/* ==========================================================================
   Eager Prairie — Precision Bento Grid 2.0 Mobile WebApp Stylesheet
   Palette: #FF9900 (Amber Orange), #232F3E (Obsidian Slate), #F8FAFC (Crisp Light)
   ========================================================================== */

:root {
  --amber: #FF9900;
  --amber-bright: #FFB340;
  --amber-dim: rgba(255, 153, 0, 0.18);
  --slate-dark: #161E29;
  --slate-core: #232F3E;
  --slate-card: rgba(35, 47, 62, 0.78);
  --slate-card-solid: #1E2936;
  --surface-light: #F8FAFC;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-amber: rgba(255, 153, 0, 0.45);
  --cyan: #38BDF8;
  --emerald: #10B981;
  --danger: #EF4444;
  --purple: #A855F7;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--slate-core);
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  touch-action: manipulation;
}

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

@media (max-width: 480px) {
  .app-container {
    max-width: 100%;
    margin: 0;
  }
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.amber-text { color: var(--amber); }
.emerald-text { color: var(--emerald); }
.cyan-text { color: var(--cyan); }

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

button:active {
  transform: scale(0.97);
}

input, textarea, select {
  font-size: 16px;
  font-family: inherit;
  user-select: text;
  -webkit-user-select: text;
}

/* ==========================================================================
   GLOBAL TOP HEADER
   ========================================================================== */
.top-header {
  padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding-bottom: 10px;
  padding-left: 12px;
  padding-right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(22, 30, 41, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 25;
  flex-shrink: 0;
}

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

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

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

.brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--surface-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.06em;
}

.header-metrics {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.metric-pill {
  position: relative;
  height: 34px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(35, 47, 62, 0.9);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--surface-light);
}

.star-pill .pill-icon {
  color: var(--amber);
}

.coin-pill {
  border-color: var(--border-amber);
  background: rgba(255, 153, 0, 0.14);
}

.coin-pill .pill-icon {
  color: var(--amber);
}

.notify-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(35, 47, 62, 0.9);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--surface-light);
}

/* ==========================================================================
   SCREENS & SCROLL CONTAINERS
   ========================================================================== */
.screen {
  display: none !important;
  flex: 1;
  width: 100%;
  flex-direction: column;
}

.screen.active {
  display: flex !important;
}

.screen-scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 92px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bento-card {
  background: var(--slate-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

/* ==========================================================================
   SCREEN #1: WELCOME / INTRO SCREEN (Single Viewport, Zero Scroll)
   ========================================================================== */
.welcome-screen {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  padding-left: 16px;
  padding-right: 16px;
  justify-content: space-between;
}

.welcome-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.welcome-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--slate-card);
  border: 1px solid var(--border-amber);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--amber);
}

.skip-btn {
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--surface-light);
  background: rgba(35, 47, 62, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}

.welcome-slides-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 10px 0;
}

.welcome-slide {
  display: none;
  width: 100%;
  max-height: 100%;
  background: var(--slate-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 18px 16px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.welcome-slide.active {
  display: flex;
  animation: fadeScaleIn 0.24s ease-out;
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.slide-illustration {
  width: 100%;
  max-width: 210px;
  max-height: 175px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-svg {
  width: 100%;
  height: auto;
  max-height: 165px;
}

.benefit-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 153, 0, 0.16);
  border: 1px solid var(--border-amber);
  color: var(--amber-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--surface-light);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.slide-desc {
  font-size: 13px;
  line-height: 1.45;
  color: #CBD5E1;
  max-width: 320px;
}

.welcome-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.slide-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.28);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.dot.active {
  width: 28px;
  background: var(--amber);
}

.primary-cta-btn {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FF9900 0%, #E67E00 100%);
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(255, 153, 0, 0.32);
}

/* ==========================================================================
   SCREEN #2: HOME MENU (Thumb-Zone Hero Hub)
   ========================================================================== */
.hero-centerpiece-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-color: var(--border-amber);
}

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

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--emerald);
}

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

.equipped-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-bright);
}

.hero-orbit-preview {
  position: relative;
  width: 100%;
  height: 170px;
  border-radius: 12px;
  background: rgba(15, 23, 34, 0.65);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#homePreviewCanvas {
  width: 220px;
  height: 170px;
}

.hero-overlay-stats {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-stat-box {
  background: rgba(35, 47, 62, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px 8px;
  display: flex;
   flex-direction: column;
}

.mini-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
}

.mini-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--surface-light);
}

.hero-play-btn {
  justify-content: space-between;
  padding: 12px 16px;
}

.play-btn-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.play-main-label {
  font-size: 15px;
  font-weight: 900;
  color: #111827;
}

.play-sub-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(17, 24, 39, 0.78);
}

.play-icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #111827;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.daily-banner-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
}

.daily-strip-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.daily-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--amber-dim);
  border: 1px solid var(--border-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.daily-strip-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--surface-light);
}

.daily-strip-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-action-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--amber);
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.section-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.section-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--amber);
  text-transform: uppercase;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.bento-2x2-deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bento-nav-tile {
  background: var(--slate-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 13px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 106px;
}

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

.tile-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.tile-icon-badge.amber { background: rgba(255, 153, 0, 0.18); border: 1px solid var(--border-amber); }
.tile-icon-badge.cyan { background: rgba(56, 189, 248, 0.18); border: 1px solid rgba(56, 189, 248, 0.4); }
.tile-icon-badge.emerald { background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(16, 185, 129, 0.4); }
.tile-icon-badge.purple { background: rgba(168, 85, 247, 0.18); border: 1px solid rgba(168, 85, 247, 0.4); }

.tile-metric {
  font-size: 12px;
  font-weight: 800;
  color: var(--surface-light);
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 34, 0.65);
  border: 1px solid var(--border-subtle);
}

.tile-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--surface-light);
  margin-top: 2px;
}

.tile-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   SHARED SCREEN HEADERS & SEGMENTED PILLS
   ========================================================================== */
.screen-intro-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intro-banner-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.screen-heading {
  font-size: 18px;
  font-weight: 800;
  color: var(--surface-light);
}

.screen-subheading {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.act-star-summary {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--amber-dim);
  border: 1px solid var(--border-amber);
  color: var(--amber-bright);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.segmented-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: rgba(15, 23, 34, 0.72);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.seg-pill {
  min-height: 38px;
  padding: 6px 6px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg-pill.active {
  background: var(--amber);
  color: #111827;
}

/* ==========================================================================
   SCREEN #3: LEVEL SELECT GRID
   ========================================================================== */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.level-card {
  background: var(--slate-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px 8px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  position: relative;
}

.level-card.unlocked {
  border-color: rgba(255, 255, 255, 0.22);
}

.level-card.current-target {
  border-color: var(--amber);
  box-shadow: 0 0 14px rgba(255, 153, 0, 0.25);
}

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

.level-boss-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.22);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.level-num {
  font-size: 20px;
  font-weight: 900;
  color: var(--surface-light);
}

.level-mechanic-tag {
  font-size: 10px;
  color: var(--text-muted);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-stars {
  display: flex;
  gap: 3px;
  font-size: 13px;
}

.star-on { color: var(--amber); }
.star-off { color: rgba(255, 255, 255, 0.18); }

/* ==========================================================================
   SCREEN #4: GAME SCREEN (Single Viewport, Zero Vertical Scroll)
   ========================================================================== */
.game-screen-layout {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  padding-left: 10px;
  padding-right: 10px;
  flex-direction: column;
  gap: 8px;
}

.game-top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  background: rgba(22, 30, 41, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 6px 8px;
  flex-shrink: 0;
}

.hud-pill {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 7px;
  border-radius: 9px;
  background: rgba(35, 47, 62, 0.85);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}

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

.hud-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--surface-light);
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-hud-pill {
  flex: 0 0 auto;
  min-width: 46px;
  border-color: var(--border-amber);
  background: var(--amber-dim);
}

.combo-hud-pill .hud-val {
  color: var(--amber-bright);
}

.coins-hud-pill .hud-icon {
  color: var(--amber);
  font-size: 12px;
}

.hud-pause-btn {
  width: 40px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 153, 0, 0.2);
  border: 1px solid var(--border-amber);
  color: var(--amber-bright);
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}

.game-sub-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(22, 30, 41, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px 10px;
  flex-shrink: 0;
}

.sub-hud-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.sub-label { color: var(--text-muted); }
.sub-val { color: var(--surface-light); }

.sub-hud-progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.sub-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--emerald));
  border-radius: 999px;
  transition: width 0.18s ease;
}

.canvas-stage-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  border-radius: 18px;
  background: rgba(15, 23, 34, 0.68);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.tap-instruction-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(22, 30, 41, 0.85);
  border: 1px solid var(--border-amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--amber-bright);
  pointer-events: none;
  white-space: nowrap;
}

/* ==========================================================================
   SCREEN #5: WORKSHOP / CUSTOMIZATION STUDIO
   ========================================================================== */
.workshop-preview-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workshop-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

#workshopPreviewCanvas {
  width: 104px;
  height: 104px;
  border-radius: 14px;
  background: rgba(15, 23, 34, 0.78);
  border: 1px solid var(--border-amber);
  flex-shrink: 0;
}

.workshop-loadout-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.loadout-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--surface-light);
}

.loadout-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #CBD5E1;
}

.workshop-balance-line {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.workshop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shop-item-card {
  background: var(--slate-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 150px;
}

.shop-item-card.equipped {
  border-color: var(--amber);
  box-shadow: 0 0 14px rgba(255, 153, 0, 0.18);
}

.shop-swatch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shop-color-swatch {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.shop-status-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 34, 0.7);
  color: var(--text-muted);
}

.shop-item-card.equipped .shop-status-tag {
  background: var(--amber-dim);
  color: var(--amber-bright);
  border: 1px solid var(--border-amber);
}

.shop-item-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--surface-light);
}

.shop-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.shop-action-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  background: rgba(255, 153, 0, 0.18);
  border: 1px solid var(--border-amber);
  color: var(--amber-bright);
}

.shop-action-btn.equip-ready {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6EE7B7;
}

.shop-action-btn.active-equipped {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
  color: var(--surface-light);
}

/* ==========================================================================
   SCREEN #6: TROPHY ROOM & ACHIEVEMENTS SHOWCASE
   ========================================================================== */
.trophy-summary-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.trophy-Rank-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--amber-dim);
  border: 1px solid var(--border-amber);
  color: var(--amber-bright);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.trophy-tier-counters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.tier-box {
  background: rgba(15, 23, 34, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.tier-box.bronze .tier-dot { background: #D97706; }
.tier-box.silver .tier-dot { background: #94A3B8; }
.tier-box.gold .tier-dot { background: #FACC15; }
.tier-box.prismatic .tier-dot { background: #38BDF8; box-shadow: 0 0 6px #A855F7; }

.tier-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.tier-val {
  font-size: 12px;
  font-weight: 800;
  color: var(--surface-light);
}

.trophies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trophy-card {
  background: var(--slate-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trophy-card.unlocked {
  border-color: rgba(255, 153, 0, 0.45);
}

.trophy-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.trophy-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.trophy-emblem {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 34, 0.78);
}

.trophy-emblem.bronze { border-color: #D97706; background: rgba(217, 119, 6, 0.16); }
.trophy-emblem.silver { border-color: #CBD5E1; background: rgba(203, 213, 225, 0.16); }
.trophy-emblem.gold { border-color: #FACC15; background: rgba(250, 204, 21, 0.18); }
.trophy-emblem.prismatic { border-color: #38BDF8; background: linear-gradient(135deg, rgba(56,189,248,0.22), rgba(168,85,247,0.22)); }

.trophy-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--surface-light);
}

.trophy-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.trophy-bounty-btn {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.trophy-bounty-btn.claimable {
  background: var(--amber);
  color: #111827;
}

.trophy-bounty-btn.claimed {
  background: rgba(16, 185, 129, 0.18);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.trophy-bounty-btn.locked-bounty {
  background: rgba(15, 23, 34, 0.7);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.trophy-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
}

.trophy-bar-bg {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.trophy-bar-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 999px;
}

/* ==========================================================================
   SCREEN #7: PLAYER TELEMETRY & RECORDS HUB
   ========================================================================== */
.telemetry-header-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.telemetry-live-pill {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
  font-size: 10px;
  font-weight: 800;
}

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

.kpi-tile {
  background: rgba(15, 23, 34, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kpi-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--surface-light);
}

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

.card-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--surface-light);
}

.card-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
}

#telemetryChartCanvas {
  width: 100%;
  height: 165px;
  display: block;
  border-radius: 10px;
  background: rgba(15, 23, 34, 0.65);
  border: 1px solid var(--border-subtle);
}

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

.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(15, 23, 34, 0.68);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}

.record-stage-name {
  font-weight: 800;
  color: var(--surface-light);
}

.record-stats-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

/* ==========================================================================
   BOTTOM NAVIGATION BAR
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding-top: 6px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  padding-left: 8px;
  padding-right: 8px;
  background: rgba(22, 30, 41, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  z-index: 30;
}

.nav-tab {
  min-height: 48px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  position: relative;
}

.nav-tab.active {
  background: rgba(255, 153, 0, 0.16);
  color: var(--amber-bright);
  border: 1px solid var(--border-amber);
}

.nav-icon {
  font-size: 16px;
}

.nav-label {
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.tab-badge {
  position: absolute;
  top: 4px;
  right: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  color: #111827;
  font-size: 9px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   MODALS & BOTTOM SHEETS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 24, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
}

.bottom-sheet {
  width: 100%;
  max-width: 480px;
  background: #1B2532;
  border-top: 1px solid var(--border-amber);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 20px) 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 86vh;
  animation: sheetSlideUp 0.22s ease-out;
}

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

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  align-self: center;
}

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

.sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--surface-light);
}

.sheet-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.close-sheet-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  font-size: 14px;
  font-weight: 800;
}

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

.secondary-btn {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--surface-light);
  font-size: 14px;
  font-weight: 800;
}

.ghost-btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

/* Result Modal */
.result-sheet {
  text-align: center;
  align-items: center;
}

.result-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: var(--amber-dim);
  color: var(--amber-bright);
  border: 1px solid var(--border-amber);
}

.result-stars-row {
  display: flex;
  gap: 10px;
  font-size: 32px;
  margin: 4px 0;
}

.res-star {
  color: rgba(255, 255, 255, 0.16);
  transition: transform 0.25s ease, color 0.25s ease;
}

.res-star.earned {
  color: var(--amber);
  text-shadow: 0 0 12px rgba(255, 153, 0, 0.6);
  transform: scale(1.1);
}

.result-metrics-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.res-box {
  background: rgba(15, 23, 34, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.res-label { font-size: 10px; font-weight: 700; color: var(--text-muted); }
.res-val { font-size: 15px; font-weight: 900; color: var(--surface-light); }

.result-actions-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
}

/* Daily Check-In Grid */
.daily-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.daily-card {
  background: rgba(15, 23, 34, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  text-align: center;
  min-height: 86px;
}

.daily-card.day-7 {
  grid-column: span 2;
}

.daily-card.today-ready {
  border-color: var(--amber);
  background: rgba(255, 153, 0, 0.16);
}

.daily-card.claimed-day {
  border-color: rgba(16, 185, 129, 0.45);
  opacity: 0.75;
}

.daily-day-num { font-size: 10px; font-weight: 800; color: var(--text-muted); }
.daily-reward-icon { font-size: 18px; }
.daily-reward-amt { font-size: 12px; font-weight: 900; color: var(--surface-light); }

/* Settings & Legal */
.settings-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--amber);
  margin-top: 4px;
}

.settings-group {
  background: rgba(15, 23, 34, 0.68);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.setting-name { font-size: 13px; font-weight: 700; color: var(--surface-light); }
.setting-desc { font-size: 11px; color: var(--text-muted); }

.toggle-switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  padding: 3px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.toggle-switch.active {
  background: var(--amber);
  justify-content: flex-end;
}

.toggle-knob {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #111827;
}

.small-action-btn {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 153, 0, 0.18);
  border: 1px solid var(--border-amber);
  color: var(--amber-bright);
  font-size: 12px;
  font-weight: 800;
}

.version-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--amber-bright);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--amber-dim);
}

.about-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.about-action-btn {
  min-height: 44px;
  padding: 8px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.legal-link-row {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--surface-light);
  padding: 4px 0;
}

.sub-dialog-body {
  font-size: 13px;
  line-height: 1.55;
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-dialog-body h4 {
  color: var(--amber-bright);
  font-size: 14px;
  margin-top: 4px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 60px);
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 90;
  pointer-events: none;
}

.toast-msg {
  background: rgba(22, 30, 41, 0.95);
  border: 1px solid var(--amber);
  color: var(--surface-light);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: fadeScaleIn 0.2s ease-out;
}

