/* Telefonra tervezve (ez az alap), nagyobb képernyőn a végén lévő @media bővít.
   Színek csak tokenekből (:root) – a sötét mód ezeket írja felül. */
:root {
  /* Márka */
  --brand: #6d3df5;          /* fő lila (gombok, kiemelés) */
  --brand-2: #a855f7;        /* átmenet második színe */
  --brand-ink: #3b1d8f;      /* sötét lila (szöveg, fejléc) */
  --accent: #ffb020;         /* sárga (szobakód, jelölés) */
  --pink: #ff5d8f;
  --grad: linear-gradient(135deg, #6d3df5 0%, #a855f7 55%, #ff5d8f 100%);
  --grad-head: linear-gradient(120deg, #2e1675 0%, #5b2ee0 55%, #8b4cf0 100%);
  /* Felületek */
  --bg: #f5f3fb;
  --surface: #ffffff;
  --surface-2: #f4f1fb;      /* kártyán belüli sávok, listaelemek */
  --surface-3: #ebe6f8;
  --text: #1b1530;
  --muted: #6c6584;
  --line: #e7e2f3;
  --sel-bg: #efe8ff;
  --good: #15a34a;
  --good-bg: #e6f8ee;
  --bad: #e11d48;
  --bad-bg: #fdecf0;
  --warn-bg: #fff5dc;
  --warn-line: #ffd479;
  --danger: #dc2645;
  --on-accent: #2a1d00;
  /* Jég (Villámkvíz-csapda) */
  --ice: #2f8fd6;
  --ice-bg: rgba(214, 240, 255, .72);
  --ice-edge: rgba(120, 190, 240, .95);
  --ice-crack: rgba(255, 255, 255, .95);
  --ice-ink: #0d4f86;
  --slime: #65c43a;
  --slime-edge: #3f8f1c;
  --fog: #d9dee6;
  --fog-light: #f4f6f9;
  /* Villámkvíz ajtók (kategóriaválasztás) – a válaszbetűk színeivel */
  --team-0: linear-gradient(160deg, #8a63ff, #5b2ee0);
  --team-1: linear-gradient(160deg, #2dd4bf, #0d8f88);
  --team-2: linear-gradient(160deg, #ffb75e, #f07a12);
  --team-3: linear-gradient(160deg, #ff7aa5, #d6336c);
  --door-frame: #4a3a7a;
  --door-light: #fff3b0;
  --god-grad: linear-gradient(135deg, #ffe066, #ffb020 55%, #ff7a1a); /* Isteni döntés (arany) */
  --god-ink: #5a3300;
  --shadow-sm: 0 1px 2px rgba(40, 20, 90, .06), 0 1px 3px rgba(40, 20, 90, .05);
  --shadow: 0 1px 2px rgba(40, 20, 90, .05), 0 8px 24px -6px rgba(60, 30, 140, .14);
  --shadow-lg: 0 20px 50px -12px rgba(50, 20, 120, .35);
  --glow: 0 6px 18px -4px rgba(109, 61, 245, .55);
  --radius: 22px;
  --radius-sm: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* Régi nevek (a szkriptek / régebbi szabályok miatt) */
  --purple: var(--brand-ink);
  --purple-2: var(--brand);
  --yellow: var(--accent);
  --card: var(--surface);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #9b7bff;
    --brand-2: #c084fc;
    --brand-ink: #d9ccff;
    --bg: #0e0b18;
    --surface: #18142a;
    --surface-2: #211b36;
    --surface-3: #2b2445;
    --text: #efeafd;
    --muted: #a49cbf;
    --line: #2f2849;
    --sel-bg: #2c2155;
    --good: #34d17a;
    --good-bg: #123123;
    --bad: #ff5c7c;
    --bad-bg: #3a1424;
    --warn-bg: #33270c;
    --warn-line: #6b5216;
    --ice: #7cc7ff;
    --ice-bg: rgba(120, 180, 230, .55);
    --ice-edge: rgba(150, 210, 255, .8);
    --ice-ink: #e6f5ff;
    --slime: #7ddc4e;
    --slime-edge: #4fae25;
    --fog: #3b4250;
    --fog-light: #5a6372;
    --danger: #e5385a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -8px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
/* touch-action: manipulation – nincs dupla koppintásos nagyítás (iPhone-on a gyors koppintásoknál, pl. a jégnél, ki-be zoomolt),
   de a két ujjas nagyítás megmarad */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  color: var(--text); line-height: 1.5; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(48rem 32rem at 110% -8%, rgba(168, 85, 247, .16), transparent 62%),
    radial-gradient(40rem 30rem at -15% 18%, rgba(255, 176, 32, .12), transparent 60%),
    radial-gradient(40rem 34rem at 50% 115%, rgba(255, 93, 143, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body.has-host-bar { padding-bottom: calc(80px + var(--safe-b)); }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: 1.45rem; margin: 0 0 .45rem; font-weight: 800; }
h2 { font-size: 1.12rem; margin: 1.1rem 0 .55rem; font-weight: 750; }
h3 { margin: .6rem 0 .4rem; }
.muted { color: var(--muted); }
.small-text { font-size: .85rem; }
.center { text-align: center; }
.center-row { justify-content: center; }
.ok-text { color: var(--good); font-weight: 700; }
.grow { flex: 1; min-width: 0; }
::selection { background: rgba(109, 61, 245, .25); }

/* ---------- Fejléc: telefonon egy sor – logó + ikonos menü ---------- */
.topbar {
  background: var(--grad-head); color: #fff; display: flex; align-items: center; gap: .5rem;
  padding: .35rem .5rem; padding-top: max(.35rem, env(safe-area-inset-top)); position: sticky; top: 0; z-index: 20;
  box-shadow: 0 6px 24px -10px rgba(46, 22, 117, .7);
}
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 800; flex: none; letter-spacing: -.01em; }
.brand img { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25)); }
.brand span { display: none; }
#nav { display: flex; gap: .15rem; margin-left: auto; min-width: 0; }
#nav a {
  color: #fff; text-decoration: none; border-radius: 14px; opacity: .82; transition: background .15s, opacity .15s;
  display: flex; flex-direction: column; align-items: center; padding: .25rem .45rem; min-width: 56px; max-width: 96px;
}
#nav a:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
#nav a.active { background: rgba(255, 255, 255, .2); opacity: 1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
#nav .ico { font-size: 1.15rem; line-height: 1.25; position: relative; display: flex; align-items: center; justify-content: center; min-height: 1.45rem; }
#nav .lbl { font-size: .68rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.badge { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 .38rem; font-size: .7rem; font-weight: 800; }
#nav .badge { position: absolute; top: -5px; right: -14px; box-shadow: 0 0 0 2px #4a23c4; }

main { width: 100%; max-width: 1040px; margin: 0 auto; padding: .75rem; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 1rem 1rem calc(1.2rem + var(--safe-b)); opacity: .85; }
/* „📖 Játékleírás” (PDF) a verziószám fölött – kis gomb, telefonon is kényelmesen eltalálható */
.guide-link { display: flex; align-items: center; justify-content: center; width: max-content; min-height: 40px; margin: 0 auto .45rem;
  padding: .35rem 1rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--brand);
  font-weight: 700; font-size: .9rem; text-decoration: none; box-shadow: var(--shadow-sm); }
.guide-link[hidden] { display: none; }
.guide-link:active { transform: scale(.97); }

/* ---------- Kártyák ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); padding: 1.1rem; margin-bottom: .85rem;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  animation: rise .28s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.card > h2:first-child, .card > h1:first-child { margin-top: 0; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.center-card { text-align: center; }
.center-card .form { text-align: left; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.head-row h1, .head-row h2 { margin: 0; }

/* Főoldali üdvözlő sáv: színes átmenet */
.hero {
  display: flex; flex-direction: column; gap: .7rem; align-items: center; text-align: center;
  background: var(--grad); color: #fff; border: 0; position: relative; overflow: hidden;
  box-shadow: 0 18px 40px -16px rgba(109, 61, 245, .65);
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 70%);
}
.hero::before { width: 260px; height: 260px; top: -110px; right: -70px; }
.hero::after { width: 200px; height: 200px; bottom: -110px; left: -60px; background: radial-gradient(circle, rgba(255, 196, 80, .35), transparent 70%); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 1.6rem; }
.hero .muted { color: rgba(255, 255, 255, .86); }
.hero a { color: #fff; font-weight: 700; }
.hero-logo { width: 68px; height: 68px; padding: 6px; border-radius: 22px; background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.hero .join-code input { background: rgba(255, 255, 255, .95); border-color: transparent; color: #1b1530; }
.hero .join-code input::placeholder { color: #8a83a3; }
.hero .join-code .btn { background: #fff; color: #5b2ee0; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35); }
.hero .realm-line {
  background: rgba(255, 255, 255, .16); padding: .3rem .8rem; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  font-size: .9rem; justify-content: center; column-gap: .35rem; row-gap: .1rem;
}
.card:not(.hero) .hero-logo { background: var(--sel-bg); box-shadow: none; }

/* ---------- Gombok – telefonon elég nagy érintési felület ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #7446f7, #9a52f2); color: #fff; padding: .65rem 1.05rem; min-height: 44px;
  border-radius: 14px; font: inherit; font-weight: 700; letter-spacing: .005em;
  text-decoration: none; white-space: nowrap; touch-action: manipulation; box-shadow: var(--glow);
  transition: transform .12s, filter .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.07); box-shadow: 0 8px 22px -4px rgba(109, 61, 245, .6); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .opt:focus-visible, .qopt:focus-visible, .realm-card:focus-visible { outline: 3px solid rgba(109, 61, 245, .45); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn.ghost { background: var(--surface); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow-sm); }
.btn.ghost:hover { background: var(--sel-bg); box-shadow: inset 0 0 0 1.5px rgba(109, 61, 245, .35); filter: none; }
.btn.danger { background: linear-gradient(135deg, #ef3f5f, #d81f44); box-shadow: 0 6px 16px -6px rgba(220, 38, 69, .6); }
.btn.small { padding: .35rem .75rem; min-height: 36px; font-size: .85rem; border-radius: 12px; }
.btn.big { padding: .85rem 1.4rem; font-size: 1.1rem; border-radius: 16px; }
.btn.wide { width: 100%; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: .35rem .5rem; min-width: 36px; min-height: 36px; border-radius: 10px; color: inherit; }
.icon-btn:hover { background: var(--surface-3); }
.row-btns { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }

/* ---------- Űrlapok – 16 px betű, hogy az iPhone ne nagyítson bele fókuszkor ---------- */
.form { display: flex; flex-direction: column; gap: .35rem; margin: .6rem 0; }
.form label { font-weight: 700; font-size: .92rem; margin-top: .45rem; }
.form label.check { font-weight: 500; font-size: 1rem; display: flex; gap: .55rem; align-items: center; min-height: 38px; }
input, select, textarea {
  font: inherit; font-size: 16px; padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--surface-2); color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px rgba(109, 61, 245, .16); }
input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--brand); padding: 0; }
input[type=search] { border-radius: 999px; padding-left: 1rem; }
.hint { color: var(--muted); font-size: .85rem; }
.form-error { color: var(--bad); font-weight: 700; margin: .3rem 0; background: var(--bad-bg); padding: .5rem .7rem; border-radius: 12px; }
.form-error[hidden] { display: none; }
.form .btn.big { margin-top: .7rem; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: .2rem .6rem; }
.join-code { display: flex; gap: .5rem; width: 100%; max-width: 380px; margin: .4rem auto 0; }
.join-code input { text-transform: uppercase; letter-spacing: .22em; font-weight: 800; text-align: center; font-family: ui-monospace, "SF Mono", "Cascadia Code", monospace; }

/* ---------- Felugró ablak – telefonon alulról felcsúszó lap ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(14, 8, 34, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 50;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  border-radius: 26px 26px 0 0; padding: 1.4rem 1.1rem calc(1rem + var(--safe-b)); animation: sheet .25s cubic-bezier(.2, .9, .3, 1.1);
  box-shadow: var(--shadow-lg); position: relative;
}
.modal::before { content: ""; position: absolute; top: .5rem; left: 50%; transform: translateX(-50%); width: 40px; height: 4px; border-radius: 999px; background: var(--surface-3); }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.modal.wide { max-width: 860px; }
.modal h2 { margin-top: 0; font-size: 1.25rem; }
.actions {
  display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; position: sticky; bottom: calc(-1rem - var(--safe-b));
  background: var(--surface); padding: .7rem 0 0; z-index: 3;
}
.actions .btn { flex: 1; }
.temp-pw { font-family: ui-monospace, monospace; font-size: 1.5rem; text-align: center; background: var(--surface-2); padding: .7rem; border-radius: 14px; letter-spacing: .08em; user-select: all; border: 1.5px dashed var(--line); }

#toasts { position: fixed; bottom: calc(1rem + var(--safe-b)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .45rem; z-index: 60; width: min(92vw, 420px); }
body.has-host-bar #toasts { bottom: calc(88px + var(--safe-b)); }
.toast {
  background: #1f1835; color: #fff; padding: .75rem 1.05rem; border-radius: 16px; transition: opacity .5s, transform .5s;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .45); font-weight: 600; animation: toast-in .3s cubic-bezier(.2, .9, .3, 1.2);
  border-left: 4px solid var(--good);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.toast.error { border-left-color: var(--bad); background: #3a1022; }
.toast.hide { opacity: 0; transform: translateY(6px); }

/* ---------- Címkék ---------- */
.tag { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: .1rem .6rem; font-size: .76rem; font-weight: 700; border: 1px solid var(--line); }
.tag.realm-tag { background: var(--sel-bg); color: var(--brand); border-color: transparent; display: inline-flex; align-items: center; gap: .25rem; }
.tag.warn-tag { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.tag.role-tag { background: var(--warn-bg); color: #9a5b00; border-color: var(--warn-line); }
@media (prefers-color-scheme: dark) { .tag.role-tag { color: #ffcf70; } }
.st-pending .tag.st { background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* ---------- Felhasználók (admin) ---------- */
.user-list { display: flex; flex-direction: column; gap: .55rem; }
.user-card { border: 1px solid var(--line); background: var(--surface-2); border-radius: 18px; padding: .8rem; display: flex; flex-direction: column; gap: .55rem; }
.user-card.st-pending { background: var(--warn-bg); border-color: var(--warn-line); }
.user-card.st-disabled { opacity: .6; }
.user-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .35rem 0; }
.user-head { display: flex; align-items: center; gap: .55rem; }
.me-row { display: flex; gap: 1rem; align-items: center; margin: .5rem 0 1rem; padding: .8rem; background: var(--surface-2); border-radius: 18px; }
.me-row .row-btns { margin-top: .45rem; justify-content: flex-start; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); }

/* ---------- Főoldal: játékkártyák ---------- */
.games-grid { display: grid; grid-template-columns: 1fr; gap: .85rem; }
.game-card {
  background: var(--surface); border-radius: var(--radius); padding: 1.05rem; display: flex; flex-direction: column; gap: .7rem;
  box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .18s, box-shadow .18s, border-color .18s;
  position: relative; overflow: hidden; animation: rise .3s ease-out both;
}
.game-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--card-grad, var(--grad)); }
.game-card:has(a.game-link:hover) { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.games-grid .game-card:nth-child(3n+1) { --card-grad: linear-gradient(135deg, #ffb020, #ff6a3d); }
.games-grid .game-card:nth-child(3n+2) { --card-grad: linear-gradient(135deg, #7446f7, #ff5d8f); }
.games-grid .game-card:nth-child(3n+3) { --card-grad: linear-gradient(135deg, #14b8a6, #3b82f6); }
.game-link { display: grid; grid-template-columns: auto 1fr; gap: .25rem .85rem; align-items: center; text-decoration: none; color: inherit; }
.game-card h2 { margin: 0; font-size: 1.2rem; }
.game-card p { margin: 0; color: var(--muted); grid-column: 1 / -1; }
.game-card .row-btns { justify-content: flex-start; }
.game-card.soon .game-link, .game-card.soon .soon-pill:not(.hidden-pill) { opacity: .6; }
.game-card.is-hidden { border-style: dashed; border-color: var(--surface-3); background: var(--surface-2); box-shadow: none; }
.game-icon {
  font-size: 1.75rem; width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: var(--card-grad, var(--grad)); box-shadow: 0 8px 18px -8px rgba(60, 30, 140, .55);
}
.soon-pill { background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: .25rem .75rem; font-size: .82rem; font-weight: 700; align-self: flex-start; }
.hidden-pill { background: var(--warn-bg); color: #9a5b00; }
@media (prefers-color-scheme: dark) { .hidden-pill { color: #ffcf70; } }

/* ---------- Családok ---------- */
.realm-grid { display: grid; grid-template-columns: 1fr; gap: .85rem; max-width: 760px; margin: 0 auto; }
.realm-card {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.5rem 1rem; min-height: 130px; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: 1.15rem; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; overflow: hidden; animation: rise .3s ease-out both;
}
.realm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.realm-card.current { box-shadow: 0 0 0 3px var(--brand), var(--shadow); }
.realm-card:active { transform: scale(.98); }
.realm-card b { font-weight: 800; letter-spacing: -.01em; }
.realm-card small { color: #fff; background: var(--brand); font-size: .75rem; font-weight: 800; padding: .1rem .6rem; border-radius: 999px; }
.realm-icon { font-size: 2.2rem; width: 72px; height: 72px; border-radius: 24px; display: flex; align-items: center; justify-content: center; background: var(--sel-bg); margin-bottom: .2rem; }
.realm-card.has-img { padding: 0 0 1.1rem; }
.realm-banner { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; margin-bottom: .7rem; }
.realm-card.has-img small { position: absolute; top: .7rem; right: .7rem; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.realm-pill {
  display: inline-flex; align-items: center; gap: .35rem; background: var(--sel-bg); color: var(--brand-ink); border-radius: 999px;
  padding: .2rem .75rem .2rem .3rem; font-size: .83rem; font-weight: 750; text-decoration: none; margin-bottom: .6rem;
}
.realm-pill small { font-weight: 500; color: var(--muted); }
.realm-line { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .1rem 0 .3rem; }
.realm-admin-list { display: flex; flex-direction: column; gap: .7rem; margin: .9rem 0; }
.realm-admin { display: flex; gap: .85rem; align-items: flex-start; border: 1px solid var(--line); background: var(--surface-2); border-radius: 18px; padding: .8rem; }
.realm-admin .row-btns { margin-top: .45rem; justify-content: flex-start; }
.realm-admin-img { width: 72px; height: 72px; border-radius: 18px; overflow: hidden; flex: none; background: var(--sel-bg);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.realm-admin-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Profil- és családképek (kerek); kép nélkül a kezdőbetű színes körben ---------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; background: var(--surface-3); }
.avatar.letter {
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: .95rem;
  background: linear-gradient(135deg, hsl(var(--h, 260) 70% 60%), hsl(calc(var(--h, 260) + 40) 65% 48%));
}
.avatar.xs { width: 18px; height: 18px; font-size: .6rem; }
.avatar.nav { width: 22px; height: 22px; font-size: .7rem; box-shadow: 0 0 0 2px rgba(255, 255, 255, .75); }
.avatar.sm { width: 28px; height: 28px; font-size: .78rem; }
.avatar.lg { width: 42px; height: 42px; font-size: 1.1rem; box-shadow: 0 0 0 3px var(--surface); }
.avatar.xl { width: 92px; height: 92px; font-size: 2.3rem; box-shadow: 0 0 0 4px var(--surface), 0 10px 24px -8px rgba(60, 30, 140, .45); }
.realm-emoji.xs { font-size: .85rem; }
.realm-emoji.sm { font-size: 1rem; }
.realm-av.sm { width: 24px; height: 24px; }

.photo-by { position: absolute; top: .3rem; left: .3rem; background: rgba(15, 10, 30, .6); color: #fff; font-size: .68rem; font-weight: 600; border-radius: 999px; padding: .08rem .5rem; max-width: calc(100% - .6rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.inline-filter { display: flex; align-items: center; gap: .5rem; margin: .3rem 0 .6rem; font-weight: 700; font-size: .92rem; }
.inline-filter select { flex: 1; max-width: 280px; padding: .45rem .7rem; }
.q-by { display: block; margin: -.2rem 0 .3rem; }
/* Kérdéskategóriák: a kérdés kártyáján, a kérdésbank szűrője, a kezelő ablak és az új kvíz választója */
.q-cat { display: block; margin: -.2rem 0 .3rem; }
.cat-row { align-items: center; }
.cat-row .inline-filter { flex: 1; margin: 0; }
.cat-list { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .35rem; max-height: 55vh; overflow-y: auto; }
.cat-list li { display: flex; align-items: center; gap: .4rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 12px; }
.cat-list .cat-name { flex: 1; min-width: 0; font-weight: 700; }
.cat-choice { border: 1px solid var(--line); border-radius: 14px; padding: .4rem .8rem .6rem; margin: 0; display: grid; grid-template-columns: 1fr; gap: 0 .6rem; }
.cat-choice legend { font-weight: 700; padding: 0 .3rem; font-size: .95rem; }
.cat-choice .cat-all { border-bottom: 1px solid var(--line); }

/* ---------- Játéklisták ---------- */
/* Nyitott játékok: nagy, élénk kártyák; korábbiak: külön, halvány, összecsukható, kicsi sorok */
.live-games h2 { display: flex; align-items: center; gap: .5rem; }
.live-games .count { background: var(--brand); color: #fff; font-size: .8rem; border-radius: 999px; padding: .05rem .55rem; }
.live-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 0 rgba(21, 163, 74, .6); animation: live-pulse 1.8s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 9px rgba(21, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 163, 74, 0); } }
.live-list { display: flex; flex-direction: column; gap: .7rem; }
.live-row {
  position: relative; display: flex; flex-direction: column; gap: .3rem; padding: .85rem .95rem .9rem 1.15rem; text-decoration: none; color: inherit;
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.live-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--good); }
.live-row.lobby::before { background: var(--accent); }
.live-row:hover { border-color: var(--brand); transform: translateY(-2px); }
.live-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.live-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 800; padding: .15rem .6rem; border-radius: 999px; background: var(--good-bg); color: var(--good); }
.live-row.lobby .live-badge { background: var(--warn-bg); color: #9a5b00; }
@media (prefers-color-scheme: dark) { .live-row.lobby .live-badge { color: #ffcf70; } }
.live-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: ch-led 1.2s steps(2) infinite; }
.live-title { font-size: 1.2rem; line-height: 1.25; overflow-wrap: anywhere; }
.live-row .btn { margin-top: .35rem; }
.old-games { margin: 1.4rem .2rem 1rem; border-top: 2px dashed var(--line); padding-top: .6rem; }
.old-games summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .45rem; color: var(--muted); font-weight: 800; font-size: .95rem; padding: .5rem .2rem; min-height: 44px; }
.old-games summary::-webkit-details-marker { display: none; }
.old-games summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
.old-games[open] summary::after { transform: rotate(180deg); }
.old-list { display: flex; flex-direction: column; gap: .3rem; }
.old-row {
  display: flex; align-items: center; gap: .6rem; padding: .45rem .65rem; border-radius: 12px; text-decoration: none; color: var(--muted);
  font-size: .85rem; background: var(--surface-2); border: 1px solid transparent; opacity: .85;
}
.old-row:hover { opacity: 1; border-color: var(--line); }
.old-row b { color: var(--text); font-weight: 700; }
.old-row .grow { min-width: 0; overflow-wrap: anywhere; }
.old-code { font-family: ui-monospace, "SF Mono", monospace; font-size: .75rem; font-weight: 800; letter-spacing: .08em; background: var(--surface-3); color: var(--muted); padding: .1rem .4rem; border-radius: 7px; flex: none; }
.old-win { white-space: nowrap; font-size: .8rem; }
/* Profilkép igazítása */
.crop-stage { position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: .6rem auto; border-radius: 18px; overflow: hidden; background: #120c22; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(10, 5, 25, .58); outline: 3px solid rgba(255, 255, 255, .9); outline-offset: -3px; pointer-events: none; }
.crop-stage.wide { width: min(440px, 100%); }
.crop-ring.rect { border-radius: inherit; box-shadow: none; }
.crop-zoom { display: flex; align-items: center; gap: .55rem; width: min(300px, 100%); margin: 0 auto .4rem; user-select: none; -webkit-user-select: none; }
.crop-zoom input { flex: 1; accent-color: var(--brand); min-height: 44px; }
.crop-zoom .btn { min-width: 44px; padding-inline: 0; }
.code-pill { font-family: ui-monospace, "SF Mono", monospace; font-weight: 800; background: var(--accent); color: var(--on-accent); padding: .22rem .55rem; border-radius: 10px; letter-spacing: .12em; flex: none; box-shadow: 0 4px 10px -4px rgba(255, 150, 0, .7); }

/* ---------- Képek (admin / játékszerkesztő) ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; margin-top: .8rem; }
.photo-tile { position: relative; display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: var(--surface-3); border: 3px solid transparent; transition: transform .15s; }
.photo-tile:hover { transform: scale(1.02); }
.photo-tile.untagged { border-color: var(--accent); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-names { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(10, 5, 25, .8)); color: #fff; font-size: .72rem; font-weight: 600; padding: 1.1rem .35rem .25rem; line-height: 1.2; }
.people { display: flex; flex-wrap: wrap; gap: .4rem; }
.person-chip small { margin-left: .35rem; }
.person-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .25rem .2rem .85rem; display: inline-flex; align-items: center; gap: .1rem; font-weight: 600; min-height: 36px; }

.tagger-wrap { display: flex; flex-direction: column; gap: 1rem; }
/* A kép magasságát korlátozzuk, hogy telefonon a képen kívül még lehessen görgetni */
.tagger { position: relative; user-select: none; -webkit-user-select: none; touch-action: none; cursor: crosshair; line-height: 0; width: fit-content; max-width: 100%; margin: 0 auto; }
.tagger img { max-width: 100%; max-height: 62vh; max-height: 62dvh; width: auto; height: auto; display: block; border-radius: 14px; -webkit-touch-callout: none; }
.tbox { position: absolute; border: 3px solid var(--accent); border-radius: 8px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); }
.tbox span { position: absolute; top: 100%; left: -3px; background: var(--accent); color: var(--on-accent); font-size: .7rem; line-height: 1.3; padding: 0 .35rem; border-radius: 0 0 8px 8px; white-space: nowrap; font-weight: 800; }
.tbox.draft { border-color: #2ee6a6; border-style: dashed; }
/* „Ki ez?” űrlap: telefonon a képernyő alján, hogy ne kelljen görgetni */
#newform {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); padding: .9rem 1rem calc(.9rem + var(--safe-b));
  border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
}
#newform h3 { margin-top: 0; }
#newform .form { margin: 0; }
.target-item { border: 1px solid var(--line); background: var(--surface-2); border-radius: 16px; padding: .6rem; margin-bottom: .55rem; }
.crop-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: .45rem 0; }
.crop-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; padding: .2rem; }
.pick { position: relative; display: block; border-radius: 12px; overflow: hidden; border: 3px solid transparent; cursor: pointer; font-weight: 400 !important; margin: 0 !important; background: var(--surface-3); }
.pick:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 61, 245, .25); }
.pick input { position: absolute; top: 6px; left: 6px; z-index: 1; }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: filter .2s; }
.pick span { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(10, 5, 25, .65); color: #fff; font-size: .72rem; padding: .15rem .3rem; }
/* Kivetítéskor se árulja el a választékot: elmosott képek, rejtett nevek */
.pick-grid.hide-answers img { filter: blur(14px) saturate(.6); }
.pick-grid.hide-answers span { visibility: hidden; }

/* ---------- Játékszoba ---------- */
.card.game { padding: .8rem; }
.game-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .55rem; }
.game-title { font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-no { font-weight: 800; color: var(--brand); background: var(--sel-bg); padding: .1rem .55rem; border-radius: 999px; font-size: .9rem; }
.timer { font-variant-numeric: tabular-nums; background: var(--grad-head); color: #fff; padding: .2rem .7rem; border-radius: 999px; font-weight: 800; box-shadow: var(--glow); }
.timer.urgent { background: linear-gradient(135deg, #ff5c7c, #e11d48); animation: pulse .8s infinite; box-shadow: 0 6px 16px -4px rgba(225, 29, 72, .6); }
.big-code {
  display: flex; flex-direction: column; align-items: center; border-radius: 20px; padding: .9rem; margin: .3rem 0 .7rem;
  background: var(--surface-2); border: 1.5px dashed var(--surface-3);
}
.big-code span {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", monospace; font-size: 2.7rem; font-weight: 800; letter-spacing: .18em; line-height: 1.2;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 16px; padding: .7rem .85rem; margin: .7rem 0; }
.notice p { margin: .1rem 0 .5rem; }
.notice.sol { margin: .5rem 0; }
.notice.sol p, p.notice.sol { margin: .5rem 0; }
.waiting { text-align: center; font-weight: 700; color: var(--brand); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.players { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.players li { display: flex; align-items: center; gap: .55rem; padding: .5rem .75rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.players li.mine { border-color: var(--brand); background: var(--sel-bg); }
.players .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); flex: none; }
.players li.online .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(21, 163, 74, .2); }
.players .rank { color: var(--muted); width: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.players li:nth-child(1) .rank { color: #e0a000; }
.pic { position: relative; line-height: 0; border-radius: 18px; overflow: hidden; background: #0c0915; margin: 0 auto; width: fit-content; max-width: 100%; box-shadow: var(--shadow); }
.round-img { width: auto; max-width: 100%; max-height: 40vh; max-height: 40dvh; height: auto; display: block; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.reveal-box { position: absolute; border: 4px solid var(--accent); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .38); animation: pop .5s ease-out; }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } }
.zoom-bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: .65rem 0; }
.worth { font-size: 1.05rem; }
.worth b { font-size: 1.55rem; color: var(--brand); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .55rem 0; }
.opt {
  font: inherit; font-weight: 750; font-size: 1rem; line-height: 1.2; padding: .7rem .45rem; min-height: 56px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text); touch-action: manipulation; overflow-wrap: anywhere;
  box-shadow: var(--shadow-sm); transition: transform .12s, border-color .15s, background .15s;
}
.options.n9 .opt, .options.n10 .opt { min-height: 46px; padding: .5rem .3rem; font-size: .95rem; }
.opt:hover:not(:disabled) { border-color: var(--brand); background: var(--sel-bg); }
.opt:active:not(:disabled) { transform: scale(.96); }
.opt:disabled { cursor: default; opacity: .7; }
.opt.chosen { border-color: var(--brand); background: var(--sel-bg); opacity: 1; box-shadow: 0 0 0 3px rgba(109, 61, 245, .2); }
.opt.correct { border-color: var(--good); background: var(--good-bg); opacity: 1; box-shadow: 0 0 0 3px rgba(21, 163, 74, .2); }
.my-tip { text-align: center; margin: .6rem 0 .2rem; }
.progress-line { text-align: center; color: var(--muted); font-size: .85rem; margin-top: .6rem; }
.pchips { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin: .35rem 0; }
.pchip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .65rem; font-size: .82rem; font-weight: 600; }
.pchip.done { background: var(--good-bg); color: var(--good); border-color: transparent; }
.pchip.off { opacity: .5; }
.solution { text-align: center; font-size: 1.55rem; font-weight: 800; margin: .25rem 0; }
.result { text-align: center; font-size: 1.2rem; font-weight: 800; margin: .3rem 0 .6rem; padding: .5rem; border-radius: 14px; }
.result.good { color: var(--good); background: var(--good-bg); }
.result.bad { color: var(--bad); background: var(--bad-bg); }
.ans-list { list-style: none; padding: 0; margin: .7rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.ans-list li { display: flex; align-items: center; gap: .55rem; padding: .45rem .75rem; border-radius: 14px; background: var(--surface-2); border-left: 5px solid var(--bad); }
.ans-list li.good { border-left-color: var(--good); }
.ans-list .pts { font-size: 1.15rem; font-weight: 800; }
.ans-list li.good .pts { color: var(--good); }
/* A vezető gombjai mindig kéznél: a képernyő alján */
.host-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; gap: .5rem; align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: .65rem .75rem calc(.65rem + var(--safe-b)); box-shadow: 0 -10px 30px -12px rgba(30, 10, 60, .3); border-top: 1px solid var(--line);
}
.host-bar .btn { min-height: 52px; }

/* ---------- Villámkvíz ---------- */
.ans-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2rem; height: 2rem; border-radius: 10px; color: #fff; font-weight: 800; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); }
.ans-badge.a0 { background: linear-gradient(135deg, #7446f7, #5b2ee0); }
.ans-badge.a1 { background: linear-gradient(135deg, #14b8a6, #0d8f88); }
.ans-badge.a2 { background: linear-gradient(135deg, #ffa53a, #f07a12); }
.ans-badge.a3 { background: linear-gradient(135deg, #ff5d8f, #d6336c); }
.q-text { font-size: 1.3rem; font-weight: 800; text-align: center; margin: .45rem 0 .55rem; overflow-wrap: anywhere; letter-spacing: -.01em; }
.q-multi { text-align: center; font-weight: 800; color: var(--brand); margin: 0 0 .45rem; }
.qopts { display: grid; grid-template-columns: 1fr; gap: .5rem; margin: .55rem 0; }
.qopt {
  display: flex; align-items: center; gap: .65rem; min-height: 60px; padding: .5rem .75rem; text-align: left; font: inherit; font-size: 1.05rem; font-weight: 700;
  color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 16px; cursor: pointer; overflow-wrap: anywhere;
  box-shadow: var(--shadow-sm); transition: transform .12s, border-color .15s, background .15s;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
/* A válaszgombok a betűjük színével árnyalva */
.qopt:has(.a0) { background: color-mix(in srgb, #7446f7 7%, var(--surface)); }
.qopt:has(.a1) { background: color-mix(in srgb, #14b8a6 7%, var(--surface)); }
.qopt:has(.a2) { background: color-mix(in srgb, #ffa53a 9%, var(--surface)); }
.qopt:has(.a3) { background: color-mix(in srgb, #ff5d8f 7%, var(--surface)); }
.qopt:active:not(:disabled) { transform: scale(.98); }
.qopt:disabled { cursor: default; }
.qopt.sel { border-color: var(--brand); background: var(--sel-bg); box-shadow: 0 0 0 3px rgba(109, 61, 245, .22); }
.qopt.correct { border-color: var(--good); background: var(--good-bg); box-shadow: 0 0 0 3px rgba(21, 163, 74, .2); }
.qopt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.qopt.dim { opacity: .5; }
.qcount { background: var(--surface-3); border-radius: 999px; padding: .1rem .55rem; font-size: .9rem; font-weight: 800; }
.tbar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: -.1rem 0 .35rem; }
.tbar i { display: block; height: 100%; width: 100%; background: var(--grad); border-radius: 999px; transition: width .2s linear; }
.ready-tag { font-size: .8rem; color: var(--muted); white-space: nowrap; font-weight: 600; }
.ready-tag.yes { color: var(--good); font-weight: 800; }
.ready-btn { margin: .4rem 0 .8rem; }
.streak { font-size: .85rem; font-weight: 800; white-space: nowrap; }
.bonus-line { text-align: center; font-weight: 800; color: #d4620b; margin: -.3rem 0 .5rem; }
.search { width: 100%; margin: .2rem 0 .6rem; }
.q-list { display: flex; flex-direction: column; gap: .55rem; }
.q-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: .7rem .8rem; }
.q-card-text { margin: 0 0 .45rem; overflow-wrap: anywhere; }
.q-card-ans { list-style: none; padding: 0; margin: 0 0 .45rem; display: flex; flex-direction: column; gap: .3rem; }
.q-card-ans li { display: flex; align-items: center; gap: .5rem; overflow-wrap: anywhere; }
.q-card-ans li.ok { font-weight: 800; color: var(--good); }
.q-card-ans .ans-badge { width: 1.55rem; height: 1.55rem; font-size: .8rem; border-radius: 8px; }
.q-ans { display: flex; align-items: center; gap: .45rem; margin: .35rem 0; }
.q-ans input:not([type]) { flex: 1; min-width: 0; margin: 0; }
.q-correct { display: flex; align-items: center; gap: .25rem; font-size: .85rem; font-weight: 700; margin: 0 !important; white-space: nowrap; }
.extra-q { margin: .5rem 0; }
.extra-q summary { cursor: pointer; font-weight: 800; padding: .45rem 0; }
.q-pick { display: flex; flex-direction: column; gap: .15rem; max-height: 40vh; overflow-y: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: .35rem .55rem; }
.q-pick.hide-answers .q-pick-row span { filter: blur(6px); user-select: none; }
.total-line { text-align: center; margin: .5rem 0; }

/* ---------- Figurák (characters.js) ---------- */
.ch { display: inline-block; flex: none; width: 72px; line-height: 0; vertical-align: middle; --d: 0s; }
.ch svg { width: 100%; height: auto; overflow: visible; display: block; filter: drop-shadow(0 3px 4px rgba(30, 10, 60, .18)); }
.ch.xs { width: 34px; } .ch.sm { width: 56px; } .ch.lg { width: 96px; } .ch.xl { width: 128px; }
.ch-shadow { fill: #1b1035; opacity: .13; transform-origin: 50px 114px; animation: ch-shadow 2.4s ease-in-out var(--d) infinite; }
.ch-fig { transform-origin: 50px 112px; animation: ch-bob 2.4s ease-in-out var(--d) infinite; }
.ch-head { transform-origin: 50px 58px; animation: ch-tilt 3.6s ease-in-out var(--d) infinite; }
.ch-eyes { transform-box: fill-box; transform-origin: center; animation: ch-blink 4.6s var(--d) infinite; }
.ch-arm.l { animation: ch-arm-l 2.4s ease-in-out var(--d) infinite; }
.ch-arm.r { animation: ch-arm-r 2.4s ease-in-out var(--d) infinite; }
.ch-tail { animation: ch-wag 1.1s ease-in-out var(--d) infinite alternate; }
.ch-cape { animation: ch-cape 1.3s ease-in-out var(--d) infinite alternate; }
.ch-wing.l { animation: ch-flap-l .9s ease-in-out var(--d) infinite alternate; }
.ch-wing.r { animation: ch-flap-r .9s ease-in-out var(--d) infinite alternate; }
.ch-ear.l { animation: ch-flap-l 1.6s ease-in-out var(--d) infinite alternate; }
.ch-ear.r { animation: ch-flap-r 1.6s ease-in-out var(--d) infinite alternate; }
.ch-sprout, .ch-antenna { animation: ch-wag 1.4s ease-in-out var(--d) infinite alternate; }
.ch-halo { animation: ch-halo 2s ease-in-out var(--d) infinite; }
.ch-led { animation: ch-led 1.2s steps(2) var(--d) infinite; }
.ch-led.d2 { animation-delay: .4s; } .ch-led.d3 { animation-delay: .8s; }
.ch-spark { animation: ch-spark 1.2s ease-in-out var(--d) infinite; }
.ch-drop { animation: ch-drop 1.8s ease-in var(--d) infinite; }
/* Alapmozgások figuránként */
.a-float .ch-fig { animation: ch-float 3.2s ease-in-out var(--d) infinite; }
.a-float .ch-shadow { animation: ch-shadow-f 3.2s ease-in-out var(--d) infinite; }
.a-hop .ch-fig { animation: ch-hop 1.8s ease-in-out var(--d) infinite; }
.a-sway .ch-fig { animation: ch-sway 2.8s ease-in-out var(--d) infinite; }
/* Hangulatok: örül (jó válasz), szomorú (rossz), integet (váró) */
.ch.happy .ch-fig { animation: ch-jump .8s ease-in-out var(--d) infinite; }
.ch.happy .ch-shadow { animation: ch-shadow-j .8s ease-in-out var(--d) infinite; }
.ch.happy .ch-arm.l { animation: ch-cheer-l .4s ease-in-out infinite alternate; }
.ch.happy .ch-arm.r { animation: ch-cheer-r .4s ease-in-out infinite alternate; }
.ch.sad .ch-fig { animation: ch-bob 4.5s ease-in-out var(--d) infinite; }
.ch.sad .ch-head { animation: none; transform: translateY(2px) rotate(9deg); }
.ch.sad .ch-arm.l, .ch.sad .ch-arm.r { animation: none; }
.ch.wave .ch-arm.r { animation: ch-wave .7s ease-in-out infinite alternate; }

@keyframes ch-bob { 50% { transform: translateY(-3px); } }
@keyframes ch-shadow { 50% { transform: scaleX(.9); } }
@keyframes ch-float { 50% { transform: translateY(-8px); } }
@keyframes ch-shadow-f { 50% { transform: scaleX(.75); opacity: .08; } }
@keyframes ch-hop { 0%, 55%, 100% { transform: translateY(0) scale(1, 1); } 62% { transform: translateY(0) scale(1.06, .92); } 75% { transform: translateY(-11px) scale(.96, 1.05); } 88% { transform: translateY(0) scale(1.04, .96); } }
@keyframes ch-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes ch-tilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes ch-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes ch-arm-l { 50% { transform: rotate(12deg); } }
@keyframes ch-arm-r { 50% { transform: rotate(-12deg); } }
@keyframes ch-wag { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes ch-cape { from { transform: skewX(-5deg); } to { transform: skewX(6deg) scaleX(1.04); } }
@keyframes ch-flap-l { from { transform: rotate(0); } to { transform: rotate(-14deg); } }
@keyframes ch-flap-r { from { transform: rotate(0); } to { transform: rotate(14deg); } }
@keyframes ch-halo { 50% { transform: translateY(-3px); } }
@keyframes ch-led { 50% { opacity: .35; } }
@keyframes ch-spark { 50% { transform: scale(1.35) rotate(25deg); } }
@keyframes ch-drop { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }
@keyframes ch-jump { 0%, 100% { transform: translateY(0) scale(1.05, .94); } 45% { transform: translateY(-16px) scale(.96, 1.05); } }
@keyframes ch-shadow-j { 45% { transform: scaleX(.6); opacity: .06; } }
@keyframes ch-cheer-l { from { transform: rotate(105deg); } to { transform: rotate(140deg); } }
@keyframes ch-cheer-r { from { transform: rotate(-105deg); } to { transform: rotate(-140deg); } }
@keyframes ch-wave { from { transform: rotate(-110deg); } to { transform: rotate(-150deg); } }

/* Állás figurákkal: dobogó + a többiek listája */
.stage { margin: .4rem 0 .8rem; }
.st-podium { display: flex; justify-content: center; align-items: flex-end; gap: .4rem; }
.st-col { flex: 1 1 0; max-width: 128px; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.st-name { font-weight: 800; font-size: .9rem; line-height: 1.2; margin-top: .2rem; overflow-wrap: anywhere; }
.st-score { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.st-score b { color: var(--text); }
.st-delta { color: var(--good); font-weight: 800; }
.st-col.mine .st-name { color: var(--brand); }
.st-col .ch.lg { width: 104px; } .st-col .ch.md { width: 82px; }
.st-block {
  width: 100%; margin-top: .35rem; border-radius: 14px 14px 6px 6px; display: flex; justify-content: center; align-items: flex-start;
  padding-top: .35rem; font-size: 1.5rem; font-weight: 900; color: #fff; background: linear-gradient(180deg, #c3c8d4, #9aa1b2);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12);
}
.st-col.p1 .st-block { height: 74px; background: linear-gradient(180deg, #ffd65c, #f5a700); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), 0 12px 26px -12px rgba(255, 170, 0, .8); }
.st-col.p2 .st-block { height: 52px; }
.st-col.p3 .st-block { height: 36px; background: linear-gradient(180deg, #f0b07a, #c97a3d); }
.st-rest { list-style: none; padding: 0; margin: .7rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.st-rest li { display: flex; align-items: center; gap: .5rem; padding: .3rem .75rem .3rem .5rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.st-rest li.mine { border-color: var(--brand); background: var(--sel-bg); }
.st-rest .rank { color: var(--muted); width: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stage.enter .st-col, .stage.enter .st-rest li { animation: st-in .55s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(var(--i) * .12s); }
.stage.enter .st-col.p1 { animation-delay: .4s; }
@keyframes st-in { from { opacity: 0; transform: translateY(24px) scale(.85); } }
/* Saját figura a váróban, figuraválasztó */
.my-char { display: flex; align-items: center; gap: .9rem; margin: .6rem 0 .9rem; padding: .5rem .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; }
.my-char > div { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; }
.my-char b { font-size: 1.15rem; }
.char-btn-row { display: flex; justify-content: center; margin: .2rem 0 .8rem; }
.ch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .6rem 0; max-height: 60vh; overflow-y: auto; padding: .2rem; }
.ch-pick {
  display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .45rem .15rem .4rem; font: inherit; font-size: .78rem; font-weight: 700;
  color: var(--text); background: var(--surface-2); border: 2px solid transparent; border-radius: 16px; cursor: pointer; min-width: 0;
}
.ch-pick span { white-space: nowrap; font-size: .72rem; letter-spacing: -.01em; line-height: 1.15; }
.ch-pick small { color: var(--muted); font-weight: 600; font-size: .7rem; overflow-wrap: anywhere; }
.ch-pick.cur { border-color: var(--brand); background: var(--sel-bg); }
.ch-pick:disabled { opacity: .45; cursor: default; }
.ch-pick:not(:disabled):active { transform: scale(.96); }
.players .ch.xs { margin: -.2rem 0; }

/* ---------- Villámkvíz-csapdák (traps.js) ---------- */
.snd { font-size: 1.05rem; min-width: 32px; padding: .2rem; }
.trap-info { text-align: center; font-weight: 700; color: var(--ice); margin: .3rem 0; }
.ice-chip { font-weight: 800; color: var(--ice); }
/* Választás */
.trap-head { text-align: center; margin: .2rem 0 .6rem; }
.trap-head h2 { margin: .1rem 0; }
.trap-head p { margin: .2rem 0; }
.trap-big { display: inline-block; font-size: 2.6rem; line-height: 1; animation: trap-wobble 1.8s ease-in-out infinite; }
@keyframes trap-wobble { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.08); } }
.trap-step { display: flex; align-items: center; gap: .45rem; font-size: 1.05rem; margin: .8rem 0 .4rem; }
.trap-step span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; font-size: .85rem; }
.trap-kinds { display: grid; gap: .5rem; }
.trap-kind, .trap-target {
  font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 16px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .12s, border-color .15s, background .15s;
}
.trap-kind { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; text-align: left; min-height: 60px; }
.trap-kind small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.3; }
.tk-icon { font-size: 2rem; line-height: 1; }
.trap-kind.sel { border-color: var(--ice); background: color-mix(in srgb, var(--ice) 12%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ice) 25%, transparent); }
.trap-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.trap-target { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .5rem .3rem .45rem; font-weight: 700; font-size: .9rem; overflow-wrap: anywhere; min-height: 44px; }
.trap-target.sel { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.trap-target { position: relative; }
.trap-target.sel::after { content: "🎯"; position: absolute; top: 4px; right: 6px; font-size: 1.1rem; }
.trap-kind:active, .trap-target:active { transform: scale(.97); }
.trap-targets + .btn { margin-top: .8rem; }
.trap-done { text-align: center; margin: .5rem 0; }
.trap-done .result { margin: .4rem 0; }
/* Dobás-animáció */
.trap-show { margin: .2rem -.2rem 0; }
.ts-scene {
  position: relative; height: min(62vh, 430px); min-height: 330px; border-radius: 20px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ice) 22%, var(--surface)) 0%, var(--surface) 70%);
  border: 1px solid var(--line);
}
.ts-snow i { position: absolute; top: -10px; width: 6px; height: 6px; border-radius: 50%; background: var(--ice-edge); opacity: .7; animation: ts-snow 6s linear infinite; }
.ts-snow i:nth-child(odd) { width: 4px; height: 4px; animation-duration: 8s; }
.ts-snow i:nth-child(1) { left: 5%; animation-delay: -1s; } .ts-snow i:nth-child(2) { left: 12%; animation-delay: -4s; }
.ts-snow i:nth-child(3) { left: 20%; animation-delay: -2.5s; } .ts-snow i:nth-child(4) { left: 28%; animation-delay: -5s; }
.ts-snow i:nth-child(5) { left: 35%; animation-delay: -.5s; } .ts-snow i:nth-child(6) { left: 43%; animation-delay: -3.3s; }
.ts-snow i:nth-child(7) { left: 51%; animation-delay: -6s; } .ts-snow i:nth-child(8) { left: 59%; animation-delay: -1.8s; }
.ts-snow i:nth-child(9) { left: 66%; animation-delay: -4.6s; } .ts-snow i:nth-child(10) { left: 73%; animation-delay: -2.2s; }
.ts-snow i:nth-child(11) { left: 80%; animation-delay: -5.5s; } .ts-snow i:nth-child(12) { left: 87%; animation-delay: -.9s; }
.ts-snow i:nth-child(13) { left: 93%; animation-delay: -3.9s; } .ts-snow i:nth-child(14) { left: 98%; animation-delay: -7s; }
@keyframes ts-snow { to { transform: translate(-30px, 470px); } }
.ts-caption { position: absolute; left: 0; right: 0; top: 14px; padding: 0 1rem; text-align: center; font-size: 1.15rem; font-weight: 800; z-index: 3; }
.ts-caption.big { top: 38%; font-size: 1.8rem; }
.ts-caption.big small { font-size: 1rem; color: var(--muted); }
.ts-caption.hit { color: var(--ice-ink); }
.ts-caption small { font-weight: 600; }
.ts-floor { position: absolute; inset: 0; }
.ts-target { position: absolute; right: 9%; bottom: 14%; display: flex; flex-direction: column; align-items: center; gap: .15rem; z-index: 1; }
.ts-fig { position: relative; display: inline-block; isolation: isolate; }
.ts-name { font-weight: 800; font-size: 1.05rem; }
.ts-count { font-weight: 800; color: var(--ice); }
/* A célpontot fokozatosan beborító jégtömb */
.ts-ice {
  position: absolute; inset: 18% -10% -4%; border-radius: 26px 30px 18px 22px; pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, .85), var(--ice-bg) 40%, color-mix(in srgb, var(--ice) 45%, transparent));
  border: 2px solid var(--ice-edge); box-shadow: inset 0 0 18px rgba(255, 255, 255, .8), 0 0 18px color-mix(in srgb, var(--ice) 40%, transparent);
  opacity: calc(min(var(--l), 1) * .4 + min(var(--l), 5) * .1); transform: scale(calc(.85 + min(var(--l), 5) * .04)); transition: opacity .35s, transform .35s cubic-bezier(.2, 1.6, .4, 1);
}
.ts-walker { position: absolute; left: 6%; bottom: 14%; z-index: 2; }
.ts-proj { position: absolute; left: 0; top: 0; font-size: 2.1rem; line-height: 1; z-index: 4; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0, 40, 90, .3)); }
.ts-shard { position: absolute; left: 50%; top: 40%; color: var(--ice); font-size: 1.1rem; pointer-events: none; }
/* Befagyott válaszok */
.ice-banner {
  text-align: center; font-weight: 800; color: var(--ice-ink); margin: .2rem 0 .45rem; padding: .5rem .7rem; border-radius: 14px;
  background: color-mix(in srgb, var(--ice) 16%, var(--surface)); border: 1px solid var(--ice-edge);
}
.qopt { position: relative; }
.qopt.frozen { border-color: var(--ice-edge); overflow: hidden; }
.ice-cover {
  position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center; pointer-events: none;
  background:
    linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, .55) 32%, transparent 44%),
    radial-gradient(120% 140% at 15% 0%, rgba(255, 255, 255, .9), var(--ice-bg) 55%, color-mix(in srgb, var(--ice) 35%, var(--ice-bg)));
  box-shadow: inset 0 0 0 2px var(--ice-edge), inset 0 -6px 14px color-mix(in srgb, var(--ice) 30%, transparent);
  backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
}
.ice-cover.fresh { animation: ice-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes ice-in { from { opacity: 0; transform: scale(1.15); } }
.ice-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ice-cover path {
  fill: none; stroke: var(--ice-crack); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 1px color-mix(in srgb, var(--ice) 80%, transparent));
  stroke-dasharray: 100; stroke-dashoffset: calc(100 - clamp(0, (var(--p) * 6 - var(--i)) * 100, 100)); transition: stroke-dashoffset .18s ease-out;
}
.ice-tap { position: relative; font-weight: 800; color: var(--ice-ink); background: rgba(255, 255, 255, .7); border-radius: 999px; padding: .1rem .7rem; font-size: .95rem; }
.ice-cover.hitfx { animation: ice-hit .18s ease-out; }
@keyframes ice-hit { 0% { transform: translateX(0) scale(1); } 30% { transform: translateX(-3px) scale(.985); } 65% { transform: translateX(3px); } 100% { transform: none; } }
.ice-cover.shatter { animation: ice-shatter .4s ease-in forwards; }
@keyframes ice-shatter { 0% { opacity: 1; transform: scale(1); filter: brightness(1.4); } 100% { opacity: 0; transform: scale(1.25); filter: blur(4px) brightness(1.6); } }
@media (prefers-color-scheme: dark) { .ice-tap { background: rgba(10, 40, 70, .6); } }
/* Ragacs a válaszokon (vászon, ujjal letörölhető) */
.qopt.slimed { overflow: hidden; border-color: var(--slime-edge); }
.slime-slot { position: absolute; inset: 0; border-radius: inherit; z-index: 2; }
.slime-canvas {
  display: block; width: 100%; height: 100%; border-radius: inherit; touch-action: none; cursor: grab;
  filter: drop-shadow(0 2px 3px rgba(20, 60, 10, .35)); transition: opacity .35s, transform .35s;
}
.slime-canvas.gone { opacity: 0; transform: scale(1.08); }
/* Mozgó válaszok (Forgószél): a szél mozgatja őket (quiz-room.js → windAnswers inline translate / rotate) */
.qopts.moving .qopt { position: relative; z-index: 5; will-change: translate, rotate; box-shadow: var(--shadow); }
/* 2 rétegtől keskenyebb csempék, hogy oldalra is legyen hova repülniük */
.qopts.moving.fly { justify-items: center; }
.qopts.moving.fly .qopt { width: min(68%, 340px); }
/* Örvény: forog / csavarodik az egész játékkártya (quiz-room.js: .card.whirl.w1–w3, --wd = eddig eltelt idő,
   hogy újrarajzoláskor ne kezdődjön elölről). Valódi forgatás, így ahol a válasz látszik, ott is kell rányomni. */
main:has(.card.whirl) { overflow-x: clip; }
.card.whirl { position: relative; isolation: isolate; animation-delay: var(--wd, 0s); }
.card.whirl.w1 { animation: whirl-sway 3.6s ease-in-out infinite; --sw: 16deg; scale: .96; }
.card.whirl.w2 { animation: whirl-spin 5.5s linear infinite, whirl-pulse 2.2s ease-in-out infinite alternate; }
.card.whirl.w3 { animation: whirl-spin 3.2s linear infinite, whirl-pulse 1.4s ease-in-out infinite alternate; }
.card.whirl.w1 { animation-delay: var(--wd, 0s); }
.card.whirl.w2, .card.whirl.w3 { animation-delay: var(--wd, 0s), var(--wd, 0s); }
.card.whirl.w3 .qopt { animation: whirl-tile 1.6s ease-in-out infinite alternate; animation-delay: var(--wd, 0s); }
.card.whirl::after {
  content: ""; position: absolute; inset: -25%; z-index: -1; pointer-events: none; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--brand) 14%, transparent) 0 14deg, transparent 14deg 28deg);
  -webkit-mask: radial-gradient(circle, transparent 12%, #000 72%); mask: radial-gradient(circle, transparent 12%, #000 72%);
  animation: whirl-spin 4s linear infinite reverse;
}
@keyframes whirl-sway { 0%, 100% { rotate: calc(var(--sw) * -1); } 50% { rotate: var(--sw); } }
@keyframes whirl-spin { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes whirl-pulse { from { scale: .8; transform: skew(-7deg, 3deg); } to { scale: .95; transform: skew(7deg, -3deg); } }
@keyframes whirl-tile { from { rotate: -22deg; } to { rotate: 22deg; } }
/* Dobás-animáció: örvény a figura mögött */
.ts-whirl {
  position: absolute; inset: 0 -30% -10%; z-index: -1; pointer-events: none; border-radius: 50%; opacity: calc(min(var(--l, 0), 1) * .35 + min(var(--l, 0), 5) * .1);
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--brand) 45%, transparent) 0 15deg, transparent 15deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%);
  animation: whirl-spin 1.6s linear infinite;
}
/* A dobás-animáció: ragacs a figurán, szédülés-csillagok */
.ts-slime { position: absolute; inset: 22% -2% 10%; pointer-events: none; opacity: calc(min(var(--l, 0), 1) * .28 + min(var(--l, 0), 5) * .08); transition: opacity .35s; }
.ts-slime::before {
  content: ""; position: absolute; inset: 0; border-radius: 58% 42% 48% 52% / 55% 50% 46% 45%;
  background: radial-gradient(60% 50% at 40% 30%, color-mix(in srgb, var(--slime) 60%, #fff), var(--slime) 60%, var(--slime-edge));
  mix-blend-mode: multiply;
}
.ts-slime i { position: absolute; top: 70%; width: 12px; height: 22px; border-radius: 0 0 8px 8px; background: var(--slime-edge); animation: ts-drip 1.6s ease-in infinite; }
.ts-slime i:nth-child(1) { left: 20%; } .ts-slime i:nth-child(2) { left: 52%; animation-delay: -.6s; height: 16px; } .ts-slime i:nth-child(3) { left: 76%; animation-delay: -1.1s; }
@keyframes ts-drip { 0% { transform: scaleY(.4); transform-origin: top; } 70% { transform: scaleY(1.2); } 100% { transform: scaleY(.4); } }
.ts-move { position: absolute; left: 50%; top: -6%; font-size: 1.6rem; opacity: 0; pointer-events: none; transform: translateX(-50%); }
.ts-fig.dizzy .ts-move { opacity: 1; animation: ts-orbit 1.1s linear infinite; }
.ts-fig.dizzy .ch { animation: ts-wobble 1.4s ease-in-out infinite; }
@keyframes ts-orbit { from { transform: translateX(-50%) rotate(0) translateX(26px) rotate(0); } to { transform: translateX(-50%) rotate(360deg) translateX(26px) rotate(-360deg); } }
@keyframes ts-wobble { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
.ts-shard.goo { color: var(--slime); font-size: 1.3rem; }
.ts-shard.star { color: var(--accent); }
.ts-count { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
/* Új kvíz: választható csapdák */
.trap-choice { border: 1px solid var(--line); border-radius: 14px; padding: .4rem .8rem .6rem; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 .6rem; }
.trap-choice legend { font-weight: 700; padding: 0 .3rem; font-size: .95rem; }
.trap-choice[hidden] { display: none; }
/* Köd a válaszokon: csak a zseblámpa-folt (--fx, --fy, --fr – quiz-room.js / fogLight) körül látszik át */
.qopts.fogbox, .qopt.fogged { touch-action: none; }
.qopt.fogged { overflow: hidden; }
.fog-cover {
  position: absolute; inset: -2px; border-radius: inherit; z-index: 4; pointer-events: none; opacity: var(--fa, .9);
  background:
    radial-gradient(40% 70% at 20% 40%, var(--fog-light), transparent 70%),
    radial-gradient(35% 60% at 75% 65%, var(--fog-light), transparent 70%),
    var(--fog);
  background-size: 200% 100%, 220% 100%, auto; animation: fog-drift 9s ease-in-out infinite alternate;
  -webkit-mask: radial-gradient(circle var(--fr, 0px) at var(--fx, -999px) var(--fy, -999px), transparent 45%, #000 100%);
  mask: radial-gradient(circle var(--fr, 0px) at var(--fx, -999px) var(--fy, -999px), transparent 45%, #000 100%);
}
@keyframes fog-drift { from { background-position: 0% 0, 100% 0, 0 0; } to { background-position: 100% 0, 0% 0, 0 0; } }
/* Eltűnő válaszok: az átlátszóságot a fadeAnswers állítja; a letűnt válasz helye is alig látszik */
.qopts.fading .qopt { transition: none; }
/* Dobás-animáció: köd a figura előtt, kavargó betűk, áttetszővé váló figura */
.ts-fog {
  position: absolute; inset: -10% -25% 0; pointer-events: none; border-radius: 50%; z-index: 2;
  background: radial-gradient(closest-side, var(--fog-light), var(--fog) 60%, transparent);
  opacity: calc(min(var(--l, 0), 1) * .35 + min(var(--l, 0), 5) * .11); transition: opacity .4s;
  animation: ts-fog 3s ease-in-out infinite alternate;
}
@keyframes ts-fog { from { transform: translateX(-6%) scale(1); } to { transform: translateX(6%) scale(1.06); } }
.ts-scramble { position: absolute; inset: -4% -10% auto; display: flex; justify-content: center; gap: .1rem; pointer-events: none; opacity: min(var(--l, 0), 1); font-weight: 900; color: var(--brand); font-size: 1.1rem; }
.ts-scramble i { font-style: normal; animation: ts-letter calc(1.6s - var(--l, 0) * .2s) ease-in-out infinite; }
.ts-scramble i:nth-child(2) { animation-delay: -.3s; } .ts-scramble i:nth-child(3) { animation-delay: -.6s; } .ts-scramble i:nth-child(4) { animation-delay: -.9s; }
@keyframes ts-letter { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(25deg); } }
.ts-fig.ghosty .ch { animation: ts-ghost calc(2.4s - var(--gl, 1) * .3s) ease-in-out infinite; }
@keyframes ts-ghost { 0%, 100% { opacity: 1; } 50% { opacity: calc(.75 - var(--gl, 1) * .13); } }

/* ---------- Kategória-ikon választó ---------- */
.icon-now { display: flex; align-items: center; gap: .6rem; }
.icon-now input { flex: 1; min-width: 0; }
.icon-big { font-size: 2rem; line-height: 1; width: 3rem; text-align: center; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: .3rem; margin: .5rem 0 .3rem; max-height: 34vh; overflow-y: auto; }
.emoji-btn { min-height: 44px; font-size: 1.45rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.emoji-btn.sel { border-color: var(--brand); background: var(--sel-bg); box-shadow: 0 0 0 2px var(--brand); }
.q-hint { display: block; margin-top: .35rem; }
.trap-choice.help-choice { grid-template-columns: 1fr; }
.help-choice .check { align-items: flex-start; }
.help-choice .check input { margin-top: .2rem; }

/* ---------- Segítségek a kérdésnél ---------- */
.help-row { display: flex; gap: .4rem; justify-content: center; margin: .3rem 0 .5rem; }
.help-btn { flex: 1; max-width: 120px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem;
  border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; padding: .25rem; }
.help-btn span { font-size: 1.25rem; line-height: 1.1; font-weight: 800; }
.help-btn small { font-size: .72rem; color: var(--muted); }
.help-btn:not(:disabled):active { transform: scale(.96); }
.help-btn.on { border-color: var(--brand); background: var(--sel-bg); }
.help-btn:disabled:not(.on) { opacity: .45; cursor: default; }
.hint-box, .double-box { margin: .3rem 0 .5rem; padding: .55rem .75rem; border-radius: 14px; font-weight: 700; text-align: center; }
.hint-box { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.double-box { background: var(--sel-bg); border: 1px solid var(--brand); color: var(--brand-ink); }
.qopt.gone { opacity: .12; pointer-events: none; filter: grayscale(1); }
.help-chip { font-size: .85rem; }
.q-cat-chip { display: table; margin: 0 auto -.1rem; padding: .15rem .65rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: .85rem; font-weight: 700; color: var(--muted); }

/* ---------- Kategóriaválasztás: kisorsolt játékos ---------- */
.cat-picks { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cat-pick { min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; padding: .5rem;
  border: 2px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); }
.cat-pick:active { transform: scale(.97); border-color: var(--brand); }
.cp-icon { font-size: 2rem; line-height: 1; }
.cat-result { display: flex; flex-direction: column; align-items: center; gap: .4rem; margin: .4rem 0; }
.cat-card { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .8rem 1.4rem; border-radius: 20px; background: var(--grad); color: #fff;
  box-shadow: var(--glow); font-size: 1.25rem; }
.cat-card .cp-icon { font-size: 2.6rem; }
.cat-card.pop { animation: cat-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes cat-pop { from { transform: scale(.3) rotate(-8deg); opacity: 0; } }
.cat-chips { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.cat-chip { padding: .3rem .65rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }

/* ---------- Ajtók ---------- */
.doors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; margin: .4rem 0 .2rem; align-items: start; }
.doors.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 260px; margin-left: auto; margin-right: auto; }
.doors.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 360px; margin-left: auto; margin-right: auto; }
.door-col { display: flex; flex-direction: column; align-items: center; min-width: 0; transition: opacity .5s, filter .5s; }
.door { position: relative; width: 100%; max-width: 110px; aspect-ratio: 3 / 4.4; padding: 0; border: 5px solid var(--door-frame); border-bottom-width: 7px;
  border-radius: 46px 46px 6px 6px; background: var(--door-light); cursor: pointer; perspective: 500px; overflow: visible; }
.door:disabled { cursor: default; }
.door-light { position: absolute; inset: 0; border-radius: 40px 40px 0 0; background: radial-gradient(circle at 50% 60%, var(--door-light), var(--accent)); opacity: 0; transition: opacity .6s; }
.door-panel { position: absolute; inset: 0; border-radius: 40px 40px 0 0; transform-origin: 0 50%; transition: transform 1.1s cubic-bezier(.3, .1, .2, 1);
  display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .18); }
.door.d0 .door-panel { background: var(--team-0); } .door.d1 .door-panel { background: var(--team-1); }
.door.d2 .door-panel { background: var(--team-2); } .door.d3 .door-panel { background: var(--team-3); }
.door-icon { font-size: clamp(1.5rem, 7vw, 2.3rem); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.door-knob { position: absolute; right: 12%; top: 56%; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.door:not(:disabled):hover .door-panel { transform: rotateY(-14deg); }
.door:not(:disabled):active .door-panel { transform: rotateY(-22deg); }
.door-col.mine .door { border-color: var(--brand); box-shadow: 0 0 0 3px var(--sel-bg), var(--glow); }
.door.open .door-panel { transform: rotateY(-100deg); }
.door.open .door-light { opacity: 1; }
.door.open { animation: door-glow 1.6s ease-in-out .9s infinite alternate; }
@keyframes door-glow { to { box-shadow: 0 0 26px 6px var(--accent); } }
.doors.decided .door-col:not(.won) { opacity: .4; filter: grayscale(.7); }
.door-name { margin-top: .3rem; font-weight: 800; font-size: .82rem; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.door-count { font-size: .78rem; color: var(--muted); font-weight: 700; min-height: 1.1em; }
.door-lane { display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem .2rem; min-height: 48px; width: 100%; }
.walker { display: inline-flex; flex-direction: column; align-items: center; width: 40px; position: relative; z-index: 1; }
.walker small { font-size: .62rem; font-weight: 700; max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.walker.walking .ch { animation: walk-step .32s ease-in-out infinite alternate; }
@keyframes walk-step { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-5px) rotate(6deg); } }
.door-start { margin-top: .5rem; padding: .4rem; border: 2px dashed var(--line); border-radius: 16px; text-align: center; }
.door-start small { color: var(--muted); font-weight: 700; }
.door-start { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem .8rem; }
.door-group { flex: 1 1 140px; }
/* Aki már döntött (titokban): toporog, várja, hogy kiderüljön */
.walker.decided .ch { animation: walk-step .5s ease-in-out infinite alternate; }
.door-tip { text-align: center; font-weight: 700; margin: .5rem 0; }

/* ---------- Isteni döntés (👑) ---------- */
.god-btn { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 52px; margin: .6rem 0 .2rem; padding: .45rem .9rem; border: 0; border-radius: 16px;
  background: var(--god-grad); color: var(--god-ink); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.god-btn span { font-size: 1.7rem; animation: god-wiggle 1.8s ease-in-out infinite; }
.god-btn b { flex: 1; }
.god-btn small { font-weight: 700; opacity: .75; }
.god-btn.on { animation: god-pulse 1s ease-in-out infinite alternate; }
@keyframes god-wiggle { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-14deg) scale(1.15); } 90% { transform: rotate(12deg) scale(1.15); } }
@keyframes god-pulse { to { box-shadow: 0 0 0 4px var(--accent), 0 0 22px 4px var(--accent); } }
.doors.god-armed .door { border-color: var(--accent); animation: door-glow .9s ease-in-out infinite alternate; }
/* A döntés után: a nyertes figurája koronát kap, a többiek reszketnek, a korona az ajtóra pottyan */
.god-show { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; margin-bottom: .4rem; }
.god-show h2 { margin: .2rem 0 0; }
.god-tease { margin: 0; font-weight: 800; font-size: 1.05rem; color: var(--pink); animation: cat-pop .6s cubic-bezier(.2, 1.6, .4, 1) .5s both; }
.god-laugher { position: relative; padding: 1.6rem 2.8rem .2rem; animation: god-laugh .26s ease-in-out infinite alternate; transform-origin: 50% 90%; }
@keyframes god-laugh { from { transform: rotate(-5deg) translateY(0); } to { transform: rotate(5deg) translateY(-6px); } }
.god-crown { position: absolute; left: 50%; top: -.2rem; font-size: 2.2rem; transform: translateX(-50%); animation: crown-drop .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes crown-drop { from { transform: translate(-50%, -60px) rotate(-30deg); opacity: 0; } }
.haha { position: absolute; font-weight: 900; font-size: 1.15rem; color: var(--accent); text-shadow: 0 2px 0 var(--god-ink); opacity: 0;
  animation: haha-float 1.6s ease-out infinite; }
.haha.h0 { left: 0; top: 40%; } .haha.h1 { right: 0; top: 30%; animation-delay: .25s; } .haha.h2 { left: 10%; top: 5%; animation-delay: .55s; }
.haha.h3 { right: 8%; top: 0; animation-delay: .8s; } .haha.h4 { left: -4%; top: 70%; animation-delay: 1.05s; } .haha.h5 { right: -4%; top: 62%; animation-delay: 1.3s; font-size: 1.5rem; }
@keyframes haha-float { 0% { opacity: 0; transform: translateY(8px) scale(.6) rotate(-10deg); } 20% { opacity: 1; transform: translateY(0) scale(1.1) rotate(6deg); }
  100% { opacity: 0; transform: translateY(-34px) scale(.9) rotate(-6deg); } }
.doors.mocked .walker:not(.god-walker) .ch { animation: mocked-shiver .14s linear infinite alternate; }
@keyframes mocked-shiver { from { transform: translateX(-1.5px); } to { transform: translateX(1.5px); } }
.walker.god-walker::before { content: '👑'; position: absolute; top: -.85rem; font-size: .95rem; z-index: 2; }
.walker.god-walker .ch { animation: god-laugh .26s ease-in-out infinite alternate; }
.door-col { position: relative; }
.god-drop { position: absolute; top: -.6rem; z-index: 3; font-size: 1.6rem; animation: crown-drop .8s cubic-bezier(.3, 1.5, .5, 1) .4s both; }

/* ---------- Kő-papír-olló ---------- */
.rps { text-align: center; margin: .6rem 0; padding: .6rem; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.rps-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .3rem .6rem; margin: .3rem 0; }
.rps-card { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 84px; padding-top: 2.2rem; }
.rps-card small { color: var(--muted); font-size: .78rem; }
.rps-card.win b { color: var(--good); }
.rps-bubble { position: absolute; top: 0; font-size: 1.6rem; line-height: 1; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: .15rem .4rem; min-width: 2.2rem; }
.rps-bubble.shown { animation: cat-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; border-color: var(--brand); }
.rps-vs { font-weight: 900; color: var(--pink); }
.rps-note { font-weight: 800; margin: .2rem 0 .4rem; }
.rps-btns { display: flex; gap: .5rem; justify-content: center; }
.rps-btn { flex: 1; max-width: 110px; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px solid var(--line);
  border-radius: 18px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); }
.rps-btn span { font-size: 2.1rem; line-height: 1.1; }
.rps-btn:active { transform: scale(.94); border-color: var(--brand); }

/* Aki kevesebb mozgást kér, annak nincs animáció */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Nagyobb képernyő ---------- */
@media (min-width: 700px) {
  .cat-choice { grid-template-columns: 1fr 1fr; }
  .cat-choice .cat-all { grid-column: 1 / -1; }
  h1 { font-size: 1.75rem; }
  main { padding: 1.25rem 1rem; }
  .card { padding: 1.4rem; }
  .topbar { padding: .55rem 1.2rem; gap: 1rem; }
  .brand span { display: inline; }
  #nav a { flex-direction: row; gap: .4rem; padding: .45rem .8rem; min-width: 0; max-width: none; }
  #nav .ico { font-size: 1rem; min-height: 0; }
  #nav .lbl { font-size: .93rem; }
  .hero { flex-direction: row; text-align: left; gap: 1.4rem; padding: 1.8rem; }
  .hero h1 { font-size: 2rem; }
  .hero-logo { width: 96px; height: 96px; padding: 10px; border-radius: 28px; }
  .join-code { margin: .7rem 0 0; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
  .game-link { flex: 1; align-content: start; }
  .realm-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .modal-back { align-items: flex-start; padding: 6vh 1rem; overflow-y: auto; }
  .modal { border-radius: var(--radius); max-height: none; overflow: visible; padding: 1.5rem; animation-name: pop-in; }
  .modal::before { display: none; }
  @keyframes pop-in { from { transform: translateY(10px) scale(.98); opacity: 0; } }
  .actions { position: static; }
  .actions .btn { flex: none; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; }
  .pick-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 46vh; overflow-y: auto; }
  .tagger-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
  .tagger img { max-height: 75vh; }
  #newform { position: static; box-shadow: none; padding: 0; border-radius: 0; background: transparent; }
  .user-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .user-card .row-btns { justify-content: flex-end; max-width: 55%; }
  .card.game { padding: 1.4rem; max-width: 780px; margin-left: auto; margin-right: auto; }
  .round-img { max-height: 52vh; }
  .options { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .qopts { grid-template-columns: 1fr 1fr; }
  .q-text { font-size: 1.6rem; }
  .host-bar { left: 50%; right: auto; transform: translateX(-50%); width: min(780px, 100%); border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0; }
}
