:root {
  --bg-top: #153261;
  --bg-mid: #29508a;
  --bg-bottom: #f8bb57;
  --ink: #12243d;
  --ink-soft: rgba(18, 36, 61, 0.72);
  --panel-strong: rgba(255, 248, 233, 0.98);
  --accent: #ff7f50;
  --accent-strong: #ff5f40;
  --shadow: 0 22px 45px rgba(10, 26, 51, 0.24);
  --radius-xl: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #fff9ef;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.2), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(255, 222, 131, 0.28), transparent 22%),
    linear-gradient(180deg, var(--bg-top), var(--bg-mid) 58%, var(--bg-bottom));
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 38vmax;
  height: 38vmax;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(18px);
  pointer-events: none;
}

body::before {
  top: -16vmax;
  right: -10vmax;
}

body::after {
  bottom: -18vmax;
  left: -14vmax;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
}



.game-shell {
  display: grid;
  place-items: center;
}

.game-frame {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 9 / 16;
  border-radius: 34px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 18%),
    linear-gradient(180deg, #20467a, #193358 46%, #264c7c 72%, #f3a84f 100%);
  box-shadow: var(--shadow);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(12px, 2vw, 18px);
  pointer-events: none;
}

.hud-chip,
.panel,
.interstitial-card {
  backdrop-filter: blur(10px);
}

.hud-chip {
  min-width: 86px;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 248, 233, 0.16);
}

.hud-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 249, 239, 0.72);
}

.hud strong {
  font-size: 1.1rem;
}

.hud-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.icon-button,
.mode-button,
.primary-button,
.secondary-button,
select {
  border: none;
  border-radius: 999px;
  font: inherit;
}

.icon-button,
.mode-button,
.secondary-button,
select {
  background: rgba(255, 248, 233, 0.9);
  color: var(--ink);
}

.icon-button,
.mode-button {
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.screen-overlay,
.interstitial-slot {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.screen-overlay {
  pointer-events: none;
}

.screen {
  width: min(100%, 360px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}

.screen-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hidden {
  display: none;
}

.panel,
.interstitial-card {
  text-align: center;
  color: var(--ink);
  padding: 28px 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--panel-strong), rgba(255, 241, 214, 0.92));
  box-shadow:
    0 18px 40px rgba(8, 22, 44, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.brand-logo {
  width: min(80%, 270px);
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(18, 36, 61, 0.6);
}

h1,
h2 {
  margin: 0;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  line-height: 0.9;
}

h1 {
  font-size: clamp(3rem, 8vw, 4.4rem);
}

h2 {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
}

.screen-copy {
  margin: 16px auto 0;
  max-width: 26ch;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.5;
}

.mode-picker,
.screen-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-picker {
  margin-top: 18px;
}

.mode-button.active {
  background: linear-gradient(180deg, #ffe37b, #ffbc5a);
}

.field-group {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  font-weight: 700;
}

select {
  min-height: 48px;
  padding: 0 16px;
  font-weight: 800;
}

.screen-actions {
  margin-top: 22px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 22px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  color: #fffdf5;
  background: linear-gradient(180deg, var(--accent), #ff5f40);
}



@media (max-width: 720px) {
  .page-shell {
    padding: 8px;
    gap: 8px;
  }

  .game-frame {
    width: min(100%, calc(100vw - 16px));
    border-radius: 26px;
  }

  .screen-overlay,
  .interstitial-slot {
    padding: 16px;
  }

  .panel {
    padding: 22px 18px;
  }
}