@import url('https://fonts.googleapis.com/css2?family=Russo+One:wght@400&family=Work+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  --gold: #FACC15;
  --gold-bright: #FDE047;
  --gold-dark: #CA8A04;
  --royal: #1E3A8A;
  --azure: #00A8E8;
  --azure-bright: #38BDF8;
  --navy: #0A1931;
  --card-bg: rgba(16, 24, 40, 0.85);
  --card-elevated: rgba(20, 33, 61, 0.90);
  --border-subtle: rgba(0, 168, 232, 0.35);
  --border-gold: rgba(250, 204, 21, 0.55);
  --text-white: #F8FAFC;
  --text-muted: #94A3B8;
  --emerald: #10B981;
  --danger: #EF4444;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-family: 'Work Sans', system-ui, sans-serif;
  color: var(--text-white);
  background-color: var(--navy);
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

.app-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.65);
}

/* TOP TELEMETRY HEADER BAR */
.top-telemetry-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
  background: rgba(10, 25, 49, 0.88);
  border-bottom: 2px solid var(--border-subtle);
  z-index: 25;
  gap: 8px;
}

.brand-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.6px;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--azure-bright);
  white-space: nowrap;
}

.telemetry-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.76rem;
  background: rgba(16, 24, 40, 0.92);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.gold-pill {
  border-color: var(--border-gold);
  color: var(--gold);
}

.azure-pill {
  border-color: var(--border-subtle);
  color: var(--azure-bright);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 58, 138, 0.6);
  color: var(--text-white);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:active {
  transform: scale(0.93);
}

/* MAIN VIEWPORT & SCREENS */
.screens-viewport {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px calc(24px + env(safe-area-inset-bottom, 0px));
}

.screen {
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.screen:not(.active) {
  display: none !important;
}

/* SCREEN #1: WELCOME / INTRO (Single Viewport, No Scroll) */
#screen-welcome.active {
  height: 100%;
  justify-content: center;
  overflow: hidden;
}

.welcome-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border-gold);
  border-top: 4px solid var(--gold);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-height: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.welcome-badge {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 1.2px;
  color: var(--navy);
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  padding: 4px 12px;
  border-radius: 4px;
  transform: skewX(-10deg);
}

.welcome-canvas-wrap {
  width: 100%;
  height: 165px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 50% 35%, rgba(30, 58, 138, 0.75), rgba(10, 25, 49, 0.95));
  overflow: hidden;
  position: relative;
}

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

.welcome-slide-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
}

.welcome-title {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 1.12rem;
  color: var(--gold);
  margin: 0;
  letter-spacing: 0.5px;
}

.welcome-benefit-pill {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--azure-bright);
  background: rgba(0, 168, 232, 0.16);
  border: 1px solid rgba(0, 168, 232, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.welcome-desc {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-white);
  margin: 0;
  opacity: 0.92;
}

.welcome-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.4);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.dot.active {
  width: 26px;
  background: var(--gold);
}

.welcome-actions {
  display: flex;
  width: 100%;
  gap: 8px;
}

/* BUTTONS */
.btn-primary {
  flex: 1;
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.6px;
  padding: 11px 14px;
  border-radius: 10px;
  border: none;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.35);
  cursor: pointer;
  text-align: center;
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
}

.btn-secondary {
  flex: 1;
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  color: var(--text-white);
  background: rgba(30, 58, 138, 0.55);
  cursor: pointer;
  text-align: center;
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* SCREEN #2: HOME MENU — SCOREBOARD & FLOATING TACTILE CARDS */
.hero-scoreboard {
  background: var(--card-bg);
  border: 1.5px solid var(--border-gold);
  border-top: 4px solid var(--gold);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.scoreboard-top-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.scoreboard-tag {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.8px;
  color: var(--azure-bright);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.streak-tag {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.65rem;
  background: rgba(250, 204, 21, 0.2);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.scoreboard-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scoreboard-left {
  flex: 1;
  min-width: 0;
}

.scoreboard-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
}

.scoreboard-stage {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 1.15rem;
  color: var(--text-white);
  margin: 2px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scoreboard-progress-wrap {
  width: 100%;
  height: 7px;
  background: rgba(10, 25, 49, 0.9);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0, 168, 232, 0.3);
}

.scoreboard-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--azure), var(--gold));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.scoreboard-sub {
  font-size: 0.7rem;
  color: var(--gold-bright);
  margin-top: 4px;
  font-weight: 600;
}

.btn-play-hero {
  flex-shrink: 0;
  width: 84px;
  height: 68px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(145deg, var(--gold-bright), var(--gold-dark));
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(250, 204, 21, 0.4);
}

.btn-play-hero:active {
  transform: scale(0.95);
}

.play-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.play-label {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

/* TACTILE STACK */
.tactile-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tactile-card {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--text-white);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38);
}

.tactile-card:active {
  transform: scale(0.985);
}

.card-accent-strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--azure);
}

.card-gold .card-accent-strip {
  background: var(--gold);
}

.card-azure .card-accent-strip {
  background: var(--azure);
}

.card-royal .card-accent-strip {
  background: var(--emerald);
}

.card-navy .card-accent-strip {
  background: var(--gold-bright);
}

.card-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(30, 58, 138, 0.65);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-left: 4px;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.card-title {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.84rem;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badge {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.62rem;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.card-badge.gold {
  background: rgba(250, 204, 21, 0.2);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.card-badge.azure {
  background: rgba(0, 168, 232, 0.2);
  color: var(--azure-bright);
  border: 1px solid var(--border-subtle);
}

.card-badge.emerald {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 7-DAY DAILY CHECK-IN PANEL */
.daily-checkin-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--azure);
  border-radius: 12px;
  padding: 10px;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.panel-title {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.76rem;
  color: var(--gold);
  letter-spacing: 0.4px;
}

.panel-status {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--azure-bright);
}

.checkin-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.checkin-cell {
  background: rgba(10, 25, 49, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 5px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.62rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkin-cell.claimed {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--emerald);
  color: #A7F3D0;
}

.checkin-cell.ready {
  background: rgba(250, 204, 21, 0.22);
  border: 1.5px solid var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.35);
}

.checkin-day {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.58rem;
}

.checkin-reward {
  font-weight: 800;
  font-size: 0.62rem;
}

/* SCREEN HEADERS (LEVELS, ARMORY, WHEEL, TELEMETRY) */
.screen-header-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--gold);
  border-radius: 12px;
  padding: 10px 12px;
}

.header-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.screen-heading {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.96rem;
  color: var(--gold);
  margin: 0;
  letter-spacing: 0.5px;
}

.act-stars-pill {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.72rem;
  background: rgba(30, 58, 138, 0.75);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.screen-subtext {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 6px 0 0;
  line-height: 1.35;
}

/* SCREEN #3: LEVEL SELECT */
.act-tabs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.act-tab {
  flex: 1;
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.64rem;
  padding: 7px 4px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 25, 49, 0.8);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-tab.active {
  background: linear-gradient(135deg, var(--royal), var(--azure));
  color: var(--text-white);
  border-color: var(--gold);
}

.act-banner-info {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-white);
  background: rgba(10, 25, 49, 0.75);
  border-left: 3px solid var(--azure);
  padding: 6px 8px;
  border-radius: 4px;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.level-tile {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  position: relative;
}

.level-tile.boss-tile {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(30, 58, 138, 0.9), rgba(16, 24, 40, 0.92));
}

.level-tile.locked {
  opacity: 0.55;
}

.level-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-num {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-white);
}

.level-stars {
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 1px;
}

.level-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--azure-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* SCREEN #4: GAME SCREEN */
#screen-game.active {
  height: 100%;
  overflow: hidden;
  gap: 6px;
}

.game-hud-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  background: rgba(10, 25, 49, 0.9);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--gold);
  border-radius: 10px;
  padding: 6px 8px;
}

.hud-pill {
  flex: 1 1 0;
  min-width: 0;
  background: rgba(16, 24, 40, 0.9);
  border: 1px solid rgba(0, 168, 232, 0.3);
  border-radius: 6px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
}

.combo-hud-pill {
  border-color: var(--border-gold);
}

.hud-label {
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--text-muted);
}

.hud-val {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.74rem;
  color: var(--gold);
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-pause-btn {
  flex: 0 0 32px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-gold);
  background: rgba(30, 58, 138, 0.8);
  color: var(--gold);
  font-size: 0.85rem;
  cursor: pointer;
}

.game-sub-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 24, 40, 0.85);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 168, 232, 0.25);
}

.time-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(10, 25, 49, 0.95);
  border-radius: 999px;
  overflow: hidden;
}

.time-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--azure), var(--gold));
  transition: width 0.12s linear;
}

.shields-row {
  display: flex;
  gap: 3px;
  font-size: 0.76rem;
}

.shield-pip {
  opacity: 0.25;
  transition: opacity 0.2s;
}

.shield-pip.active {
  opacity: 1;
}

.time-remaining-text {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.7rem;
  color: var(--azure-bright);
  min-width: 28px;
  text-align: right;
}

.game-canvas-container {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border-radius: 14px;
  border: 1.5px solid var(--border-subtle);
  background: rgba(10, 25, 49, 0.55);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 168, 232, 0.2);
}

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

/* SCREEN #5: ARMORY */
.armory-section-title {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.76rem;
  color: var(--azure-bright);
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.upgrades-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upgrade-item {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upgrade-info {
  flex: 1;
  min-width: 0;
}

.upgrade-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.upgrade-name {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-white);
}

.upgrade-lvl-badge {
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--gold);
  background: rgba(250, 204, 21, 0.16);
  padding: 2px 6px;
  border-radius: 4px;
}

.upgrade-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 3px 0 6px;
}

.stat-pips {
  display: flex;
  gap: 4px;
}

.stat-pip {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.25);
}

.stat-pip.filled {
  background: linear-gradient(90deg, var(--azure), var(--gold));
}

.btn-buy-upgrade {
  flex-shrink: 0;
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.72rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--navy);
  cursor: pointer;
  min-width: 82px;
}

.btn-buy-upgrade:disabled {
  background: rgba(30, 58, 138, 0.4);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.3);
}

.skins-grid, .trails-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cosmetic-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.cosmetic-card.equipped {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.28);
}

.cosmetic-preview {
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(10, 25, 49, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cosmetic-title {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.76rem;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cosmetic-perk {
  font-size: 0.66rem;
  color: var(--azure-bright);
}

/* SCREEN #6: BONUS PRIZE WHEEL */
.wheel-stage-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border-gold);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.wheel-canvas-wrap {
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#wheel-canvas {
  width: 240px;
  height: 240px;
  display: block;
}

.wheel-status-banner {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--gold-bright);
  background: rgba(10, 25, 49, 0.9);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 8px;
  text-align: center;
  width: 100%;
}

.wheel-buttons-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.wheel-prizes-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.legend-chip {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-white);
  text-align: center;
}

/* SCREEN #7: TELEMETRY & RECORDS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--azure);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kpi-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.kpi-val {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 1.2rem;
}

.gold-text {
  color: var(--gold);
}

.azure-text {
  color: var(--azure-bright);
}

.kpi-sub {
  font-size: 0.66rem;
  color: var(--text-muted);
}

.telemetry-chart-card, .telemetry-records-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
}

.act-bars-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.act-bar-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.act-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
}

.act-bar-track {
  height: 8px;
  background: rgba(10, 25, 49, 0.9);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0, 168, 232, 0.25);
}

.act-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--azure), var(--gold));
  border-radius: 999px;
}

.records-table-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 25, 49, 0.75);
  border: 1px solid rgba(0, 168, 232, 0.2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.74rem;
}

.record-stage {
  font-family: 'Russo One', system-ui, sans-serif;
  color: var(--text-white);
}

.record-score {
  color: var(--gold);
  font-weight: 800;
}

/* STATIC FLEX BOTTOM NAVIGATION */
.bottom-nav {
  flex: 0 0 auto;
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(10, 25, 49, 0.94);
  border-top: 2px solid var(--border-subtle);
  padding: 6px 6px calc(env(safe-area-inset-bottom, 0px) + 8px);
}

.nav-item {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item.active {
  color: var(--gold);
  background: rgba(30, 58, 138, 0.5);
}

.nav-icon {
  font-size: 1.08rem;
  line-height: 1;
}

.nav-label {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.4px;
}

/* MODALS */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 49, 0.78);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 390px;
  max-height: 86vh;
  background: rgba(16, 24, 40, 0.96);
  border: 1.5px solid var(--border-gold);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

.modal-scrollable {
  overflow-y: auto;
}

.modal-top-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--azure), var(--gold));
}

.modal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 1.02rem;
  color: var(--gold);
  margin: 0;
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  text-align: center;
}

.result-stars-row {
  font-size: 1.8rem;
  color: var(--gold);
  text-align: center;
  letter-spacing: 6px;
}

.result-stats-box {
  background: rgba(10, 25, 49, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.modal-actions-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

/* SETTINGS & LEGAL */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(10, 25, 49, 0.7);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 168, 232, 0.2);
}

.toggle-pill {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.68rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(148, 163, 184, 0.25);
  color: var(--text-muted);
  cursor: pointer;
}

.toggle-pill.active {
  background: var(--emerald);
  color: var(--navy);
  border-color: #34D399;
}

.btn-small-action {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.66rem;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-gold);
  background: rgba(250, 204, 21, 0.2);
  color: var(--gold);
  cursor: pointer;
}

.settings-divider {
  height: 1px;
  background: rgba(0, 168, 232, 0.25);
  margin: 2px 0;
}

.settings-subhead {
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.74rem;
  color: var(--azure-bright);
  margin: 0;
}

.about-box {
  background: rgba(10, 25, 49, 0.75);
  border: 1px solid rgba(0, 168, 232, 0.25);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-version-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.version-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(250, 204, 21, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.about-copy {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}

.about-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.btn-outline {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 58, 138, 0.45);
  color: var(--text-white);
  cursor: pointer;
}

.legal-body-content {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-white);
  max-height: 55vh;
  overflow-y: auto;
  background: rgba(10, 25, 49, 0.8);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 168, 232, 0.25);
}

.legal-body-content h4 {
  color: var(--gold);
  margin: 8px 0 4px;
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.78rem;
}

.legal-body-content p {
  margin: 0 0 8px;
  color: #E2E8F0;
}

/* TOAST */
.toast-banner {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 24, 40, 0.96);
  border: 1.5px solid var(--gold);
  color: var(--gold-bright);
  font-family: 'Russo One', system-ui, sans-serif;
  font-size: 0.74rem;
  padding: 7px 14px;
  border-radius: 999px;
  z-index: 80;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.toast-banner.hidden {
  display: none !important;
}
