* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg1: #1a1040; --bg2: #2d1b69;
  --card: rgba(255,255,255,.08);
  --a0: #e21b3c; --a1: #1368ce; --a2: #d89e00; --a3: #26890c;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  color: #fff; min-height: 100dvh;
  display: flex; flex-direction: column;
}
#app { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; gap: 18px; width: 100%; max-width: 900px; margin: 0 auto; text-align: center; }

h1 { font-size: clamp(2.2rem, 8vw, 4rem); letter-spacing: -1px; }
h1 .q { display: inline-block; animation: bounce 2.2s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-10px) rotate(6deg); } }
h2 { font-size: clamp(1.3rem, 5vw, 2rem); }
.sub { opacity: .75; font-size: 1.05rem; max-width: 34em; }

button {
  font: inherit; border: none; border-radius: 14px; cursor: pointer;
  padding: 16px 28px; font-size: 1.15rem; font-weight: 700; color: #fff;
  background: #7b2ff7; box-shadow: 0 4px 0 rgba(0,0,0,.35);
  transition: transform .08s, filter .15s;
}
button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
button:disabled { opacity: .4; cursor: default; }
button.ghost { background: var(--card); font-weight: 600; }
button.small { font-size: .95rem; padding: 10px 18px; box-shadow: none; }
.scorerow small { opacity: .6; font-weight: 400; }

input {
  font: inherit; font-size: 1.3rem; padding: 14px 18px; border-radius: 14px;
  border: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: #fff;
  text-align: center; width: min(320px, 80vw); outline: none;
}
input:focus { border-color: #a78bfa; }
input.code { text-transform: uppercase; letter-spacing: .4em; font-weight: 800; }

.card { background: var(--card); border-radius: 20px; padding: 22px; width: 100%; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Målvalg */
.targets { display: flex; gap: 14px; }
.targets button { min-width: 90px; font-size: 1.5rem; background: var(--card); }
.targets button.sel { background: #7b2ff7; }

/* Spiltype */
.modes { display: flex; gap: 10px; }
.modes button {
  flex: 1; background: var(--card); font-size: 1.05rem; padding: 14px 10px;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  border: 2px solid transparent; box-shadow: none;
}
.modes button small { font-size: .78rem; font-weight: 400; opacity: .7; line-height: 1.3; }
.modes button.sel { background: rgba(123,47,247,.35); border-color: #a78bfa; }

/* Lobby */
.code-big { font-size: clamp(2.5rem, 10vw, 4.5rem); font-weight: 900; letter-spacing: .3em; text-indent: .3em; }
#qr { background: #fff; padding: 14px; border-radius: 18px; display: inline-block; line-height: 0; }
#qr svg { width: min(46vw, 300px); height: min(46vw, 300px); }
.players { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip { background: var(--card); border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 1.1rem; }
.chip.off { opacity: .45; }

/* Scoreboard */
.scores { display: flex; flex-direction: column; gap: 8px; width: min(480px, 100%); margin: 0 auto; }
.scorerow { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 10px 16px; font-size: 1.15rem; }
.scorerow .nm { flex: 1; text-align: left; font-weight: 700; }
.scorerow .pts { font-weight: 900; font-size: 1.3rem; }
.scorerow.win { background: rgba(255,200,0,.25); outline: 2px solid #ffc800; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.2); }
.dots i.on { background: #ffc800; }

/* Kategorivalg */
.cats { display: flex; flex-direction: column; gap: 14px; width: min(440px, 100%); }
.cats button { font-size: 1.35rem; padding: 20px; background: var(--card); }
.cats button:hover { filter: brightness(1.3); }

/* Spørgsmål */
.qtext { font-size: clamp(1.3rem, 4.5vw, 2.1rem); font-weight: 800; line-height: 1.3; }
.catline { opacity: .8; font-weight: 700; font-size: 1.1rem; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
@media (max-width: 520px) { .opts { grid-template-columns: 1fr; } }
.opts button {
  padding: 22px 16px; font-size: 1.15rem; border-radius: 16px; text-align: left;
  display: flex; align-items: center; gap: 12px; min-height: 76px;
}
.opts .shape { font-size: 1.3rem; flex-shrink: 0; }
.o0 { background: var(--a0); } .o1 { background: var(--a1); }
.o2 { background: var(--a2); } .o3 { background: var(--a3); }
.opts button.dim { opacity: .28; }
.opts button.correct { outline: 4px solid #fff; box-shadow: 0 0 24px rgba(255,255,255,.6); }
.opts button.mine::after { content: '👆'; margin-left: auto; font-size: 1.4rem; }

/* Nedtælling */
.timerbar { width: 100%; height: 12px; background: rgba(0,0,0,.3); border-radius: 999px; overflow: hidden; }
.timerbar i { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #fbbf24, #ef4444); border-radius: 999px; transition: width .2s linear; }
.timernum { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.timernum.low { color: #ff5470; animation: pulse .5s infinite; }
@keyframes pulse { 50% { transform: scale(1.15); } }

.big-emoji { font-size: clamp(3.5rem, 14vw, 6rem); }
.flash { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #e21b3c; padding: 12px 22px; border-radius: 12px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 10; animation: pop .3s ease; max-width: 90vw; }

.footer { opacity: .5; font-size: .85rem; padding-bottom: 8px; }
.waitpulse { animation: fade 1.4s ease-in-out infinite; }
@keyframes fade { 50% { opacity: .45; } }

/* Konfetti */
.confetti { position: fixed; top: -20px; font-size: 1.6rem; z-index: 5; pointer-events: none; animation: drop linear forwards; }
@keyframes drop { to { transform: translateY(110vh) rotate(720deg); } }
