/* Dabar 500 — built for projectors and TVs (1280×720 and up), still usable on a phone. */
:root {
  /* the 4 theme colors (theme.js sets them from the player's palette); everything else is built from them */
  --bg: #0E1730; --tile: #1C2D58; --accent: #F5B63F; --ink: #FFFFFF;
  --onaccent: #1A1300; --shade: rgba(0,0,0,.25); --numshadow: 0 3px 0 rgba(0,0,0,.35);
  --navy: var(--bg); --navy2: color-mix(in srgb, var(--bg) 65%, var(--tile)); --card: var(--tile);
  --line: color-mix(in srgb, var(--tile) 80%, var(--ink)); --muted: color-mix(in srgb, var(--ink) 66%, var(--bg));
  --gold: var(--accent); --gold2: color-mix(in srgb, var(--accent) 72%, var(--ink));
  --tileTop: color-mix(in srgb, var(--tile) 93%, var(--ink)); --tileBot: color-mix(in srgb, var(--tile) 82%, var(--bg));
  --tileHi: color-mix(in srgb, var(--tile) 84%, var(--ink));
  --wash: color-mix(in srgb, var(--ink) 6%, transparent); --wash2: color-mix(in srgb, var(--ink) 13%, transparent);
  --soft: color-mix(in srgb, var(--ink) 88%, var(--bg));
  --orange: #FF5F29; --teal: #19A38F; --red: #E5484D;
  --okText: color-mix(in srgb, var(--teal) 62%, var(--ink)); --badText: color-mix(in srgb, var(--red) 62%, var(--ink));
  --t1: #3E7BFA; --t2: #FF5F29; --t3: #19A38F; --t4: #B45CF0; --t5: #F5B63F; --t6: #E5484D;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: radial-gradient(1200px 700px at 50% -10%, var(--tile) 0%, var(--bg) 60%) fixed var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow-x: hidden; }
button { font: inherit; cursor: pointer; }
a { color: var(--gold); }
.hidden { display: none !important; }

/* ---------- start screen ---------- */
.start { max-width: 1100px; margin: 0 auto; padding: 24px 20px 48px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.top a.home { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.seg { display: inline-flex; background: var(--wash); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink); font-weight: 700; padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.logo { text-align: center; margin: 28px 0 8px; }
.logo h1 { margin: 0; font-size: clamp(54px, 9vw, 110px); line-height: .95; font-weight: 900; letter-spacing: -2px; }
.logo h1 span { color: var(--gold); }
.logo .tag { font-size: clamp(20px, 2.6vw, 30px); color: var(--gold2); font-weight: 700; margin-top: 8px; }
.logo .why { color: var(--muted); font-size: 16px; margin-top: 10px; }
.panel { background: var(--wash); border: 1px solid var(--line); border-radius: 20px; padding: 22px; margin-top: 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.panel h2 { margin: 0 0 12px; font-size: 20px; color: var(--gold2); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.row label.lbl { min-width: 150px; color: var(--muted); font-weight: 600; }
.chip { border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 15px; }
.chip[aria-pressed=true] { border-color: var(--gold); background: color-mix(in srgb, var(--accent) 16%, var(--tile)); color: var(--gold2); }
.chip.locked { opacity: .55; }
.chip .lock { margin-left: 6px; }
.teams input { background: var(--card); border: 2px solid var(--line); color: var(--ink); border-radius: 12px; padding: 10px 12px; font-size: 16px; width: 100%; }
.teams .t { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.teams .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
select { background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 12px; padding: 10px; font-size: 15px; max-width: 100%; }
.toggle { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.toggle input { width: 22px; height: 22px; accent-color: var(--gold); }
.big { display: block; width: 100%; margin-top: 22px; border: 0; border-radius: 16px; padding: 18px; font-size: 24px; font-weight: 900;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); color: var(--onaccent); box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 30%, transparent); }
.big:disabled { opacity: .5; cursor: default; }
.unlock { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(255,95,41,.16), color-mix(in srgb, var(--accent) 14%, transparent)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.unlock p { margin: 4px 0 0; color: var(--soft); }
.btn { text-decoration: none; display: inline-block; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 800; font-size: 16px; background: var(--gold); color: var(--onaccent); }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--ink); }
.btn.teal { background: var(--teal); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.note { color: var(--muted); font-size: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 14px; margin-top: 28px; }
.foot a { color: var(--muted); }

/* ---------- game layout ---------- */
.game { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(14px, 2.4vh, 34px) clamp(16px, 2.4vw, 44px); gap: clamp(10px, 1.8vh, 24px); }
.scores { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: clamp(10px, 1.2vw, 20px); }
.score { background: var(--card); border-radius: 14px; padding: clamp(8px, 1.2vh, 16px) clamp(12px, 1.2vw, 22px); border-bottom: 6px solid var(--c); position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.score.turn { box-shadow: 0 0 0 3px var(--gold), 0 0 24px color-mix(in srgb, var(--accent) 50%, transparent); }
.score .nm { font-weight: 800; font-size: clamp(14px, 1.7vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score .pt { font-weight: 900; font-size: clamp(20px, 2.8vw, 44px); font-variant-numeric: tabular-nums; }
.score .adj { display: flex; flex-direction: column; gap: 4px; opacity: .35; transition: opacity .2s; }
.score:hover .adj, .score:focus-within .adj { opacity: 1; }
.score .adj button { border: 0; background: var(--wash2); color: var(--ink); border-radius: 8px; font-weight: 800; font-size: 14px; padding: 4px 10px; min-width: 52px; }
.board { display: grid; gap: clamp(8px, 1vw, 18px); min-height: 0; }
.cat { background: linear-gradient(180deg, var(--tileTop), var(--tile)); border-radius: 12px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 900; text-transform: uppercase; letter-spacing: .5px; padding: .6vh .5vw; font-size: clamp(12px, 1.55vw, 26px); line-height: 1.1; color: var(--gold2); }
.cell { border: 0; border-radius: 12px; background: linear-gradient(180deg, var(--tileTop) 0%, var(--tileBot) 100%); color: var(--gold); font-weight: 900;
  font-size: clamp(24px, min(4.6vw, 8vh), 80px); font-variant-numeric: tabular-nums; box-shadow: inset 0 -5px 0 var(--shade), 0 4px 10px var(--shade);
  transition: transform .12s, background .12s; text-shadow: var(--numshadow); }
.cell:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); background: linear-gradient(180deg, var(--tileHi), var(--tile)); }
.cell:disabled { background: color-mix(in srgb, var(--ink) 4%, transparent); color: transparent; box-shadow: none; text-shadow: none; cursor: default; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: clamp(14px, 1.2vw, 18px); }
.bar .tools { display: flex; gap: 10px; flex-wrap: wrap; }
.bar .tools button { border: 2px solid var(--line); background: var(--wash); color: var(--soft); border-radius: 12px; padding: 9px 16px; min-height: 44px; font-size: clamp(14px, 1.1vw, 17px); font-weight: 700; }
.bar .tools button:hover { border-color: var(--gold); color: var(--ink); }
.brand { font-weight: 900; color: var(--ink); } .brand span { color: var(--gold); }

/* ---------- question / overlays ---------- */
.overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 93%, transparent); display: flex; align-items: flex-start; justify-content: center; padding: clamp(18px, 4vh, 56px) clamp(18px, 4vw, 80px); z-index: 10; overflow-y: auto; }
/* centered when it fits; when taller than the window it starts at the top and scrolls (short laptop screens) */
.overlay > * { margin-top: auto; margin-bottom: auto; }
.qbox { width: min(1500px, 100%); }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--gold2); font-weight: 900; font-size: clamp(16px, min(2vw, 3.6vh), 32px); text-transform: uppercase; }
.qhead .turnname { color: var(--ink); text-transform: none; }
.timer { height: 1.2vh; min-height: 8px; background: var(--wash2); border-radius: 99px; overflow: hidden; margin: 1.4vh 0 2.2vh; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold), var(--orange)); width: 100%; transition: width .25s linear; }
.qchap { color: var(--gold2); font-weight: 800; font-size: clamp(15px, min(1.9vw, 3.4vh), 30px); letter-spacing: .5px; margin: 0 0 1vh; opacity: .9; }
.qtext { font-size: clamp(24px, min(3.9vw, 7vh), 66px); font-weight: 800; line-height: 1.18; margin: 0 0 3vh; text-wrap: balance; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.8vh, 22px) clamp(10px, 1.4vw, 24px); }
.opt { display: flex; align-items: center; gap: 1vw; text-align: left; border: 3px solid var(--line); background: var(--card); color: var(--ink); border-radius: 16px;
  padding: clamp(10px, 1.8vh, 24px) clamp(14px, 1.4vw, 28px); font-size: clamp(17px, min(2.4vw, 4.2vh), 40px); font-weight: 700; min-height: clamp(56px, 9vh, 120px); }
.opt b { flex: none; display: inline-grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; background: var(--wash2); font-size: .8em; }
.opt:hover:not(:disabled) { border-color: var(--gold); }
.opt.ok { border-color: var(--teal); background: rgba(25,163,143,.25); }
.opt.bad { border-color: var(--red); background: rgba(229,72,77,.25); }
.opt:disabled { cursor: default; }
.qfoot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: clamp(14px, 2.6vh, 32px); flex-wrap: wrap; }
/* action buttons on the big screens scale with the text around them */
.qbox .btn, .final .btn, .special .btn, .winner .btn { font-size: clamp(16px, min(1.6vw, 3vh), 26px); padding: .7em 1.4em; border-radius: 14px; min-height: 48px; }
.qbox .row, .winner .row { gap: 14px; }
.result { font-size: clamp(20px, min(2.8vw, 5vh), 46px); font-weight: 900; }
.result.ok { color: var(--okText); } .result.bad { color: var(--badText); }
.ref { color: var(--muted); font-size: clamp(14px, 1.5vw, 24px); font-weight: 700; }
.special { text-align: center; }
.special .big-emoji { font-size: clamp(64px, min(14vw, 22vh), 200px); }
.special h2 { font-size: clamp(32px, min(6vw, 10vh), 96px); margin: 0; color: var(--gold); }
.special p { font-size: clamp(18px, 2.4vw, 36px); color: var(--ink); }
.pickteam { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 2vh; }
.pickteam button { border: 0; border-radius: 14px; padding: 14px 22px; font-weight: 900; font-size: clamp(16px, 2vw, 30px); color: #fff; background: var(--c); }

/* final round + winner */
.final h2 { font-size: clamp(30px, min(5vw, 8vh), 84px); color: var(--gold); margin: 0 0 1vh; text-align: center; }
.final .sub { text-align: center; color: var(--muted); font-size: clamp(16px, 1.8vw, 28px); margin-bottom: 3vh; }
.wagers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.wager { background: var(--card); border-radius: 16px; padding: 16px; border-bottom: 6px solid var(--c); }
.wager .nm { font-weight: 900; font-size: 22px; }
.wager input { width: 100%; margin-top: 10px; background: var(--navy); border: 2px solid var(--line); color: var(--ink); border-radius: 10px; padding: 10px; font-size: 22px; font-weight: 800; }
.wager .judge { display: flex; gap: 8px; margin-top: 10px; }
.wager .judge button { flex: 1; border: 2px solid var(--line); background: transparent; color: var(--ink); border-radius: 12px; padding: 10px; min-height: 48px; font-weight: 900; font-size: 20px; }
.wager .judge button:hover { border-color: var(--gold); }
.wager .judge button[aria-pressed=true].y { background: var(--teal); border-color: var(--teal); }
.wager .judge button[aria-pressed=true].n { background: var(--red); border-color: var(--red); }
.winner { text-align: center; max-width: 1100px; }
.winner .crown { font-size: clamp(56px, min(10vw, 16vh), 150px); }
.winner h2 { font-size: clamp(36px, min(6.5vw, 11vh), 110px); margin: 0; color: var(--gold); line-height: 1; }
.rank { margin: 3vh auto; display: grid; gap: 10px; max-width: 700px; }
.rank div { display: flex; justify-content: space-between; background: var(--card); border-radius: 14px; padding: 12px 18px; font-size: clamp(18px, 2.2vw, 32px); font-weight: 800; border-left: 8px solid var(--c); }
.cta { background: var(--wash); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-top: 2vh; }
.cta p { margin: 0 0 12px; font-size: clamp(16px, 1.6vw, 22px); }
.cta .row { justify-content: center; }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; }

/* modal (email, help) */
.modal { background: var(--navy2); border: 1px solid var(--line); border-radius: 20px; padding: 26px; width: min(560px, 100%); max-height: 92vh; overflow: auto; }
.modal h2 { margin: 0 0 8px; color: var(--gold); }
.modal input[type=email], .modal input[type=text] { width: 100%; background: var(--card); border: 2px solid var(--line); color: var(--ink); border-radius: 12px; padding: 14px; font-size: 18px; margin: 8px 0; }
.modal ul { padding-left: 20px; line-height: 1.6; }
.modal .row { justify-content: flex-end; }
.err { color: var(--badText); font-weight: 700; }

@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .row label.lbl { min-width: 100%; }
  .opts { grid-template-columns: 1fr; }
  .game { height: auto; min-height: 100vh; }
  .board { min-height: 70vh; }
  .score .adj { opacity: 1; }
}

/* ---------- app ribbon (always visible; the game shrinks to make room) ---------- */
:root { --rib: 36px; }
body.rib-open { padding-bottom: var(--rib); }
body.rib-open .game { height: calc(100vh - var(--rib)); }
body.rib-open .overlay { bottom: var(--rib); }
#ribbon.open { position: fixed; left: 0; right: 0; bottom: 0; height: var(--rib); z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 0 12px; background: linear-gradient(90deg, var(--bg), var(--navy2)); border-top: 1px solid var(--line); font-size: 13px; color: var(--ink); }
#ribbon.open img { border-radius: 7px; flex: none; }
#ribbon .rt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#ribbon .rt b { color: var(--gold); }
#ribbon .rt-s { display: none; }
#ribbon .rs { color: var(--muted); font-size: 12px; white-space: nowrap; margin-left: auto; }
#ribbon .rb { flex: none; background: var(--gold); color: var(--onaccent); font-weight: 800; text-decoration: none; padding: 4px 12px; border-radius: 999px; font-size: 13px; }
#ribbon .rx, #ribbon .ro { flex: none; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 6px; }
#ribbon.pill { position: fixed; right: 12px; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 2px;
  background: var(--navy2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 6px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#ribbon.pill a { display: flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 13px; padding: 2px 4px; }
#ribbon.pill img { border-radius: 5px; }
@media (max-width: 640px) { #ribbon .rs { display: none; } #ribbon .rb { margin-left: auto; } #ribbon.open { font-size: 13px; gap: 8px; } #ribbon .rb { padding: 6px 11px; font-size: 13px; } #ribbon .rt { display: none; } #ribbon .rt.rt-s { display: -webkit-box; white-space: normal; font-size: 12.5px; line-height: 1.25; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } }
/* sign-in */
.ubtns { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ubtns a, .acct a { color: var(--gold2); font-weight: 700; }
.acct { margin: 6px 0 0; }
.modal input.code { font-size: 34px; letter-spacing: 12px; text-align: center; font-weight: 800; max-width: 280px; display: block; margin: 8px auto; }
[hidden] { display: none !important; }
/* the app bar stays off the screen while a game is being played (board, question, final round) */
body.in-game #ribbon { display: none; }
body.in-game.rib-open { padding-bottom: 0; }
body.in-game.rib-open .game { height: 100vh; }
body.in-game.rib-open .overlay { bottom: 0; }
#ribbon.open img { width: 24px; height: 24px; }
#fin { scroll-margin-bottom: clamp(18px, 4vh, 48px); }
.appcta { display: flex; gap: 18px; align-items: center; text-align: left; }
.appcta img { border-radius: 14px; flex: none; }
.appcta p { margin: 0 0 6px; }
.appcta .row { justify-content: flex-start; margin-top: 10px; }
@media (max-width: 640px) { .appcta { flex-direction: column; text-align: center; } .appcta .row { justify-content: center; } }
.prep { display: flex; gap: 18px; align-items: center; }
.prep img { border-radius: 14px; flex: none; }
.prep p { margin: 4px 0 0; color: var(--soft); }
.prep > div:nth-child(2) { flex: 1; min-width: 0; }
@media (max-width: 760px) { .prep { flex-direction: column; text-align: center; } }

/* Cookie notice (consent.js): same look and rules as jocaed.com; Reject and Accept are equal on purpose. */
.dcookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 9999; max-width: 860px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px; padding: 14px 16px; color: #fff; background: #0f172a;
  border: 1px solid rgba(255,255,255,.18); border-radius: 10px; box-shadow: 0 18px 42px rgba(0,0,0,.45); line-height: 1.4; }
.dcookie p { margin: 0; font-size: 14px; flex: 1; }
.dcookie a { color: #F5B63F; font-weight: 800; }
.dcookie-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.dcookie button { min-width: 110px; min-height: 44px; border: 0; border-radius: 8px; padding: 9px 13px; color: #111827;
  background: #F5B63F; font: inherit; font-size: 14px; font-weight: 900; cursor: pointer; }
@media (max-width: 640px) {
  .dcookie { flex-direction: column; align-items: stretch; gap: 10px; left: 10px; right: 10px; bottom: 10px; }
  .dcookie-btns button { flex: 1; min-width: 0; }
}
/* tawk.to runs only for the live visitor list: never show its bubble or chat window over the game. */
iframe[title*="chat" i], .widget-visible iframe { display: none !important; visibility: hidden !important; }

/* ---------- colors: palettes + my colors (theme.js) ---------- */
.themes .lead { margin: 0 0 12px; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 106px; padding: 8px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; font-size: 13px; line-height: 1.15; }
.swatch[aria-pressed=true] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.sw-prev { width: 100%; height: 46px; border-radius: 9px; background: var(--sb); display: grid; place-items: center; border: 1px solid rgba(128,128,128,.35); }
.sw-prev i { font-style: normal; background: var(--st); color: var(--sa); font-weight: 900; font-size: 18px; padding: 3px 10px; border-radius: 6px; }
.tcustom { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 18px; }
.tcustom h3 { margin: 0 0 4px; font-size: 16px; color: var(--gold2); }
.cpicks { display: grid; gap: 8px; }
.cpick { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); cursor: pointer; }
.cpick input { width: 48px; height: 38px; border: 2px solid var(--line); border-radius: 10px; background: transparent; padding: 2px; cursor: pointer; flex: none; }
.tprev { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; border-radius: 14px; border: 1px solid var(--line);
  background: radial-gradient(400px 200px at 50% -20%, var(--tile) 0%, var(--bg) 70%) var(--bg); pointer-events: none; }
.tprev .cat { font-size: 11px; min-height: 34px; padding: 4px; }
.tprev .cell { font-size: clamp(20px, 2.6vw, 30px); padding: 6px 0; display: grid; place-items: center; }
.tprev .opt { grid-column: 1 / -1; font-size: 15px; min-height: 0; padding: 8px 12px; border-width: 2px; }
.twarn { color: var(--badText); font-weight: 700; margin: 12px 0 0; }
.modal.tmodal { width: min(760px, 100%); }
@media (max-width: 640px) { .tcustom { grid-template-columns: 1fr; } .swatch { width: calc(33.3% - 7px); } }
