/* Bronze Cove — Crisp Tactile Daylight & Neo-Pop Lake Arcade Stylesheet */
:root {
  --emerald: #22C55E;
  --emerald-dark: #15803D;
  --gold: #FACC15;
  --gold-dark: #A16207;
  --orange: #F97316;
  --orange-dark: #C2410C;
  --azure: #0EA5E9;
  --azure-dark: #0369A1;
  --card-frost: rgba(235, 255, 255, 0.92);
  --card-warm: rgba(254, 252, 232, 0.93);
  --ink-dark: #0F172A;
  --ink-muted: #334155;
  --border-light: rgba(14, 165, 233, 0.45);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink-dark);
  background-color: #0EA5E9;
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  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 36px rgba(15, 23, 42, 0.25);
}

/* Top Persistent Brand Header */
.top-brand-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  background: rgba(235, 255, 255, 0.90);
  border-bottom: 2px solid rgba(14, 165, 233, 0.4);
  z-index: 15;
}

.top-brand-bar.hidden {
  display: none !important;
}

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

.brand-mini-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  flex-shrink: 0;
}

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

.brand-title {
  font-family: 'Bungee', sans-serif;
  font-size: 0.92rem;
  line-height: 1.05;
  color: var(--ink-dark);
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--azure-dark);
  letter-spacing: 0.8px;
}

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

.currency-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1.5px solid rgba(14, 165, 233, 0.5);
  font-family: 'Bungee', sans-serif;
  font-size: 0.78rem;
  color: var(--ink-dark);
  box-shadow: 0 2px 0 rgba(14, 165, 233, 0.22);
}

.coin-pill {
  border-color: var(--orange);
  background: #FFFBEB;
}

.pill-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1.5px solid rgba(14, 165, 233, 0.5);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(14, 165, 233, 0.22);
  transition: transform 0.12s ease;
}

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

/* Screens Viewport */
.screens-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.screen.active {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(28px + env(safe-area-inset-bottom, 0px));
  gap: 12px;
}

/* Screen #1: Intro Deck (Single viewport, zero scroll required) */
#screen-intro.screen.active {
  overflow-y: hidden;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(16px + env(safe-area-inset-bottom, 0px));
  justify-content: space-between;
}

.intro-deck-layout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 10px;
}

.intro-hero-box {
  background: var(--card-frost);
  border: 2px solid rgba(250, 204, 21, 0.85);
  border-radius: var(--radius-lg);
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

.intro-logo-frame {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
  background: linear-gradient(135deg, var(--azure), var(--emerald));
  flex-shrink: 0;
}

.intro-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.intro-spark-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.intro-badge-strip {
  margin-top: 2px;
}

.sunburst-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  color: #FFFFFF;
  font-family: 'Bungee', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.intro-main-title {
  font-family: 'Bungee', sans-serif;
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--ink-dark);
  letter-spacing: 0.6px;
}

.intro-tagline {
  font-size: 0.8rem;
  line-height: 1.32;
  color: var(--ink-muted);
  font-weight: 500;
  max-width: 34ch;
}

.intro-bento-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intro-bento-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-frost);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.intro-bento-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
}

.bg-sky {
  background: #E0F2FE;
}
.bg-emerald {
  background: #DCFCE7;
}
.bg-orange {
  background: #FFEDD5;
}
.bg-gold {
  background: #FEF9C3;
}

.intro-bento-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.intro-bento-copy h3 {
  font-family: 'Bungee', sans-serif;
  font-size: 0.82rem;
  color: var(--ink-dark);
}

.intro-bento-copy p {
  font-size: 0.74rem;
  color: var(--ink-muted);
  line-height: 1.25;
  font-weight: 500;
}

.intro-cta-box {
  flex-shrink: 0;
}

.btn-primary-giant {
  width: 100%;
  padding: 14px 18px;
  border-radius: 20px;
  border: 2px solid #FFFFFF;
  background: linear-gradient(135deg, var(--emerald) 0%, #16A34A 50%, var(--azure) 100%);
  color: #FFFFFF;
  font-family: 'Bungee', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 0 #15803D, 0 10px 20px rgba(15, 23, 42, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-primary-giant:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #15803D, 0 5px 12px rgba(15, 23, 42, 0.2);
}

/* Screen #2: Home Command Center */
.hero-act-card {
  background: var(--card-frost);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
  flex-shrink: 0;
}

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

.hero-act-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.act-pill {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: #DCFCE7;
  border: 1px solid var(--emerald);
  color: var(--emerald-dark);
  font-family: 'Bungee', sans-serif;
  font-size: 0.65rem;
}

.hero-act-title {
  font-family: 'Bungee', sans-serif;
  font-size: 1.05rem;
  color: var(--ink-dark);
  line-height: 1.15;
}

.hero-act-desc {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
  line-height: 1.3;
}

.hero-mascot-thumb {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--orange);
  background: linear-gradient(135deg, var(--gold), var(--orange));
  flex-shrink: 0;
}

.hero-mascot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-act-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  flex: 1;
  height: 10px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

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

.progress-label {
  font-family: 'Bungee', sans-serif;
  font-size: 0.72rem;
  color: var(--ink-dark);
  white-space: nowrap;
}

.btn-play-now {
  width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  border: 2px solid #FFFFFF;
  background: linear-gradient(135deg, var(--orange) 0%, #EA580C 100%);
  color: #FFFFFF;
  font-family: 'Bungee', sans-serif;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #9A3412;
  transition: transform 0.12s ease;
}

.btn-play-now:active {
  transform: translateY(2px);
}

/* Daily 7-Day Check-In Panel */
.bento-panel {
  background: var(--card-frost);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
  flex-shrink: 0;
}

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

.panel-title {
  font-family: 'Bungee', sans-serif;
  font-size: 0.84rem;
  color: var(--ink-dark);
}

.panel-sub {
  font-size: 0.73rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.streak-pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: #FEF08A;
  border: 1.5px solid var(--gold-dark);
  font-family: 'Bungee', sans-serif;
  font-size: 0.68rem;
  color: var(--ink-dark);
  white-space: nowrap;
}

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

.daily-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  text-align: center;
  gap: 3px;
  min-width: 0;
  transition: transform 0.12s ease;
}

.daily-cell.claimable {
  background: #FEF9C3;
  border: 2px solid var(--orange);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(249, 115, 22, 0.35);
  animation: pulseBounce 1.4s infinite ease-in-out;
}

.daily-cell.claimed {
  background: #DCFCE7;
  border-color: var(--emerald);
  opacity: 0.88;
}

.daily-cell.locked {
  background: #F1F5F9;
  opacity: 0.68;
}

.daily-day-num {
  font-family: 'Bungee', sans-serif;
  font-size: 0.58rem;
  color: var(--ink-muted);
}

.daily-reward-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.daily-reward-amt {
  font-family: 'Bungee', sans-serif;
  font-size: 0.6rem;
  color: var(--ink-dark);
}

@keyframes pulseBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* Asymmetric Bento Command Grid */
.bento-command-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  flex-shrink: 0;
}

.bento-tile {
  background: var(--card-frost);
  border: 1.5px solid var(--border-light);
  border-radius: 22px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.11);
  transition: transform 0.14s ease;
}

.bento-tile:active {
  transform: scale(0.96);
}

.tile-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
}

.tile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.tile-meta h4 {
  font-family: 'Bungee', sans-serif;
  font-size: 0.85rem;
  color: var(--ink-dark);
}

.tile-meta p {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Loadout Banner */
.loadout-banner {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

.loadout-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  text-align: center;
}

.loadout-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--azure-dark);
  letter-spacing: 0.5px;
}

.loadout-val {
  font-family: 'Bungee', sans-serif;
  font-size: 0.74rem;
  color: var(--ink-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loadout-divider {
  width: 1.5px;
  height: 26px;
  background: rgba(14, 165, 233, 0.35);
}

/* Shared Screen Header Card */
.screen-header-card {
  background: var(--card-frost);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}

.screen-heading {
  font-family: 'Bungee', sans-serif;
  font-size: 1.08rem;
  color: var(--ink-dark);
}

.screen-subtitle {
  font-size: 0.76rem;
  color: var(--ink-muted);
  font-weight: 500;
}

/* Screen #3: Level Select */
.act-filter-tabs,
.shop-tabs {
  display: flex;
  gap: 6px;
}

.act-tab,
.shop-tab {
  flex: 1;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
  font-family: 'Bungee', sans-serif;
  font-size: 0.7rem;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
}

.act-tab.active,
.shop-tab.active {
  background: linear-gradient(135deg, var(--azure), #0284C7);
  color: #FFFFFF;
  border-color: #0369A1;
  box-shadow: 0 3px 0 #0369A1;
}

.act-banner-info {
  background: var(--card-warm);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.act-banner-tag {
  font-family: 'Bungee', sans-serif;
  font-size: 0.72rem;
  color: var(--orange-dark);
}

.act-banner-info p {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 500;
  line-height: 1.3;
}

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

.level-card {
  background: var(--card-frost);
  border: 2px solid var(--border-light);
  border-radius: 20px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
  transition: transform 0.12s ease;
}

.level-card:active {
  transform: scale(0.96);
}

.level-card.boss-stage {
  border-color: var(--orange);
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.95), rgba(254, 243, 199, 0.95));
}

.level-card.locked {
  opacity: 0.62;
  background: rgba(241, 245, 249, 0.88);
  border-color: #CBD5E1;
}

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

.level-num-badge {
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--azure);
  color: #FFFFFF;
  font-family: 'Bungee', sans-serif;
  font-size: 0.7rem;
}

.level-card.boss-stage .level-num-badge {
  background: var(--orange);
}

.level-stars {
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: #CBD5E1;
}

.level-stars .earned {
  color: #F59E0B;
}

.level-name {
  font-family: 'Bungee', sans-serif;
  font-size: 0.78rem;
  color: var(--ink-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-meta-line {
  font-size: 0.68rem;
  color: var(--ink-muted);
  font-weight: 600;
}

/* Screen #4: Game Screen (Single-Viewport Canvas Layout) */
#screen-game.screen.active {
  overflow: hidden;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-top-hud {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  background: var(--card-frost);
  border: 2px solid var(--border-light);
  border-radius: 16px;
  padding: 6px 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}

.hud-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.hud-stat-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1.5px solid rgba(14, 165, 233, 0.35);
  overflow: hidden;
}

.hud-stat-pill.score-pill {
  background: #FEF9C3;
  border-color: var(--gold-dark);
}

.hud-stat-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--ink-muted);
}

.hud-stat-num {
  font-family: 'Bungee', sans-serif;
  font-size: 0.76rem;
  color: var(--ink-dark);
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-arena-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 2.5px solid rgba(250, 204, 21, 0.9);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  background: rgba(14, 165, 233, 0.28);
}

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

.game-bottom-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.power-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--gold-dark);
  background: var(--card-warm);
  font-family: 'Bungee', sans-serif;
  font-size: 0.66rem;
  color: var(--ink-dark);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(161, 98, 7, 0.3);
  flex-shrink: 0;
}

.power-btn:active {
  transform: translateY(2px);
}

.power-count {
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--orange);
  color: #FFFFFF;
  font-size: 0.62rem;
}

.aim-hint-pill {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 7px 8px;
  border-radius: 12px;
  background: var(--card-frost);
  border: 1.5px solid var(--border-light);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Screen #5: Gear & Upgrade Armory */
.shop-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.shop-item-card {
  background: var(--card-frost);
  border: 2px solid var(--border-light);
  border-radius: 20px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.1);
}

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

.shop-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  border: 2px solid rgba(15, 23, 42, 0.14);
}

.shop-item-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.shop-item-title {
  font-family: 'Bungee', sans-serif;
  font-size: 0.82rem;
  color: var(--ink-dark);
}

.shop-item-desc {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 500;
  line-height: 1.25;
}

.stat-pips-row {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.stat-pip {
  width: 18px;
  height: 6px;
  border-radius: 4px;
  background: #CBD5E1;
}

.stat-pip.filled {
  background: var(--emerald);
}

.shop-action-btn {
  padding: 9px 12px;
  border-radius: 13px;
  border: 1.5px solid #FFFFFF;
  background: linear-gradient(135deg, var(--orange), #EA580C);
  color: #FFFFFF;
  font-family: 'Bungee', sans-serif;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 0 #9A3412;
  flex-shrink: 0;
}

.shop-action-btn.equipped {
  background: var(--emerald);
  box-shadow: 0 3px 0 var(--emerald-dark);
}

.shop-action-btn.owned {
  background: var(--azure);
  box-shadow: 0 3px 0 var(--azure-dark);
}

/* Screen #6: Codex Field Guide */
.codex-preview-stage {
  background: var(--card-frost);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
  flex-shrink: 0;
}

.codex-canvas-box {
  width: 104px;
  height: 104px;
  border-radius: 18px;
  background: linear-gradient(180deg, #38BDF8, #0284C7);
  border: 2px solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.25);
}

.codex-detail-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.codex-cat-tag {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FEF08A;
  color: var(--gold-dark);
  font-family: 'Bungee', sans-serif;
  font-size: 0.62rem;
}

.codex-detail-box h3 {
  font-family: 'Bungee', sans-serif;
  font-size: 0.9rem;
  color: var(--ink-dark);
}

.codex-detail-box p {
  font-size: 0.74rem;
  color: var(--ink-muted);
  line-height: 1.3;
  font-weight: 500;
}

.codex-tip-box {
  margin-top: 2px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #E0F2FE;
  font-size: 0.7rem;
  color: var(--ink-dark);
  line-height: 1.25;
}

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

.codex-entry-card {
  background: var(--card-frost);
  border: 2px solid var(--border-light);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.codex-entry-card.active {
  border-color: var(--orange);
  background: var(--card-warm);
}

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

.codex-entry-emoji {
  font-size: 1.35rem;
}

.codex-bounty-btn {
  padding: 4px 8px;
  border-radius: 8px;
  border: none;
  background: var(--gold);
  color: var(--ink-dark);
  font-family: 'Bungee', sans-serif;
  font-size: 0.62rem;
  cursor: pointer;
}

.codex-bounty-btn.claimed {
  background: #DCFCE7;
  color: var(--emerald-dark);
}

.codex-entry-name {
  font-family: 'Bungee', sans-serif;
  font-size: 0.76rem;
  color: var(--ink-dark);
}

.codex-entry-role {
  font-size: 0.68rem;
  color: var(--ink-muted);
  font-weight: 600;
}

/* Screen #7: Trophy Cabinet */
.trophy-summary-row {
  display: flex;
  gap: 8px;
}

.trophy-stat-chip {
  flex: 1;
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.trophy-stat-chip span {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--ink-muted);
}

.trophy-stat-chip strong {
  font-family: 'Bungee', sans-serif;
  font-size: 0.82rem;
  color: var(--ink-dark);
}

.trophy-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.trophy-card {
  background: var(--card-frost);
  border: 2px solid var(--border-light);
  border-radius: 20px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trophy-card.unlocked {
  border-color: var(--gold);
  background: var(--card-warm);
}

.trophy-emblem {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #FEF08A;
  border: 2px solid var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.trophy-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.trophy-info h4 {
  font-family: 'Bungee', sans-serif;
  font-size: 0.8rem;
  color: var(--ink-dark);
}

.trophy-info p {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.trophy-claim-btn {
  padding: 8px 11px;
  border-radius: 12px;
  border: none;
  background: var(--emerald);
  color: #FFFFFF;
  font-family: 'Bungee', sans-serif;
  font-size: 0.68rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--emerald-dark);
}

.trophy-claim-btn:disabled {
  background: #CBD5E1;
  color: #64748B;
  box-shadow: none;
  cursor: default;
}

/* Static Bottom Navigation Bar (Strictly in flex column flow below .screens-viewport) */
.bottom-nav {
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(235, 255, 255, 0.94);
  border-top: 2px solid rgba(14, 165, 233, 0.45);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav.hidden {
  display: none !important;
}

.nav-item {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  color: var(--ink-muted);
  font-family: 'Rubik', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 12px;
}

.nav-item.active {
  color: var(--azure-dark);
}

.nav-cast-circle {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange), var(--gold));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(249, 115, 22, 0.4);
  border: 2px solid #FFFFFF;
}

/* Modals & Sheets */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--card-frost);
  border: 2.5px solid var(--gold);
  border-radius: 26px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.35);
}

.modal-card.modal-scrollable {
  max-height: 84vh;
  overflow-y: auto;
  text-align: left;
}

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

.icon-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
  font-weight: 800;
  cursor: pointer;
}

.modal-badge {
  align-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold);
  font-family: 'Bungee', sans-serif;
  font-size: 0.68rem;
  color: var(--ink-dark);
}

.modal-title {
  font-family: 'Bungee', sans-serif;
  font-size: 1.18rem;
  color: var(--ink-dark);
}

.modal-text {
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.result-stars-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 2.1rem;
  color: #CBD5E1;
}

.result-stars-row .earned {
  color: #FACC15;
  text-shadow: 0 3px 0 #A16207;
}

.result-stats-box {
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.result-stat-line strong {
  font-family: 'Bungee', sans-serif;
  color: var(--ink-dark);
}

.result-stat-line.highlight-gold strong {
  color: var(--orange-dark);
}

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

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

.btn-primary {
  flex: 1;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1.5px solid #FFFFFF;
  background: linear-gradient(135deg, var(--emerald), #16A34A);
  color: #FFFFFF;
  font-family: 'Bungee', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--emerald-dark);
}

.btn-secondary {
  flex: 1;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
  color: var(--ink-dark);
  font-family: 'Bungee', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Settings & Legal Subsheet */
.settings-section {
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-sec-title {
  font-family: 'Bungee', sans-serif;
  font-size: 0.78rem;
  color: var(--azure-dark);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

.toggle-pill {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1.5px solid #CBD5E1;
  background: #F1F5F9;
  font-family: 'Bungee', sans-serif;
  font-size: 0.7rem;
  cursor: pointer;
}

.toggle-pill.active {
  background: var(--emerald);
  color: #FFFFFF;
  border-color: var(--emerald-dark);
}

.about-version-line {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

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

.btn-outline-sm {
  padding: 8px 10px;
  border-radius: 11px;
  border: 1.5px solid var(--border-light);
  background: #F8FAFC;
  font-family: 'Rubik', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-dark);
  cursor: pointer;
}

.subsheet-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.subsheet-body h4 {
  font-family: 'Bungee', sans-serif;
  font-size: 0.82rem;
  color: var(--ink-dark);
  margin-top: 4px;
}

.support-input,
.support-textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1.5px solid #CBD5E1;
  font-family: 'Rubik', sans-serif;
  font-size: 0.8rem;
}

.rating-stars-picker {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 2rem;
  cursor: pointer;
}

.toast-banner {
  position: absolute;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink-dark);
  color: #FFFFFF;
  border: 2px solid var(--gold);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: 'Bungee', sans-serif;
  font-size: 0.74rem;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);
}

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

/* Mandatory Screen Isolation Rules at Bottom of Stylesheet */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; }
.screen:not(.active) { display: none !important; }
