:root {
  color-scheme: dark;
  --ink: #110c09;
  --char: #1d1410;
  --panel: #251913;
  --panel-2: #2d1f18;
  --cream: #f7eddc;
  --paper: #e9dbc5;
  --muted: #b9a68f;
  --ember: #e04e32;
  --ember-hot: #ff7450;
  --saffron: #f2b946;
  --teal: #2ba6a0;
  --teal-dark: #176f6c;
  --line: rgba(247, 237, 220, 0.15);
  --radius-lg: 30px;
  --radius-md: 20px;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 13% 3%, rgba(224, 78, 50, 0.16), transparent 29rem),
    radial-gradient(circle at 90% 15%, rgba(43, 166, 160, 0.12), transparent 24rem),
    var(--ink);
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image: repeating-linear-gradient(118deg, transparent 0 18px, rgba(255,255,255,.018) 18px 19px);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--saffron);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 30px;
  width: min(100% - 36px, 1240px);
  min-height: 80px;
  margin: 16px auto 0;
  padding: 11px 14px 11px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(17, 12, 9, 0.82);
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  letter-spacing: .08em;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.03rem;
}

.brand small {
  margin-top: 5px;
  color: var(--saffron);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .28em;
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  width: 34px;
  height: 42px;
  transform: rotate(-8deg);
}

.brand-mark::after {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2px;
  height: 36px;
  background: var(--paper);
  content: "";
  transform: translateX(-50%);
}

.brand-mark i {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 13px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--ember);
}

.brand-mark i:nth-child(2) {
  background: var(--saffron);
}

.brand-mark i:nth-child(3) {
  background: var(--teal);
}

.header-nav {
  display: flex;
  gap: 23px;
  margin-right: auto;
}

.header-nav a {
  color: var(--paper);
  font-size: .83rem;
  font-weight: 750;
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--saffron);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.profile-button,
.pause-button,
.touch-controls button,
.dialog-close {
  border: 1px solid var(--line);
  color: var(--cream);
  cursor: pointer;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 13px;
  background: rgba(255,255,255,.04);
  font-size: .75rem;
  font-weight: 750;
}

.icon-button[aria-pressed="true"] {
  border-color: rgba(242,185,70,.55);
  background: rgba(242,185,70,.12);
  color: var(--saffron);
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 154px;
  min-height: 48px;
  padding: 5px 12px 5px 6px;
  border-radius: 15px;
  background: var(--panel-2);
  text-align: left;
}

.profile-button small,
.profile-button strong {
  display: block;
  overflow: hidden;
  max-width: 102px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-button small {
  color: var(--muted);
  font-size: .62rem;
}

.profile-button strong {
  margin-top: 2px;
  font-size: .78rem;
}

.profile-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--ember), #932b20);
  font-family: Georgia, serif;
  font-size: .8rem;
  font-weight: 900;
}

main {
  overflow: hidden;
}

.intro-shell,
.game-section,
.library-section,
.how-section,
footer {
  width: min(100% - 36px, 1180px);
  margin-inline: auto;
}

.intro-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.618fr) minmax(290px, 1fr);
  gap: clamp(42px, 7vw, 100px);
  align-items: end;
  min-height: 650px;
  padding: 100px 0 78px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--saffron);
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 26px;
  height: 2px;
  background: currentColor;
}

.intro-copy h1,
.section-heading h2,
.how-copy h2,
.profile-dialog h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .93;
}

.intro-copy h1 {
  max-width: 740px;
  font-size: clamp(4rem, 8.8vw, 7.4rem);
}

.intro-copy h1 em {
  color: var(--ember-hot);
  font-weight: 500;
}

.intro-deck {
  max-width: 640px;
  margin: 30px 0 0;
  color: var(--paper);
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 34px;
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  min-height: 54px;
  padding: 0 21px;
  border: 0;
  border-radius: 15px;
  background: var(--ember);
  box-shadow: 0 12px 30px rgba(224,78,50,.22);
  color: white;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-decoration: none;
}

.primary-cta:hover {
  background: var(--ember-hot);
  transform: translateY(-2px);
}

.text-link {
  color: var(--paper);
  font-size: .86rem;
  font-weight: 800;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.player-card {
  position: relative;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255,255,255,.06), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
}

.player-card::before {
  position: absolute;
  top: -10px;
  right: 30px;
  width: 72px;
  height: 20px;
  border: 1px solid rgba(242,185,70,.4);
  border-radius: 50%;
  content: "";
  transform: rotate(-8deg);
}

.player-card-top {
  display: flex;
  align-items: center;
  gap: 17px;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}

.player-emblem {
  display: grid;
  flex: 0 0 63px;
  height: 63px;
  place-items: center;
  border: 1px solid rgba(242,185,70,.35);
  border-radius: 19px;
  background: radial-gradient(circle at 35% 30%, var(--saffron), #8f3b20 68%);
  box-shadow: inset 0 0 0 6px rgba(17,12,9,.28);
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 900;
}

.player-card-top p {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
}

.player-card-top h2 {
  overflow: hidden;
  max-width: 190px;
  margin: 2px 0 6px;
  font-family: Georgia, serif;
  font-size: 1.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-chip,
.live-chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(43,166,160,.14);
  color: #75d8d2;
  font-size: .64rem;
  font-weight: 850;
}

.lifetime-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 23px 0 0;
}

.lifetime-stats div {
  min-width: 0;
}

.lifetime-stats dt {
  color: var(--muted);
  font-size: .61rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.lifetime-stats dd {
  overflow: hidden;
  margin: 4px 0 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.06rem;
  font-weight: 900;
  text-overflow: ellipsis;
}

.local-note {
  margin: 21px 0 0;
  color: var(--muted);
  font-size: .69rem;
}

.local-note span {
  margin-right: 6px;
  color: var(--teal);
}

.game-section,
.library-section,
.how-section {
  scroll-margin-top: 110px;
  padding: 78px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
}

.section-heading .eyebrow {
  margin-bottom: 11px;
}

.section-heading h2,
.how-copy h2 {
  font-size: clamp(2.9rem, 6vw, 5.3rem);
}

.section-heading > p {
  max-width: 420px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .83rem;
  text-align: right;
}

.game-console {
  overflow: hidden;
  border: 1px solid rgba(247,237,220,.18);
  border-radius: var(--radius-lg);
  background: #090706;
  box-shadow: 0 34px 80px rgba(0,0,0,.5), 0 0 90px rgba(224,78,50,.08);
}

.console-topbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, .65fr)) minmax(180px, 2fr) auto auto;
  gap: 20px;
  align-items: center;
  min-height: 78px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #2a1d17, #1b120e);
}

.hud-stat span,
.xp-label span {
  display: block;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hud-stat strong,
.xp-label strong {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1rem;
  letter-spacing: .05em;
}

.combo-stat strong {
  color: var(--saffron);
}

.xp-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.xp-label strong {
  font-size: .65rem;
}

.xp-track {
  overflow: hidden;
  height: 7px;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
}

.xp-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--saffron));
  transition: width .25s ease;
}

.lives {
  display: flex;
  gap: 5px;
  color: var(--ember-hot);
  font-size: .72rem;
}

.lives .lost {
  color: rgba(255,255,255,.15);
}

.pause-button {
  min-height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  font-size: .72rem;
  font-weight: 800;
}

.canvas-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #080606;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 50% 45%, rgba(224,78,50,.2), transparent 36%),
    rgba(8,6,6,.72);
  text-align: center;
  backdrop-filter: blur(5px);
  transition: opacity .25s ease, visibility .25s ease;
}

.game-overlay.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.overlay-kicker {
  color: var(--saffron);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.game-overlay h3 {
  margin: 10px 0 16px;
  font-family: Georgia, serif;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: .95;
}

.game-overlay > p {
  max-width: 570px;
  margin: 0;
  color: var(--paper);
}

.overlay-button {
  margin-top: 24px;
}

.game-overlay .overlay-controls {
  margin-top: 17px;
  color: var(--muted);
  font-size: .68rem;
}

.level-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  min-width: 250px;
  padding: 17px 30px;
  border: 1px solid rgba(242,185,70,.42);
  border-radius: 18px;
  background: rgba(22,15,11,.93);
  box-shadow: var(--shadow);
  opacity: 0;
  text-align: center;
  transform: translate(-50%, -50%) scale(.9);
  pointer-events: none;
}

.level-flash.show {
  animation: levelFlash 1.7s both;
}

.level-flash span {
  color: var(--saffron);
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.level-flash strong {
  font-family: Georgia, serif;
  font-size: 2.2rem;
}

@keyframes levelFlash {
  0% { opacity: 0; transform: translate(-50%, -45%) scale(.9); }
  18%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(1.03); }
}

.touch-controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  min-height: 152px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: #18100c;
}

.touch-dpad {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 40px);
  gap: 4px;
}

.touch-controls button {
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  user-select: none;
  touch-action: none;
}

.touch-controls button.active {
  border-color: var(--saffron);
  background: rgba(242,185,70,.2);
}

.touch-up { grid-column: 2; grid-row: 1; }
.touch-left { grid-column: 1; grid-row: 2; }
.touch-dpad > span { grid-column: 2; grid-row: 2; border-radius: 50%; background: rgba(255,255,255,.035); }
.touch-right { grid-column: 3; grid-row: 2; }
.touch-down { grid-column: 2; grid-row: 3; }

.fire-button {
  display: grid;
  width: 94px;
  height: 94px;
  place-content: center;
  border: 4px solid rgba(224,78,50,.28) !important;
  border-radius: 50% !important;
  background: linear-gradient(145deg, var(--ember), #892d22) !important;
  box-shadow: 0 8px 25px rgba(224,78,50,.2);
  color: #fff !important;
  line-height: 1;
}

.fire-button span {
  font-size: .9rem;
  font-weight: 950;
}

.fire-button small {
  margin-top: 6px;
  font-size: .54rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.game-caption {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 18px;
  color: var(--muted);
  font-size: .76rem;
}

.game-caption p {
  margin: 0;
}

.game-caption strong {
  color: var(--cream);
}

.library-section {
  padding-top: 120px;
}

.game-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 18px;
}

.library-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.card-art {
  position: relative;
  overflow: hidden;
  height: 250px;
  background: #0c0907;
}

.featured-game .card-art {
  height: 300px;
}

.storm-art {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 48%, rgba(242,185,70,.22), transparent 12%),
    repeating-radial-gradient(circle at center, transparent 0 42px, rgba(43,166,160,.13) 43px 44px),
    linear-gradient(145deg, #17100c, #090706);
}

.art-orbit {
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border: 1px solid rgba(224,78,50,.25);
  border-radius: 50%;
  transform: rotate(25deg) skewX(-25deg);
}

.orbit-two {
  width: 82%;
  border-color: rgba(43,166,160,.2);
  transform: rotate(-23deg) skewX(18deg);
}

.art-skewer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 175px;
  transform: rotate(-35deg);
}

.art-skewer::after {
  position: absolute;
  left: -20px;
  right: -50px;
  z-index: -1;
  height: 4px;
  background: var(--paper);
  content: "";
}

.art-skewer i {
  width: 42px;
  height: 48px;
  border: 4px solid #160f0b;
  border-radius: 12px 7px;
  background: var(--ember);
  box-shadow: 0 0 30px rgba(224,78,50,.32);
}

.art-skewer i:nth-child(2) { background: var(--saffron); }
.art-skewer i:nth-child(3) { background: var(--teal); }

.storm-art b {
  position: absolute;
  right: 20px;
  bottom: -22px;
  color: rgba(255,255,255,.045);
  font-family: Georgia, serif;
  font-size: 10rem;
  font-weight: 500;
}

.stack-art {
  display: flex;
  align-items: end;
  justify-content: center;
  padding-bottom: 35px;
  background: radial-gradient(circle at 50% 80%, rgba(242,185,70,.17), transparent 45%), #0b0807;
}

.stack-art span {
  position: absolute;
  width: 110px;
  height: 34px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.2);
  transform: translateY(calc(var(--i, 0) * -32px)) rotate(calc(var(--i, 0) * 3deg));
}

.stack-art span:nth-child(1) { --i: 0; width: 145px; background: #4c2c20; }
.stack-art span:nth-child(2) { --i: 1; background: var(--saffron); }
.stack-art span:nth-child(3) { --i: 2; width: 125px; background: var(--teal); }
.stack-art span:nth-child(4) { --i: 3; width: 88px; background: var(--ember); }
.stack-art span:nth-child(5) { --i: 4; width: 72px; background: var(--paper); }

.patience-art {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 70% 20%, rgba(43,166,160,.17), transparent 35%),
    #0b0807;
}

.card-fan {
  position: absolute;
  display: grid;
  width: 100px;
  height: 145px;
  place-items: center;
  border: 3px solid var(--cream);
  border-radius: 13px;
  background: var(--panel-2);
  color: var(--saffron);
  font-family: Georgia, serif;
  font-size: 2.6rem;
  font-weight: 900;
}

.card-one { transform: translateX(-40px) rotate(-15deg); }
.card-two { z-index: 2; color: var(--ember-hot); }
.card-three { transform: translateX(40px) rotate(15deg); color: var(--teal); }

.card-body {
  padding: 22px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.live-chip {
  background: rgba(224,78,50,.15);
  color: var(--ember-hot);
}

.card-body h3 {
  margin: 15px 0 8px;
  font-family: Georgia, serif;
  font-size: 1.7rem;
  font-weight: 500;
}

.featured-game .card-body h3 {
  font-size: 2.15rem;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.card-body a,
.muted-link {
  display: inline-flex;
  gap: 26px;
  margin-top: 19px;
  color: var(--saffron);
  font-size: .76rem;
  font-weight: 900;
  text-underline-offset: 5px;
}

.muted-link {
  color: #8f7e6b;
}

.coming-soon {
  opacity: .78;
}

.how-section {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.35fr);
  gap: clamp(48px, 8vw, 110px);
  align-items: start;
  padding-top: 150px;
  padding-bottom: 150px;
}

.rules-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rules-list li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.rules-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.rules-list > li > span {
  color: var(--ember-hot);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 900;
}

.rules-list strong {
  font-family: Georgia, serif;
  font-size: 1.4rem;
  font-weight: 500;
}

.rules-list p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

footer {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 35px;
  align-items: end;
  padding: 35px 0 50px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .71rem;
}

footer strong {
  color: var(--cream);
  font-family: Georgia, serif;
  font-size: 1.05rem;
}

footer p {
  margin: 5px 0 0;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

footer a {
  color: var(--paper);
  font-weight: 750;
  text-underline-offset: 4px;
}

.prototype-note {
  text-align: right;
}

.profile-dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--panel);
  box-shadow: 0 40px 100px rgba(0,0,0,.65);
  color: var(--cream);
}

.profile-dialog::backdrop {
  background: rgba(8,6,6,.78);
  backdrop-filter: blur(8px);
}

.profile-dialog form {
  position: relative;
  padding: 34px;
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  font-size: 1.3rem;
}

.profile-dialog h2 {
  font-size: 2.7rem;
}

.profile-dialog > form > p:not(.eyebrow) {
  color: var(--muted);
  font-size: .8rem;
}

.profile-dialog label {
  display: block;
  margin: 24px 0 7px;
  color: var(--paper);
  font-size: .72rem;
  font-weight: 850;
}

.profile-dialog input {
  width: 100%;
  min-height: 51px;
  padding: 0 14px;
  border: 1px solid rgba(247,237,220,.22);
  border-radius: 12px;
  background: rgba(0,0,0,.18);
  color: var(--cream);
}

.dialog-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 18px;
}

.dialog-stats span {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.dialog-stats small,
.dialog-stats strong {
  display: block;
}

.dialog-stats small {
  color: var(--muted);
  font-size: .61rem;
}

.dialog-stats strong {
  overflow: hidden;
  margin-top: 3px;
  font-family: ui-monospace, monospace;
  text-overflow: ellipsis;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}

.danger-link {
  border: 0;
  background: transparent;
  color: #d7a397;
  cursor: pointer;
  font-size: .7rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: 320px;
  padding: 12px 16px;
  border: 1px solid rgba(242,185,70,.35);
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
  opacity: 0;
  color: var(--paper);
  font-size: .75rem;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: -1px !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

@media (max-width: 980px) {
  .header-nav {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .intro-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 90px;
  }

  .player-card {
    width: min(100%, 510px);
  }

  .console-topbar {
    grid-template-columns: repeat(3, 1fr) minmax(190px, 2fr) auto;
  }

  .pause-button {
    grid-column: 1 / -1;
    min-height: 34px;
  }

  .game-grid {
    grid-template-columns: 1fr 1fr;
  }

  .featured-game {
    grid-column: 1 / -1;
  }

  .how-section {
    grid-template-columns: 1fr;
  }

  footer {
    grid-template-columns: 1fr 1fr;
  }

  .prototype-note {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (hover: none), (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}

@media (max-width: 700px) {
  .site-header {
    width: calc(100% - 22px);
    min-height: 68px;
    margin-top: 10px;
    border-radius: 18px;
  }

  .button-label,
  .profile-button small {
    display: none;
  }

  .icon-button {
    min-width: 39px;
    padding: 0;
    justify-content: center;
  }

  .profile-button {
    min-width: 0;
    width: 46px;
    padding: 4px;
  }

  .profile-button > span:last-child {
    display: none;
  }

  .intro-shell,
  .game-section,
  .library-section,
  .how-section,
  footer {
    width: calc(100% - 24px);
  }

  .intro-shell {
    padding: 74px 0 40px;
    gap: 46px;
  }

  .intro-copy h1 {
    font-size: clamp(3.7rem, 18vw, 5.4rem);
  }

  .intro-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .player-card {
    padding: 22px;
  }

  .game-section,
  .library-section,
  .how-section {
    padding-top: 65px;
    padding-bottom: 65px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .section-heading > p {
    max-width: 100%;
    text-align: left;
  }

  .game-console {
    margin-inline: -12px;
    border-radius: 20px;
  }

  .console-topbar {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 11px;
  }

  .xp-meter {
    grid-column: 1 / 3;
  }

  .lives {
    justify-content: end;
  }

  .pause-button {
    grid-column: 1 / -1;
  }

  .game-overlay {
    padding: 20px;
  }

  .game-overlay h3 {
    font-size: 3.25rem;
  }

  .game-overlay .overlay-controls {
    display: none;
  }

  .touch-controls {
    display: flex;
  }

  .game-caption,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .featured-game {
    grid-column: auto;
  }

  .featured-game .card-art {
    height: 250px;
  }

  .how-section {
    padding-top: 90px;
  }

  footer {
    grid-template-columns: 1fr;
    padding-bottom: 30px;
  }

  footer nav {
    flex-direction: column;
    gap: 9px;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .brand small {
    display: none;
  }

  .brand strong {
    font-size: .9rem;
  }

  .site-header {
    gap: 7px;
    padding-inline: 11px;
  }

  .header-actions {
    gap: 5px;
  }

  .lifetime-stats {
    gap: 8px;
  }

  .touch-dpad {
    grid-template-columns: repeat(3, 42px);
    grid-template-rows: repeat(3, 36px);
  }

  .fire-button {
    width: 82px;
    height: 82px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: .01ms !important;
}


