/*
  The websites' design system (web spec W1). One stylesheet for both sites; a theme class on <html> sets the colors
  and the display font:
    .studio  aygames.gg, direction A "Crest": navy and gold, headings in Cinzel.
    .game    grindhold.aygames.gg: the game's palette, headings in Pixelify Sans.
  Mobile first. Fonts are served from /fonts (SIL Open Font License, see the OFL files there).
*/

@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("/fonts/cinzel.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("/fonts/pixelify-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

/* ---- Tokens --------------------------------------------------------------------------------------------------- */

:root {
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --radius-s: 8px; --radius-m: 12px; --radius-l: 18px; --radius-xl: 24px;
  --container: 1200px;
  --nav-height: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

.studio {
  --bg: #0b0e24;
  --bg-2: #0f1331;
  --surface: #141a40;
  --surface-2: #1b2250;
  --line: rgba(242, 184, 75, .16);
  --line-soft: rgba(244, 238, 226, .08);
  --text: #f4eee2;
  --muted: #bdb6a8;
  --accent: #f2b84b;
  --accent-hi: #ffe39e;
  --accent-deep: #c5862a;
  --accent-ink: #1c1406;
  --second: #ef6b43;
  --glow: rgba(45, 52, 120, .9);
  --font-display: "Cinzel", Georgia, serif;
  --display-weight: 700;
  --display-tracking: .01em;
  --display-features: normal;
  --display-case: none;
}

.game {
  --bg: #100e15;
  --bg-2: #14121a;
  --surface: #1c1924;
  --surface-2: #252130;
  --line: rgba(224, 178, 58, .18);
  --line-soft: rgba(242, 230, 208, .08);
  --text: #f2e6d0;
  --muted: #bdb7c6;
  --accent: #e0b23a;
  --accent-hi: #f7e07a;
  --accent-deep: #b07f1c;
  --accent-ink: #2b1a05;
  --second: #8db9e3;
  --ember: #d86b45;
  --leaf: #6fa84a;
  --glow: rgba(224, 178, 58, .14);
  --font-display: "Pixelify Sans", var(--font-text);
  --display-weight: 700;
  --display-tracking: .01em;
  /* Pixelify Sans draws its fi and fl ligatures like an A. font-feature-settings, unlike font-variant-ligatures,
     survives the font shorthand. */
  --display-features: "liga" 0, "clig" 0;
  --display-case: none;
}

/* ---- Base ----------------------------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 16px); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.65 var(--font-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hi); }
p { margin: 0 0 var(--space-4); }
ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25em; }
h1, h2, h3, h4 { margin: 0 0 var(--space-4); line-height: 1.15; }
h1, h2, h3, .display {
  font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
  font-feature-settings: var(--display-features); text-transform: var(--display-case);
}
h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1rem; font-weight: 700; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: var(--space-6) 0; }
code, kbd { font-family: var(--font-mono); font-size: .92em; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--space-4); top: -60px; z-index: 100; padding: var(--space-2) var(--space-4); border-radius: var(--radius-s); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.skip-link:focus { top: var(--space-3); }

/* ---- Layout --------------------------------------------------------------------------------------------------- */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: var(--space-8); position: relative; }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-block: 1px solid var(--line-soft); }
.section-head { max-width: 720px; margin-bottom: var(--space-7); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4);
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.grid-2, .grid-3 { display: grid; gap: var(--space-5); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .container { padding-inline: 32px; } .section { padding-block: var(--space-9); } }

/* ---- Buttons -------------------------------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 46px; padding: 11px 20px; border: 0; border-radius: var(--radius-m);
  font: 600 15px/1.2 var(--font-text); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), color .2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent) 55%, var(--accent-deep));
  color: var(--accent-ink); box-shadow: 0 8px 24px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { color: var(--accent-ink); box-shadow: 0 12px 30px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-soft), inset 0 0 0 1.5px rgba(255, 255, 255, .14); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.btn-small { min-height: 38px; padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.game .btn { border-radius: 8px; }
.game .btn-primary { box-shadow: 0 4px 0 #7a5210, 0 14px 30px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .4); }
.game .btn-primary:hover { box-shadow: 0 5px 0 #7a5210, 0 18px 36px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .5); }
.game .btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a5210, inset 0 1px 0 rgba(255, 255, 255, .4); }
.ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---- Navigation ----------------------------------------------------------------------------------------------- */

.site-nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-height);
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line-soft);
}
.site-nav .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--text); text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { width: 38px; height: 38px; }
.brand-word { font: 700 18px/1 var(--font-display); letter-spacing: .16em; }
.brand-wordmark { height: 30px; width: auto; }
.brand-icon { width: 36px; height: 36px; border-radius: 9px; }
.nav-links { display: none; align-items: center; gap: var(--space-6); list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text); opacity: .82; text-decoration: none; font-weight: 500; font-size: 15px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--text); }
.nav-actions { display: none; align-items: center; gap: var(--space-3); }
/* The phone menu: a <details> needs no script. */
.nav-menu { position: relative; }
.nav-menu summary {
  list-style: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
  color: var(--text); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .14);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary svg { width: 20px; height: 20px; }
.nav-menu[open] summary { background: rgba(255, 255, 255, .06); }
.nav-menu .menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(84vw, 300px); padding: var(--space-3);
  border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.menu-panel a:not(.btn) { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.menu-panel a:not(.btn):hover { background: rgba(255, 255, 255, .06); }
.menu-panel .btn { width: 100%; margin-top: var(--space-2); }
@media (min-width: 900px) {
  .nav-links, .nav-actions { display: flex; }
  .nav-menu { display: none; }
}

/* ---- Hero ----------------------------------------------------------------------------------------------------- */

.hero { position: relative; overflow: hidden; padding-block: var(--space-8) var(--space-8); isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 55% at 78% 18%, var(--glow), transparent 70%);
}
.hero-grid { display: grid; gap: var(--space-7); align-items: center; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); color: var(--muted); max-width: 560px; margin-bottom: var(--space-6); }
.hero-note { margin-top: var(--space-4); font-size: .9rem; color: var(--muted); }
@media (min-width: 960px) {
  .hero { padding-block: var(--space-9) var(--space-9); }
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
}

/* A framed picture, such as the living village. */
.frame {
  position: relative; border-radius: var(--radius-l); overflow: hidden; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 120px -30px var(--accent);
}
.frame img { width: 100%; }
.game .frame { box-shadow: 0 0 0 2px rgba(224, 178, 58, .55), 0 30px 80px -20px rgba(0, 0, 0, .85), 0 0 120px -30px var(--accent); }

/* ---- Cards ---------------------------------------------------------------------------------------------------- */

.card {
  position: relative; padding: var(--space-5); border-radius: var(--radius-l);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, white 2%), var(--surface));
  border: 1px solid var(--line-soft);
}
.card h3 { margin-bottom: var(--space-2); }
.card p:last-child { margin-bottom: 0; }
.card-icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: var(--space-4); border-radius: 14px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid var(--line);
}
.card-icon svg { width: 24px; height: 24px; }
.card .muted { font-size: .98rem; }

/* A game, as the studio shows it: a picture on top, then its story and links. */
.game-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.game-card:hover { transform: translateY(-3px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); }
.game-card .cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.game-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.game-card .body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); flex: 1; }
.game-card h3 { margin: 0; font-size: 1.6rem; }
.game-card .body p { color: var(--muted); margin: 0; }
.game-card .ctas { margin-top: auto; padding-top: var(--space-3); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.tag { padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line-soft); }

/* The hero's games, beside the headline. */
.hero-games { display: grid; gap: var(--space-4); }
.pic picture, .cover picture, .frame picture { display: contents; }
.stats.studio-stats { margin-top: var(--space-7); }

/* A small game in a list, picture beside text. */
.mini-game { display: grid; grid-template-columns: 120px 1fr; gap: var(--space-4); align-items: center; padding: var(--space-3); border-radius: var(--radius-l); background: rgba(255, 255, 255, .03); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: background-color .2s, transform .2s var(--ease); }
.mini-game:hover { background: rgba(255, 255, 255, .06); color: var(--text); transform: translateY(-2px); }
.mini-game .pic { aspect-ratio: 3 / 2; border-radius: var(--radius-m); overflow: hidden; background: var(--bg-2); }
.mini-game .pic img { width: 100%; height: 100%; object-fit: cover; }
.mini-game h3 { font-family: var(--font-text); font-size: 1.05rem; letter-spacing: 0; margin: 0 0 2px; }
.mini-game p { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.45; }
.mini-game .go { display: inline-block; margin-top: 6px; font-size: .85rem; font-weight: 600; color: var(--accent); }
@media (min-width: 520px) { .mini-game { grid-template-columns: 160px 1fr; } }

/* Vanguard Realm's cover: drawn here in its colors, with no pictures from its site. */
/* As specific as .game-card .cover and .mini-game .pic, and after them, so its board wins over their plain background. */
.cover-vanguard, .game-card .cover-vanguard, .mini-game .cover-vanguard {
  display: grid; place-items: center; align-content: center; gap: 6px; padding: var(--space-4); text-align: center;
  color: #fec46b;
  /* A board of our own drawing: two lanes, the river between the halves and a bridge on each lane, under a glow. */
  background:
    linear-gradient(rgba(214, 189, 140, .32), rgba(214, 189, 140, .32)) 28.5% 50% / 7% 13% no-repeat,
    linear-gradient(rgba(214, 189, 140, .32), rgba(214, 189, 140, .32)) 71.5% 50% / 7% 13% no-repeat,
    radial-gradient(55% 45% at 50% 50%, rgba(254, 196, 107, .2), transparent 72%),
    linear-gradient(180deg, transparent 44%, rgba(79, 126, 187, .3) 44% 56%, transparent 56%),
    linear-gradient(90deg, transparent 26%, rgba(201, 205, 230, .11) 26% 33%, transparent 33% 67%, rgba(201, 205, 230, .11) 67% 74%, transparent 74%),
    radial-gradient(120% 90% at 30% 10%, #2a3163 0%, #14182e 62%), #14182e;
}
.cover-vanguard strong { font: 800 clamp(1.3rem, 1rem + 2.2vw, 2.6rem)/.95 "Arial Narrow", "Roboto Condensed", Arial, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.cover-vanguard span { font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #c9cde6; }
.mini-game .cover-vanguard strong { font-size: 1.1rem; }
.mini-game .cover-vanguard span { font-size: .55rem; }

/* ---- Feature rows, steps, numbers ----------------------------------------------------------------------------- */

.feature { display: grid; gap: var(--space-6); align-items: center; }
.feature + .feature { margin-top: var(--space-8); }
.feature .text { max-width: 520px; }
.feature .text p { color: var(--muted); font-size: 1.05rem; }
.feature ul.checks { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; gap: var(--space-2); }
/* The check sits beside the line, so words and code inside it flow as text. */
.checks li { position: relative; padding-left: 30px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 5px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
@media (min-width: 900px) {
  .feature { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .feature.flip .media { order: 2; }
}

.steps { display: grid; gap: var(--space-4); counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; display: flex; }
.steps .card { flex: 1; }
.steps .card::before {
  content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: var(--space-4);
  border-radius: 10px; font: 700 16px/1 var(--font-text); color: var(--accent-ink); background: var(--accent);
}
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); list-style: none; padding: 0; margin: 0; }
.stats li { padding: var(--space-5); border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line-soft); text-align: center; }
.stats strong { display: block; font: 700 clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem)/1.1 var(--font-display); color: var(--accent); font-feature-settings: var(--display-features); }
.stats span { color: var(--muted); font-size: .92rem; }
/* Pixelify Sans's 5 reads like an S, so Grindhold's numbers are in the text font. */
.game .stats strong { font-family: var(--font-text); font-weight: 800; letter-spacing: -.01em; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* ---- FAQ, call to action, contact ----------------------------------------------------------------------------- */

.faq { display: grid; gap: var(--space-3); max-width: 820px; margin-inline: auto; }
.faq details { border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line-soft); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); font-weight: 600; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--accent); background: rgba(255, 255, 255, .05); font: 600 20px/1 var(--font-text); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 var(--space-5) var(--space-5); color: var(--muted); }
.faq .answer p:last-child { margin-bottom: 0; }

.cta-band {
  position: relative; overflow: hidden; padding: var(--space-7) var(--space-5); border-radius: var(--radius-xl); text-align: center;
  background: radial-gradient(70% 120% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--surface);
  border: 1px solid var(--line);
}
.cta-band h2 { margin-bottom: var(--space-3); }
.cta-band p { color: var(--muted); max-width: 560px; margin: 0 auto var(--space-5); }
.cta-band .ctas { justify-content: center; }

/* ---- Footer --------------------------------------------------------------------------------------------------- */

.site-footer { padding-block: var(--space-8) var(--space-6); background: var(--bg-2); border-top: 1px solid var(--line-soft); font-size: .95rem; }
.footer-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(2, 1fr); }
.footer-about { grid-column: 1 / -1; max-width: 360px; }
.footer-about p { color: var(--muted); margin-top: var(--space-3); }
.site-footer h2 { font: 700 .78rem/1 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--space-4); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.site-footer a { color: var(--text); opacity: .85; text-decoration: none; }
.site-footer a:hover { opacity: 1; color: var(--accent); }
.footer-base { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); justify-content: space-between; margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .88rem; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr repeat(3, 1fr); } .footer-about { grid-column: auto; } }

/* ---- Pages of text: the legal pages and notices --------------------------------------------------------------- */

.prose { max-width: 760px; }
.prose h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
.prose h2 { font-size: 1.5rem; margin-top: var(--space-7); }
.prose h3 { font-size: 1.15rem; margin-top: var(--space-5); font-family: var(--font-text); letter-spacing: 0; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.prose li + li { margin-top: var(--space-2); }
.prose .updated { color: var(--muted); font-size: .95rem; }
.prose table { width: 100%; border-collapse: collapse; margin: var(--space-4) 0 var(--space-5); font-size: .95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: var(--space-3); border-bottom: 1px solid var(--line-soft); }
.prose th { color: var(--muted); font-weight: 600; }
.note { padding: var(--space-4) var(--space-5); border-radius: var(--radius-m); background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1px solid var(--line); }
.note p:last-child { margin-bottom: 0; }

/* ---- Commands ------------------------------------------------------------------------------------------------- */

.cmd-group + .cmd-group { margin-top: var(--space-7); }
.cmd-list { display: grid; gap: var(--space-3); list-style: none; padding: 0; margin: 0; }
@media (min-width: 760px) { .cmd-list { grid-template-columns: repeat(2, 1fr); } }
.cmd { padding: var(--space-4) var(--space-5); border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line-soft); }
.cmd code { font-size: 1rem; font-weight: 700; color: var(--accent); }
.cmd p { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.cmd .opts { list-style: none; padding: 0; display: grid; gap: 4px; margin: var(--space-2) 0 0; font-size: .88rem; color: var(--muted); }
.cmd .opts code { font-size: .85rem; font-weight: 600; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-7); }
.chips .tag { text-decoration: none; padding: 6px 14px; font-size: .88rem; }
.chips .tag:hover { color: var(--accent-hi); border-color: var(--line); }
.cmd-group h2 { font-size: 1.6rem; margin-bottom: var(--space-2); }
.cmd-cta { margin-top: var(--space-8); }

/* ---- Dashboard ------------------------------------------------------------------------------------------------ */

.dash { display: grid; gap: var(--space-5); padding-block: var(--space-6) var(--space-8); }
.dash-nav { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); }
.dash-nav a { display: flex; align-items: center; gap: var(--space-3); padding: 10px 14px; border-radius: var(--radius-m); color: var(--text); opacity: .8; text-decoration: none; font-weight: 500; white-space: nowrap; }
.dash-nav a:hover { opacity: 1; background: rgba(255, 255, 255, .05); color: var(--text); }
.dash-nav a[aria-current="page"] { opacity: 1; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-hi); box-shadow: inset 0 0 0 1px var(--line); }
.dash-nav svg { width: 18px; height: 18px; }
.dash-user { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }
@media (min-width: 900px) {
  .dash { grid-template-columns: 240px 1fr; align-items: start; }
  .dash-side { position: sticky; top: calc(var(--nav-height) + var(--space-5)); }
  .dash-nav { flex-direction: column; overflow: visible; }
}
.panel { padding: var(--space-5); border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line-soft); }
.panel + .panel { margin-top: var(--space-5); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.panel-head h2 { font-size: 1.3rem; margin: 0; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); margin: 0; }
.kv div { padding: var(--space-3) var(--space-4); border-radius: var(--radius-m); background: var(--bg-2); border: 1px solid var(--line-soft); }
.kv dt { font-size: .8rem; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-size: 1.2rem; font-weight: 700; }
.meter { height: 10px; border-radius: 999px; background: var(--bg-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-soft); }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-deep), var(--accent-hi)); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 10px var(--space-3); text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table th { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-win { color: #0f2410; background: #8fd07a; }
.badge-loss { color: #2a0d08; background: #f09a7c; }
.badge-soft { color: var(--text); background: rgba(255, 255, 255, .08); }
.empty { text-align: center; padding: var(--space-8) var(--space-5); }
.empty p { color: var(--muted); max-width: 460px; margin-inline: auto; }

/* ---- Errors --------------------------------------------------------------------------------------------------- */

.error-page { display: grid; place-items: center; text-align: center; min-height: 60vh; padding-block: var(--space-8); }
.error-page .code { font: 700 clamp(4rem, 3rem + 6vw, 7rem)/1 var(--font-display); color: var(--accent); font-feature-settings: var(--display-features); }
.error-page p { color: var(--muted); max-width: 440px; margin-inline: auto; }

/* ---- Grindhold's front page --------------------------------------------------------------------------------- */

/* Grind. Build. Raid., a line and a color each. */
.grind-build-raid span { display: block; }
.grind-build-raid span:nth-child(1) { color: var(--accent-hi); }
.grind-build-raid span:nth-child(2) { color: var(--second); }
.grind-build-raid span:nth-child(3) { color: var(--ember); }
@media (min-width: 960px) { .game-hero .hero-grid { grid-template-columns: .85fr 1.15fr; } }

/* A message in a Discord channel, in Discord's dark theme, as the bot sends it: a container with its accent bar. */
.chat { padding: var(--space-5); border-radius: var(--radius-l); background: #313338; border: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .85); }
.msg { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.msg-avatar { width: 40px; height: 40px; border-radius: 50%; }
.msg-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; line-height: 1.2; }
.msg-head strong { color: #f2f3f5; font-weight: 600; }
.app-tag { padding: 1px 5px; border-radius: 4px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; }
.msg-time { color: #949ba4; font-size: 12px; }
.msg-card { padding: 12px 16px; border-radius: 8px; background: #2b2d31; border-left: 4px solid var(--accent); }
.msg-title { margin: 0 0 4px; color: #f2f3f5; font-weight: 700; }
.msg-text { margin: 0 0 12px; color: #dbdee1; font-size: .95rem; }
.msg-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.dbtn { padding: 6px 16px; border-radius: 4px; background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; }
.dbtn-danger { background: #da373c; }

/* A close look at the village: the picture scaled up around its middle, its pixels kept sharp. */
.frame.zoom { aspect-ratio: 4 / 3; }
.frame.zoom img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.9); transform-origin: 50% 56%; image-rendering: pixelated; }

/* The raid's replay is cropped to its battle; a fixed shape keeps the page from jumping when it loads. */
.frame.raid { aspect-ratio: 16 / 10; }
.frame.raid img { width: 100%; height: 100%; object-fit: cover; }

.skins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.skins-grid figure { margin: 0; }
.skins-grid figcaption { position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(16, 14, 21, .82); font-size: .85rem; font-weight: 600; }

/* ---- Motion --------------------------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
