/* Címlapok: "Na ki vagyok?" (assets/js/nakivagyok.js), the phone-first game screens inside .jt-stage.
   Centred on desktop; while playing, the scoreboard sits in a column next to the game on wide screens. */
.nk{--nk-red:#e0483a; --nk-red-dark:#8f1d13; --nk-ok:#2d8a4e}
.nk-head{position:relative; display:flex; align-items:center; justify-content:center; max-width:920px; margin:10px auto}
.nk-head .jt-back{position:absolute; left:0; margin:0}
.nk-head h1{margin:0; font:600 22px/1.2 var(--serif)}
.nk .jt-stage{max-width:560px; margin:0 auto; padding:18px; border-radius:20px; box-shadow:0 10px 30px rgba(0,0,0,.06)}
.nk .jt-stage[data-phase="clue"], .nk .jt-stage[data-phase="reveal"], .nk .jt-stage[data-phase="ready"]{max-width:920px}
.nk-card{display:flex; flex-direction:column; gap:14px}
.nk-lead{margin:0; color:var(--muted); font-size:15px; line-height:1.55; text-align:center}
.nk-hero{font-size:56px; text-align:center; line-height:1}
.nk-label{margin:0; font:500 12px var(--mono); text-transform:uppercase; letter-spacing:.06em; color:var(--muted)}
.nk-hint{margin:0; color:var(--muted); font-size:13px}
.nk-input{width:100%; box-sizing:border-box; padding:13px 15px; font:500 18px var(--sans); color:var(--ink);
  background:var(--bg); border:2px solid var(--line); border-radius:12px; transition:border-color .15s}
.nk-input:focus{outline:none; border-color:var(--accent)}
/* buttons */
.nk-btn{display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:12px 18px; border-radius:12px; cursor:pointer;
  font:600 16px var(--sans); color:var(--ink); background:var(--surface); border:2px solid var(--line);
  box-shadow:0 3px 0 var(--line); transition:transform .08s, box-shadow .08s, background .15s; touch-action:manipulation}
.nk-btn:hover{border-color:var(--muted)}
.nk-btn:active{transform:translateY(2px); box-shadow:0 1px 0 var(--line)}
.nk-btn.primary{color:#fff; background:linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent));
  border-color:color-mix(in srgb, var(--accent) 70%, #000); box-shadow:0 4px 0 color-mix(in srgb, var(--accent) 55%, #000)}
.nk-btn.primary:active{box-shadow:0 1px 0 color-mix(in srgb, var(--accent) 55%, #000)}
.nk-btn.big{width:100%; padding:16px 18px; font-size:18px}
.nk-btn.small{padding:7px 12px; font-size:14px; border-radius:10px; box-shadow:0 2px 0 var(--line)}
.nk-btn.yes{flex:1; color:#fff; background:var(--nk-ok); border-color:#1f6538; box-shadow:0 4px 0 #1f6538}
.nk-btn.no{flex:1; color:#fff; background:var(--nk-red); border-color:var(--nk-red-dark); box-shadow:0 4px 0 var(--nk-red-dark)}
.nk-start > .nk-btn.primary{padding:16px; font-size:18px}
.nk-actions{display:flex; gap:10px; flex-wrap:wrap}
.nk-or{display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px}
.nk-or::before, .nk-or::after{content:""; flex:1; border-top:1px solid var(--line)}
.nk-join{display:flex; gap:10px}
.nk-code-in{max-width:130px; text-transform:uppercase; letter-spacing:.25em; text-align:center; font-family:var(--mono)}
.nk-join .nk-btn{flex:1}
.nk-error{margin:0 0 12px; padding:10px 12px; border-radius:10px; background:color-mix(in srgb, var(--bad) 15%, transparent); color:var(--ink)}
.nk-conn{max-width:560px; margin:10px auto 0; padding:8px 12px; border-radius:10px; background:color-mix(in srgb, var(--accent) 12%, transparent); font-size:14px; text-align:center}
.linklike{border:0; background:none; padding:4px; color:var(--muted); text-decoration:underline; cursor:pointer; font:inherit; font-size:14px}
/* avatars */
.nk-av{display:inline-flex; align-items:center; justify-content:center; flex:none; width:36px; height:36px; border-radius:50%;
  font-size:20px; line-height:1; background:color-mix(in srgb, var(--av) 28%, var(--surface)); box-shadow:inset 0 0 0 2px var(--av)}
.nk-av.sm{width:26px; height:26px; font-size:14px}
.nk-av.lg{width:64px; height:64px; font-size:36px; box-shadow:inset 0 0 0 3px var(--av)}
/* lobby */
.nk-room{display:flex; gap:18px; align-items:center; justify-content:space-between; flex-wrap:wrap; padding:14px; border-radius:16px; background:var(--bg)}
.nk-room-info{flex:1; min-width:180px; display:flex; flex-direction:column; gap:6px}
.nk-code{margin:0; font:600 46px/1 var(--mono); letter-spacing:.15em}
.nk-qr{width:170px; padding:8px; background:#fff; border-radius:12px; flex:none; margin-inline:auto}
.nk-qr svg{display:block; width:100%; height:auto}
.nk-h{margin:6px 0 0; font:600 18px/1.2 var(--serif)}
.nk-wait{display:flex; align-items:center; justify-content:center; gap:10px; margin:0; padding:16px; text-align:center; color:var(--muted); background:var(--bg); border-radius:14px}
.nk-secs{font:600 20px var(--mono); color:var(--ink)}
/* players / scoreboard */
.nk-players{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px}
.nk-players li{display:flex; align-items:center; gap:10px; padding:7px 10px; border-radius:12px; background:var(--bg)}
.nk-players li.me{box-shadow:inset 0 0 0 2px var(--accent)}
.nk-players li.off{opacity:.45}
.nk-players.grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr))}
.nk-players.compact li{padding:5px 8px}
.nk-players.compact .nk-av{width:30px; height:30px; font-size:17px}
.nk-rank{min-width:1.6em; font:500 13px var(--mono); color:var(--muted)}
.nk-pname{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.nk-score{font:600 16px var(--mono)}
/* game: on wide screens the scoreboard is a column on the right */
.nk-game{display:grid; grid-template-columns:1fr; gap:14px}
.nk-side{display:flex; flex-direction:column; gap:8px}
@media (min-width:860px){
  .nk-game{grid-template-columns:minmax(0, 1fr) 260px; grid-template-rows:auto auto 1fr; column-gap:24px; align-items:start}
  .nk-game > .nk-top{grid-column:1 / -1}
  .nk-game > .nk-play, .nk-game > .nk-reveal, .nk-game > .nk-ready{grid-column:1; grid-row:2 / 4}
  .nk-action{grid-column:2; grid-row:2}
  .nk-side{grid-column:2; grid-row:3; padding-left:20px; border-left:1px solid var(--line)}
  .nk-action + .nk-side{padding-top:4px}
  .nk-side .nk-h{margin-top:0}
  .nk-action .nk-buzz{width:170px; height:170px}
  .nk-clues li{padding:9px 14px}
}
.nk-top{display:flex; justify-content:space-between; align-items:center; font:500 13px var(--mono); color:var(--muted)}
.nk-tier{padding:4px 10px; border-radius:999px; color:#fff; font-weight:600}
.nk-tier.t1{background:#2d8a4e} .nk-tier.t2{background:#c77d12} .nk-tier.t3{background:#c23b2e}
.nk-pts{min-width:7em; text-align:right}
.nk-play, .nk-reveal{display:flex; flex-direction:column; gap:14px}
.nk-clues{margin:0; padding:0; list-style:none; counter-reset:clue; display:flex; flex-direction:column; gap:8px}
.nk-clues li{counter-increment:clue; display:flex; gap:10px; padding:11px 14px; border-radius:12px; background:var(--bg); font:500 18px/1.4 var(--serif)}
.nk-clues li::before{content:counter(clue); flex:none; width:24px; height:24px; border-radius:50%; background:var(--ink); color:var(--bg);
  font:600 13px/24px var(--mono); text-align:center; margin-top:1px}
.nk-clues li.new{animation:nk-in .5s ease-out; background:color-mix(in srgb, var(--accent) 12%, var(--bg))}
@keyframes nk-in{from{opacity:0; transform:translateY(8px) scale(.98)} to{opacity:1; transform:none}}
/* the next clue: only in its last 3 seconds, over the points in the top bar */
.nk-pts{position:relative}
.nk-soon{position:absolute; right:0; top:50%; transform:translateY(-50%); padding:3px 9px; border-radius:999px; white-space:nowrap;
  background:var(--accent); color:var(--accent-ink); font:600 13px var(--mono); opacity:0; pointer-events:none; transition:opacity .2s}
.nk-soon.on{opacity:1}
.nk-wrongs{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; font-size:15px}
.nk-wrongs li{display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:6px 10px; border-radius:10px; background:color-mix(in srgb, var(--bad) 10%, transparent)}
.nk-wrongs li > span:not(.nk-av){flex:1}
.nk-wrongs em{font-style:normal; font-weight:600; color:var(--bad)}
.nk-wrongs li.accepted{background:color-mix(in srgb, var(--nk-ok) 14%, transparent)}
.nk-wrongs em.ok{color:var(--nk-ok)}
/* the buzz button: big, round, 3D; when locked, a ring shows the seconds left */
.nk-buzz-wrap{display:flex; justify-content:center; padding:6px 0 4px}
.nk-buzz{position:relative; width:190px; height:190px; border-radius:50%; border:0; padding:0; cursor:pointer; touch-action:manipulation;
  background:var(--nk-red-dark); box-shadow:0 10px 24px rgba(160, 30, 20, .35); -webkit-tap-highlight-color:transparent}
.nk-buzz-face{position:absolute; inset:0 0 12px; display:flex; flex-direction:column; align-items:center; justify-content:center; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #ff8a7a, var(--nk-red) 55%, #b8261a); color:#fff; font:700 32px var(--sans);
  text-shadow:0 2px 0 rgba(0,0,0,.25); transition:transform .07s}
.nk-buzz:not(.locked):hover .nk-buzz-face{filter:brightness(1.05)}
.nk-buzz:active .nk-buzz-face{transform:translateY(9px)}
.nk-buzz:not(.locked){animation:nk-pulse 2s ease-in-out infinite}
@keyframes nk-pulse{0%, 100%{box-shadow:0 10px 24px rgba(160, 30, 20, .35), 0 0 0 0 rgba(224, 72, 58, .35)} 50%{box-shadow:0 10px 24px rgba(160, 30, 20, .35), 0 0 0 14px rgba(224, 72, 58, 0)}}
.nk-buzz.locked{cursor:default; background:conic-gradient(var(--muted) calc(var(--p, 1) * 360deg), var(--line) 0); box-shadow:none; padding:0}
.nk-buzz.locked .nk-buzz-face{inset:8px; background:var(--surface); color:var(--muted); text-shadow:none; font-size:15px; font-weight:500}
.nk-buzz.locked .nk-buzz-face b{font:600 44px/1 var(--mono); color:var(--ink)}
.nk-answering{display:flex; flex-direction:column; gap:10px; padding:14px; border-radius:16px; background:color-mix(in srgb, var(--accent) 10%, transparent)}
.nk-answering .nk-label{display:flex; justify-content:space-between; align-items:center}
.nk-other .nk-secs{margin-left:auto}
/* 3-2-1 */
.nk-ready{display:flex; flex-direction:column; align-items:center; gap:4px; padding:30px 10px; text-align:center}
.nk-ready-n{margin:0; font:700 110px/1 var(--mono); color:var(--accent); animation:nk-tick 1s ease-out infinite}
@keyframes nk-tick{from{transform:scale(1.15); opacity:.6} to{transform:scale(1); opacity:1}}
.nk-ready-sub{margin:0; color:var(--muted)}
/* reveal */
.nk-reveal{text-align:center}
/* photo and name side by side, so the reveal fits on one screen */
.nk-reveal-main{display:flex; gap:16px; align-items:center; text-align:left}
.nk-reveal-main .nk-reveal-text{flex:1; min-width:0}
.nk-photo{margin:0; flex:none; width:180px; display:flex; flex-direction:column; gap:4px; animation:nk-in .5s ease-out}
.nk-photo img{width:180px; height:225px; object-fit:cover; object-position:50% 20%; border-radius:16px; background:var(--line); box-shadow:0 8px 20px rgba(0,0,0,.15)}
.nk-photo figcaption{font-size:11px; line-height:1.3}
.nk-photo figcaption a{color:var(--muted)}
.nk-photo.none{width:120px; height:120px; border-radius:50%; align-items:center; justify-content:center; background:var(--line); font:600 48px var(--serif); color:var(--muted)}
.nk-reveal-text{display:flex; flex-direction:column; gap:4px}
.nk-answer{margin:0; font:600 30px/1.2 var(--serif)}
.nk-info{margin:0; color:var(--muted); font-size:15px}
.nk-reveal .nk-wrongs{text-align:left}
.nk-next{margin:0; color:var(--muted); font-size:14px}
.nk-next b{font-family:var(--mono); color:var(--ink)}
/* challenge vote */
.nk-challenge{display:flex; flex-direction:column; gap:10px; padding:14px; border-radius:16px; text-align:left;
  background:color-mix(in srgb, #f4b400 16%, var(--surface)); border:2px solid color-mix(in srgb, #f4b400 60%, transparent)}
.nk-ch-q{display:flex; gap:10px; align-items:flex-start; margin:0; font-size:16px; line-height:1.45}
.nk-ch-count{margin:0; font:500 14px var(--mono); text-align:center}
/* end of round */
.nk-end{text-align:center}
.nk-podium{display:flex; justify-content:center; align-items:flex-end; gap:10px; margin:6px 0}
.nk-pod{display:flex; flex-direction:column; align-items:center; gap:4px; width:31%; max-width:150px}
.nk-pod b{max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.nk-pod span{font:500 13px var(--mono); color:var(--muted)}
.nk-pod-bar{width:100%; border-radius:10px 10px 0 0; display:flex; align-items:center; justify-content:center; font:700 22px var(--mono); color:#fff}
.nk-pod.p1 .nk-pod-bar{height:110px; background:linear-gradient(#f6c945, #d4a017)}
.nk-pod.p2 .nk-pod-bar{height:80px; background:linear-gradient(#c9d1d9, #8f9aa5)}
.nk-pod.p3 .nk-pod-bar{height:60px; background:linear-gradient(#e0a070, #b06a35)}
.nk-end .nk-players{text-align:left}
.nk-leave{margin:0}
/* phones: everything on one screen – the scoreboard becomes a strip of chips above the clues, smaller pieces */
@media (max-width:859px){
  .nk-head{margin:6px auto}
  .nk-head h1{font-size:19px}
  .nk .jt-stage{padding:12px; border-radius:16px}
  .nk-card{gap:10px}
  .nk-game{gap:10px}
  .nk-side{order:1}
  .nk-play, .nk-reveal, .nk-ready{order:2}
  .nk-action{order:3}
  .nk-side .nk-h{display:none}
  .nk-side .nk-players{flex-direction:row; overflow-x:auto; gap:6px; scrollbar-width:none}
  .nk-side .nk-players::-webkit-scrollbar{display:none}
  .nk-side .nk-players li{flex:none; gap:6px; padding:3px 10px 3px 3px; border-radius:999px}
  .nk-side .nk-rank{display:none}
  .nk-side .nk-pname{max-width:72px; font-size:13px}
  .nk-side .nk-score{font-size:14px}
  .nk-side .nk-players.compact .nk-av{width:26px; height:26px; font-size:15px}
  .nk-play, .nk-reveal{gap:10px}
  .nk-clues{gap:5px}
  .nk-clues li{padding:6px 10px; font-size:15px; line-height:1.35; border-radius:10px}
  .nk-clues li::before{width:20px; height:20px; font-size:11px; line-height:20px}
  .nk-wrongs{font-size:14px; gap:4px}
  .nk-wrongs li{padding:4px 8px}
  .nk-buzz-wrap{padding:0}
  .nk-buzz{width:132px; height:132px}
  .nk-hint{font-size:12px}
  .nk-next{font-size:13px}
  .nk-buzz-face{font-size:26px; inset:0 0 9px}
  .nk-buzz.locked .nk-buzz-face b{font-size:36px}
  .nk-ready{padding:12px 6px}
  .nk-ready-n{font-size:84px}
  .nk-photo{width:110px}
  .nk-photo img{width:110px; height:138px; border-radius:12px}
  .nk-photo figcaption{font-size:9px}
  .nk-photo.none{width:90px; height:90px; font-size:34px}
  .nk-answer{font-size:23px}
  .nk-info{font-size:14px}
  .nk-challenge{padding:10px; gap:8px}
  .nk-ch-q{font-size:15px}
  .nk-challenge .nk-btn.yes, .nk-challenge .nk-btn.no{padding:10px 12px}
  .nk-challenge .nk-hint{text-align:center}
  .nk-room{padding:10px; gap:12px}
  .nk-code{font-size:36px}
  .nk-qr{width:130px}
  .nk-hero{font-size:40px}
  .nk-podium .nk-av.lg{width:48px; height:48px; font-size:26px}
  .nk-pod.p1 .nk-pod-bar{height:80px} .nk-pod.p2 .nk-pod-bar{height:58px} .nk-pod.p3 .nk-pod-bar{height:42px}
}
@media (prefers-reduced-motion: reduce){
  .nk-clues li.new, .nk-photo, .nk-ready-n, .nk-buzz:not(.locked){animation:none}
}
/* sound on/off, top right of the game box */
.nk .jt-stage{position:relative}
.nk-mute{position:absolute; top:8px; right:8px; z-index:2; display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; padding:0; border:0; border-radius:10px; color:var(--muted); cursor:pointer;
  background:color-mix(in srgb, var(--surface) 85%, transparent)}   /* flat; readable also over the start screen's picture */
.nk-mute svg{width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round}
.nk-mute:hover{color:var(--ink); background:color-mix(in srgb, var(--ink) 7%, transparent)}
.nk-mute[aria-pressed="true"]{color:var(--bad)}
.nk-top{padding-right:44px}
.nk-alone{display:flex; flex-direction:column; gap:8px; text-align:left}
.nk-btn:disabled{opacity:.55; cursor:not-allowed; transform:none}
/* "are you sure you want to leave?" */
.nk-dialog{max-width:min(380px, calc(100vw - 32px)); padding:20px; border:0; border-radius:18px; background:var(--surface); color:var(--ink);
  box-shadow:0 20px 50px rgba(0,0,0,.3)}
.nk-dialog::backdrop{background:rgba(0,0,0,.5)}
.nk-dlg-t{margin:0 0 8px; font:600 20px/1.25 var(--serif)}
.nk-dlg-x{margin:0 0 16px; color:var(--muted); font-size:15px; line-height:1.45}
.nk-dialog .nk-actions .nk-btn{flex:1}
.nk-photo.none.emoji{font:400 64px/1 sans-serif; background:color-mix(in srgb, var(--accent) 12%, var(--bg))}
@media (max-width:859px){ .nk-photo.none.emoji{font-size:46px} }
/* ---------- one screen: the game box never grows past the screen (its height comes from fit() in the script);
   the parts that can grow – clues, the reveal, player lists – scroll inside it, and the buttons stay in view ---------- */
.nk .jt-stage{max-height:var(--nk-h, none); box-sizing:border-box; display:flex; flex-direction:column; overflow:hidden}
.nk .jt-stage[data-phase="clue"], .nk .jt-stage[data-phase="reveal"], .nk .jt-stage[data-phase="ready"]{height:var(--nk-h, auto)}
.nk .jt-stage > .nk-error{flex:none}
.nk .jt-stage > .nk-card{flex:1 1 auto; min-height:0}
.nk-start, .nk-lobby, .nk-end{overflow-y:auto}
.nk-hero{display:block; width:100%; height:auto; max-height:26vh; object-fit:cover; border-radius:14px; flex:none}
.nk-lobby .nk-room, .nk-end .nk-podium, .nk-alone{flex:none}
.nk-lobby .nk-players, .nk-end .nk-players{flex:0 1 auto; min-height:52px; overflow-y:auto; align-content:start}
.nk-lobby > .nk-btn, .nk-lobby > .nk-wait, .nk-end > .nk-btn, .nk-end > .nk-wait, .nk-end > .nk-leave{flex:none}
.nk-game{min-height:0}
.nk-play, .nk-reveal, .nk-ready{min-height:0; overflow-y:auto; overscroll-behavior:contain}
.nk-ready{justify-content:center}
.nk-action{flex:none}
@media (max-width:859px){
  .nk-game{display:flex; flex-direction:column}
  .nk-game > .nk-top, .nk-side{flex:none}
  .nk-play, .nk-reveal, .nk-ready{flex:1 1 auto}
}
@media (min-width:860px){
  .nk-game{height:100%; grid-template-rows:auto auto minmax(0, 1fr); align-items:stretch}
  .nk-action{align-self:start}
  .nk-side{min-height:0; overflow-y:auto; align-self:stretch}
}
