@font-face {
  font-family: "Jersey 25";
  src: url("./assets/fonts/Jersey25-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --app-pad-top: max(24px, env(safe-area-inset-top));
  --app-pad-bottom: max(24px, env(safe-area-inset-bottom));
  --game-controls-reserve: 0px;
  --namira-vh: 100dvh;
  --ink: #080d24;
  --navy: #0d1533;
  --navy-2: #111c45;
  --panel: #172557;
  --panel-2: #1e2f6d;
  --line: #526bc2;
  --line-soft: rgb(130 155 255 / 28%);
  --white: #fffaf7;
  --muted: #b6c1e5;
  --blue: #667cff;
  --blue-strong: #4054d3;
  --purple: #a06eff;
  --gold: #ffd05a;
  --gold-deep: #d38f2d;
  --danger: #f37a88;
  --shadow: 0 24px 70px rgb(3 5 21 / 48%);
  color: var(--white);
  font-family: "Jersey 25", sans-serif;
  font-synthesis: none;
  font-style: normal;
  font-weight: 400;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 50% -12%, rgb(103 82 208 / 27%), transparent 34rem),
    linear-gradient(180deg, #0e1740 0%, var(--ink) 76%);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image: linear-gradient(rgb(255 255 255 / 3%) 1px, transparent 1px);
  background-size: 100% 4px;
  mix-blend-mode: screen;
}

button,
input,
select { font: inherit; }

button {
  color: inherit;
  cursor: pointer;
}

button:disabled { cursor: not-allowed; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

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

.app {
  width: min(calc(100% - 32px), 960px);
  min-height: 100svh;
  padding: var(--app-pad-top) max(0px, env(safe-area-inset-right)) var(--app-pad-bottom);
  margin: 0 auto;
}

/* The active game owns the viewport. Menus remain independently scrollable,
   while the arena and its touch row stay inside the visual viewport. */
body[data-screen="game"],
body[data-screen="tutorial"],
body[data-screen="pause"],
body[data-screen="result"],
body[data-screen="task-complete"],
body[data-screen="overlay"] {
  height: var(--namira-vh);
  min-height: var(--namira-vh);
  overflow: hidden;
}

body[data-screen="game"] .app,
body[data-screen="tutorial"] .app,
body[data-screen="pause"] .app,
body[data-screen="result"] .app,
body[data-screen="task-complete"] .app,
body[data-screen="overlay"] .app {
  height: 100%;
  min-height: 0;
}

.eyebrow,
.modal__kicker,
.tutorial-kicker {
  margin: 0 0 8px;
  color: #b9c9ff;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  line-height: 1.1;
  text-transform: uppercase;
}

.home-screen {
  display: grid;
  min-height: calc(100svh - 48px);
  place-items: center;
}

.home-screen__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.93fr) minmax(300px, 1.07fr);
  align-items: center;
  width: 100%;
  max-width: 900px;
  gap: clamp(34px, 8vw, 100px);
  padding: 28px 0;
}

.home-copy { position: relative; z-index: 1; }

.home-wordmark {
  width: min(100%, 450px);
  aspect-ratio: 984 / 214;
  overflow: hidden;
  margin: 0;
  line-height: 0;
}

.home-wordmark img {
  display: block;
  width: 104.07%;
  height: auto;
  margin-left: -2.03%;
  transform: translateY(-21.875%);
  image-rendering: auto;
}

.home-tagline {
  margin: 17px 0 0;
  color: var(--gold);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  letter-spacing: 0.03em;
  line-height: 1;
}

.home-description {
  max-width: 33rem;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.45;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.home-actions > button { flex: 0 1 auto; }

.home-links { margin-top: 12px; }

.home-art {
  position: relative;
  display: grid;
  min-height: 450px;
  overflow: hidden;
  place-items: center;
  isolation: isolate;
}

.home-art__halo {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  background-image: linear-gradient(180deg, rgb(17 31 91 / 10%), rgb(9 15 51 / 32%)), url("../assets/game/arena-sky-city.png");
  background-position: center 58%;
  background-size: cover;
  box-shadow: inset 0 0 70px rgb(26 39 112 / 20%);
  clip-path: none;
}

.home-mentor {
  display: block;
  width: min(83%, 410px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 20px 12px rgb(0 0 0 / 30%));
  transform: translateY(-28px);
}

.sponsor-mark {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #283256;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.sponsor-mark img {
  display: block;
  width: min(180px, 100%);
  height: auto;
  image-rendering: auto;
}

.sponsor-mark--home {
  position: absolute;
  z-index: 2;
  right: auto;
  bottom: 5px;
  left: 50%;
  min-width: 176px;
  padding: 7px 12px 8px;
  border: 2px solid #d3be90;
  background: #fbf1d9;
  box-shadow: 0 5px 0 rgb(8 13 36 / 36%);
  transform: translateX(-50%);
}
.sponsor-mark--result { margin-top: 17px; }

.home-note {
  margin: 18px 0 0;
  color: #8492c4;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.primary-button,
.secondary-button,
.link-button,
.preference-button,
.icon-button,
.touch-control {
  -webkit-tap-highlight-color: transparent;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 9px 18px;
  border: 2px solid var(--line);
  border-radius: 0;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}

.primary-button {
  color: #101834;
  border-color: #ffdf79;
  background: linear-gradient(180deg, #ffdb70, var(--gold));
  box-shadow: inset 0 -4px 0 var(--gold-deep), inset 0 3px 0 #fff4b7, 0 5px 0 #090f28;
}

.primary-button:hover { filter: brightness(1.08); }

.primary-button:active,
.secondary-button:active,
.touch-control:active { transform: translateY(3px); }

.primary-button--hero {
  min-height: 58px;
  border-width: 3px;
  padding-inline: 30px;
  font-size: 1.5rem;
}

.home-actions .secondary-button {
  min-height: 50px;
  padding-inline: 18px;
  font-size: 1.15rem;
}

.secondary-button {
  color: var(--white);
  border-color: #7288e3;
  background: linear-gradient(180deg, #596bd2, var(--blue-strong));
  box-shadow: inset 0 -4px 0 #29388d, inset 0 3px 0 #8193f0, 0 5px 0 #090f28;
}

.secondary-button:hover { filter: brightness(1.12); }

.link-button {
  min-height: 40px;
  padding: 8px 4px;
  border: 0;
  color: #cfdaff;
  background: transparent;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-decoration-color: rgb(207 218 255 / 42%);
  text-underline-offset: 4px;
}

.link-button:hover { color: var(--white); }

.preference-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 18px;
}

.preference-button {
  display: inline-flex;
  align-items: center;
  min-width: 48px;
  min-height: 48px;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 0;
  color: #ccd6ff;
  background: transparent;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.preference-button:hover,
.preference-button:focus-visible { border-color: var(--line-soft); background: rgb(73 91 177 / 24%); }

.preference-button[aria-pressed="false"] { color: #7d89b4; text-decoration: line-through; }
.preference-button[aria-pressed="false"] .preference-icon { opacity: 0.45; filter: grayscale(0.7); }

.preference-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  border: 2px solid currentcolor;
}

.preference-icon--music { border-radius: 50%; }
.preference-icon--music::after { position: absolute; top: 2px; right: -4px; width: 5px; height: 8px; border: 2px solid currentcolor; border-left: 0; content: ""; }
.preference-icon--sfx::before,
.preference-icon--sfx::after { position: absolute; top: 3px; left: 3px; width: 5px; height: 7px; border: 2px solid currentcolor; border-top: 0; border-bottom: 0; border-radius: 50%; content: ""; }
.preference-icon--sfx::after { top: 1px; left: 1px; width: 11px; height: 11px; }
.preference-icon--effects { transform: rotate(45deg); }
.preference-icon--effects::after { position: absolute; top: 5px; left: 2px; width: 9px; height: 3px; background: currentcolor; content: ""; }

.game-shell {
  width: min(100%, 360px);
  margin: 0 auto;
}

.stage {
  position: relative;
  width: min(100%, 360px, calc((var(--namira-vh) - var(--app-pad-top) - var(--app-pad-bottom) - var(--game-controls-reserve)) * 9 / 16));
  min-width: 0;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  isolation: isolate;
  border: 2px solid #4c67bd;
  background: #09122d;
  box-shadow: var(--shadow), 0 0 0 2px rgb(4 8 24 / 70%);
  clip-path: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px));
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  cursor: crosshair;
  image-rendering: pixelated;
  touch-action: none;
  user-select: none;
}

#game-canvas.canvas-pointer-active { cursor: none; }

.hud {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  /* 104px at the reference 360px arena. On a short landscape viewport the
     stage scales down, so the HUD keeps the y=128 spawn lane visible. */
  height: clamp(64px, 16.25%, 104px);
  min-height: clamp(64px, 16.25%, 104px);
  max-height: clamp(64px, 16.25%, 104px);
  padding: 10px 10px 8px;
  overflow: hidden;
  pointer-events: none;
  background: #182658;
  border-bottom: 2px solid #6d86df;
  box-shadow: inset 0 3px 0 #263f85, inset 0 -4px 0 #20356e;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 9px calc(100% - 9px), 0 calc(100% - 9px));
}

.hud__row { display: flex; align-items: center; min-width: 0; }
.hud__row--top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.75fr) minmax(0, 1.1fr) 48px; gap: 7px; min-height: 58px; }
.hud__row--bottom { gap: 6px; min-height: 22px; }
.stat { min-width: 0; }
.stat--combo, .stat--ammo { padding-left: 8px; border-left: 1px solid #4d65ad; }
.stat__label { display: block; overflow: hidden; color: #c2cbed; font-size: 1rem; letter-spacing: 0.1em; line-height: 1; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.stat__value { display: block; max-width: 100%; margin-top: 4px; overflow: hidden; color: var(--white); font-size: clamp(1.25rem, 7vw, 1.9rem); font-variant-numeric: tabular-nums; letter-spacing: -0.06em; line-height: 0.9; text-overflow: clip; white-space: nowrap; }
.stat--combo .stat__value { color: var(--gold); font-size: clamp(1.1rem, 6vw, 1.6rem); }
.ammo__values { display: grid; gap: 2px; min-width: 0; margin-top: 2px; }
.ammo__item { display: inline-flex; align-items: center; min-width: 0; gap: 3px; color: var(--white); }
.ammo__item img { flex: 0 0 15px; width: 15px; height: 15px; object-fit: contain; image-rendering: pixelated; }
.ammo__kind { color: #a9b8e6; font-size: 0.875rem; line-height: 1; }
.ammo__item strong { min-width: 1ch; color: var(--white); font-size: 1.1rem; font-variant-numeric: tabular-nums; line-height: 1; }
.ammo__item:last-child strong { color: var(--gold); }
.ammo__divider { display: none; }

.icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  padding: 0;
  border: 2px solid #7891e4;
  border-radius: 0;
  color: var(--white);
  background: #263b78;
  box-shadow: inset 0 -4px 0 #162655, inset 0 3px 0 #4059a2;
}

.icon-button:hover { background: #355096; }
.icon-button:disabled { opacity: 0.55; }
.icon-button--close { align-self: start; font-size: 1.5rem; line-height: 1; }
.pause-icon { display: inline-flex; align-items: center; gap: 4px; height: 19px; }
.pause-icon span { display: block; width: 5px; height: 19px; background: var(--white); box-shadow: 2px 0 0 #d2dcff; }
.hud__status { display: inline-flex; align-items: baseline; min-width: 0; gap: 4px; white-space: nowrap; }
.hud__status--level { padding-left: 6px; border-left: 1px solid #4d65ad; }
.hud__micro-label { color: #a9b7df; font-size: 0.9375rem; letter-spacing: 0.04em; line-height: 1; }
.lives { color: #ffb0b8; font-size: 1rem; line-height: 1; }
.level-value { color: var(--gold); font-size: 0.82rem; font-variant-numeric: tabular-nums; line-height: 1; }
.progress-chip, .wind-chip { display: inline-flex; align-items: center; min-width: 0; min-height: 24px; padding: 0 6px; overflow: hidden; border: 1px solid #5a73bd; color: #e0e6ff; background: #243a77; font-size: 0.875rem; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.progress-chip { flex: 1 1 auto; }
.wind-chip { flex: 0 1 auto; color: #c8f1ff; border-color: #4389ab; background: #174767; }

.stage-message { position: absolute; z-index: 4; top: 111px; left: 50%; max-width: calc(100% - 24px); padding: 5px 8px; color: #fff8e0; background: rgb(19 29 68 / 82%); border: 1px solid rgb(255 208 90 / 64%); font-size: 1rem; line-height: 1.2; opacity: 0; pointer-events: none; text-align: center; transform: translateX(-50%); transition: opacity 120ms ease; }
.stage-message:not(:empty) { opacity: 1; }

.touch-controls { display: none; align-items: center; justify-content: space-between; width: min(100%, 360px); height: 70px; min-height: 70px; padding: 10px 2px 2px; touch-action: none; user-select: none; }
.touch-direction-group, .touch-fire-group { display: flex; align-items: center; gap: 8px; }
.touch-control { display: grid; position: relative; width: 52px; height: 52px; min-width: 52px; min-height: 52px; place-items: center; padding: 0; border: 2px solid #8195e6; border-radius: 0; color: var(--white); background: var(--blue-strong); box-shadow: inset 0 -4px 0 #29388d, inset 0 3px 0 #8193f0, 0 5px 0 #090f28; font-size: 1rem; touch-action: none; }
.touch-control img { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; transform: rotate(-25deg); }
.touch-control:hover { filter: brightness(1.1); }
.touch-control--fire { width: 58px; height: 58px; min-width: 58px; min-height: 58px; border-color: #ffe18a; color: #182045; background: var(--gold); box-shadow: inset 0 -5px 0 var(--gold-deep), inset 0 3px 0 #fff0ad, 0 5px 0 #090f28; }
.touch-control--power { border-color: #c9a5ff; color: var(--white); background: #6e4bc5; box-shadow: inset 0 -4px 0 #3e277e, inset 0 3px 0 #b495ff, 0 5px 0 #090f28; }
.touch-control--power:disabled { opacity: 0.45; }
.power-glyph { color: var(--gold); font-size: 1.6rem; line-height: 1; }
.touch-control__hint { position: absolute; right: 3px; bottom: 3px; left: 3px; overflow: hidden; color: currentcolor; font-size: 0.875rem; letter-spacing: 0.02em; line-height: 1; text-align: center; white-space: nowrap; }

.modal {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 12px;
  overflow: auto;
  background: rgb(6 11 32 / 86%);
}

.modal__card,
.home-panel__card {
  width: min(100%, 320px);
  max-height: calc(100% - 4px);
  padding: 20px 17px 17px;
  overflow: auto;
  border: 2px solid #6078cd;
  border-radius: 0;
  color: var(--white);
  background: #1a285b;
  box-shadow: 0 18px 38px rgb(4 8 25 / 62%), inset 0 3px 0 #354b96, inset 0 -5px 0 #111c40;
  clip-path: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px));
}

.modal__card--compact { padding-top: 18px; }
.modal__card h2, .home-panel__card h2, .tutorial-card h2 { margin: 0; color: var(--white); font-size: clamp(1.35rem, 5vw, 1.75rem); line-height: 1.04; }
.modal__card p:not(.modal__kicker):not(.result-score):not(.result-status) { margin: 11px 0 15px; color: #d2daf1; font-size: 1.125rem; line-height: 1.42; }
.modal__card .primary-button, .modal__card .secondary-button { display: block; width: 100%; }
.modal__card .secondary-button { margin-top: 9px; }
.field { display: block; margin: 0 0 12px; color: #e0e6ff; font-size: 1rem; }
.field span { display: block; margin-bottom: 5px; }
.field small { color: #9eacd2; font-size: 0.875rem; }
.field input { display: block; width: 100%; height: 50px; padding: 7px 9px; border: 2px solid #5c73bd; border-radius: 0; color: var(--white); background: #0d183a; font-size: 1.125rem; }
.field input::placeholder { color: #7f8db8; }
.result-score { margin: 15px 0 2px; color: var(--gold); font-size: 1.45rem; line-height: 1; text-align: center; }
#result-detail { margin: 7px 0 14px; color: #bdc8e7; font-size: 1rem; text-align: center; }
.result-status { min-height: 18px; margin: 8px 0 0; color: #aab7dd; font-size: 1rem; line-height: 1.3; text-align: center; }
.result-actions { display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 6px; }
.result-actions .secondary-button { margin-top: 0; }
.result-actions .link-button { justify-self: center; }
.result-publish { margin-top: 3px; }

.home-panel { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: rgb(5 9 28 / 95%); }
.home-panel__card { width: min(100%, 640px); max-height: min(680px, calc(100svh - 32px)); padding: clamp(20px, 4vw, 32px); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h2 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
.leaderboard-meta { margin: 18px 0 10px; padding: 10px 12px; color: #b9c8ed; border: 1px solid rgb(112 138 220 / 35%); background: #111e46; font-size: 1rem; line-height: 1.35; }
.leaderboard-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; min-height: 158px; margin: 8px 0 14px; }
.podium-slot { display: grid; justify-items: center; min-width: 0; padding: 5px 4px 8px; border: 1px solid rgb(255 208 90 / 30%); background: rgb(39 53 113 / 72%); text-align: center; }
.podium-slot[hidden] { display: none; }
.podium-slot img { display: block; width: min(100%, 90px); height: 76px; object-fit: contain; image-rendering: pixelated; }
.podium-slot--gold { min-height: 158px; border-color: rgb(255 208 90 / 74%); background: rgb(92 70 57 / 76%); }
.podium-slot--silver { min-height: 137px; }
.podium-slot--bronze { min-height: 124px; border-color: rgb(206 144 77 / 62%); }
.podium-slot__nickname { display: block; width: 100%; overflow: hidden; color: var(--white); font-size: 0.8rem; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.podium-slot__score { display: block; margin-top: 4px; color: var(--gold); font-size: 1rem; line-height: 1; }
.podium-slot small { display: block; margin-top: 4px; color: #c4cdeb; font-size: 0.875rem; }
.leaderboard-list { display: grid; gap: 4px; min-height: 220px; padding: 0; margin: 0; list-style: none; }
.leaderboard-row { display: grid; grid-template-columns: 3ch 1fr auto; gap: 10px; align-items: center; min-height: 34px; padding: 5px 8px; color: #edf1ff; border-bottom: 1px solid rgb(122 146 223 / 16%); font-size: 1rem; }
.leaderboard-row__rank { color: var(--gold); }
.leaderboard-row__score { color: #c7d3ff; font-variant-numeric: tabular-nums; }
.leaderboard-empty { display: grid; min-height: 220px; place-items: center; padding: 24px; color: #9eacd2; border: 1px dashed rgb(131 156 236 / 30%); font-size: 1rem; line-height: 1.4; text-align: center; }
.leaderboard-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; color: #b9c8ed; font-size: 1rem; }
.leaderboard-footer .secondary-button { min-width: 112px; }

.tutorial-screen { position: fixed; z-index: 30; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: max(18px, env(safe-area-inset-top)) 16px 16px; pointer-events: none; }
.tutorial-card { width: min(100%, 360px); padding: 16px 17px 13px; pointer-events: auto; border: 2px solid #7c91ea; background: rgb(20 33 78 / 97%); box-shadow: 0 16px 35px rgb(2 5 19 / 58%), inset 0 3px 0 #4159a7; clip-path: polygon(0 7px, 7px 7px, 7px 0, calc(100% - 7px) 0, calc(100% - 7px) 7px, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 7px calc(100% - 7px), 0 calc(100% - 7px)); }
.tutorial-card__topline { display: flex; align-items: center; justify-content: space-between; }
.tutorial-step-count { color: var(--gold); font-size: 1rem; }
.tutorial-card h2 { font-size: 1.25rem; }
.tutorial-card p { margin: 8px 0 0; color: #d2dcf5; font-size: 1.125rem; line-height: 1.42; }
.tutorial-card .tutorial-hint { color: #9caedb; font-size: 1rem; }
.tutorial-card .link-button { min-height: 48px; margin-top: 12px; }
body.is-tutorial .hud { opacity: 0; }
body.is-tutorial .pause-button { pointer-events: none; }

.debug-panel { width: min(100%, 360px); padding: 15px; margin: 22px auto 0; border: 2px solid #c49332; background: #1f2a51; box-shadow: 0 10px 22px rgb(4 9 27 / 30%); }
.debug-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.debug-panel h2, .debug-badge { margin: 0; font-size: 1.1rem; }
.debug-badge { padding: 3px 5px; color: #2a1d08; background: #ffc94d; font-size: 0.875rem; }
.debug-panel__note { color: #bac6e5; font-size: 1rem; line-height: 1.35; }
.debug-select-label { display: block; margin-top: 13px; color: #d6def7; font-size: 1rem; }
.debug-select { width: 100%; min-height: 42px; margin-top: 5px; padding: 5px; border: 2px solid #5369ac; border-radius: 0; color: var(--white); background: #0e1938; }
.debug-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.debug-actions button { min-height: 48px; border: 2px solid #5369ac; border-radius: 0; color: var(--white); background: #415393; font-size: 0.875rem; line-height: 1.15; }
.debug-actions button:hover { background: #536cc0; }
.debug-status { display: block; min-height: 80px; padding: 9px; margin-top: 10px; color: #d6def7; background: #0e1938; font-size: 0.875rem; line-height: 1.35; white-space: pre-wrap; }

@media (pointer: coarse), (max-width: 720px) {
  :root { --game-controls-reserve: 70px; }
  .touch-controls { display: flex; }
}

@media (max-width: 720px) {
  :root { --app-pad-top: max(16px, env(safe-area-inset-top)); --app-pad-bottom: max(24px, env(safe-area-inset-bottom)); }
  .app { width: min(calc(100% - 24px), 520px); }
  .home-screen { min-height: calc(100svh - 32px); }
  .home-screen__inner { grid-template-columns: 1fr; gap: 6px; padding: 14px 0 22px; }
  .home-copy { text-align: center; }
  .home-wordmark { width: min(100%, 380px); margin: 0 auto; }
  .home-description { max-width: 30rem; margin-right: auto; margin-left: auto; font-size: 1.05rem; }
  .home-actions { max-width: 370px; margin-right: auto; margin-left: auto; margin-top: 22px; }
  .home-actions .primary-button--hero { flex: 1 1 100%; }
  .home-actions .secondary-button { flex: 0 1 auto; margin-right: auto; margin-left: auto; }
  .home-links { margin-top: 8px; }
  .preference-row { justify-content: center; margin-top: 12px; }
  .home-note { margin-top: 10px; }
  .home-art { min-height: 300px; margin-top: -6px; }
  .home-art__halo { background-position: center 56%; }
  .home-mentor { width: min(64%, 250px); transform: translateY(-44px); }
  .sponsor-mark--home { right: auto; bottom: 0; left: 50%; min-width: 170px; }
  .sponsor-mark--home img { width: min(160px, 42vw); }
  .leaderboard-podium { min-height: 148px; }
  .podium-slot img { width: min(100%, 72px); height: 68px; }
}

@media (pointer: coarse), (max-width: 720px) {
  body[data-screen="game"] .game-shell,
  body[data-screen="tutorial"] .game-shell,
  body[data-screen="pause"] .game-shell,
  body[data-screen="result"] .game-shell,
  body[data-screen="task-complete"] .game-shell,
  body[data-screen="overlay"] .game-shell {
    display: grid;
    grid-template-rows: minmax(0, 1fr) var(--game-controls-reserve);
    align-items: center;
    height: 100%;
  }

  body[data-screen="game"] .stage,
  body[data-screen="tutorial"] .stage,
  body[data-screen="pause"] .stage,
  body[data-screen="result"] .stage,
  body[data-screen="task-complete"] .stage,
  body[data-screen="overlay"] .stage {
    width: min(100%, 360px, calc((var(--namira-vh) - var(--app-pad-top) - var(--app-pad-bottom) - var(--game-controls-reserve)) * 9 / 16));
    max-width: 100%;
    align-self: center;
  }
}

@media (max-width: 360px) {
  .app { width: min(calc(100% - 16px), 360px); }
  .home-description { display: block; font-size: 1rem; }
  .home-art { min-height: 260px; }
  .home-mentor { width: min(64%, 220px); transform: translateY(-44px); }
  .hud { padding-right: 7px; padding-left: 7px; }
  .hud__row--top { grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1.1fr) 48px; gap: 4px; }
  .stat--combo, .stat--ammo { padding-left: 4px; }
  .ammo__kind { display: none; }
  .touch-controls { padding-right: 0; padding-left: 0; }
}

@media (max-height: 620px) and (orientation: landscape) {
  :root { --app-pad-top: max(8px, env(safe-area-inset-top)); --app-pad-bottom: max(8px, env(safe-area-inset-bottom)); }
  .app { padding-top: var(--app-pad-top); padding-bottom: var(--app-pad-bottom); }
  .home-screen__inner { grid-template-columns: 1fr 0.8fr; gap: 28px; padding: 0; }
  .home-art { min-height: calc(100svh - 24px); }
  .home-mentor { width: min(80%, 270px); }
  .sponsor-mark--home { bottom: 0; }
  .home-description { margin-top: 8px; }
  .home-actions { margin-top: 13px; }
  .preference-row { margin-top: 4px; }
  .hud { padding: 5px 7px 4px; gap: 2px; }
  .hud__row--top { min-height: 35px; gap: 4px; }
  .hud__row--bottom { min-height: 15px; gap: 4px; }
  .stat__label { font-size: 0.875rem; }
  .stat__value { margin-top: 2px; font-size: 1.05rem; }
  .stat--combo .stat__value { font-size: 0.9rem; }
  .ammo__item strong { font-size: 1rem; }
  .ammo__item img { width: 11px; height: 11px; flex-basis: 11px; }
  .icon-button { width: 38px; height: 38px; min-width: 38px; min-height: 38px; }
  .pause-icon { height: 14px; }
  .pause-icon span { width: 4px; height: 14px; }
  .hud__micro-label { font-size: 0.875rem; }
  .lives, .level-value { font-size: 0.875rem; }
  .progress-chip, .wind-chip { min-height: 22px; font-size: 0.875rem; }
}

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

/* Astra shell: the game canvas keeps its contrast while the surrounding
   product surface uses a clear daytime palette. These rules intentionally sit
   after the responsive foundation above so the same shell works in the direct
   route and in the embed frame. */
:root {
  --app-pad-top: max(24px, env(safe-area-inset-top));
  --app-pad-bottom: max(24px, env(safe-area-inset-bottom));
  --ink: #14264b;
  --navy: #14264b;
  --navy-2: #213b70;
  --panel: #f1f5ff;
  --panel-2: #e4ecff;
  --line: #8799d7;
  --line-soft: rgb(108 128 198 / 34%);
  --white: #f1f5ff;
  --muted: #40577e;
  --blue: #7078e8;
  --blue-strong: #5552c9;
  --purple: #7048ce;
  --gold: #f4b63f;
  --gold-deep: #bd781e;
  --danger: #c94861;
  --shadow: 0 24px 70px rgb(39 76 128 / 22%);
  color: var(--navy);
}

html { background: #dceeff; }

body {
  color: var(--navy);
  background:
    radial-gradient(circle at 14% 4%, rgb(255 255 255 / 78%) 0 3.5rem, transparent 15rem),
    radial-gradient(circle at 86% 12%, rgb(255 255 255 / 55%) 0 4rem, transparent 19rem),
    linear-gradient(180deg, #dceeff 0%, #cfe8fa 62%, #c4dff2 100%);
}

body::before {
  opacity: 0.12;
  background-image: linear-gradient(rgb(79 112 164 / 13%) 1px, transparent 1px);
  mix-blend-mode: multiply;
}

.app {
  width: min(calc(100% - 32px), 1040px);
  padding-left: max(0px, env(safe-area-inset-left));
}

.eyebrow,
.modal__kicker,
.tutorial-kicker {
  color: #5b6fa7;
  font-size: 1rem;
}

.home-screen { min-height: calc(100svh - var(--app-pad-top) - var(--app-pad-bottom)); }

.home-screen__inner {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.94fr);
  max-width: 1000px;
  gap: clamp(30px, 7vw, 84px);
  padding: 20px 0 24px;
}

.home-copy { max-width: 540px; }

.home-wordmark {
  width: min(100%, 470px);
  aspect-ratio: 1774 / 887;
  overflow: visible;
}

.home-wordmark img {
  width: 100%;
  height: auto;
  margin: 0;
  transform: none;
  image-rendering: auto;
  filter: drop-shadow(0 8px 0 rgb(53 75 130 / 12%));
}

.home-tagline {
  margin-top: 12px;
  color: #6845c8;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.home-description {
  max-width: 35rem;
  margin-top: 14px;
  color: #2f4d78;
  font-size: 1.125rem;
  line-height: 1.5;
}

.home-actions { margin-top: 24px; }

.primary-button,
.secondary-button {
  min-height: 52px;
  padding: 10px 20px;
  font-size: 1.125rem;
}

.primary-button--hero {
  min-height: 60px;
  padding-inline: 32px;
  font-size: 1.5rem;
}

.home-actions .secondary-button { min-height: 52px; font-size: 1.125rem; }

.secondary-button {
  color: #f7f8ff;
  border-color: #858fe3;
  background: linear-gradient(180deg, #777be1, #5651c7);
  box-shadow: inset 0 -4px 0 #3c3a9d, inset 0 3px 0 #a7aaf5, 0 5px 0 rgb(42 53 101 / 28%);
}

.link-button {
  min-height: 48px;
  color: #5b3bb7;
  font-size: 1.125rem;
  text-decoration-color: rgb(91 59 183 / 42%);
}

.link-button:hover { color: #38227e; }

.preference-row { gap: 8px; margin-top: 16px; }

.preference-button {
  min-width: 48px;
  min-height: 56px;
  gap: 8px;
  padding: 8px 10px;
  border: 2px solid #afbee8;
  color: #243d6d;
  background: rgb(241 245 255 / 66%);
  font-size: 1.125rem;
  line-height: 1;
}

.preference-button:hover,
.preference-button:focus-visible {
  border-color: #6f79d9;
  background: #f1f5ff;
}

.preference-button::after { display: none; content: none; }

.preference-button[aria-pressed="false"] {
  color: #657494;
  text-decoration: none;
}

.preference-button[aria-pressed="false"]::after { display: none; content: none; }

.preference-icon,
.preference-button[aria-pressed="false"] .preference-icon {
  display: block;
  /* The source PNGs keep transparent padding. A 44px box leaves a roughly
     32px visible silhouette, matching the control contract. */
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 0;
  opacity: 1;
  filter: none;
  object-fit: contain;
  image-rendering: auto;
}

.preference-button[aria-pressed="false"] .preference-icon { opacity: 0.45; filter: grayscale(0.65); }

.preference-icon--effects { transform: none; }

.home-note {
  margin-top: 14px;
  color: #49658d;
  font-size: 1rem;
}

.home-art {
  min-height: 440px;
  overflow: visible;
}

.home-art__halo {
  inset: 4px;
  border: 2px solid #a0b2e2;
  background-image:
    linear-gradient(180deg, rgb(220 238 255 / 22%), rgb(171 204 234 / 18%)),
    url("../assets/game/arena-sky-city.png");
  background-position: center 58%;
  box-shadow: inset 0 0 70px rgb(65 111 167 / 17%), 0 12px 0 rgb(88 121 175 / 13%);
  clip-path: polygon(0 12px, 12px 12px, 12px 0, calc(100% - 12px) 0, calc(100% - 12px) 12px, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 12px calc(100% - 12px), 0 calc(100% - 12px));
}

.home-mentor {
  width: min(80%, 390px);
  filter: drop-shadow(0 20px 12px rgb(36 70 119 / 24%));
  transform: translateY(-12px);
}

.sponsor-mark {
  gap: 3px;
  color: #2b4773;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
}

.sponsor-mark img { width: min(180px, 100%); }

.sponsor-mark--home {
  right: auto;
  bottom: 4px;
  left: 50%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sponsor-mark--result { margin-top: 14px; }

.stage {
  border-color: #8094d9;
  box-shadow: 0 18px 42px rgb(25 57 103 / 26%), 0 0 0 2px rgb(43 66 118 / 22%);
}

.hud {
  background: #14264b;
  border-bottom-color: #91a7eb;
  box-shadow: inset 0 3px 0 #25447d, inset 0 -4px 0 #1c3465;
}

.stat__label { color: #c9d5f6; font-size: 1rem; }
.stat__value { font-size: clamp(1.4rem, 7vw, 2rem); }
.stat--combo .stat__value { font-size: clamp(1.25rem, 6vw, 1.7rem); }
.ammo__kind { color: #bbcaee; font-size: 0.9375rem; }
.ammo__item strong { font-size: 1.1rem; }
.hud__micro-label { color: #c0cdef; font-size: 0.9375rem; }
.lives { font-size: 1rem; }
.level-value { font-size: 1rem; }
.progress-chip, .wind-chip { min-height: 24px; padding-inline: 6px; font-size: 0.875rem; }
.stage-message { font-size: 1rem; line-height: 1.2; }

.icon-button {
  border-color: #9bb0ed;
  color: #f1f5ff;
  background: #304f8d;
  box-shadow: inset 0 -4px 0 #1e376a, inset 0 3px 0 #5978bc;
}

.icon-button:hover { background: #3e64a4; }

.touch-control__hint { font-size: 0.875rem; letter-spacing: 0.02em; }

.modal {
  padding: 10px;
  background: rgb(20 38 75 / 52%);
}

.modal__card,
.home-panel__card {
  width: min(100%, 360px);
  padding: 24px 20px 20px;
  color: var(--navy);
  border: 3px solid #91a4df;
  background: #f1f5ff;
  box-shadow: 0 18px 38px rgb(28 55 101 / 30%), inset 0 3px 0 #ffffff, inset 0 -5px 0 #d5e0fb;
}

.modal__card h2,
.home-panel__card h2,
.tutorial-card h2 {
  color: var(--navy);
  font-size: clamp(2rem, 6vw, 2.625rem);
  line-height: 1.05;
}

.modal__card p:not(.modal__kicker):not(.result-score):not(.result-status) {
  color: #3a5279;
  font-size: 1.125rem;
  line-height: 1.42;
}

.modal__card .primary-button,
.modal__card .secondary-button { width: 100%; }

.field { color: #29466f; font-size: 1rem; }
.field small { color: #5d7196; font-size: 0.875rem; }
.field input { height: 50px; color: var(--navy); background: #ffffff; border-color: #91a6de; font-size: 1.125rem; }
.field input::placeholder { color: #7182a4; }
.result-score { margin: 16px 0 4px; color: #b06d16; font-size: clamp(2.75rem, 12vw, 4rem); font-variant-numeric: tabular-nums; }
#result-detail { color: #3f5a82; font-size: 1rem; }
.result-status { color: #4e668d; font-size: 1rem; }
.result-actions { gap: 8px; margin-top: 10px; }
.result-actions #restart-button { order: -1; min-height: 52px; padding: 10px 20px; color: #14264b; border: 2px solid #f6cf75; background: linear-gradient(180deg, #ffdb70, #f4b63f); box-shadow: inset 0 -4px 0 #bd781e, inset 0 3px 0 #fff4b7, 0 4px 0 rgb(42 53 101 / 22%); font-size: 1.125rem; text-align: center; text-decoration: none; }
.result-actions #home-button { min-height: 52px; }

.home-panel {
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgb(220 238 255 / 82%);
}

.home-panel__card {
  width: min(100%, 680px);
  max-height: min(720px, calc(var(--namira-vh) - 32px));
}

.panel-heading h2 { font-size: clamp(2rem, 6vw, 2.625rem); }
.leaderboard-meta { color: #3f5c87; background: #e2ebff; border-color: #afbee8; font-size: 1rem; }
.podium-slot { color: var(--navy); background: #e3ebff; border-color: #b7c5ea; }
.podium-slot--gold { background: #fff2c9; border-color: #dfb44d; }
.podium-slot__nickname { color: var(--navy); font-size: 1rem; }
.podium-slot__score { color: #ac6a14; font-size: 1rem; }
.podium-slot small { color: #536a92; font-size: 0.875rem; }
.leaderboard-row { color: #243f6c; border-bottom-color: #d0daf2; font-size: 1rem; }
.leaderboard-row__rank, .leaderboard-row__score { color: #4f3ca8; }
.leaderboard-empty { color: #50688e; border-color: #b3c1e6; font-size: 1rem; }
.leaderboard-footer { color: #4c668e; font-size: 1rem; }

.tutorial-screen { padding-top: max(18px, env(safe-area-inset-top)); }
.tutorial-card {
  width: min(100%, 390px);
  padding: 22px 20px 18px;
  color: var(--navy);
  border-color: #91a4df;
  background: #f1f5ff;
  box-shadow: 0 16px 35px rgb(28 55 101 / 26%), inset 0 3px 0 #ffffff;
}
.tutorial-step-count { color: #6845c8; font-size: 1rem; }
.tutorial-card p { color: #3a5279; font-size: 1.125rem; line-height: 1.42; }
.tutorial-card .tutorial-hint { color: #5b7199; font-size: 1rem; }
.tutorial-card .link-button { min-height: 48px; margin-top: 12px; }

.debug-panel { color: var(--navy); border-color: #c19335; background: #f1f5ff; }
.debug-panel__note, .debug-select-label { color: #3e587e; font-size: 1rem; }
.debug-select { color: var(--navy); background: #ffffff; font-size: 1rem; }
.debug-actions button { min-height: 48px; color: #f7f8ff; background: #5753c8; font-size: 0.875rem; }
.debug-status { color: #314d78; background: #e3ebff; font-size: 0.875rem; }

@media (pointer: coarse), (max-width: 720px) {
  :root { --game-controls-reserve: 70px; }

  .app { width: min(calc(100% - 24px), 520px); }

  .home-screen__inner {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 0 18px;
  }

  .home-copy { text-align: center; }
  .home-wordmark { width: min(100%, 370px); margin-inline: auto; }
  .home-description { margin-inline: auto; }
  .home-actions { max-width: 380px; margin-inline: auto; }
  .home-actions .primary-button--hero { flex: 1 1 100%; }
  .home-actions .secondary-button { flex: 1 1 100%; }
  .home-links { margin-top: 8px; }
  .preference-row { justify-content: center; margin-top: 12px; }
  .home-note { margin-top: 10px; }
  .home-art { min-height: 300px; margin-top: 4px; }
  .home-mentor { width: min(68%, 260px); transform: translateY(-12px); }
  .sponsor-mark--home { bottom: 0; left: 50%; }
  .sponsor-mark--home img { width: min(170px, 48vw); }

  body[data-screen="game"] .game-shell,
  body[data-screen="tutorial"] .game-shell,
  body[data-screen="pause"] .game-shell,
  body[data-screen="result"] .game-shell,
  body[data-screen="task-complete"] .game-shell,
  body[data-screen="overlay"] .game-shell {
    grid-template-rows: minmax(0, 1fr) var(--game-controls-reserve);
    height: 100%;
  }

  body[data-screen="game"] .stage,
  body[data-screen="tutorial"] .stage,
  body[data-screen="pause"] .stage,
  body[data-screen="result"] .stage,
  body[data-screen="task-complete"] .stage,
  body[data-screen="overlay"] .stage {
    width: min(100%, 360px, calc((var(--namira-vh) - var(--app-pad-top) - var(--app-pad-bottom) - var(--game-controls-reserve)) * 9 / 16));
    max-width: 100%;
  }

  .touch-controls { display: flex; height: 70px; min-height: 70px; }
}

@media (max-width: 360px) {
  .app { width: min(calc(100% - 16px), 360px); }
  .preference-button { padding-inline: 8px; }
  .preference-button::after { display: none; }
  .preference-label { font-size: 1rem; }
  .stat__label, .ammo__kind, .hud__micro-label { font-size: 0.8125rem; }
  .progress-chip, .wind-chip { font-size: 0.8125rem; }
}

@media (max-height: 720px) and (max-width: 720px) and (orientation: portrait) {
  .home-screen__inner { padding-top: 4px; padding-bottom: 8px; }
  .home-tagline { margin-top: 6px; }
  .home-description { margin-top: 8px; }
  .home-actions { margin-top: 12px; }
  .home-art { min-height: 190px; }
  .home-mentor { width: min(52%, 190px); transform: translateY(-4px); }
}

@media (max-height: 620px) and (orientation: landscape) {
  /* Preserve readable controls in short embed frames; the arena formula above
     is what scales the canvas, so text does not become microscopic. */
  .stat__label, .ammo__kind, .hud__micro-label { font-size: 0.875rem; }
  .stat__value { font-size: 1.4rem; }
  .stat--combo .stat__value { font-size: 1.25rem; }
  .ammo__item strong { font-size: 1rem; }
  .lives, .level-value { font-size: 0.875rem; }
  .progress-chip, .wind-chip { min-height: 22px; font-size: 0.875rem; }
  .icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}

/* Final compact controls and overlays. Effects stay enabled by the runtime,
   so the user-facing preference surface only exposes music and sound. */
.preference-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 6px;
  margin-top: 10px;
}

.preference-button {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  height: 48px;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 6px 8px;
  overflow: hidden;
  font-size: 1.125rem;
  line-height: 1;
  text-align: left;
}

.preference-button::after {
  display: none;
  content: none;
}

.preference-label {
  min-width: 0;
  overflow: hidden;
  font-size: 1.125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preference-icon,
.preference-button[aria-pressed="false"] .preference-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.preference-button[aria-pressed="false"] {
  opacity: 0.72;
  text-decoration: none;
}

.preference-button[aria-pressed="false"] .preference-label { text-decoration: line-through; }

/* HUD is visually passive so the canvas can receive aim gestures, but the
   pause control remains an explicit interactive island above it. */
.hud #pause-button { pointer-events: auto; }
.hud #pause-button:disabled,
body.is-tutorial .hud #pause-button { pointer-events: none; }

.sponsor-mark--home {
  top: 8px;
  right: auto;
  bottom: auto;
  left: 50%;
  min-width: 120px;
  transform: translateX(-50%);
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

.sponsor-mark--home img { width: 120px; }
.home-mentor { transform: translateY(22px); }

.result-card {
  width: min(100%, 410px);
  max-height: min(470px, calc(100% - 12px));
  padding: 12px 16px 14px;
  overflow: auto;
}

.result-card .modal__kicker { display: none; }
.result-card h2 { margin: 0 0 2px; font-size: 2rem; line-height: 1; }

.result-card .sponsor-mark--result {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 1rem;
  letter-spacing: 0;
  line-height: 1;
  text-align: left;
  text-transform: none;
}

.result-card .sponsor-mark--result span { font-size: 1rem; }
.result-card .sponsor-mark--result img { width: 120px; height: 32px; object-fit: contain; }
.result-card .result-score { margin: 4px 0 2px; font-size: clamp(2.75rem, 12vw, 3rem); line-height: 0.95; }
.result-card #result-detail { margin: 2px 0 8px; font-size: 1.125rem; }
.result-card .result-publish { margin-top: 0; }
.result-card .field { margin-bottom: 6px; }
.result-card .field span { margin-bottom: 3px; }
.result-card .field input { height: 44px; }
.result-card .primary-button { min-height: 48px; }
.result-card .result-status { min-height: 16px; margin: 4px 0 0; font-size: 1rem; line-height: 1.1; }

.result-card .result-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.result-card .result-actions #restart-button,
.result-card .result-actions #home-button {
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 8px 6px;
  font-size: 1.125rem;
}

.result-card .preference-row { margin-top: 8px; }

/* The home sponsor shares the copy column so it stays visible in the first
   viewport. Keep it a short, readable strip instead of an absolutely
   positioned footer inside the Mentor artwork. */
.home-copy > .sponsor-mark--home {
  position: static;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #2b4773;
  font-size: 1rem;
  letter-spacing: 0;
  line-height: 1;
  text-align: left;
  text-transform: none;
  transform: none;
}

.home-copy > .sponsor-mark--home span { flex: 0 0 auto; font-size: 1rem; }
.home-copy > .sponsor-mark--home img {
  width: 120px;
  height: 32px;
  object-fit: contain;
}

/* A height-reduced arena still owns its 9:16 size; center that block inside
   the wider shell while leaving the touch controls on their own full track. */
@media (pointer: coarse), (max-width: 720px) {
  body[data-screen="game"] .stage,
  body[data-screen="tutorial"] .stage,
  body[data-screen="pause"] .stage,
  body[data-screen="result"] .stage,
  body[data-screen="task-complete"] .stage,
  body[data-screen="overlay"] .stage {
    justify-self: center;
    margin-inline: auto;
  }

  .home-copy > .sponsor-mark--home { justify-content: center; }
}

/* Keep the compact result actions legible when both labels wrap in the
   two-column layout without increasing the card height. */
.result-card .result-actions #restart-button,
.result-card .result-actions #home-button {
  padding: 4px 6px;
  line-height: 1.05;
}

@media (max-height: 720px) and (max-width: 720px) and (orientation: portrait) {
  /* The sponsor and Mentor are the useful first-viewport landmarks. Remove
     secondary home copy only at this constrained height, while keeping all
     actionable controls at their minimum hit size. */
  .home-note { display: none; }

  .home-copy > .sponsor-mark--home { margin-bottom: 4px; }
  .home-wordmark { width: min(100%, 240px); }
  .home-description {
    display: -webkit-box;
    max-height: 52px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .home-actions .primary-button--hero {
    grid-column: 1 / -1;
    width: 100%;
  }
  .home-actions .secondary-button,
  .home-actions .link-button {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    line-height: 1.05;
  }
  .primary-button--hero { min-height: 52px; }
  .home-actions .secondary-button { min-height: 48px; }
  .home-art {
    min-height: 150px;
    margin-top: 0;
  }
  .home-mentor {
    width: min(52%, 190px);
    transform: translateY(8px);
  }
}
