/* Foundation */

@font-face {
  font-family: "Noto Sans";
  src: url("assets/fonts/noto-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ui-font: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #050706;
  --night: #09110e;
  --moss: #10201a;
  --panel: #14231f;
  --panel-light: #1b302b;
  --paper: #f7edda;
  --muted: #cbbfa9;
  --gold: #e0a84e;
  --amber: #f0d083;
  --teal: #43beb2;
  --crimson: #b94b3f;
  --magenta: #d20d8d;
  --silver: rgba(247, 237, 218, 0.62);
  --time-quick: 180ms;
  --time-soft: 240ms;
  --time-backdrop: 420ms;
  --time-panel: 440ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --edge-muted: rgba(247, 237, 218, 0.18);
  --edge-soft: rgba(247, 237, 218, 0.22);
  --edge-medium: rgba(247, 237, 218, 0.24);
  --edge-strong: rgba(247, 237, 218, 0.34);
  --edge-gold-muted: rgba(240, 208, 131, 0.3);
  --edge-gold: rgba(240, 208, 131, 0.34);
  --edge-teal: rgba(67, 190, 178, 0.34);
  --edge-teal-strong: rgba(67, 190, 178, 0.78);
  --shadow-command-rest: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
  --shadow-command-base: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42));
  --shadow-panel-ambient: 0 18px 48px rgba(0, 0, 0, 0.34);
  --shadow-control-lift: 0 12px 28px rgba(0, 0, 0, 0.24);
  --shadow-inset-soft: inset 0 1px 0 rgba(247, 237, 218, 0.1);
  --line: var(--edge-muted);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  --focus-ring: 0 0 0 3px rgba(240, 208, 131, 0.34);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  --mood-rim: var(--silver);
  --mood-glow: rgba(67, 190, 178, 0.14);
  --mood-wash: rgba(67, 190, 178, 0.09);
  --mood-accent: rgba(240, 208, 131, 0.42);
  --backdrop-image: url("assets/brand/luminous-nights-hero-backdrop.webp");
  --backdrop-position: center;
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(5, 7, 6, 0.52), rgba(5, 7, 6, 0.94)),
    linear-gradient(135deg, #101716 0%, #050706 45%, #170b18 100%);
  color: var(--paper);
  font-family: var(--ui-font);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
video,
iframe {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  transform: translateY(calc(-100% - 20px));
  transition: transform var(--time-quick) ease;
}

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

#main-content:focus {
  outline: 0;
}

button {
  color: inherit;
  font: inherit;
}

:focus-visible {
  outline: 0;
}

:is(a, button):focus-visible {
  box-shadow: var(--focus-ring), 0 0 0 1px rgba(5, 7, 6, 0.84);
}

/* Stage shell */

.stage-backdrop {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(5, 7, 6, 0.96), rgba(5, 7, 6, 0.54), rgba(5, 7, 6, 0.96)),
    var(--backdrop-image) var(--backdrop-position) / cover no-repeat;
  opacity: 0.2;
  filter: saturate(0.95) contrast(1.08);
  transition: opacity var(--time-backdrop) ease, filter var(--time-backdrop) ease;
}

.stage-backdrop::after {
  content: "";
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(circle at 18% 24%, var(--mood-glow), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(224, 168, 78, 0.2), transparent 24%),
    radial-gradient(circle at 62% 86%, rgba(210, 13, 141, 0.18), transparent 28%);
  opacity: 0;
  transform: translate3d(-1%, 1%, 0);
  transition: opacity var(--time-backdrop) ease;
}

body.is-music-on .stage-backdrop {
  opacity: 0.34;
  filter: saturate(1.18) contrast(1.12);
}

body.is-music-on .stage-backdrop::after {
  opacity: 0.72;
  animation: music-drift 16s ease-in-out infinite alternate;
}

body[data-active-screen="world"] {
  --mood-rim: rgba(240, 208, 131, 0.54);
  --mood-glow: rgba(240, 208, 131, 0.24);
  --mood-wash: rgba(224, 168, 78, 0.14);
  --mood-accent: var(--edge-teal);
  --backdrop-image: url("assets/worlds/noor-city-concept-backdrop.webp");
  --backdrop-position: center;
}

body[data-active-screen="the-game"] {
  --mood-rim: rgba(67, 190, 178, 0.58);
  --mood-glow: rgba(67, 190, 178, 0.26);
  --mood-wash: rgba(67, 190, 178, 0.13);
  --mood-accent: rgba(240, 208, 131, 0.44);
  --backdrop-image: url("assets/screenshots/display/screenshot-03-backdrop.webp");
}

body[data-active-screen="characters"],
body[data-active-screen^="character-"] {
  --mood-rim: rgba(210, 13, 141, 0.42);
  --mood-glow: rgba(210, 13, 141, 0.24);
  --mood-wash: rgba(210, 13, 141, 0.1);
  --mood-accent: rgba(67, 190, 178, 0.4);
  --backdrop-image: url("assets/brand/luminous-nights-poster-1600.webp");
}

body[data-active-screen="afreets"] {
  --mood-rim: rgba(185, 75, 63, 0.58);
  --mood-glow: rgba(185, 75, 63, 0.3);
  --mood-wash: rgba(185, 75, 63, 0.13);
  --mood-accent: rgba(240, 208, 131, 0.5);
  --backdrop-image: url("assets/enemies/afreet-emberling.webp");
}

body[data-active-screen="screenshots"] {
  --mood-rim: rgba(247, 237, 218, 0.36);
  --mood-glow: rgba(240, 208, 131, 0.2);
  --mood-wash: rgba(247, 237, 218, 0.08);
  --mood-accent: var(--edge-teal);
  --backdrop-image: url("assets/screenshots/display/screenshot-01-backdrop.webp");
}

body[data-active-screen="info"],
body[data-active-screen="community"] {
  --mood-rim: var(--edge-strong);
  --mood-glow: rgba(67, 190, 178, 0.18);
  --mood-wash: rgba(247, 237, 218, 0.07);
  --mood-accent: rgba(240, 208, 131, 0.36);
}

/* Command navigation */

.site-stage {
  --side-rail: 307px;
  display: grid;
  grid-template-columns: var(--side-rail) minmax(0, 1fr);
  gap: 18px;
  width: calc(100% - 24px);
  max-width: none;
  margin: 28px 12px 24px;
  align-items: start;
  transition: grid-template-columns 280ms ease;
}

/* Widen the side rail when the character submenu is open so shifted links stay clear of the page frame */
body[data-active-screen="characters"] .site-stage,
body[data-active-screen^="character-"] .site-stage {
  --side-rail: 392px;
}

body[data-active-screen="characters"] .site-header::before,
body[data-active-screen^="character-"] .site-header::before {
  inset: 84px -72px -30px -32px;
}

.site-header {
  position: sticky;
  top: 24px;
  z-index: 50;
  isolation: isolate;
  display: grid;
  justify-items: start;
  gap: 18px;
  padding-top: 10px;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 84px -64px -30px -32px;
  z-index: 0;
  border: 1px solid rgba(67, 190, 178, 0.24);
  border-right: 0;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 58%, rgba(5, 7, 6, 0.46) 82%, rgba(5, 7, 6, 0) 100%),
    url("assets/ui/side-pattern.webp") left top / 430px auto repeat-y,
    linear-gradient(90deg, rgba(19, 154, 145, 0.72), rgba(13, 65, 61, 0.84) 48%, rgba(5, 7, 6, 0.12)),
    linear-gradient(180deg, rgba(5, 7, 6, 0.7), rgba(5, 7, 6, 0.52));
  box-shadow:
    inset 0 1px 0 rgba(247, 237, 218, 0.14),
    inset 34px 0 68px rgba(67, 190, 178, 0.22),
    0 24px 46px rgba(0, 0, 0, 0.28);
  mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 94%, transparent 100%);
  opacity: 1;
  pointer-events: none;
}

.site-header::after {
  content: "";
  display: none;
}

.brand-mark {
  position: relative;
  z-index: 1;
  display: block;
  width: 289px;
  justify-self: center;
  margin: 0;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.62));
}

.brand-mark img {
  width: 100%;
  height: auto;
}

.nav-toggle {
  position: relative;
  z-index: 1;
  display: none;
  width: 46px;
  height: 40px;
  justify-self: end;
  border: 1px solid rgba(67, 190, 178, 0.72);
  border-radius: 6px;
  background: rgba(5, 7, 6, 0.68);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 6px auto;
  background: var(--paper);
}

.command-menu {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  width: 307px;
  padding: 0 0 8px;
}

.command-caption {
  width: 307px;
  height: 99px;
  margin: 0 0 -18px;
  overflow: hidden;
  background-image: url("assets/ui/commands-header-main.webp");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: transparent;
  font-size: 1px;
  line-height: 1;
  text-indent: -999px;
}

.site-nav {
  display: grid;
  gap: 0;
  padding-left: 36px;
}

.command-group {
  position: relative;
  display: grid;
  gap: 0;
}

.character-submenu {
  display: grid;
  gap: 0;
  width: 244px;
  /* Past selected Characters (~32px) so the roster reads as a true submenu */
  margin: 2px 0 8px 52px;
  padding: 0;
  overflow: visible;
}

.character-submenu[hidden] {
  display: none;
}

.character-sublink {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 244px;
  min-height: 48px;
  margin-top: -1px;
  padding: 9px 23px 9px 31px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("assets/ui/command-sub-magic-unselected.webp");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: #fff5df;
  font-family: var(--ui-font);
  font-size: 1.01rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
  transition:
    color var(--time-quick) ease,
    filter var(--time-quick) ease,
    transform var(--time-quick) ease;
}

.character-sublink::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -28px;
  width: 24px;
  height: 42px;
  background: url("assets/ui/command-arrow.webp") center / contain no-repeat;
  opacity: 0;
  transform: translate(0, -50%);
  pointer-events: none;
  transition: opacity var(--time-quick) ease;
}

.character-sublink:hover,
.character-sublink:focus-visible {
  background-image: url("assets/ui/command-sub-magic-selected.webp");
  color: #fff;
  filter: drop-shadow(0 10px 18px rgba(240, 208, 131, 0.22)) var(--shadow-command-base);
  transform: translateX(5px) scale(1.01);
}

.character-sublink.is-selected {
  background-image: url("assets/ui/command-sub-magic-selected.webp");
  color: #fff;
  filter: drop-shadow(0 10px 18px rgba(240, 208, 131, 0.22)) var(--shadow-command-base);
  transform: translateX(20px) scale(1.01);
}

.character-sublink.is-selected::before {
  opacity: 1;
  animation: command-arrow-wave 0.65s ease-in-out infinite alternate;
}

.command-link {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 244px;
  min-height: 48px;
  margin-top: -1px;
  padding: 9px 23px 9px 31px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("assets/ui/command-unselected.webp");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: #fff5df;
  font-family: var(--ui-font);
  font-size: 1.01rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
  transition:
    color var(--time-quick) ease,
    filter var(--time-quick) ease,
    transform var(--time-quick) ease;
}

.command-link:focus-visible {
  filter: drop-shadow(0 10px 18px rgba(240, 208, 131, 0.3)) var(--shadow-command-base);
  transform: translateX(5px) scale(1.01);
}

.command-link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -28px;
  width: 24px;
  height: 42px;
  background: url("assets/ui/command-arrow.webp") center / contain no-repeat;
  opacity: 0;
  transform: translate(0, -50%);
  transition: opacity var(--time-quick) ease;
}

.command-link:hover,
.command-link.is-selected {
  background-image: url("assets/ui/command-selected.webp");
  color: #fff;
  filter: drop-shadow(0 10px 18px rgba(240, 208, 131, 0.22)) var(--shadow-command-base);
  transform: translateX(5px) scale(1.01);
}

.command-link.is-selected {
  transform: translateX(32px) scale(1.01);
}

.command-link.is-selected::before {
  opacity: 1;
  animation: command-arrow-wave 0.65s ease-in-out infinite alternate;
}

.command-link.is-confirming {
  animation: command-confirm 360ms var(--ease-standard);
}

.site-header.is-command-focus .command-link.is-selected {
  box-shadow:
    inset 0 1px 0 rgba(247, 237, 218, 0.2),
    0 0 0 2px rgba(240, 208, 131, 0.28),
    0 14px 28px rgba(0, 0, 0, 0.34);
}

.header-actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  width: 210px;
  justify-self: center;
  margin: 0;
}

.header-cta,
.button,
.community-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 6px;
  font-weight: 900;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-align: center;
  text-transform: uppercase;
  transition:
    border-color var(--time-quick) ease,
    background var(--time-quick) ease,
    box-shadow var(--time-quick) ease,
    color var(--time-quick) ease,
    transform var(--time-quick) ease;
}

.platform-icon {
  display: block;
  width: 1.35em;
  height: 1.35em;
  flex-shrink: 0;
  object-fit: contain;
  pointer-events: none;
}

.header-cta::before,
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 0 28%, rgba(255, 248, 220, 0.44) 47%, transparent 66% 100%);
  opacity: 0;
  transform: translateX(-115%);
  transition:
    opacity var(--time-soft) ease,
    transform 520ms var(--ease-standard);
  pointer-events: none;
}

.header-cta:hover::before,
.header-cta:focus-visible::before,
.button:hover::before,
.button:focus-visible::before {
  opacity: 0.75;
  transform: translateX(115%);
}

.header-cta {
  width: 100%;
  padding: 0 12px;
  border: 1px solid rgba(247, 237, 218, 0.28);
  background: #1b2838;
  color: #fff7ed;
  font-size: 0.72rem;
  box-shadow: 0 14px 28px rgba(27, 40, 56, 0.36);
}

.header-cta-secondary {
  border-color: rgba(247, 237, 218, 0.28);
  background: #05ce78;
  color: #fff7ed;
  box-shadow: 0 14px 28px rgba(5, 206, 120, 0.28);
}

.header-cta-tertiary {
  border-color: var(--amber);
  background: var(--magenta);
  color: #fff7ed;
  box-shadow: 0 12px 24px rgba(210, 13, 141, 0.26);
}

.header-cta.cta-pulse {
  animation: cta-pulse 2.8s ease-in-out infinite;
  transform-origin: center;
}

.button.cta-pulse {
  animation: cta-pulse 2.8s ease-in-out infinite;
  transform-origin: center;
}

/* Screen flow */

.retro-shell {
  position: relative;
  display: grid;
  gap: 18px;
}

.retro-shell,
.screen-stack,
.screen-panel,
.command-frame {
  min-width: 0;
}

.screen-stack {
  position: relative;
  z-index: 60;
  display: grid;
  gap: 18px;
  overflow-x: clip;
}

.screen-panel {
  display: grid;
  gap: 18px;
  opacity: 0;
  pointer-events: none;
  transform-origin: center top;
  transform: translateX(34px) scale(0.992);
  transition:
    opacity 360ms ease,
    transform var(--time-panel) var(--ease-standard),
    filter var(--time-panel) ease;
  filter: blur(2px);
}

.screen-panel[hidden] {
  display: none;
}

.screen-panel.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  filter: blur(0);
}

.screen-panel.is-exiting {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-28px) scale(0.992);
  filter: blur(2.5px);
}

.screen-stack.is-forward .screen-panel {
  transform: translateX(34px) scale(0.992);
}

.screen-stack.is-backward .screen-panel {
  transform: translateX(-34px) scale(0.992);
}

.screen-stack.is-forward .screen-panel.is-active,
.screen-stack.is-backward .screen-panel.is-active {
  transform: translateX(0) scale(1);
}

.screen-panel.is-active,
.screen-panel.is-exiting {
  will-change: opacity, transform, filter;
}

.screen-stack.is-screen-pulsing .screen-panel.is-active .command-frame {
  animation: screen-pulse 620ms var(--ease-standard);
}

.stage-chrome {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 2px;
  color: var(--paper);
}

.stage-control {
  position: relative;
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px 0 23px;
  border: 1px solid rgba(247, 237, 218, 0.22);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(14, 31, 30, 0.84), rgba(4, 8, 9, 0.7)),
    rgba(5, 7, 6, 0.62);
  color: rgba(247, 237, 218, 0.86);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-inset-soft);
  transition:
    border-color var(--time-quick) ease,
    background var(--time-quick) ease,
    color var(--time-quick) ease,
    transform var(--time-quick) ease,
    box-shadow var(--time-quick) ease;
}

.stage-control::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 10px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--silver);
  transform: translateY(-50%);
  transition: border-color var(--time-quick) ease;
}

.stage-control--music {
  padding: 0 12px 0 10px;
}

.stage-control--music::before {
  content: none;
}

.music-waves {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 14px;
  height: 12px;
  flex-shrink: 0;
}

.music-waves span {
  display: block;
  width: 2px;
  height: 40%;
  border-radius: 999px;
  background: rgba(247, 237, 218, 0.55);
  transform-origin: center bottom;
  transition: background var(--time-quick) ease, height 160ms ease;
}

.stage-control--music:hover .music-waves span,
.stage-control--music:focus-visible .music-waves span {
  background: rgba(240, 208, 131, 0.9);
}

.stage-control--music[aria-pressed="true"] .music-waves span {
  background: var(--amber);
  animation: music-wave 0.9s ease-in-out infinite;
}

.stage-control--music[aria-pressed="true"] .music-waves span:nth-child(1) {
  animation-delay: 0s;
}

.stage-control--music[aria-pressed="true"] .music-waves span:nth-child(2) {
  animation-delay: 0.15s;
}

.stage-control--music[aria-pressed="true"] .music-waves span:nth-child(3) {
  animation-delay: 0.3s;
}

.stage-control--music[aria-pressed="true"] .music-waves span:nth-child(4) {
  animation-delay: 0.45s;
}

.stage-control--music[aria-pressed="false"] .music-waves span {
  animation: none;
  height: 35%;
}

.stage-control--music[aria-pressed="false"] .music-waves span:nth-child(1) { height: 28%; }
.stage-control--music[aria-pressed="false"] .music-waves span:nth-child(2) { height: 55%; }
.stage-control--music[aria-pressed="false"] .music-waves span:nth-child(3) { height: 40%; }
.stage-control--music[aria-pressed="false"] .music-waves span:nth-child(4) { height: 22%; }

.stage-control:hover,
.stage-control:focus-visible,
.stage-control[aria-pressed="true"] {
  border-color: rgba(240, 208, 131, 0.78);
  background:
    linear-gradient(180deg, rgba(20, 70, 68, 0.92), rgba(6, 19, 19, 0.82)),
    rgba(5, 7, 6, 0.72);
  color: #fff7e7;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(247, 237, 218, 0.16),
    0 12px 28px rgba(0, 0, 0, 0.24);
}

.stage-control:hover::before,
.stage-control:focus-visible::before,
.stage-control[aria-pressed="true"]::before {
  border-left-color: var(--amber);
}

/* Framed content */

.command-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--mood-rim);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 17, 16, 0.94), rgba(12, 27, 33, 0.78) 42%, rgba(3, 8, 8, 0.95)),
    radial-gradient(circle at 18% 18%, var(--mood-glow), transparent 34%),
    rgba(5, 7, 6, 0.86);
  box-shadow:
    var(--shadow),
    0 0 34px color-mix(in srgb, var(--mood-glow) 44%, transparent),
    inset 0 0 0 1px rgba(5, 7, 6, 0.78);
}

.command-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--mood-wash), transparent 34%),
    linear-gradient(90deg, transparent 0%, rgba(240, 208, 131, 0.08) 48%, transparent 78%);
  opacity: 0.72;
}

.command-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--mood-accent), transparent 26%, transparent 72%, rgba(67, 190, 178, 0.32)),
    linear-gradient(180deg, var(--edge-muted), transparent 24%, transparent 78%, rgba(240, 208, 131, 0.12));
  opacity: 0.58;
  mix-blend-mode: screen;
}

body.is-music-on .command-frame::before {
  opacity: 0.95;
  background:
    linear-gradient(180deg, rgba(67, 190, 178, 0.14), transparent 32%),
    linear-gradient(90deg, transparent 0%, rgba(240, 208, 131, 0.14) 45%, rgba(210, 13, 141, 0.1) 78%, transparent 100%);
}

/* Content sections */

.hero-inner,
.section-inner,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 54px), var(--max));
  margin-inline: auto;
}

.gameplay > .section-inner {
  width: calc(100% - 32px);
  max-width: none;
}

.hero {
  display: grid;
  min-height: 0;
  isolation: isolate;
}

.hero-media,
.hero-inner {
  grid-area: 1 / 1;
}

.hero-media {
  position: relative;
  z-index: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.hero-backdrop {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-inner {
  display: flex;
  z-index: 1;
  width: calc(100% - 54px);
  max-width: none;
  min-height: 0;
  align-items: end;
  padding: 42px 0;
}

.hero-copy {
  position: relative;
  isolation: isolate;
  width: min(100%, clamp(560px, 48vw, 900px));
  padding: clamp(14px, 1.8vw, 24px) clamp(16px, 2vw, 28px);
  border-radius: 28px;
}

.hero-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -6% -4% -10% -4%;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.62);
  box-shadow: 0 0 0px 0px rgba(0, 0, 0, 0.55);
  filter: blur(16px);
  pointer-events: none;
}

.hero-lede {
  margin: 0;
  color: #fff5df;
  font-size: clamp(1rem, 0.82rem + 0.55vw, 1.38rem);
  line-height: 1.35;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.85),
    0 12px 28px rgba(0, 0, 0, 0.72);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 1vw, 16px);
  align-items: center;
  margin-top: clamp(24px, 2vw, 32px);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

.hero-actions .button {
  min-width: clamp(176px, 12vw, 230px);
  min-height: clamp(38px, 2.6vw, 48px);
  font-size: clamp(0.85rem, 0.72rem + 0.28vw, 0.98rem);
}

.button {
  min-width: 176px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-size: 0.85rem;
}

.button-primary {
  border-color: rgba(247, 237, 218, 0.28);
  background: #1b2838;
  color: #fff7ed;
  box-shadow:
    var(--shadow-inset-soft),
    0 18px 42px rgba(27, 40, 56, 0.36);
}

.button-secondary {
  border-color: rgba(247, 237, 218, 0.28);
  background: #05ce78;
  color: #fff7ed;
  box-shadow:
    var(--shadow-inset-soft),
    0 16px 34px rgba(5, 206, 120, 0.28);
}

.button-tertiary {
  min-width: 142px;
  border-color: var(--amber);
  background: var(--magenta);
  color: #fff7ed;
  box-shadow:
    var(--shadow-inset-soft),
    0 14px 30px rgba(210, 13, 141, 0.24);
}

.button:hover,
.header-cta:hover,
.community-links a:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 18px 38px rgba(0, 0, 0, 0.32),
    0 0 30px rgba(240, 208, 131, 0.16);
}

.header-actions .header-cta:hover,
.header-actions .header-cta:focus-visible,
.hero-actions .button:hover,
.hero-actions .button:focus-visible {
  transform: translateY(-2px) scale(1.1);
  z-index: 2;
}

.header-cta.cta-pulse:hover,
.header-cta.cta-pulse:focus-visible,
.button.cta-pulse:hover,
.button.cta-pulse:focus-visible {
  animation: none;
  transform: translateY(-2px) scale(1.1);
}

.info-grid div {
  padding: 14px;
  background: rgba(5, 7, 6, 0.58);
}

.info-grid dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.info-grid dd {
  margin: 3px 0 0;
  color: var(--paper);
  font-weight: 900;
}

.section {
  padding: 40px 0;
  scroll-margin-top: 32px;
}

.press-showcase {
  position: relative;
  padding: 32px 0 36px;
  background:
    linear-gradient(135deg, rgba(67, 190, 178, 0.07), transparent 38%),
    rgba(5, 7, 6, 0.92);
}

.press-showcase__inner {
  display: grid;
  gap: 22px;
}

.press-showcase__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.press-showcase__heading h2 {
  margin: 0;
  color: #ffe05f;
  font-size: clamp(1.45rem, 2.5vw, 2.35rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.press-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(240, 208, 131, 0.42);
  border-radius: 8px;
  background: rgba(240, 208, 131, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 223, 0.08),
    0 22px 54px rgba(0, 0, 0, 0.38);
}

.press-quote {
  display: grid;
  grid-template-rows: minmax(66px, auto) 32px;
  place-items: center;
  gap: 6px;
  min-width: 0;
  padding: 14px clamp(10px, 1.1vw, 16px);
  background:
    radial-gradient(circle at 50% 18%, rgba(224, 168, 78, 0.07), transparent 40%),
    rgba(3, 5, 4, 0.96);
}

.press-quote blockquote {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  margin: 0;
  padding: 6px 20px;
}

.press-quote blockquote::before,
.press-quote blockquote::after {
  position: absolute;
  color: #fff4d2;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 14px rgba(224, 168, 78, 0.72);
}

.press-quote blockquote::before {
  content: "\201C";
  left: 0;
  top: 0;
}

.press-quote blockquote::after {
  content: "\201D";
  right: 0;
  bottom: -4px;
}

.press-quote blockquote p {
  margin: 0;
  max-width: 360px;
  color: #fff7e7;
  font-size: clamp(0.78rem, 0.85vw, 0.9rem);
  font-weight: 900;
  line-height: 1.26;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 12px rgba(224, 168, 78, 0.28);
}

.press-source {
  display: grid;
  place-items: center;
  width: min(180px, 84%);
  min-height: 32px;
  padding: 2px 7px;
  border-radius: 6px;
  transition:
    background var(--time-quick) ease,
    box-shadow var(--time-quick) ease,
    transform var(--time-quick) ease;
}

.press-source:hover,
.press-source:focus-visible {
  background: rgba(247, 237, 218, 0.06);
  box-shadow: 0 0 24px rgba(240, 208, 131, 0.12);
  transform: translateY(-1px);
}

.press-source img {
  width: auto;
  max-width: 100%;
  height: 23px;
  object-fit: contain;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(220px, 0.45fr);
  gap: 26px;
  align-items: end;
  margin-bottom: 26px;
}

.section-heading h2,
.story-copy h2,
.world-heading h2,
.community-panel h2,
.character-profile-panel h2 {
  margin: 0;
  color: #ffe05f;
  font-family: var(--ui-font);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.02;
  text-transform: uppercase;
}

.section-heading h2,
.story-copy h2,
.world-heading h2,
.community-panel h2 {
  font-size: clamp(1.55rem, 3.2vw, 3.4rem);
}

.section-heading p:not(.eyebrow),
.story-copy p,
.feature-copy p,
.feature-cards p,
.community-panel p,
.character-profile-panel > p {
  margin: 0;
  color: var(--muted);
}

.compact-heading {
  display: block;
  max-width: 860px;
}

.section-subtitle {
  margin: 8px 0 0;
  color: var(--paper);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.92fr);
  grid-template-areas: "media copy";
  gap: clamp(20px, 2.4vw, 42px);
  align-items: center;
  padding: clamp(22px, 2.6vw, 40px) 0;
  border-top: 1px solid rgba(247, 237, 218, 0.14);
}

.showcase-video {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0 0 30px;
  border: 1px solid var(--edge-gold);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.showcase-video iframe,
.showcase-video__player,
.showcase-video__facade,
.showcase-video__poster {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.showcase-video iframe,
.showcase-video__player {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.showcase-video__facade {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  border: 0;
  cursor: pointer;
  color: inherit;
}

.showcase-video__facade[hidden],
.showcase-video.is-playing .showcase-video__facade {
  display: none !important;
}

.showcase-video__poster {
  object-fit: cover;
}

.showcase-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(240, 208, 131, 0.96), rgba(224, 168, 78, 0.92));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, -50%);
  transition:
    transform var(--time-quick) ease,
    box-shadow var(--time-quick) ease;
}

.showcase-video__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 52%;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #050706;
  transform: translate(-40%, -50%);
}

.showcase-video__facade:hover .showcase-video__play,
.showcase-video__facade:focus-visible .showcase-video__play {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.48);
}

.showcase-video.is-playing .trailer-mode-status {
  display: none;
}

.trailer-mode-status {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 3;
  padding: 6px 10px;
  border: 1px solid rgba(240, 208, 131, 0.44);
  border-radius: 6px;
  background: rgba(5, 7, 6, 0.72);
  color: var(--paper);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.feature-row:last-child {
  border-bottom: 1px solid rgba(247, 237, 218, 0.14);
}

.feature-row-flipped {
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.08fr);
  grid-template-areas: "copy media";
}

.feature-row .feature-media {
  grid-area: media;
}

.feature-row .feature-copy {
  grid-area: copy;
  display: grid;
  align-content: center;
  gap: clamp(12px, 1.2vw, 18px);
  max-width: min(100%, 40rem);
}

.feature-row-flipped .feature-copy {
  justify-self: end;
}

.feature-media,
.story-art,
.gallery-feature {
  position: relative;
  border: 1px solid rgba(247, 237, 218, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(247, 237, 218, 0.08),
    var(--shadow-panel-ambient);
  transition:
    border-color var(--time-quick) ease,
    box-shadow var(--time-quick) ease,
    transform var(--time-quick) ease;
}

.feature-media img,
.feature-media video,
.story-art img,
.gallery-feature img,
.feature-cards img,
.gallery-strip img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition:
    filter var(--time-soft) ease,
    transform var(--time-backdrop) var(--ease-standard);
}

.feature-media:hover,
.story-art:hover,
.gallery-feature:hover {
  border-color: rgba(240, 208, 131, 0.42);
  box-shadow:
    var(--shadow-inset-soft),
    0 22px 54px rgba(0, 0, 0, 0.4),
    0 0 32px rgba(67, 190, 178, 0.12);
  transform: translateY(-1px);
}

.feature-media:hover img,
.feature-media:hover video,
.story-art:hover img,
.gallery-feature:hover img {
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.015);
}

.feature-copy h3,
.feature-cards h3 {
  margin: 0;
  color: #fff5df;
  font-size: clamp(1.2rem, 0.95rem + 1.05vw, 2.05rem);
  line-height: 1.15;
}

.feature-copy p {
  margin: 0;
  font-size: clamp(0.9rem, 0.82rem + 0.32vw, 1.1rem);
  line-height: 1.55;
}

.feature-copy p + p {
  margin-top: 0;
}

.world-hero {
  min-height: auto;
  padding: 24px 0;
}

.world-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  width: calc(100% - 32px);
  max-width: none;
}

.world-heading {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(247, 237, 218, 0.16);
}

.world-intro {
  max-width: none;
  margin: 0;
  color: #fff5df;
  font-size: clamp(1rem, 0.82rem + 0.55vw, 1.38rem);
  line-height: 1.35;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.66);
}

.world-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1800 / 1177;
  margin: 0;
}

.world-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.world-image figcaption {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  max-width: min(430px, calc(100% - 36px));
  padding: 12px 14px;
  border: 1px solid var(--edge-muted);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.72);
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

.world-copy {
  width: 100%;
}

.world-copy p {
  color: #fff5df;
  font-size: clamp(1rem, 0.82rem + 0.55vw, 1.38rem);
  font-weight: 400;
  line-height: 1.35;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.66);
}

.world-story {
  display: grid;
  gap: 14px;
}

.world-copy p.world-alert {
  color: #ffe05f;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.story-copy p + p {
  margin-top: 18px;
}

.world-copy p + p {
  margin-top: 0;
}

/* =============================================================================
   CHARACTERS — LINEUP PAGE (#characters / poster stage)
   Edit position/scale here for the group poster view.
   Class pattern: .character-lineup-figure--{name}
   Properties: left/right/top/bottom = position | width/height = scale | z-index = layer

   Faris (and others) also have responsive overrides later in this file:
   1) Desktop defaults  → this section
   2) Tablet ≤1100px    → search "LINEUP PAGE — tablet"
   3) Mobile ≤920px     → search "LINEUP PAGE — mobile"

   Character SUBPAGES (#character-faris, etc.) use .character-profile-* below.
   They do NOT use .character-lineup-figure--* classes.
   ============================================================================= */

.characters.section {
  padding: 0;
}

.characters.command-frame {
  overflow: hidden;
}

.characters-lineup-inner {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
}

/* LINEUP PAGE — stage shell (desktop) */
.character-lineup {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  /* Track content width so live + editor stay the same ~16:9 stage. */
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: min(82vh, 780px);
  min-height: 0;
  padding: 12px 0 0;
  border: 0;
  border-radius: 0;
  background: none;
  overflow: hidden;
}

.character-lineup::before {
  content: none;
}

.character-lineup-name {
  position: relative;
  z-index: 8;
  margin: 0;
  min-height: 1.1em;
  color: var(--amber);
  font-size: clamp(1.8rem, 4.4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 0 6px rgba(0, 0, 0, 0.95),
    0 0 12px rgba(0, 0, 0, 0.9),
    0 0 22px rgba(0, 0, 0, 0.8),
    0 0 36px rgba(0, 0, 0, 0.7),
    0 0 52px rgba(0, 0, 0, 0.55);
  filter: drop-shadow(0 0 14px rgba(0, 0, 0, 0.85));
  pointer-events: none;
  transition: opacity var(--time-quick) ease, transform var(--time-quick) ease;
}

.character-lineup-stage--poster {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 0;
  height: 100%;
  width: 100%;
  margin-inline: 0;
  overflow: hidden;
  cursor: default;
  touch-action: manipulation;
}

/* Desktop only — inset so drop-shadows aren't clipped by the frame. */
@media (min-width: 1101px) {
  .character-lineup-stage--poster {
    width: calc(100% - 56px);
    margin-inline: 28px;
    overflow: visible;
  }
}

.character-lineup-stage--poster.is-over-character {
  cursor: pointer;
}

/* LINEUP PAGE — shared figure defaults (desktop) */
.character-lineup-figure {
  position: absolute;
  display: grid;
  place-items: end center;
  margin: 0;
  opacity: 1;
  filter: saturate(0.92) brightness(0.9);
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: none;
  transition:
    opacity var(--time-soft) ease,
    filter var(--time-soft) ease,
    transform var(--time-soft) var(--ease-standard);
  z-index: 1;
}

.character-lineup-figure img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 22px 24px rgba(0, 0, 0, 0.55));
  pointer-events: none;
  user-select: none;
}

/* LINEUP PAGE — per-character position/scale (desktop)
   From character editor. */

/* LINEUP · Masked King */
.character-lineup-figure--masked-king {
  left: 0%;
  right: auto;
  top: -7.5%;
  bottom: auto;
  width: 93.5%;
  height: 125.5%;
  z-index: 1;
}

.character-lineup-figure--masked-king img {
  object-position: 28% 8%;
}

/* LINEUP · Jasim */
.character-lineup-figure--jasim {
  left: 17.5%;
  right: auto;
  bottom: 12%;
  top: auto;
  width: 27%;
  height: 64%;
  z-index: 4;
}

.character-lineup-figure--jasim img {
  object-position: 50% 100%;
}

/* LINEUP · Basim */
.character-lineup-figure--basim {
  left: 2.5%;
  right: auto;
  bottom: 0.5%;
  top: auto;
  width: 23%;
  height: 57.5%;
  z-index: 3;
}

.character-lineup-figure--basim img {
  object-position: 50% 100%;
}

/* LINEUP · Faris */
.character-lineup-figure--faris {
  left: calc(50% - 24.8%);
  right: auto;
  bottom: 8.5%;
  top: auto;
  width: 49.5%;
  height: 91%;
  z-index: 9;
  place-items: center;
  transform-origin: center center;
}

.character-lineup-figure--faris img {
  object-position: 37% 41%;
}

/* LINEUP · Sahar */
.character-lineup-figure--sahar {
  left: calc(50% + 4.5%);
  right: auto;
  top: -15.5%;
  bottom: auto;
  width: 25%;
  height: 72.5%;
  z-index: 7;
  place-items: center;
  transform-origin: center center;
}

.character-lineup-figure--sahar img {
  object-position: 50% 50%;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45));
}

/* LINEUP · Shifa */
.character-lineup-figure--shifa {
  left: 58.5%;
  right: auto;
  bottom: 0%;
  top: auto;
  width: 30%;
  height: 76%;
  z-index: 5;
}

.character-lineup-figure--shifa img {
  object-position: 50% 100%;
}

/* LINEUP · Hakeem */
.character-lineup-figure--hakeem {
  right: -1.5%;
  left: auto;
  bottom: 0%;
  top: auto;
  width: 27%;
  height: 66%;
  z-index: 2;
}

.character-lineup-figure--hakeem img {
  object-position: 100% 100%;
}

/* LINEUP PAGE — hover/selection states */
.character-lineup.is-selecting .character-lineup-figure:not(.is-focused) {
  opacity: 0.34;
  filter: saturate(0.45) brightness(0.55);
}

.character-lineup-figure.is-focused {
  /* Keep natural z-order so large figures (Masked King) don't trap hits. */
  opacity: 1;
  filter: saturate(1.05) brightness(1.05);
  transform: translate3d(0, -8px, 0) scale(1.06);
  transform-origin: center center;
}

.character-lineup:not(.is-selecting) .character-lineup-figure--faris {
  filter: saturate(1) brightness(1);
}

.character-lineup-hint {
  position: relative;
  z-index: 8;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

/* =============================================================================
   CHARACTERS — PROFILE SUBPAGES (#character-faris, #character-sahar, etc.)
   Shared layout for every individual character page.
   Do NOT confuse with .character-lineup-figure--* (those are lineup-only).
   ============================================================================= */

.character-profile {
  min-height: 0;
  width: 100%;
  /* Override .section padding so art can bleed to the frame edge. */
  padding: 0;
}

.character-profile.command-frame::before,
.character-profile.command-frame::after {
  /* Keep overlays from washing out / hiding large desktop art. */
  z-index: 0;
  mix-blend-mode: normal;
  opacity: 0.35;
}

.character-profile-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 0;
  align-items: stretch;
  width: 100%;
  min-height: min(62vh, 640px);
  padding: 0;
  overflow: hidden;
}

.character-profile-art {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.character-profile-art img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: center bottom;
  filter: drop-shadow(0 28px 30px rgba(0, 0, 0, 0.58));
}

/* Keep each portrait centered in the left column; scale only when needed. */
#character-faris .character-profile-art img,
#character-basim-jasim .character-profile-art img,
#character-shifa .character-profile-art img,
#character-hakeem .character-profile-art img {
  object-position: center bottom;
  transform: none;
}

#character-sahar .character-profile-art img {
  object-position: center bottom;
  transform: translate(0%, 20.5%) scale(1.2);
  transform-origin: center bottom;
}

#character-masked-king .character-profile-art img,
.character-profile--wide .character-profile-art img {
  object-position: center center;
  transform: none;
  transform-origin: center bottom;
}

.character-profile-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-self: center;
  justify-self: stretch;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: clamp(18px, 3.2vh, 36px) 0;
  padding: 0 clamp(28px, 4.5vw, 56px) 0 clamp(12px, 2vw, 24px);
  gap: clamp(12px, 1.6vw, 18px);
  border: 0;
  background: none;
  box-shadow: none;
}

.character-profile-panel h2 {
  margin: 0;
  padding-bottom: clamp(8px, 1.2vw, 12px);
  border-bottom: 1px solid rgba(247, 237, 218, 0.55);
  color: var(--amber);
  font-size: clamp(1.7rem, 2.8vw + 0.6rem, 3.15rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 0.95;
  text-transform: uppercase;
}

.character-profile-panel > p {
  margin: 0;
  max-width: none;
  width: 100%;
  color: var(--paper);
  font-size: clamp(0.92rem, 0.55vw + 0.78rem, 1.12rem);
  font-weight: 700;
  line-height: 1.5;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.character-profile-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  align-self: flex-start;
  box-sizing: border-box;
  width: min(100%, 220px);
  min-height: 46px;
  margin-top: clamp(4px, 0.8vw, 10px);
  padding: 10px 42px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("assets/ui/choice-unselected.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  color: #fff5df;
  font-family: var(--ui-font);
  font-size: clamp(0.82rem, 0.35vw + 0.72rem, 0.95rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
  transition:
    color var(--time-quick) ease,
    filter var(--time-quick) ease,
    transform var(--time-quick) ease;
}

.character-profile-back-icon {
  font-size: 1.15em;
  line-height: 1;
  transform: translateY(-0.04em);
}

.character-profile-back:hover,
.character-profile-back:focus-visible {
  background-image: url("assets/ui/choice-selected.webp");
  color: #fff;
  filter: drop-shadow(0 10px 18px rgba(240, 208, 131, 0.22)) var(--shadow-command-base);
  transform: translateY(-1px) scale(1.01);
  outline: none;
}

/* Monsters */

.monsters.command-frame {
  padding: 0;
  overflow: hidden;
}

.monsters-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  min-height: min(68vh, 720px);
  padding: 36px 28px 28px 40px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 18%, rgba(185, 75, 63, 0.16), transparent 58%),
    radial-gradient(circle at 18% 22%, rgba(240, 208, 131, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(5, 7, 6, 0.2), rgba(5, 7, 6, 0.55));
}

.monsters-intro {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 28px 32px;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(247, 237, 218, 0.28);
}

.monsters-emblem {
  width: min(220px, 100%);
  height: auto;
  justify-self: center;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55));
}

.monsters-copy {
  min-width: 0;
  width: 100%;
  padding-top: 4px;
  padding-right: 8px;
}

.monsters-copy h2 {
  margin: 0;
  color: #ffe05f;
  font-family: var(--ui-font);
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 0.95;
  text-transform: uppercase;
}

.monsters-copy-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(247, 237, 218, 0.28);
  width: 100%;
  max-width: none;
}

.monsters-copy-body p {
  margin: 0;
  color: var(--paper);
  font-size: clamp(0.98rem, 1.35vw, 1.12rem);
  font-weight: 700;
  line-height: 1.55;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.monsters-copy-body p + p {
  margin-top: 1em;
}

.monsters-roster {
  position: relative;
  min-height: min(48vh, 460px);
  padding: 12px 0 0;
  overflow: visible;
  cursor: default;
}

.monsters-roster.is-over-monster {
  cursor: pointer;
}

.monsters-figure {
  position: absolute;
  display: block;
  margin: 0;
  min-width: 0;
  pointer-events: none;
}

.monsters-figure img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.5));
  transition: transform var(--time-soft) var(--ease-standard), filter var(--time-soft) ease;
  pointer-events: none;
}

.monsters-figure.is-hovered {
  z-index: 9;
}

.monsters-figure.is-hovered img {
  transform: translateY(-6px) scale(1.03);
  filter: drop-shadow(0 28px 30px rgba(0, 0, 0, 0.56)) saturate(1.06);
}

/* MONSTERS · Emberling */
.monsters-figure--emberling {
  left: -6%;
  right: auto;
  bottom: -7.5%;
  top: auto;
  width: 35.5%;
  height: 84.5%;
  z-index: 1;
}

.monsters-figure--emberling img {
  object-position: 50% 100%;
}

/* MONSTERS · Scorcher */
.monsters-figure--scorcher {
  left: 10%;
  right: auto;
  bottom: -4%;
  top: auto;
  width: 42%;
  height: 99%;
  z-index: 3;
}

.monsters-figure--scorcher img {
  object-position: 50% 100%;
}

/* MONSTERS · Cinderwing */
.monsters-figure--cinderwing {
  left: calc(50% - 23.3%);
  right: auto;
  bottom: 21%;
  top: auto;
  width: 44.5%;
  height: 103%;
  z-index: 2;
}

.monsters-figure--cinderwing img {
  object-position: 50% 100%;
}

/* MONSTERS · Blazebelly */
.monsters-figure--blazebelly {
  right: -10%;
  left: auto;
  bottom: -12.5%;
  top: auto;
  width: 64%;
  height: 134%;
  z-index: 4;
}

.monsters-figure--blazebelly img {
  object-position: 50% 100%;
}

.gallery-heading {
  grid-template-columns: minmax(0, 1fr) auto;
}

.text-link {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery {
  display: grid;
  gap: 18px;
}

.gallery-stage {
  display: grid;
  gap: 10px;
}

.gallery-feature {
  margin: 0;
  cursor: zoom-in;
}

.gallery-feature:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}

.gallery-feature img {
  opacity: 1;
}

.gallery-feature.is-transitioning img {
  opacity: 0.72;
  filter: saturate(1.18) contrast(1.08);
  transform: scale(1.012);
}

.gallery-status {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  min-width: 112px;
  padding: 8px 12px;
  border: 1px solid var(--edge-gold);
  border-radius: 6px;
  background: rgba(5, 7, 6, 0.74);
  color: var(--paper);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
}

.gallery-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.gallery-control {
  position: relative;
  min-height: 34px;
  min-width: 88px;
  padding: 7px 16px;
  border: 1px solid rgba(240, 208, 131, 0.3);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(247, 237, 218, 0.08), rgba(5, 7, 6, 0.18)),
    rgba(5, 7, 6, 0.62);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color var(--time-quick) ease,
    box-shadow var(--time-quick) ease,
    transform var(--time-quick) ease;
}

.gallery-control--prev::before,
.gallery-control--next::after {
  color: var(--amber);
}

.gallery-control--prev::before {
  content: "< ";
}

.gallery-control--next::after {
  content: " >";
}

.gallery-control:hover,
.gallery-control:focus-visible {
  border-color: rgba(240, 208, 131, 0.58);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.3),
    0 0 22px rgba(240, 208, 131, 0.16);
  transform: translateY(-1px);
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(13, minmax(88px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 12px;
}

.gallery-strip button {
  min-width: 88px;
  padding: 0;
  border: 1px solid var(--edge-muted);
  border-radius: 5px;
  overflow: hidden;
  background: rgba(247, 237, 218, 0.06);
  cursor: pointer;
  transition:
    border-color var(--time-quick) ease,
    box-shadow var(--time-quick) ease,
    transform var(--time-quick) ease;
}

.gallery-strip button:hover,
.gallery-strip button:focus-visible {
  border-color: rgba(240, 208, 131, 0.62);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.28),
    0 0 22px rgba(240, 208, 131, 0.14);
  transform: translateY(-1px);
}

.gallery-strip button.is-active {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(224, 168, 78, 0.24);
}

.gallery-strip button:hover img,
.gallery-strip button:focus-visible img {
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.035);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--time-soft) ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(67, 190, 178, 0.14), transparent 42%),
    rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
}

.gallery-lightbox__panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(1280px, 100%);
  max-height: calc(100vh - 44px);
  padding: 14px;
  border: 1px solid rgba(240, 208, 131, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(5, 7, 6, 0.72), rgba(5, 7, 6, 0.94)),
    rgba(5, 7, 6, 0.86);
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.72),
    0 0 44px rgba(67, 190, 178, 0.16);
  transform: translateY(12px) scale(0.985);
  transition: transform var(--time-soft) var(--ease-standard);
}

.gallery-lightbox.is-open .gallery-lightbox__panel {
  transform: translateY(0) scale(1);
}

.gallery-lightbox__close {
  justify-self: end;
}

.gallery-lightbox__figure {
  display: grid;
  gap: 10px;
  min-height: 0;
  margin: 0;
}

.gallery-lightbox__image {
  width: 100%;
  max-height: calc(100vh - 188px);
  object-fit: contain;
  border: 1px solid var(--edge-muted);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.46);
}

.gallery-lightbox__caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-lightbox__controls {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.gallery-lightbox__control {
  min-width: 96px;
}

.gallery-lightbox__control,
.gallery-lightbox__close {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid rgba(240, 208, 131, 0.4);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(247, 237, 218, 0.1), rgba(5, 7, 6, 0.2)),
    rgba(5, 7, 6, 0.68);
  color: var(--paper);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color var(--time-quick) ease,
    box-shadow var(--time-quick) ease,
    transform var(--time-quick) ease;
}

.gallery-lightbox__control:hover,
.gallery-lightbox__control:focus-visible,
.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible {
  border-color: var(--amber);
  box-shadow: 0 0 22px rgba(240, 208, 131, 0.16);
  transform: translateY(-1px);
}

body.is-gallery-lightbox-open {
  overflow: hidden;
}

.award-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.award-list article {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 210px;
  padding: 24px;
  border: 1px solid rgba(240, 208, 131, 0.26);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.38);
}

.award-list img {
  width: min(210px, 100%);
  max-height: 150px;
  object-fit: contain;
}

.award-list p {
  margin: 0;
  color: var(--paper);
  font-weight: 900;
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--edge-muted);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(247, 237, 218, 0.12);
}

.product-info-card {
  box-shadow:
    var(--shadow-inset-soft),
    0 18px 44px rgba(0, 0, 0, 0.26);
}

.community-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.community-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.community-links a {
  min-height: 64px;
  padding: 0 22px;
  border: 1px solid rgba(247, 237, 218, 0.4);
  color: #fff7ed;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.community-links .platform-icon {
  width: 26px;
  height: 26px;
}

.community-links a[data-platform="steam"] {
  background: #1b2838;
}

.community-links a[data-platform="kickstarter"] {
  background: #05ce78;
  color: #fff7ed;
}

.community-links a[data-platform="discord"] {
  background: #5865f2;
}

.community-links a[data-platform="youtube"] {
  background: #ff0000;
}

.community-links a[data-platform="twitter"] {
  background: #1da1f2;
}

.community-links a[data-platform="instagram"] {
  background: #c13584;
}

.community-links a[data-platform="press-kit"] {
  border-color: var(--amber);
  background: #a50b64;
}

.info-grid dd,
.community-panel p {
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 42px;
  color: var(--muted);
  font-size: 0.76rem;
}

.site-footer::after {
  content: "MUSIC OFF";
  color: var(--silver);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

body.is-music-on .site-footer::after {
  content: "MUSIC ON";
}

.site-footer a {
  color: var(--amber);
  font-weight: 900;
  text-transform: uppercase;
}

/* Motion and responsive states */

@keyframes music-wave {
  0%,
  100% {
    height: 28%;
  }

  35% {
    height: 100%;
  }

  65% {
    height: 45%;
  }
}

@keyframes music-drift {
  from {
    transform: translate3d(-1%, 1%, 0) scale(1);
  }

  to {
    transform: translate3d(1.5%, -1.5%, 0) scale(1.03);
  }
}

@keyframes cta-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.045);
  }
}

@keyframes screen-pulse {
  0%,
  100% {
    box-shadow: var(--shadow), inset 0 0 0 1px rgba(5, 7, 6, 0.78);
    filter: saturate(1);
  }

  42% {
    box-shadow:
      var(--shadow),
      inset 0 0 0 1px rgba(240, 208, 131, 0.74),
      0 0 0 2px rgba(67, 190, 178, 0.18),
      0 0 44px rgba(67, 190, 178, 0.22);
    filter: saturate(1.08);
  }
}

@keyframes command-arrow-wave {
  from {
    transform: translate(-5px, -50%);
  }

  to {
    transform: translate(7px, -50%);
  }
}

@keyframes command-confirm {
  0%,
  100% {
    filter: drop-shadow(0 10px 18px rgba(240, 208, 131, 0.22)) var(--shadow-command-base);
  }

  45% {
    filter:
      drop-shadow(0 0 10px rgba(240, 208, 131, 0.52))
      drop-shadow(0 12px 20px rgba(67, 190, 178, 0.24))
      var(--shadow-command-base);
  }
}

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

  .header-cta.cta-pulse,
  .button.cta-pulse {
    animation: none;
  }

  .command-link.is-confirming {
    animation: none;
  }

  .site-stage {
    transition: none;
  }

  .command-link.is-selected::before {
    animation: none;
    transform: translate(0, -50%);
  }

  .character-sublink.is-selected::before {
    animation: none;
    transform: translate(0, -50%);
  }

  .screen-panel,
  .character-lineup-figure,
  .character-profile-art img,
  .feature-media img,
  .feature-media video,
  .story-art img,
  .gallery-feature.is-transitioning img,
  .gallery-feature img,
  .gallery-strip img,
  .gallery-lightbox,
  .gallery-lightbox__panel,
  .stage-backdrop,
  .stage-backdrop::after {
    animation: none;
    transition-duration: 1ms;
    transform: none;
    filter: none;
  }

  body.is-music-on .stage-backdrop::after {
    animation: none;
  }

  .stage-control--music[aria-pressed="true"] .music-waves span {
    animation: none;
    height: 55%;
  }

  .stage-control--music[aria-pressed="true"] .music-waves span:nth-child(1) { height: 35%; }
  .stage-control--music[aria-pressed="true"] .music-waves span:nth-child(2) { height: 70%; }
  .stage-control--music[aria-pressed="true"] .music-waves span:nth-child(3) { height: 50%; }
  .stage-control--music[aria-pressed="true"] .music-waves span:nth-child(4) { height: 40%; }

  .screen-stack.is-screen-pulsing .screen-panel.is-active .command-frame,
  .command-menu,
  .header-actions {
    animation: none;
    transition-duration: 1ms;
  }
}

@media (max-width: 1100px) {
  .site-stage {
    grid-template-columns: var(--side-rail) minmax(0, 1fr);
    gap: 18px;
  }

  body[data-active-screen="characters"] .site-stage,
  body[data-active-screen^="character-"] .site-stage {
    --side-rail: 360px;
  }

  .brand-mark {
    width: 244px;
  }

  .site-header::before {
    inset: 84px -56px -30px -32px;
  }

  body[data-active-screen="characters"] .site-header::before,
  body[data-active-screen^="character-"] .site-header::before {
    inset: 84px -64px -30px -32px;
  }

  /* LINEUP PAGE — tablet overrides (≤1100px)
     From character editor. Profile layout rules follow below. */
  .character-lineup {
    aspect-ratio: auto;
    height: min(62vh, 620px);
    max-height: none;
    min-height: 440px;
    padding: 8px 0 0;
  }

  .character-lineup-stage--poster {
    width: 100%;
    margin-inline: 0;
    overflow: hidden;
  }

  /* LINEUP · Masked King (tablet) */
  .character-lineup-figure--masked-king {
    left: 0%;
    right: auto;
    bottom: -26.5%;
    top: auto;
    width: 98.5%;
    height: 125.5%;
    z-index: 1;
  }

  /* LINEUP · Jasim (tablet) */
  .character-lineup-figure--jasim {
    left: 13%;
    right: auto;
    bottom: 9.5%;
    top: auto;
    width: 28%;
    height: 60%;
    z-index: 4;
  }

  /* LINEUP · Basim (tablet) */
  .character-lineup-figure--basim {
    left: 0%;
    right: auto;
    bottom: 1.5%;
    top: auto;
    width: 24%;
    height: 54.5%;
    z-index: 3;
  }

  /* LINEUP · Faris (tablet) */
  .character-lineup-figure--faris {
    left: calc(50% - 28.3%);
    right: auto;
    bottom: -15.5%;
    top: auto;
    width: 56.5%;
    height: 117%;
    z-index: 6;
  }

  .character-lineup-figure--faris img {
    object-position: 50% 50%;
  }

  /* LINEUP · Sahar (tablet) */
  .character-lineup-figure--sahar {
    left: calc(50% + 1.5%);
    right: auto;
    top: -7%;
    bottom: auto;
    width: 33%;
    height: 63%;
    z-index: 7;
  }

  /* LINEUP · Shifa (tablet) */
  .character-lineup-figure--shifa {
    left: 58.5%;
    right: auto;
    bottom: -6%;
    top: auto;
    width: 38%;
    height: 86%;
    z-index: 5;
  }

  /* LINEUP · Hakeem (tablet) */
  .character-lineup-figure--hakeem {
    right: -5%;
    left: auto;
    bottom: -2%;
    top: auto;
    width: 32.5%;
    height: 71%;
    z-index: 2;
  }

  /* PROFILE SUBPAGES — tablet */
  .character-profile-layout {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 0;
  }

  .character-profile-art {
    min-height: min(48vh, 420px);
    height: min(48vh, 420px);
  }

  .character-profile-art img {
    object-position: center bottom;
  }

  #character-sahar .character-profile-art img {
    object-position: center bottom;
    transform: translate(0%, 31%) scale(1.3);
    transform-origin: center bottom;
  }

  #character-masked-king .character-profile-art img,
  .character-profile--wide .character-profile-art img {
    object-position: center center;
    transform: none;
    transform-origin: center bottom;
  }

  .character-profile-panel {
    width: auto;
    max-width: none;
    margin: 16px 0;
    padding: 0 16px;
  }

  .character-profile-back {
    width: min(100%, 200px);
    min-height: 42px;
    padding: 9px 36px;
  }

  /* MONSTERS PAGE — tablet (≤1100px) */
  .monsters-figure--emberling {
    left: -9.5%;
    right: auto;
    bottom: -6%;
    top: auto;
    width: 40%;
    height: 68%;
    z-index: 1;
  }

  .monsters-figure--emberling img {
    object-position: 50% 100%;
  }

  .monsters-figure--scorcher {
    left: 8%;
    right: auto;
    bottom: -5%;
    top: auto;
    width: 50%;
    height: 104%;
    z-index: 3;
  }

  .monsters-figure--scorcher img {
    object-position: 50% 100%;
  }

  .monsters-figure--cinderwing {
    left: calc(50% - 23%);
    right: auto;
    bottom: 47.5%;
    top: auto;
    width: 44%;
    height: 101%;
    z-index: 2;
  }

  .monsters-figure--cinderwing img {
    object-position: 50% 100%;
  }

  .monsters-figure--blazebelly {
    right: -6.5%;
    left: auto;
    bottom: -5.5%;
    top: auto;
    width: 62.5%;
    height: 117%;
    z-index: 4;
  }

  .monsters-figure--blazebelly img {
    object-position: 50% 100%;
  }

}

@media (max-width: 920px) {
  .site-stage {
    grid-template-columns: 1fr;
    width: auto;
    max-width: none;
    margin: 16px 12px 28px;
    box-sizing: border-box;
  }

  .screen-stack {
    z-index: auto;
  }

  .site-header {
    position: sticky;
    top: 0;
    grid-template-columns: auto auto;
    column-gap: 12px;
    row-gap: 0;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--edge-muted);
    background: rgba(5, 7, 6, 0.88);
    backdrop-filter: blur(16px);
    box-shadow:
      inset 0 1px 0 rgba(247, 237, 218, 0.08),
      0 18px 42px rgba(0, 0, 0, 0.38);
  }

  .site-header::before,
  .site-header::after {
    display: none;
  }

  .brand-mark {
    width: 92px;
    margin: 0;
    justify-self: start;
  }

  .nav-toggle {
    display: block;
    min-width: 46px;
    min-height: 44px;
  }

  .site-header.is-open {
    grid-template-columns: auto auto;
    row-gap: 12px;
  }

  .command-menu,
  .header-actions {
    grid-column: 1 / -1;
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    visibility: hidden;
    transition:
      max-height 280ms var(--ease-standard),
      opacity var(--time-quick) ease,
      transform var(--time-soft) ease,
      visibility var(--time-quick) ease;
  }

  .command-menu {
    padding-bottom: 0;
  }

  .site-header.is-open .command-menu {
    max-height: 980px;
    opacity: 1;
    padding-bottom: 8px;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }

  .site-header.is-open .header-actions {
    max-height: 190px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }

  .site-header.is-open .command-menu::before {
    content: "";
    position: absolute;
    inset: 56px auto 8px 0;
    width: min(190px, 54vw);
    border: 1px solid rgba(67, 190, 178, 0.28);
    border-radius: 6px;
    background:
      url("assets/ui/side-pattern.webp") left top / 220px auto repeat-y,
      linear-gradient(90deg, rgba(19, 154, 145, 0.54), rgba(5, 7, 6, 0.08));
    opacity: 0.72;
    pointer-events: none;
  }

  .site-header.is-open .site-nav,
  .site-header.is-open .command-caption,
  .site-header.is-open .header-actions {
    position: relative;
    z-index: 1;
  }

  .site-nav {
    gap: 4px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    padding-left: 18px;
  }

  .command-caption {
    width: min(307px, 100%);
  }

  .command-link {
    width: 244px;
    min-height: 52px;
    padding: 8px 14px 8px 24px;
    font-size: 0.88rem;
    line-height: 1.08;
  }

  .character-submenu {
    width: 244px;
    margin-left: 48px;
    justify-items: start;
  }

  .character-sublink {
    width: 244px;
    min-height: 52px;
    padding: 8px 14px 8px 24px;
    font-size: 0.88rem;
    line-height: 1.08;
  }

  .header-cta {
    min-height: 44px;
  }

  .command-link::before,
  .character-sublink::before {
    left: -18px;
    width: 20px;
    height: 36px;
  }

  .hero-inner,
  .section-heading,
  .community-panel {
    grid-template-columns: 1fr;
  }

  .story-copy {
    order: -1;
  }

  .world-copy {
    order: initial;
  }

  .world-layout {
    gap: 22px;
  }

  .world-heading {
    gap: 12px;
  }

  .world-hero {
    min-height: auto;
  }

  .press-grid,
  .info-grid,
  .award-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monsters-intro {
    grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
    gap: 20px;
    padding-bottom: 22px;
  }

  .monsters-stage {
    padding: 24px 20px 20px;
    min-height: auto;
  }

  .monsters-roster {
    min-height: min(36vh, 320px);
  }

  .monsters-figure--emberling {
    left: -16%;
    right: auto;
    bottom: -3%;
    top: auto;
    width: 42.5%;
    height: 71%;
    z-index: 1;
  }

  .monsters-figure--emberling img {
    object-position: 50% 100%;
  }

  .monsters-figure--scorcher {
    left: 66.5%;
    right: auto;
    bottom: 1.5%;
    top: auto;
    width: 46.5%;
    height: 89%;
    z-index: 3;
  }

  .monsters-figure--scorcher img {
    object-position: 50% 100%;
  }

  .monsters-figure--cinderwing {
    right: -2.5%;
    left: auto;
    bottom: 47.5%;
    top: auto;
    width: 49.5%;
    height: 93%;
    z-index: 2;
  }

  .monsters-figure--cinderwing img {
    object-position: 50% 100%;
  }

  .monsters-figure--blazebelly {
    left: calc(50% - 39.5%);
    right: auto;
    bottom: -1.5%;
    top: auto;
    width: 72%;
    height: 128.5%;
    z-index: 4;
  }

  .monsters-figure--blazebelly img {
    object-position: 50% 100%;
  }

  .feature-row,
  .feature-row-flipped {
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "copy";
    gap: 22px;
  }

  .world-image,
  .world-image img {
    min-height: 360px;
  }

  .community-panel {
    gap: 22px;
  }

  .community-links {
    gap: 12px;
  }

  .community-links a {
    min-height: 56px;
    font-size: 0.92rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .hero-inner,
  .section-inner,
  .site-footer {
    width: min(calc(100% - 28px), var(--max));
  }

  .gameplay > .section-inner {
    width: calc(100% - 28px);
  }

  .stage-chrome {
    justify-content: flex-start;
    gap: 6px;
    row-gap: 6px;
    flex-wrap: wrap;
    overflow-x: hidden;
    padding-bottom: 2px;
  }

  .stage-control {
    flex: 0 0 auto;
    max-width: 100%;
    min-height: 44px;
    padding: 0 10px 0 21px;
    font-size: 0.58rem;
    white-space: nowrap;
  }

  .stage-control--music {
    padding: 0 12px 0 10px;
  }

  .stage-control::before {
    left: 9px;
  }

  .hero {
    grid-template-rows: auto auto;
  }

  .hero-media {
    grid-row: 1;
  }

  .hero-inner {
    grid-row: 2;
    min-height: 0;
    padding: 32px 0;
  }

  .hero-lede,
  .world-intro,
  .world-copy p {
    font-size: 1rem;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .hero-actions {
    overflow-x: clip;
  }

  .command-frame {
    border-radius: 6px;
  }

  .press-grid,
  .info-grid,
  .award-list {
    grid-template-columns: 1fr;
  }

  /* LINEUP PAGE — mobile overrides (≤920px)
     From character editor. Profile layout rules follow below. */
  .character-lineup {
    aspect-ratio: auto;
    height: min(46vh, 400px);
    max-height: none;
    min-height: 300px;
    padding: 0;
    /* Don't crop inside the frame — let .command-frame clip at the border. */
    overflow: visible;
  }

  .character-lineup-stage--poster {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
  }

  .character-lineup-name {
    position: relative;
    z-index: 8;
    padding-top: 10px;
    font-size: clamp(1.35rem, 6.5vw, 2rem);
  }

  /* LINEUP · Masked King (mobile) */
  .character-lineup-figure--masked-king {
    left: 0%;
    right: auto;
    bottom: -35%;
    top: auto;
    width: 120%;
    height: 140%;
    z-index: 1;
  }

  /* LINEUP · Jasim (mobile) */
  .character-lineup-figure--jasim {
    left: 11%;
    right: auto;
    bottom: -1.5%;
    top: auto;
    width: 44%;
    height: 83.5%;
    z-index: 4;
  }

  /* LINEUP · Basim (mobile) */
  .character-lineup-figure--basim {
    left: -4.5%;
    right: auto;
    bottom: -3%;
    top: auto;
    width: 32%;
    height: 62%;
    z-index: 3;
  }

  /* LINEUP · Faris (mobile) */
  .character-lineup-figure--faris {
    left: calc(50% - 41.8%);
    right: auto;
    bottom: -23%;
    top: auto;
    width: 83.5%;
    height: 120.5%;
    z-index: 6;
  }

  .character-lineup-figure--faris img {
    object-position: 50% 50%;
  }

  /* LINEUP · Sahar (mobile) */
  .character-lineup-figure--sahar {
    left: 48.5%;
    right: auto;
    top: -20.5%;
    bottom: auto;
    width: 50%;
    height: 84%;
    z-index: 7;
  }

  /* LINEUP · Shifa (mobile) */
  .character-lineup-figure--shifa {
    right: -27%;
    left: auto;
    bottom: -6%;
    top: auto;
    width: 49%;
    height: 100%;
    z-index: 5;
  }

  /* LINEUP · Hakeem (mobile) */
  .character-lineup-figure--hakeem {
    right: -4%;
    left: auto;
    bottom: -1%;
    top: auto;
    width: 58%;
    height: 107%;
    z-index: 2;
  }

  /* PROFILE SUBPAGES — mobile */
  .character-profile-art {
    min-height: min(50vh, 400px);
    height: min(50vh, 400px);
  }

  .character-profile-art img {
    object-position: center bottom;
  }

  #character-sahar .character-profile-art img {
    object-position: center bottom;
    transform: translate(0%, 15%) scale(1.2);
    transform-origin: center bottom;
  }

  #character-masked-king .character-profile-art img,
  .character-profile--wide .character-profile-art img {
    object-position: center center;
    transform: scale(1.4);
    transform-origin: center bottom;
  }

  .character-profile-panel {
    margin: 12px 0;
    padding: 0 12px;
  }

  .character-profile-back {
    width: min(100%, 180px);
    min-height: 40px;
    padding: 8px 32px;
    font-size: 0.8rem;
  }

  .section {
    padding: 34px 0;
  }

  .section-heading {
    gap: 18px;
    margin-bottom: 24px;
  }

  .feature-row {
    padding: 22px 0;
  }

  .gallery-heading {
    align-items: start;
  }

  .gallery-controls {
    justify-content: stretch;
  }

  .gallery-control {
    flex: 1;
    min-width: 0;
    min-height: 44px;
  }

  .gallery-strip {
    grid-template-columns: repeat(9, 112px);
  }

  .world-image,
  .world-image img {
    min-height: 0;
  }

  .world-image figcaption {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    font-size: 0.7rem;
  }

  .gallery-lightbox {
    padding: 10px;
  }

  .gallery-lightbox__panel {
    max-height: calc(100vh - 20px);
    padding: 10px;
  }

  .gallery-lightbox__caption,
  .gallery-lightbox__controls {
    flex-direction: column;
  }

  .gallery-lightbox__image {
    max-height: calc(100vh - 230px);
  }

  .gallery-lightbox__control,
  .gallery-lightbox__close,
  .hero-actions .button,
  .community-links a {
    min-height: 52px;
  }

  .site-footer {
    display: grid;
  }

  .press-showcase__heading {
    align-items: start;
    flex-direction: column;
  }

  .press-quote {
    grid-template-rows: minmax(66px, auto) 34px;
    gap: 7px;
    padding: 14px 12px;
  }

  .press-quote blockquote {
    padding-inline: 26px;
  }

  .press-quote blockquote p {
    font-size: 0.84rem;
  }

  .press-source img {
    height: 24px;
  }
}

@media (max-width: 520px) {
  .community-links a {
    min-height: 50px;
    padding: 0 16px;
    font-size: 0.88rem;
  }

  .community-links .platform-icon {
    width: 22px;
    height: 22px;
  }

  .monsters-intro {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .monsters-emblem {
    width: min(150px, 42vw);
  }

  .monsters-copy-body {
    margin-inline: auto;
  }

  .monsters-roster {
    min-height: min(30vh, 250px);
  }
}
