/* 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);
}
