* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", "Arial Narrow", Arial, sans-serif;
}

.fever-shell {
  width: min(100vw - 32px, 1120px);
  margin: 0 auto;
  padding:
    max(16px, env(safe-area-inset-top))
    0
    max(18px, env(safe-area-inset-bottom));
}

.fever-topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 4px 16px;
  border-bottom: 2px solid rgba(255, 216, 77, 0.2);
}

.brand-block {
  display: grid;
  gap: 8px;
}

.back-link,
.start-btn {
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}

.fever-topbar h1 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 0.92;
}

.start-btn {
  cursor: pointer;
  border: 1px solid rgba(255, 216, 77, 0.24);
  background: rgba(18, 45, 96, 0.82);
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  box-shadow: 0 0 24px rgba(255, 216, 77, 0.12);
}

.hud-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hud-card,
.fever-meter-wrap {
  border: 1px solid rgba(255, 216, 77, 0.16);
  background: rgba(18, 45, 96, 0.44);
  backdrop-filter: blur(10px);
}

.hud-card {
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.hud-label,
.fever-label,
.fever-state {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.hud-card strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.3rem, 4vw, 2.4rem);
  line-height: 1;
}

.fever-meter-wrap {
  margin-top: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.fever-meter {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 216, 77, 0.08);
  overflow: hidden;
}

.fever-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe588 0%, #ffd84d 40%, #ff7a00 100%);
  box-shadow: 0 0 18px rgba(255, 216, 77, 0.35);
  transition: width 120ms linear;
}

.game-stage {
  position: relative;
  margin-top: 18px;
  height: min(72vh, 760px);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(255, 216, 77, 0.16);
  background:
    radial-gradient(circle at center, rgba(255, 216, 77, 0.16), transparent 42%),
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.08), transparent 12%),
    linear-gradient(180deg, rgba(10, 28, 60, 0.94), rgba(7, 18, 41, 0.98));
  box-shadow: inset 0 0 42px rgba(255, 216, 77, 0.06);
}

#game-canvas,
.scan-overlay,
.center-message {
  position: absolute;
  inset: 0;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scan-overlay {
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.045) 0%,
      rgba(255, 255, 255, 0) 10%,
      rgba(255, 255, 255, 0) 100%
    ),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03) 0 1px,
      transparent 1px 5px
    );
  mix-blend-mode: screen;
}

.center-message {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  pointer-events: none;
  padding: 24px;
  transition: opacity 180ms ease;
}

.center-message.hidden {
  opacity: 0;
}

.center-message img {
  width: min(240px, 52vw);
  filter: var(--logo-filter);
}

.center-message h2 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 0.98;
}

.center-message p,
.game-footer p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.45;
}

.game-footer {
  padding: 14px 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.76rem;
}

body.fever-active .game-stage {
  box-shadow: 0 0 46px rgba(255, 127, 39, 0.34), inset 0 0 54px rgba(255, 216, 77, 0.1);
}

body.fever-active .fever-fill {
  background: linear-gradient(90deg, #fff1b0 0%, #ff9a1f 48%, #ff3f0a 100%);
}

@media (max-width: 900px) {
  .hud-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-stage {
    min-height: 460px;
    height: 62vh;
  }
}

@media (max-width: 640px) {
  .fever-shell {
    width: min(100vw - 20px, 1120px);
  }

  .fever-topbar {
    align-items: start;
    flex-direction: column;
  }

  .start-btn {
    width: 100%;
    justify-self: stretch;
  }

  .fever-meter-wrap {
    grid-template-columns: 1fr;
  }

  .game-stage {
    min-height: 420px;
    height: 56vh;
  }
}
