:root {
  --bg1: #130b2b;
  --bg2: #2a0f4a;
  --card: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f6f2ff;
  --muted: #b9acd8;
  --pink: #ff4d8d;
  --cyan: #38d6ff;
  --yellow: #ffd23f;
  --green: #4be37c;
  --red: #ff5c6c;
  --a: #ff4d8d;
  --b: #38d6ff;
  --c: #ffd23f;
  --d: #7cff6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 700px at 15% -10%, #4a1a8a 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #7a1456 0%, transparent 55%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  min-height: 100vh;
}
.brand {
  display: block; text-align: center; color: inherit; text-decoration: none;
  font-weight: 900; letter-spacing: -0.02em; font-size: 1.6rem; padding: 16px 24px;
}
.brand span { color: var(--pink); }
main { padding: 0 24px 32px; max-width: 1200px; margin: 0 auto; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin: 0.3em 0; letter-spacing: -0.02em; }
h2 { margin: 0 0 12px; }
.hint, .muted { color: var(--muted); }
.view { display: none; }
body[data-phase~="x"] .view { display: none; }

.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 800;
  color: #1b0b33; background: linear-gradient(135deg, var(--yellow), #ff9f43);
  padding: 14px 26px; border-radius: 14px; box-shadow: 0 6px 22px rgba(255, 159, 67, 0.35);
  transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.big { font-size: 1.4rem; padding: 20px 40px; }
input, select {
  font: inherit; color: var(--text); background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
}
select option { color: #111; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 12px 0 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; backdrop-filter: blur(6px); }
.center { text-align: center; }
.error { background: rgba(255, 92, 108, 0.18); border: 1px solid var(--red); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }

/* progress bar */
.bar { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin: 14px 0; }
.bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); transform-origin: left; }

/* players */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); font-weight: 700;
}
.chip .dot { width: 14px; height: 14px; border-radius: 50%; }
.chip.off { opacity: 0.45; }
.chip.done { border-color: var(--green); }
.chip .tag { font-size: 0.7rem; color: var(--yellow); }

/* host */
.code {
  font-size: clamp(4rem, 14vw, 9rem); font-weight: 900; letter-spacing: 0.12em; line-height: 1;
  background: linear-gradient(135deg, var(--cyan), var(--pink)); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.join-url { font-size: 1.3rem; color: var(--cyan); word-break: break-all; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.opt {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 18px;
  font-size: clamp(1.1rem, 2.2vw, 1.7rem); font-weight: 700; background: var(--card);
  border: 3px solid var(--line);
}
.opt b { display: inline-grid; place-items: center; width: 2.1em; height: 2.1em; border-radius: 12px; color: #1b0b33; flex: none; }
.opt.c0 b { background: var(--a); } .opt.c1 b { background: var(--b); }
.opt.c2 b { background: var(--c); } .opt.c3 b { background: var(--d); }
.opt.correct { border-color: var(--green); background: rgba(75, 227, 124, 0.2); }
.opt.wrong { opacity: 0.4; }
.countdown { font-size: clamp(3rem, 10vw, 7rem); font-weight: 900; text-align: center; }
.eq { display: flex; gap: 6px; justify-content: center; align-items: flex-end; height: 70px; margin: 10px 0; }
.eq i { width: 10px; background: linear-gradient(var(--pink), var(--cyan)); border-radius: 4px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2n) { animation-delay: -0.3s; } .eq i:nth-child(3n) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { height: 12px; } 50% { height: 66px; } }
.cover { width: 160px; height: 160px; border-radius: 18px; object-fit: cover; background: var(--card); flex: none; }
.reveal-head { display: flex; gap: 20px; align-items: center; margin: 12px 0 18px; }
.reveal-head .t { font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 800; }
.board { width: 100%; border-collapse: collapse; }
.board td { padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 1.25rem; }
.board td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.board .plus { color: var(--green); font-size: 0.95rem; }
.medal { font-size: 1.6rem; width: 2.4rem; }
.round-info { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 700; }

/* phone */
body.phone main { max-width: 520px; padding: 0 16px 28px; }
.pbtns { display: grid; gap: 12px; margin-top: 10px; }
.pbtn {
  appearance: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: #1b0b33; font-weight: 800;
  padding: 18px 16px; border-radius: 18px; display: flex; gap: 12px; align-items: center; font-size: 1.1rem;
  min-height: 74px; transition: transform 0.08s, opacity 0.2s;
}
.pbtn:active:not(:disabled) { transform: scale(0.97); }
.pbtn:disabled { opacity: 0.35; }
.pbtn.picked { opacity: 1; outline: 4px solid #fff; }
.pbtn.c0 { background: var(--a); } .pbtn.c1 { background: var(--b); }
.pbtn.c2 { background: var(--c); } .pbtn.c3 { background: var(--d); }
.pbtn.correct { outline: 4px solid var(--green); opacity: 1; }
.pbtn b { background: rgba(0, 0, 0, 0.18); border-radius: 10px; width: 2em; height: 2em; display: grid; place-items: center; flex: none; }
.big-result { font-size: 2.2rem; font-weight: 900; margin: 8px 0; }
.big-result.good { color: var(--green); } .big-result.bad { color: var(--red); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 800px) {
  .grid2 { grid-template-columns: 1fr; }
  .reveal-head { flex-direction: column; align-items: flex-start; }
}

/* --- eredeti játék mintájára: kijelző alsó játékossor, telefon eredménysáv --- */
.pill {
  display: block; width: fit-content; max-width: 100%; margin: 6px auto 14px; padding: 12px 28px;
  border-radius: 99px; background: rgba(90, 40, 140, 0.85); border: 1px solid var(--line);
  font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; text-align: center;
}
.pill b { color: var(--yellow); }
.players-row { display: flex; flex-wrap: wrap; gap: 18px; justify-content: flex-start; margin-top: 18px; }
.pl { text-align: center; width: 96px; }
.pl .av {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 4px; display: grid; place-items: center;
  font-size: 1.9rem; font-weight: 900; color: #1b0b33; border: 4px solid var(--yellow);
}
.pl.done .av { border-color: var(--green); }
.pl.off { opacity: 0.4; }
.pl .pn { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .ps { font-weight: 800; font-size: 1.1rem; }
.fast { color: var(--yellow); font-weight: 800; font-size: 1.2rem; text-transform: uppercase; margin-bottom: 10px; }
.badge {
  display: inline-grid; place-items: center; min-width: 2.3em; height: 2.3em; border-radius: 50%;
  background: #6b2fa5; border: 3px solid var(--yellow); font-weight: 900; font-size: 0.85rem; color: #fff;
}
.band {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px;
  font-weight: 900; font-size: 1.3rem; margin-bottom: 6px; background: var(--green); color: #fff;
}
.band.bad { background: var(--red); }
.pts { font-weight: 800; margin: 6px 0 12px; }
.pcover { width: 100%; max-width: 340px; aspect-ratio: 1; border-radius: 16px; object-fit: cover; background: var(--card); }
.sol { margin: 14px 0; padding: 18px; border-radius: 22px; background: rgba(107, 47, 165, 0.85); border: 3px solid rgba(255, 255, 255, 0.5); }
.sol-t { font-size: 1.3rem; font-weight: 800; }
.sol-a { color: var(--muted); margin-top: 4px; text-transform: uppercase; }

/* kompaktabb kijelző, hogy a játékosok és pontszámaik is elférjenek */
.countdown { font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 1.05; }
.eq { height: 44px; margin: 4px 0; }
@keyframes eq { 0%, 100% { height: 10px; } 50% { height: 42px; } }
.opt { padding: 12px 18px; }
.players-row { margin-top: 10px; }

/* kör vége: nagy borító a megoldással */
.reveal-head { gap: 28px; margin: 8px 0 14px; }
.cover { width: 220px; height: 220px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45); }
.reveal-head .t { font-size: clamp(1.6rem, 3.4vw, 2.8rem); line-height: 1.15; }
.opt.wrong b { opacity: 0.6; }
.pcover { max-width: 240px; }

/* avatarok, zenecímkék */
.chip .dot { width: 28px; height: 28px; font-size: 16px; line-height: 1; display: inline-grid; place-items: center; border-radius: 50%; }
.chip .tag-vip { font-size: 0.7rem; color: var(--yellow); }
.pl .av { font-size: 2.2rem; }
.avgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 6px; }
.avb {
  aspect-ratio: 1; font-size: 1.4rem; line-height: 1; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); cursor: pointer; padding: 0; color: inherit;
}
.avb.on { border-color: var(--yellow); background: rgba(255, 210, 63, 0.22); }
.avb:disabled { opacity: 0.2; cursor: not-allowed; }
.avbox { margin: 8px 0 14px; }
.avbox summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.grp { font-size: 0.8rem; color: var(--muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 8px 14px; border-radius: 99px; font: inherit; font-weight: 700; cursor: pointer;
}
.tag.on { background: linear-gradient(135deg, var(--pink), #ff8a3d); color: #1b0b33; border-color: transparent; }
.tag.custom::after { content: ' ×'; }
.addrow { display: flex; gap: 8px; margin-top: 12px; }
.addrow input { flex: 1; min-width: 0; }
.addrow .btn { padding: 12px 16px; }

.count { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: .95rem; background: rgba(255,255,255,.08); }
.count.low { background: rgba(239,68,68,.22); color: #fca5a5; }
.count.mid { background: rgba(250,204,21,.2); color: #fde047; }
.count.high { background: rgba(34,197,94,.22); color: #86efac; }

.musicbox { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 22px auto 6px; max-width: 760px; padding: 16px 22px; border-radius: 20px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); text-align: left; }
.mb-covers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 150px; flex: none; }
.mb-covers img, .mb-covers i { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: linear-gradient(135deg, #7c3aed, #ec4899); display: block; }
.mb-k { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: #b8a9d9; }
.mb-t { font-size: 2rem; font-weight: 900; line-height: 1.1; margin: 2px 0; }
.mb-d { color: #b8a9d9; }
.mb-n { margin-top: 4px; font-weight: 700; }
.mb-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mb-tag { padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.14); font-weight: 800; font-size: 1.2rem; }

.stepper { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; touch-action: pan-y; }
.stepper button { flex: none; width: 44px; height: 54px; border-radius: 14px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.stepper button:active { background: rgba(255,255,255,.2); }
.st-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; justify-content: center; padding: 6px 10px; border-radius: 14px; background: rgba(255,255,255,.06); min-height: 54px; }
.st-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; transition: background .2s; }
.st-n { font-weight: 800; line-height: 1.15; }
.st-c { font-size: .85rem; color: #b8a9d9; }
.dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 2px 0 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.22); }
.dots i.on { background: #ec4899; width: 14px; border-radius: 4px; }

.mb-ic { flex: none; width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; font-size: 3.6rem; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.tabs { display: flex; gap: 6px; padding: 4px; margin: 8px 0 10px; border-radius: 14px; background: rgba(255,255,255,.08); }
.tabs button { flex: 1; padding: 10px 8px; border: 0; border-radius: 10px; background: transparent; color: #cbbfe8; font: inherit; font-weight: 800; cursor: pointer; }
.tabs button.on { background: linear-gradient(135deg, #ffd23f, #ff9a3c); color: #1a1030; }

.board tr.thead td { font-size: .85rem; font-weight: 700; color: #b8a9d9; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 4px; }
.stats { display: grid; gap: 8px; margin: 14px 0; text-align: left; }
.stats .st { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.07); }
.stats .st b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.stats .st small { color: #b8a9d9; font-size: .8rem; }

.langsw { position: fixed; top: 10px; right: 12px; z-index: 50; display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; background: rgba(0,0,0,.35); backdrop-filter: blur(6px); font-size: .8rem; color: #b8a9d9; }
.langsw button { border: 0; background: transparent; color: #b8a9d9; font: inherit; font-weight: 800; cursor: pointer; padding: 2px 4px; }
.langsw button.on { color: #ffd23f; }

.credit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; text-align: center; padding: 5px 10px; font-size: .78rem; color: rgba(203,191,232,.75); background: linear-gradient(to top, rgba(20,10,40,.75), rgba(20,10,40,0)); pointer-events: none; }
.credit a { color: #ffd23f; text-decoration: none; font-weight: 700; pointer-events: auto; }
.credit a:hover { text-decoration: underline; }
body { padding-bottom: 30px; }
