@font-face {
  font-family: Kufam;
  src: url("ui-art/Kufam.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #100d16;
  --ink: #fff0d9;
  --muted: #c0ad9b;
  --accent: #ffcb78;
  --edge: #775136;
  --panel: #1c1322;
  --ui-frame: url("ui-art/dialogue-frame.png");
  font-family: Kufam, "Instrument Sans", "Avenir Next", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background: radial-gradient(ellipse at 41% -34%, #4d3037 0, #231827 43%, var(--background) 73%);
  color: var(--ink);
}
button { font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible, canvas:focus-visible {
  outline: 2px solid #ffe09d;
  outline-offset: 3px;
}

.shell {
  width: min(100% - 48px, clamp(760px, calc((100svh - 156px) * 16 / 9), 1220px));
  margin-inline: auto;
}
.masthead, .identity, .game-actions { display: flex; align-items: center; }
.masthead {
  justify-content: space-between;
  gap: 14px;
  padding: 15px 0;
}
.identity { gap: 11px; }
.seal {
  width: 20px;
  height: 42px;
  object-fit: contain;
}
.wordmark { margin: 0; font-weight: 750; font-size: 18px; line-height: 1.08; }
.wordmark span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .065em;
}
.game-actions { gap: 8px; }
.text-button, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 44px;
  border: 8px solid transparent;
  border-inline-width: clamp(9px, 1cqw, 13px);
  border-image: url("ui-art/button.png") 12 25 fill stretch;
  padding: 3px .46em 2px;
  background-color: transparent;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}
.text-button {
  font-size: 12px;
}
.text-button:is(:hover, :focus-visible):not(:disabled),
.primary:is(:hover, :focus-visible):not(:disabled) { filter: brightness(1.18); }
.text-button:active:not(:disabled), .primary:active:not(:disabled) { filter: brightness(.84); }
.text-button:disabled, .primary:disabled { opacity: .48; filter: saturate(.44); }
.button-icon { flex: 0 0 auto; font: 500 1.14em/1 sans-serif; }
.text-button kbd {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: .86em;
  line-height: 1;
}
.pause-control img { width: 22px; height: auto; image-rendering: pixelated; }

.stage {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--edge);
  background: #332631;
  box-shadow: 0 0 0 3px #080910, 0 24px 80px #0009;
  container-type: inline-size;
}
#scene {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
#scene:focus { outline: none; }
.intro-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.intro-seal {
  position: absolute;
  inset: 4.5% 4% auto auto;
  width: clamp(15px, 3.6cqw, 45px);
  height: auto;
  filter: drop-shadow(0 2px 3px #1b0f22c9);
  display: none;
  pointer-events: none;
}
body:is([data-phase="opening"], [data-phase="prologue"]) .intro-seal { display: block; z-index: 1; }
.intro-still:not([hidden]) ~ .dialogue {
  grid-template-columns: minmax(0, 1fr) auto;
}
.intro-still:not([hidden]) ~ .dialogue #portrait { display: none; }
.screen-panel { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
body[data-phase="language"] :is(.game-actions, .status-strip, .controls, .wordmark > span:last-child, #title-panel) {
  display: none;
}
#language-panel {
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 100%, #8b493947, transparent 70%),
    linear-gradient(160deg, #211524d9, #170f1bed 65%);
}
.language-card {
  width: min(91%, 455px);
  padding: clamp(7px, 2.8cqw, 27px) clamp(8px, 3.7cqw, 42px);
  border: solid transparent;
  border-width: clamp(7px, 1.05cqw, 13px) clamp(9px, 1.6cqw, 20px);
  border-image: var(--ui-frame) 13 20 fill stretch;
  filter: drop-shadow(0 7px 16px #0f0811c9);
}
.language-seal {
  display: block;
  width: clamp(12px, 2.6cqw, 27px);
  height: clamp(30px, 6.5cqw, 67px);
  margin: 0 auto clamp(5px, 1.1cqw, 11px);
  object-fit: contain;
}
.language-card h2 {
  margin: 0;
  color: #ffe4ad;
  font-size: clamp(18px, 4.3cqw, 38px);
  line-height: 1.25;
}
.language-title-ar, .language-note {
  display: block;
  margin: .2em 0 0;
  color: var(--muted);
  font-size: clamp(13px, 2.2cqw, 20px);
  font-weight: 650;
  line-height: 1.4;
}
.language-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, .9cqw, 12px);
  margin-top: clamp(9px, 2.1cqw, 24px);
}
.language-options .primary { font-size: clamp(12px, 1.8cqw, 19px); }
.language-options .primary[aria-pressed="true"] { color: #ffe1a6; }
.prologue-panel {
  align-items: center;
  justify-items: start;
  background:
    linear-gradient(90deg, #170e1cf7 4%, #231523ec 50%, #24152334 100%),
    linear-gradient(0deg, #130e1cce, transparent 45%);
  color: var(--ink);
  text-align: left;
}
.prologue-panel::before {
  content: "";
  position: absolute;
  inset: 9% 1.5% 0 61%;
  background: url("actor-art/hassan-approved-portrait.png") right bottom / contain no-repeat;
  filter: drop-shadow(-10px 5px 18px #160d20c9);
  transform: scaleX(-1);
  pointer-events: none;
}
.prologue-copy {
  position: relative;
  width: 53%;
  margin-inline: 7%;
  padding-block: 3cqw;
}
.prologue-copy h2 {
  margin: .08em 0 .27em;
  color: #ffe4ad;
  font-size: clamp(25px, 7cqw, 86px);
  line-height: 1;
  letter-spacing: -.055em;
}
.prologue-body p {
  font-size: clamp(11px, 1.85cqw, 22px);
  line-height: 1.5;
  margin: 0 0 .7em;
}
.prologue-copy button { margin-top: .28em; }
@media (max-width: 570px) {
  body[data-phase="prologue"] .stage {
    width: 100%;
    min-width: 0;
    min-height: 218px;
  }
  body[data-phase="prologue"] #scene {
    position: absolute;
    inset: 0;
    object-fit: cover;
  }
}
@container (max-width: 570px) {
  .prologue-panel::before { opacity: .16; inset: 4% 0 0 52%; }
  .prologue-copy { width: 88%; margin-inline: 6%; }
  .prologue-body p { line-height: 1.36; }
}
@container (max-width: 390px) {
  .prologue-copy { padding-block: 2.7cqw; }
  .prologue-copy h2 { margin-bottom: .2em; }
  .prologue-body p { margin-bottom: .4em; }
}
.title-panel {
  justify-items: start;
  align-items: center;
  padding: 3cqw 6.5cqw 0;
  text-align: left;
  background: linear-gradient(90deg, #12111bd6 0%, #151222a2 29%, #16102131 57%, transparent 75%),
    linear-gradient(0deg, #120c16b0 0%, #140e1b00 24%, #140e1b00 75%, #140e1b42 100%);
  text-shadow: 0 2px 1px #140b13, 0 5px 25px #140a15;
}
body:is([data-phase="loading"], [data-phase="error"]) .title-panel {
  background: radial-gradient(ellipse at 84% 4%, #422b2d, #19151f 65%);
}
.title-panel > div { margin-top: -2cqw; }
.kicker {
  margin: 0;
  color: var(--accent);
  font-weight: 750;
  font-size: clamp(9px, 1.26cqw, 13px);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.kicker span { padding: 0 .35em; opacity: .75; }
h1, h2 { font-weight: 800; }
h1 {
  margin: .12em 0 .28em;
  font-size: clamp(27px, 7.4cqw, 90px);
  line-height: .98;
  letter-spacing: -.055em;
}
.primary {
  gap: .65em;
  padding: .5em .88em .4em;
  filter: drop-shadow(0 4px 6px #100811aa);
  font-size: clamp(10px, 1.55cqw, 17px);
  font-weight: 750;
}
.title-note {
  margin: clamp(8px, 1.3cqw, 16px) 0 0;
  max-inline-size: 38ch;
  font-size: clamp(10px, 1.25cqw, 14px);
  color: var(--ink);
}
.fullscreen-status {
  position: absolute;
  z-index: 5;
  inset: auto var(--play-right, 12px) var(--play-bottom, 12px) var(--play-left, 12px);
  width: fit-content;
  max-width: calc(100% - var(--play-right, 12px) - var(--play-left, 12px));
  margin: 0 auto;
  padding: 6px 10px;
  background: var(--panel);
  color: var(--ink);
  text-align: center;
  font-size: 12px;
  pointer-events: none;
}

.hud {
  position: absolute;
  inset: 2.6% 2.2% auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}
.hud-player { display: flex; align-items: flex-start; min-width: 0; gap: clamp(3px, .75cqw, 9px); }
.hud-portrait {
  position: relative;
  width: clamp(41px, 7.7cqw, 97px);
  flex: 0 0 auto;
  aspect-ratio: 110 / 97;
  filter: drop-shadow(1px 3px 2px #100812cc);
}
.hud-portrait img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.hud-portrait span {
  position: absolute;
  inset: auto auto 4.8% 50%;
  transform: translateX(-50%) scaleX(.74);
  text-align: center;
  color: #fff1cd;
  text-shadow: 0 1px 2px #000;
  font-size: clamp(4.8px, .82cqw, 10px);
  line-height: 1;
  white-space: nowrap;
  font-weight: 800;
  text-transform: uppercase;
}
.hud-vitals { display: grid; gap: clamp(2px, .3cqw, 4px); }
.health {
  position: relative;
  width: clamp(96px, 21cqw, 270px);
  margin: clamp(2px, .4cqw, 6px) 0 0;
  aspect-ratio: 284 / 42;
  filter: drop-shadow(1px 3px 2px #100812cc);
}
.health-track {
  position: absolute;
  inset: 21% 1.4% 22%;
  background: #381b2c;
  overflow: hidden;
  clip-path: polygon(0 0, 94% 0, 100% 50%, 94% 100%, 0 100%);
}
.health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(#fb6463 0%, #d32d39 27%, #a91a2c 78%, #710f2a 100%);
  transition: width .14s ease;
}
.health-frame {
  position: absolute;
  inset: 6% 0;
  background: url("ui-art/health-frame.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
.health-text {
  position: absolute;
  inset: 6% 5% 0 0;
  display: grid;
  place-items: center;
  color: #fff7e7;
  text-shadow: 0 1px 2px #471025, 0 1px 3px #2b0b16;
  font-size: clamp(6px, 1.2cqw, 14px);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}
.lives {
  display: flex;
  align-items: center;
  gap: clamp(3px, .44cqw, 6px);
  color: #fff1cd;
  font-size: clamp(7px, 1.05cqw, 13px);
  font-weight: 750;
  line-height: 1;
  text-shadow: 0 1px 2px #100812, 0 0 4px #100812;
}
.life-heart {
  display: block;
  width: clamp(11px, 2.1cqw, 26px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(1px 2px 1px #100812cc);
}
.life-heart.spent { filter: grayscale(1) brightness(.55) drop-shadow(1px 2px 1px #100812cc); }
.supplies {
  position: relative;
  flex: 0 0 auto;
  width: clamp(27px, 4.45cqw, 56px);
  aspect-ratio: 1;
  filter: drop-shadow(1px 3px 2px #100812cc);
}
.bandage-icon { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.supply-count {
  position: absolute;
  inset: auto 13% 9% auto;
  font-size: clamp(7px, 1.19cqw, 13px);
  font-weight: 780;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}
.supplies kbd {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
  min-width: 27%;
  border-color: #a97936;
  padding: .08em .28em 0;
  font-size: clamp(5px, .79cqw, 9px);
  border-radius: 1px;
  background: #221326;
}
.hud-progress {
  min-width: min(88px, 23cqw);
  padding: clamp(2px, .25cqw, 4px) clamp(4px, .45cqw, 7px);
  border: solid transparent;
  border-width: clamp(5px, .75cqw, 10px) clamp(7px, 1.06cqw, 14px);
  border-image: var(--ui-frame) 13 20 fill stretch;
  text-align: right;
  filter: drop-shadow(1px 3px 2px #100812bb);
}
.hud-progress span {
  color: #ffe7cd;
  text-transform: uppercase;
  font-size: clamp(5px, .94cqw, 11px);
  font-weight: 750;
  letter-spacing: .10em;
}
.hud-progress strong { display: block; margin-top: 1px; font-size: clamp(8px, 1.33cqw, 16px); }
.hint {
  position: absolute;
  top: 16.5%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 88%;
  width: max-content;
  padding: .35em .62em .28em;
  text-align: center;
  border: solid transparent;
  border-width: clamp(6px, .78cqw, 10px) clamp(8px, 1.1cqw, 14px);
  border-image: var(--ui-frame) 13 20 fill stretch;
  color: #fff4df;
  filter: drop-shadow(0 3px 6px #120a17ad);
  font-size: clamp(12px, 2.02cqw, 25px);
  font-weight: 750;
  line-height: 1.24;
  pointer-events: none;
}
.hint kbd {
  display: inline-block;
  min-width: 1.54em;
  padding: .14em .34em .09em;
  border-color: #e5b77a;
  background: #f0ce8d;
  color: #342138;
  font-size: .82em;
  font-weight: 850;
  vertical-align: .06em;
}
body:not([data-input="touch"]) .hint[data-feedback="true"] {
  font-size: clamp(11px, 1.55cqw, 18px);
  font-weight: 680;
}
@container (max-width: 500px) {
  .hint { top: 19%; }
}

.dialogue {
  position: absolute;
  inset: auto 2.2% 3.2%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.6cqw;
  border: solid transparent;
  border-width: clamp(7px, 1.1cqw, 14px) clamp(10px, 1.65cqw, 20px);
  border-image: var(--ui-frame) 13 20 fill stretch;
  filter: drop-shadow(0 4px 10px #100812ad);
  padding: .5cqw;
}
.dialogue:has(#portrait[hidden]) { grid-template-columns: minmax(0, 1fr) auto; }
#portrait {
  width: clamp(31px, 8.6cqw, 96px);
  aspect-ratio: 1;
  border: 1px solid #ab7c42;
  background: #2b1b30;
  image-rendering: pixelated;
}
.dialogue p { margin: 0; }
.dialogue #line { margin-top: .25em; color: #fff3e1; font-size: clamp(9px, 1.62cqw, 19px); line-height: 1.38; }
.next {
  justify-self: end;
  min-width: clamp(83px, 9cqw, 114px);
}
.dialogue-questions {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 84px), 1fr));
  gap: clamp(4px, .7cqw, 10px);
}
.dialogue-questions .text-button {
  min-width: 0;
  font-size: clamp(10px, 1.42cqw, 16px);
  white-space: normal;
}
.dialogue-questions:not([hidden]) + .next { grid-column: -2 / -1; grid-row: 1; }
.boss-intro {
  --duel-duration: 2050ms;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 48%, #4a2927bb, #110c16d9 85%),
    linear-gradient(90deg, #151022ac, #12101c2e 50%, #21101aaf);
  animation: duel-overlay var(--duel-duration) ease both;
}
.boss-intro::before {
  content: "";
  position: absolute;
  inset: 4% 2.2%;
  z-index: -1;
  border: 1px solid #e8ad6266;
  box-shadow: inset 0 0 0 3px #241428, 0 0 0 2px #241428;
  background:
    repeating-linear-gradient(45deg, #e8ad6215 0 1px, transparent 1px 12px),
    repeating-linear-gradient(-45deg, #e8ad6215 0 1px, transparent 1px 12px);
  mask-image: linear-gradient(black, transparent 40% 60%, black);
}
.duel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: min(86%, 850px);
  margin: 0;
  padding-block: 3.2cqw;
  text-transform: uppercase;
}
.duel::before, .duel::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ba7548 16%, #ffda96 50%, #ba7548 84%, transparent);
  box-shadow: 0 3px 0 #d4995640, 0 -3px 0 #d4995640;
  animation: duel-rule 460ms ease-out both;
}
.duel::before { top: 0; }
.duel::after { bottom: 0; }
.duel-entrant {
  display: grid;
  justify-items: center;
  min-width: 0;
  animation: duel-entrance 500ms cubic-bezier(.19, .75, .25, 1) both;
}
.duel-entrant--hassan {
  --from: -17cqw;
  --portrait-color: #3c4552;
}
.duel-entrant--saddam {
  --from: 17cqw;
  --portrait-color: #5c3031;
}
.duel-portrait {
  --arch: polygon(50% 0, 63% 7%, 77% 13%, 86% 22%, 94% 30%, 97% 42%, 97% 53%, 94% 64%,
    89% 73%, 89% 100%, 11% 100%, 11% 73%, 6% 64%, 3% 53%, 3% 42%, 6% 30%, 14% 22%, 23% 13%, 37% 7%);
  position: relative;
  display: block;
  width: clamp(65px, 21cqw, 240px);
  aspect-ratio: 164 / 170;
  clip-path: var(--arch);
  background: linear-gradient(145deg, #ffdb91, #8f4d35 60%, #d8a15c);
}
.duel-portrait::before {
  content: "";
  position: absolute;
  inset: clamp(2px, .33cqw, 4px) clamp(2px, .33cqw, 4px) 0;
  clip-path: var(--arch);
  background-color: var(--portrait-color);
  background-image: url("intro-art/saddam.webp");
  background-size: 372% auto;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  transform: scaleX(-1);
}
.duel-entrant--hassan .duel-portrait::before {
  background-position: 83.5% 0;
}
.duel-entrant--saddam .duel-portrait::before {
  background-position: 17% 0;
}
.duel-name {
  position: relative;
  width: 100%;
  margin-top: -.2cqw;
  padding: .3em .18em .17em;
  border: solid transparent;
  border-width: clamp(4px, .72cqw, 10px) clamp(7px, 1.12cqw, 16px);
  border-image: var(--ui-frame) 13 20 fill stretch;
  color: #ffe7bd;
  filter: drop-shadow(0 3px 7px #1d0f19);
  font-size: clamp(14px, 4.15cqw, 51px);
  line-height: 1;
  letter-spacing: -.04em;
  white-space: nowrap;
  text-shadow: 0 2px 2px #240f15;
}
.duel-versus {
  --seal: polygon(50% 0, 64% 15%, 86% 14%, 85% 36%, 100% 50%, 85% 64%, 86% 86%, 64% 85%,
    50% 100%, 36% 85%, 14% 86%, 15% 64%, 0 50%, 15% 36%, 14% 14%, 36% 15%);
  position: relative;
  display: grid;
  place-items: center;
  grid-template: 1fr / 1fr;
  width: clamp(40px, 10cqw, 112px);
  aspect-ratio: 1;
  margin-inline: clamp(7px, 2cqw, 24px);
  margin-top: 3cqw;
  clip-path: var(--seal);
  background: linear-gradient(135deg, #ffe5a3, #c47c43 62%, #ffda88);
  color: #fff2d2;
  font-size: clamp(13px, 3.3cqw, 37px);
  line-height: 1;
  text-shadow: 0 2px 2px #421a25;
  animation: duel-seal 490ms 110ms cubic-bezier(.19, .75, .25, 1) both;
}
.duel-versus::before {
  content: "";
  grid-area: 1 / 1;
  width: 89%;
  aspect-ratio: 1;
  clip-path: var(--seal);
  background: radial-gradient(ellipse at 50% 30%, #814237, #3d1e2f 80%);
}
.duel-versus > span {
  grid-area: 1 / 1;
  z-index: 1;
  padding-top: .15em;
}
@keyframes duel-overlay {
  0%, 100% { opacity: 0; }
  10%, 82% { opacity: 1; }
}
@keyframes duel-rule {
  from { transform: scaleX(.44); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}
@keyframes duel-entrance {
  from { transform: translateX(var(--from)); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
body[data-input="touch"] .duel-versus { --duel-seal-start-scale: 1; }
@keyframes duel-seal {
  from { transform: scale(var(--duel-seal-start-scale, 1.45)) rotate(-18deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.pause-panel { background: #14101cc9; }
.pause-card {
  width: min(90%, 515px);
  border: solid transparent;
  border-width: clamp(7px, 1.05cqw, 13px) clamp(8px, 1.6cqw, 20px);
  border-image: var(--ui-frame) 13 20 fill stretch;
  padding: clamp(3px, 1.6cqw, 19px);
  filter: drop-shadow(0 7px 16px #0f0811c9);
}
.pause-panel h2 {
  margin: 0 0 .3em;
  font-size: clamp(21px, 4.5cqw, 48px);
  line-height: 1.1;
}
.pause-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(4px, .85cqw, 10px);
}
.pause-options .primary {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 48%;
}
.pause-options .text-button {
  padding-inline: 9px;
  white-space: normal;
  line-height: 1.12;
}
.pause-checkpoint-note {
  display: none;
  margin: .6em 0 0;
  color: var(--muted);
  font-size: clamp(10px, 1.45cqw, 14px);
  line-height: 1.15;
}
.pause-options:has(#restart-checkpoint-button:disabled) + .pause-checkpoint-note { display: block; }
.ending-panel {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 4cqw 3cqw 2cqw;
  background: linear-gradient(transparent, #141018f7);
}
.ending-panel h2 { margin: .14em 0 0; font-size: clamp(17px, 3.4cqw, 39px); }
.ending-panel .text-button { flex: 0 0 auto; }

.status-strip, .controls { display: flex; align-items: center; }
.status-strip {
  justify-content: space-between;
  gap: 16px;
  min-height: 37px;
  padding: 6px 9px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-top: 0;
  font-size: 12px;
}
.status-strip p { margin: 0; }
#objective { color: #f6d1a6; font-weight: 650; }
.level-name { flex: 0 0 auto; color: var(--muted); text-align: right; }
.controls {
  flex-wrap: wrap;
  gap: 8px 19px;
  padding: 12px 0 17px;
  color: #d6c6b7;
  font-size: 12px;
}
.control, .control > div { display: flex; align-items: center; gap: 5px; }
kbd {
  display: inline-block;
  min-width: 21px;
  padding: 2px 5px;
  background: #1e1b24;
  border: 1px solid #51414a;
  border-radius: 3px;
  color: #ffe0be;
  font: 600 11px/1.3 ui-monospace, monospace;
  text-align: center;
}

:root[dir="rtl"] {
  font-family: Kufam, "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
}
:root[dir="rtl"] :is(.wordmark span, .kicker, h1, .prologue-copy h2, .duel-name, .hud-progress span) {
  letter-spacing: normal;
}
:root[dir="rtl"] :is(h1, .prologue-copy h2, .duel-name) { line-height: 1.18; }
:root[dir="rtl"] :is(.title-panel, .prologue-panel) { text-align: start; }
:root[dir="rtl"] .title-panel {
  background: linear-gradient(270deg, #12111be6 0%, #151222ab 28%, #1610213d 57%, transparent 76%),
    linear-gradient(0deg, #120c16b0 0%, transparent 24% 75%, #140e1b42 100%);
}
:root[dir="rtl"] body:is([data-phase="loading"], [data-phase="error"]) .title-panel {
  background: radial-gradient(ellipse at 16% 4%, #422b2d, #19151f 65%);
}
:root[dir="rtl"] .prologue-panel {
  background:
    linear-gradient(270deg, #170e1cf7 4%, #231523ec 50%, #24152334 100%),
    linear-gradient(0deg, #130e1cce, transparent 45%);
}
:root[dir="rtl"] .prologue-panel::before {
  inset: 9% 61% 0 1.5%;
  background-position: left bottom;
  transform: none;
  filter: drop-shadow(10px 5px 18px #160d20c9);
}
:root[dir="rtl"] .prologue-body p { line-height: 1.65; }
:root[dir="rtl"] body[data-phase="prologue"] .intro-seal { inset: 4.5% auto auto 4%; }
:root[dir="rtl"] :is(#start-button, #prologue-continue, #continue-button, #resume-button) .button-icon {
  transform: scaleX(-1);
}
:root[dir="rtl"] .hud-portrait span {
  transform: translateX(-50%);
  font-size: clamp(6px, 1.02cqw, 12px);
}
:root[dir="rtl"] .health-frame { transform: scaleX(-1); }
:root[dir="rtl"] .health-track { clip-path: polygon(6% 0, 100% 0, 100% 100%, 6% 100%, 0 50%); }
:root[dir="rtl"] .health-text { inset: 6% 0 0 5%; }
:root[dir="rtl"] :is(.hud-progress, .level-name) { text-align: end; }
:root[dir="rtl"] .hud-progress span { font-size: clamp(7px, 1.05cqw, 13px); }
:root[dir="rtl"] .hud-progress strong { unicode-bidi: isolate; }
:root[dir="rtl"] :is(#scene, #portrait, .duel, .control > div, kbd) { direction: ltr; }
:root[dir="rtl"] :is(.duel-name, .duel-versus) { direction: rtl; }
:root[dir="rtl"] :is(kbd, #guards) { unicode-bidi: isolate; }
:root[dir="rtl"] .dialogue #line { font-size: clamp(11px, 1.66cqw, 20px); line-height: 1.53; }
:root[dir="rtl"] :is(.dialogue-questions .text-button, .pause-options .text-button, .pause-checkpoint-note) {
  line-height: 1.38;
}
:root[dir="rtl"] .ending-panel { text-align: start; }

@container (max-width: 570px) {
  :root[dir="rtl"] .prologue-panel::before { inset: 4% 52% 0 0; }
  :root[dir="rtl"] .prologue-body p { line-height: 1.48; }
}
@container (max-width: 390px) {
  :root[dir="rtl"] .prologue-body p { line-height: 1.4; }
  :root[dir="rtl"] .pause-card { width: 96%; padding-block: 3px; }
  :root[dir="rtl"] .pause-panel h2 { margin-bottom: .18em; font-size: clamp(17px, 4.2cqw, 21px); }
  :root[dir="rtl"] .pause-checkpoint-note { margin-top: .3em; }
  .language-card { padding-block: clamp(4px, 1.8cqw, 8px); }
}

@media (max-width: 600px) {
  .shell { width: calc(100% - 18px); }
  .masthead { padding-block: 10px; }
  .game-actions { gap: 4px; }
  .text-button { font-size: 11px; }
  .pause-control img { width: 17px; }
  .controls { gap: 6px 10px; }
  .control { font-size: 11px; }
  .status-strip { min-height: 34px; font-size: 10px; }
}
@media (max-width: 475px) {
  :root[dir="rtl"] .masthead, .masthead:has(#language-button:not([hidden])) { flex-wrap: wrap; gap: 6px 10px; }
  .masthead:has(#language-button:not([hidden])) .identity { gap: 8px; }
  .game-actions:has(#language-button:not([hidden])) .text-button { padding-inline: .25em; }
  .game-actions:has(#language-button:not([hidden])) #pause-button:disabled { display: none; }
}
@media (max-width: 380px) {
  .pause-control kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .health-fill { transition: none; }
  .boss-intro, .duel::before, .duel::after, .duel-entrant, .duel-versus { animation: none; }
}

.touch-controls { display: none; }

body[data-input="touch"] {
  --play-top: max(8px, env(safe-area-inset-top));
  --play-right: max(12px, env(safe-area-inset-right));
  --play-bottom: max(12px, env(safe-area-inset-bottom));
  --play-left: max(12px, env(safe-area-inset-left));
  overscroll-behavior-y: contain;
}
body[data-input="touch"] .shell {
  width: auto;
  max-width: 960px;
  margin-left: max(8px, env(safe-area-inset-left));
  margin-right: max(8px, env(safe-area-inset-right));
  padding-block: env(safe-area-inset-top) max(8px, env(safe-area-inset-bottom));
}
body[data-input="touch"] .masthead {
  gap: 6px;
  padding-block: 4px;
}
body[data-input="touch"] .identity { gap: 7px; }
body[data-input="touch"] .seal { width: 16px; height: 34px; }
body[data-input="touch"] .wordmark { font-size: 15px; }
body[data-input="touch"] .wordmark span { font-size: 8px; }
body[data-input="touch"] .game-actions { gap: 4px; }
body[data-input="touch"] .game-actions .text-button { padding-inline: .25em; }
body[data-input="touch"] :is(.controls, .pause-control kbd, .supplies kbd) { display: none; }
body[data-input="touch"][data-phase="play"] .wordmark span { display: none; }
body[data-input="touch"] .status-strip {
  min-height: 32px;
  padding: 5px 8px;
  font-size: clamp(10px, 2.3vw, 12px);
}
body[data-input="touch"][data-phase="play"] .level-name { display: none; }
body[data-input="touch"]:is([data-phase="play"], [data-phase="paused"], [data-phase="boss-intro"]) {
  touch-action: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body[data-input="touch"]:is([data-phase="play"], [data-phase="paused"], [data-phase="boss-intro"]) :is(.shell, .stage, .masthead) {
  touch-action: none;
}
body[data-input="touch"][data-phase="play"] .touch-controls {
  --touch-target-size: clamp(52px, calc(12.5cqw + 4px), 66px);
  --touch-left: calc(var(--play-left, 10px) + 6px);
  --touch-right: calc(var(--play-right, 10px) + 6px);
  --touch-bottom: calc(var(--play-bottom, 10px) + 6px);
  --touch-pad-gap: 10px;
  --touch-group-gap: 4px;
  /* Three standard buttons and a 1.8× Attack must fit between the safe edges. */
  --touch-key-size: min(var(--touch-target-size), calc((100cqw - var(--touch-left) - var(--touch-right) - 2 * var(--touch-pad-gap) - var(--touch-group-gap)) / 4.8));
  --touch-attack-size: calc(1.8 * var(--touch-key-size));
  position: absolute;
  inset: auto var(--touch-right) var(--touch-bottom) var(--touch-left);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--touch-group-gap);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.touch-pad {
  display: grid;
  grid-template-columns: repeat(2, var(--touch-key-size));
  justify-items: center;
  gap: var(--touch-pad-gap);
}
.touch-pad--center {
  position: absolute;
  left: 50%;
  bottom: calc(3 * var(--touch-key-size) + 2 * var(--touch-pad-gap) + var(--touch-group-gap));
  transform: translateX(-50%);
  grid-template-columns: var(--touch-key-size);
}
.touch-pad--movement :is([data-game-key="Space"], [data-game-key="ArrowDown"]) {
  grid-column: 1 / -1;
}
.touch-pad--actions {
  grid-template-columns: var(--touch-key-size) var(--touch-attack-size);
  grid-template-rows: repeat(3, var(--touch-key-size));
  grid-template-areas: ". jump" "block attack" "heal attack";
}
.touch-pad--actions [data-game-key="Space"] {
  grid-area: jump;
  justify-self: end;
}
.touch-pad--actions [data-game-key="KeyA"] { grid-area: attack; }
.touch-pad--actions [data-game-key="KeyZ"] { grid-area: block; }
.touch-pad--actions [data-game-key="KeyC"] { grid-area: heal; }
.touch-pad button {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  container-type: inline-size;
  width: var(--touch-key-size);
  height: var(--touch-key-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff0d5;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 3px #100813;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.touch-pad button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid #f5d099;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 32%, #3a282f, #19111c 80%);
  box-shadow: inset 0 0 0 2px #322132, 0 2px 9px #140a1aab;
  opacity: .5;
  pointer-events: none;
}
.touch-pad button span { font-size: clamp(10px, 21cqw, 12px); }
.touch-pad--actions button[data-game-key="KeyA"] {
  align-self: end;
  width: var(--touch-attack-size);
  height: var(--touch-attack-size);
}
.touch-pad--actions button[data-game-key="KeyA"] span { font-size: clamp(13px, 16cqw, 18px); }
.touch-pad button kbd {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #ffe2ab;
  font-size: clamp(15px, 33cqw, 23px);
  font-weight: 750;
  line-height: 1;
}
.touch-pad button:is([data-game-key="Space"], [data-game-key="KeyA"])::before {
  border-color: #ffe0a9;
  background: radial-gradient(circle at 50% 32%, #73453f, #392333 80%);
}
.touch-pad button:is(.is-pressed, :active)::before {
  border-color: #fff3c7;
  background: #784b36;
  box-shadow: inset 0 2px 3px #2f1721, 0 0 0 2px #ffce7b70;
}
.touch-pad button:is(.is-pressed, :active) kbd { color: #fff5ce; }

body[data-input="touch"] .hud-portrait { width: clamp(40px, 8cqw, 74px); }
body[data-input="touch"] .health { width: clamp(100px, 21cqw, 214px); }
body[data-input="touch"] .health-text { font-size: clamp(8px, 1.55cqw, 12px); }
body[data-input="touch"] .lives { font-size: clamp(8px, 1.27cqw, 12px); }
body[data-input="touch"] .supply-count { font-size: clamp(9px, 1.4cqw, 13px); }
body[data-input="touch"] .hud-progress { min-width: 66px; }
:root body[data-input="touch"] .hud-progress span {
  display: block;
  max-width: clamp(64px, 22cqw, 108px);
  font-size: clamp(8px, 1.23cqw, 11px);
  letter-spacing: 0;
  line-height: 1.15;
}
body[data-input="touch"] .hud-progress strong { font-size: clamp(10px, 1.56cqw, 15px); }

@media (min-width: 960px) {
  body[data-input="touch"] .shell {
    margin-left: max(env(safe-area-inset-left), calc((100% - 960px) / 2));
    margin-right: max(env(safe-area-inset-right), calc((100% - 960px) / 2));
  }

}

@media (max-width: 760px) and (orientation: portrait) {
  body[data-input="touch"][data-phase="opening"] .stage {
    aspect-ratio: auto;
  }
  body[data-input="touch"][data-phase="opening"] :is(#scene, .intro-still) {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  body[data-input="touch"] .dialogue {
    position: relative;
    inset: auto;
    padding: 4px;
    gap: 6px;
  }
  :root body[data-input="touch"] .dialogue #line { font-size: clamp(12px, 2.1cqw, 15px); }
  body[data-input="touch"] .dialogue-questions {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 122px), 1fr));
  }
}
@media (max-width: 570px) and (orientation: portrait) {
  body[data-input="touch"][data-phase="prologue"] .stage { min-height: 243px; }
  body[data-input="touch"] .prologue-body p { font-size: 12px; }
  body[data-input="touch"] .level-name { max-width: 40%; }
}

@media (orientation: landscape) and (max-height: 560px) {
  :root body[data-input="touch"] .dialogue #line { font-size: clamp(11px, 2.2cqw, 15px); }
}

body[data-input="touch"]:is([data-phase="language"], [data-phase="rotate"], [data-phase="loading"], [data-phase="error"], [data-phase="title"], [data-phase="play"], [data-phase="paused"], [data-phase="dialogue"], [data-phase="boss-intro"]) {
  overflow: hidden;
}
body[data-input="touch"]:is([data-phase="language"], [data-phase="rotate"], [data-phase="loading"], [data-phase="error"], [data-phase="title"], [data-phase="play"], [data-phase="paused"], [data-phase="dialogue"], [data-phase="boss-intro"]) .shell {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
body[data-input="touch"]:is([data-phase="language"], [data-phase="rotate"], [data-phase="loading"], [data-phase="error"], [data-phase="title"], [data-phase="play"], [data-phase="paused"], [data-phase="dialogue"], [data-phase="boss-intro"]) .stage {
  width: 100%;
  height: 100dvh;
  aspect-ratio: auto;
  border: 0;
  box-shadow: none;
}
body[data-input="touch"]:is([data-phase="language"], [data-phase="rotate"], [data-phase="loading"], [data-phase="error"], [data-phase="title"], [data-phase="play"], [data-phase="paused"], [data-phase="dialogue"], [data-phase="boss-intro"]) .masthead {
  position: absolute;
  inset: var(--play-top) var(--play-right) auto var(--play-left);
  z-index: 3;
}
body[data-input="touch"]:is([data-phase="language"], [data-phase="rotate"], [data-phase="loading"], [data-phase="error"], [data-phase="title"], [data-phase="paused"], [data-phase="dialogue"], [data-phase="boss-intro"]) .status-strip {
  display: none;
}
body[data-input="touch"][data-phase="dialogue"] .intro-still {
  object-fit: contain;
  background: #17101e;
}
body[data-input="touch"][data-phase="dialogue"] .dialogue {
  position: absolute;
  inset: auto var(--play-right) var(--play-bottom) var(--play-left);
  max-height: calc(100% - var(--play-top) - var(--play-bottom) - 48px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
@media (orientation: landscape) {
  body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"], [data-phase="ending"]) {
    overflow: hidden;
  }
  body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"], [data-phase="ending"]) .shell {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"], [data-phase="ending"]) .stage {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    aspect-ratio: auto;
    border: 0;
    box-shadow: none;
  }
  body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"], [data-phase="dialogue"], [data-phase="ending"]) :is(#scene, .intro-still) {
    object-fit: cover;
  }
  body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"], [data-phase="dialogue"], [data-phase="ending"]) .masthead {
    position: absolute;
    inset: var(--play-top) var(--play-right) auto var(--play-left);
    z-index: 3;
    justify-content: flex-start;
    padding: 0;
    pointer-events: none;
  }
  body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"], [data-phase="dialogue"], [data-phase="ending"]) .game-actions {
    pointer-events: auto;
  }
  body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"], [data-phase="dialogue"], [data-phase="ending"]) :is(.identity, #pause-button),
  body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"]) .status-strip {
    display: none;
  }
  body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"]) .intro-seal {
    inset: max(var(--play-top), 4.5%) max(var(--play-right), 4%) auto auto;
  }
  :root[dir="rtl"] body[data-input="touch"]:is([data-phase="prologue"], [data-phase="opening"]) .intro-seal {
    inset: max(var(--play-top), 4.5%) auto auto max(var(--play-left), 4%);
  }
  body[data-input="touch"][data-phase="prologue"] .prologue-panel {
    align-items: safe center;
    padding: calc(var(--play-top) + 44px) var(--play-right) var(--play-bottom) var(--play-left);
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  body[data-input="touch"][data-phase="prologue"] .prologue-copy h2 {
    font-size: clamp(28px, min(7cqw, 16dvh), 72px);
  }
  body[data-input="touch"][data-phase="prologue"] .prologue-body p {
    font-size: clamp(13px, min(1.85cqw, 4.7dvh), 20px);
  }
  body[data-input="touch"][data-phase="opening"] .dialogue {
    inset: auto var(--play-right) var(--play-bottom) var(--play-left);
    max-height: calc(100% - var(--play-top) - var(--play-bottom) - 48px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  body[data-input="touch"][data-phase="ending"] .ending-panel {
    padding: 4cqw var(--play-right) calc(var(--play-bottom) + 34px) var(--play-left);
  }
  body[data-input="touch"][data-phase="ending"] .status-strip {
    position: absolute;
    inset: auto var(--play-right) var(--play-bottom) var(--play-left);
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    pointer-events: none;
  }
}
body[data-input="touch"]:is([data-phase="language"], [data-phase="rotate"], [data-phase="loading"], [data-phase="error"], [data-phase="title"]) #scene {
  object-fit: cover;
  object-position: 58% 63%;
}
body[data-input="touch"][data-phase="language"] #language-panel {
  background: linear-gradient(180deg, #21152482, #170f1ba3 55%, #140d1be0);
}
body[data-input="touch"][data-phase="language"] .language-card { padding: 16px 12px; }
body[data-input="touch"][data-phase="rotate"] .game-actions { display: none; }
body:not([data-phase="rotate"]) #rotate-panel { display: none; }
.rotate-panel {
  z-index: 2;
  padding: 16px;
  background: linear-gradient(158deg, #291831b3, #110e1be8);
}
.rotate-card {
  width: min(100%, 335px);
  padding: 21px 17px 17px;
  border: 10px solid transparent;
  border-image: var(--ui-frame) 13 20 fill stretch;
  filter: drop-shadow(0 6px 14px #100912bf);
}
.rotate-card h2 {
  margin: 11px 0 8px;
  color: #ffdfa6;
  font-size: clamp(20px, 6.1cqw, 28px);
  line-height: 1.22;
}
.rotate-card p {
  margin: 0 auto 14px;
  max-width: 29ch;
  color: #f2e4d3;
  font-size: 13px;
  line-height: 1.5;
}
.rotate-card .text-button { font-size: 13px; }
.rotate-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 55px;
  color: #efc58f;
}
.rotate-phone {
  position: relative;
  display: block;
  border: 2px solid;
  border-radius: 6px;
  background:
    linear-gradient(34deg, #451f30 24%, transparent 25%),
    linear-gradient(145deg, #52313d 25%, #2d1a34 26% 58%, #7d483f 59% 72%, #351d2e 73%);
  box-shadow: inset 0 0 0 3px #1a1124, 0 3px 8px #140c20b0;
}
.rotate-phone::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.rotate-phone--upright { width: 29px; height: 51px; transform: rotate(-12deg); }
.rotate-phone--upright::before { top: 2px; left: 7px; }
.rotate-phone--wide { width: 62px; height: 34px; }
.rotate-phone--wide::before { top: 14px; left: -1px; transform: rotate(90deg); }
.rotate-arrow {
  position: relative;
  width: 28px;
  height: 17px;
  border: solid #f2bb73;
  border-width: 2px 2px 0 0;
  border-radius: 50% 58% 0 0;
  transform: rotate(9deg);
}
.rotate-arrow::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 6px;
  border: solid #f2bb73;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
body[data-input="touch"]:is([data-phase="play"], [data-phase="paused"], [data-phase="boss-intro"]) .masthead {
  z-index: 5;
  justify-content: flex-end;
  padding: 0;
  pointer-events: none;
}
body[data-input="touch"]:is([data-phase="play"], [data-phase="paused"], [data-phase="boss-intro"]) .identity { display: none; }
body[data-input="touch"]:is([data-phase="play"], [data-phase="paused"], [data-phase="boss-intro"]) .game-actions { gap: 8px; }
body[data-input="touch"]:is([data-phase="play"], [data-phase="paused"], [data-phase="boss-intro"]) .masthead .text-button {
  position: relative;
  width: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid #eed18bb3;
  border-radius: 50%;
  border-image: none;
  background: #271a2de5;
  box-shadow: 0 2px 6px #150f18b3;
  font-size: 0;
  pointer-events: auto;
}
body[data-input="touch"]:is([data-phase="play"], [data-phase="paused"], [data-phase="boss-intro"]) #sound-button::after {
  content: "♪" / "";
  color: #ffe2aa;
  font: 800 24px/1 sans-serif;
}
body[data-input="touch"]:is([data-phase="play"], [data-phase="paused"], [data-phase="boss-intro"]) #sound-button[aria-pressed="true"]::after {
  opacity: .6;
  text-decoration: line-through;
}
body[data-input="touch"]:is([data-phase="play"], [data-phase="paused"], [data-phase="boss-intro"]) .pause-control img { width: 20px; }
body[data-input="touch"][data-phase="paused"] .pause-control img { display: none; }
body[data-input="touch"][data-phase="paused"] .pause-control::after {
  content: "▶" / "";
  color: #ffe2aa;
  font: 800 17px/1 sans-serif;
}
body[data-input="touch"][data-phase="paused"] #fullscreen-button::after {
  content: "⛶" / "";
  color: #ffe2aa;
  font: 800 21px/1 sans-serif;
}
body[data-input="touch"][data-phase="boss-intro"] #pause-button { display: none; }
body[data-input="touch"][data-phase="play"] main { position: relative; }
body[data-input="touch"][data-phase="play"] .status-strip {
  position: absolute;
  inset: calc(var(--play-top) + 58px) 0 auto;
  z-index: 1;
  width: max-content;
  max-width: min(75%, 330px);
  min-height: 0;
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: none;
}
body[data-input="touch"][data-phase="play"] #objective {
  margin: 0;
  padding: 5px 8px;
  border: 1px solid #e6b17e70;
  border-radius: 6px;
  background: #1c1424de;
  color: #fff0d2;
  font-size: clamp(10px, 1.5cqw, 12px);
  line-height: 1.34;
}
body[data-input="touch"][data-phase="play"] .hud {
  inset: var(--play-top) var(--play-right) auto var(--play-left);
  padding-inline-end: 116px;
}
body[data-input="touch"][data-phase="play"] .hint {
  top: calc(var(--play-top) + 93px);
  max-width: min(calc(100% - var(--play-left) - var(--play-right)), 250px);
  padding: .18em .48em;
  border-width: 3px 5px;
  font-size: clamp(11px, 1.35cqw, 13px);
  line-height: 1.24;
}

@media (orientation: landscape) and (min-width: 550px) {
  .touch-pad--center { bottom: 0; }
  body[data-input="touch"][data-phase="play"] .hint {
    top: calc(var(--play-top) + 3px);
    max-width: min(calc(34cqw - 78px), 250px);
  }
}

@media (orientation: landscape) {
  body[data-input="touch"][data-phase="title"] .title-panel {
    align-items: center;
    padding-inline: max(8cqw, var(--play-left)) max(8cqw, var(--play-right));
  }
  body[data-input="touch"][data-phase="play"] .hud-portrait { width: clamp(46px, 6.5cqw, 64px); }
  body[data-input="touch"][data-phase="play"] .touch-controls {
    --touch-pad-gap: 14px;
    --touch-group-gap: 6px;
    /* Leave room for the HUD in short landscape browser windows. */
    --touch-row-space: calc((100dvh - var(--play-top) - 48px - var(--touch-bottom) - 2 * var(--touch-pad-gap)) / 3);
    --touch-target-size: min(clamp(62px, calc(6cqw + 14px), 72px), max(44px, var(--touch-row-space)));
  }
}

@media (orientation: portrait) {
  body[data-input="touch"][data-phase="title"] .title-panel {
    place-items: start center;
    padding: clamp(94px, 23dvh, 196px) 18px 0;
    text-align: center;
    background: linear-gradient(180deg, #13101eae, #1b132595 38%, #22142409 64%, #140e1b70);
  }
  body[data-input="touch"][data-phase="title"] .title-panel > div { margin: 0; }
  body[data-input="touch"][data-phase="title"] .title-panel h1 { font-size: clamp(43px, 12cqw, 69px); }
  body[data-input="touch"][data-phase="title"] .title-panel .primary { min-width: 138px; font-size: 15px; }
  body[data-input="touch"][data-phase="title"] .title-note { font-size: 12px; }
  body[data-input="touch"][data-phase="play"] .status-strip {
    inset: calc(var(--play-top) + 52px) var(--play-right) auto var(--play-left);
    width: auto;
    max-width: none;
    padding-inline-start: 116px;
  }
  body[data-input="touch"][data-phase="play"] #objective { max-width: 24em; }
  body[data-input="touch"][data-phase="play"] .hud-progress {
    position: absolute;
    inset-block-start: 52px;
    inset-inline-start: 0;
    min-width: 76px;
  }
  body[data-input="touch"][data-phase="boss-intro"] .duel {
    width: min(92%, 440px);
    padding-block: clamp(14px, 5cqw, 30px);
  }
  body[data-input="touch"][data-phase="boss-intro"] .duel-portrait {
    width: clamp(78px, 27cqw, 132px);
  }
}
