/* ===================================================================
   TILT REALM - MODERN GLASSMORPHIC MOBILE STYLESHEET
   =================================================================== */

:root {
  --bg-base: #060913;
  --panel-bg: rgba(16, 22, 38, 0.72);
  --panel-bg-subtle: rgba(22, 29, 49, 0.55);
  --panel-border: rgba(255, 255, 255, 0.16);
  --panel-border-focus: rgba(0, 210, 255, 0.55);
  --glass-blur: blur(14px);

  --accent-cyan: #00d2ff;
  --accent-blue: #3a82f6;
  --accent-purple: #9d4edd;
  --accent-magenta: #f72585;
  --accent-emerald: #10b981;
  --accent-gold: #fbbf24;
  --accent-danger: #ef4444;

  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-panel: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  --shadow-glow-cyan: 0 0 20px rgba(0, 210, 255, 0.4);
  --shadow-glow-purple: 0 0 20px rgba(157, 78, 221, 0.4);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: #060913;
}

body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: #060913 url('bg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

/* Atmospheric Background Image Layer (Zero Blackout, 100% visible & crisp) */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('bg.jpg');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: 0;
  pointer-events: none;
}

/* Subtle particle glow overlay without darkening background */
.app-stars-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 15%, rgba(0, 210, 255, 0.10), transparent 65%),
              radial-gradient(circle at 80% 85%, rgba(157, 78, 221, 0.12), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* 100% Smartphone App Container */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* Glassmorphism Generic Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

/* ===================================================================
   TOP BAR (Safe Area Compliant)
   =================================================================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 14, 26, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
  object-fit: cover;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.star-icon {
  color: var(--accent-gold);
}

.gem-icon {
  font-size: 12px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.2);
}

/* ===================================================================
   MAIN CONTENT & SCREENS
   =================================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--safe-bottom) + 72px);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  width: 100%;
  height: 100%;
  padding: 16px;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================================
   1. WELCOME SCREEN
   =================================================================== */
#screenWelcome {
  display: none;
  height: 100%;
}

#screenWelcome.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-card {
  padding: 32px 20px;
  text-align: center;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hero-orb-preview {
  position: relative;
  width: 110px;
  height: 110px;
  margin-bottom: 8px;
}

.sphere-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.4) 0%, transparent 70%);
  animation: pulseGlow 2.5s infinite ease-in-out;
}

.preview-orb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, var(--accent-cyan) 35%, #0f172a 100%);
  box-shadow: inset -6px -6px 16px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 210, 255, 0.6);
  animation: floatOrb 3s infinite ease-in-out;
}

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

@keyframes pulseGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.hero-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffffff 20%, var(--accent-cyan) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.hero-description {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 12px 0 16px;
}

.feature-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}

/* ===================================================================
   BUTTONS & TOUCH TARGETS (44px Minimum)
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  color: #060913;
  box-shadow: 0 4px 18px rgba(0, 210, 255, 0.35);
}

.btn-primary:active {
  box-shadow: 0 2px 10px rgba(0, 210, 255, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 52px;
  font-size: 16px;
  width: 100%;
}

.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.pulse-glow {
  animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 210, 255, 0.4); }
  50% { box-shadow: 0 0 28px rgba(0, 210, 255, 0.8); }
}

/* ===================================================================
   2. HOME SCREEN & DAILY REWARDS
   =================================================================== */
.home-scroll-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  padding: 16px;
}

.daily-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  font-size: 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
}

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

.streak-badge {
  background: rgba(0, 210, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 210, 255, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

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

.daily-day-tile {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  text-align: center;
  transition: all 0.15s ease;
}

.daily-day-tile .day-num {
  font-weight: 600;
  color: var(--text-muted);
}

.daily-day-tile .day-reward {
  font-weight: 800;
  color: var(--accent-gold);
}

.daily-day-tile.claimed {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

.daily-day-tile.active-today {
  background: rgba(0, 210, 255, 0.2);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
  transform: scale(1.05);
}

.daily-day-tile.locked {
  opacity: 0.5;
}

/* Play Banner */
.play-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(22, 29, 49, 0.85) 0%, rgba(157, 78, 221, 0.25) 100%);
  border: 1px solid rgba(157, 78, 221, 0.35);
}

.banner-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.banner-title {
  font-size: 18px;
  font-weight: 800;
  margin: 2px 0 4px;
}

.banner-stars {
  font-size: 14px;
  color: var(--accent-gold);
  letter-spacing: 2px;
}

.play-btn-circle {
  width: 54px;
  height: 54px;
  min-height: 54px;
  border-radius: 50%;
  font-size: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.action-tile {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  min-height: 84px;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.action-tile:active {
  transform: scale(0.97);
  border-color: var(--accent-cyan);
}

.tile-icon {
  font-size: 24px;
}

.tile-title {
  font-size: 14px;
  font-weight: 700;
}

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

/* Metrics Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.metric-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.metric-lbl {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ===================================================================
   3. LEVEL SELECT SCREEN (30 LEVELS)
   =================================================================== */
.levels-header-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
}

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

.realm-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
}

.realm-tab {
  flex: 1;
  min-height: 40px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.realm-tab.active {
  background: var(--accent-cyan);
  color: #060913;
  box-shadow: 0 2px 10px rgba(0, 210, 255, 0.35);
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-bottom: 20px;
}

.level-tile {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
  position: relative;
}

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

.level-tile.unlocked {
  border-color: rgba(0, 210, 255, 0.3);
}

.level-tile.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.level-tile.locked {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.level-tile-num {
  font-size: 18px;
  font-weight: 800;
}

.level-tile-stars {
  font-size: 11px;
  color: var(--accent-gold);
  letter-spacing: 2px;
}

.level-tile-time {
  font-size: 10px;
  color: var(--text-dim);
}

/* ===================================================================
   4. GAME PLAY SCREEN & 3D TILT ARENA
   =================================================================== */
.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.game-level-info {
  text-align: center;
}

.game-level-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.game-stars-live {
  display: flex;
  justify-content: center;
  gap: 3px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.2);
}

.game-stars-live .live-star.active {
  color: var(--accent-gold);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.7);
}

.game-timer {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
}

/* 3D Perspective Tilt Container */
.board-perspective-wrapper {
  perspective: 900px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tilt-board {
  position: relative;
  width: 360px;
  height: 360px;
  border-radius: var(--radius-xl);
  background: rgba(14, 18, 32, 0.85);
  border: 2px solid rgba(0, 210, 255, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), inset 0 0 25px rgba(0, 210, 255, 0.15);
  transform-style: preserve-3d;
  transition: transform 0.08s ease-out;
  overflow: hidden;
}

#gameCanvas {
  width: 360px;
  height: 360px;
  display: block;
}

.tilt-compass {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.compass-pointer {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* Game Controls Panel */
.game-controls-panel {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controls-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.tilt-readout {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

/* Touch Tilt Virtual Pad */
.touch-tilt-pad {
  position: relative;
  width: 100%;
  height: 110px;
  border-radius: var(--radius-lg);
  background: rgba(16, 22, 38, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  overflow: hidden;
}

.touch-tilt-pad:active {
  cursor: grabbing;
  border-color: var(--accent-cyan);
}

.touch-pad-crosshair {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.touch-pad-thumb {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.6);
  pointer-events: none;
  transform: translate(0, 0);
  transition: transform 0.05s ease-out;
}

.pad-hint {
  position: absolute;
  bottom: 8px;
  font-size: 11px;
  color: var(--text-dim);
  pointer-events: none;
}

/* ===================================================================
   5. SKIN VAULT SCREEN
   =================================================================== */
.shop-header {
  margin-bottom: 12px;
}

.active-skin-preview-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.skin-canvas-preview {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.15) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#skinPreviewCanvas {
  width: 90px;
  height: 90px;
}

.skin-preview-meta {
  flex: 1;
}

.preview-skin-name {
  font-size: 17px;
  font-weight: 800;
}

.preview-skin-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 8px;
}

.skin-status-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding-bottom: 20px;
}

.skin-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  border: 1px solid var(--panel-border);
  transition: transform 0.12s ease;
}

.skin-card:active {
  transform: scale(0.97);
}

.skin-card.equipped {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.skin-card-canvas {
  width: 60px;
  height: 60px;
}

.skin-card-name {
  font-size: 13px;
  font-weight: 700;
}

.skin-card-btn {
  width: 100%;
  min-height: 38px;
  font-size: 12px;
  padding: 0 10px;
}

/* ===================================================================
   6. ACHIEVEMENTS SCREEN
   =================================================================== */
.achieve-header {
  margin-bottom: 12px;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
}

.achievement-card {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.achieve-badge-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  flex-shrink: 0;
}

.achieve-details {
  flex: 1;
}

.achieve-title {
  font-size: 14px;
  font-weight: 700;
}

.achieve-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.achieve-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

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

.achieve-action {
  flex-shrink: 0;
}

/* ===================================================================
   BOTTOM NAVIGATION (Fixed & Safe Area)
   =================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 12px calc(var(--safe-bottom) + 8px);
  z-index: 50;
}

.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  cursor: pointer;
  min-width: 54px;
  min-height: 48px;
  justify-content: center;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item.active {
  color: var(--accent-cyan);
}

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

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

.nav-play-action {
  position: relative;
  top: -12px;
}

.nav-icon-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  color: #060913;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 18px rgba(0, 210, 255, 0.45);
}

/* ===================================================================
   MODALS & BOTTOM SHEETS
   =================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-bottom-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding: 20px 18px calc(var(--safe-bottom) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

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

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

.modal-header-title {
  font-size: 18px;
  font-weight: 800;
}

.modal-scroll-body {
  overflow-y: auto;
  max-height: 65vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
}

.text-danger {
  color: var(--accent-danger);
}

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

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
  justify-content: flex-start;
}

.modal-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

/* Victory Stars Display */
.victory-stars {
  font-size: 38px;
  color: var(--accent-gold);
  letter-spacing: 6px;
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.6);
  margin: 6px 0;
}

.victory-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.v-stat-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-cyan);
}

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

/* Settings Components */
.setting-group {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

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

.setting-label {
  font-size: 14px;
  font-weight: 700;
}

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

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.2s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-cyan);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #060913;
}

.app-range {
  width: 100%;
  accent-color: var(--accent-cyan);
}

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

.help-content {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.help-content strong {
  color: var(--text-main);
}

.app-meta-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 0 4px;
}

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

/* Form inputs (font-size 16px to prevent iOS auto-zoom) */
.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.app-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  font-family: inherit;
}

.app-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

/* Legal text modal */
.legal-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.legal-text h4 {
  color: var(--text-main);
  margin-top: 10px;
  margin-bottom: 2px;
  font-size: 14px;
}

/* Interactive Star Rating */
.stars-rating-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 36px;
  color: rgba(255, 255, 255, 0.2);
  margin: 10px 0;
}

.interactive-star {
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}

.interactive-star.active {
  color: var(--accent-gold);
  transform: scale(1.1);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 60px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
  width: 90%;
  max-width: 360px;
}

.toast {
  background: rgba(16, 22, 38, 0.95);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--text-main);
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
