@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/archivo-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/archivo-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/newsreader-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/newsreader-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/newsreader-400-italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/newsreader-400-italic-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: "Lilita One"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/lilita-one-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lilita One"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/lilita-one-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #1d2420;
  --muted: #5b6259;
  --rule: #e2e2dc;
  --rule-strong: #c6c6bd;
  --accent: #1d2420;
  --accent-ink: #faf8f3;
  --highlight: #b07f2c;
  --soft: #f1f1ec;
  --wrong: #b4533f;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scrollbar-color: var(--rule-strong) transparent;
}
/* Game colour schemes: each game gets its own Geometry Dash-style sky, keyed to its homepage badge. */
body[data-game] {
  --ink: #ffffff;
  --muted: rgb(255 255 255 / .82);
  --rule: rgb(255 255 255 / .24);
  --rule-strong: rgb(255 255 255 / .42);
  --soft: rgb(255 255 255 / .12);
  --accent-ink: #10131a;
  --bg: var(--sky-3);
  color-scheme: dark;
  background: var(--sky-3) linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 50%, var(--sky-3) 100%) fixed;
}
body[data-game="linkspan"] {
  --sky-1: #2d66ea; --sky-2: #1745c2; --sky-3: #0d2a86;
  --surface: #123a9e;
  --accent: #f2b632;
  --highlight: #ffd23f;
  --wrong: #ffb3a8;
  --card: #fff6dc;
  --card-ink: #10131a;
}
body[data-game="first-beat"] {
  --sky-1: #6a32d8; --sky-2: #46209f; --sky-3: #250d63;
  --surface: #34167e;
  --accent: #8ff05a;
  --highlight: #8ff05a;
  --wrong: #ffb3a8;
}
body[data-game="level-lens"] {
  --sky-1: #c9402a; --sky-2: #8f1f14; --sky-3: #4a0c07;
  --surface: #6a150d;
  --accent: #ffa24d;
  --highlight: #ffc06e;
  --wrong: #ffd0c8;
}
body[data-game="chess"] {
  --sky-1: #4f9a35; --sky-2: #2f7224; --sky-3: #163f12;
  --surface: #1f5419;
  --accent: #f2b632;
  --highlight: #ffd23f;
  --wrong: #ffd0c8;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 280px; min-height: 100vh; min-height: 100dvh; display: flow-root; background: var(--bg); color: var(--ink); }
::selection { background: var(--highlight); color: var(--bg); }
input { caret-color: var(--highlight); }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--highlight); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
p { margin: 0; }
h1, h2, h3 { line-height: 1.05; margin: 0; text-wrap: balance; }
.icon { width: 18px; height: 18px; flex: none; }

/* Home: level list */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gd-text {
  font-family: "Lilita One", var(--sans); font-weight: 400; letter-spacing: .01em; line-height: 1.1;
  color: #fff; -webkit-text-stroke: .14em #10131a; paint-order: stroke fill;
  text-shadow: 0 .07em 0 rgb(16 19 26 / .45);
}
body:not([data-game]) { color: #fff; background: #0d2a86 linear-gradient(180deg, #2d66ea 0%, #1745c2 45%, #0d2a86 100%) fixed; }
body:not([data-game]) ::selection { background: #f2b632; color: #10131a; }
#home, #game-view { position: relative; z-index: 1; }
.home { position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; padding: 0 20px; overflow-x: clip; }
.backdrop {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background-image: linear-gradient(rgb(255 255 255 / .045) 2px, transparent 2px), linear-gradient(90deg, rgb(255 255 255 / .045) 2px, transparent 2px);
  background-size: 96px 96px;
}
.shape {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); rotate: var(--r);
  border: 6px solid rgb(255 255 255 / .13); border-radius: 12px;
  animation: turn 90s linear infinite;
}
.shape.ring { border-radius: 50%; }
.shape.tri { border: 0; border-radius: 0; background: rgb(255 255 255 / .1); clip-path: polygon(50% 6%, 96% 94%, 4% 94%); }
.depth-1 { opacity: .55; }
.depth-3 { opacity: 1; border-width: 8px; }
@keyframes turn { to { rotate: calc(var(--r) + 360deg); } }
@supports (animation-timeline: scroll()) {
  .depth-1 { animation: turn 90s linear infinite, drift-1 linear both; animation-timeline: auto, scroll(root); }
  .depth-2 { animation: turn 90s linear infinite, drift-2 linear both; animation-timeline: auto, scroll(root); }
  .depth-3 { animation: turn 90s linear infinite, drift-3 linear both; animation-timeline: auto, scroll(root); }
  @keyframes drift-1 { to { translate: 0 -90px; } }
  @keyframes drift-2 { to { translate: 0 -200px; } }
  @keyframes drift-3 { to { translate: 0 -340px; } }
}
.home-header { text-align: center; padding: clamp(44px, 8vw, 92px) 0 clamp(26px, 4vw, 40px); }
.wordmark { display: inline-flex; align-items: center; gap: .16em; font-size: clamp(44px, 8.4vw, 92px); animation: pop-in .7s cubic-bezier(.34, 1.56, .64, 1) both; }
.wordmark-mark { width: .78em; height: .78em; color: #f2b632; filter: drop-shadow(0 .05em 0 rgb(16 19 26 / .5)); }
.home-header p { margin-top: 12px; font-size: 18px; font-weight: 550; color: rgb(255 255 255 / .88); }
@keyframes pop-in { 0% { scale: .7; opacity: 0; } 60% { scale: 1.05; opacity: 1; } 100% { scale: 1; } }
.level-panel {
  position: relative; max-width: 900px; margin: 0 auto; padding: 0 14px 14px;
  background: #a5582a; border: 5px solid #10131a; border-radius: 24px;
  box-shadow: inset 0 0 0 4px #c9763d, 0 34px 60px -24px rgb(0 0 0 / .6);
  animation: drop-in .9s cubic-bezier(.34, 1.4, .64, 1) .12s both;
}
@keyframes drop-in { from { translate: 0 -40px; opacity: 0; } }
.panel-title { text-align: center; padding: 16px 0 12px; font-size: clamp(30px, 4.4vw, 42px); }
.level-list { list-style: none; margin: 0; padding: 0; overflow: hidden; background: #6e3514; border: 4px solid #10131a; border-radius: 14px; }
.level-row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 4px 18px;
  padding: 16px 22px 16px 12px; background: #8a4520; transition: background-color .2s;
}
.level-row:nth-child(even) { background: #7e3f1c; }
.level-row + .level-row { border-top: 3px solid #5e2d10; }
.level-row:hover { background: #964b23; }
.level-row:nth-child(even):hover { background: #8a4520; }
.badge { display: grid; justify-items: center; gap: 2px; }
.badge-art { width: 68px; height: 68px; filter: drop-shadow(0 3px 0 rgb(16 19 26 / .35)); transition: rotate .5s cubic-bezier(.34, 1.56, .64, 1), scale .5s cubic-bezier(.34, 1.56, .64, 1); }
.level-row:hover .badge-art { rotate: -10deg; scale: 1.08; }
.badge-label { font-size: 15px; }
.level-main { min-width: 0; }
.level-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; font-size: clamp(28px, 3.6vw, 38px); }
.level-progress { display: inline-flex; align-items: center; gap: 4px; font-size: .6em; color: #ffd23f; }
.level-progress.done { color: #8ff05a; }
.done-check { width: 1.15em; height: 1em; }
.level-by { margin-top: 2px; font-size: 19px; color: #ffe066; }
.level-tag { font-size: 16px; color: #fbd0ff; }
.level-stats {
  display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 0; padding: 0; list-style: none;
  font: 400 15px/1.2 "Lilita One", var(--sans); letter-spacing: .01em; color: #fff;
  -webkit-text-stroke: .14em #10131a; paint-order: stroke fill;
}
.level-stats li { display: inline-flex; align-items: center; gap: 6px; }
.level-stats .icon { width: 20px; height: 20px; }
.stat-cal, .stat-link { color: #7cc8ff; }
.stat-link { stroke: #10131a; }
.stat-clock { color: #c6f36b; }
.stat-trophy { color: #ffd23f; }
.play-button {
  display: inline-grid; place-items: center; min-width: 116px; min-height: 60px; padding: 0 22px;
  font-size: 27px; text-decoration: none;
  background: linear-gradient(#aef266, #5cc22a 55%, #3f9d17);
  border: 4px solid #10131a; border-radius: 16px;
  box-shadow: inset 0 4px 0 rgb(255 255 255 / .45), inset 0 -5px 0 rgb(16 19 26 / .2), 0 12px 20px -12px rgb(16 19 26 / .8);
  transition: scale .4s cubic-bezier(.34, 1.56, .64, 1), filter .2s;
}
.play-button:hover { scale: 1.06; filter: brightness(1.06); }
.play-button:active { scale: 1.16; transition-duration: .1s; }
.play-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 16px; }
@supports (animation-timeline: view()) {
  .level-row { animation: row-in linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
  @keyframes row-in { from { opacity: 0; translate: 70px 0; } }
}
/* Plain-language description of the games for players and search engines. */
.home-about { max-width: 720px; margin: clamp(40px, 6vw, 64px) auto 0; padding: 0 4px; color: rgb(255 255 255 / .88); font-size: 16px; line-height: 1.6; }
.home-about h2 { margin: 0 0 10px; color: #fff; font: 400 clamp(26px, 3.6vw, 34px)/1.15 "Lilita One", var(--sans); letter-spacing: .01em; }
.home-about h3 { margin: 22px 0 4px; font-size: 18px; font-weight: 750; color: #fff; }
.home-about a { color: #ffd23f; text-decoration-thickness: 2px; }
.home-about p { margin: 0; }
.home-ground { margin: clamp(48px, 7vw, 72px) -20px 0; text-align: center; }
.home-ground p { font-size: 20px; }
.community-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 20px; padding: 0 12px; }
.community-button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 20px 0 16px;
  font-size: 21px; text-decoration: none;
  border: 4px solid #10131a; border-radius: 15px;
  box-shadow: inset 0 4px 0 rgb(255 255 255 / .4), inset 0 -5px 0 rgb(16 19 26 / .2), 0 12px 20px -12px rgb(16 19 26 / .8);
  transition: scale .4s cubic-bezier(.34, 1.56, .64, 1), filter .2s;
}
.community-button svg { width: 26px; height: 26px; flex: none; }
.community-button:hover { scale: 1.06; filter: brightness(1.06); }
.community-button:active { scale: 1.14; transition-duration: .1s; }
.community-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 15px; }
.community-button.discord { background: linear-gradient(#8f9bff, #5865f2 55%, #4450d0); }
.community-button.kofi { background: linear-gradient(#ff9a8f, #ff5e5b 55%, #d9403e); }
.top-links { position: absolute; top: 16px; right: 20px; z-index: 2; display: flex; gap: 10px; }
.community-button.mini { min-height: 44px; gap: 7px; padding: 0 14px 0 10px; font-size: 17px; border-width: 3px; border-radius: 12px; }
.community-button.mini svg { width: 22px; height: 22px; }
.ground { position: relative; height: 150px; margin-top: 22px; overflow: hidden; }
.ground::after {
  content: ""; position: absolute; inset: auto 0 0; height: 92px;
  border-top: 3px solid rgb(255 255 255 / .75);
  background: linear-gradient(rgb(255 255 255 / .1), transparent 70%), repeating-linear-gradient(90deg, #163aa6 0 113px, #12318f 113px 115px);
  background-color: #12318f;
  animation: floor 2s linear infinite;
}
@keyframes floor { to { background-position: 0 0, -460px 0; } }
.hazards { position: absolute; left: 50%; bottom: 92px; width: 420px; height: 60px; margin-left: -210px; z-index: 1; }
.spike { position: absolute; bottom: 0; left: 0; }
.spike { width: 34px; height: 34px; background: #10131a; clip-path: polygon(50% 0, 100% 100%, 0 100%); animation: hazard 2s linear infinite; }
.spike::after { content: ""; position: absolute; inset: 7px 8px 0; background: #2d66ea; clip-path: polygon(50% 18%, 100% 100%, 0 100%); }
.runner { position: absolute; left: 50%; bottom: 92px; width: 38px; height: 38px; margin-left: -90px; z-index: 2; animation: jump 2s linear infinite; }
@keyframes hazard { from { translate: 420px 0; } to { translate: -40px 0; } }
@keyframes jump {
  0%, 52% { translate: 0 0; rotate: 0deg; animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  64% { translate: 0 -66px; rotate: 90deg; animation-timing-function: cubic-bezier(.6, 0, .8, .3); }
  76%, 100% { translate: 0 0; rotate: 180deg; }
}

/* Game shell */
.game-nav {
  max-width: 1200px; margin: auto; padding: 14px 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
.game-nav a, .game-nav button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 6px 10px; margin: 0 -10px;
  font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none;
  background: none; border: 0; border-radius: 10px;
  transition: color .2s, background-color .2s;
}
.game-nav a:hover, .game-nav button:hover { color: var(--ink); background: var(--soft); }
.game-nav .nav-brand { color: var(--ink); font: 400 19px/1 "Lilita One", var(--sans); letter-spacing: .01em; }
.nav-brand .icon { color: var(--highlight); }
.nav-actions { justify-self: end; display: flex; align-items: center; gap: 2px; }
.game-nav .nav-actions > * { margin: 0; }
.game-nav .nav-actions > :last-child { margin-right: -10px; }
.social-icon { width: 20px; height: 20px; }
.game { width: min(100% - 48px, 760px); margin: clamp(20px, 4vw, 40px) auto 72px; }
body[data-game="linkspan"] .game { width: min(100% - 48px, 1080px); }
.game-title { text-align: center; }
.game-title h1 { font-size: clamp(44px, 6.4vw, 68px); font-weight: 800; letter-spacing: -.04em; }
body[data-game="linkspan"] .game-title h1 { font: 400 clamp(50px, 7vw, 76px)/1 var(--serif); letter-spacing: -.025em; }
.game-title p { margin-top: 12px; font-size: 17px; color: var(--muted); }
.game-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 10px 0 clamp(28px, 4vw, 40px); color: var(--muted); font-size: 14px; }
.game-bar span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 14px 0 0; vertical-align: middle; border-radius: 50%; background: currentColor; opacity: .6; }

/* Controls */
.fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
#media-form .fields { grid-template-columns: minmax(0, 1fr) auto auto; }
.fields input {
  width: 100%; min-width: 0; height: 52px; padding: 12px 16px;
  font-size: 17px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.fields input::placeholder { color: var(--muted); opacity: 1; }
.fields input:focus { outline: none; border-color: var(--highlight); box-shadow: 0 0 0 3px color-mix(in srgb, var(--highlight) 22%, transparent); }
.search-field { position: relative; min-width: 0; }
.search-field .icon { position: absolute; left: 15px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 44px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 20px;
  font-size: 16px; font-weight: 650; text-decoration: none;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: 12px;
  transition: transform .15s var(--ease-out), background-color .2s, filter .2s;
}
.button:hover:not(:disabled) { background: var(--soft); }
.button:active:not(:disabled) { transform: scale(.97); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.12); }
.button.quiet { min-height: 44px; border-color: transparent; background: none; color: var(--muted); font-weight: 550; }
.button.quiet:hover:not(:disabled) { color: var(--ink); background: var(--soft); }
.feedback { min-height: 24px; margin-top: 12px; font-size: 15px; color: var(--muted); }

/* Linkspan */
body[data-game="linkspan"] #board { text-align: center; }
.round-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; }
.round-steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.round-steps li { width: 30px; height: 5px; border-radius: 3px; background: var(--rule); }
.round-steps .done { background: var(--ink); }
.round-steps .current { background: var(--highlight); }
.round-label { font-size: 15px; font-weight: 550; color: var(--muted); }
.meaning-cue { max-width: 520px; margin: -6px auto 24px; font: italic 400 19px/1.45 var(--serif); color: var(--muted); }
.bridge { position: relative; display: grid; grid-template-columns: 32% 1fr 32%; isolation: isolate; margin: 8px 0 40px; }
.bridge--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto clamp(120px, 15vw, 190px) auto; column-gap: 16px; margin-bottom: 36px; }
.bridge-card {
  position: relative; display: grid; place-items: center; min-width: 0; min-height: 110px;
  padding: 16px 14px; text-align: center; overflow-wrap: anywhere; container-type: inline-size;
  font-size: clamp(1.35rem, 4.4vw, 3.1rem); font-weight: 750; line-height: 1.05; letter-spacing: -.035em;
  color: var(--card-ink, inherit); background: var(--card, var(--surface)); border: 1px solid var(--rule); border-radius: 16px;
  box-shadow: 0 1px 1px rgb(0 0 0 / .08), 0 18px 34px -16px rgb(0 0 0 / .45);
}
.bridge--1 .bridge-card:last-of-type, .bridge--2 .bridge-card:last-of-type { grid-column: 3; }
.bridge--3 .bridge-card { font-size: clamp(1rem, 3.3vw, 2.4rem); min-height: 96px; }
.clue-text { font-size: min(1em, calc(100cqi / (var(--chars) * .56))); }
.bridge--3 .bridge-target { grid-area: 3 / 2; min-height: 76px; }
.bridge-target { border-color: var(--rule-strong); }
.bridge-target.unsolved { font: italic 400 clamp(18px, 2.6vw, 26px)/1.2 var(--serif); letter-spacing: 0; color: var(--muted); border-color: var(--rule-strong); background: transparent; border-style: dashed; box-shadow: none; }
.bridge-strength { position: absolute; bottom: -26px; inset-inline-start: 4px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.bridge-chain { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.bridge--1, .bridge--2 { padding-bottom: 36px; margin-bottom: 28px; }
body[data-game="linkspan"] .fields { max-width: 480px; margin: auto; text-align: start; }
body[data-game="linkspan"] #pass-round { margin-top: 6px; }
.link-result { max-width: 540px; margin: 0 auto 24px; font: 400 19px/1.5 var(--serif); color: var(--muted); text-wrap: balance; }
.link-result strong { color: var(--ink); font-weight: 400; }
.link-result h2 { margin: 12px 0 8px; font: 400 22px/1.3 var(--serif); color: var(--ink); }
.link-result h2 strong { font: 800 clamp(36px, 5vw, 46px)/1 var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-right: 4px; }
.strongest-link em { font-style: italic; }
.strongest-link strong { color: var(--highlight); }
.link-explanation { margin-top: 10px; font-size: 16px; }
.final { max-width: 620px; margin: 0 auto; }
.final-score { font: 400 22px/1.3 var(--serif); color: var(--muted); }
.final-score strong { display: block; margin-bottom: 6px; font: 800 clamp(64px, 11vw, 104px)/1 var(--sans); letter-spacing: -.045em; color: var(--ink); font-variant-numeric: tabular-nums; }
.final-score:focus { outline: none; }
.final-note { margin-top: 10px; font-size: 16px; color: var(--muted); }
.round-table { list-style: none; margin: 36px 0 0; padding: 0; text-align: start; border-top: 1px solid var(--rule); }
.round-table li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 16px 4px; border-bottom: 1px solid var(--rule); }
.round-table .clues { font-weight: 650; letter-spacing: -.01em; }
.round-table .points { font-weight: 750; font-variant-numeric: tabular-nums; text-align: end; }
.round-table .words { grid-column: 1 / -1; font: 400 17px/1.4 var(--serif); color: var(--muted); }
.round-table .words strong { color: var(--ink); font-weight: 400; }
.round-table .words em { color: var(--highlight); font-style: normal; }
.arriving { animation: arrive .5s var(--ease-out) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } }

/* Media games */
.tries { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.tries li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 12px;
  min-height: 48px; padding: 6px 14px;
  border: 1px solid var(--rule); border-radius: 12px; overflow-wrap: anywhere; line-height: 1.25;
}
.tries li.next { border-color: var(--rule-strong); }
.tries li.used { background: var(--surface); }
.tries li.win { border-color: var(--accent); }
.attempt-icon { display: grid; place-items: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.attempt-icon .icon { width: 18px; height: 18px; }
.tries .wrong .attempt-icon { color: var(--wrong); }
.tries .win .attempt-icon { color: var(--accent); }
.tries .skip .attempt-text { color: var(--muted); }
.latest-try { animation: arrive .35s var(--ease-out) both; }
.sound-panel { margin: 4px 0 28px; }
.track-time { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.track-time strong { font-size: 16px; font-weight: 700; color: var(--ink); }
.timeline { position: relative; display: grid; grid-template-columns: .55fr .75fr 1fr 1.45fr 2.3fr 3.95fr; gap: 3px; }
.timeline span { height: 12px; background: var(--rule); border-radius: 3px; }
.timeline span:first-child { border-radius: 6px 3px 3px 6px; }
.timeline span:last-child { border-radius: 3px 6px 6px 3px; }
.timeline .available { background: color-mix(in srgb, var(--accent) 45%, var(--rule)); }
.timeline .current { animation: timeline-open .4s var(--ease-out); transform-origin: left; }
@keyframes timeline-open { from { transform: scaleX(.2); opacity: .4; } }
.playhead { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: var(--accent); pointer-events: none; }
.timeline.playing .playhead { animation: play-through var(--play-ms, 1000ms) linear forwards; }
@keyframes play-through { to { width: var(--play-to, 100%); } }
.clip-button {
  display: grid; place-items: center; width: 76px; height: 76px; margin: 28px auto 0;
  color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 50%;
  box-shadow: 0 14px 28px -12px rgb(0 0 0 / .55);
  transition: transform .25s var(--ease-out), filter .2s;
}
.clip-button .icon { width: 30px; height: 30px; }
.clip-button:hover:not(:disabled) { transform: scale(1.05); filter: brightness(1.08); }
.clip-button:active:not(:disabled) { transform: scale(.95); }
.clip-button .icon-play { translate: 2px 0; }
.sound-error { padding: 12px 0 0; font-size: 15px; color: var(--muted); text-align: center; }
.picture-panel { margin: 0 0 24px; }
.picture-window { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #0d1118; border: 1px solid var(--rule); border-radius: 16px; }
.picture-window img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover;
  transform: scale(var(--zoom, 1)); clip-path: inset(var(--mask, 0%) round 8px);
  animation: uncover .7s var(--ease-out);
}
@keyframes uncover { from { clip-path: inset(var(--previous-mask, var(--mask)) round 8px); } }
.picture-window::after {
  content: ""; position: absolute; inset: 14px; pointer-events: none; opacity: .55;
  --c: var(--muted);
  background:
    linear-gradient(var(--c) 0 0) top left / 18px 2px, linear-gradient(var(--c) 0 0) top left / 2px 18px,
    linear-gradient(var(--c) 0 0) top right / 18px 2px, linear-gradient(var(--c) 0 0) top right / 2px 18px,
    linear-gradient(var(--c) 0 0) bottom left / 18px 2px, linear-gradient(var(--c) 0 0) bottom left / 2px 18px,
    linear-gradient(var(--c) 0 0) bottom right / 18px 2px, linear-gradient(var(--c) 0 0) bottom right / 2px 18px;
  background-repeat: no-repeat;
  transition: opacity .4s;
}
.picture-window.full::after { opacity: 0; }
.picture-window p { position: absolute; inset: 50% 0 auto; transform: translateY(-50%); padding: 12px; text-align: center; color: var(--muted); }
.picture-panel figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.quick-choices { display: grid; margin: 8px 0 0; padding: 4px; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 12px; }
.quick-choices button { padding: 10px 12px; text-align: start; font-size: 15px; background: none; border: 0; border-radius: 8px; }
.quick-choices button:hover, .quick-choices button:focus-visible { background: var(--soft); outline-offset: -2px; }
.reveal { margin: 0 0 16px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; }
.reveal h2 { margin-bottom: 8px; font-size: clamp(26px, 4vw, 32px); font-weight: 800; letter-spacing: -.03em; }
.reveal h2:focus { outline: none; }
.reveal p { color: var(--muted); }
.reveal p + p { margin-top: 8px; }
.reveal a { color: var(--ink); }
.reveal a:hover { color: var(--highlight); }
.out-link { display: inline-flex; align-items: center; gap: 2px; }
.out-link .icon { width: 16px; height: 16px; }
.come-back { text-align: center; color: var(--muted); }

/* Help dialog */
dialog { width: min(100% - 32px, 460px); padding: 28px; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .5); }
dialog[open] { animation: arrive .35s var(--ease-out); }
dialog::backdrop { background: rgb(14 18 16 / .5); }
dialog h2 { margin-bottom: 14px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
dialog p { color: var(--muted); }
dialog p + p { margin-top: 12px; }
.close-help { float: right; display: grid; place-items: center; width: 36px; height: 36px; margin: -6px -8px 0 0; color: var(--muted); background: none; border: 0; border-radius: 10px; }
.close-help:hover { color: var(--ink); background: var(--soft); }

/* Demon Chess: a classic green board; white pieces sit on light coins, black pieces on dark coins. */
body[data-game="chess"] .game { width: min(100% - 48px, 600px); }
#chess { margin-top: clamp(20px, 3vw, 32px); }
.chess-setup { display: grid; gap: 22px; justify-items: center; text-align: center; }
.chess-setup h2 { font: 400 28px/1.1 "Lilita One", var(--sans); letter-spacing: .01em; }
.bot-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; }
.bot-card { position: relative; display: grid; justify-items: center; gap: 2px; padding: 14px 6px 12px; border: 2px solid var(--rule); border-radius: 16px; background: var(--surface); cursor: pointer; transition: border-color .15s, transform .15s var(--ease-out); }
.bot-card:hover { border-color: var(--rule-strong); }
.bot-card:active { transform: scale(.97); }
.bot-card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.bot-card:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 3px; }
.bot-card input { position: absolute; opacity: 0; pointer-events: none; }
.bot-card img { width: 56px; height: 56px; margin-bottom: 6px; object-fit: contain; }
.bot-name { font: 400 21px/1.1 "Lilita One", var(--sans); letter-spacing: .01em; }
.bot-elo { font-weight: 750; color: var(--highlight); font-variant-numeric: tabular-nums; }
.bot-record { font-size: 13px; color: var(--muted); }
.side-pick { margin: 0; padding: 0; border: 0; }
.side-pick legend { margin: 0 auto 8px; font-size: 14px; color: var(--muted); }
.side-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.side-options label { position: relative; cursor: pointer; }
.side-options input { position: absolute; opacity: 0; pointer-events: none; }
.side-options span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--rule-strong); border-radius: 999px; font-weight: 650; }
.side-options input:checked + span { background: #fff; border-color: #fff; color: #10131a; }
.side-options input:focus-visible + span { outline: 2px solid var(--highlight); outline-offset: 2px; }
#chess-start { min-width: 200px; }
.piece-key { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; width: 100%; margin: 0; padding: 16px; list-style: none; border-radius: 16px; background: rgb(0 0 0 / .18); text-align: left; }
.piece-key li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.piece-key .piece { position: relative; inset: auto; flex: none; width: 46px; height: 46px; }
.piece-key strong { display: block; font-size: 15px; color: var(--ink); }
.chess-note { max-width: 48ch; font-size: 14px; color: var(--muted); }
.chess-play { display: grid; gap: 10px; }
.chess-player { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.chess-player .avatar { flex: none; width: 40px; height: 40px; object-fit: contain; }
.chess-player .avatar.you { position: relative; display: block; }
.chess-player .avatar.you .piece { inset: 0; }
.who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.who strong { font: 400 20px/1.1 "Lilita One", var(--sans); letter-spacing: .01em; }
.who .elo { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.thinking { font-size: 13px; font-weight: 650; color: var(--highlight); }
.thinking::after { content: "…"; }
.captured { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; min-width: 0; margin-left: auto; padding-left: 6px; }
.captured img { width: 20px; height: 20px; margin-left: -4px; object-fit: contain; }
.captured span { margin-left: 8px; font-size: 14px; font-weight: 750; color: var(--muted); }
.board-wrap { position: relative; }
.chess-board { display: grid; grid-template: repeat(8, 1fr) / repeat(8, 1fr); aspect-ratio: 1; overflow: hidden; border-radius: 6px; box-shadow: 0 0 0 4px #10131a, 0 10px 0 4px rgb(0 0 0 / .3); container-type: inline-size; touch-action: none; user-select: none; -webkit-user-select: none; }
.sq { position: relative; min-width: 0; padding: 0; border: 0; border-radius: 0; background: #ebecd0; -webkit-tap-highlight-color: transparent; }
.sq.dark { background: #739552; }
.sq.last::before, .sq.selected::before { content: ""; position: absolute; inset: 0; background: rgb(255 255 51 / .42); }
.sq.check { background-image: radial-gradient(circle, #ff2b2b 58%, rgb(255 43 43 / 0) 100%); }
.sq:focus-visible { z-index: 3; outline: 3px solid #fff; outline-offset: -3px; }
.coord { position: absolute; z-index: 2; font-size: max(9px, 2.3cqi); font-weight: 750; line-height: 1; pointer-events: none; }
.coord.rank { top: .5cqi; left: .6cqi; }
.coord.file { right: .6cqi; bottom: .4cqi; }
.sq.light .coord { color: #739552; }
.sq.dark .coord { color: #ebecd0; }
.sq .dot, .sq .ring { position: absolute; z-index: 2; border-radius: 50%; pointer-events: none; }
.sq .dot { inset: 36%; background: rgb(0 0 0 / .18); }
.sq .ring { inset: 3%; border: .9cqi solid rgb(0 0 0 / .18); }
.piece { position: absolute; inset: 6%; z-index: 1; display: grid; place-items: center; border-radius: 50%; container-type: size; pointer-events: none; }
.piece.w { background: radial-gradient(circle at 50% 30%, #fff, #e6dfcd); box-shadow: inset 0 0 0 2px #10131a, 0 2px 0 rgb(0 0 0 / .35); }
.piece.b { background: radial-gradient(circle at 50% 30%, #3b3e48, #111217); box-shadow: inset 0 0 0 2px #f4f1e8, 0 2px 0 rgb(0 0 0 / .35); }
.piece img { width: 78%; height: 78%; object-fit: contain; }
.piece b { position: absolute; top: -6%; right: -6%; display: grid; place-items: center; width: 40%; height: 40%; border-radius: 50%; font: 800 26cqh/1 var(--sans); }
.piece.w b { background: #fff; color: #10131a; box-shadow: 0 0 0 1.5px #10131a; }
.piece.b b { background: #10131a; color: #fff; box-shadow: 0 0 0 1.5px #f4f1e8; }
.piece.dragging { z-index: 6; scale: 1.12; filter: drop-shadow(0 6px 6px rgb(0 0 0 / .35)); transition: none !important; }
.promotion { position: absolute; inset: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 19%); justify-content: center; align-content: center; gap: 2%; border-radius: 6px; background: rgb(0 0 0 / .6); }
.promotion button { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 14px; background: #ebecd0; }
.promotion button:hover, .promotion button:focus-visible { background: #fff; outline: none; }
.chess-status { min-height: 24px; font-weight: 650; text-align: center; }
.chess-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (max-width: 570px) {
  .bot-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .piece-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .home { padding: 0 12px; }
  .home-ground { margin-inline: -12px; }
  .top-links { top: 10px; right: 12px; gap: 8px; }
  .community-button.mini { width: 44px; padding: 0; justify-content: center; }
  .community-button.mini span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .home-header { padding-top: 66px; }
  .community-button { min-height: 48px; padding: 0 16px 0 12px; font-size: 18px; border-width: 3px; }
  .level-panel { padding: 0 8px 8px; border-radius: 20px; }
  .level-row { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 12px 14px 8px; }
  .badge-art { width: 50px; height: 50px; }
  .badge-label { font-size: 12px; }
  .level-title { font-size: 24px; gap: 0 8px; }
  .level-by { font-size: 15px; }
  .level-tag { font-size: 14px; }
  .level-stats { gap: 2px 12px; font-size: 13px; }
  .level-stats .icon { width: 17px; height: 17px; }
  .play-button { min-width: 74px; min-height: 48px; padding: 0 12px; font-size: 20px; border-width: 3px; border-radius: 13px; }
  @supports (animation-timeline: view()) { @keyframes row-in { from { opacity: 0; translate: 40px 0; } } }
}
@media (max-width: 570px) {
  .game, body[data-game="linkspan"] .game { width: calc(100% - 32px); }
  .game-nav { padding: 10px 16px; grid-template-columns: auto 1fr; }
  .game-nav a, .game-nav button { white-space: nowrap; }
  .game-nav .nav-brand { display: none; }
  .nav-social .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .game-title p { font-size: 15px; }
  .game-bar { font-size: 13px; }
  .bridge { grid-template-columns: 34% 1fr 34%; }
  .bridge-card { min-height: 76px; padding: 12px 8px; border-radius: 12px; }
  .bridge--3 { grid-template-rows: auto 104px auto; column-gap: 8px; }
  .bridge--3 .bridge-card { min-height: 64px; }
  .button { padding-inline: 14px; }
  #media-form .fields { grid-template-columns: minmax(0, 1fr) auto; }
  #media-form .search-field { grid-column: 1 / -1; }
  #media-form .button { width: 100%; }
  .tries li { min-height: 42px; }
  .reveal { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .timeline.playing .playhead { width: var(--play-to); }
}
