:root {
  --bg: #0b1424;
  --panel: rgba(10, 17, 30, 0.86);
  --panel-strong: rgba(8, 13, 24, 0.95);
  --border: rgba(255, 255, 255, 0.12);
  --text: #ecf3ff;
  --muted: #adc0df;
  --warm: #ffb347;
  --teal: #35d3c8;
  --rose: #ff6474;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --body-glow-left: rgba(255, 179, 71, 0.22);
  --body-glow-right: rgba(53, 211, 200, 0.18);
  --body-glow-bottom: rgba(124, 153, 255, 0.18);
  --body-top: #11203b;
  --body-bottom: #09111d;
  --game-accent: #77f8d8;
  --game-accent-soft: rgba(119, 248, 216, 0.18);
  --game-store: #ffb347;
  --game-store-soft: rgba(255, 179, 71, 0.18);
  --mode-panel-glow: rgba(119, 248, 216, 0.12);
  --mode-panel-border: rgba(119, 248, 216, 0.22);
  --upgrade-panel-glow: rgba(255, 179, 71, 0.12);
  --upgrade-panel-border: rgba(255, 179, 71, 0.22);
  --tray-glow-top: rgba(119, 248, 216, 0.08);
  --tray-glow-bottom: rgba(255, 179, 71, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--body-glow-left), transparent 22%),
    radial-gradient(circle at top right, var(--body-glow-right), transparent 26%),
    radial-gradient(circle at 50% 120%, var(--body-glow-bottom), transparent 35%),
    linear-gradient(180deg, var(--body-top) 0%, var(--body-bottom) 100%);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  position: relative;
  overflow-x: hidden;
}

body.theme-lane {
  --body-glow-left: rgba(255, 168, 88, 0.24);
  --body-glow-right: rgba(87, 255, 227, 0.19);
  --body-glow-bottom: rgba(120, 148, 255, 0.18);
  --body-top: #13213d;
  --body-bottom: #09111d;
  --game-accent: #57ffe3;
  --game-accent-soft: rgba(87, 255, 227, 0.18);
  --game-store: #ffb347;
  --game-store-soft: rgba(255, 179, 71, 0.18);
  --mode-panel-glow: rgba(87, 255, 227, 0.13);
  --mode-panel-border: rgba(87, 255, 227, 0.24);
  --upgrade-panel-glow: rgba(255, 168, 88, 0.14);
  --upgrade-panel-border: rgba(255, 168, 88, 0.24);
  --tray-glow-top: rgba(87, 255, 227, 0.09);
  --tray-glow-bottom: rgba(255, 168, 88, 0.08);
}

body.theme-tower {
  --body-glow-left: rgba(255, 214, 115, 0.23);
  --body-glow-right: rgba(117, 215, 255, 0.18);
  --body-glow-bottom: rgba(131, 163, 255, 0.18);
  --body-top: #16253f;
  --body-bottom: #0a1220;
  --game-accent: #75d7ff;
  --game-accent-soft: rgba(117, 215, 255, 0.18);
  --game-store: #ffd56b;
  --game-store-soft: rgba(255, 213, 107, 0.17);
  --mode-panel-glow: rgba(117, 215, 255, 0.13);
  --mode-panel-border: rgba(117, 215, 255, 0.24);
  --upgrade-panel-glow: rgba(255, 213, 107, 0.14);
  --upgrade-panel-border: rgba(255, 213, 107, 0.24);
  --tray-glow-top: rgba(117, 215, 255, 0.09);
  --tray-glow-bottom: rgba(255, 213, 107, 0.08);
}

body.theme-petal {
  --body-glow-left: rgba(255, 142, 198, 0.22);
  --body-glow-right: rgba(102, 228, 180, 0.18);
  --body-glow-bottom: rgba(162, 146, 255, 0.18);
  --body-top: #1b2348;
  --body-bottom: #0a1220;
  --game-accent: #66e4b4;
  --game-accent-soft: rgba(102, 228, 180, 0.17);
  --game-store: #ff8ec6;
  --game-store-soft: rgba(255, 142, 198, 0.16);
  --mode-panel-glow: rgba(102, 228, 180, 0.13);
  --mode-panel-border: rgba(102, 228, 180, 0.24);
  --upgrade-panel-glow: rgba(255, 142, 198, 0.14);
  --upgrade-panel-border: rgba(255, 142, 198, 0.24);
  --tray-glow-top: rgba(102, 228, 180, 0.08);
  --tray-glow-bottom: rgba(255, 142, 198, 0.08);
}

body.theme-orbit {
  --body-glow-left: rgba(255, 159, 90, 0.22);
  --body-glow-right: rgba(122, 209, 255, 0.2);
  --body-glow-bottom: rgba(128, 150, 255, 0.18);
  --body-top: #171f42;
  --body-bottom: #070d1b;
  --game-accent: #7ad1ff;
  --game-accent-soft: rgba(122, 209, 255, 0.18);
  --game-store: #ff9f5a;
  --game-store-soft: rgba(255, 159, 90, 0.16);
  --mode-panel-glow: rgba(122, 209, 255, 0.13);
  --mode-panel-border: rgba(122, 209, 255, 0.24);
  --upgrade-panel-glow: rgba(255, 159, 90, 0.14);
  --upgrade-panel-border: rgba(255, 159, 90, 0.24);
  --tray-glow-top: rgba(122, 209, 255, 0.09);
  --tray-glow-bottom: rgba(255, 159, 90, 0.08);
}

body.theme-switch {
  --body-glow-left: rgba(120, 214, 255, 0.2);
  --body-glow-right: rgba(255, 213, 107, 0.18);
  --body-glow-bottom: rgba(112, 255, 204, 0.16);
  --body-top: #132236;
  --body-bottom: #08111d;
  --game-accent: #75d7ff;
  --game-accent-soft: rgba(117, 215, 255, 0.18);
  --game-store: #ffd56b;
  --game-store-soft: rgba(255, 213, 107, 0.16);
  --mode-panel-glow: rgba(117, 215, 255, 0.13);
  --mode-panel-border: rgba(117, 215, 255, 0.24);
  --upgrade-panel-glow: rgba(255, 213, 107, 0.14);
  --upgrade-panel-border: rgba(255, 213, 107, 0.24);
  --tray-glow-top: rgba(117, 215, 255, 0.08);
  --tray-glow-bottom: rgba(255, 213, 107, 0.08);
}

body.theme-star {
  --body-glow-left: rgba(112, 196, 255, 0.24);
  --body-glow-right: rgba(255, 105, 138, 0.2);
  --body-glow-bottom: rgba(255, 176, 91, 0.18);
  --body-top: #1b203d;
  --body-bottom: #070a16;
  --game-accent: #7ac8ff;
  --game-accent-soft: rgba(122, 200, 255, 0.18);
  --game-store: #ff8d63;
  --game-store-soft: rgba(255, 141, 99, 0.16);
  --mode-panel-glow: rgba(122, 200, 255, 0.13);
  --mode-panel-border: rgba(122, 200, 255, 0.24);
  --upgrade-panel-glow: rgba(255, 141, 99, 0.14);
  --upgrade-panel-border: rgba(255, 141, 99, 0.24);
  --tray-glow-top: rgba(122, 200, 255, 0.09);
  --tray-glow-bottom: rgba(255, 141, 99, 0.08);
}

body.theme-ashen {
  --body-glow-left: rgba(255, 183, 102, 0.2);
  --body-glow-right: rgba(255, 110, 89, 0.18);
  --body-glow-bottom: rgba(138, 248, 207, 0.14);
  --body-top: #2c1f1a;
  --body-bottom: #090607;
  --game-accent: #ffb45e;
  --game-accent-soft: rgba(255, 180, 94, 0.18);
  --game-store: #72f1c0;
  --game-store-soft: rgba(114, 241, 192, 0.16);
  --mode-panel-glow: rgba(255, 180, 94, 0.13);
  --mode-panel-border: rgba(255, 180, 94, 0.24);
  --upgrade-panel-glow: rgba(114, 241, 192, 0.14);
  --upgrade-panel-border: rgba(114, 241, 192, 0.24);
  --tray-glow-top: rgba(255, 180, 94, 0.08);
  --tray-glow-bottom: rgba(114, 241, 192, 0.08);
}

body.theme-rune {
  --body-glow-left: rgba(114, 197, 255, 0.19);
  --body-glow-right: rgba(155, 255, 212, 0.17);
  --body-glow-bottom: rgba(255, 227, 130, 0.16);
  --body-top: #122236;
  --body-bottom: #071017;
  --game-accent: #9de7ff;
  --game-accent-soft: rgba(157, 231, 255, 0.18);
  --game-store: #ffe07a;
  --game-store-soft: rgba(255, 224, 122, 0.16);
  --mode-panel-glow: rgba(157, 231, 255, 0.13);
  --mode-panel-border: rgba(157, 231, 255, 0.24);
  --upgrade-panel-glow: rgba(255, 224, 122, 0.14);
  --upgrade-panel-border: rgba(255, 224, 122, 0.24);
  --tray-glow-top: rgba(157, 231, 255, 0.08);
  --tray-glow-bottom: rgba(255, 224, 122, 0.08);
}

body.theme-aether {
  --body-glow-left: rgba(112, 255, 210, 0.19);
  --body-glow-right: rgba(255, 215, 126, 0.16);
  --body-glow-bottom: rgba(255, 104, 124, 0.13);
  --body-top: #0f2b28;
  --body-bottom: #05080f;
  --game-accent: #71ffd5;
  --game-accent-soft: rgba(113, 255, 213, 0.18);
  --game-store: #ffe184;
  --game-store-soft: rgba(255, 225, 132, 0.16);
  --mode-panel-glow: rgba(113, 255, 213, 0.13);
  --mode-panel-border: rgba(113, 255, 213, 0.24);
  --upgrade-panel-glow: rgba(255, 225, 132, 0.14);
  --upgrade-panel-border: rgba(255, 225, 132, 0.24);
  --tray-glow-top: rgba(113, 255, 213, 0.08);
  --tray-glow-bottom: rgba(255, 104, 124, 0.08);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  opacity: 0.28;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 92%);
}

body::after {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 32%);
}

a {
  color: inherit;
}

.hub-shell,
.game-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero-panel,
.notes-panel,
.game-card,
.play-panel,
.sidebar-panel,
.controls-panel,
.stat-panel {
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 30%),
    var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-panel,
.notes-panel {
  padding: 32px;
}

.eyebrow,
.card-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dce9ff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-panel h1,
.notes-panel h2,
.game-card h2,
.sidebar-panel h2,
.controls-panel h2 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
}

.hero-panel h1 {
  font-size: clamp(2.3rem, 4vw, 4.3rem);
  line-height: 0.98;
  max-width: 760px;
}

.hero-copy,
.card-copy,
.notes-grid p,
.sidebar-panel p,
.control-list li,
.hud-copy {
  color: var(--muted);
  line-height: 1.65;
}

.hero-badges,
.card-tags,
.quick-links,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}

.hero-badges span,
.card-tags li,
.quick-links a,
.quick-links span,
.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #dce8fd;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

.status-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.18) 50%, transparent 80%);
  transform: translateX(-120%);
  animation: shimmerSweep 5.8s ease-in-out infinite;
  pointer-events: none;
}

.game-grid,
.notes-grid {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.game-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.notes-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.game-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 42%);
}

.game-card-lane::after,
.game-card-tower::after,
.game-card-petal::after,
.game-card-orbit::after,
.game-card-switch::after,
.game-card-star::after,
.game-card-ashen::after,
.game-card-rune::after,
.game-card-aether::after {
  content: "";
  position: absolute;
  inset: auto 18px 16px 18px;
  height: 3px;
  border-radius: 999px;
  pointer-events: none;
}

.game-card-lane::after {
  background: linear-gradient(90deg, #57ffe3, #ffb347);
}

.game-card-tower::after {
  background: linear-gradient(90deg, #75d7ff, #ffd56b);
}

.game-card-petal::after {
  background: linear-gradient(90deg, #66e4b4, #ff8ec6);
}

.game-card-orbit::after {
  background: linear-gradient(90deg, #7ad1ff, #ff9f5a);
}

.game-card-switch::after {
  background: linear-gradient(90deg, #75d7ff, #ffd56b);
}

.game-card-star::after {
  background: linear-gradient(90deg, #7ac8ff, #ff8d63);
}

.game-card-ashen::after {
  background: linear-gradient(90deg, #ffb45e, #72f1c0);
}

.game-card-rune::after {
  background: linear-gradient(90deg, #9de7ff, #ffe07a);
}

.game-card-aether::after {
  background: linear-gradient(90deg, #71ffd5, #ffe184, #ff6a7c);
}

.card-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-meter {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    rgba(6, 12, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-meter span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(220, 233, 255, 0.78);
}

.card-meter strong {
  font-size: 1rem;
  color: var(--text);
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.card-footer .card-tags {
  margin: 0;
}

.card-link,
.back-link,
.ghost-link,
.play-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.card-link,
.play-link {
  background: linear-gradient(135deg, var(--warm), #ff8a1f);
  color: #1c1304;
  box-shadow: 0 16px 32px rgba(255, 138, 31, 0.25);
}

.back-link,
.ghost-link {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-link:hover,
.back-link:hover,
.ghost-link:hover,
.play-link:hover,
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.card-link:active,
.back-link:active,
.ghost-link:active,
.play-link:active,
button:active {
  transform: translateY(1px);
}

.game-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 28px 30px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 0% 0%, var(--game-store-soft), transparent 26%),
    radial-gradient(circle at 100% 20%, var(--game-accent-soft), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01) 38%),
    rgba(9, 15, 27, 0.84);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.game-header::before,
.game-header::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.game-header::before {
  width: 220px;
  height: 220px;
  top: -110px;
  right: -50px;
  background: radial-gradient(circle, var(--game-accent-soft), transparent 68%);
}

.game-header::after {
  width: 160px;
  height: 160px;
  bottom: -78px;
  left: -32px;
  background: radial-gradient(circle, var(--game-store-soft), transparent 70%);
}

.game-header > * {
  position: relative;
  z-index: 1;
}

.game-header h1 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 3.6vw, 3.8rem);
  line-height: 0.98;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.hero-copy {
  max-width: 720px;
  font-size: 1.03rem;
}

.hero-panel {
  position: relative;
  overflow: hidden;
}

.hero-panel::before,
.hero-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-panel::before {
  width: 320px;
  height: 320px;
  top: -180px;
  right: -90px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
}

.hero-panel::after {
  width: 260px;
  height: 260px;
  bottom: -160px;
  left: -120px;
  background: radial-gradient(circle, var(--game-store-soft), transparent 74%);
}

.hero-panel > * {
  position: relative;
  z-index: 1;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.hero-rail,
.launch-strip {
  display: grid;
  gap: 14px;
}

.hero-stat,
.launch-card,
.intel-card,
.notes-grid article {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(8, 14, 26, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 30px rgba(0, 0, 0, 0.12);
}

.hero-stat::before,
.launch-card::before,
.intel-card::before,
.notes-grid article::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 42%);
  pointer-events: none;
}

.game-card > *,
.hero-stat > *,
.launch-card > *,
.intel-card > *,
.notes-grid article > * {
  position: relative;
  z-index: 1;
}

.hero-stat {
  padding: 18px;
}

.notes-grid article {
  padding: 18px;
}

.hero-stat strong,
.launch-card strong {
  display: block;
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--text);
}

.hero-stat p,
.launch-card p,
.notes-grid article p {
  margin: 0;
}

.hero-stat p + strong,
.launch-card p + strong {
  margin-top: 4px;
}

.quick-launch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.game-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.play-panel,
.sidebar-panel,
.controls-panel,
.stat-panel {
  padding: 22px;
}

.play-panel {
  display: grid;
  gap: 18px;
}

.launch-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.launch-card {
  padding: 18px 18px 16px;
}

.launch-card-primary {
  grid-column: span 2;
}

.launch-label {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(220, 233, 255, 0.78);
}

.launch-card h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.05;
}

.cabinet-stack {
  position: relative;
  display: grid;
  gap: 0;
  margin-top: 2px;
}

.cabinet-stack::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  bottom: 0;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01) 24%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(circle at top, var(--tray-glow-top), transparent 32%),
    radial-gradient(circle at bottom, var(--tray-glow-bottom), transparent 40%);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  z-index: 0;
}

.canvas-wrap {
  --cabinet-canvas-max-height: min(72vh, 760px);
  --cabinet-canvas-width: min(100%, 40.5vh, 428px);
  position: relative;
  width: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 28%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    rgba(0, 0, 0, 0.18);
  border-radius: 26px 26px 16px 16px;
  padding: 18px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 22px 40px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.canvas-wrap::before,
.canvas-wrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
}

.canvas-wrap::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 100% 6px, 18px 100%;
  opacity: 0.22;
  mix-blend-mode: screen;
}

.canvas-wrap::after {
  inset: 14px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.1), transparent 36%),
    linear-gradient(180deg, transparent 64%, rgba(0, 0, 0, 0.18));
}

.screen-visor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  padding: 8px 12px;
  position: relative;
  z-index: 1;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(4, 9, 17, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.screen-visor-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d6e4fb;
}

.screen-visor-glow {
  width: 76px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--game-accent), var(--game-store));
  opacity: 0.85;
  box-shadow: 0 0 18px var(--game-accent-soft);
  animation: visorPulse 2.8s ease-in-out infinite;
}

.screen-visor-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.visor-action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 18px rgba(0, 0, 0, 0.14);
}

canvas {
  display: block;
  width: var(--cabinet-canvas-width);
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: var(--cabinet-canvas-max-height);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  border-radius: 18px;
  background: #0b1020;
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

body.theme-rune .canvas-wrap {
  --cabinet-canvas-max-height: min(82vh, 720px);
  --cabinet-canvas-width: min(100%, 1120px);
}

body.theme-rune canvas#game {
  aspect-ratio: 16 / 9;
}

body.theme-aether .game-shell {
  width: min(1480px, calc(100% - 32px));
}

body.theme-aether .game-header {
  margin-bottom: 18px;
  padding: 22px 30px;
}

body.theme-aether .game-header h1 {
  font-size: clamp(2.25rem, 3vw, 3.35rem);
}

body.theme-aether .hero-copy {
  max-width: 66ch;
  line-height: 1.5;
}

body.theme-aether .quick-links {
  margin-top: 0;
  align-self: center;
}

body.theme-aether .game-layout {
  grid-template-columns: minmax(0, 2.15fr) minmax(310px, 0.85fr);
}

body.theme-aether .canvas-wrap {
  --cabinet-canvas-max-height: min(78vh, 720px);
  --cabinet-canvas-width: min(100%, 960px);
}

body.theme-aether .cabinet-stack {
  order: 1;
}

body.theme-aether .hud-row {
  order: 2;
}

body.theme-aether .launch-strip {
  order: 3;
}

body.theme-aether .hud-banner {
  order: 4;
}

body.theme-aether canvas#game {
  aspect-ratio: 3 / 2;
  width: var(--cabinet-canvas-width);
  max-height: var(--cabinet-canvas-max-height);
}

.hud-row,
.button-row,
.lane-controls,
.stack-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hud-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.hud-banner {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.hud-banner strong {
  color: var(--text);
}

.meta-stack {
  position: relative;
  display: grid;
  gap: 14px;
  margin-top: -1px;
  padding: 18px 16px 16px;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at top, var(--tray-glow-top), transparent 48%),
    radial-gradient(circle at bottom right, var(--tray-glow-bottom), transparent 62%),
    rgba(6, 11, 21, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 0;
  border-bottom: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 34px rgba(0, 0, 0, 0.16);
  z-index: 1;
}

.meta-stack::before {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.meta-stack::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  top: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--game-accent-soft), transparent 38%, var(--game-store-soft));
  opacity: 0.4;
  filter: blur(14px);
  pointer-events: none;
  animation: visorPulse 4.4s ease-in-out infinite;
}

.meta-stack-header {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    rgba(9, 16, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.meta-stack-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(220, 233, 255, 0.78);
}

.meta-stack-title {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--text);
}

.meta-stack-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.deck-controls {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: -1px;
  padding: 14px 16px 16px;
  border-radius: 0 0 26px 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    radial-gradient(circle at top, var(--tray-glow-top), transparent 44%),
    rgba(5, 10, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 34px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.deck-controls::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.deck-controls-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
}

.deck-controls-label,
.deck-controls-note {
  margin: 0;
}

.deck-controls-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(220, 233, 255, 0.8);
}

.deck-controls-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

.cabinet-console-shell {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    radial-gradient(circle at top, var(--tray-glow-top), transparent 46%),
    rgba(5, 10, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 34px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

.cabinet-console-shell[hidden] {
  display: none !important;
}

.cabinet-console-shell::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.cabinet-control-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.cabinet-console-shell .button-row,
.cabinet-console-shell .lane-controls,
.cabinet-console-shell .stack-controls {
  gap: 8px;
}

.cabinet-console-shell button {
  min-height: 0;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.2;
}

.cabinet-console-shell .mode-grid,
.cabinet-console-shell .upgrade-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cabinet-console-shell .mode-panel,
.cabinet-console-shell .upgrade-panel {
  padding: 12px;
  border-radius: 18px;
}

.cabinet-console-shell .mode-button,
.cabinet-console-shell .upgrade-button {
  padding: 10px 11px;
  gap: 4px;
  border-radius: 16px;
}

.cabinet-console-shell .mode-button small,
.cabinet-console-shell .upgrade-button small {
  font-size: 0.72rem;
}

.cabinet-console-shell .resource-line {
  font-size: 0.82rem;
}

.cabinet-console-drawer {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(7, 14, 25, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cabinet-console-drawer summary {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px 38px 10px 12px;
  cursor: pointer;
  list-style: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    rgba(8, 15, 28, 0.72);
}

.cabinet-console-drawer summary::-webkit-details-marker {
  display: none;
}

.cabinet-console-drawer summary::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  color: var(--text);
  font-size: 1rem;
  transform: translateY(-50%);
  transition: transform 180ms ease;
}

.cabinet-console-drawer[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.cabinet-console-drawer[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cabinet-console-tag {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(220, 233, 255, 0.78);
}

.cabinet-console-title {
  display: block;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.3;
}

.cabinet-console-body {
  display: grid;
  gap: 10px;
  padding: 10px;
  max-height: min(30vh, 220px);
  overflow: auto;
}

.cabinet-console-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.deck-controls .button-row,
.deck-controls .lane-controls,
.deck-controls .stack-controls {
  gap: 10px;
}

.mode-panel,
.upgrade-panel {
  position: relative;
  overflow: hidden;
  padding: 14px 16px 16px;
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 26px rgba(0, 0, 0, 0.12);
}

.mode-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at top right, var(--mode-panel-glow), transparent 56%),
    rgba(8, 17, 28, 0.72);
  border: 1px solid var(--mode-panel-border);
}

.upgrade-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at top left, var(--upgrade-panel-glow), transparent 56%),
    rgba(14, 13, 20, 0.72);
  border: 1px solid var(--upgrade-panel-border);
}

.mode-panel::before,
.upgrade-panel::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 3px;
  border-radius: 999px;
}

.mode-panel::before {
  background: linear-gradient(90deg, var(--game-accent), rgba(255, 255, 255, 0));
}

.upgrade-panel::before {
  background: linear-gradient(90deg, var(--game-store), rgba(255, 255, 255, 0));
}

.mode-panel h3,
.upgrade-panel h3 {
  margin: 4px 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mode-panel h3 {
  color: var(--game-accent);
}

.upgrade-panel h3 {
  color: var(--game-store);
}

.resource-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.resource-line strong {
  color: var(--text);
}

.mode-panel .resource-line strong {
  color: var(--game-accent);
}

.upgrade-panel .resource-line strong {
  color: var(--game-store);
}

.mode-grid,
.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.mode-button,
.upgrade-button {
  min-height: 0;
  padding: 12px 14px;
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.mode-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at top right, var(--mode-panel-glow), transparent 64%),
    rgba(8, 21, 32, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 22px rgba(0, 0, 0, 0.12);
}

.upgrade-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at top left, var(--upgrade-panel-glow), transparent 64%),
    rgba(25, 18, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 22px rgba(0, 0, 0, 0.12);
}

.mode-button::after,
.upgrade-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mode-button::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 40%);
}

.upgrade-button::after {
  background: linear-gradient(135deg, rgba(255, 245, 220, 0.05), transparent 40%);
}

.mode-button span,
.upgrade-button span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.mode-button strong,
.upgrade-button strong {
  display: block;
  font-size: 0.95rem;
}

.mode-button small,
.upgrade-button small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.78rem;
}

.mode-button.active {
  border: 1px solid var(--mode-panel-border);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 16px 30px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--mode-panel-border);
  transform: translateY(-1px);
}

.upgrade-button.afford {
  border: 1px solid var(--upgrade-panel-border);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 14px 22px rgba(0, 0, 0, 0.14), 0 0 0 1px var(--upgrade-panel-border);
  animation: affordPulse 1.8s ease-in-out infinite;
}

@keyframes affordPulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.1), 0 14px 22px rgba(255, 179, 71, 0.1);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.24), 0 18px 30px rgba(255, 179, 71, 0.2);
  }
}

@keyframes visorPulse {
  0%, 100% {
    opacity: 0.72;
    transform: scaleX(0.98);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.02);
  }
}

@keyframes shimmerSweep {
  0%, 74%, 100% {
    transform: translateX(-120%);
  }
  82% {
    transform: translateX(120%);
  }
}

.stat-chip {
  position: relative;
  min-width: 116px;
  overflow: hidden;
  padding: 12px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(11, 17, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 22px rgba(0, 0, 0, 0.14);
}

.stat-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 44%);
  pointer-events: none;
}

.stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 700;
  color: #06111d;
  background: linear-gradient(135deg, var(--teal), #77f8d8 58%, #8ef7ff);
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(53, 211, 200, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

button.secondary {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 18px rgba(0, 0, 0, 0.12);
}

button:focus-visible,
.card-link:focus-visible,
.back-link:focus-visible,
.ghost-link:focus-visible,
.play-link:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--game-accent);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
}

.intel-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.intel-card[open] {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 32px rgba(0, 0, 0, 0.14);
}

.intel-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--text);
}

.intel-card summary::-webkit-details-marker {
  display: none;
}

.intel-card summary::after {
  content: "+";
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--game-accent);
  flex: 0 0 auto;
}

.intel-card[open] summary::after {
  content: "-";
}

.intel-card > *:not(summary) {
  padding: 0 18px 18px;
}

.intel-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.control-list {
  margin: 0;
  padding-left: 18px;
}

.control-list li + li {
  margin-top: 10px;
}

.focus-note {
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid var(--game-accent);
  border-radius: 16px;
  background: var(--game-accent-soft);
  color: #dffefa;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.objective-card {
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--game-store-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffe6bf;
  line-height: 1.6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.objective-card strong {
  color: #fff2dc;
}

body.page-special .game-shell {
  width: min(1480px, calc(100% - 24px));
  padding-top: 18px;
}

body.page-special .game-header {
  margin-bottom: 16px;
  padding: 20px 24px;
  gap: 14px 18px;
}

body.page-special .game-header h1 {
  margin-bottom: 8px;
  font-size: clamp(2.3rem, 3vw, 3.55rem);
}

body.page-special .hero-copy {
  max-width: 78ch;
  margin: 0;
  font-size: 0.99rem;
  line-height: 1.48;
}

body.page-special .quick-links {
  margin-top: 0;
  justify-content: flex-end;
  align-self: center;
}

body.page-special .game-layout {
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.82fr);
  gap: 18px;
  align-items: start;
}

body.page-special .play-panel,
body.page-special .sidebar-panel {
  padding: 18px;
}

body.page-special .play-panel {
  gap: 14px;
}

body.page-special .cabinet-stack {
  order: 1;
  width: 100%;
}

body.page-special .hud-row,
body.page-special .hud-banner,
body.page-special .launch-strip {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
}

body.page-special .hud-row {
  order: 2;
  gap: 10px;
}

body.page-special .hud-banner {
  order: 3;
  min-height: 0;
  padding: 10px 14px;
}

body.page-special .launch-strip {
  order: 4;
  gap: 12px;
}

body.page-special .launch-card {
  padding: 15px 16px 14px;
}

body.page-special .launch-card p {
  line-height: 1.52;
}

body.page-special .canvas-wrap {
  --cabinet-canvas-max-height: min(84vh, 940px);
  --cabinet-canvas-width: min(100%, 47.25vh, 529px);
  width: min(100%, 596px);
  margin: 0 auto;
  padding: 16px 18px 14px;
  border-radius: 30px 30px 20px 20px;
}

body.page-special .canvas-wrap::after {
  inset: 18px;
  border-radius: 22px;
}

body.page-special .screen-visor {
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 12px;
}

body.page-special .screen-visor-label {
  letter-spacing: 0.14em;
}

body.page-special .screen-visor-glow {
  width: 64px;
}

body.page-special .stat-chip {
  min-width: 0;
  padding: 11px 13px;
}

body.page-special .sidebar-panel {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  scrollbar-width: thin;
}

body.page-special .sidebar-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 2vw, 2.5rem);
  line-height: 1.02;
}

body.page-special .objective-card,
body.page-special .focus-note {
  margin: 0;
}

body.page-special .intel-stack {
  gap: 10px;
  margin-bottom: 14px;
}

body.page-special .intel-card summary {
  padding: 13px 16px;
}

body.page-special .intel-card > *:not(summary) {
  padding-inline: 16px;
}

body.page-special.special-focus-mode .game-header,
body.page-special.special-focus-mode .sidebar-panel,
body.page-special.special-focus-mode .launch-strip,
body.page-special.special-focus-mode .hud-banner {
  display: none;
}

body.page-special.special-focus-mode .game-layout {
  grid-template-columns: 1fr;
}

body.page-special.special-focus-mode .play-panel {
  padding: 12px;
}

body.page-special.special-focus-mode .cabinet-stack,
body.page-special.special-focus-mode .hud-row {
  max-width: 1080px;
  margin-inline: auto;
}

body.page-special.special-focus-mode .canvas-wrap {
  --cabinet-canvas-max-height: min(90vh, 1040px);
  --cabinet-canvas-width: min(100%, 50.625vh, 585px);
  width: min(100%, 660px);
}

body.page-special.special-focus-mode .hud-row {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

body.page-special.page-window {
  background:
    radial-gradient(circle at top left, rgba(255, 168, 88, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(87, 255, 227, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.98), rgba(10, 17, 30, 0.98));
}

body.page-special.page-window .game-shell {
  width: min(732px, calc(100% - 12px));
  padding: 8px 0 12px;
}

body.page-special.page-window .game-header,
body.page-special.page-window .sidebar-panel,
body.page-special.page-window .launch-strip {
  display: none;
}

body.page-special.page-window .game-layout {
  grid-template-columns: 1fr;
  gap: 0;
}

body.page-special.page-window .play-panel {
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

body.page-special.page-window .cabinet-stack,
body.page-special.page-window .hud-row,
body.page-special.page-window .hud-banner {
  width: min(100%, 640px);
  max-width: 640px;
  margin-inline: auto;
}

body.page-special.page-window .canvas-wrap {
  --cabinet-canvas-max-height: min(81vh, 900px);
  --cabinet-canvas-width: min(100%, 45.5vh, 514px);
  width: 100%;
  padding: 10px 12px 10px;
}

body.page-special.page-window .canvas-wrap::after {
  inset: 14px;
}

body.page-special.page-window .hud-row {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

body.page-special.page-window .stat-chip {
  padding: 9px 8px;
  border-radius: 15px;
}

body.page-special.page-window .stat-label {
  margin-bottom: 4px;
  font-size: clamp(0.56rem, 1.5vw, 0.68rem);
  letter-spacing: 0.07em;
}

body.page-special.page-window .stat-value {
  display: block;
  overflow: hidden;
  font-size: clamp(0.86rem, 2.8vw, 1.05rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-special.page-window .hud-banner {
  padding: 10px 12px;
  line-height: 1.48;
}

@media (max-width: 680px) {
  body.page-special.page-window .hud-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.theme-rune.page-special .canvas-wrap {
  --cabinet-canvas-max-height: min(82vh, 720px);
  --cabinet-canvas-width: min(100%, 1120px);
  width: min(100%, 1180px);
}

body.theme-rune.page-special:not(.page-window) .game-layout {
  grid-template-columns: 1fr;
}

body.theme-rune.page-special:not(.page-window) .play-panel {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
}

body.theme-rune.page-special:not(.page-window) .cabinet-stack,
body.theme-rune.page-special:not(.page-window) .hud-row,
body.theme-rune.page-special:not(.page-window) .hud-banner,
body.theme-rune.page-special:not(.page-window) .launch-strip {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
}

body.theme-rune.page-special:not(.page-window) .canvas-wrap {
  --cabinet-canvas-max-height: min(84vh, 780px);
  --cabinet-canvas-width: min(100%, 1240px);
  width: min(100%, 1280px);
}

body.theme-rune.page-special:not(.page-window) .sidebar-panel {
  position: static;
  display: grid;
  grid-template-columns: minmax(230px, 0.82fr) minmax(360px, 1.38fr) minmax(220px, 0.8fr);
  gap: 14px 16px;
  max-height: none;
  overflow: visible;
}

body.theme-rune.page-special:not(.page-window) .sidebar-panel .section-kicker {
  grid-column: 1 / -1;
}

body.theme-rune.page-special:not(.page-window) .sidebar-panel h2,
body.theme-rune.page-special:not(.page-window) .sidebar-panel .objective-card {
  grid-column: 1;
}

body.theme-rune.page-special:not(.page-window) .sidebar-panel .intel-stack {
  grid-column: 2;
  grid-row: 2 / span 3;
}

body.theme-rune.page-special:not(.page-window) .sidebar-panel .focus-note {
  grid-column: 3;
  grid-row: 2;
}

body.theme-rune.page-special.special-focus-mode:not(.page-window) .sidebar-panel {
  display: none;
}

body.theme-rune.page-special.special-focus-mode:not(.page-window) .play-panel,
body.theme-rune.page-special.special-focus-mode:not(.page-window) .cabinet-stack,
body.theme-rune.page-special.special-focus-mode:not(.page-window) .hud-row,
body.theme-rune.page-special.special-focus-mode:not(.page-window) .canvas-wrap {
  min-width: 0;
  max-width: 100%;
}

body.theme-rune.page-special.special-focus-mode:not(.page-window) .play-panel {
  width: 100%;
}

body.theme-rune.page-special.special-focus-mode .canvas-wrap {
  --cabinet-canvas-max-height: min(84vh, 760px);
  --cabinet-canvas-width: min(100%, 1240px);
  width: min(100%, 1280px);
}

body.theme-rune.page-special.page-window .canvas-wrap {
  --cabinet-canvas-max-height: min(78vh, 720px);
  --cabinet-canvas-width: min(100%, calc(100vw - 48px), 1120px);
  width: min(100%, calc(100vw - 20px), 1160px);
}

body.theme-rune.page-special.page-window .game-shell {
  width: min(1180px, calc(100% - 10px));
}

body.theme-rune.page-special.page-window .cabinet-stack,
body.theme-rune.page-special.page-window .hud-row,
body.theme-rune.page-special.page-window .hud-banner {
  width: calc(100vw - 50px);
  max-width: 1140px;
}

body.theme-rune.page-special:not(.page-window) .game-shell {
  padding-top: 10px;
}

body.theme-rune.page-special:not(.page-window) .game-header {
  margin-bottom: 10px;
  padding: 12px 18px;
  border-radius: 22px;
  align-items: center;
}

body.theme-rune.page-special:not(.page-window) .game-header h1 {
  margin-bottom: 4px;
  font-size: clamp(1.85rem, 2.35vw, 2.7rem);
}

body.theme-rune.page-special:not(.page-window) .hero-copy {
  max-width: 72ch;
  font-size: 0.92rem;
  line-height: 1.35;
}

body.theme-rune.page-special:not(.page-window) .quick-links {
  gap: 8px;
}

body.theme-rune.page-special:not(.page-window) .status-pill {
  padding: 8px 12px;
}

body.theme-rune.page-special:not(.page-window) .play-panel {
  padding-top: 14px;
}

@media (max-width: 920px) {
  .hero-layout,
  .launch-strip {
    grid-template-columns: 1fr;
  }

  .launch-card-primary {
    grid-column: auto;
  }

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

  .game-shell {
    width: min(760px, calc(100% - 20px));
  }

  .hero-panel,
  .notes-panel,
  .game-card,
  .play-panel,
  .sidebar-panel,
  .controls-panel,
  .stat-panel {
    border-radius: 24px;
  }

  .screen-visor-label,
  .meta-stack-kicker {
    letter-spacing: 0.12em;
  }

  body.page-special .game-shell {
    width: min(100% - 18px, 100%);
  }

  body.page-special .game-header {
    padding: 18px 20px;
  }

  body.page-special .game-layout {
    grid-template-columns: 1fr;
  }

  body.page-special .sidebar-panel {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }

  body.theme-rune.page-special:not(.page-window) .sidebar-panel {
    display: block;
  }

  body.page-special .canvas-wrap {
    width: min(100%, 560px);
  }

  body.page-special canvas,
  body.page-special.special-focus-mode canvas {
    max-height: min(78vh, 860px);
  }

  body.page-special.page-window .game-shell {
    width: min(100% - 10px, 100%);
    padding-top: 6px;
  }

  body.page-special.page-window .cabinet-stack,
  body.page-special.page-window .hud-row,
  body.page-special.page-window .hud-banner {
    width: min(100%, 584px);
    max-width: 584px;
  }
}

@media (max-width: 640px) {
  .hub-shell,
  .game-shell {
    width: min(100% - 16px, 100%);
    padding-top: 16px;
  }

  .hero-panel,
  .notes-panel,
  .game-card,
  .play-panel,
  .sidebar-panel,
  .controls-panel,
  .stat-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-panel h1 {
    font-size: 2.4rem;
  }

  .hero-layout {
    gap: 18px;
  }

  .hero-stat,
  .launch-card,
  .notes-grid article {
    padding: 16px;
    border-radius: 18px;
  }

  .game-header {
    margin-bottom: 16px;
    padding: 20px;
  }

  .game-header h1 {
    margin: 0 0 8px;
    font-size: 2rem;
  }

  .hero-copy {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .quick-links {
    display: none;
  }

  .play-panel {
    gap: 14px;
  }

  .cabinet-stack {
    order: 1;
  }

  .hud-row {
    order: 2;
  }

  .launch-strip {
    order: 3;
    gap: 12px;
  }

  .hud-banner {
    order: 4;
  }

  .canvas-wrap {
    --cabinet-canvas-max-height: min(84vh, 760px);
    --cabinet-canvas-width: 100%;
    padding: 12px 10px 10px;
  }

  .screen-visor {
    margin-bottom: 8px;
    padding: 7px 10px;
  }

  .screen-visor-glow {
    width: 52px;
  }

  .cabinet-console-shell {
    left: 18px;
    right: 18px;
    bottom: 18px;
    gap: 7px;
    padding: 9px 10px 10px;
    border-radius: 18px;
  }

  .cabinet-console-drawer summary {
    padding: 9px 34px 9px 11px;
  }

  .cabinet-console-title {
    font-size: 0.92rem;
  }

  .cabinet-console-body {
    gap: 8px;
    padding: 9px;
    max-height: min(28vh, 180px);
  }

  .cabinet-console-shell .mode-grid,
  .cabinet-console-shell .upgrade-grid {
    grid-template-columns: 1fr;
  }

  .meta-stack {
    padding: 14px 12px 12px;
  }

  .meta-stack-header {
    padding: 10px;
  }

  .deck-controls {
    order: 2;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 0;
    border-radius: 0;
  }

  .sidebar-panel {
    display: grid;
    gap: 14px;
  }

  .deck-controls-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta-stack {
    order: 3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 24px 24px;
  }

  .hud-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deck-controls .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deck-controls .lane-controls,
  .deck-controls .stack-controls {
    flex-direction: column;
  }

  .mode-grid,
  .upgrade-grid {
    grid-template-columns: 1fr;
  }

  .card-footer,
  .quick-launch {
    flex-direction: column;
    align-items: stretch;
  }

  .intel-card {
    border-radius: 18px;
  }

  .intel-card summary {
    padding: 14px 16px;
  }

  .intel-card > *:not(summary) {
    padding: 0 16px 16px;
  }

  button,
  .card-link,
  .back-link,
  .ghost-link,
  .play-link {
    width: 100%;
  }

  .stat-chip {
    width: auto;
    min-width: 0;
  }

  .screen-visor-actions {
    gap: 6px;
  }

  .visor-action {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  body.page-special .game-shell {
    width: min(100% - 12px, 100%);
    padding-top: 12px;
  }

  body.page-special .game-header {
    gap: 12px;
    padding: 16px 18px;
  }

  body.page-special .game-header h1 {
    font-size: 2rem;
  }

  body.page-special .hero-copy {
    font-size: 0.94rem;
    line-height: 1.42;
  }

  body.theme-rune.page-special:not(.page-window) .game-shell {
    padding-top: 8px;
  }

  body.theme-rune.page-special:not(.page-window) .game-header {
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 18px;
  }

  body.theme-rune.page-special:not(.page-window) .game-header .eyebrow,
  body.theme-rune.page-special:not(.page-window) .hero-copy,
  body.theme-rune.page-special:not(.page-window) .launch-strip {
    display: none;
  }

  body.theme-rune.page-special:not(.page-window) .game-header h1 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1;
  }

  body.theme-rune.page-special:not(.page-window) .play-panel {
    gap: 8px;
    padding: 8px;
  }

  body.theme-rune.page-special:not(.page-window) .canvas-wrap {
    padding: 8px 6px 6px;
    border-radius: 20px;
  }

  body.theme-rune.page-special:not(.page-window) .screen-visor {
    margin-bottom: 6px;
    padding: 6px 8px;
  }

  body.page-special .play-panel,
  body.page-special .sidebar-panel {
    padding: 16px;
  }

  body.page-special .hud-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-special .canvas-wrap,
  body.page-special.special-focus-mode .canvas-wrap {
    --cabinet-canvas-max-height: min(84vh, 760px);
    --cabinet-canvas-width: 100%;
    width: 100%;
    padding: 12px 10px 10px;
  }

  body.page-special .screen-visor {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  body.page-special .screen-visor-glow {
    display: none;
  }

  body.page-special.page-window .game-shell {
    width: min(100% - 8px, 100%);
    padding: 6px 0 10px;
  }

  body.page-special.page-window .play-panel {
    gap: 8px;
  }

  body.page-special.page-window .cabinet-stack,
  body.page-special.page-window .hud-row,
  body.page-special.page-window .hud-banner {
    width: 100%;
    max-width: none;
  }

  body.page-special.page-window .canvas-wrap {
    padding: 8px 6px 6px;
  }

  body.theme-rune .canvas-wrap,
  body.theme-rune.page-special .canvas-wrap,
  body.theme-rune.page-special.special-focus-mode .canvas-wrap,
  body.theme-rune.page-special.page-window .canvas-wrap {
    --cabinet-canvas-max-height: min(84vh, 760px);
    --cabinet-canvas-width: 100%;
  }

  body.theme-rune.page-special:not(.page-window) .game-shell {
    width: min(100% - 4px, 100%);
    padding-top: 4px;
  }

  body.theme-rune.page-special:not(.page-window) .play-panel {
    gap: 6px;
    padding: 4px;
  }

  body.theme-rune.page-special:not(.page-window) .canvas-wrap {
    padding: 6px 4px 4px;
    border-radius: 18px;
  }

  body.theme-rune.page-special:not(.page-window) .screen-visor {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 3;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body.theme-rune.page-special:not(.page-window) .screen-visor-label,
  body.theme-rune.page-special:not(.page-window) .screen-visor-glow {
    display: none;
  }

  body.theme-rune.page-special:not(.page-window) .screen-visor-actions {
    gap: 5px;
  }

  body.theme-rune.page-special:not(.page-window) .visor-action {
    min-height: 28px;
    padding: 0 9px;
    font-size: 0.66rem;
    background: rgba(6, 10, 18, 0.78);
    border-color: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
  }
}

/* Runeblade's standalone game window uses a wide website playfield. */
body.theme-rune.page-special.page-window .canvas-wrap {
  --cabinet-canvas-max-height: min(78vh, 720px);
  --cabinet-canvas-width: min(100%, calc(100vw - 48px), 1120px);
}

body.theme-rune.page-special.page-window canvas {
  max-height: var(--cabinet-canvas-max-height);
}

@media (max-width: 640px) {
  body.page-special.page-window .screen-visor {
    margin-bottom: 6px;
    padding: 6px 8px;
  }

  body.page-special.page-window .screen-visor-actions {
    gap: 5px;
  }

  body.page-special.page-window .visor-action {
    min-height: 28px;
    padding: 0 9px;
    font-size: 0.66rem;
  }

  body.page-special.page-window .hud-row {
    grid-template-columns: repeat(4, minmax(78px, 1fr));
    gap: 6px;
  }

  body.page-special.page-window .stat-chip {
    min-width: 0;
    padding: 7px 6px;
    border-radius: 12px;
  }

  body.page-special.page-window .stat-label {
    margin-bottom: 3px;
    font-size: 0.54rem;
  }

  body.page-special.page-window .stat-value {
    font-size: 0.82rem;
  }

  body.page-special.page-window .hud-banner {
    padding: 7px 8px;
    font-size: 0.78rem;
    line-height: 1.34;
  }

  body.theme-rune.page-special.page-window .game-shell {
    width: min(100% - 4px, 100%);
    padding: 4px 0 8px;
  }

  body.theme-rune.page-special.page-window .play-panel {
    gap: 6px;
  }

  body.theme-rune.page-special.page-window .cabinet-stack,
  body.theme-rune.page-special.page-window .hud-row,
  body.theme-rune.page-special.page-window .hud-banner {
    width: 100%;
    max-width: none;
  }

  body.theme-rune.page-special.page-window .canvas-wrap {
    --cabinet-canvas-max-height: min(72vh, 620px);
    --cabinet-canvas-width: min(100%, calc(100vw - 12px));
    width: 100%;
    padding: 6px 4px 5px;
    border-radius: 18px;
  }

  body.theme-rune.page-special.page-window canvas {
    border-radius: 14px;
  }
}

@media (max-width: 920px) {
  body.theme-aether .game-shell {
    width: min(100% - 18px, 100%);
  }

  body.theme-aether .game-layout {
    grid-template-columns: 1fr;
  }

  body.theme-aether .canvas-wrap,
  body.theme-aether.page-special .canvas-wrap,
  body.theme-aether.page-special.special-focus-mode .canvas-wrap,
  body.theme-aether.page-special.page-window .canvas-wrap {
    --cabinet-canvas-max-height: min(72vh, 620px);
    --cabinet-canvas-width: min(100%, 920px);
  }
}

@media (max-width: 640px) {
  body.theme-aether .canvas-wrap,
  body.theme-aether.page-special .canvas-wrap,
  body.theme-aether.page-special.special-focus-mode .canvas-wrap,
  body.theme-aether.page-special.page-window .canvas-wrap {
    --cabinet-canvas-max-height: min(58vh, 360px);
    --cabinet-canvas-width: min(100%, 560px);
  }
}

body.theme-aether.aether-rpg {
  background:
    linear-gradient(135deg, rgba(6, 16, 24, 0.98), rgba(19, 44, 42, 0.96) 34%, rgba(52, 32, 52, 0.96) 68%, rgba(24, 16, 13, 0.98));
}

body.theme-aether.aether-rpg::before {
  opacity: 0.14;
}

body.theme-aether.aether-rpg::after {
  opacity: 0.32;
}

body.theme-aether.aether-rpg .game-shell {
  width: min(1720px, calc(100% - 28px));
  padding-top: 22px;
}

body.theme-aether.aether-rpg .game-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px 24px;
  border-radius: 18px;
}

body.theme-aether.aether-rpg .game-header h1 {
  font-size: clamp(2rem, 2.6vw, 3.15rem);
}

body.theme-aether.aether-rpg .hero-copy {
  margin-bottom: 0;
  max-width: 78ch;
}

body.theme-aether.aether-rpg .quick-links {
  justify-content: flex-end;
}

body.theme-aether.aether-rpg .status-pill {
  border-radius: 8px;
  padding: 9px 12px;
}

body.theme-aether.aether-rpg .game-layout {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  align-items: start;
  gap: 18px;
}

body.theme-aether.aether-rpg .play-panel {
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.theme-aether.aether-rpg .hud-row {
  order: 1;
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  gap: 8px;
}

body.theme-aether.aether-rpg .stat-chip {
  min-height: 54px;
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(5, 10, 18, 0.62);
}

body.theme-aether.aether-rpg .cabinet-stack {
  order: 2;
  margin: 0;
}

body.theme-aether.aether-rpg .cabinet-stack::before,
body.theme-aether.aether-rpg .canvas-wrap::before,
body.theme-aether.aether-rpg .canvas-wrap::after,
body.theme-aether.aether-rpg .screen-visor,
body.theme-aether.aether-rpg .launch-strip {
  display: none;
}

body.theme-aether.aether-rpg .canvas-wrap {
  --cabinet-canvas-width: 100%;
  --cabinet-canvas-max-height: min(78vh, 860px);
  padding: 10px;
  border: 1px solid rgba(147, 255, 241, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    rgba(5, 10, 18, 0.88);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.theme-aether.aether-rpg canvas#game {
  width: 100%;
  max-height: var(--cabinet-canvas-max-height);
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #061018;
}

body.theme-aether.aether-rpg .hud-banner {
  order: 3;
  border-radius: 8px;
  background: rgba(5, 10, 18, 0.62);
}

body.theme-aether.aether-rpg .sidebar-panel {
  border-radius: 14px;
  padding: 18px;
  background: rgba(7, 13, 22, 0.78);
}

body.theme-aether.aether-rpg .sidebar-panel h2 {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
}

body.theme-aether.aether-rpg .objective-card,
body.theme-aether.aether-rpg .intel-card,
body.theme-aether.aether-rpg .focus-note {
  border-radius: 8px;
}

body.theme-aether.aether-rpg .control-list {
  padding-left: 18px;
}

body.theme-aether.aether-rpg .control-list li {
  margin-bottom: 8px;
}

body.theme-aether.aether-rpg.aether-reborn {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(126, 255, 221, 0.11), transparent 42%),
    linear-gradient(180deg, #02070d 0%, #010409 100%);
}

body.theme-aether.aether-rpg.aether-reborn::before {
  opacity: 0.08;
}

body.theme-aether.aether-rpg.aether-reborn::after {
  background: radial-gradient(circle at 50% 40%, rgba(126, 255, 221, 0.08), transparent 44%);
}

body.theme-aether.aether-rpg.aether-reborn .game-shell {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

body.theme-aether.aether-rpg.aether-reborn .game-header,
body.theme-aether.aether-rpg.aether-reborn .hud-row,
body.theme-aether.aether-rpg.aether-reborn .hud-banner,
body.theme-aether.aether-rpg.aether-reborn .sidebar-panel {
  display: none;
}

body.theme-aether.aether-rpg.aether-reborn .game-layout {
  width: 100vw;
  height: 100vh;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  place-items: center;
  overflow: hidden;
}

body.theme-aether.aether-rpg.aether-reborn .play-panel {
  width: 100vw;
  height: 100vh;
  max-width: none;
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  place-items: center;
  overflow: hidden;
}

body.theme-aether.aether-rpg.aether-reborn .cabinet-stack {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

body.theme-aether.aether-rpg.aether-reborn .canvas-wrap {
  --cabinet-canvas-max-height: calc(100vh - 12px);
  width: 100vw;
  height: 100vh;
  padding: 6px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 0;
  background: #010509;
  box-shadow: none;
}

body.theme-aether.aether-rpg.aether-reborn canvas#game {
  width: min(calc(100vw - 12px), calc((100vh - 12px) * 16 / 9));
  height: auto;
  max-height: var(--cabinet-canvas-max-height);
  max-width: calc(100vw - 12px);
  display: block;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(255, 225, 132, 0.24),
    0 24px 72px rgba(0, 0, 0, 0.5),
    0 0 42px rgba(42, 255, 210, 0.12);
}

body.theme-aether.aether-rpg.aether-reborn.page-special.page-window .game-shell,
body.theme-aether.aether-rpg.aether-reborn.page-special.page-window .game-layout,
body.theme-aether.aether-rpg.aether-reborn.page-special.page-window .play-panel,
body.theme-aether.aether-rpg.aether-reborn.page-special.page-window .cabinet-stack,
body.theme-aether.aether-rpg.aether-reborn.page-special.page-window .canvas-wrap {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  overflow: hidden;
}

.company-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(68, 255, 220, 0.16), transparent 42%),
    linear-gradient(180deg, #01070b 0%, #000306 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 680ms ease, visibility 680ms ease;
}

.company-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 5px, 18px 100%;
  mix-blend-mode: screen;
  opacity: 0.18;
  pointer-events: none;
}

.company-splash-frame {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #010509;
  box-shadow:
    0 0 0 1px rgba(255, 225, 132, 0.28),
    0 28px 86px rgba(0, 0, 0, 0.68),
    0 0 52px rgba(42, 255, 210, 0.18);
}

.company-splash-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.company-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .company-splash {
    transition: none;
  }
}

@media (max-width: 720px) {
  body.theme-aether.aether-rpg.aether-reborn .game-shell {
    width: 100vw;
    height: 100vh;
    padding: 0;
  }

  body.theme-aether.aether-rpg.aether-reborn .canvas-wrap {
    --cabinet-canvas-max-height: calc(100vh - 8px);
    padding: 4px;
    border-radius: 12px;
  }

  body.theme-aether.aether-rpg.aether-reborn canvas#game {
    width: min(calc(100vw - 8px), calc((100vh - 8px) * 16 / 9));
  }
}

@media (max-width: 1100px) {
  body.theme-aether.aether-rpg .game-header,
  body.theme-aether.aether-rpg .game-layout {
    grid-template-columns: 1fr;
  }

  body.theme-aether.aether-rpg .quick-links {
    justify-content: flex-start;
  }

  body.theme-aether.aether-rpg .hud-row {
    grid-template-columns: repeat(4, minmax(88px, 1fr));
  }
}

@media (max-width: 720px) {
  body.theme-aether.aether-rpg .game-shell {
    width: min(100% - 14px, 100%);
    padding-top: 12px;
  }

  body.theme-aether.aether-rpg .game-header {
    padding: 16px;
  }

  body.theme-aether.aether-rpg .hud-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.theme-aether.aether-rpg .canvas-wrap {
    --cabinet-canvas-max-height: min(64vh, 420px);
    padding: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
