:root {
  --ink: #182019;
  --ink-soft: #344039;
  --paper: #f4ecdc;
  --paper-bright: #fffaf0;
  --sand: #d8b98f;
  --terracotta: #be5130;
  --terracotta-dark: #7e2f21;
  --saffron: #e9873b;
  --green: #315d43;
  --navy: #213b62;
  --line: rgba(24, 32, 25, 0.18);
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  --font-display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #a94a2f;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: #b85a36;
}

button {
  font: inherit;
}

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

button:focus-visible {
  outline: 3px solid var(--paper-bright);
  outline-offset: 3px;
}

#game-shell,
#scene,
#scene canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#game-shell {
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, #e7b87c 0%, #f0cf9e 36%, #b85b38 100%);
}

#scene {
  z-index: 0;
}

#scene canvas {
  display: block;
  touch-action: none;
}

.paper-grain,
.vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.paper-grain {
  opacity: 0.11;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E");
}

.vignette {
  background:
    linear-gradient(180deg, rgba(67, 29, 20, 0.18), transparent 22%, transparent 68%, rgba(44, 25, 17, 0.38)),
    radial-gradient(circle at 50% 45%, transparent 42%, rgba(45, 28, 20, 0.24) 130%);
}

.topbar {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  min-height: 90px;
  padding: max(20px, env(safe-area-inset-top)) clamp(18px, 4vw, 48px) 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 20px;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.1vw, 24px);
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--paper-bright);
  text-shadow: 0 2px 18px rgba(55, 23, 16, 0.35);
}

.brand-lockup b {
  color: #ffd49d;
  font-weight: 900;
}

.flag-mark,
.loading-flag {
  position: relative;
  width: 29px;
  height: 24px;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  transform: skewY(-7deg);
  box-shadow: 0 2px 8px rgba(60, 31, 21, 0.18);
}

.flag-mark::before {
  content: "";
  position: absolute;
  right: -3px;
  top: -4px;
  width: 2px;
  height: 34px;
  border-radius: 2px;
  background: #f9e7c8;
}

.flag-mark i,
.loading-flag i {
  display: block;
}

.flag-mark i:first-child,
.loading-flag i:first-child {
  background: var(--saffron);
}

.flag-mark i:nth-child(2),
.loading-flag i:nth-child(2) {
  position: relative;
  background: var(--paper-bright);
}

.flag-mark i:nth-child(2)::after,
.loading-flag i:nth-child(2)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border: 1px solid var(--navy);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.flag-mark i:last-child,
.loading-flag i:last-child {
  background: var(--green);
}

.hud {
  min-width: clamp(222px, 27vw, 320px);
  padding: 11px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 31px);
  color: var(--paper-bright);
  border: 1px solid rgba(255, 250, 240, 0.29);
  border-radius: 5px;
  background: rgba(62, 37, 24, 0.26);
  box-shadow: 0 12px 35px rgba(75, 34, 20, 0.12);
  backdrop-filter: blur(10px);
}

.hud-stat {
  min-width: 75px;
  display: grid;
  justify-items: center;
}

.hud-stat span {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
  opacity: 0.67;
}

.hud-stat strong {
  margin-top: -1px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.hud-stat strong small {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
}

.hud-rule {
  width: 1px;
  height: 28px;
  background: rgba(255, 250, 240, 0.28);
}

.top-actions {
  justify-self: end;
  display: flex;
  gap: 9px;
  pointer-events: auto;
}

.icon-button {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: var(--paper-bright);
  border: 1px solid rgba(255, 250, 240, 0.3);
  border-radius: 50%;
  background: rgba(62, 37, 24, 0.28);
  backdrop-filter: blur(9px);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.icon-button:hover {
  background: rgba(62, 37, 24, 0.43);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: scale(0.93);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-off {
  display: none;
}

.icon-button[aria-pressed="true"] .sound-on {
  display: none;
}

.icon-button[aria-pressed="true"] .sound-off {
  display: block;
}

.gas-hud {
  position: absolute;
  z-index: 12;
  top: max(98px, calc(env(safe-area-inset-top) + 84px));
  left: 50%;
  width: min(430px, calc(100vw - 36px));
  padding: 10px 14px 10px 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--paper-bright);
  border: 1px solid rgba(255, 228, 188, 0.52);
  border-radius: 7px;
  background: rgba(87, 39, 27, 0.88);
  box-shadow: 0 14px 40px rgba(59, 25, 17, 0.26);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.gas-hud.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.gas-hud.is-urgent {
  background: rgba(111, 40, 27, 0.94);
  animation: urgentPulse 620ms ease-in-out infinite alternate;
}

.gas-hud__icon {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 243, 219, 0.1);
}

.gas-hud__icon span {
  width: 19px;
  height: 9px;
  display: block;
  border: 2px solid #f4c27d;
  border-radius: 3px;
  transform: rotate(-17deg);
}

.gas-hud__icon i {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 241, 214, 0.8);
  border-radius: 50%;
  animation: smokeRise 1.1s linear infinite;
}

.gas-hud__icon i:nth-of-type(1) {
  top: 7px;
  left: 8px;
}

.gas-hud__icon i:nth-of-type(2) {
  top: 3px;
  left: 17px;
  animation-delay: -0.4s;
}

.gas-hud__icon i:nth-of-type(3) {
  top: 7px;
  left: 27px;
  animation-delay: -0.7s;
}

.gas-hud__copy {
  min-width: 0;
  flex: 1;
}

.gas-hud__copy > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gas-hud__copy strong,
.gas-hud__copy span {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.gas-hud__copy strong {
  font-size: 13px;
}

.gas-hud__copy span {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.gas-hud__copy small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 250, 240, 0.72);
}

.fuse-track {
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 250, 240, 0.16);
}

.fuse-track i {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #efb15f;
  transform-origin: left;
}

.action-callout {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 41%;
  padding: 7px 13px 7px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  border: 1px solid rgba(255, 250, 240, 0.62);
  border-radius: 5px;
  background: rgba(255, 248, 232, 0.88);
  box-shadow: 0 8px 24px rgba(57, 26, 19, 0.16);
  transform: translate(-50%, 10px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 130ms ease, transform 130ms ease;
}

.action-callout.is-visible {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

.action-callout__key {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--paper-bright);
  border-radius: 3px;
  background: var(--terracotta);
  font-size: 15px;
  font-weight: 800;
}

.action-callout > span:last-child {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.streak-card {
  position: absolute;
  z-index: 8;
  top: 24%;
  right: clamp(18px, 4vw, 48px);
  padding: 10px 14px 10px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper-bright);
  border-left: 3px solid #efb35f;
  background: rgba(67, 40, 26, 0.33);
  backdrop-filter: blur(8px);
  transform: translateX(20px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.streak-card.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.streak-card > span {
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
}

.streak-card div {
  display: grid;
}

.streak-card strong {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.streak-card small {
  margin-top: 1px;
  font-size: 9px;
  opacity: 0.7;
}

.lane-guide {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 100px;
  width: min(240px, 54vw);
  height: 3px;
  display: flex;
  justify-content: space-between;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.game-running .lane-guide {
  opacity: 0.42;
}

.lane-guide i {
  width: 34%;
  border-bottom: 2px solid rgba(255, 247, 231, 0.72);
}

.lane-guide i:nth-child(2) {
  margin-inline: 5px;
  border-bottom-color: rgba(255, 205, 143, 0.85);
}

.touch-controls {
  position: absolute;
  z-index: 11;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px clamp(18px, 4vw, 48px) var(--safe-bottom);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
}

.game-running .touch-controls {
  transform: translateY(0);
  opacity: 1;
}

.move-controls,
.action-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  pointer-events: auto;
}

.control-button {
  height: 62px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--paper-bright);
  border: 1px solid rgba(255, 250, 240, 0.4);
  border-radius: 6px;
  background: rgba(52, 38, 28, 0.42);
  box-shadow: 0 8px 24px rgba(56, 28, 20, 0.17);
  backdrop-filter: blur(8px);
  cursor: pointer;
  user-select: none;
  transition: transform 100ms ease, background 100ms ease, opacity 160ms ease;
}

.control-button:active,
.control-button.is-active {
  transform: translateY(2px) scale(0.95);
  background: rgba(49, 34, 25, 0.7);
}

.control-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-button span {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.control-button--round {
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
}

.control-button--round svg {
  width: 22px;
}

.control-button--primary {
  width: 80px;
  height: 74px;
  flex-direction: column;
  gap: 2px;
  color: #fff9ee;
  border-color: rgba(255, 231, 199, 0.58);
  background: rgba(179, 69, 39, 0.78);
}

.control-button--primary svg {
  width: 26px;
  height: 26px;
}

.control-button--wide {
  width: 83px;
  flex-direction: column;
  gap: 2px;
}

.control-button--throw {
  width: 0;
  padding: 0;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  color: #382317;
  border-color: rgba(255, 236, 202, 0.78);
  background: #efb35f;
  transform: scale(0.7);
  opacity: 0;
  pointer-events: none;
}

.has-canister .control-button--throw {
  width: 88px;
  padding: 0 14px;
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.screen {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  position: absolute;
  z-index: 20;
  inset: 0;
  padding:
    max(82px, calc(env(safe-area-inset-top) + 70px))
    clamp(24px, 7vw, 110px)
    max(30px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(430px, 1.1fr);
  align-items: center;
  gap: clamp(35px, 8vw, 120px);
  overflow: auto;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(89, 35, 24, 0.89), rgba(102, 47, 29, 0.67) 46%, rgba(56, 37, 25, 0.76)),
    radial-gradient(circle at 70% 40%, transparent, rgba(54, 26, 18, 0.28));
  backdrop-filter: blur(7px);
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}

.screen--visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 300ms ease;
}

.intro-poster {
  justify-self: end;
  position: relative;
  width: min(430px, 37vw);
  min-width: 300px;
  aspect-ratio: 0.85;
  padding: clamp(29px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  overflow: hidden;
  border: 2px solid rgba(255, 244, 220, 0.55);
  box-shadow:
    0 30px 90px rgba(43, 20, 14, 0.34),
    inset 0 0 0 11px rgba(111, 48, 31, 0.1);
  background:
    linear-gradient(160deg, transparent 52%, rgba(119, 57, 38, 0.11) 52.2%, transparent 53%),
    linear-gradient(20deg, transparent 58%, rgba(119, 57, 38, 0.12) 58.2%, transparent 59%),
    #e8c490;
  transform: rotate(-1.8deg);
}

.intro-poster::before,
.intro-poster::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 45px solid rgba(178, 72, 40, 0.17);
}

.intro-poster::before {
  width: 280px;
  height: 280px;
  left: -130px;
  bottom: -145px;
}

.intro-poster::after {
  width: 130px;
  height: 130px;
  right: -70px;
  top: -65px;
}

.poster-kicker {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 800;
  letter-spacing: 0.19em;
  color: var(--terracotta-dark);
}

.intro-poster h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(76px, 9vw, 136px);
  font-weight: 900;
  line-height: 0.72;
  letter-spacing: -0.055em;
}

.intro-poster h1 em {
  color: var(--terracotta);
  font-style: italic;
  text-shadow: 4px 4px 0 rgba(255, 247, 228, 0.42);
}

.poster-stamp {
  position: relative;
  z-index: 1;
  margin-top: 38px;
  padding-top: 16px;
  display: flex;
  gap: 12px;
  border-top: 2px solid rgba(24, 32, 25, 0.55);
}

.poster-stamp span {
  font-family: var(--font-display);
  font-size: clamp(10px, 1vw, 12px);
  font-weight: 900;
  letter-spacing: 0.12em;
}

.poster-stamp span + span::before {
  content: "•";
  margin-right: 12px;
  color: var(--terracotta);
}

.intro-panel {
  width: min(600px, 100%);
  color: var(--paper-bright);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #efb873;
}

.eyebrow i {
  width: 34px;
  height: 2px;
  display: block;
  background: currentColor;
}

.eyebrow span {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.intro-panel h2,
.modal-card h2 {
  margin: 14px 0 13px;
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 69px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.025em;
}

.intro-copy {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 248, 233, 0.76);
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 500;
  line-height: 1.65;
}

.instruction-grid {
  margin: 27px 0 25px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.instruction-grid article {
  min-height: 76px;
  padding: 12px 11px;
  display: grid;
  grid-template-columns: 39px 1fr;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 243, 220, 0.21);
  border-radius: 5px;
  background: rgba(255, 240, 215, 0.08);
}

.instruction-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f3c383;
  background: rgba(255, 240, 215, 0.09);
}

.instruction-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.instruction-grid article div {
  min-width: 0;
  display: grid;
}

.instruction-grid strong {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.instruction-grid small {
  margin-top: 3px;
  color: rgba(255, 248, 233, 0.58);
  font-size: 9px;
  white-space: nowrap;
}

.instruction-grid kbd {
  display: none;
}

.start-button {
  width: min(100%, 370px);
  height: 61px;
  padding: 0 9px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #43271a;
  border: 0;
  border-radius: 4px;
  background: #f0b260;
  box-shadow: 0 13px 35px rgba(39, 18, 12, 0.2);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.start-button:hover {
  background: #f8c377;
  transform: translateY(-2px);
}

.start-button:active {
  transform: translateY(1px);
}

.start-button > span {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.start-button > i {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: var(--paper-bright);
  border-radius: 3px;
  background: #9a422a;
}

.start-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gesture-hint {
  margin: 16px 0 0;
  color: rgba(255, 248, 233, 0.55);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.gesture-hint span {
  margin-right: 4px;
  color: #efb873;
  font-size: 15px;
  vertical-align: -1px;
}

.screen--compact {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}

.modal-card {
  width: min(440px, calc(100vw - 38px));
  padding: clamp(30px, 6vw, 48px);
  color: var(--paper-bright);
  border: 1px solid rgba(255, 242, 219, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(255, 241, 216, 0.08), transparent),
    rgba(63, 36, 24, 0.82);
  box-shadow: 0 34px 95px rgba(37, 17, 11, 0.37);
  backdrop-filter: blur(16px);
  text-align: center;
}

.modal-card .eyebrow {
  justify-content: center;
}

.modal-card h2 {
  font-size: clamp(45px, 7vw, 62px);
}

.modal-card > p {
  margin: -2px 0 26px;
  color: rgba(255, 248, 233, 0.7);
  font-size: 13px;
  line-height: 1.6;
}

.modal-card .start-button {
  margin-inline: auto;
}

.text-button {
  margin-top: 18px;
  padding: 7px 12px;
  color: rgba(255, 248, 233, 0.68);
  border: 0;
  border-bottom: 1px solid rgba(255, 248, 233, 0.28);
  background: transparent;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.result-row {
  margin: 24px 0;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 29px;
  border-top: 1px solid rgba(255, 244, 224, 0.17);
  border-bottom: 1px solid rgba(255, 244, 224, 0.17);
}

.result-row div {
  min-width: 94px;
  display: grid;
}

.result-row div small {
  color: rgba(255, 248, 233, 0.5);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.result-row div strong {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.result-row > span {
  width: 1px;
  height: 39px;
  background: rgba(255, 244, 224, 0.19);
}

.rotate-notice {
  position: absolute;
  z-index: 30;
  inset: 0;
  padding: 40px;
  display: none;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--paper-bright);
  background: #743422;
  text-align: center;
}

.rotate-notice svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: #efb873;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rotate-notice span {
  max-width: 220px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.35;
}

.loading-screen {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 15px;
  color: var(--paper-bright);
  background: #793824;
  transition: opacity 450ms ease, visibility 0s linear 450ms;
}

.loading-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loading-screen > strong {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.loading-screen > div {
  width: 160px;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 248, 235, 0.18);
}

.loading-screen > div i {
  width: 48%;
  height: 100%;
  display: block;
  background: #efb873;
  animation: loadingMove 1s ease-in-out infinite alternate;
}

.loading-flag {
  width: 42px;
  height: 32px;
  animation: flagTilt 1.2s ease-in-out infinite alternate;
}

.noscript {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  background: #793824;
}

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

@keyframes loadingMove {
  from { transform: translateX(-10%); }
  to { transform: translateX(125%); }
}

@keyframes flagTilt {
  from { transform: skewY(-7deg) rotate(-2deg); }
  to { transform: skewY(3deg) rotate(2deg); }
}

@keyframes smokeRise {
  from { transform: translateY(5px) scale(0.5); opacity: 0; }
  35% { opacity: 0.7; }
  to { transform: translateY(-6px) scale(1.35); opacity: 0; }
}

@keyframes urgentPulse {
  from { box-shadow: 0 14px 40px rgba(59, 25, 17, 0.26); }
  to { box-shadow: 0 14px 42px rgba(126, 48, 30, 0.5); }
}


.icon-button:disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.loading-screen.has-load-error {
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.loading-screen.has-load-error > div {
  display: none;
}

.loading-error-copy {
  max-width: 290px;
  color: rgba(255, 250, 240, 0.82);
  font-size: 13px;
  line-height: 1.45;
}

.loading-retry {
  min-width: 132px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid rgba(255, 250, 240, 0.5);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper-bright);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.gas-hud.is-missed {
  border-color: rgba(255, 244, 222, 0.72);
  background: rgba(93, 39, 27, 0.94);
}

.gas-hud.is-missed .gas-hud__icon {
  animation: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .touch-controls {
    opacity: 0 !important;
    pointer-events: none;
  }

  .touch-controls button {
    pointer-events: none;
  }

  .instruction-grid article {
    grid-template-columns: 39px 1fr auto;
  }

  .instruction-grid kbd {
    min-width: 29px;
    height: 25px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    color: rgba(255, 248, 233, 0.75);
    border: 1px solid rgba(255, 246, 229, 0.26);
    border-bottom-width: 2px;
    border-radius: 3px;
    background: rgba(34, 25, 19, 0.2);
    font-family: var(--font-display);
    font-size: 9px;
  }
}

@media (max-width: 850px) {
  .topbar {
    padding-inline: 16px;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }

  .brand-lockup > span:last-child {
    display: none;
  }

  .hud {
    min-width: 0;
    justify-self: center;
    padding-inline: 12px;
    gap: 13px;
  }

  .hud-stat {
    min-width: 57px;
  }

  .hud-stat strong {
    font-size: 23px;
  }

  .hud-stat--best {
    display: none;
  }

  .hud-rule {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .icon-button {
    width: 39px;
    height: 39px;
  }

  .screen {
    padding: max(80px, calc(env(safe-area-inset-top) + 66px)) 24px max(28px, env(safe-area-inset-bottom));
    grid-template-columns: minmax(220px, 0.85fr) minmax(340px, 1.15fr);
    gap: 30px;
  }

  .screen.screen--compact {
    grid-template-columns: 1fr;
  }

  .intro-poster {
    width: min(290px, 35vw);
    min-width: 220px;
    padding: 25px;
  }

  .intro-poster h1 {
    font-size: clamp(61px, 10vw, 88px);
  }

  .intro-panel h2 {
    font-size: clamp(39px, 7vw, 56px);
  }

  .instruction-grid {
    margin-block: 19px;
  }

  .instruction-grid article {
    min-height: 66px;
    padding: 9px 8px;
    grid-template-columns: 32px 1fr;
    gap: 6px;
  }

  .instruction-icon {
    width: 31px;
    height: 31px;
  }

  .instruction-icon svg {
    width: 21px;
    height: 21px;
  }
}

@media (max-width: 690px) {
  .screen {
    grid-template-columns: 1fr;
    place-items: center;
    padding-inline: 20px;
  }

  .intro-poster {
    display: none;
  }

  .intro-panel {
    width: min(470px, 100%);
  }

  .intro-panel h2 {
    font-size: clamp(45px, 14vw, 66px);
  }

  .instruction-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .instruction-grid article {
    grid-template-columns: 38px 1fr;
    min-height: 54px;
  }

  .instruction-grid small {
    margin-top: 1px;
  }

  .start-button {
    width: 100%;
  }

  .touch-controls {
    padding-inline: 14px;
    gap: 10px;
  }

  .move-controls,
  .action-controls {
    gap: 7px;
  }

  .control-button--round {
    width: 52px;
    height: 52px;
  }

  .control-button--primary {
    width: 68px;
    height: 67px;
  }

  .control-button--wide {
    width: 69px;
    height: 57px;
    padding: 0 10px;
  }

  .has-canister .control-button--throw {
    width: 70px;
    height: 57px;
    padding: 0 9px;
  }

  .streak-card {
    display: none;
  }
}

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

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .hud {
    justify-self: start;
  }

  .intro-panel h2 {
    font-size: 46px;
  }

  .intro-copy {
    font-size: 11px;
  }

  .gesture-hint {
    text-align: center;
  }

  .move-controls {
    gap: 4px;
  }

  .control-button--round {
    width: 46px;
    height: 46px;
  }

  .action-controls {
    gap: 5px;
  }

  .control-button--primary {
    width: 60px;
  }

  .control-button--wide,
  .has-canister .control-button--throw {
    width: 59px;
  }

  .control-button span {
    font-size: 9px;
  }

  .gas-hud {
    top: 86px;
  }
}


@media (max-width: 350px) {
  .topbar {
    padding-inline: 10px;
  }

  .hud {
    padding-inline: 9px;
  }

  .top-actions {
    gap: 4px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .screen {
    padding-inline: 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .intro-panel h2 {
    font-size: 42px;
  }

  .instruction-grid {
    margin-block: 13px;
    gap: 5px;
  }

  .instruction-grid article {
    min-height: 48px;
    padding-block: 6px;
  }

  .touch-controls {
    padding-inline: 10px;
    gap: 6px;
  }

  .move-controls,
  .action-controls {
    gap: 4px;
  }

  .control-button--round {
    width: 42px;
    height: 42px;
  }

  .control-button--primary {
    width: 54px;
    height: 58px;
  }

  .control-button--wide,
  .has-canister .control-button--throw {
    width: 48px;
    height: 52px;
    padding-inline: 4px;
  }

  .control-button span {
    display: none;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .topbar {
    min-height: 54px;
    padding-top: max(7px, env(safe-area-inset-top));
    padding-bottom: 7px;
  }

  .hud {
    padding: 6px 12px;
  }

  .hud-stat strong {
    font-size: 21px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .screen {
    padding: max(54px, calc(env(safe-area-inset-top) + 47px)) 16px max(10px, env(safe-area-inset-bottom));
    grid-template-columns: 1fr;
    place-items: start center;
  }

  .intro-poster,
  .intro-copy {
    display: none;
  }

  .intro-panel {
    width: min(700px, 100%);
  }

  .intro-panel h2,
  .modal-card h2 {
    font-size: 35px;
    line-height: 0.95;
  }

  .eyebrow {
    margin-bottom: 6px;
  }

  .instruction-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-block: 10px;
  }

  .instruction-grid article {
    min-height: 48px;
    padding: 5px 7px;
    grid-template-columns: 28px 1fr;
  }

  .instruction-icon {
    width: 27px;
    height: 27px;
  }

  .instruction-icon svg {
    width: 18px;
    height: 18px;
  }

  .start-button {
    min-height: 45px;
  }

  .gesture-hint {
    margin-top: 7px;
  }

  .modal-card {
    padding: 17px 22px;
  }

  .modal-card p {
    margin: 7px 0 13px;
  }

  .result-row {
    margin: 10px 0 13px;
  }

  .touch-controls {
    padding: 0 12px max(7px, env(safe-area-inset-bottom));
  }

  .control-button--round {
    width: 43px;
    height: 43px;
  }

  .control-button--primary {
    width: 58px;
    height: 53px;
  }

  .control-button--wide,
  .has-canister .control-button--throw {
    width: 58px;
    height: 48px;
  }

  .gas-hud {
    top: 58px;
  }
}

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