/*
 * BSI Game Shell — Heritage v2.1 tokens
 * Scoped to game frames. Mirrors lib/tokens and app/globals.css.
 * Used by every arcade game so the family stays in one visual lineage.
 */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Oswald:wght@500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=Cormorant+Garamond:ital,wght@1,500;1,600&family=JetBrains+Mono:wght@500;700&display=swap');

:root,
[data-bsi-game] {
  /* Surfaces */
  --surface-scoreboard: #050505;
  --surface-dugout: #0d0d0d;
  --surface-press-box: #080808;
  --surface-middle-card: #15110d;
  --surface-middle-card-raised: #1d1813;

  /* Brand */
  --bsi-primary: #bf5700;
  --bsi-primary-deep: #8b3d00;
  --bsi-primary-bright: #d96a1a;
  --bsi-primary-text: #db6400;
  --bsi-cta-fill: #9c4500;
  --bsi-accent: #ff6b35;
  --bsi-electric: #8fbad6;
  --bsi-bone: #f5f2eb;
  --bsi-dust: #c4b8a5;
  --bsi-texas-soil: #9c7b5c;
  --heritage-columbia-blue: #4b9cd3;
  --heritage-bronze: #8c6239;

  /* Borders */
  --border-vintage: rgba(140, 98, 57, 0.3);
  --border-vintage-strong: rgba(140, 98, 57, 0.55);
  --border-subtle: rgba(245, 242, 235, 0.08);
  --border-electric: rgba(143, 186, 214, 0.32);

  /* Type */
  --font-display: 'Bebas Neue', Impact, sans-serif;
  --font-heading: 'Oswald', system-ui, sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-editorial: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Motion */
  --bsi-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --bsi-ease-in: cubic-bezier(0.5, 0, 0.75, 0);

  /* Z-index lanes for game HUD */
  --bsi-z-game: 1;
  --bsi-z-hud: 5;
  --bsi-z-overlay: 50;
  --bsi-z-modal: 90;
}

/* Base reset for the game viewport */
[data-bsi-game] {
  background: var(--surface-scoreboard);
  color: var(--bsi-bone);
  font-family: var(--font-heading);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Heritage stamp — burnt-orange Oswald uppercase label */
.bsi-stamp {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--bsi-electric);
}

/* Heritage display heading */
.bsi-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--bsi-bone);
  line-height: 0.9;
}

/* Editorial support copy stays in Source Serif; Cormorant is reserved for pull quotes. */
.bsi-subtitle {
  font-family: var(--font-body);
  color: var(--bsi-dust);
  line-height: 1.5;
}

/* Heritage card surface */
.bsi-card {
  background: var(--surface-middle-card);
  border: 1px solid var(--border-vintage);
  border-radius: 2px;
}

/* Heritage button */
.bsi-btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 14px 32px;
  min-height: 44px;
  background: var(--surface-scoreboard);
  color: var(--bsi-bone);
  border: 1.5px solid var(--bsi-primary);
  border-radius: 2px;
  cursor: pointer;
  transition:
    transform 0.15s var(--bsi-ease-out),
    background 0.15s var(--bsi-ease-out);
}
.bsi-btn:hover {
  background: rgba(191, 87, 0, 0.18);
  transform: translateY(-1px);
}
.bsi-btn:active {
  transform: translateY(0);
}
.bsi-btn--filled {
  background: var(--bsi-cta-fill);
  border-color: var(--bsi-cta-fill);
  box-shadow:
    0 4px 20px rgba(191, 87, 0, 0.35),
    inset 0 1px 0 rgba(245, 242, 235, 0.1);
}

/* HUD frame — top stamp and bottom score bar */
.bsi-hud-frame {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(245, 242, 235, 0.85);
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.95), rgba(21, 17, 13, 0.94));
  border: 1px solid var(--border-vintage);
  border-radius: 2px;
  pointer-events: none;
  z-index: var(--bsi-z-hud);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}
.bsi-hud-frame .bsi-hud-label {
  font-size: 12px;
  color: rgba(196, 184, 165, 0.65);
  letter-spacing: 2px;
}
.bsi-hud-frame .bsi-hud-value {
  color: var(--bsi-bone);
  font-weight: 700;
  font-size: 15px;
}

/* Top-left brand stamp on every game */
.bsi-brand {
  position: absolute;
  top: 14px;
  left: 18px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--bsi-electric);
  z-index: var(--bsi-z-hud);
  pointer-events: none;
  text-shadow: 0 0 18px rgba(143, 186, 214, 0.25);
}
.bsi-brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(196, 184, 165, 0.7);
  letter-spacing: 2.4px;
  margin-top: -2px;
}

/* Overlay for splash / pause / end-of-game */
.bsi-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(143, 186, 214, 0.08), transparent 26%),
    radial-gradient(circle at 50% 40%, rgba(191, 87, 0, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(5, 5, 5, 0.98), rgba(13, 13, 13, 0.98));
  z-index: var(--bsi-z-overlay);
}
.bsi-overlay--hidden {
  display: none !important;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
