:root {
  color-scheme: dark;
  --ink: #020b14;
  --ink-soft: #0a1c2b;
  --risk-muted: #a8443d;
  --profit-amber: #d8953f;
  --gold: #f2be62;
  --pale-gold: #ffe4a3;
  --cream: #edf4f6;
  --teal: #39c7a5;
  --danger: #ee625c;
  --shadow: rgba(0, 5, 13, 0.64);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--cream);
  background:
    radial-gradient(circle at 50% -18%, rgba(57, 199, 165, 0.14), transparent 34rem),
    radial-gradient(circle at 88% 28%, rgba(242, 190, 98, 0.08), transparent 26rem),
    linear-gradient(145deg, #061522, #020912 66%);
  font-family: Tahoma, "Leelawadee UI", "Noto Sans Thai", sans-serif;
  overflow-x: hidden;
}

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

body::before {
  opacity: 0.32;
  background:
    linear-gradient(rgba(109, 167, 183, 0.06) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(90deg, rgba(109, 167, 183, 0.05) 1px, transparent 1px) 0 0 / 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

body::after {
  background: linear-gradient(110deg, transparent 0 72%, rgba(57, 199, 165, 0.04) 72% 73%, transparent 73%);
}

button {
  font: inherit;
}

button:focus-visible,
canvas:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.game-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 32px) 26px;
}

.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #071521;
  background: linear-gradient(145deg, #f7d180, #c98331);
  border: 1px solid rgba(255, 229, 165, 0.72);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 28px rgba(0, 0, 0, 0.32);
}

.brand-mark span {
  font-size: 1.75rem;
  font-weight: 900;
}

.title-lockup {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 1px;
  color: var(--gold);
  font-size: clamp(0.55rem, 1vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.22em;
}

h1 {
  margin: 0;
  color: #fff6da;
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 18px rgba(30, 138, 122, 0.3);
}

h1 span {
  color: var(--gold);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: var(--pale-gold);
  background: rgba(5, 27, 36, 0.92);
  border: 1px solid #236f6c;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px #03131a, 0 5px 18px rgba(0, 0, 0, 0.24);
  transition: transform 140ms ease, background 140ms ease;
}

.icon-button:hover {
  background: #0d5654;
  transform: translateY(-2px);
}

.icon-button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--gold);
}

.score-ribbon {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0 auto -12px;
  width: min(860px, calc(100% - 30px));
}

.stat-card {
  padding: 12px 16px 10px;
  background: linear-gradient(135deg, rgba(12, 39, 56, 0.96), rgba(4, 18, 29, 0.97));
  border: 1px solid rgba(100, 167, 181, 0.4);
  border-radius: 12px;
  box-shadow: 0 12px 28px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.stat-heading {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat-heading p,
.stat-heading strong,
.stat-card small {
  display: block;
  margin: 0;
}

.stat-heading p {
  color: #85c9c2;
  font-size: 0.72rem;
}

.stat-heading strong {
  color: #fff4c8;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-variant-numeric: tabular-nums;
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #33200a;
  background: var(--gold);
  border: 2px solid #fff0a9;
  border-radius: 50%;
  font-weight: 900;
  box-shadow: 0 0 0 2px #8b4b16;
}

.car-icon {
  color: #fff;
  background: var(--teal);
  border-radius: 6px;
  box-shadow: 0 0 0 2px #116a64;
}

.meter {
  height: 7px;
  margin: 9px 0 5px;
  overflow: hidden;
  background: #020f16;
  border: 1px solid #18534f;
  border-radius: 99px;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--profit-amber), var(--gold));
  border-radius: inherit;
  box-shadow: 0 0 10px var(--gold);
  transition: width 260ms ease;
}

.ratio-card .meter span {
  background: linear-gradient(90deg, #137d76, #3de0cf);
  box-shadow: 0 0 10px var(--teal);
}

.stat-card small {
  color: #6ba39f;
  font-size: 0.65rem;
}

.stat-card small b {
  color: #f0c879;
}

.timer-seal {
  display: grid;
  width: 100px;
  height: 100px;
  margin: 0 auto;
  place-content: center;
  text-align: center;
  background: linear-gradient(155deg, #123449, #061722);
  border: 1px solid rgba(160, 201, 207, 0.52);
  border-radius: 18px;
  box-shadow: 0 10px 28px #01080d, inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 22px rgba(57, 199, 165, 0.1);
}

.timer-seal span,
.timer-seal small {
  color: #8bd4cd;
  font-size: 0.64rem;
  line-height: 1;
}

.timer-seal strong {
  color: var(--gold);
  font-size: 2.15rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.timer-seal.danger {
  border-color: #ff7167;
  animation: timer-pulse 0.55s ease-in-out infinite alternate;
}

.timer-seal.danger strong {
  color: #ff7167;
}

.playfield-frame {
  position: relative;
  padding: 9px;
  background: linear-gradient(145deg, rgba(112, 154, 166, 0.62), rgba(21, 63, 79, 0.9));
  border: 1px solid rgba(188, 218, 222, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.playfield-frame::before {
  position: absolute;
  inset: 3px;
  content: "";
  border: 1px solid rgba(3, 15, 25, 0.8);
  border-radius: 13px;
  pointer-events: none;
}

.game-stage {
  position: relative;
  overflow: hidden;
  background: #03141e;
  border: 1px solid rgba(112, 174, 184, 0.46);
  border-radius: 9px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  touch-action: none;
}

.stage-callout {
  position: absolute;
  top: 22%;
  left: 50%;
  z-index: 3;
  color: #fff;
  font-size: clamp(1rem, 3vw, 1.8rem);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 3px 0 #5d1d11, 0 0 14px #000;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 18px) scale(0.85);
}

.stage-callout.show {
  animation: callout 850ms ease-out both;
}

.combo-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  padding: 7px 13px;
  color: #402000;
  background: var(--gold);
  border: 2px solid #fff0aa;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.36);
  opacity: 0;
  transform: translateY(-6px) scale(0.8);
  transition: opacity 150ms, transform 150ms;
}

.combo-badge.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.combo-badge b {
  font-size: 1.1rem;
}

.modal-backdrop,
.pause-curtain {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(1, 12, 20, 0.76);
  backdrop-filter: blur(8px);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
}

.modal-backdrop.cover-active {
  padding: 0;
  overflow: hidden;
  background: #020b18;
  backdrop-filter: none;
}

.game-modal {
  width: min(670px, 96%);
  max-height: 96%;
  padding: clamp(18px, 3vw, 30px);
  overflow-y: auto;
  position: relative;
  color: var(--cream);
  text-align: center;
  background:
    linear-gradient(145deg, rgba(12, 42, 59, 0.985), rgba(3, 15, 25, 0.99)),
    radial-gradient(circle at 50% 0, rgba(57, 199, 165, 0.11), transparent 48%);
  border: 1px solid rgba(130, 184, 195, 0.48);
  border-top: 3px solid var(--gold);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 3, 10, 0.74), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cover-art,
.cover-logo {
  display: none;
}

.result-brand {
  position: relative;
  width: 166px;
  height: 134px;
  margin: -14px auto 2px;
  overflow: hidden;
}

.result-brand > img {
  position: relative;
  z-index: 2;
  display: block;
  width: 148px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.42));
}

.game-modal.intro-modal {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #f5f8ff;
  text-align: left;
  background:
    linear-gradient(90deg, #020b18 0 48%, rgba(2, 11, 24, 0.76) 63%, rgba(2, 11, 24, 0.12) 100%),
    radial-gradient(circle at 76% 48%, rgba(255, 211, 40, 0.14), transparent 34%),
    #020b18;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.intro-modal::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 8, 22, 0.98) 0, rgba(0, 8, 22, 0.9) 34%, rgba(0, 8, 22, 0.46) 57%, transparent 78%),
    linear-gradient(0deg, rgba(0, 6, 17, 0.58), transparent 42%);
}

.intro-modal .cover-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.intro-modal .result-brand {
  display: none;
}

.intro-modal .modal-content {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(620px, 53vw);
  min-height: 100%;
  margin-left: clamp(28px, 6vw, 96px);
  padding: clamp(30px, 5vh, 58px) 0;
  flex-direction: column;
  justify-content: center;
}

.intro-modal .cover-logo {
  display: block;
  width: min(345px, 78%);
  height: auto;
  margin: 0 0 clamp(16px, 3vh, 28px);
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.34));
}

.intro-modal .modal-kicker {
  color: #ffd328;
  font-size: clamp(0.66rem, 1vw, 0.78rem);
  letter-spacing: 0.13em;
}

.intro-modal h2 {
  color: #fff;
  font-size: clamp(3rem, 5.3vw, 5.1rem);
  letter-spacing: -0.035em;
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.48);
}

.intro-modal .modal-lead {
  max-width: 560px;
  margin: 10px 0 20px;
  color: #d6e2eb;
  font-size: clamp(0.86rem, 1.3vw, 1.04rem);
}

.intro-modal .item-guide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 570px;
  margin-bottom: 14px;
}

.intro-modal .guide-item {
  background: rgba(5, 25, 48, 0.82);
  border-color: rgba(108, 159, 191, 0.36);
  box-shadow: inset 3px 0 0 rgba(255, 211, 40, 0.65);
  backdrop-filter: blur(8px);
}

.intro-modal .guide-item.danger {
  box-shadow: inset 3px 0 0 rgba(210, 34, 43, 0.9);
}

.intro-modal .control-hint {
  max-width: 570px;
  justify-content: flex-start;
  margin-bottom: 16px;
  color: #b2c6d4;
}

.intro-modal .primary-button {
  min-width: 250px;
  align-self: flex-start;
  padding: 14px 24px;
  color: #ffffff;
  background: linear-gradient(100deg, #80161c, #5c0e13 72%, #461018);
  border: 2px solid #ffd328;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.intro-modal .primary-button:hover {
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.52), 0 0 0 3px rgba(255, 211, 40, 0.16);
}

.intro-modal .asset-status {
  margin: 10px 0 0;
  color: #abc0cf;
}

.intro-hero-glow {
  position: absolute;
  z-index: 1;
  top: 25px;
  left: 50%;
  width: 84px;
  height: 70px;
  background: radial-gradient(circle, rgba(242, 190, 98, 0.34), rgba(57, 199, 165, 0.1) 48%, transparent 72%);
  transform: translateX(-50%);
}

.hanuman-emblem {
  position: absolute;
  z-index: 3;
  right: 4px;
  bottom: 4px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #05232b;
  background: var(--gold);
  border: 2px solid #fff0ad;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #164c58, 0 0 16px rgba(242, 190, 98, 0.3);
}

.hanuman-emblem .face {
  font-size: 1.15rem;
  font-weight: 900;
}

.modal-kicker {
  margin: 0 0 2px;
  color: #72d7ce;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-modal h2 {
  margin: 0;
  color: #fff0ba;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 900;
  line-height: 1.1;
}

.modal-lead {
  margin: 6px 0 16px;
  color: #b7d1ce;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  line-height: 1.55;
}

.item-guide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.guide-item {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
  padding: 9px 7px;
  text-align: left;
  background: rgba(20, 60, 76, 0.34);
  border: 1px solid rgba(111, 176, 188, 0.24);
  border-radius: 8px;
}

.guide-symbol {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  color: #381b08;
  background: var(--gold);
  border: 2px solid #d49628;
  border-radius: 50%;
  font-weight: 900;
}

.car-symbol { color: white; background: var(--teal); border-color: #167a72; border-radius: 5px; }
.loss-symbol { color: white; background: var(--risk-muted); border-color: #6f2d2a; border-radius: 5px; }
.bomb-symbol { color: white; background: #27211f; border-color: var(--danger); box-shadow: 0 0 0 2px #29201d; }

.guide-item p,
.guide-item strong,
.guide-item small {
  display: block;
  min-width: 0;
  margin: 0;
}

.guide-item strong {
  color: #f8ecc0;
  font-size: 0.73rem;
  white-space: nowrap;
}

.guide-item small {
  color: #82b9b4;
  font-size: 0.57rem;
  white-space: nowrap;
}

.control-hint {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin: 0 0 15px;
  color: #8cbcb8;
  font-size: 0.66rem;
}

.control-hint i {
  width: 1px;
  height: 20px;
  background: #327d78;
}

kbd {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  margin-inline: 1px;
  padding: 0 4px;
  place-items: center;
  color: #fff2bc;
  background: #082b34;
  border: 1px solid #2b817a;
  border-radius: 3px;
  box-shadow: 0 2px 0 #020c12;
}

.primary-button {
  display: inline-flex;
  min-width: 190px;
  justify-content: center;
  gap: 20px;
  align-items: center;
  padding: 12px 20px;
  color: #fff7df;
  background: linear-gradient(100deg, #0c4d40, #12624f 58%, #6f4319);
  border: 1px solid rgba(174, 226, 214, 0.58);
  border-radius: 9px;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(0, 4, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 4, 11, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.primary-button:disabled {
  cursor: wait;
  filter: saturate(0.45);
  opacity: 0.72;
  transform: none;
}

.asset-status {
  min-height: 1.2em;
  margin: 10px 0 -6px;
  color: #69aaa5;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

.asset-status.fallback {
  color: #ffd078;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 13px 0 18px;
}

.result-summary div {
  padding: 9px 5px;
  background: rgba(20, 75, 84, 0.24);
  border-top: 2px solid #3bc4a4;
  border-radius: 0 0 8px 8px;
}

.result-summary span,
.result-summary strong {
  display: block;
}

.result-summary span { color: #85b9b4; font-size: 0.62rem; }
.result-summary strong { color: #fff0bd; font-size: 1rem; }

.game-modal.win { border-top-color: var(--teal); }
.game-modal.win .hanuman-emblem { background: #2fc8ba; box-shadow: 0 0 0 3px #126961; }
.game-modal.lose { border-top-color: var(--danger); }
.game-modal.lose .hanuman-emblem { color: #fff; background: #30201b; box-shadow: 0 0 0 3px #df3c32; }

.pause-curtain {
  z-index: 8;
  text-align: center;
  background: rgba(2, 12, 21, 0.76);
}

.pause-curtain div {
  display: grid;
  place-items: center;
}

.pause-curtain span {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 900;
  box-shadow: 0 0 0 5px rgba(246, 199, 91, 0.25);
}

.pause-curtain strong { margin-top: 10px; font-size: 1.5rem; }
.pause-curtain small { color: #d9a875; }

.mobile-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 13px auto 0;
  width: min(720px, 100%);
}

.mobile-controls p {
  margin: 0;
  color: #78a8b1;
  font-size: 0.67rem;
  text-align: center;
}

.move-button {
  padding: 12px 16px;
  color: #f8e2a8;
  background: linear-gradient(#123d4d, #071d2a);
  border: 1px solid #3c8586;
  border-bottom-width: 4px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  touch-action: none;
  user-select: none;
}

.move-button:active,
.move-button.active {
  border-bottom-width: 1px;
  transform: translateY(3px);
}

footer p {
  margin: 14px 0 0;
  color: #548f8b;
  font-size: 0.62rem;
  text-align: center;
  letter-spacing: 0.08em;
}

footer span { color: var(--gold); }

@keyframes timer-pulse {
  to { box-shadow: 0 0 0 4px #713019, 0 0 24px rgba(255, 80, 67, 0.7); transform: scale(1.04); }
}

@keyframes callout {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.8); }
  22% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -5px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -25px) scale(0.95); }
}

@media (max-width: 720px) {
  .game-shell { padding: 10px 8px 18px; }
  .masthead { grid-template-columns: 40px 1fr auto; gap: 10px; }
  .brand-mark { width: 38px; height: 38px; border-width: 1px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 16px rgba(0, 0, 0, 0.32); }
  .brand-mark span { font-size: 1.2rem; }
  .header-actions { gap: 5px; }
  .icon-button { width: 36px; height: 36px; }
  .score-ribbon { grid-template-columns: 1fr 65px 1fr; gap: 5px; width: calc(100% - 12px); margin-bottom: -7px; }
  .stat-card { padding: 8px 7px 7px; }
  .stat-heading { gap: 5px; }
  .stat-icon { width: 25px; height: 25px; font-size: 0.72rem; border-width: 1px; }
  .stat-heading p { font-size: 0.58rem; }
  .stat-heading strong { font-size: 0.78rem; }
  .stat-card small { font-size: 0.51rem; }
  .meter { height: 5px; margin: 6px 0 3px; }
  .timer-seal { width: 62px; height: 62px; border-width: 1px; border-radius: 12px; box-shadow: 0 6px 15px #01080d; }
  .timer-seal strong { font-size: 1.5rem; }
  .timer-seal span, .timer-seal small { font-size: 0.48rem; }
  .playfield-frame { padding: 7px; }
  .game-stage { border-width: 2px; }
  .game-stage { overflow: visible; }
  .modal-backdrop {
    position: fixed;
    z-index: 100;
    overflow-y: auto;
    background: rgba(1, 12, 20, 0.96);
  }
  .game-modal { max-height: none; margin: auto; }
  .item-guide { grid-template-columns: repeat(2, 1fr); }
  .game-modal { padding: 20px 13px 17px; }
  .result-brand { width: 136px; height: 110px; margin-top: -10px; }
  .result-brand > img { width: 120px; }
  .hanuman-emblem { right: 0; bottom: 2px; width: 30px; height: 30px; }
  .modal-lead { margin-bottom: 10px; }
  .control-hint { display: none; }
  .guide-item { padding: 6px; }
  .guide-symbol { width: 27px; height: 27px; }
  .primary-button { padding: 9px 16px; }
  .mobile-controls { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mobile-controls p { display: none; }
  .move-button { padding: 13px; }

  .game-modal.intro-modal {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .intro-modal::before {
    background:
      linear-gradient(0deg, #020b18 0 46%, rgba(2, 11, 24, 0.92) 58%, rgba(2, 11, 24, 0.2) 82%, rgba(2, 11, 24, 0.08) 100%),
      linear-gradient(90deg, rgba(2, 11, 24, 0.24), transparent 70%);
  }

  .intro-modal .cover-art {
    position: fixed;
    object-position: 69% center;
  }

  .intro-modal .modal-content {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: clamp(225px, 33vh, 285px) 16px 16px;
    justify-content: flex-end;
    text-align: center;
  }

  .intro-modal .cover-logo {
    width: min(260px, 76vw);
    margin: 0 auto 10px;
  }

  .intro-modal .modal-kicker {
    font-size: 0.6rem;
    letter-spacing: 0.07em;
  }

  .game-modal.intro-modal h2 {
    font-size: clamp(2.2rem, 11vw, 2.9rem);
  }

  .intro-modal .modal-lead {
    margin: 4px auto 10px;
    font-size: 0.72rem;
    line-height: 1.42;
  }

  .intro-modal .item-guide {
    width: 100%;
    margin-bottom: 10px;
  }

  .intro-modal .guide-item {
    padding: 6px;
    background: rgba(3, 20, 40, 0.9);
    backdrop-filter: blur(5px);
  }

  .intro-modal .primary-button {
    width: min(300px, 100%);
    min-width: 0;
    align-self: center;
    padding: 11px 18px;
  }

  .intro-modal .asset-status {
    margin: 7px 0 0;
  }
}

@media (max-width: 1000px) and (max-height: 520px) and (orientation: landscape) {
  .modal-backdrop.cover-active {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .game-modal.intro-modal {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .intro-modal::before {
    position: fixed;
    background:
      linear-gradient(90deg, rgba(0, 8, 22, 0.98) 0, rgba(0, 8, 22, 0.92) 45%, rgba(0, 8, 22, 0.5) 67%, transparent 88%),
      linear-gradient(0deg, rgba(0, 6, 17, 0.52), transparent 50%);
  }

  .intro-modal .cover-art {
    position: fixed;
    object-position: center;
  }

  .intro-modal .modal-content {
    width: min(500px, 59vw);
    min-height: 100dvh;
    margin-left: clamp(18px, 4vw, 40px);
    padding: 9px 0 8px;
    justify-content: center;
  }

  .intro-modal .cover-logo {
    width: min(190px, 33vw);
    margin: 0 0 3px;
  }

  .intro-modal .modal-kicker {
    font-size: 0.55rem;
    letter-spacing: 0.08em;
  }

  .game-modal.intro-modal h2 {
    font-size: clamp(1.9rem, 5vw, 2.35rem);
  }

  .intro-modal .modal-lead {
    margin: 2px 0 6px;
    font-size: 0.66rem;
    line-height: 1.3;
  }

  .intro-modal .item-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 6px;
  }

  .intro-modal .guide-item {
    gap: 5px;
    padding: 3px 5px;
  }

  .intro-modal .guide-symbol {
    width: 24px;
    height: 24px;
    border-width: 1px;
    font-size: 0.72rem;
  }

  .intro-modal .guide-item strong { font-size: 0.64rem; }
  .intro-modal .guide-item small { font-size: 0.5rem; }
  .intro-modal .control-hint { display: none; }

  .intro-modal .primary-button {
    min-width: 220px;
    padding: 7px 18px;
  }

  .intro-modal .asset-status {
    margin-top: 3px;
    font-size: 0.55rem;
  }
}

@media (max-width: 430px) {
  .eyebrow { display: none; }
  h1 { font-size: 1.35rem; }
  .header-actions { gap: 3px; }
  .icon-button { width: 32px; height: 32px; }
  .game-modal h2 { font-size: 1.8rem; }
  .modal-kicker { font-size: 0.58rem; }
  .modal-lead { font-size: 0.7rem; }
  .item-guide { gap: 4px; }
  .guide-item strong { font-size: 0.64rem; }
  .guide-item small { font-size: 0.5rem; }
  .result-summary { margin: 8px 0 12px; }

  .game-modal.intro-modal h2 { font-size: 2.25rem; }
  .intro-modal .guide-item strong { font-size: 0.65rem; }
  .intro-modal .guide-item small { font-size: 0.51rem; }
}

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

/* ---- ปุ่มกลับเข้าเกมหลัก TIPlife (โชว์เฉพาะตอนชนะใน iframe) ---- */
.finish-button {
  margin-top: 10px;
  background: linear-gradient(135deg, #1f9d6b, #14724c);
  border-color: rgba(180, 255, 220, 0.45);
}

.finish-button:hover,
.finish-button:focus-visible {
  background: linear-gradient(135deg, #25b87e, #188257);
}
