/* Telefonskærme: spiller og controller. Alt skal kunne nås med én tommelfinger. */
html { font-size: 17px; }
body { overscroll-behavior: none; touch-action: manipulation; }
.screen { min-height: 100dvh; padding: max(1rem, env(safe-area-inset-top)) 1.1rem max(1rem, env(safe-area-inset-bottom)); max-width: 34rem; margin: 0 auto; }

/* ---------- join ---------- */
.join { display: flex; flex-direction: column; gap: 1.2rem; }
.join-top { display: flex; justify-content: flex-end; }
.logo { font-size: 3.4rem; font-weight: 900; line-height: .92; text-shadow: .2rem .2rem 0 var(--pink); margin: .5rem 0 .8rem; }
.join form { display: grid; gap: .45rem; }
.join label { font-weight: 700; margin-top: .5rem; }
.join input { font-size: 1.25rem; padding: .8em; }
.code-input { font: 800 2.3rem var(--display) !important; letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.btn-wide { width: 100%; font-size: 1.25rem; padding: 1em; margin-top: .4rem; }
.join-links { display: flex; flex-direction: column; gap: .9rem; margin-top: auto; padding-top: 1.5rem; font-weight: 600; }
.notice { background: var(--panel); border: .12rem solid var(--ice); border-radius: var(--r); padding: .8rem 1rem; font-weight: 600; margin: 0; }

/* ---------- spil ---------- */
.game { height: 100dvh; display: flex; flex-direction: column; gap: .7rem; overflow: hidden; }
.me { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex: none; }
.me-id { min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.me-id strong { font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-badge { align-self: flex-start; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .15em .8em; border: .14rem solid var(--tc); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-score { font: 800 2rem var(--display); font-variant-numeric: tabular-nums; flex: none; }
.status { flex: none; margin: 0; font-size: 1.12rem; font-weight: 600; min-height: 3.1em; display: flex; flex-direction: column; justify-content: center; }
.status.ok { color: var(--ok); } .status.bad { color: var(--bad); }
.status small { color: var(--text); font-size: 1em; font-weight: 800; }
.mini-clock { flex: none; height: .7rem; border-radius: 999px; background: rgba(0,0,0,.4); overflow: hidden; }
.mini-clock i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(to right, #ff4d5e, #ff3d9a 33%, #9b6bff 66%, #86e3ff); }
.mini-clock.idle { opacity: .3; }

.buzz {
  flex: 1 1 0; min-height: 40dvh; border: 0; border-radius: 2.2rem; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  background: var(--pink); color: #2a0619; box-shadow: 0 .7rem 0 #a31259; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  margin-bottom: .7rem; transition: transform .05s, box-shadow .05s, background .2s;
}
.buzz-word { font: 900 4rem var(--display); letter-spacing: .04em; }
.buzz-value { font: 700 1.6rem var(--display); min-height: 1.2em; font-variant-numeric: tabular-nums; }
.buzz:active:not(:disabled), .buzz.pressed { transform: translateY(.5rem); box-shadow: 0 .2rem 0 #a31259; }
.buzz:disabled { background: #3a2a5c; color: #7d6ca6; box-shadow: 0 .7rem 0 #241640; cursor: default; }
.buzz.mine { background: var(--ice); color: #062532; box-shadow: 0 .7rem 0 #2f8fb0; }

.board { flex: 0 1 auto; max-height: 24dvh; overflow-y: auto; font-size: .92rem; }
.game.is-final .board { max-height: none; flex: 1 1 0; }
.game.is-lobby .board { max-height: 22dvh; }
.game.is-lobby .teams { flex: 1 1 0; }
.offline-bar { position: fixed; left: 0; right: 0; top: 0; background: var(--bad); color: #36060c; font-weight: 700; text-align: center; padding: .4em; z-index: 20; }

/* ---------- hold (lobby) ---------- */
.teams { flex: 2 1 0; overflow-y: auto; background: rgba(12,7,22,.4); border-radius: 1.2rem; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; min-height: 0; }
.teams-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.teams h2 { font-size: 1.15rem; } .teams h3 { font: 700 .95rem var(--body); margin-bottom: .5rem; }
.teams p { margin: 0; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.team-list li { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; background: var(--panel); border-left: .4rem solid var(--tc); border-radius: .8rem; padding: .6rem .8rem; }
.team-list strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.team-list span { color: var(--muted); font-size: .88rem; }
.team-form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.colors { display: grid; grid-template-columns: repeat(10, 1fr); gap: .4rem; }
.colors button { aspect-ratio: 1; border-radius: 50%; border: .16rem solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.colors button[aria-pressed=true] { border-color: #fff; box-shadow: 0 0 0 .14rem var(--bg), 0 0 0 .28rem #fff; }
.colors button:disabled { opacity: .18; cursor: not-allowed; }
.leave { background: none; border: 0; color: var(--muted); font: 600 .9rem var(--body); text-decoration: underline; padding: .4rem 0; align-self: flex-start; cursor: pointer; }
.leave.armed { color: var(--bad); }

/* ---------- controller ---------- */
.ctrl { display: flex; flex-direction: column; gap: .9rem; padding-bottom: 2rem; }
.ctrl-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.ctrl-head strong { font: 700 1rem var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctrl-head .armed { background: var(--bad); border-color: var(--bad); color: #36060c; }
.ctrl-meta { color: var(--ice); font-weight: 700; margin: 0; }
.card { background: rgba(12,7,22,.4); border-radius: 1.2rem; padding: 1rem; display: grid; gap: .8rem; }
.card h2 { font-size: 1.1rem; }
.card p { margin: 0; }
.c-question { font-size: 1.25rem; font-weight: 700; }
.c-answer { background: var(--panel); border-left: .4rem solid var(--ok); border-radius: .7rem; padding: .6rem .8rem; font-size: 1.2rem; font-weight: 800; }
.c-answer small { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; }
.c-live { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.c-live b { font: 800 2.2rem var(--display); font-variant-numeric: tabular-nums; }
.c-buzz { font: 700 1.15rem var(--display); color: var(--pink); min-height: 1.3em; }
.c-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.c-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.ctrl .btn { padding: 1.05em .8em; font-size: 1.05rem; }
.ctrl .btn-huge { font-size: 1.3rem; padding: 1.4em .8em; }
.c-cats { display: grid; gap: .6rem; }
.c-cats .btn { justify-content: space-between; border-radius: 1rem; text-align: left; }
.c-cats small { color: var(--muted); font-weight: 600; }
.c-players { display: flex; flex-wrap: wrap; gap: .4rem; }
.c-result.ok { color: var(--ok); } .c-result.bad { color: var(--bad); }
.c-result { font-weight: 800; font-size: 1.15rem; }
.c-quiz { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.c-quiz select { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--panel); border: .12rem solid var(--tc, var(--line)); border-radius: 999px; padding: .3rem .4rem .3rem .8rem; font-weight: 700; }
.chip.is-offline { opacity: .45; }
.chip button { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer; }
.pin-input { font: 800 2rem var(--display) !important; letter-spacing: .3em; text-align: center; }

/* ---------- rundeopsummering (controller) og krone ---------- */
.me-id strong .crown { width: 1.1em; }
.c-recap { list-style: none; margin: .4rem 0 .9rem; padding: 0; display: grid; gap: .35rem; }
.c-recap li { display: grid; grid-template-columns: minmax(0, 1fr) auto 4.2rem; gap: .6rem; align-items: center; background: rgba(255,255,255,.05); border-radius: .7rem; padding: .5rem .7rem; }
.c-recap li span:first-child { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-recap li b { font-size: .9rem; color: var(--muted); }
.c-recap li b.ok { color: var(--ok); } .c-recap li b.bad { color: var(--bad); }
.c-recap li span:last-child { text-align: right; font: 800 .95rem var(--display); }
.c-turn { margin: .2rem 0 .8rem; font-size: 1.15rem; font-weight: 600; } .c-turn b { color: var(--pink); }
.join-me { margin: -.4rem 0 0; color: var(--ok); font-weight: 600; }
.c-per-round { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-weight: 600; margin: .4rem 0 0; }
.c-per-round select { width: auto; }
.c-per-round-hint { margin: .3rem 0 .6rem; font-size: .9rem; }
.c-per-round-hint.warn { color: var(--bad); }
