/* SPDX-License-Identifier: LicenseRef-Proprietary */
/* Copyright (c) 2026 Griffith Software — https://griffith.software */
/* Parody Arcade: neon arcade shell. No external fonts or images. */
:root {
  --bg: #0b0a12;
  --bg2: #110f1a;
  --panel: #15131f;
  --panel2: #1c1929;
  --line: #2b2740;
  --text: #f3f1fa;
  --muted: #a9a3c0;
  --red: #ff2e4d;
  --red2: #ff4f6e;
  --pink: #ff4f8b;
  --cyan: #3fd0ff;
  --yellow: #ffd23f;
  --orange: #ff8a3d;
  --green: #7cff6b;
  --radius: 12px;
  --title-font: Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Heavy", system-ui, sans-serif;
  --ui-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--ui-font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; }
a { color: var(--cyan); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: 270px 1fr;
  height: 100%;
  padding-left: var(--safe-l);
}
.sidebar {
  background: linear-gradient(180deg, #121020, #0c0a14);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px calc(18px + var(--safe-b));
  overflow-y: auto;
}
.view {
  overflow-y: auto;
  padding: calc(28px + var(--safe-t)) calc(28px + var(--safe-r)) 40px 28px;
  outline: none;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(255, 46, 77, .16), transparent 60%),
    radial-gradient(700px 360px at 10% 110%, rgba(63, 208, 255, .08), transparent 60%),
    var(--bg);
}

/* ---------- Logo: our own lettering ---------- */
.logo {
  display: block;
  text-decoration: none;
  margin: 0 0 28px 6px;
  transform: rotate(-8deg);
  line-height: .86;
  user-select: none;
}
.logo-top {
  display: block;
  font: italic 900 46px/0.9 var(--title-font);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #ffd23f 0%, #ff8a3d 45%, #ff2e4d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 46, 77, .55)) drop-shadow(2px 3px 0 #2a0610);
  width: 7ch;
}
.logo-bottom {
  display: inline-block;
  margin: 6px 0 0 34px;
  padding: 2px 12px 4px;
  font: italic 900 30px/1 var(--title-font);
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #dff6ff;
  border: 3px solid var(--cyan);
  border-radius: 8px;
  text-shadow: 0 0 8px var(--cyan);
  box-shadow: 0 0 14px rgba(63, 208, 255, .55), inset 0 0 10px rgba(63, 208, 255, .35);
  background: #0a1a2a;
}

/* ---------- Nav ---------- */
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border-radius: 10px;
  color: #d6d2e6;
  text-decoration: none;
  font-size: 17px;
  border: 2px solid transparent;
  border-bottom-color: rgba(255, 255, 255, .04);
}
.nav a:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.nav a.active {
  background: linear-gradient(90deg, rgba(255, 46, 77, .28), rgba(255, 46, 77, .08));
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 46, 77, .35);
}
.nav svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.promo {
  position: relative;
  margin-top: auto;
  padding: 18px 70px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .02);
  color: #d6d2e6;
  overflow: hidden;
}
.promo::before { content: ""; position: absolute; left: 0; top: 0; width: 56px; height: 3px; background: var(--red); }
.promo p { margin: 0 0 12px; font-size: 15px; }
.promo-line { display: block; width: 46px; height: 3px; background: var(--red); border-radius: 2px; }
.promo-art { position: absolute; right: 8px; bottom: 8px; width: 56px; height: 56px; image-rendering: pixelated; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  min-height: 330px;
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  overflow: hidden;
  background: #070a1c;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 46, 77, .15);
}
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(7, 10, 28, .96) 0%, rgba(7, 10, 28, .82) 38%, rgba(7, 10, 28, 0) 62%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; padding: 30px 32px 64px; }
.badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(255, 46, 77, .6);
}
.hero h2 { margin: 18px 0 10px; }
.hero .title-art { font-size: min(56px, 4.4vw); }
.hero-kicker { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.hero-blurb { color: #d6d2e6; margin: 0 0 22px; max-width: 34ch; }
.hero-pager { position: absolute; z-index: 1; right: 18px; bottom: 14px; display: flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(7, 10, 28, .72); border: 1px solid rgba(255, 255, 255, .12); }
.hero-pager button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; font: 700 22px/1 var(--font, system-ui); cursor: pointer; display: grid; place-items: center; padding: 0 0 3px; }
.hero-pager button:hover, .hero-pager button:focus-visible { background: rgba(255, 46, 77, .45); outline: none; box-shadow: 0 0 8px var(--red); }
.hero-count { min-width: 52px; text-align: center; font: 700 13px/1 var(--font, system-ui); color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums; }

/* Game title lettering: chunky, slanted, outlined. Our own style for every game. */
.title-art {
  font: italic 900 56px/0.92 var(--title-font);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  transform: rotate(-4deg);
  transform-origin: left;
  background: linear-gradient(180deg, #fff 0%, #ffe79a 40%, #ffb02e 62%, #ff6a2e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(60, 10, 0, .4);
  filter: drop-shadow(3px 4px 0 #2a0610) drop-shadow(0 0 14px rgba(255, 138, 61, .35));
  /* Gradient text only paints inside its box, and the italic leans up to ~0.25em past
     the last letter (measured over every title), so leave room for the slant. */
  padding: 0 .28em 0 .06em;
}
.title-art.alt { background-image: linear-gradient(180deg, #fff 0%, #9fe8ff 45%, #3fa0ff 100%); filter: drop-shadow(3px 4px 0 #061a2a) drop-shadow(0 0 14px rgba(63, 208, 255, .35)); }
.title-art.pink { background-image: linear-gradient(180deg, #fff 0%, #ffb0d8 40%, #ff4f8b 100%); filter: drop-shadow(3px 4px 0 #2a0618) drop-shadow(0 0 14px rgba(255, 79, 139, .35)); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px;
  padding: 10px 26px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  background: var(--panel2);
  color: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
}
.btn:hover { filter: brightness(1.15); }
.btn.primary {
  background: linear-gradient(180deg, var(--red2), var(--red));
  border-color: transparent;
  box-shadow: 0 6px 22px rgba(255, 46, 77, .45);
  min-width: 200px;
  font-size: 18px;
}
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.btn .play-ico { width: 0; height: 0; border-left: 16px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Section head, filters, search ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin: 30px 0 14px; }
.section-head h2 { font: 800 28px/1.1 var(--ui-font); margin: 0 auto 0 0; letter-spacing: -.3px; }
.view > h2.page-title { font: 800 32px/1.1 var(--ui-font); margin: 4px 0 18px; letter-spacing: -.3px; }
.filters { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.filters button {
  border: 0; background: none; padding: 8px 18px; cursor: pointer; color: #d6d2e6; font-size: 15px;
  border-right: 1px solid var(--line);
}
.filters button:last-child { border-right: 0; }
.filters button[aria-pressed="true"] { background: var(--red); color: #fff; box-shadow: 0 0 14px rgba(255, 46, 77, .5); }
.search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  padding: 0 12px; min-width: 240px;
}
.search svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.search input { border: 0; background: none; color: var(--text); font: inherit; padding: 9px 0; width: 100%; outline: none; }
.search input::placeholder { color: var(--muted); }

/* ---------- Game cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  position: relative;
  display: flex; flex-direction: column;
  border: 2px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-align: left;
  padding: 0;
  color: inherit;
}
.card:hover, .card:focus-within { border-color: var(--cyan); box-shadow: 0 0 18px rgba(63, 208, 255, .55), inset 0 0 0 1px rgba(63, 208, 255, .5); }
.card .thumb { position: relative; aspect-ratio: 16 / 10; }
.card canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card .card-title {
  position: absolute; left: 10px; right: 10px; bottom: 6px;
  font: italic 900 30px/0.9 var(--title-font);
  text-transform: uppercase;
  transform: rotate(-4deg);
  transform-origin: left bottom;
  background: linear-gradient(180deg, #fff 0%, #ffe79a 40%, #ffb02e 62%, #ff6a2e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(2px 3px 0 #1a0408) drop-shadow(0 0 6px rgba(0, 0, 0, .8));
  pointer-events: none;
  padding: 0 .28em 0 .06em; /* room for the italic slant, as in .title-art */
}
.card .card-title.alt { background-image: linear-gradient(180deg, #fff 0%, #9fe8ff 45%, #3fa0ff 100%); }
.card .card-title.pink { background-image: linear-gradient(180deg, #fff 0%, #ffb0d8 40%, #ff4f8b 100%); }
.card .card-body { display: flex; align-items: center; gap: 6px; padding: 9px 10px 10px 14px; border-top: 1px solid var(--line); }
.card .tagline { flex: 1; font-size: 14px; color: #e6e2f2; margin: 0; }
.card .open { position: absolute; inset: 0; z-index: 1; border: 0; background: none; cursor: pointer; }
.card .open:focus-visible { outline-offset: -4px; }
.card .card-tools { position: absolute; z-index: 2; top: 6px; right: 6px; display: flex; gap: 6px; }
.chip-btn {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(8, 6, 16, .72);
  color: #fff; cursor: pointer; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  backdrop-filter: blur(4px);
}
.chip-btn:hover { border-color: var(--cyan); }
.chip-btn.fav[aria-pressed="true"] { color: var(--pink); border-color: var(--pink); }
.soon-ribbon {
  position: absolute; z-index: 2; left: 8px; top: 8px;
  background: rgba(8, 6, 16, .82); border: 1px solid var(--yellow); color: var(--yellow);
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px;
}
.card.soon .open { cursor: default; }
.card.soon canvas { filter: saturate(.7) brightness(.8); }
.empty { color: var(--muted); padding: 30px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }

/* ---------- Panels (scores, settings, about) ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; max-width: 860px; }
.panel h3 { margin: 0 0 10px; font-size: 20px; }
.panel p { color: #d6d2e6; }
.scores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.score-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.score-table th, .score-table td { padding: 5px 6px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.score-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.score-table td.num { text-align: right; }
.score-table tr.mine td { color: var(--yellow); font-weight: 700; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.setting:last-child { border-bottom: 0; }
.setting label, .setting .label { font-weight: 600; }
.setting small { display: block; color: var(--muted); font-weight: 400; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.seg button { border: 0; background: var(--panel2); padding: 8px 14px; cursor: pointer; color: #d6d2e6; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--red); color: #fff; }
.disclaimer { border-left: 3px solid var(--yellow); padding: 6px 0 6px 14px; color: #f1ead0; }
.tribute-list { display: grid; gap: 10px; }
.tribute-list .t-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }

/* ---------- Game screen ---------- */
.game-screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 46, 77, .22), transparent 60%),
    radial-gradient(800px 480px at 5% 110%, rgba(63, 208, 255, .14), transparent 60%),
    radial-gradient(600px 400px at 50% 50%, rgba(122, 77, 255, .08), transparent 70%),
    #07060d;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}
.game-bar {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(28, 24, 44, .92), rgba(14, 12, 24, .88));
  min-height: 56px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  z-index: 2;
}
.game-bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--red) 20%, var(--pink) 50%, var(--cyan) 80%, transparent);
  opacity: .8;
}
.game-title {
  font: italic 900 22px/1.05 var(--title-font); text-transform: uppercase; margin: 0; padding: 2px .55em 2px 2px; flex: 0 1 auto; min-width: 0;
  /* Up to two lines, shrunk to fit by fitGameTitle() in app.js, so a long name is never cut off. */
  white-space: normal; overflow: hidden; max-height: calc(2.1em + 4px); overflow-wrap: normal;
  background: linear-gradient(180deg, #fff 0%, #ffe79a 45%, #ffb02e 70%, #ff6a2e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 138, 61, .45));
}
.game-title .word { white-space: nowrap; }
.hud { display: flex; gap: 16px; margin-left: auto; font-variant-numeric: tabular-nums; }
.hud div { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.hud b { font-size: 18px; color: #fff; text-shadow: 0 0 10px rgba(63, 208, 255, .45); }
.hud span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.icon-btn {
  width: 44px; height: 44px; flex: none;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .12); background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
  cursor: pointer; font-size: 18px; display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--cyan); }
.stage { position: relative; flex: 1; min-height: 0; touch-action: none; overflow: hidden; margin: 12px; }
.game-canvas {
  position: absolute; display: block; border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .10),
    0 0 0 3px rgba(255, 46, 77, .35),
    0 0 28px rgba(255, 46, 77, .35),
    0 0 70px rgba(63, 208, 255, .12),
    0 24px 60px rgba(0, 0, 0, .65);
}
.stage.shake .game-canvas { animation: shake .28s linear; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(var(--sx), calc(var(--sx) * -.5)); }
  40% { transform: translate(calc(var(--sx) * -1), calc(var(--sx) * .4)); }
  60% { transform: translate(calc(var(--sx) * .6), var(--sx)); }
  80% { transform: translate(calc(var(--sx) * -.4), calc(var(--sx) * -.3)); }
}

/* Touch controls: shown on touch devices only */
.touch-root { display: none; }
body.touch .touch-root { display: block; flex: none; }
.touch-pad {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px 14px;
  min-height: 150px;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.touch-pad.swapped { flex-direction: row-reverse; }
.touch-pad.solo { justify-content: center; }
.touch-pad.split, .touch-pad.split.swapped { flex-direction: row; justify-content: space-between; }
.touch-pad.split .action-btns { flex: 1; pointer-events: none; }
.touch-pad.split .a-btn { pointer-events: auto; }
.touch-pad.split .place-center { justify-content: center; }
.touch-pad.split .place-right { justify-content: flex-end; }
.touch-pad.split .a-btn { width: 84px; height: 84px; font-size: 15px; background: rgba(255, 46, 77, .25); border-color: var(--red); }
.touch-pad.split .place-center .a-btn { width: 70px; height: 70px; background: rgba(255, 210, 63, .2); border-color: #ffd23f; }
.touch-pad.empty { display: none; }
/* Action buttons with no stick or pad beside them sit on the action side, like every other game. */
.touch-pad > .action-btns:only-child { margin-left: auto; }
.touch-pad.swapped > .action-btns:only-child { margin-left: 0; margin-right: auto; }
.dpad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 46px); gap: 4px; }
.dpad-horizontal { grid-template-rows: 58px; grid-template-columns: 72px 72px; gap: 10px; }
.dpad-vertical { grid-template-columns: 72px; grid-template-rows: 58px 58px; gap: 10px; }
.dpad-four .d-up { grid-area: 1 / 2; }
.dpad-four .d-left { grid-area: 2 / 1; }
.dpad-four .d-right { grid-area: 2 / 3; }
.dpad-four .d-down { grid-area: 3 / 2; }
.stick {
  position: relative; flex: none;
  width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0 44%, rgba(255,255,255,.09) 45% 100%);
  border: 2px solid rgba(255, 255, 255, .18);
  touch-action: none; cursor: pointer;
  display: grid; place-items: center;
}
.stick.down { border-color: var(--cyan); }
.stick-knob {
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff6b85, var(--red) 60%, #a3122b);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 12px rgba(255, 46, 77, .45);
  pointer-events: none; transition: transform .08s;
}
.stick.down .stick-knob { transition: none; }
.stick-horizontal { height: 84px; width: 150px; border-radius: 42px; }
.stick-vertical { width: 84px; height: 150px; border-radius: 42px; }
.touch-btn {
  border-radius: 14px; border: 2px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07); color: #fff; font-size: 20px;
  touch-action: none; cursor: pointer;
}
.touch-btn.down { background: rgba(63, 208, 255, .35); border-color: var(--cyan); }
.action-btns { display: flex; gap: 12px; }
.a-btn { width: 84px; height: 84px; border-radius: 50%; font-size: 16px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; background: rgba(255, 46, 77, .25); border-color: var(--red); }
.a-btn.down { background: rgba(255, 46, 77, .6); }
.action-btns { align-items: center; }
.action-btns .a-btn:not(:last-child) { width: 62px; height: 62px; font-size: 12px; background: rgba(179, 140, 255, .2); border-color: #b38cff; }

/* Overlays inside the game screen */
.overlay {
  position: absolute; inset: 56px 0 0 0; z-index: 5;
  display: grid; place-items: center;
  background: rgba(5, 4, 12, .78);
  backdrop-filter: blur(3px);
  padding: 16px;
  overflow-y: auto;
}
.sheet {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  text-align: center;
}
.sheet h2 { margin: 0 0 6px; }
.sheet .title-art { font-size: 44px; transform-origin: center; display: inline-block; margin: 6px 0 12px; }
.sheet p { color: #d6d2e6; margin: 8px 0; }
.sheet .joke { font-size: 20px; font-weight: 700; color: var(--yellow); margin: 4px 0 12px; }
.sheet .big-score { font: 800 46px/1 var(--ui-font); color: #fff; margin: 4px 0; font-variant-numeric: tabular-nums; }
.sheet .btn-row { justify-content: center; margin-top: 14px; }
.sheet .controls-help { text-align: left; background: var(--panel2); border-radius: 10px; padding: 10px 14px; font-size: 14px; color: #d6d2e6; margin: 12px 0; }
.sheet .controls-help b { color: #fff; }
.options { text-align: left; margin: 12px 0; }
.options fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0; }
.options legend { color: var(--muted); font-size: 13px; padding: 0 4px; }
.options label { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; }
.options input { accent-color: var(--red); width: 18px; height: 18px; }
.initials { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 10px 0; }
.initials .initials-head { margin: 0; font-weight: 700; color: #fff; text-align: center; }
.initials .initials-label { font-size: 13px; color: var(--muted); letter-spacing: .5px; }
.initials-row { display: flex; gap: 8px; align-items: center; justify-content: center; width: 100%; }
.initials .btn.save { background: var(--yellow); color: #1a1420; border-color: var(--yellow); font-weight: 800; min-height: 48px; padding: 0 22px; box-shadow: 0 0 16px rgba(255, 210, 63, .35); }
.initials .btn.save:hover, .initials .btn.save:focus-visible { background: #ffe07a; }
.initials input {
  width: min(100%, 300px); min-width: 0; text-align: center; font: 900 26px/1 var(--title-font); letter-spacing: 2px;
  background: var(--panel2); color: var(--yellow); border: 2px solid var(--yellow); border-radius: 10px; padding: 8px;
}
.rotate-hint { display: none; color: var(--muted); font-size: 13px; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: rgba(5, 4, 12, .75);
  padding: 16px;
}
.modal .sheet { text-align: left; max-height: calc(100vh - 32px); overflow-y: auto; }
.tribute-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tribute-head .badge { font-size: 12px; padding: 3px 10px; }
.tribute dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; }
.tribute dt { color: var(--muted); }
.tribute dd { margin: 0; font-weight: 600; }
.tribute ul { padding-left: 20px; color: #d6d2e6; }
.tribute .small { font-size: 12px; color: var(--muted); }
.guide-title { margin: 12px 0 0; }
.guide .guide-objective { font-size: 17px; font-weight: 600; color: #fff; }
.guide section { margin-top: 14px; }
.guide h3 { margin: 0 0 4px; font-size: 15px; color: var(--yellow); text-transform: none; }
.guide ol, .guide ul { margin: 0; padding-left: 22px; color: #d6d2e6; }
.guide li { margin: 5px 0; line-height: 1.4; }
.guide .controls-help { margin: 4px 0 0; }

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%) translateY(20px);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Phones and small windows ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding-left: 0; }
  .sidebar {
    order: 2; flex-direction: row; padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
    border-right: 0; border-top: 1px solid var(--line); overflow: visible;
  }
  .sidebar .logo, .sidebar .logo-by, .sidebar .promo { display: none; }
  .nav { flex-direction: row; width: 100%; gap: 0; }
  .nav a { flex: 1; flex-direction: column; gap: 3px; padding: 8px 2px 7px; font-size: 11px; border-radius: 0; border: 0; border-top: 3px solid transparent; }
  .nav a.active { background: rgba(255, 46, 77, .12); border-top-color: var(--red); box-shadow: none; }
  .nav svg { width: 22px; height: 22px; }
  .view { padding: calc(14px + var(--safe-t)) 16px 24px; }
  .mobile-logo { display: flex; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  /* The game's picture runs down behind the badge and the title (its whole 16:9 scene shows), then
     fades into the card just under the title so the tag line and blurb sit on plain background */
  .hero-art {
    position: relative; inset: auto; height: auto; aspect-ratio: 16 / 9; max-height: 360px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, rgba(0, 0, 0, .55) 88%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 72%, rgba(0, 0, 0, .55) 88%, rgba(0, 0, 0, 0) 100%);
  }
  .hero::after { display: none; }
  .hero-copy { padding: 0 18px 54px; margin-top: -104px; }
  .hero .title-art { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .85)); }
  .title-art, .hero .title-art { font-size: 40px; }
  .hero-kicker { font-size: 18px; }
  .section-head h2 { width: 100%; }
  .filters { overflow-x: auto; max-width: 100%; }
  .filters button { padding: 8px 12px; white-space: nowrap; }
  .search { min-width: 0; flex: 1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
  .card .card-title { font-size: 21px; }
  .card .tagline { font-size: 12.5px; }
  .card .card-body { padding: 7px 8px 8px 10px; }
  .card .chip-btn { height: 28px; min-width: 28px; padding: 0 8px; font-size: 11px; }
  .card .card-tools { top: 4px; right: 4px; gap: 4px; }
  .soon-ribbon { font-size: 10px; padding: 2px 6px; left: 5px; top: 5px; letter-spacing: .5px; }
  .game-title { font-size: 17px; }
  .hud { gap: 10px; }
  .hud b { font-size: 15px; }
  .hud span { font-size: 10px; }
  .game-bar { gap: 6px; padding: 6px 8px; }
  .stage { margin: 6px; }
  .game-canvas { border-radius: 10px; }
  .icon-btn { width: 40px; height: 40px; }
  .overlay { inset: 52px 0 0 0; }
}
@media (max-width: 860px) and (orientation: portrait) {
  .rotate-hint.landscape-game { display: block; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .touch-pad { position: absolute; left: 0; right: 0; bottom: 0; min-height: 0; padding: 8px 18px; pointer-events: none; }
  .touch-pad > * { pointer-events: auto; }
  .touch-btn { opacity: .75; }
  .dpad { grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 40px); }
  .a-btn { width: 70px; height: 70px; }
  .stick { width: 110px; height: 110px; }
  .stick-knob { width: 48px; height: 48px; }
}
.mobile-logo { display: none; align-items: center; gap: 10px; margin: 0 0 14px; }
.mobile-logo .logo-top { font-size: 30px; width: auto; padding-right: .28em; } /* room for the italic slant: gradient text only paints inside the box */
.mobile-logo .logo-bottom { font-size: 18px; margin: 0; border-width: 2px; padding: 1px 8px 2px; }
@media (max-width: 860px) { .mobile-logo { display: flex; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
body.reduce-motion * { transition: none !important; animation: none !important; }

/* Classes that replace inline styles (the CSP allows no inline styles) */
.panel.note { padding: 12px 18px; }
.muted { color: var(--muted); }
.tribute-title { margin: 12px 0 0; }
.panel.score-panel { margin: 12px 0 0; padding: 12px 14px; }
.panel.score-panel h3 { font-size: 16px; }
.about-name { margin-bottom: 0; }
.about-by { margin: 2px 0 6px; color: var(--muted); font-weight: 600; }
.about-stamp { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.about-stamp a { color: inherit; }

/* Community high scores */
.score-tabs { margin: 0 0 12px; }
.score-boards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.community-best { color: var(--cyan); font-weight: 700; }
.community-best:empty { display: none; }
.post-status { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.post-status:empty { display: none; }

/* Play tokens: today's count on the home, games and start screens */
.token-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin: 6px 0 12px; font-size: 14px; color: var(--muted, #b8c4e0); }
.token-bar b { color: #ffd23f; }
.token-bar.empty b { color: #ff8a8a; }
.token-ico { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255,210,63,.45)); flex: none; }

/* Account page: sign-up, sign-in and the account details */
.account-tabs { margin-bottom: 14px; flex-wrap: wrap; }
.account-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.field-input { font: inherit; font-size: 16px; color: #fff; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.field-input:focus { outline: 2px solid var(--yellow, #ffd23f); outline-offset: 1px; }
select.field-input { color-scheme: dark; }
select.field-input option { color: #fff; background: #1d1b26; }
select.field-input optgroup { color: #c9c2d8; background: #1d1b26; font-style: normal; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.fine { font-size: 12px; color: var(--muted); }
.form-status { min-height: 1.2em; color: #ff8a8a; font-weight: 600; margin: 0; }
.form-status.good { color: #7cff6b; }
.license-key { font-family: ui-monospace, Consolas, monospace; font-size: 14px; color: #ffd23f; word-break: break-all; }
.setting .value { text-align: right; color: #e8ecf6; }
.btn.danger { background: rgba(255, 46, 77, .16); border-color: rgba(255, 46, 77, .6); color: #ff9aa8; }
.about-link { display: none; }
@media (max-width: 860px) {
  .nav a[data-route="about"] { display: none; }
  .about-link { display: block; }
}
.panel .btn-row + h3, .panel form + h3 { margin-top: 22px; }

/* Settings, Account and About: a centered column on wide screens. About is wider, so each of
   The Originals fits on one line. */
.view[data-route="settings"] > *, .view[data-route="account"] > *, .view[data-route="friends"] > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.view[data-route="about"] > * { max-width: 1240px; margin-left: auto; margin-right: auto; }

/* ---------- High Scores ---------- */
.scores-head { display: none; }
.scores-banner { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin: 0 0 14px; aspect-ratio: 1600 / 534; }
.scores-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scores-banner .score-tabs { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); margin: 0; background: rgba(12, 10, 24, .85); }
.scores-banner .score-tabs button { min-width: 134px; }
.score-note { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: #d6d2e6; }
.score-note svg { width: 28px; height: 28px; flex: none; color: #d6d2e6; }
.score-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.score-card {
  display: flex; gap: 14px; align-items: center; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 10px 10px;
  transition: border-color .15s, transform .15s;
}
.score-card:hover, .score-card:focus-visible { border-color: rgba(255, 210, 63, .55); transform: translateY(-2px); }
.sc-thumb { flex: none; width: 76px; height: 116px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); }
.sc-thumb canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.sc-body { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.sc-title { font: 800 17px/1.15 var(--ui-font); color: #fff; }
.sc-score { display: flex; align-items: center; gap: 7px; font: 800 22px/1 var(--ui-font); color: var(--yellow, #ffd23f); font-variant-numeric: tabular-nums; }
.sc-score svg { width: 22px; height: 22px; }
.sc-score.none { font-size: 15px; color: var(--muted); }
.sc-who { font-size: 13px; padding: 3px 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: #d6d2e6; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-more { font-size: 13px; color: #d6d2e6; }
.sc-chevron { display: none; }
@media (max-width: 860px) {
  .scores-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .scores-head .page-title { margin: 0 0 12px; }
  .scores-trophy { width: 74px; height: auto; margin: -18px 0 0; filter: drop-shadow(0 0 14px rgba(255, 190, 40, .35)); }
  .scores-banner { aspect-ratio: auto; border: 0; border-radius: 0; overflow: visible; margin: 0 0 12px; }
  .scores-banner img { display: none; }
  .scores-banner .score-tabs { position: static; transform: none; display: flex; width: 100%; background: var(--panel); }
  .scores-banner .score-tabs button { flex: 1; min-width: 0; }
  .score-note { gap: 12px; padding: 10px 14px; font-size: 14px; }
  .score-cards { grid-template-columns: 1fr; gap: 8px; }
  .score-card { padding: 8px 12px 8px 8px; gap: 12px; }
  .score-card:hover { transform: none; }
  .sc-thumb { width: 86px; height: 58px; }
  .sc-body { gap: 4px; flex: 1; }
  .sc-title { font-size: 16px; }
  .sc-score { font-size: 19px; }
  .sc-score svg { width: 19px; height: 19px; }
  .sc-who, .sc-more { display: none; }
  .sc-chevron { display: block; margin-left: auto; font-size: 28px; line-height: 1; color: #d6d2e6; }
}

.view[data-route="scores"] > * { max-width: 1240px; margin-left: auto; margin-right: auto; }

/* "by Griffith Software" under the logo */
.logo-by { margin: -14px 0 24px 10px; font-size: 13px; font-weight: 600; letter-spacing: .3px; color: var(--muted); }
.mobile-logo .logo-by { margin: 0 0 0 auto; font-size: 11px; align-self: center; }

/* Small phones, and phones set to large text (which narrows the page) */
.account-tabs { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 420px; }
.account-tabs button { padding: 9px 6px; line-height: 1.2; text-align: center; }
.mobile-logo { flex-wrap: wrap; row-gap: 2px; }
.mobile-logo .logo-by { white-space: nowrap; }
.nav-short { display: none; }
.nav a span { white-space: nowrap; }
@media (max-width: 420px) {
  .mobile-logo .logo-by { flex-basis: 100%; margin: 0; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
}

/* Settings: Install App and its help */
.install-row { display: flex; align-items: center; gap: 10px; flex: none; }
.help-btn {
  width: 34px; height: 34px; flex: none; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06);
  color: #fff; font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1; display: grid; place-items: center;
}
.help-btn:hover, .help-btn:focus-visible { border-color: var(--cyan); }
.help-step h3 { margin: 14px 0 4px; font-size: 16px; }
.help-step p { margin: 0; color: #d6d2e6; }
.sheet.install-help { text-align: left; max-height: calc(100dvh - 32px); overflow-y: auto; }
.sheet.install-help h2 { text-align: center; }
@media (max-width: 600px) {
  .install-setting { flex-wrap: wrap; }
  .install-setting .label { flex-basis: 100%; }
}

/* Play With a Friend */
.friend-room { text-align: center; }
.friend-label { margin: 0; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.friend-code { font: 800 44px/1.1 var(--ui-font, inherit); letter-spacing: 6px; color: var(--yellow, #ffd23f); margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.friend-wait { font-weight: 600; color: #d6d2e6; }
.friend-wait.good { color: #7cff6b; }
.friend-room .btn-row { justify-content: center; }
.friend-games-head { margin: 22px 0 10px; }
.friend-code-input { text-transform: uppercase; letter-spacing: 3px; font-size: 20px; max-width: 220px; }
.friend-with { font-weight: 600; color: #9fe8ff; }
div.score-card.friend-game { cursor: default; }
@media (max-width: 860px) { .friend-game .sc-who { display: inline-block; } }

/* Play With a Friend: the arcade countdown before the game starts */
.countdown {
  position: absolute; inset: 56px 0 0 0; z-index: 4;
  display: grid; place-content: center; justify-items: center; gap: 4px;
  background: rgba(5, 4, 12, .45);
  pointer-events: none; text-align: center;
}
.countdown span {
  font: 700 clamp(16px, 4vw, 26px)/1 ui-monospace, Consolas, monospace;
  letter-spacing: .3em; text-transform: uppercase; color: #fff;
  text-shadow: 0 0 10px rgba(255, 210, 63, .6);
  animation: countdown-blink 1s steps(2, start) infinite;
}
.countdown b {
  font: 900 clamp(96px, 30vw, 200px)/1 ui-monospace, Consolas, monospace;
  color: #ffd23f;
  text-shadow: 4px 4px 0 #e2336b, 8px 8px 0 rgba(0, 0, 0, .55), 0 0 30px rgba(255, 210, 63, .5);
  font-variant-numeric: tabular-nums;
  animation: countdown-pop .35s ease-out;
}
.countdown b.go { color: #3ef08b; text-shadow: 4px 4px 0 #2a6bff, 8px 8px 0 rgba(0, 0, 0, .55), 0 0 30px rgba(62, 240, 139, .5); }
@keyframes countdown-pop { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes countdown-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .countdown span, .countdown b { animation: none; } }
