/* Games: the game screen (every game), its visuals and the deck of tabs */
/* ---------- Games ---------- */
.games-grid { margin-top: clamp(40px, 6vw, 72px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gcard {
  display: flex; flex-direction: column; gap: 12px; text-align: left;
  padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid transparent;
  color: var(--ink); font: inherit; cursor: pointer; transition: border-color .2s, transform .2s;
}
.gcard:hover { border-color: var(--hair); transform: translateY(-2px); }
.gcard .gi { height: 64px; display: flex; align-items: center; gap: 6px; }
.gcard .gi .mk { width: 22px; height: 38px; }
.gcard .gi .mk.color { background: conic-gradient(from 0deg, #ff3b3b, #ffd23b, #3bff6e, #3bd8ff, #6b3bff, #ff3bd2, #ff3b3b); }
.gcard h3 { font-size: 20px; }
.gcard p { color: var(--muted); font-size: 14px; flex: 1; }
.gcard .gfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.gcard .gplay { color: var(--ink); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.gcard .gplay::after { content: "→"; transition: transform .2s; }
.gcard:hover .gplay::after { transform: translateX(3px); }
.gcard .tag { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 1000px) { .games-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .games-grid { grid-template-columns: 1fr; } }

.game {
  position: fixed; inset: 0; z-index: 40; background: var(--ground); color: var(--ink);
  display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transition: background .35s, color .35s;
}
.game.tinted { --g-ink: #111114; }
.g-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; width: 100%; margin: 0 auto; }
.g-title { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 18px; letter-spacing: -0.02em; }
.g-title .mk { width: 9px; height: 16px; background: currentColor; }
.g-dots { display: flex; gap: 6px; }
.g-dots i { width: 7px; height: 12px; background: currentColor; opacity: .18;
  -webkit-mask: var(--bolt) center / contain no-repeat; mask: var(--bolt) center / contain no-repeat; }
.g-dots i.on { opacity: 1; }
.g-close {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit;
  font: 400 22px/1 var(--body); cursor: pointer; opacity: .75;
}
.g-close:hover { opacity: 1; }
.g-stage { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; max-width: 760px; margin: 0 auto; padding-block: 16px; min-height: 0; overflow-y: auto; }
.g-panel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.g-kicker { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.g-big { font-family: var(--display); font-size: clamp(36px, 7vw, 72px); line-height: 1; letter-spacing: -0.045em; margin: 0; }
.g-mid { font-family: var(--display); font-size: clamp(22px, 3.4vw, 32px); letter-spacing: -0.03em; margin: 0; }
.g-note { color: var(--muted); max-width: 30rem; font-size: 16px; margin: 0; }
.game.tinted .g-note { color: inherit; opacity: .75; }
.g-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.g-bar { width: min(420px, 80%); height: 3px; background: currentColor; opacity: .2; border-radius: 3px; overflow: hidden; position: relative; }
.g-bar b { position: absolute; inset: 0; background: currentColor; transform-origin: left; opacity: 1; }
.g-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); font-size: 15px; }
.g-rules li { display: flex; gap: 10px; align-items: center; justify-content: center; }
.g-rules li::before { content: ""; width: 7px; height: 12px; background: var(--ink); -webkit-mask: var(--bolt) center / contain no-repeat; mask: var(--bolt) center / contain no-repeat; }
.game .btn { min-height: 48px; padding: 0 24px; font-size: 16px; }
.game.tinted .btn { background: var(--g-fg); color: var(--g-bg); border-color: var(--g-fg); }
.bigmark { width: 90px; height: 158px; background: currentColor; -webkit-mask: var(--bolt) center / contain no-repeat; mask: var(--bolt) center / contain no-repeat; }

/* color */
.swatch { width: min(460px, 100%); aspect-ratio: 16 / 10; max-width: 100%; border-radius: 22px; display: grid; place-items: center; border: 1px solid var(--hair); }
.swatch .bigmark { width: 60px; height: 105px; opacity: .9; }
.sliders { width: min(460px, 100%); display: grid; gap: 14px; }
.sl { display: grid; gap: 6px; text-align: left; }
.sl label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.sl input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; border-radius: 999px; outline: none; border: 1px solid var(--hair); cursor: pointer; }
.sl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid #111114; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.sl input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid #111114; }
.sl input[type=range]:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.compare { width: min(560px, 100%); display: grid; grid-template-columns: 1fr 1fr; border-radius: 22px; overflow: hidden; border: 1px solid var(--hair); }
.compare div { aspect-ratio: 1 / 1; max-width: 100%; display: flex; align-items: flex-end; padding: 14px; font-size: 13px; font-weight: 500; }
.strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: min(560px, 100%); }
.strip div { border-radius: 12px; overflow: hidden; border: 1px solid var(--hair); display: grid; grid-template-rows: 1fr 1fr; aspect-ratio: 1 / 1.5; max-width: 100%; }

/* time / reaction pads */
.pad {
  width: min(460px, 100%); aspect-ratio: 4 / 3; max-width: 100%; border-radius: 26px; border: 1px solid var(--hair);
  display: grid; place-items: center; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none;
  background: var(--surface); color: var(--ink); transition: background .12s, color .12s;
}
.pad .bigmark { opacity: .16; transition: opacity .08s, transform .2s; }
.pad.lit { background: var(--ink); color: var(--ground); }
.pad.lit .bigmark { opacity: 1; transform: scale(1.08); }
.pad .padtext { position: absolute; }
.pad-wrap { position: relative; width: 100%; display: grid; place-items: center; }
.pad-cap { font-size: 14px; color: var(--muted); }

/* sound */
.freq { font-family: var(--display); font-size: clamp(40px, 8vw, 64px); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.wave { width: min(460px, 100%); height: 80px; color: var(--ink); }

/* password */
.pw-grid { display: grid; gap: 8px; }
.pw-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pw-row.shake { animation: pwshake .35s; }
@keyframes pwshake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pw-tile {
  width: clamp(46px, 12vw, 62px); height: clamp(46px, 12vw, 62px); border-radius: 12px; border: 1.5px solid var(--hair);
  display: grid; place-items: center; font-family: var(--display); font-size: clamp(22px, 5vw, 28px); font-weight: 500; text-transform: uppercase;
}
.pw-tile.filled { border-color: var(--muted); }
.pw-tile.hit { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.pw-tile.near { border: 2.5px solid var(--ink); position: relative; }
.pw-tile.near::after { content: ""; position: absolute; top: 5px; right: 6px; width: 6px; height: 10px; background: var(--ink); -webkit-mask: var(--bolt) center / contain no-repeat; mask: var(--bolt) center / contain no-repeat; }
.pw-tile.miss { background: var(--surface); color: var(--muted); border-color: transparent; }
.kb { display: grid; gap: 6px; width: min(520px, 100%); }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb button {
  flex: 1; min-width: 0; max-width: 44px; height: 46px; border-radius: 8px; border: 1px solid var(--hair); background: var(--ground); color: var(--ink);
  font: 500 14px/1 var(--body); cursor: pointer; padding: 0;
}
.kb button.wide { max-width: 72px; flex: 1.6; font-size: 12px; }
.kb button.hit { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.kb button.near { border: 2px solid var(--ink); }
.kb button.miss { opacity: .3; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--hair); }
.legend i.hit { background: var(--ink); border-color: var(--ink); }
.legend i.near { border: 2px solid var(--ink); }
.legend i.miss { background: var(--surface); border-color: transparent; }

/* count */
.field { position: relative; width: min(560px, 100%); aspect-ratio: 16 / 10; max-width: 100%; border-radius: 22px; background: var(--surface); overflow: hidden; }
.field .mk { position: absolute; width: 14px; height: 24px; background: var(--ink); }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 52px; height: 52px; border-radius: 999px; border: 1px solid var(--hair); background: var(--ground); color: var(--ink); font: 400 26px/1 var(--body); cursor: pointer; }
.stepper input { width: 120px; text-align: center; border: 0; border-bottom: 2px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--display); font-size: 48px; letter-spacing: -0.03em; padding: 4px 0; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* packet path */
.net { width: min(680px, 100%); height: auto; max-width: 100%; color: var(--ink); touch-action: manipulation; }
.net .edge { stroke: var(--hair); stroke-width: 2; }
.net .edge.used { stroke: var(--ink); stroke-width: 4; }
.net .edge.best { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 6; }
.net .elabel { font: 500 11px var(--body); fill: var(--muted); }
.net .node circle { fill: var(--ground); stroke: var(--muted); stroke-width: 2; transition: r .15s; }
.net .node.on { cursor: pointer; }
.net .node.on circle { fill: var(--ink); stroke: var(--ink); }
.net .node.goal circle { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 3 3; }
.net .node text { font: 600 11px var(--body); fill: var(--muted); text-anchor: middle; }
.ping { display: flex; gap: 22px; justify-content: center; font-size: 14px; color: var(--muted); }
.ping b { color: var(--ink); font-family: var(--display); font-size: 22px; font-weight: 400; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* results */
.res-list { width: min(460px, 100%); display: grid; border-top: 1px solid var(--hair); }
.res-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 14px; font-variant-numeric: tabular-nums; }
.res-list span:first-child { color: var(--muted); }


/* game motion */
.g-tools { display: inline-flex; gap: 8px; }
.g-mute { display: grid; place-items: center; }
.g-mute .x { display: none; } .g-mute.off .x { display: inline; } .g-mute.off .w { display: none; }
.g-top, .g-stage { position: relative; z-index: 1; }
.flood { position: absolute; inset: 0; z-index: 0; clip-path: circle(75% at 50% 55%); }
.gfx { position: fixed; z-index: 60; width: 14px; height: 24px; background: currentColor; pointer-events: none; }
.g-count { font-family: var(--display); font-size: clamp(90px, 22vw, 200px); line-height: 1; letter-spacing: -0.05em; margin: 0; }
.g-intro .g-icon { height: 110px; display: flex; align-items: center; justify-content: center; gap: 10px; animation: float 3.2s ease-in-out infinite; }
.g-intro .g-icon .mk { width: 40px; height: 70px; background: currentColor; }
.g-intro .g-icon .mk.color { background: conic-gradient(#ff3b3b,#ffd23b,#3bff6e,#3bd8ff,#6b3bff,#ff3bd2,#ff3b3b); animation: huespin 4s linear infinite; }
.g-intro .g-icon svg { width: auto; height: 74px; }
.g-intro .g-icon svg.gic-color, .g-intro .g-icon svg[width="44"] { height: 96px; }
.gcard .gi svg[width="44"] { height: 48px; width: auto; }
.gcard .gi svg.gic-color { height: 48px; width: auto; }
.g-intro .ic-dots { font: 500 54px/1 var(--display); letter-spacing: .2em; }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes huespin { to { filter: hue-rotate(360deg); } }
.breathe { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); } }
.pad { position: relative; overflow: hidden; }
.pad.lit { box-shadow: 0 0 0 10px color-mix(in srgb, var(--ink) 12%, transparent), 0 20px 60px color-mix(in srgb, var(--ink) 25%, transparent); }
.pad.lit .bigmark { animation: glow .6s ease-in-out infinite alternate; }
@keyframes glow { from { transform: scale(1.02); } to { transform: scale(1.12); } }
.pad.wait .bigmark { animation: breathe 1.4s ease-in-out infinite; }
.tbars { width: min(460px, 100%); display: grid; gap: 14px; }
.tbars div { display: grid; grid-template-columns: 4.5rem 1fr 4.5rem; align-items: center; gap: 12px; font-size: 14px; }
.tbars span { color: var(--muted); text-align: left; }
.tbars b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.tbars i { height: 10px; border-radius: 10px; background: var(--ink); transform-origin: left; transform: scaleX(var(--w)); animation: grow .9s cubic-bezier(.2,.8,.2,1) both; }
.tbars div + div i { opacity: .35; animation-delay: .15s; }
@keyframes grow { from { transform: scaleX(0); } }
.wave { overflow: hidden; }
.wave polyline { transform-box: fill-box; }
.wave.live polyline { animation: wave var(--dur, 1s) linear infinite; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.wavebox { transition: opacity .25s; width: min(460px, 100%); }
.sl input.plain { background: var(--surface); }
.pw-grid { perspective: 600px; }
.net .edge.fresh { stroke-dasharray: 400; animation: draw .45s ease-out both; }
@keyframes draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
.net .node.here circle { animation: ping 1.2s ease-out infinite; }
@keyframes ping { 0% { stroke-width: 2.5; } 50% { stroke-width: 7; } 100% { stroke-width: 2.5; } }
.net .packet { fill: var(--ink); stroke: var(--ground); stroke-width: 3; }
.gcard .gi { transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.gcard:hover .gi { transform: translateY(-4px) scale(1.06); }
.gcard:hover .mk.color { animation: huespin 2s linear infinite; }
.gcard:hover .ic-path { stroke-dasharray: 140; animation: draw2 .8s ease-out; }
@keyframes draw2 { from { stroke-dashoffset: 140; } to { stroke-dashoffset: 0; } }
.gcard:hover .ic-wave path { animation: wiggle .6s ease-in-out infinite alternate; transform-origin: center; }
@keyframes wiggle { to { transform: scaleY(-1); } }
.gcard .ic-dots { font: 500 26px/1 var(--display); letter-spacing: .2em; }
@media (prefers-reduced-motion: reduce) { .g-intro .g-icon, .breathe, .pad.wait .bigmark, .pad.lit .bigmark, .wave.live polyline, .net .node.here circle, .btn.play-games .mk { animation: none; } }

/* ---------- Game card layout (a centred card, like a device) ---------- */
.game { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
.g-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
.g-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.g-brand .mk { width: 9px; height: 16px; background: currentColor; }
.g-brand .x { color: var(--muted); }
.g-tabs { display: flex; gap: 4px; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.g-tabs::-webkit-scrollbar { display: none; }
.g-wrap { flex: 1; min-height: 0; display: grid; place-items: center; }
.g-card {
  --ground: #111114; --ink: #f4f5f0; --surface: #1d1e23; --hair: rgba(255,255,255,.14); --muted: #9a9ca6;
  position: relative; overflow: hidden; isolation: isolate;
  width: min(480px, 100%); height: min(640px, 100%); max-height: 100%;
  background: var(--card-bg, var(--ground)); color: var(--ink); color-scheme: dark;
  border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.12);
  display: flex; flex-direction: column; transition: color .3s;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body:not([data-mode="light"]) .g-card { --card-bg: var(--ground); --ground: #fbfbfd; --ink: #16171b; --surface: #eeeef2; --hair: #e2e3e9; --muted: #62656f; color-scheme: light; }
}
:root[data-theme="dark"] body:not([data-mode="light"]) .g-card, body[data-mode="dark"] .g-card.g-card { --card-bg: var(--ground); --ground: #fbfbfd; --ink: #16171b; --surface: #eeeef2; --hair: #e2e3e9; --muted: #62656f; color-scheme: light; }
.g-head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; min-height: 34px; font-size: 13px; color: inherit; opacity: .8; }
.g-card .g-stage { position: relative; z-index: 1; flex: 1; max-width: none; padding: 10px 24px 24px; align-items: center; overflow-y: auto; }
.g-card .g-panel { gap: 16px; }
.g-card .g-big { font-size: clamp(34px, 9vw, 52px); }
.g-card .g-mid { font-size: clamp(20px, 5vw, 26px); }
.g-card .g-count { font-size: clamp(90px, 26vw, 150px); }
.g-card .btn { background: var(--ink); color: var(--ground); border-color: var(--ink); min-height: 46px; }
.g-card .btn.ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.g-card .flood { position: absolute; inset: 0; z-index: 0; }
.g-card .swatch { width: 100%; aspect-ratio: 16 / 9; }
.g-card .pad { width: 100%; aspect-ratio: 5 / 4; }
.g-card .compare, .g-card .strip, .g-card .res-list, .g-card .sliders, .g-card .tbars, .g-card .field { width: 100%; }
.g-card .pw-tile { width: 42px; height: 42px; font-size: 21px; border-radius: 10px; }
.g-card .pw-grid { gap: 6px; } .g-card .pw-row { gap: 6px; }
.g-card .kb button { height: 40px; }
.g-card .kb { gap: 5px; }
.g-card .res-list div { padding: 8px 0; }
.g-card .strip div { aspect-ratio: 1 / 1.3; }
/* intro inside the card: big lowercase title top-left, controls at the bottom */
.g-card .g-intro { height: 100%; align-items: stretch; text-align: left; justify-content: space-between; }
.g-intro .it-top { display: grid; gap: 12px; }
.g-intro .it-title { font-family: var(--display); font-size: clamp(52px, 14vw, 76px); line-height: .95; letter-spacing: -0.055em; margin: 0; text-transform: lowercase; }
.g-intro .it-desc { margin: 0; font-size: 17px; line-height: 1.4; opacity: .85; max-width: 24ch; }
.g-intro .it-icon { display: flex; justify-content: center; align-items: center; flex: 1; }
.g-intro .it-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.g-intro .it-best { font-size: 14px; opacity: .8; }
.round-btn { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--ink); color: var(--ground); display: grid; place-items: center; cursor: pointer; transition: transform .2s; position: relative; }
.round-btn:hover { transform: scale(1.06); }
.round-btn::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--ink); opacity: .25; animation: halo 1.8s ease-out infinite; }
@keyframes halo { from { transform: scale(.9); opacity: .5; } to { transform: scale(1.35); opacity: 0; } }
.round-btn svg { width: 22px; height: 22px; margin-left: 3px; }
.timer { width: 100%; height: 4px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.timer b { display: block; height: 100%; background: var(--ink); transform-origin: left; }
.timer.low b { animation: blink .4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.card-flash { position: absolute; inset: 0; z-index: 2; background: var(--ink); pointer-events: none; }
@media (max-width: 760px) { .g-brand { display: none; } .g-top { grid-template-columns: 1fr auto; } .g-tabs { justify-content: flex-start; } }
@media (max-height: 700px) { .g-card { height: 100%; } }

/* ---------- per-game energy visuals ---------- */
.ring-wrap { position: relative; width: 230px; height: 230px; max-width: 100%; display: grid; place-items: center; border: 0; background: none; color: var(--ink); padding: 0; cursor: default; touch-action: none; user-select: none; -webkit-user-select: none; }
button.ring-wrap { cursor: pointer; }
.ring { position: absolute; inset: 0; }
.ring .mk { position: absolute; left: 50%; top: 50%; width: 14px; height: 24px; margin: -12px 0 0 -7px; background: currentColor; opacity: .16;
  transform: rotate(calc(var(--i) * 30deg)) translateY(-96px); transition: opacity .25s; }
.ring-wrap .core { width: 44px; height: 77px; background: currentColor; opacity: .22; transition: opacity .2s, transform .3s cubic-bezier(.2,1.4,.4,1); }
.ring-wrap.lit .ring { animation: spin 5s linear infinite; }
.ring-wrap.lit .ring .mk { opacity: 1; animation: ringpulse 1s ease-in-out infinite; animation-delay: calc(var(--i) * -.083s); }
.ring-wrap.lit .core { opacity: 1; transform: scale(1.15); }
button.ring-wrap:not(.lit):hover .core { opacity: .45; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ringpulse { 50% { opacity: .3; } }
.eq { display: flex; gap: 10px; justify-content: center; align-items: flex-end; height: 190px; width: 100%; }
.eq .col { display: flex; flex-direction: column-reverse; gap: 3px; }
.eq .mk { width: 12px; height: 21px; background: var(--ink); opacity: .12; transition: opacity .08s; }
.eq .mk.on { opacity: 1; }
.storm { position: relative; width: 100%; height: min(380px, 52vh); border: 0; background: none; color: var(--ink); cursor: pointer; padding: 0; overflow: hidden; touch-action: none; border-radius: 18px; }
.storm .mk { position: absolute; width: calc(14px * var(--s)); height: calc(24px * var(--s)); background: currentColor; opacity: .14; animation: drift 5s ease-in-out infinite alternate; }
.storm .core { left: 50%; top: 50%; width: 70px; height: 122px; margin: -61px 0 0 -35px; opacity: 0; transform: scale(.4); animation: none; transition: transform .18s cubic-bezier(.2,1.5,.4,1), opacity .05s; rotate: 0deg !important; }
.storm.wait .mk:not(.core) { animation-duration: 3.5s; }
.storm.lit .mk:not(.core) { opacity: 1; animation: none; }
.storm.lit .core { opacity: 1; transform: scale(1); }
@keyframes drift { from { transform: translate(-6px, 4px); opacity: .08; } to { transform: translate(6px, -6px); opacity: .28; } }
.cstage { width: 100%; display: grid; place-items: center; height: 240px; }
.cmark { display: block; width: 130px; height: 228px; -webkit-mask: var(--bolt) center / contain no-repeat; mask: var(--bolt) center / contain no-repeat; background: var(--ink); transition: background .05s; }
.cmpair { display: flex; gap: 40px; justify-content: center; width: 100%; }
.cmpair > div { display: grid; justify-items: center; gap: 10px; }
.cmpair .cmark { width: 96px; height: 168px; }
.cmpair small { font-size: 13px; opacity: .75; }
.g-card .field { background: transparent; border: 1px dashed var(--hair); }
.net .node .bolt { fill: var(--muted); opacity: .5; }
.net .node circle { fill: var(--ground); stroke: var(--hair); stroke-width: 1.5; }
.net .node.on circle { fill: var(--ink); stroke: var(--ink); }
.net .node.on .bolt { fill: var(--ground); opacity: 1; }
.net .node.goal circle { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 3 3; }
.net .packet { fill: var(--ink); stroke: none; }
@media (prefers-reduced-motion: reduce) { .ring-wrap.lit .ring, .ring-wrap.lit .ring .mk, .storm .mk { animation: none; } }

.pw-hintrow { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 0; }
.pw-hintrow:has(.pw-hint[hidden]) .pw-msg:empty { display: none; }
.pw-hintrow .g-note { margin: 0; }
.btn.pw-hint { min-height: 36px; padding: 0 14px; font-size: 14px; gap: 8px; }
.btn.pw-hint .mk { width: 7px; height: 12px; background: currentColor; }
.btn.pw-hint.used { opacity: .35; cursor: default; }
.btn.pw-hint:not(.used) .mk { animation: breathe 1.4s ease-in-out infinite; }

.g-card .pw-panel { gap: 10px; }
.g-card .pw-panel .kb button { height: 38px; }
.pw-clue { margin: 0; max-width: 34ch; font-size: 14px; line-height: 1.45; text-align: center; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--hair); }

.kb button.enter { background: var(--surface); font-weight: 600; font-size: 12px; letter-spacing: .02em; max-width: 80px; flex: 1.9; }
.kb button.enter.ready { background: var(--ink); color: var(--ground); border-color: var(--ink); }

.cswatch { display: block; width: 100%; height: 190px; border-radius: 20px; background: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.cswatch.sm { width: 120px; height: 120px; border-radius: 22px; }
.cwheel { display: inline-block; width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(#ff3b3b,#ffd23b,#3bff6e,#3bd8ff,#6b3bff,#ff3bd2,#ff3b3b); }
.g-intro .g-icon .cwheel { width: 110px; height: 110px; animation: huespin 4s linear infinite; }
.gcard:hover .cwheel { animation: huespin 2s linear infinite; }

.g-card .flood { top: 72px; border-radius: 0 0 22px 22px; }
.g-head { flex-wrap: wrap; row-gap: 10px; }
.g-headbar { flex-basis: 100%; height: 3px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.g-headbar b { display: block; height: 100%; background: var(--ink); transform-origin: left; }

/* ---------- Apple-style colour UI ---------- */
.cwheel {
  position: relative; display: inline-block; width: 44px; height: 44px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0%, rgba(255,255,255,.85) 12%, rgba(255,255,255,0) 62%),
    conic-gradient(from 90deg, #ff3b30, #ff9500, #ffcc00, #34c759, #5ac8fa, #007aff, #5856d6, #af52de, #ff2d55, #ff3b30);
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 10px 30px -6px rgba(0,0,0,.45), inset 0 1px 2px rgba(255,255,255,.5);
}
.cwheel::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.35), rgba(255,255,255,0) 45%); }
.g-intro .g-icon .cwheel { width: 150px; height: 150px; animation: wheelspin 14s linear infinite; }
.g-intro .g-icon .cwheel::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; background: inherit; filter: blur(28px) saturate(1.4); opacity: .55; z-index: -1; }
@keyframes wheelspin { to { transform: rotate(360deg); } }
.gcard .cwheel { width: 52px; height: 52px; }
.gcard:hover .cwheel { animation: wheelspin 3s linear infinite; }
.cswatch {
  --c: #888; position: relative; display: grid; place-items: end start; width: 100%; height: 200px; border-radius: 28px; background: var(--c);
  box-shadow: 0 24px 60px -18px var(--c), 0 0 0 1px rgba(255,255,255,.06), inset 0 1px 0 rgba(255,255,255,.28);
  transition: box-shadow .25s; overflow: hidden;
}
.cswatch::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 38%, rgba(0,0,0,.08)); pointer-events: none; }
.cswatch .hex { position: relative; margin: 0 0 14px 16px; font: 600 12px/1 var(--body); letter-spacing: .08em; font-style: normal; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cswatch.sm { width: 124px; height: 124px; border-radius: 30px; }
.cmpair { gap: 28px; }
.sl.apple label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.sl.apple label span { color: var(--muted); font-weight: 500; }
.sl.apple output { font: 500 13px/1 var(--body); color: var(--ink); font-variant-numeric: tabular-nums; }
.sl.apple input[type=range] { height: 34px; border-radius: 999px; border: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 2px 6px rgba(0,0,0,.25); }
.sl.apple input[type=range]::-webkit-slider-thumb { width: 30px; height: 30px; border-radius: 50%; background: var(--c, #fff); border: 4px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 0 .5px rgba(0,0,0,.2); cursor: grab; }
.sl.apple input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); cursor: grabbing; }
.sl.apple input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--c, #fff); border: 4px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.strip.apple { gap: 10px; }
.strip.apple div { border: 0; border-radius: 18px; box-shadow: 0 10px 24px -12px rgba(0,0,0,.6); }
.strip.apple span { background: var(--c); }

.g-card .g-stage { align-items: safe center; justify-content: safe center; }
.g-card .strip.apple div { aspect-ratio: 1 / 1; }

/* sound-pack picker */
.g-packwrap { position: relative; }
.g-pack { height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; font: 500 14px/1 var(--body); cursor: pointer; opacity: .8; }
.g-pack:hover, .g-pack[aria-expanded="true"] { opacity: 1; }
.g-pack .pi svg, .g-packmenu .pi svg { width: 16px; height: 16px; display: block; }
.g-packmenu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 260px; padding: 8px; border-radius: 18px;
  background: color-mix(in srgb, var(--ground) 88%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--hair); box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.g-packmenu .pm-title { margin: 6px 10px 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.g-packmenu button { width: 100%; display: grid; grid-template-columns: 34px 1fr 16px; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.g-packmenu button:hover { background: var(--surface); }
.g-packmenu .pi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); }
.g-packmenu button[aria-checked="true"] .pi { background: var(--ink); color: var(--ground); }
.g-packmenu .pt { display: grid; gap: 2px; }
.g-packmenu .pt b { font-weight: 600; font-size: 14px; }
.g-packmenu .pt small { font-size: 12px; color: var(--muted); }
.g-packmenu .ok { opacity: 0; font-weight: 600; }
.g-packmenu button[aria-checked="true"] .ok { opacity: 1; }
@media (max-width: 560px) { .g-pack .pn { display: none; } .g-pack { padding: 0; width: 40px; justify-content: center; } }
/* tab icons */
/* Apple-style colour well (clean, no glow) */
.cwheel {
  background: conic-gradient(from 0deg, #ff3b30, #ff9500, #ffcc00, #34c759, #00c7be, #5ac8fa, #007aff, #5856d6, #af52de, #ff2d55, #ff3b30);
  box-shadow: 0 0 0 .5px rgba(255,255,255,.2), 0 2px 8px rgba(0,0,0,.25);
}
.cwheel::after { inset: 22%; background: var(--ground); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.15); }
.cwheel::before { content: ""; position: absolute; inset: 34%; border-radius: 50%; background: #fff; z-index: 1; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.g-intro .g-icon .cwheel { width: 150px; height: 150px; animation: none; }
.g-intro .g-icon .cwheel::before { inset: 34%; filter: none; opacity: 1; background: #fff; }
.gcard .cwheel::after { background: var(--surface); }
/* packet route bolts (stroked, work in every browser) */
.net .node .bolt { fill: none; stroke: var(--muted); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.net .node.on .bolt { stroke: var(--ground); opacity: 1; }
.net .packet { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

/* intro: daily challenge button (lightning on hover) */
.g-intro .it-left, .g-intro .it-right { display: flex; align-items: center; gap: 14px; }
.g-intro .daily-cap { display: grid; text-align: right; font-size: 13px; line-height: 1.3; opacity: .85; }
.g-intro .daily-cap small { opacity: .6; font-size: 12px; }
.daily-btn { position: relative; width: 72px; height: 72px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; }
.daily-btn .ring { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from var(--a, 0deg), var(--ink), transparent 30%, var(--ink) 55%, transparent 80%, var(--ink));
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%); mask: radial-gradient(circle, transparent 60%, #000 61%); animation: dailyspin 3.2s linear infinite; opacity: .9; }
.daily-btn .face { position: relative; width: 56px; height: 56px; border-radius: 50%; background: var(--ink); color: var(--ground); display: grid; place-items: center; transition: transform .2s; }
.daily-btn .face .mk { width: 15px; height: 26px; background: var(--ground); transition: transform .2s; }
.daily-btn:hover .face, .daily-btn.charged .face { transform: scale(1.06); }
.daily-btn.charged .ring { animation-duration: .9s; }
.daily-btn.charged .face .mk { animation: zapbuzz .16s steps(2) infinite; }
@keyframes zapbuzz { 50% { transform: translate(.6px,-.6px) scale(1.08); } }
.g-intro .daily-cap { font-weight: 500; letter-spacing: .01em; }
@keyframes dailyspin { to { transform: rotate(360deg); } }
.zap-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; overflow: visible; }
.zap-layer polyline { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ink) 60%, transparent)); }
/* bolt-built icons */
.bolt-ic { width: 56px; height: 56px; color: var(--ink); overflow: visible; }
.bolt-ic.big { width: 150px; height: 150px; }
.bolt-ic.tab { width: 17px; height: 17px; color: currentColor; }
.g-tabs .ti .cwheel.tab { width: 15px; height: 15px; }
.gcard .gi .bolt-ic { width: 60px; height: 60px; }
@media (prefers-reduced-motion: reduce) { .daily-btn .ring { animation: none; } }

/* game icons made of the real energy mark */
.ic-eq { display: inline-flex; align-items: flex-end; gap: 4px; height: 44px; }
.ic-react { position: relative; display: inline-block; width: 64px; height: 56px; }
.ic-react > .mk:first-child { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.ic-react .sp1, .ic-react .sp2 { position: absolute; width: 10px; height: 17px; }
.ic-react .sp1 { left: 2px; top: 4px; rotate: -30deg; }
.ic-react .sp2 { right: 2px; bottom: 2px; rotate: 30deg; }
.ic-pass { display: inline-flex; gap: 6px; align-items: center; }
.ic-pass .mk { width: 11px; height: 19px; }
.ic-eq .mk, .ic-react .mk, .ic-pass .mk { background: currentColor; }
.g-intro .g-icon .ic-eq, .g-intro .g-icon .ic-react, .g-intro .g-icon .ic-pass { transform: scale(2.1); }
.g-intro .g-icon .ic-pass .mk { width: 11px; height: 19px; }
.g-intro .g-icon .ic-react .sp1, .g-intro .g-icon .ic-react .sp2 { width: 10px; height: 17px; }
.g-intro .g-icon .ic-eq .mk { width: auto; }

/* reaction storm: shockwaves + crackle */
.storm .shock { position: absolute; left: 50%; top: 50%; width: 90px; height: 90px; border-radius: 50%; border: 2px solid currentColor; pointer-events: none; }
.storm.lit:not(.hit) .mk:not(.core) { animation: crackle .12s steps(2) infinite; }
.storm.lit:not(.hit) .mk:nth-child(3n):not(.core) { animation-duration: .17s; }
.storm.lit:not(.hit) .core { animation: corebeat .5s ease-in-out infinite alternate; }
@keyframes crackle { 0% { opacity: 1; translate: 0 0; } 50% { opacity: .35; translate: 1.5px -1.5px; } 100% { opacity: 1; translate: -1px 1px; } }
@keyframes corebeat { from { scale: 1; } to { scale: 1.1; } }
.storm.wait .core { opacity: .06; transform: scale(.7); animation: coreidle 1.6s ease-in-out infinite; }
@keyframes coreidle { 50% { opacity: .14; transform: scale(.78); } }
/* Energize fountain */
.ez-mk { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); will-change: transform; }
.gic { overflow: visible; }

/* minimal line icons (same family as the tab icons), all one size */
.gic-line { width: 44px; height: 44px; overflow: visible; }
.gic-line * { vector-effect: non-scaling-stroke; stroke-width: 2.6px; }
.g-intro .g-icon svg.gic-line { width: 96px; height: 96px; }
.g-intro .g-icon svg.gic-line * { stroke-width: 4.5px; }
.gcard .gi svg.gic-color { height: 44px; }
.g-intro .g-icon svg.gic-color { height: 96px; }

/* time game: liquid-energy glass orb */
.orb { position: relative; width: 240px; height: 240px; max-width: 100%; border-radius: 50%; border: 0; padding: 0; background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink);
  overflow: hidden; isolation: isolate; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-mask-image: -webkit-radial-gradient(white, black);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 24%, transparent), inset 0 -22px 44px color-mix(in srgb, var(--ink) 9%, transparent);
  transition: box-shadow .5s; }
button.orb { cursor: pointer; }
.orb-liq { position: absolute; left: -4%; right: -4%; bottom: 0; height: 13%; transition: height .7s cubic-bezier(.3,1.35,.5,1); z-index: 1; }
.orb-liq svg { position: absolute; left: 0; top: 0; width: 200%; height: 16px; fill: var(--ink); animation: slosh 3.4s linear infinite; }
.orb-liq svg.w2 { top: -4px; opacity: .35; animation-duration: 2.3s; animation-direction: reverse; }
.orb-liq .body { position: absolute; left: 0; right: 0; top: 15px; bottom: 0; background: var(--ink); }
@keyframes slosh { to { transform: translateX(-50%); } }
.orb .core { position: absolute; left: 50%; top: 50%; width: 40px; height: 70px; margin: -35px 0 0 -20px; background: #fff; mix-blend-mode: difference; z-index: 2; opacity: .55; transition: opacity .3s, transform .5s cubic-bezier(.3,1.5,.5,1); }
.orb .bub { position: absolute; bottom: 5%; background: #fff; mix-blend-mode: difference; z-index: 2; pointer-events: none; }
.orb-glass { position: absolute; inset: 0; border-radius: 50%; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at 32% 22%, rgba(255,255,255,.5), rgba(255,255,255,0) 30%), radial-gradient(circle at 72% 88%, rgba(255,255,255,.14), rgba(255,255,255,0) 38%); }
button.orb:not(.lit):hover .orb-liq { height: 19%; }
.orb.lit { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 40%, transparent), inset 0 -22px 44px color-mix(in srgb, var(--ink) 12%, transparent), 0 0 0 8px color-mix(in srgb, var(--ink) 7%, transparent), 0 0 60px color-mix(in srgb, var(--ink) 18%, transparent); }
.orb.lit .orb-liq { height: 57%; }
.orb.lit .orb-liq svg.w1 { animation-duration: 1.2s; }
.orb.lit .orb-liq svg.w2 { animation-duration: .8s; }
.orb.lit .core { opacity: 1; transform: scale(1.12); animation: orbbeat 1.1s ease-in-out infinite alternate; }
@keyframes orbbeat { to { transform: scale(1.2) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .orb-liq svg, .orb.lit .core { animation: none; } }

/* time game: energy vortex */
.vortex { position: relative; width: 280px; height: 280px; max-width: 100%; border: 0; padding: 0; background: none; color: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 50%; }
.vortex canvas { width: 100%; height: 100%; display: block; }
button.vortex { cursor: pointer; }
button.vortex:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* colour icon: the three circles drift together and apart around each other */
.gic-color .rgb { transform-box: view-box; transform-origin: 30px 20.5px; animation: rgbspin 9s linear infinite; }
.gic-color circle { transform-box: view-box; animation: 3.6s cubic-bezier(.45,0,.55,1) infinite; }
.gic-color .c1 { animation-name: rgb1; } .gic-color .c2 { animation-name: rgb2; animation-delay: -1.2s; } .gic-color .c3 { animation-name: rgb3; animation-delay: -2.4s; }
@keyframes rgb1 { 0%, 100% { transform: translate(0, 0); } 35% { transform: translate(5px, 2.6px); } 70% { transform: translate(-2.4px, -1.3px); } }
@keyframes rgb2 { 0%, 100% { transform: translate(0, 0); } 35% { transform: translate(-5px, 2.6px); } 70% { transform: translate(2.4px, -1.3px); } }
@keyframes rgb3 { 0%, 100% { transform: translate(0, 0); } 35% { transform: translate(0, -5.4px); } 70% { transform: translate(0, 2.6px); } }
@keyframes rgbspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gic-color .rgb, .gic-color circle { animation: none; } }

/* packet route: every free node looks the same — no hints */
.net .node.free { cursor: pointer; }
/* play together */
.g-intro .mp-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px 0 10px; border-radius: 999px; border: 1px solid var(--hair); background: transparent; color: var(--ink); font: 500 13px/1 var(--body); cursor: pointer; transition: border-color .2s, transform .2s; }
.g-intro .mp-btn svg { width: 18px; height: 18px; }
.g-intro .mp-btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.g-intro .it-left { flex-wrap: wrap; }
.mp { gap: 14px; width: min(340px, 100%); margin-inline: auto; text-align: center; }
.mp .mp-title { margin: 0 0 4px; }
.mp-seg { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--hair); border-radius: 999px; padding: 3px; }
.mp-seg button { border: 0; background: none; color: var(--muted); font: 500 14px/1 var(--body); padding: 10px 14px; border-radius: 999px; cursor: pointer; }
.mp-seg button[aria-selected="true"] { background: var(--ink); color: var(--ground); }
.mp-pane { display: grid; gap: 10px; width: 100%; }
.mp-in { width: 100%; height: 46px; border-radius: 14px; border: 1px solid var(--hair); background: var(--surface); color: var(--ink); font: 400 16px/1 var(--body); padding: 0 16px; outline: none; text-align: center; }
.mp-in:focus { border-color: var(--ink); }
.mp-code { letter-spacing: .3em; font-weight: 600; text-transform: uppercase; }
.mp-join { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.mp-or { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mp-err { min-height: 1.2em; margin: 0; font-size: 13px; color: var(--muted); }
.mp-back { border: 0; background: none; color: var(--muted); font: 400 14px/1 var(--body); cursor: pointer; padding: 8px; }
.mp-back:hover { color: var(--ink); }
.mp-players { display: grid; gap: 8px; }
.mp-count { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.mp-count .btn { min-height: 40px; padding: 0; font-size: 20px; }
.mp-codebig { display: flex; gap: 8px; justify-content: center; margin: 4px 0; }
.mp-codebig span { width: 44px; height: 56px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); font: 600 28px/1 var(--display); }
.mp-hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.mp-turn { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.mp-who { margin: 0 0 6px; font: 400 clamp(34px, 9vw, 48px)/1.05 var(--display); letter-spacing: -0.03em; word-break: break-word; }
.mp .round-btn { margin: 10px auto 0; }
.mp-board { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; text-align: left; }
.mp-board li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); font-size: 15px; }
.mp-board .rk { color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-board .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-board b { font-weight: 500; font-variant-numeric: tabular-nums; }
.mp-board li.me { outline: 1.5px solid var(--ink); }
.mp-board li.win { background: var(--ink); color: var(--ground); }
.mp-board li.win .rk { color: inherit; opacity: .7; }
.mp-res { display: grid; gap: 10px; width: 100%; justify-items: center; margin: 4px 0 6px; }

/* game deck: mini cards above the game */
.g-tabs { gap: 8px; padding: 6px 4px 10px; align-items: flex-end; scroll-snap-type: x proximity; }
.g-tabs .dk { --dk-ground: #111114; --dk-ink: #f4f5f0; position: relative; flex: none; width: 116px; height: 70px; padding: 10px 11px; border: 0; border-radius: 14px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer; scroll-snap-align: center;
  background: var(--dk-ground); color: var(--dk-ink); opacity: .5; transform: translateY(0) scale(.95); transform-origin: 50% 100%;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 6px 16px rgba(0,0,0,.08);
  transition: opacity .3s, transform .45s cubic-bezier(.3,1.5,.5,1), box-shadow .3s; overflow: hidden; }
.g-tabs .dk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.14) 50%, transparent 65%); transform: translateX(-120%); transition: transform .7s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.g-tabs .dk:hover { opacity: .9; transform: translateY(-4px) scale(.98) rotate(-1deg); box-shadow: 0 12px 26px rgba(0,0,0,.16); }
.g-tabs .dk:hover::after { transform: translateX(120%); }
.g-tabs .dk[aria-current="true"] { opacity: 1; transform: translateY(-4px) scale(1); box-shadow: 0 14px 30px rgba(0,0,0,.2); }
.g-tabs .dk[aria-current="true"]::before { content: ""; position: absolute; left: 50%; bottom: 5px; width: 16px; height: 2px; margin-left: -8px; border-radius: 2px; background: currentColor; opacity: .6; }
.g-tabs .dk-ic { height: 22px; display: flex; align-items: center; }
.g-tabs .dk-ic svg { height: 22px !important; width: auto !important; max-width: 60px; }
.g-tabs .dk-ic .gic-line * { stroke-width: 2px !important; }
.g-tabs .dk-ic .mk { width: 9px !important; height: 16px !important; background: currentColor; }
.g-tabs .dk-ic > .mk + .mk { margin-left: 2px; }
.g-tabs .dk-nm { font: 500 12.5px/1.15 var(--body); letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body:not([data-mode="light"]) .g-tabs .dk { --dk-ground: #fbfbfd; --dk-ink: #16171b; } }
:root[data-theme="dark"] body:not([data-mode="light"]) .g-tabs .dk, body[data-mode="dark"] .g-tabs .dk { --dk-ground: #fbfbfd; --dk-ink: #16171b; }
@media (max-width: 760px) { .g-tabs .dk { width: 96px; height: 62px; } }
@media (prefers-reduced-motion: reduce) { .g-tabs .dk, .g-tabs .dk::after { transition: none; } }

/* /games/<slug>: the game screen is the page; the text underneath is for search engines and no-JS visitors */
.game-page { padding: 120px 24px; max-width: 40rem; margin: 0 auto; }
.game-page h1 { font-family: var(--display); font-weight: 400; font-size: 48px; letter-spacing: -.04em; margin: 0 0 12px; }
.game-page p { color: var(--muted); }
a.g-brand { color: inherit; text-decoration: none; }

/* ---------- /games/<slug>: the game lives inside the Games section (site navbar above, breadcrumb, footer below) ---------- */
.game-embedded .game-page { padding: calc(76px + env(safe-area-inset-top, 0px)) 0 0; max-width: none; margin: 0; }
.game-embedded .game { position: relative; inset: auto; z-index: 1; min-height: calc(100svh - 118px); padding: 10px 16px 28px; background: transparent; }
.game-embedded .g-brand { display: none; }
.game-embedded .g-top { grid-template-columns: 1fr auto; }
.game-embedded .g-tabs { justify-content: flex-start; }
.game-embedded .g-wrap { align-items: start; }
.game-embedded .g-card { height: min(640px, calc(100svh - 190px)); min-height: 520px; }
.g-crumbs { max-width: 1120px; margin: 0 auto; padding: 8px 16px 0; display: flex; gap: 8px; font-size: 14px; color: var(--muted); }
.g-crumbs a { color: var(--muted); text-decoration: none; }
.g-crumbs a:hover { color: var(--ink); }
.g-crumbs a::after { content: "/"; margin-left: 8px; color: var(--hair); }
.g-crumbs [aria-current] { color: var(--ink); }

/* ---------- colour: every game glows in its own candy colours (same palette as the /games panels) ---------- */
[data-game="color"] .g-card, .dk-color { --k0: #ff4fa8; --k1: #0a7cff; --k2: #2ecc40; }
[data-game="time"]  .g-card, .dk-time  { --k0: #e8335f; --k1: #2fd6a6; --k2: #8b5cff; }
[data-game="sound"] .g-card, .dk-sound { --k0: #0a7cff; --k1: #ff2e44; --k2: #9be62a; }
[data-game="react"] .g-card, .dk-react { --k0: #ff2e44; --k1: #22c8ff; --k2: #8b5cff; }
[data-game="count"] .g-card, .dk-count { --k0: #1f9d58; --k1: #8b5cff; --k2: #ff4fa8; }
[data-game="path"]  .g-card, .dk-path  { --k0: #8b5cff; --k1: #2fd6a6; --k2: #ff2e44; }
/* while playing: plain black, no colour glows (they mixed into each other) */
[data-game] .g-card {
  background: var(--card-bg, var(--ground));
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--k0) 55%, transparent), 0 8px 24px rgba(0,0,0,.14);
}
.g-card .btn:not(.ghost) { background: var(--k0, var(--ink)); border-color: var(--k0, var(--ink)); color: #fff; }
.g-tabs .dk[aria-current="true"] { --dk-ground: var(--k0) !important; --dk-ink: #fff !important; opacity: 1; box-shadow: 0 10px 22px -10px var(--k0); }
.g-tabs .dk:not([aria-current="true"]) .dk-ic { color: var(--k0); }

/* light mode: the game card's intro screen wears its own game's colour (dark mode keeps the light card — the rules above reset --card-bg) */
/* only on the game's intro screen — once you press play the inside goes back to black */
[data-game] .g-card:has(.g-intro) {
  --card-bg: radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--k0), #fff 14%), transparent 70%), linear-gradient(165deg, var(--k0), color-mix(in srgb, var(--k0) 55%, #0b0b0f));
  --ground: color-mix(in srgb, var(--k0) 42%, #0b0b0f); --ink: #fff; --surface: rgba(255,255,255,.16); --hair: rgba(255,255,255,.3); --muted: rgba(255,255,255,.8);
}

/* ---------- rounds picker (start screen and the room host) ---------- */
.rounds { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.rounds-lbl { color: var(--muted); margin-right: 2px; }
.rounds button { min-width: 36px; height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--hair); background: transparent; color: var(--ink); font: 500 13px/1 var(--body); cursor: pointer; }
.rounds button[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.rounds input { width: 84px; height: 32px; border-radius: 999px; border: 1px solid var(--hair); background: transparent; color: var(--ink); font: 500 13px/1 var(--body); text-align: center; padding: 0 8px; outline: none; -moz-appearance: textfield; }
.rounds input::-webkit-outer-spin-button, .rounds input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rounds input:focus { border-color: var(--ink); }
.rounds input:not(:placeholder-shown) { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.mp .rounds { justify-content: center; margin-top: 0; }

/* ---------- live room ---------- */
.mp-sub { margin: 4px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mp-who-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mp-who-list li { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); font-size: 14px; animation: mp-pop .35s cubic-bezier(.3,1.5,.5,1); }
.mp-who-list li.me { outline: 1.5px solid var(--ink); }
.mp-who-list small { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@keyframes mp-pop { from { transform: scale(.8); opacity: 0; } }
.mp-wait { margin: 0; font-size: 14px; color: var(--muted); animation: mp-breathe 1.8s ease-in-out infinite; }
@keyframes mp-breathe { 50% { opacity: .45; } }
.mp-dot, .mp-live-k i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff2e44; margin-right: 6px; vertical-align: middle; animation: mp-breathe 1.2s ease-in-out infinite; }
/* the live scoreboard: a strip of chips ABOVE the game card (in the flow, so it never covers the game).
   Chips shrink as the room fills up (--n players, up to 15); phones get one scrolling row. */
.mp-live { --n: 2; width: min(760px, 100%); margin: 0 auto 10px; display: flex; align-items: center; gap: 8px; font-size: clamp(10px, calc(14px - var(--n) * .28px), 13px); }
.mp-live-k { flex: none; display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mp-live ol { list-style: none; margin: 0; padding: 2px; flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.mp-live li { display: inline-flex; align-items: center; gap: .45em; padding: .35em .75em .35em .45em; border-radius: 999px; background: var(--surface); border: 1px solid var(--hair);
  line-height: 1; transition: background .3s, transform .3s cubic-bezier(.3,1.6,.5,1); max-width: 100%; }
.mp-live .rk { width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; font-size: .82em; font-weight: 700; background: var(--ground); color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-live .nm { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mp-live .pg { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9em; }
.mp-live b { font-weight: 700; font-variant-numeric: tabular-nums; }
.mp-live li.me { border-color: var(--ink); }
.mp-live li.lead .rk { background: var(--k0, var(--ink)); color: #fff; }
.mp-live li.done .pg { color: #1f9d58; font-weight: 600; }
.mp-live li.away { opacity: .45; }
.mp-live.many .pg { display: none; }                                 /* crowded room: name + score only */
.mp-live.many .nm { max-width: 6.5em; }
@media (max-width: 760px) {
  .mp-live { width: 100%; margin-bottom: 8px; }
  .mp-live ol { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mp-live ol::-webkit-scrollbar { display: none; }
  .mp-live li { flex: none; }
  .mp-live .pg { display: none; }
}

/* ---------- the end of a multiplayer game: winner + podium + ranking ---------- */
.mp-final { width: 100%; display: grid; gap: 14px; justify-items: center; }
.mp-win { margin: 0; display: grid; gap: 2px; text-align: center; }
.mp-win-k { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mp-win-n { font: 500 clamp(24px, 6vw, 32px)/1.1 var(--display); letter-spacing: -.03em; animation: pd-pop .6s 1.1s cubic-bezier(.3,1.6,.5,1) both; }
.mp-podium { width: 100%; display: grid; grid-template-columns: 1fr 1.12fr 1fr; align-items: end; gap: 8px; }
.pd { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pd-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; animation: pd-pop .45s calc(var(--d) + .45s) cubic-bezier(.3,1.6,.5,1) both; }
.pd-score { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; animation: pd-pop .45s calc(var(--d) + .5s) ease both; }
.pd-block { width: 100%; display: grid; place-items: start center; padding-top: 10px; border-radius: 16px 16px 8px 8px; color: #fff;
  font: 600 26px/1 var(--display); transform-origin: bottom; animation: pd-rise .7s var(--d) cubic-bezier(.2,1.3,.4,1) both;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -10px 16px -10px rgba(0,0,0,.25); }
.pd-1 .pd-block { height: 118px; background: var(--k0, #16171b); }
.pd-2 .pd-block { height: 86px; background: var(--k1, #555a66); }
.pd-3 .pd-block { height: 64px; background: var(--k2, #8b8f99); }
.pd.me .pd-name::after { content: " ●"; font-size: .7em; vertical-align: middle; }
.pd-crown { width: 30px; height: 30px; color: var(--k0, #16171b); animation: pd-crown 1s calc(var(--d) + .6s) cubic-bezier(.3,1.6,.5,1) both, pd-bob 2.4s 1.8s ease-in-out infinite; }
.pd-crown svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--k0, #000) 45%, transparent)); }
.mp-rank { width: 100%; margin: 0; padding: 0; list-style: none; counter-reset: rk 3; display: grid; gap: 6px; }
.mp-rank li { counter-increment: rk; display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 14px; border-radius: 12px; background: var(--surface); font-size: 14px; animation: pd-pop .4s 1.3s ease both; }
.mp-rank li::before { content: counter(rk); color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-rank li.me { outline: 1.5px solid var(--ink); }
.mp-rank .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-rank b { font-weight: 500; font-variant-numeric: tabular-nums; }
@keyframes pd-rise { from { transform: scaleY(0); } }
@keyframes pd-pop { from { opacity: 0; transform: translateY(8px) scale(.9); } }
@keyframes pd-crown { from { opacity: 0; transform: translateY(-24px) rotate(-20deg) scale(.4); } }
@keyframes pd-bob { 50% { transform: translateY(-4px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .pd-block, .pd-name, .pd-score, .pd-crown, .mp-win-n, .mp-rank li { animation: none; } }

/* glass mode: the podium is made of coloured glass, the ranking rows are clear glass slabs */
:root.glass .pd-block {
  background: linear-gradient(170deg, color-mix(in srgb, var(--pc) 45%, rgba(255,255,255,.5)), color-mix(in srgb, var(--pc) 70%, transparent));
  color: #fff; text-shadow: 0 1px 8px color-mix(in srgb, var(--pc) 70%, #000);
  -webkit-backdrop-filter: saturate(1.6) brightness(1.06); backdrop-filter: saturate(1.6) brightness(1.06);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.95), inset 0 -1px 1px rgba(255,255,255,.5), inset 12px 0 18px -14px rgba(255,255,255,.9),
    inset 0 -18px 24px -18px rgba(255,255,255,.7), 0 0 0 .5px rgba(255,255,255,.6), 0 16px 30px -16px color-mix(in srgb, var(--pc) 60%, transparent);
}
:root.glass .pd-1 { --pc: var(--k0, #0a7cff); } :root.glass .pd-2 { --pc: var(--k1, #8b5cff); } :root.glass .pd-3 { --pc: var(--k2, #2fd6a6); }
:root.glass .pd-crown svg { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 6px 12px color-mix(in srgb, var(--k0, #000) 50%, transparent)); }
:root.glass .mp-rank li { background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 1px rgba(255,255,255,.18), 0 0 0 .5px rgba(255,255,255,.12), 0 8px 18px -12px rgba(0,0,0,.5); }

/* ================= the game's start screen, redesigned =================
   top: name, one line, rounds · middle: the icon floating on soft rings · bottom: a real Start pill (with your best),
   "with friends" beside it, the daily Energize on the right */
.g-card .g-intro { gap: 10px; }
.g-intro .it-title { font-size: clamp(50px, 13vw, 72px); }
.g-intro .it-desc { font-size: 16px; opacity: .8; }
.g-intro .it-icon { position: relative; min-height: 150px; }
.g-intro .it-halo { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.g-intro .it-halo i { position: absolute; left: 0; top: 0; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent); animation: it-ring 3.6s cubic-bezier(.2,.6,.3,1) infinite; }
.g-intro .it-halo i:nth-child(2) { animation-delay: 1.2s; } .g-intro .it-halo i:nth-child(3) { animation-delay: 2.4s; }
.g-intro .it-halo::before { content: ""; position: absolute; width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--ink) 16%, transparent), transparent 70%); }
@keyframes it-ring { 0% { transform: scale(.55); opacity: 0; } 25% { opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.g-intro .g-icon { position: relative; filter: drop-shadow(0 12px 24px rgba(0,0,0,.18)); }

/* rounds: one capsule, the chosen number lifts out as a pill */
.rounds { gap: 10px; margin-top: 6px; }
.rounds-lbl { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .75; color: inherit; }
.rounds-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent); }
.rounds .rounds-seg button { min-width: 38px; height: 30px; border: 0; background: transparent; border-radius: 999px; font-weight: 600; transition: background .25s, color .25s, transform .25s cubic-bezier(.3,1.6,.5,1); }
.rounds .rounds-seg button[aria-pressed="true"] { background: var(--ink); color: var(--ground); box-shadow: 0 4px 12px -4px rgba(0,0,0,.35); transform: scale(1.04); }
.rounds .rounds-seg input { width: 46px; height: 30px; border: 0; background: transparent; border-radius: 999px; font-weight: 600; }
.rounds .rounds-seg input::placeholder { color: currentColor; opacity: .7; }
.rounds .rounds-seg input:focus { width: 58px; background: color-mix(in srgb, var(--ink) 16%, transparent); }
.rounds .rounds-seg input:not(:placeholder-shown) { background: var(--ink); color: var(--ground); }

/* bottom: Start is a pill, not a lone circle */
.g-intro .it-bottom { align-items: flex-end; }
.g-intro .it-left { gap: 10px; flex-wrap: wrap; align-items: center; }
.round-btn.it-start { width: auto; height: 60px; border-radius: 999px; padding: 0 24px 0 8px; display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--ground); box-shadow: 0 14px 30px -14px rgba(0,0,0,.5); transition: transform .3s cubic-bezier(.3,1.6,.5,1), box-shadow .3s; }
.round-btn.it-start:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 18px 36px -14px rgba(0,0,0,.55); }
.round-btn.it-start:active { transform: scale(.97); }
.round-btn.it-start::before { border-radius: 999px; inset: -4px; }
.it-play { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ground); color: var(--ink); }
.it-play svg { width: 18px; height: 18px; margin-left: 2px; }
.it-start-t { display: grid; text-align: left; line-height: 1.15; }
.it-start-t b { font: 600 17px/1.1 var(--body); }
.it-start-t small { font-size: 12px; opacity: .7; }
.it-start-t small:empty { display: none; }
.g-intro .mp-btn { height: 44px; padding: 0 16px 0 12px; border-color: color-mix(in srgb, var(--ink) 30%, transparent); background: color-mix(in srgb, var(--ink) 8%, transparent); font-size: 14px; }
.g-intro .it-right { flex-direction: column; gap: 6px; align-items: center; }
.g-intro .daily-cap { text-align: center; }
@media (max-width: 480px) {
  .g-intro .it-bottom { flex-wrap: wrap; }
  .g-intro .it-left { flex: 1 1 100%; }
  .round-btn.it-start { flex: 1; }
  .g-intro .it-right { flex-direction: row; margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .g-intro .it-halo i { animation: none; opacity: .35; } }

/* ================= glass mode: the whole game card is glass =================
   start screen: the game's colour as tinted glass with dark text; while playing and on the results / winners:
   white glass (light, as in the rest of glass mode) */
:root.glass [data-game] .g-card {
  --card-bg: linear-gradient(170deg, rgba(255,255,255,.86), rgba(255,255,255,.66));
  --ground: #fbfbfd; --ink: #16171b; --surface: rgba(20,22,40,.05); --hair: rgba(20,22,40,.12); --muted: #5a5e69; color-scheme: light;
  -webkit-backdrop-filter: saturate(1.6) brightness(1.04); backdrop-filter: saturate(1.6) brightness(1.04);
  box-shadow: inset 0 1.5px 0 #fff, inset 0 -1px 1px rgba(255,255,255,.7), inset 16px 0 30px -26px #fff, inset 0 -30px 40px -34px rgba(255,255,255,.95),
    0 0 0 .5px rgba(20,22,40,.1), 0 40px 80px -40px color-mix(in srgb, var(--k0) 45%, rgba(20,22,40,.4)), 0 10px 24px -14px rgba(20,22,40,.2);
}
:root.glass [data-game] .g-card:has(.g-intro) {
  --card-bg: radial-gradient(90% 60% at 100% 0%, rgba(255,255,255,.5), transparent 70%),
    linear-gradient(165deg, color-mix(in srgb, var(--k0) 58%, rgba(255,255,255,.72)), color-mix(in srgb, var(--k0) 80%, rgba(255,255,255,.4)));
  --ground: #ffffff; --ink: #16171b; --surface: rgba(255,255,255,.4); --hair: rgba(20,22,40,.16); --muted: rgba(22,23,27,.76);
}
:root.glass [data-game] .g-card:has(.g-intro) .it-title { color: color-mix(in srgb, var(--k0) 40%, #0e0f13); }
:root.glass .g-intro .it-halo i { border-color: color-mix(in srgb, var(--k0) 45%, transparent); }
:root.glass .g-intro .it-halo::before { background: radial-gradient(circle, rgba(255,255,255,.9), transparent 70%); }
:root.glass .g-intro .g-icon { color: color-mix(in srgb, var(--k0) 70%, #16171b); }
:root.glass .rounds-seg { background: rgba(255,255,255,.45); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(20,22,40,.08); }
:root.glass .rounds .rounds-seg button[aria-pressed="true"], :root.glass .rounds .rounds-seg input:not(:placeholder-shown) { background: #16171b; color: #fff; }
:root.glass .round-btn.it-start { background: #16171b; color: #fff; }
:root.glass .it-play { background: #fff; color: #16171b; }
:root.glass .g-intro .mp-btn { background: rgba(255,255,255,.5); border-color: rgba(255,255,255,.8); box-shadow: inset 0 1px 0 #fff, 0 6px 16px -10px rgba(20,22,40,.3); }
/* winners in glass mode: white glass, the podium in the game's coloured glass */
:root.glass .mp-rank li { background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.6));
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 1px rgba(255,255,255,.6), 0 0 0 .5px rgba(20,22,40,.1), 0 8px 18px -12px rgba(20,22,40,.25); }
:root.glass .mp-live li { border: 0; background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.6));
  box-shadow: inset 0 1px 0 #fff, 0 0 0 .5px rgba(20,22,40,.12), 0 6px 14px -8px rgba(20,22,40,.25); }
:root.glass .mp-live li.me { box-shadow: inset 0 1px 0 #fff, 0 0 0 1.5px #16171b, 0 6px 14px -8px rgba(20,22,40,.25); }

/* glass mode: the game deck and the tools beside it are glass too —
   other games are clear white glass with their colour in the icon, the open game is its colour in glass */
:root.glass .g-tabs .dk {
  --dk-ground: transparent; --dk-ink: #16171b; opacity: 1;
  background: linear-gradient(170deg, rgba(255,255,255,.82), rgba(255,255,255,.5));
  -webkit-backdrop-filter: saturate(1.6) brightness(1.04); backdrop-filter: saturate(1.6) brightness(1.04);
  box-shadow: inset 0 1.5px 0 #fff, inset 0 -1px 1px rgba(255,255,255,.6), inset 10px 0 16px -12px #fff, 0 0 0 .5px rgba(20,22,40,.1), 0 8px 18px -10px rgba(20,22,40,.2);
}
:root.glass .g-tabs .dk:hover { box-shadow: inset 0 1.5px 0 #fff, inset 0 -1px 1px rgba(255,255,255,.6), 0 0 0 .5px rgba(20,22,40,.12), 0 14px 26px -12px rgba(20,22,40,.28); }
:root.glass .g-tabs .dk[aria-current="true"] {
  --dk-ground: transparent !important; --dk-ink: #fff !important;
  background: linear-gradient(160deg, color-mix(in srgb, var(--k0) 58%, rgba(255,255,255,.45)), color-mix(in srgb, var(--k0) 78%, transparent));
  text-shadow: 0 1px 6px color-mix(in srgb, var(--k0) 70%, #000);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.9), inset 0 -1px 1px rgba(255,255,255,.5), inset 12px 0 18px -14px rgba(255,255,255,.9),
    inset 0 -14px 20px -14px rgba(255,255,255,.6), 0 0 0 .5px rgba(255,255,255,.6), 0 14px 28px -12px color-mix(in srgb, var(--k0) 65%, transparent);
}
:root.glass .game .g-pack, :root.glass .game .g-close {
  border: 0; opacity: 1; color: #16171b;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.55));
  -webkit-backdrop-filter: saturate(1.6); backdrop-filter: saturate(1.6);
  box-shadow: inset 0 1.5px 0 #fff, inset 0 -1px 1px rgba(255,255,255,.6), 0 0 0 .5px rgba(20,22,40,.12), 0 8px 18px -10px rgba(20,22,40,.25);
  transition: transform .3s cubic-bezier(.3,1.6,.5,1), box-shadow .3s;
}
:root.glass .game .g-pack:hover, :root.glass .game .g-close:hover { transform: translateY(-1px) scale(1.04); }
:root.glass .game .g-packmenu { background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.75)); border: 0;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 .5px rgba(20,22,40,.12), 0 20px 50px -20px rgba(20,22,40,.35); }

/* sound-pack menu, compact: two columns of icon + name (the one-line description moves into a tooltip) */
.g-packmenu { width: 300px; padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-height: min(70vh, 420px); overflow: auto; }
.g-packmenu .pm-title { grid-column: 1 / -1; margin: 4px 8px 4px; }
.g-packmenu button { grid-template-columns: 30px 1fr 12px; gap: 8px; padding: 8px; }
.g-packmenu .pi { width: 30px; height: 30px; border-radius: 9px; }
.g-packmenu .pt small { display: none; }
.g-packmenu .pt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-packmenu .ok { font-size: 12px; }
@media (max-width: 400px) { .g-packmenu { width: min(300px, calc(100vw - 24px)); } }
/* phones: the menu hangs from the whole row (not from its button), so it always stays on screen */
@media (max-width: 640px) {
  .gal-tools { position: relative; }
  .gal-pack { position: static; }
  .gal-pack .g-packmenu { left: 0; right: auto; width: min(300px, 100%); }
  .g-top { position: relative; }
  .g-top .g-packwrap { position: static; }
  .g-top .g-packmenu { left: auto; right: 0; width: min(300px, 100%); }
}
/* with the live strip above it, the game card gives up a little height so everything still fits the screen */
.game-embedded .game:has(.mp-live) .g-card { height: min(620px, calc(100svh - 236px)); min-height: 480px; }

/* the custom round count reads as a real choice: "Custom ✎", then your number (1–20) */
.rounds .rounds-seg input { width: 86px; padding: 0 10px; }
.rounds .rounds-seg input:focus, .rounds .rounds-seg input:not(:placeholder-shown) { width: 64px; }
.rounds .rounds-seg input::placeholder { font-weight: 500; opacity: .8; }

/* room lobby: the host picks the game (chips) and the rounds; guests see a line with the choice */
.mp-host-only { display: grid; gap: 10px; justify-items: center; width: 100%; }
.mp-games { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mp-games button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--hair);
  background: transparent; color: var(--ink); font: 500 13px/1 var(--body); cursor: pointer; transition: background .2s, color .2s, transform .25s cubic-bezier(.3,1.6,.5,1); }
.mp-games button:hover { transform: translateY(-1px); }
.mp-games button[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.mp-games .mg-ic { width: 20px; height: 20px; display: grid; place-items: center; overflow: hidden; }
.mp-games .mg-ic svg { width: 18px !important; height: 18px !important; }
.mp-games .mg-ic .mk { width: 5px !important; height: 9px !important; background: currentColor; }
.mp-setup-info { margin: 0; font-size: 14px; font-weight: 500; }
:root.glass .mp-games button { border: 0; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.5)); box-shadow: inset 0 1px 0 #fff, 0 0 0 .5px rgba(20,22,40,.12), 0 6px 14px -8px rgba(20,22,40,.25); }
:root.glass .mp-games button[aria-pressed="true"] { background: #16171b; color: #fff; }

/* The Liming: the game fills the screen on its own (no page header or footer) — tabs on the left, tools on the right */
.game .g-top { grid-template-columns: minmax(0, 1fr) auto; }
.game .g-tabs { justify-content: flex-start; }
.g-tools { align-items: center; }
.g-tools .set-btn { width: 40px; height: 40px; }

/* ---------- Easy · Hard (lobby.js diffPicker): a black glass switch; the sliding thumb is a bead of the game's colour (--k0) ---------- */
.diff { display: grid; gap: 8px; justify-items: start; }
.diff-row { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* the track matches the Rounds control (light glass); the thumb stays a glass bead of the game's colour */
.diff-seg { position: relative; isolation: isolate; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent); }
:root.glass .diff-seg { background: rgba(255,255,255,.45); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(20,22,40,.08); }
.diff-seg button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 76px; height: 30px; padding: 0 12px;
  border: 0; border-radius: 999px; background: none; cursor: pointer; color: var(--ink); font: 600 13px/1 var(--body); transition: color .3s; }
.diff-seg button svg { width: 13px; height: 13px; flex: none; }
.diff-seg button[aria-checked="true"] { color: #fff; }
.diff-seg button:focus { outline: none; }
.diff-seg button:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 55%, transparent); }
/* the chosen side: a black pill, the same as the chosen number in Rounds; it slides across */
.diff-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px;
  background: #16171b; box-shadow: 0 4px 12px -4px rgba(0,0,0,.35); transform: scale(1.04);
  transition: transform .55s cubic-bezier(.3,1.6,.45,1); }
.diff[data-mode="hard"] .diff-thumb { transform: translateX(100%) scale(1.04); }
/* "no medium": a crossed-out chip and the reason */
.diff-note { margin: 0; display: flex; align-items: baseline; gap: 8px; max-width: 38ch; font-size: 12.5px; line-height: 1.4; }
.diff-note > span { opacity: .75; font-style: italic; }
.diff-med { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: line-through 1.5px;
  color: color-mix(in srgb, var(--ink) 60%, transparent); background: rgba(255,255,255,.4); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
/* the soft sparks that fly out of the switch */
.diff-dot { position: absolute; z-index: 5; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #fff 0 25%, var(--dc) 60%, transparent 72%); }
/* the flash that spreads from the switch, and the card's look while Hard is on */
.diff-flash { position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit; }
.diff-flash.hard { background: radial-gradient(circle at var(--x) var(--y), color-mix(in srgb, var(--k0, #ff3b30) 70%, transparent), color-mix(in srgb, var(--k0, #ff3b30) 26%, transparent) 38%, transparent 72%); }
.diff-flash.easy { background: radial-gradient(circle at var(--x) var(--y), rgba(255,255,255,.7), color-mix(in srgb, var(--k0, #4fd1a5) 30%, transparent) 42%, transparent 74%); }
.g-card.is-hard { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--k0, #e62832) 55%, transparent), 0 0 0 1px color-mix(in srgb, var(--k0, #e62832) 20%, transparent), 0 30px 70px -20px color-mix(in srgb, var(--k0, #c81428) 55%, transparent); transition: box-shadow .5s; }
@media (prefers-reduced-motion: reduce) { .diff-thumb { transition: none; } }
/* short screens: the switch takes room from the big icon, not from the buttons */
@media (max-height: 760px) { .g-intro .it-icon { min-height: 70px; } .g-intro .g-icon { height: 80px; } .g-intro .it-title { font-size: clamp(44px, 11vw, 60px); } }
@media (max-height: 700px) { .g-intro .it-icon { display: none; } }

/* ---------- Rounds + difficulty: two quiet pills beside Start / With friends ---------- */
.g-intro .it-left { flex-wrap: wrap; row-gap: 10px; }
.it-pill { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.8); background: rgba(255,255,255,.5); color: #16171b; font: 500 14px/1 var(--body);
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px -10px rgba(20,22,40,.3); transition: transform .2s, background .2s; }
.it-pill:hover { transform: translateY(-1px); background: rgba(255,255,255,.66); }
.it-pill b { font-weight: 600; font-variant-numeric: tabular-nums; }
.it-pill span { opacity: .75; }
.it-pill i { display: inline-grid; place-items: center; }
.it-pill svg { width: 15px; height: 15px; }
.it-diff-pill[data-mode="hard"] { background: #16171b; color: #fff; border-color: #16171b; box-shadow: none; }
.it-diff-pill[data-mode="hard"] span { opacity: 1; }

/* ---------- With friends: the room screens as glass ---------- */
.g-panel.mp { gap: 14px; }
.mp .mp-seg { border: 1px solid rgba(255,255,255,.8); background: rgba(255,255,255,.4); box-shadow: inset 0 1px 0 #fff; padding: 4px; }
.mp .mp-seg button { color: #16171b; opacity: .7; }
.mp .mp-seg button[aria-selected="true"] { background: #16171b; color: #fff; opacity: 1; }
.mp .mp-in, .mp-in { height: 50px; border-radius: 16px; border: 1px solid rgba(255,255,255,.85); background: rgba(255,255,255,.5); color: #16171b;
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px -12px rgba(20,22,40,.3); -webkit-backdrop-filter: saturate(1.5); backdrop-filter: saturate(1.5); }
.mp .mp-in::placeholder { color: #16171b; opacity: .5; }
.mp .mp-in:focus { border-color: #16171b; outline: none; }
.mp .btn, .mp .btn.ghost { border-radius: 999px; min-height: 48px; border: 1px solid rgba(255,255,255,.85); background: rgba(255,255,255,.55); color: #16171b;
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px -12px rgba(20,22,40,.3); }
.mp .btn:not(.ghost) { background: #16171b; color: #fff; border-color: #16171b; box-shadow: none; }
.mp .mp-back { color: #16171b; opacity: .7; }
.mp-codebig span, .mp-who-list li, .mp-board li, .mp-rank li { background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.85);
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px -12px rgba(20,22,40,.25); color: #16171b; }
.mp-board li.win, .mp-who-list li.me { background: #16171b; color: #fff; }
.mp-live li { background: rgba(255,255,255,.55); border-color: rgba(255,255,255,.85); box-shadow: inset 0 1px 0 #fff; }
:root.lowfx .mp .mp-in, :root.lowfx .mp-in { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* the room screens take the same tinted glass card as the start screen */
:root.glass [data-game] .g-card:has(.mp) {
  --card-bg: radial-gradient(90% 60% at 100% 0%, rgba(255,255,255,.5), transparent 70%),
    linear-gradient(165deg, color-mix(in srgb, var(--k0) 58%, rgba(255,255,255,.72)), color-mix(in srgb, var(--k0) 80%, rgba(255,255,255,.4)));
  --ground: #ffffff; --ink: #16171b; --surface: rgba(255,255,255,.4); --hair: rgba(20,22,40,.16); --muted: rgba(22,23,27,.76);
}
.mp .mp-pane, .g-panel.mp { text-align: left; }
.mp .mp-title { font: 600 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.mp .mp-in { text-align: left; padding: 0 16px; }
.mp .mp-code { text-align: center; }
.g-card .mp .btn:not(.ghost), .game .mp .btn:not(.ghost) { background: #16171b !important; color: #fff !important; border-color: #16171b !important; }

/* room screens: white glass fields with only a whisper of the card colour; the main actions are black */
.mp .mp-in, .mp-in { background: color-mix(in srgb, var(--k0, #ff4fa8) 3%, rgba(255,255,255,.93)); border-color: rgba(255,255,255,.95); }
.mp .btn.ghost, .mp .mp-seg { background: color-mix(in srgb, var(--k0, #ff4fa8) 3%, rgba(255,255,255,.9)); }
.mp .mp-seg button[aria-selected="true"] { background: #16171b; color: #fff; }
.g-card .mp .btn:not(.ghost), .game .mp .btn:not(.ghost) { background: #16171b !important; color: #fff !important; border-color: #16171b !important; box-shadow: none; }
.g-card .mp .btn.ghost { background: rgba(255,255,255,.85) !important; color: #16171b !important; border-color: rgba(255,255,255,.95) !important; }
:root.glass .g-card .mp .mp-in { background: color-mix(in srgb, #ff2e44 3%, rgba(255,255,255,.94)) !important; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: rgba(255,255,255,.95); }
:root.glass .g-card .mp .mp-seg, :root.glass .g-card .mp .btn.ghost { background: color-mix(in srgb, #ff2e44 3%, rgba(255,255,255,.9)) !important; }

/* glass, not paper: the fields are see-through, with a bright rim on top, light pooling at the bottom and a soft blur of the card behind */
:root.glass .g-card .mp .mp-in {
  background: linear-gradient(180deg, rgba(255,255,255,.74), rgba(255,255,255,.5)) !important;
  border: 1px solid rgba(255,255,255,.85);
  -webkit-backdrop-filter: blur(14px) saturate(.85) brightness(1.08); backdrop-filter: blur(14px) saturate(.85) brightness(1.08);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.95), inset 0 -8px 14px -10px rgba(255,255,255,.6), inset 8px 0 14px -12px rgba(255,255,255,.7), 0 8px 18px -12px rgba(120,20,30,.35);
  color: #16171b;
}
:root.glass .g-card .mp .mp-in::placeholder { color: #16171b; opacity: .55; }
:root.glass .g-card .mp .mp-in:focus { background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.66)) !important; border-color: rgba(255,255,255,.95); }
:root.glass .g-card .mp .mp-seg, :root.glass .g-card .mp .btn.ghost {
  background: linear-gradient(180deg, rgba(255,255,255,.74), rgba(255,255,255,.5)) !important;
  border: 1px solid rgba(255,255,255,.85) !important;
  -webkit-backdrop-filter: blur(14px) saturate(.85) brightness(1.08); backdrop-filter: blur(14px) saturate(.85) brightness(1.08);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.95), inset 0 -8px 14px -10px rgba(255,255,255,.6), 0 8px 18px -12px rgba(120,20,30,.35) !important;
}
:root.lowfx .g-card .mp .mp-in, :root.lowfx .g-card .mp .mp-seg, :root.lowfx .g-card .mp .btn.ghost { -webkit-backdrop-filter: none; backdrop-filter: none; }
