@font-face {
  font-family: 'Bergen Sans';
  src: url('../fonts/BergenSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Bergen Sans';
  src: url('../fonts/BergenSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-dark: #1a1020;
  --bg-deep: #0d0815;
  --brand-blue: #0072bb;
  --brand-green: #0ca250;
  --wood-light: #A0784C;
  --wood-mid: #8B6538;
  --wood-dark: #6B4C28;
  --text-main: #f8fafc;
  --text-pixel: #ffffff;
  --type-xs: 12px;
  --type-sm: 14px;
  --type-md: 16px;
  --type-lg: 18px;
  --type-xl: 28px;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

html, body {
  min-height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: 'Bergen Sans', sans-serif;
  color: var(--text-main);
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, rgba(0, 114, 187, 0.25), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(12, 162, 80, 0.2), transparent 60%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.02) 0 2px,
      transparent 2px 24px
    ),
    linear-gradient(180deg, #1a1030 0%, var(--bg-deep) 100%);
}

.game-layout {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(12px, 2.8vw, 20px);
}

.phone-stage {
  --stage-chrome: 96px;
  width: min(100%, 430px, calc((min(90vh, 90dvh) - var(--stage-chrome)) * 420 / 760));
  max-height: min(90vh, 90dvh);
  position: relative;
  background: #1a1020;
  border: 3px solid #3a2a40;
  border-radius: 12px;
  box-shadow: 0 0 0 3px #0d0815, 0 20px 60px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 480px) {
  .phone-stage {
    width: 100%;
    max-height: 100dvh;
    border: none;
    border-radius: 12px;
    box-shadow: none;
  }
  .game-layout {
    padding: 0;
  }
}

/* Header — dark bar like screenshot */
.topbar {
  background: linear-gradient(180deg, #2a2040, #1a1030);
  border-bottom: 2px solid #3a2a45;
  padding: clamp(10px, 2.2vw, 12px) clamp(14px, 3vw, 18px) clamp(12px, 2.6vw, 14px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: clamp(72px, 11vw, 84px);
  flex-shrink: 0;
}

.brand-lockup {
  grid-column: 2;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.6vw, 8px);
  margin: 4px 0 2px;
  max-width: min(100%, 220px);
}

.brand-logo {
  display: block;
  height: clamp(28px, 6vw, 38px);
  width: auto;
  max-width: min(100%, 190px);
  transform: none;
}

.brand-lockup h1 {
  font-family: 'Bergen Sans', ui-monospace, monospace;
  font-weight: 600;
  font-size: clamp(17px, 3.9vw, 20px);
  margin: 0;
  color: var(--text-pixel);
  text-transform: none;
  letter-spacing: clamp(0.4px, 0.18vw, 0.8px);
  line-height: 0.95;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  transform: none;
  text-align: center;
}

/* Round arcade buttons — in-canvas bottom-left */
.restart-fab,
.help-fab,
.assist-fab,
.mute-fab {
  position: absolute;
  z-index: 4;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 28%, #5ec8d4, #1a8fba 75%);
  border: 3px solid #0072bb;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.35),
    inset 0 -3px 0 rgba(0,0,0,0.25),
    0 3px 6px rgba(0,0,0,0.45),
    0 0 0 2px #0d0815;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.6);
}

.restart-fab { left: 10px; bottom: 12px; }
.help-fab { left: 10px; bottom: 64px; }
.assist-fab { left: 10px; bottom: 116px; }
.mute-fab { left: 10px; bottom: 168px; }

.mute-fab.overlay-floating { z-index: 9; }

.assist-fab[aria-pressed="true"] {
  background: radial-gradient(circle at 30% 28%, #7be2a0, #0ca250 75%);
  border-color: #0ca250;
}

.assist-fab[aria-pressed="false"] {
  background: radial-gradient(circle at 30% 28%, #6a6070, #34303a 75%);
  border-color: #2a2630;
  color: #b9b4c2;
}

.mute-fab[aria-pressed="false"] {
  background: radial-gradient(circle at 30% 28%, #f4bf63, #d67724 75%);
  border-color: #d67724;
}

.mute-fab[aria-pressed="true"] {
  background: radial-gradient(circle at 30% 28%, #6a6070, #34303a 75%);
  border-color: #2a2630;
  color: #f6a1a1;
}

.restart-fab svg,
.help-fab svg,
.assist-fab svg,
.mute-fab svg {
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.55));
}

.restart-fab:active,
.help-fab:active,
.assist-fab:active,
.mute-fab:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.4),
    0 1px 2px rgba(0,0,0,0.5),
    0 0 0 2px #0d0815;
}

.mute-fab .mute-slash {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mute-fab[aria-pressed="true"] .mute-slash {
  opacity: 1;
}

.mute-fab[aria-pressed="true"] .sound-wave {
  opacity: 0;
}

/* Score HUD — pixel scoreboard */
.scoreboard {
  position: absolute;
  top: 10px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(230px, calc(100% - 20px));
  display: grid;
  grid-template-columns: minmax(48px, 1fr) minmax(50px, 0.85fr) minmax(48px, 1fr);
  gap: 4px;
  pointer-events: none;
  z-index: 3;
  padding: 6px 7px 5px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(26, 20, 44, 0.96), rgba(10, 8, 18, 0.98)),
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent 40%);
  border: 2px solid #211730;
  box-shadow:
    inset 0 0 0 2px rgba(88, 76, 115, 0.75),
    0 8px 20px rgba(0, 0, 0, 0.38);
}

.scoreboard::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(105, 94, 136, 0.3);
  border-radius: 2px;
  pointer-events: none;
}

.scoreboard article {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.scoreboard-side,
.scoreboard-center {
  background: linear-gradient(180deg, rgba(8, 10, 20, 0.82), rgba(19, 14, 29, 0.94));
  border: 1px solid #1a1624;
  box-shadow: inset 0 0 0 1px rgba(104, 92, 132, 0.24);
  border-radius: 4px;
  padding: 5px 5px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
}

.scoreboard-label {
  font-family: 'Bergen Sans', ui-monospace, monospace;
  font-size: 6px;
  letter-spacing: 0.2px;
  line-height: 1;
  min-width: 0;
  white-space: nowrap;
  text-transform: uppercase;
}

.scoreboard-label {
  color: #f2eddc;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.85);
}

.scoreboard-value,
.scoreboard-timer,
.scoreboard-period {
  font-family: 'Bergen Sans', sans-serif;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.5px;
}

.scoreboard-value {
  font-size: 24px;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.2), 2px 2px 0 rgba(0, 0, 0, 0.75);
}

.scoreboard-home .scoreboard-value {
  color: #ff5b4f;
}

.scoreboard-away .scoreboard-value {
  color: #47a2ff;
}

.scoreboard-timer {
  font-size: 21px;
  color: #fcb441;
  text-shadow: 0 0 10px rgba(252, 180, 65, 0.18), 2px 2px 0 rgba(0, 0, 0, 0.85);
}

.scoreboard-period {
  font-size: 16px;
  color: #ff5b4f;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.85);
}

/* Tooltip — right of assist-fab */
.assist-tooltip {
  position: absolute;
  top: auto;
  bottom: 116px;
  left: 62px;
  transform: none;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(13, 8, 21, 0.95);
  border: 1px solid #4a3a55;
  color: #fff;
  padding: 8px 12px 9px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  width: 160px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.assist-tooltip.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-6px);
}

.assist-tooltip-copy {
  display: block;
  padding-right: 2px;
}

.assist-tooltip-close {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  margin: -2px -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.assist-tooltip-close:hover,
.assist-tooltip-close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.tooltip-arrow {
  position: absolute;
  top: 50%;
  bottom: auto;
  left: -6px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #4a3a55;
  border-left: 0;
}

@media (max-width: 420px) {
  .assist-tooltip {
    top: auto;
    bottom: 100px;
    left: 54px;
    width: 140px;
    font-size: 10px;
  }

  .assist-tooltip-close {
    margin-right: -2px;
  }
}

.assist-banner,
.status-toast {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 3;
  pointer-events: none;
  text-align: center;
}

.assist-banner {
  top: 82px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(12, 162, 80, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  color: #f8fafc;
  font-family: 'Bergen Sans', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.35px;
  text-transform: none;
}

.status-toast {
  top: 118px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
  color: #eef2f7;
  font-family: 'Bergen Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.status-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.status-toast.warning {
  border-color: rgba(255, 207, 71, 0.35);
  color: #ffe39b;
}

.status-toast.assist {
  border-color: rgba(12, 162, 80, 0.45);
  color: #c9ffd8;
}

.status-toast.success {
  border-color: rgba(94, 200, 212, 0.45);
  color: #d2fbff;
}

.canvas-panel {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

canvas {
  display: block;
  touch-action: none;
  aspect-ratio: 420 / 760;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  background: url("../assets/game/background/bg.webp") center / 100% 100% no-repeat;
}

.fps-indicator {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 8;
  min-width: 72px;
  padding: 5px 8px;
  border: 1px solid rgba(124, 255, 107, 0.55);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #7cff6b;
  font: 600 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-align: center;
  pointer-events: none;
}

.fps-indicator[hidden] {
  display: none;
}

/* Overlays & Cards */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 24px) clamp(16px, 4vw, 24px) clamp(28px, 8vw, 86px);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.visible {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.overlay-card, .lead-card {
  background: linear-gradient(180deg, #2a2040, #1a1030);
  border: 3px solid #4a3a55;
  padding: clamp(18px, 4.5vw, 24px);
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  text-align: center;
}

.overlay-card h2, .lead-card h2 {
  font-family: 'Bergen Sans', ui-monospace, monospace;
  font-weight: 600;
  font-size: var(--type-xl);
  color: var(--brand-green);
  margin: 0 0 14px;
  line-height: 1.25;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.overlay-card p, .lead-card p {
  font-size: var(--type-sm);
  line-height: 1.65;
  margin: 0 0 16px;
  color: #d0c8d8;
}

.modal-graphic {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 18px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.overlay-card strong,
.lead-card strong,
.help-list strong {
  font-weight: 600;
  color: var(--text-main);
}

.copy-accent {
  color: #5ec8d4 !important;
}

.intro-card {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(42, 32, 64, 0.74), rgba(26, 16, 48, 0.84)),
    radial-gradient(circle at 50% 24%, rgba(94, 200, 212, 0.18), transparent 42%),
    url("../assets/ui/modals/bg-intro.webp") 68% center / cover no-repeat,
    linear-gradient(180deg, #2a2040, #1a1030);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 22px 22px 18px;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 200, 212, 0.45) transparent;
}

.intro-card::-webkit-scrollbar { width: 6px; }
.intro-card::-webkit-scrollbar-thumb {
  background: rgba(94, 200, 212, 0.45);
  border-radius: 3px;
}

.intro-card > * {
  margin: 0;
}

.intro-hero-logo {
  display: block;
  width: min(48%, 150px);
  height: auto;
}

.intro-title {
  font-size: 20px;
  line-height: 1.1;
  color: #fff !important;
  margin: 0 !important;
}

.intro-sub {
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  margin: 0 !important;
}

.intro-sub strong { color: #fff; font-weight: 700; }

.intro-scroll-cue {
  position: sticky;
  bottom: -8px;
  align-self: center;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 24px;
  margin-top: -12px;
  border-radius: 999px;
  background: rgba(22, 14, 40, 0.88);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(94, 200, 212, 0.28);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.intro-scroll-cue.hidden {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.intro-scroll-cue-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(94, 200, 212, 0.9);
  border-bottom: 2px solid rgba(94, 200, 212, 0.9);
  transform: rotate(45deg);
  margin-top: -2px;
}

.prize-section {
  width: 100%;
  border-top: 1px solid rgba(94, 200, 212, 0.35);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.prize-heading {
  font-family: 'Bergen Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.6px;
  color: #fff;
  margin: 0;
}

.prize-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 26px;
  align-items: center;
}

.prize-item {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.prize-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  margin: 0;
  line-height: 1.25;
}

.prize-image {
  display: block;
  width: auto;
  max-height: 110px;
  max-width: 72%;
  filter: drop-shadow(0 8px 16px rgba(78, 180, 197, 0.28));
  transition: transform 220ms ease, filter 220ms ease;
  will-change: transform;
}

.prize-item:hover .prize-image,
.prize-item:focus-within .prize-image {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 12px 22px rgba(94, 200, 212, 0.45));
}

.help-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  text-align: left;
}

.help-list li {
  font-size: var(--type-sm);
  line-height: 1.6;
  color: #d0c8d8;
  padding: 8px 0 8px 22px;
  position: relative;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}

.help-list li:last-child { border-bottom: none; }

.help-list li::before {
  content: "•";
  color: var(--brand-green);
  position: absolute;
  left: 6px;
  top: 8px;
  font-size: 16px;
}

/* Primary action — cyan pill button */
.primary-button {
  width: 100%;
  background: linear-gradient(180deg, #5ec8d4 0%, #2fa6c7 55%, #1a8fba 100%);
  border: none;
  color: #fff;
  font-family: 'Bergen Sans', sans-serif;
  font-weight: 500;
  font-size: var(--type-md);
  letter-spacing: 0.3px;
  text-transform: none;
  padding: 14px 20px;
  cursor: pointer;
  border-radius: 8px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -2px 0 rgba(0,0,0,0.12),
    0 3px 6px rgba(0,0,0,0.25);
  transition: transform 0.05s ease, box-shadow 0.1s ease;
}

.primary-button:hover {
  background: linear-gradient(180deg, #6cd2dd 0%, #35b0d0 55%, #1e97c2 100%);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -1px 0 rgba(0,0,0,0.1),
    0 2px 4px rgba(0,0,0,0.18);
}

.secondary-button {
  width: 100%;
  background: transparent;
  border: 2px solid rgba(94, 200, 212, 0.4);
  color: #5ec8d4;
  font-family: 'Bergen Sans', sans-serif;
  font-weight: 500;
  font-size: var(--type-md);
  padding: 12px 20px;
  margin-top: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.secondary-button:hover {
  background: rgba(94, 200, 212, 0.08);
  border-color: rgba(94, 200, 212, 0.6);
}

.secondary-button:active {
  background: rgba(94, 200, 212, 0.15);
}

.primary-button:active {
  background: linear-gradient(180deg, #2fa6c7 0%, #1a8fba 100%);
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 3px rgba(0,0,0,0.25),
    0 1px 2px rgba(0,0,0,0.3);
}

/* Lead Form */
.lead-card {
  position: absolute;
  inset: 0;
  z-index: 11;
  flex-direction: column;
  overflow-y: auto;
  padding: 40px 14px 10px;
  background: rgba(13, 8, 21, 0.95);
  border: none;
  border-radius: 0;
  display: flex;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lead-card:not(.hidden) {
  display: flex;
}

.lead-copy {
  max-width: 312px;
  margin: 0 auto 6px;
}

.lead-copy h2 {
  margin-bottom: 6px;
  font-size: clamp(22px, 4.8vw, 30px);
  line-height: 1.08;
  color: #f8fafc;
}

.lead-copy p {
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.3;
  color: #f8fafc;
}

.form-fields {
  width: 100%;
  max-width: 312px;
  margin: 0 auto;
  text-align: left;
}

/* Form fields — label above input */
.form-field {
  margin-bottom: 8px;
}

.form-field label {
  display: block;
  font-family: 'Bergen Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #d7d3e2;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 5px;
}

.form-field input {
  width: 100%;
  background: #1a1030;
  border: 2px solid #3a2a50;
  color: #fff;
  padding: 8px 11px;
  font-family: 'Bergen Sans', sans-serif;
  font-size: 13px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-field input:focus {
  border-color: #23c8ff;
}

.form-field .req {
  color: #ff6b6b;
  font-weight: 700;
}

.form-consent {
  margin: 8px 0 10px;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: start;
}

.form-consent input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border-radius: 4px;
  border: 2px solid #23c8ff;
  background: transparent;
  cursor: pointer;
}

.form-consent input[type="checkbox"]:checked {
  background: linear-gradient(180deg, #5ec8d4 0%, #1a8fba 100%);
}

.form-consent input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 4px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: translate(5px, 1px) rotate(45deg);
}

.form-consent label {
  font-size: 12.5px;
  line-height: 1.32;
  color: #f1f5f9;
}

.inline-link {
  display: inline;
  font-size: inherit;
  line-height: inherit;
  color: #f1f5f9;
  text-underline-offset: 2px;
}

.inline-link:hover {
  color: #8ee8ff;
}

.eyebrow {
  font-family: 'Bergen Sans', ui-monospace, monospace;
  font-weight: 600;
  font-size: var(--type-xs);
  color: var(--brand-blue);
  text-transform: none;
  margin: 0 0 12px;
  letter-spacing: 0.6px;
}

.eyebrow:empty {
  display: none;
}

.overlay-card.is-win {
  gap: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.overlay-card.is-win h2 {
  color: #0ca250;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0.5px;
  margin: 0;
}

.overlay-card.is-win p {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.65;
  color: #d0c8d8;
  letter-spacing: 0.6px;
  margin: 0;
}

.overlay-card.is-win .primary-button { margin-top: 4px; }
.overlay-card.is-win .secondary-button { margin-top: 0; }

.overlay-card.is-loss {
  gap: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.overlay-card.is-loss .eyebrow {
  font-family: 'Bergen Sans', ui-monospace, monospace;
  font-weight: 400;
  font-size: 20px;
  color: #ffffff;
  letter-spacing: 0.8px;
  margin: 0;
}

.overlay-card.is-loss h2 {
  color: #0ca250;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0.5px;
  margin: 0;
}

.overlay-card.is-loss p {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.65;
  color: #d0c8d8;
  letter-spacing: 0;
  margin: 0;
}

.overlay-card.is-loss .primary-button { margin-top: 4px; }

.lead-card p.form-note {
  font-size: 11px;
  line-height: 1.38;
  color: #8ee8ff;
  margin-top: 5px;
  margin-bottom: 6px;
  text-align: center;
}

.lead-card p.form-note[data-status="success"] {
  color: #9ff7c2;
}

.lead-card p.form-note[data-status="error"] {
  color: #ffb4b4;
}

.lead-card p.form-note[data-status="pending"] {
  color: #ffe29f;
}

.participation-card {
  width: min(100%, 360px);
}

.participation-logo {
  display: block;
  width: min(58%, 180px);
  height: auto;
  margin: 0 auto 20px;
}

.lead-card p.form-legal {
  margin: 0 auto 10px;
  width: min(100%, 292px);
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 10px 12px;
  font-family: 'Bergen Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  color: #f1f5f9;
  text-align: center;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.aux-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(94, 200, 212, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.aux-footer-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(100%, 240px);
  opacity: 0.9;
  filter: saturate(0.94);
}

.aux-footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 0;
}

.aux-link {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text-main);
  font-family: 'Bergen Sans', sans-serif;
  font-size: var(--type-xs);
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.aux-link:hover {
  color: #5ec8d4;
}

.aux-link.inline-link {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-underline-offset: 2px;
}

.aux-footer-note,
.aux-content p,
.aux-content li {
  font-size: var(--type-xs);
  line-height: 1.55;
  color: #d0c8d8;
}

.aux-footer-note {
  margin: 0;
}

.aux-overlay-card {
  width: min(100%, 360px);
  max-height: min(78vh, 620px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#auxOverlay {
  z-index: 20;
}

.aux-content {
  flex: 1 1 auto;
  min-height: 0;
  text-align: left;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 200, 212, 0.45) transparent;
  padding: 4px 4px 0;
  margin: 0 -4px 16px;
}

.aux-content::-webkit-scrollbar { width: 6px; }
.aux-content::-webkit-scrollbar-thumb {
  background: rgba(94, 200, 212, 0.45);
  border-radius: 3px;
}

.aux-content h3 {
  margin: 0 0 8px;
  color: #5ec8d4;
  font-family: 'Bergen Sans', sans-serif;
  font-size: var(--type-md);
  font-weight: 600;
}

.aux-content p {
  margin: 0 0 14px;
}

.aux-content ul {
  margin: 0 0 16px;
  padding-left: 18px;
}

.aux-content li {
  margin-bottom: 8px;
}

.tips-card {
  display: none;
  text-align: center;
}

.hidden {
  display: none !important;
}

.button-row {
  display: flex;
  gap: 10px;
}

.button-row .primary-button {
  flex: 1;
}

/* Debug panel */
#debugPanel {
  position: fixed;
  top: 8px;
  right: 8px;
  width: min(360px, calc(100vw - 16px));
  max-height: 78vh;
  background: rgba(0, 0, 0, 0.85);
  color: #9dff9d;
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-size: 11px;
  line-height: 1.35;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 8px;
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#debugPanel[hidden] {
  display: none !important;
}

#debugPanel.collapsed #debugState,
#debugPanel.collapsed #debugLog,
#debugPanel.collapsed #debugFileLog,
#debugPanel.collapsed .debug-label {
  display: none;
}

#debugPanel .debug-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  color: #ffcf47;
  margin-bottom: 4px;
  gap: 4px;
}

.debug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

#debugPanel button {
  background: #222;
  border: 1px solid #444;
  color: #ccc;
  font: inherit;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  cursor: pointer;
}

.debug-modals {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 6px;
}

.debug-modals button {
  background: #1a3a2a;
  border: 1px solid #2a6a4a;
  color: #9dff9d;
  font: inherit;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 2px;
  cursor: pointer;
}

.debug-modals button:hover {
  background: #2a5a3a;
}

.debug-modals button.debug-hide-all {
  background: #3a1a1a;
  border-color: #6a2a2a;
  color: #ff9d9d;
}

#debugState {
  margin: 0 0 4px 0;
  white-space: pre-wrap;
  color: #9de1ff;
}

#debugLog {
  overflow-y: auto;
  flex: 1;
  min-height: 140px;
  max-height: 24vh;
  border-top: 1px dashed #333;
  padding-top: 4px;
}

#debugLog .entry {
  color: #9dff9d;
  white-space: pre-wrap;
}

#debugLog .entry.warn { color: #ffcf47; }
#debugLog .entry.err  { color: #ff7a7a; }
#debugLog .entry.evt  { color: #c59dff; }

.debug-label {
  display: block;
  margin-top: 6px;
  margin-bottom: 4px;
  color: #ffcf47;
}

#debugFileLog {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid #333;
  color: #c7f3c7;
  font: inherit;
  font-size: 10px;
  line-height: 1.35;
  padding: 6px;
  border-radius: 3px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .game-layout {
    padding: clamp(10px, 3vw, 20px);
  }
  .phone-stage {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 2px solid #3a2a40;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  }
  .topbar {
    display: grid;
    min-height: 64px;
    padding: 8px 12px;
  }
  canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 420 / 760;
  }
  .aux-footer-nav {
    gap: 6px 10px;
  }
  .aux-link {
    font-size: 11px;
  }
  .restart-fab,
  .help-fab,
  .assist-fab,
  .mute-fab {
    bottom: auto;
  }
  .restart-fab { bottom: 10px; }
  .help-fab { bottom: 62px; }
  .assist-fab { bottom: 114px; }
  .mute-fab { bottom: 166px; }
  .assist-tooltip {
    bottom: 114px;
    left: 62px;
  }
  .scoreboard {
    top: 8px;
    left: 50%;
    right: auto;
    gap: 4px;
    padding: 5px 6px 4px;
  }
  .scoreboard-side,
  .scoreboard-center {
    min-height: 42px;
    padding: 5px 4px 4px;
    gap: 3px;
  }
  .scoreboard-label {
    font-size: 5.5px;
  }
  .scoreboard-value {
    font-size: 22px;
  }
  .scoreboard-timer {
    font-size: 19px;
  }
  .scoreboard-period {
    font-size: 15px;
  }
  .assist-banner {
    top: 76px;
  }
  .status-toast {
    top: 110px;
    font-size: 12px;
  }
  .overlay {
    align-items: center;
    padding: 12px 12px 18px;
    overflow-y: auto;
  }
  .overlay-card {
    width: min(100%, 380px);
  }
  .overlay-card h2,
  .lead-card h2 {
    font-size: clamp(22px, 6vw, 26px);
    margin-bottom: 10px;
  }
  .overlay-card p {
    line-height: 1.55;
    margin-bottom: 14px;
  }
  .lead-card {
    padding: 44px 12px 10px;
  }
  .lead-card .lead-copy h2 {
    font-size: clamp(21px, 6vw, 26px);
    margin-bottom: 6px;
  }
  .lead-card .lead-copy p {
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .phone-stage {
    border-radius: 12px;
  }
  .game-layout {
    padding: 10px;
  }
}

@media (max-width: 420px) {
  .topbar {
    min-height: 70px;
    padding: 8px 10px 10px;
  }
  .brand-lockup {
    max-width: 172px;
    gap: 5px;
  }
  .brand-logo {
    height: 28px;
    max-width: 148px;
  }
  .brand-lockup h1 {
    font-size: 16px;
    letter-spacing: 0.3px;
  }
  .restart-fab,
  .help-fab,
  .assist-fab,
  .mute-fab {
    width: 38px;
    height: 38px;
    left: 8px;
  }
  .restart-fab { bottom: 8px; }
  .help-fab { bottom: 54px; }
  .assist-fab { bottom: 100px; }
  .mute-fab { bottom: 146px; }
  .assist-tooltip {
    bottom: 100px;
    left: 54px;
  }
  .scoreboard {
    top: 8px;
    left: 50%;
    right: auto;
    width: min(220px, calc(100% - 16px));
    gap: 3px;
    padding: 5px 5px 4px;
  }
  .scoreboard-side,
  .scoreboard-center {
    min-height: 38px;
    padding: 4px 3px 3px;
    gap: 2px;
  }
  .scoreboard-label {
    font-size: 5px;
    letter-spacing: 0.1px;
  }
  .scoreboard-value {
    font-size: 19px;
  }
  .scoreboard-timer {
    font-size: 17px;
  }
  .scoreboard-period {
    font-size: 13px;
  }
  .assist-banner {
    top: 66px;
    left: 10px;
    right: 10px;
    padding: 6px 10px;
    font-size: 9px;
  }
  .status-toast {
    top: 98px;
    left: 10px;
    right: 10px;
    padding: 9px 12px;
    font-size: 11px;
  }
  .overlay-card,
  .lead-card {
    padding: 16px 14px;
  }
  .primary-button,
  .secondary-button {
    font-size: 15px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .aux-footer-logo {
    height: 42px;
    max-width: 200px;
  }
}

@media (max-height: 760px) {
  .game-layout {
    padding: 10px;
  }
  .phone-stage {
    --stage-chrome: 80px;
    width: min(100%, calc((100dvh - 20px - var(--stage-chrome)) * 420 / 760));
    max-height: calc(100dvh - 20px);
  }
  .topbar {
    min-height: 68px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .brand-lockup {
    gap: 4px;
    margin: 2px 0;
  }
  .brand-logo {
    height: 28px;
  }
  .brand-lockup h1 {
    font-size: 16px;
  }
  .assist-banner {
    top: 74px;
  }
  .status-toast {
    top: 106px;
  }
  .overlay {
    padding-top: 10px;
    padding-bottom: 12px;
  }
  .overlay-card,
  .lead-card {
    padding: 16px;
  }
  .overlay-card h2,
  .lead-card h2 {
    font-size: 22px;
    margin-bottom: 10px;
  }
  .overlay-card p {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
  }
  .lead-card {
    padding-top: 40px;
  }
  .lead-card .lead-copy h2 {
    font-size: clamp(20px, 5.5vw, 24px);
    margin-bottom: 6px;
  }
  .lead-card .lead-copy p {
    font-size: 11.5px;
    line-height: 1.28;
    margin-bottom: 4px;
  }
}
