/* ThreeTwoOne: a night match. Striped grass under floodlights, chalk lines, LED scoreboards
   (dot-matrix amber for words, red for numbers), stadium signage for buttons. */
:root {
  --bg: #06120B; --bg2: rgba(3, 10, 6, .72); --panel: rgba(4, 14, 9, .78); --line: rgba(236, 244, 228, .16);
  --chalk: rgba(240, 246, 232, .62); --ink: #F1F5EC; --mute: #9DB3A2;
  --amber: #FFB000; --green: #39E07A; --red: #FF3B30; --yellow: #FFD60A; --blue: #8FC8FF;
  --led: #FFB000; --led-red: #FF3B30; --board: #050505;
  --radius: 6px;
  --score: "Chakra Petch", ui-monospace, Menlo, Consolas, monospace;
  --sign: "Big Shoulders Display", "Chakra Petch", Impact, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink); font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; background-color: var(--bg);
  background-image:
    radial-gradient(60% 50% at 8% -12%, rgba(255, 252, 225, .22), transparent 70%),
    radial-gradient(60% 50% at 92% -12%, rgba(255, 252, 225, .22), transparent 70%),
    radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(0, 0, 0, .55) 100%),
    repeating-linear-gradient(90deg, #0B2715 0 72px, #0E2E19 72px 144px);
  background-attachment: fixed;
}
a { color: var(--blue); }
button, input { font: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }

/* LED: dot-matrix lettering with a glow */
.led, .hero h1, .vsname, .vsscore b, .big:not(.btn), .timer, #codeval {
  -webkit-mask: radial-gradient(circle at center, #000 62%, transparent 66%) 0 0 / 3px 3px;
          mask: radial-gradient(circle at center, #000 62%, transparent 66%) 0 0 / 3px 3px;
}

.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 18px; }
.brand { font-family: var(--score); font-weight: 700; font-size: 26px; letter-spacing: .06em; color: var(--led); text-decoration: none;
  text-shadow: 0 0 10px rgba(255, 176, 0, .6); }
.brand b { color: var(--led-red); text-shadow: 0 0 10px rgba(255, 59, 48, .6); }
.nav .right { display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--bg2); }
.seg button { background: none; border: 0; color: var(--mute); padding: 6px 12px; cursor: pointer; font-family: var(--score); font-weight: 700; }
.seg button.on { background: var(--led); color: #1b1100; }

/* ---------- home: the stadium scoreboard ---------- */
.hero { padding: 6px 0 18px; }
.scoreboard { position: relative; background: var(--board); border-radius: 10px; padding: 22px 18px 18px; text-align: center;
  box-shadow: 0 0 0 3px #1c1f1d, 0 0 0 5px #3a403c, 0 22px 50px rgba(0, 0, 0, .6), inset 0 0 40px rgba(255, 176, 0, .06); }
.scoreboard::before, .scoreboard::after { content: ""; position: absolute; bottom: -26px; width: 10px; height: 26px; background: linear-gradient(90deg, #2b302d, #4a514c, #2b302d); }
.scoreboard::before { left: 18%; } .scoreboard::after { right: 18%; }
.hero h1 { font-family: var(--score); font-weight: 700; font-size: clamp(64px, 16vw, 132px); margin: 0; line-height: .95; letter-spacing: .06em;
  color: var(--led-red); text-shadow: 0 0 18px rgba(255, 59, 48, .7); }
.hero h1 span { color: var(--led); text-shadow: 0 0 18px rgba(255, 176, 0, .7); }
.hero .ticker { margin: 12px auto 0; max-width: 620px; overflow: hidden; white-space: nowrap; border-top: 1px solid #1d1d1d; padding-top: 10px; }
.hero .ticker p { display: inline-block; margin: 0; font-family: var(--score); font-weight: 700; color: var(--led); letter-spacing: .04em; text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255, 176, 0, .55); padding-left: 100%; animation: ticker 18s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }
.hero .pitch-gap { height: 30px; }

.card { background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card h3 { font-family: var(--sign); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 22px; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { color: var(--mute); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
input[type=text] { width: 100%; background: rgba(0, 0, 0, .45); border: 2px solid var(--line); color: var(--ink); border-radius: 4px; padding: 12px 14px; }
input[type=text]:focus { outline: none; border-color: var(--led); box-shadow: 0 0 0 3px rgba(255, 176, 0, .2); }

/* buttons: stadium signage */
.btn { text-decoration: none; appearance: none; border-radius: 4px; padding: 13px 20px; font-weight: 800; cursor: pointer; background: rgba(0, 0, 0, .4); color: var(--ink);
  border: 2px solid var(--chalk); transition: transform .12s cubic-bezier(.3, 1.6, .5, 1), filter .12s, box-shadow .12s; }
.btn:hover { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.big { width: 100%; font-family: var(--sign); font-weight: 900; font-size: 30px; line-height: 1; padding: 16px 20px; letter-spacing: .05em; text-transform: uppercase; }
.btn.amber { background: var(--led); color: #1b1100; border-color: transparent; box-shadow: 0 6px 0 #9a6a00, 0 0 24px rgba(255, 176, 0, .35); }
.btn.amber:active:not(:disabled) { box-shadow: 0 2px 0 #9a6a00; transform: translateY(4px); }
.btn.green { background: var(--green); color: #032010; border-color: transparent; box-shadow: 0 6px 0 #158a43; }
.btn.green:active:not(:disabled) { box-shadow: 0 2px 0 #158a43; transform: translateY(4px); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { padding: 8px 12px; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mute { color: var(--mute); }
.small { font-size: 14px; }
.center { text-align: center; }
.msg { min-height: 22px; color: var(--led); font-weight: 700; }
.msg.err { color: var(--red); }
.hidden { display: none !important; }
.steps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; color: var(--mute); font-size: 14px; }
.steps li::before { counter-increment: s; content: counter(s); font-family: var(--score); font-weight: 700; font-size: 20px; text-align: center;
  background: var(--board); color: var(--led-red); border-radius: 4px; line-height: 34px; text-shadow: 0 0 8px rgba(255, 59, 48, .6); }

/* ---------- match: the scoreboard on top (VS bar) ---------- */
.vsbar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 2px 12px;
  margin: 4px 0 18px; padding: 16px 16px 14px; background: var(--board); border-radius: 8px; isolation: isolate;
  box-shadow: 0 0 0 3px #1c1f1d, 0 0 0 5px #3a403c, 0 16px 40px rgba(0, 0, 0, .55); transition: padding .5s cubic-bezier(.2, .9, .3, 1); }
.vsside { display: flex; align-items: center; gap: 10px; min-width: 0; grid-row: 1; }
.vsside.l { grid-column: 1; } .vsside.r { grid-column: 3; }
.vsscore { grid-column: 2; grid-row: 1; }
.vsmid { grid-column: 2; grid-row: 2; }
.vsside.r { flex-direction: row-reverse; }
.ava { flex: none; width: 36px; height: 36px; border-radius: 4px; display: grid; place-items: center; font-style: normal;
  font-family: var(--score); font-weight: 700; font-size: 16px; color: #04120a; background: var(--green); }
.vsside.r .ava { background: var(--blue); color: #061423; }
.vsname { font-family: var(--score); font-weight: 700; text-transform: uppercase; font-size: clamp(18px, 4.4vw, 32px); letter-spacing: .06em;
  color: var(--led); text-shadow: 0 0 10px rgba(255, 176, 0, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
.vsmid { display: grid; justify-items: center; gap: 2px; }
.vsscore { display: grid; justify-items: center; line-height: 1; }
.vsscore small { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #6f6f6f; margin-bottom: 4px; font-weight: 700; }
.vsscore b { font-family: var(--score); font-size: clamp(34px, 8vw, 54px); letter-spacing: .08em; color: var(--led-red); text-shadow: 0 0 14px rgba(255, 59, 48, .75); padding: 2px 4px; }
.vslabel { font-family: var(--score); color: #8a8a8a; font-weight: 700; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.vslabel:empty { display: none; }
.vsbar .vs { display: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
/* a side's points, in order (where the lamps were): the player's surname, or a red card the other side got */
.strip { display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.strip:empty { display: none; }
.strip i { font-style: normal; font-family: var(--score); font-weight: 700; font-size: 11px; letter-spacing: .03em; line-height: 1;
  padding: 4px 7px; border-radius: 4px; max-width: 7.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #04120a; background: var(--green); box-shadow: 0 0 10px rgba(57, 224, 122, .35); animation: pop .3s ease-out both; }
.strip i.rv { color: #061423; background: var(--blue); box-shadow: 0 0 10px rgba(143, 200, 255, .35); }
.strip i.red { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; padding: 2px 7px; }
.strip i.red::before { content: ""; width: 9px; height: 13px; border-radius: 2px; transform: rotate(10deg);
  background: linear-gradient(160deg, #ff6b61, var(--red)); box-shadow: 0 1px 3px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .3); }
/* the first look at the rival: the board switches on, names slide in */
.vsbar.intro { padding: 34px 18px 30px; }
.vsbar.intro .vsname { font-size: clamp(24px, 7vw, 54px); }
.vsbar.intro .vsside.l { animation: vsInL .5s cubic-bezier(.2, .9, .3, 1) both; }
.vsbar.intro .vsside.r { animation: vsInR .5s cubic-bezier(.2, .9, .3, 1) both; }
.vsbar.intro .vsmid { animation: boardOn .9s steps(1) both; }
@keyframes vsInL { from { transform: translateX(-60px); opacity: 0; } }
@keyframes vsInR { from { transform: translateX(60px); opacity: 0; } }
@keyframes boardOn { 0% { opacity: 0; } 20% { opacity: 1; } 30% { opacity: .2; } 45% { opacity: 1; } 55% { opacity: .4; } 70%, 100% { opacity: 1; } }
@media (max-width: 520px) { .vsbar .ava { display: none; } .vsbar { gap: 8px; padding: 12px 10px; } }

/* ---------- match: the pitch ---------- */
.arena { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.centre { grid-column: 1 / -1; position: relative; z-index: 1; justify-self: center; text-align: center; min-height: 118px; min-width: min(300px, 80%);
  display: grid; place-items: center; gap: 2px; padding: 10px 18px; background: var(--board); border-radius: 8px;
  box-shadow: 0 0 0 3px #1c1f1d, 0 0 0 5px #3a403c, 0 14px 30px rgba(0, 0, 0, .5); }
/* a real pitch, 105 x 68: halfway line, centre circle, penalty and goal areas, arcs, spots */
.pitch { --l: 2px solid var(--chalk); grid-column: 1 / -1; position: relative; aspect-ratio: 105 / 68; max-height: 420px; width: 100%; justify-self: center;
  border: var(--l); border-radius: 2px; overflow: hidden; container-type: inline-size;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 9.52%, transparent 9.52% 19.04%), rgba(10, 40, 20, .55);
  box-shadow: 0 0 0 6px rgba(10, 40, 20, .55), 0 18px 40px rgba(0, 0, 0, .45); margin: 6px 0; }
.pitch::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: var(--l); transform: translateX(-1px); }
.pitch::after { content: ""; position: absolute; left: 50%; top: 50%; width: 17.4%; aspect-ratio: 1; border: var(--l); border-radius: 50%; transform: translate(-50%, -50%); }
.pitch .spot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--chalk); }
.pitch .box { position: absolute; top: 20.4%; height: 59.2%; width: 15.7%; border: var(--l); }
.pitch .box.l { left: -2px; } .pitch .box.r { right: -2px; }
.pitch .box::before { content: ""; position: absolute; top: 31.8%; height: 36.4%; width: 33.3%; border: var(--l); }   /* goal area */
.pitch .box.l::before { left: -2px; } .pitch .box.r::before { right: -2px; }
.pitch .box::after { content: ""; position: absolute; top: 50%; width: 34%; aspect-ratio: 1; border: var(--l); border-radius: 50%; transform: translateY(-50%);
  clip-path: inset(0 0 0 50%); }   /* the arc outside the box */
.pitch .box.l::after { right: -17%; } .pitch .box.r::after { left: -17%; clip-path: inset(0 50% 0 0); }
.half { position: absolute; top: 0; bottom: 0; width: 50%; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 0 6% 0 18%; }
.half.l { left: 0; } .half.r { right: 0; padding: 0 18% 0 6%; }
.slot { width: clamp(64px, 22cqw, 150px); aspect-ratio: 1; display: grid; place-items: center; }
.slot img { width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .65)); }
.slot .badge { width: 88%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--score); font-weight: 700; font-size: clamp(18px, 5cqw, 34px); color: #fff;
  background: radial-gradient(circle at 35% 30%, #2d6b45, #0b2a17); border: 3px solid var(--chalk); }
.slot .dice { font-size: 40px; }
.clubname { text-align: center; font-family: var(--sign); font-weight: 800; font-size: clamp(14px, 3.2cqw, 24px); text-transform: uppercase; letter-spacing: .04em; min-height: 1.2em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .7); line-height: 1.05; }
/* each side's bench under the pitch: name, rounds, cards, what it said */
/* each side's board under the pitch, like the scoreboard: a coloured edge (me green, rival blue) */
.side { --team: var(--blue); position: relative; display: flex; flex-direction: column; min-height: 132px; overflow: hidden;
  background: linear-gradient(180deg, #0a0a0a, #050505); border-radius: 8px;
  box-shadow: inset 5px 0 0 var(--team), 0 0 0 3px #1c1f1d, 0 0 0 5px #3a403c, 0 14px 30px rgba(0, 0, 0, .45); }
.side.me { --team: var(--green); }
.side .who { display: flex; align-items: center; gap: 10px; padding: 10px 12px 9px 17px; border-bottom: 1px solid #1d1f1e;
  background: linear-gradient(90deg, color-mix(in srgb, var(--team) 16%, transparent), transparent 70%); }
.side .name { flex: 1; min-width: 0; font-family: var(--sign); font-weight: 900; font-size: 22px; text-transform: uppercase; letter-spacing: .05em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.side .answers { padding: 10px 12px 4px 17px; flex: 1; }
.side .answers:empty::before { content: attr(data-empty); color: #4a4f4c; font-family: var(--score); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.side .heard { padding: 6px 12px 9px 17px; border-top: 1px solid #161817; font-style: normal; font-family: var(--score); font-size: 12px; color: #6d7570; letter-spacing: .03em; }
.side .heard:not(:empty):not(.state)::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; vertical-align: 1px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 6px var(--red); }
.centre .big:empty { display: none; }
.side .heard:empty { display: none; }
.big { font-family: var(--score); font-weight: 700; font-size: clamp(54px, 15vw, 104px); line-height: 1; letter-spacing: .06em; }
.big.amber:not(.btn) { color: var(--led); text-shadow: 0 0 18px rgba(255, 176, 0, .7); }
.big.green:not(.btn) { color: var(--green); text-shadow: 0 0 18px rgba(57, 224, 122, .7); }
.big.red:not(.btn) { color: var(--led-red); text-shadow: 0 0 18px rgba(255, 59, 48, .7); font-size: clamp(30px, 7vw, 54px); }
.phase { font-family: var(--score); color: var(--led); letter-spacing: .12em; text-transform: uppercase; font-size: 14px; font-weight: 700; text-shadow: 0 0 8px rgba(255, 176, 0, .5); }
.timer { font-family: var(--score); font-size: 40px; font-weight: 700; color: var(--led); line-height: 1; text-shadow: 0 0 12px rgba(255, 176, 0, .6); }
.timer.low { color: var(--led-red); text-shadow: 0 0 12px rgba(255, 59, 48, .7); }
.hint { font-family: var(--score); font-weight: 700; font-size: 18px; color: var(--green); letter-spacing: .08em; text-shadow: 0 0 10px rgba(57, 224, 122, .6); margin-top: 2px; }
/* a side locked after a wrong name: red strip under the name */
.lock { display: none; padding: 5px 12px 5px 17px; font-family: var(--score); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: linear-gradient(90deg, rgba(255, 59, 48, .55), rgba(255, 59, 48, .15)); border-bottom: 1px solid #1d1f1e; }
.lock.on { display: block; animation: fxShake .4s; }
.side.locked .answers { opacity: .5; }
/* clubs already played this match */
.used { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 0 12px 6px 17px; font-size: 11px; color: var(--mute); }
.used:empty { display: none; }
.used b { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10px; margin-right: 2px; }
.chip { padding: 2px 7px; border-radius: 10px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); color: var(--ink); white-space: nowrap; }
.cards { display: inline-flex; gap: 3px; min-width: 0; }
.cards i { width: 11px; height: 15px; border-radius: 2px; display: inline-block; transform: rotate(10deg); box-shadow: 0 2px 4px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .25); }
.cards i.y { background: linear-gradient(160deg, #ffe55c, var(--yellow)); } .cards i.r { background: linear-gradient(160deg, #ff6b61, var(--red)); }
.answers { display: grid; gap: 6px; align-content: start; }
.ans { padding: 6px 10px; border-radius: 4px; background: #0f1110; font-weight: 800; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-left: 3px solid #2a2d2b; }
.ans.ok { color: var(--green); border-left-color: var(--green); background: linear-gradient(90deg, rgba(57, 224, 122, .14), rgba(57, 224, 122, .03)); }
.ans.no { color: #ff8a80; border-left-color: var(--red); background: linear-gradient(90deg, rgba(255, 59, 48, .12), rgba(255, 59, 48, .02)); }
.ans.no > span:nth-child(2) { text-decoration: line-through; text-decoration-thickness: 2px; }
.ans .mark { font-family: var(--score); font-size: 18px; text-decoration: none; }
.ans .why { flex-basis: 100%; font-weight: 500; font-size: 12px; text-decoration: none; display: block; color: var(--mute); }
.heard { color: var(--mute); font-size: 13px; min-height: 18px; font-style: italic; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.heard.miss, .side .heard.miss { color: var(--led); font-style: normal; font-weight: 700; }
.micstate { font-size: 12px; color: var(--mute); display: flex; gap: 6px; align-items: center; background: var(--bg2); padding: 5px 10px; border-radius: 4px; }
.micstate i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: inline-block; }
.micstate.on i { background: var(--red); box-shadow: 0 0 8px var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.micstate.warn { color: var(--red); font-weight: 700; }
.micstate.warn i { background: var(--red); animation: none; box-shadow: none; }
.toolbar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 560px) {
  .side .who { padding: 8px 8px 8px 13px; gap: 6px; flex-wrap: wrap; }
  .side .answers, .side .heard { padding-left: 13px; padding-right: 8px; }
  .side .name { font-size: 18px; flex-basis: 100%; }
}

/* results overlay: the big screen */
.overlay { position: fixed; inset: 0; background: rgba(2, 8, 4, .8); display: grid; place-items: center; padding: 16px; z-index: 40; backdrop-filter: blur(3px); }
.overlay .card { width: min(560px, 100%); text-align: center; background: var(--board); border: 0; border-radius: 10px;
  box-shadow: 0 0 0 3px #1c1f1d, 0 0 0 5px #3a403c, 0 30px 60px rgba(0, 0, 0, .7); }
.overlay h2 { font-family: var(--sign); font-weight: 900; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 8px; font-size: 34px; line-height: 1.05; color: var(--led); text-shadow: 0 0 14px rgba(255, 176, 0, .5); }
.overlay h2.winner { color: var(--green); text-shadow: 0 0 14px rgba(57, 224, 122, .55); }
.also { color: var(--mute); font-size: 14px; max-height: 120px; overflow: auto; margin-top: 8px; }
.overlay .rating { font-family: var(--score); color: var(--led); font-size: 18px; margin: 4px 0 8px; }
.rating .up { color: var(--green); } .rating .down { color: var(--red); }
.logos { display: flex; justify-content: center; gap: 20px; align-items: center; margin: 8px 0; font-family: var(--sign); font-weight: 800; text-transform: uppercase; }
.logos img { height: 64px; }
.logos .vs { font-family: var(--score); color: var(--led-red); }
.winner { font-family: var(--score); font-size: 28px; color: var(--green); }
.cheat { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(61,220,132,.12); color: var(--green); font-weight: 700; line-height: 1.6; }
.cheat b { color: var(--mute); font-weight: 400; margin-right: 6px; }
.dev { border: 2px dashed var(--line); border-radius: var(--radius); padding: 10px; margin-top: 14px; background: var(--bg2); }
.dev input { margin-top: 6px; }
.log { font: 12px/1.4 ui-monospace, monospace; color: var(--mute); max-height: 160px; overflow: auto; background: rgba(0, 0, 0, .5); border-radius: 4px; padding: 8px; margin-top: 8px; white-space: pre-wrap; }
.footer { color: var(--mute); font-size: 13px; text-align: center; padding: 26px 0 10px; }
.footer a { color: var(--mute); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* ---------- the daily puzzle ---------- */
.daily { display: grid; gap: 16px; }
.dboard { padding: 16px 18px 14px; }
.dtitle { font-family: var(--score); font-weight: 700; color: var(--led); letter-spacing: .14em; text-transform: uppercase; font-size: 14px; text-shadow: 0 0 8px rgba(255, 176, 0, .5); }
.dpair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 10px 0 6px; container-type: inline-size; }
.dclub { display: grid; justify-items: center; gap: 6px; }
.dclub .slot { width: clamp(70px, 24cqw, 130px); }
.dclub .clubname { color: #fff; }
.dvs { font-family: var(--score); font-size: 34px; color: var(--led-red); text-shadow: 0 0 12px rgba(255, 59, 48, .7); }
.dline { font-family: var(--score); font-weight: 700; color: #8a8a8a; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.dask { font-family: var(--sign); font-weight: 800; font-size: clamp(22px, 5vw, 32px); text-transform: uppercase; letter-spacing: .02em; margin: 6px 0 14px; }
.dstart { max-width: 360px; }
.dcentre { margin: 0 auto 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile { padding: 9px 10px; border-radius: 4px; background: #070807; border: 1px solid #1d201e; color: #3b403d; font-weight: 800; text-align: center;
  font-family: var(--score); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.ok { color: var(--green); border-color: rgba(57, 224, 122, .5); background: linear-gradient(180deg, rgba(57, 224, 122, .16), rgba(57, 224, 122, .04)); font-family: var(--sans); }
.tile.miss { color: #9aa39d; font-family: var(--sans); font-weight: 700; }
.wrongs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 10px; }
.wrong { color: #ff8a80; text-decoration: line-through; font-weight: 700; font-size: 14px; background: rgba(255, 59, 48, .1); padding: 3px 8px; border-radius: 4px; }
.dscore { display: flex; justify-content: center; align-items: baseline; gap: 16px; background: var(--board); border-radius: 10px; padding: 14px;
  box-shadow: 0 0 0 3px #1c1f1d, 0 0 0 5px #3a403c, 0 22px 50px rgba(0, 0, 0, .6); }
.dscore b { font-family: var(--score); font-size: clamp(56px, 16vw, 110px); line-height: 1; color: var(--led-red); text-shadow: 0 0 18px rgba(255, 59, 48, .7);
  -webkit-mask: radial-gradient(circle at center, #000 62%, transparent 66%) 0 0 / 3px 3px; mask: radial-gradient(circle at center, #000 62%, transparent 66%) 0 0 / 3px 3px; }
.dscore span { font-family: var(--score); font-weight: 700; font-size: clamp(28px, 7vw, 44px); color: var(--led); text-shadow: 0 0 12px rgba(255, 176, 0, .6); }
.led-inline { font-family: var(--score); color: var(--led); letter-spacing: .06em; }
.stats .card h3 { margin: 0 0 12px; font-size: 16px; letter-spacing: .1em; }
.stats4 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.stat small, .label { display: block; color: var(--mute); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.stat b { font-family: var(--score); font-size: 28px; color: #fff; }
.label { margin: 14px 0 6px; }
.topnamed { display: grid; gap: 5px; }
.bar { position: relative; display: flex; justify-content: space-between; padding: 4px 8px; border-radius: 3px; font-size: 13px; font-weight: 700; overflow: hidden; background: rgba(255, 255, 255, .03); }
.bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: rgba(57, 224, 122, .16); }
.bar > * { position: relative; }

.stats h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: .12em; }
.meter { margin-top: 14px; height: 7px; border-radius: 4px; background: #121413; overflow: hidden; }
.meter::before { content: ""; display: block; height: 100%; width: var(--w); background: var(--green); box-shadow: 0 0 8px rgba(57, 224, 122, .6); }

/* ---------- top menu ---------- */
.nav { flex-wrap: wrap; }
.links { display: flex; gap: 4px; flex: 1; margin-left: 18px; }
.links a { color: var(--ink); text-decoration: none; font-weight: 800; font-size: 15px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.links a:hover { background: rgba(255, 255, 255, .06); }
.links a.on { color: var(--led); }
@media (max-width: 640px) { .links { order: 3; flex-basis: 100%; margin: 8px 0 0; overflow-x: auto; } .links a { font-size: 14px; padding: 6px 8px; } }

/* ---------- home: the duel ---------- */
.duelbox { max-width: 760px; margin: 0 auto; }
.duelbox .field { max-width: 360px; margin: 0 auto 14px; }
.card.play { display: grid; gap: 8px; align-content: start; }
.card.play h3 { margin: 0; font-size: 26px; }
.card.play p { margin: 0 0 6px; }
.card.play .rating { font-family: var(--score); color: var(--led); font-size: 14px; letter-spacing: .04em; }
.card.play .rating small { color: var(--mute); font-family: var(--sans); letter-spacing: 0; margin-left: 6px; }
.how { max-width: 760px; margin: 22px auto 0; }
.how h3 { margin: 0 0 12px; }
.scoreboard { position: relative; }
/* the sign-in dialog (account.js) and the account button in the top right */
.signin { display: grid; gap: 10px; margin: 16px auto 12px; max-width: 340px; }
.signin .btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 16px;
  font-family: var(--sans); font-weight: 600; font-size: 15px; text-transform: none; letter-spacing: 0; }
.signin .btn small { font-size: 12px; }
.signin .btn.google { background: #fff; color: #1f1f1f; border-color: #fff; }
.signin .btn.google:hover { background: #f1f3f4; }
.signin .btn[disabled] { opacity: .5; cursor: not-allowed; }
.nav .right { display: flex; align-items: center; gap: 8px; }
#account { white-space: nowrap; }
/* "Report a problem" (home page) */
.report .kinds { display: grid; gap: 6px; margin: 10px 0; }
.report .kinds label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); }
.report .kinds label:has(input:checked) { border-color: var(--amber); }
.report .kinds input { accent-color: var(--amber); }
.report textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 72px; padding: 10px; font: inherit; color: var(--ink);
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); }
.report .row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
#namefield { max-width: none; margin: 0 0 4px; width: 100%; }
/* "My account" (account.html): rating, tabs, the match and puzzle history */
.account { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.acchead h2 { margin: 0 0 6px; }
.acctabs { justify-self: center; }
.acctabs button { padding: 8px 16px; }
.hrow { display: block; border-bottom: 1px solid var(--line); padding: 10px 2px; }
.hrow:last-child { border-bottom: 0; }
.hrow summary, .hrow.daily { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.hrow summary::-webkit-details-marker { display: none; }
.hres { font-family: var(--score); font-weight: 700; letter-spacing: .04em; min-width: 6.5em; }
.hrow.win .hres { color: var(--green); } .hrow.loss .hres { color: var(--red); } .hrow.none .hres { color: var(--mute); }
.hscore { font-family: var(--score); font-weight: 700; }
.hrival { flex: 1; min-width: 6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdelta { font-family: var(--score); font-weight: 700; font-size: 13px; } .hdelta.up { color: var(--green); } .hdelta.down { color: var(--red); }
.hdate { margin-left: auto; }
.hrounds { margin: 8px 0 2px; padding-left: 22px; display: grid; gap: 4px; font-size: 14px; }
.hrounds li { display: flex; gap: 10px; flex-wrap: wrap; }
.hclubs { color: var(--chalk); }
.hwon { color: var(--green); } .hlost { color: var(--red); }
/* ranked leagues (league.js) and the leaderboard */
.league { display: inline-block; padding: 3px 9px; border-radius: 4px; font-family: var(--score); font-weight: 700; font-size: 12px;
  letter-spacing: .04em; white-space: nowrap; color: #0b0b0b; background: #9aa3a0; }
.league.placement { background: transparent; color: var(--mute); border: 1px dashed var(--line); }
.league.lg-amateur { background: #8a7a6a; } .league.lg-regional { background: #b08d57; } .league.lg-third { background: #c0c7cc; }
.league.lg-second { background: #e7c24a; } .league.lg-first { background: #39d0b4; } .league.lg-super { background: #5aa9ff; }
.league.lg-europe { background: #b48cff; } .league.lg-legend { background: linear-gradient(135deg, #ffb000, #ff3b30); color: #fff; }
.lbrow { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto 4em 4em; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.lbrow.you { background: rgba(255, 176, 0, .08); }
.lbrank { font-family: var(--score); color: var(--mute); }
.lbname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lbrating { font-family: var(--score); text-align: right; }
.lbwins { text-align: right; }
.lbgap { text-align: center; color: var(--mute); padding: 4px; }
.lbcount { margin: 10px 0 0; text-align: center; }
@media (max-width: 520px) { .lbrow { grid-template-columns: 2.6em minmax(0, 1fr) auto 3.4em; } .lbwins { display: none; } }
@media (max-width: 420px) { .links { gap: 0; } .links a { font-size: 13px; padding: 6px 6px; } }
