/* =======================================================
   CRYSTAL PATH - Ancient Temple of Light
   Pure CSS Design System - Glassmorphic & Vibrant Gradients
   ======================================================= */

:root {
  /* Vibrant Tropical Sun & Ocean Color Palette */
  --color-gold: #FFD200;
  --color-amber: #FF9900;
  --color-coral: #FF4D6D;
  --color-emerald: #00F5D4;
  --color-jade: #06D6A0;
  --color-azure: #00B4D8;
  --color-deep-blue: #0077B6;
  --color-amethyst: #B5179E;
  --color-bg-dark: #070D18;
  --color-text-light: #F8FAFC;
  --color-text-dim: #94A3B8;

  /* Glassmorphism Tokens */
  --glass-bg-card: rgba(11, 22, 39, 0.72);
  --glass-bg-panel: rgba(15, 29, 53, 0.85);
  --glass-bg-btn: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-gold: rgba(255, 210, 0, 0.35);
  --glass-border-cyan: rgba(0, 245, 212, 0.35);
  --glass-blur: blur(20px);
  --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow-gold: 0 0 25px rgba(255, 210, 0, 0.45);
  --shadow-glow-teal: 0 0 25px rgba(0, 245, 212, 0.4);

  /* Fonts */
  --font-display: 'Cinzel', serif, system-ui;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --max-width: 480px;
}

/* Base Reset & Mobile-First Foundation */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  font-family: var(--font-body);
  color: var(--color-text-light);
  background-color: var(--color-bg-dark);
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  /* Prompt requirement: background url('bg.jpg') center/cover no-repeat */
  background: #070D18 url('bg.jpg') center/cover no-repeat fixed;
}

/* Outer Desktop Frame Container */
#app-wrapper {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: url('bg.jpg') center/cover no-repeat;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

@media (min-width: 500px) {
  #app-wrapper {
    height: 94vh;
    max-height: 920px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
}

/* Glassmorphic Ambient Underlay */
#main-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: url('bg.jpg') center/cover no-repeat;
  overflow: hidden;
}

#main-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 13, 24, 0.4) 0%, rgba(7, 13, 24, 0.65) 100%);
  pointer-events: none;
  z-index: 0;
}

/* GLOBAL HEADER */
#global-header {
  height: 58px;
  min-height: 58px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: var(--glass-blur);
  background: rgba(8, 16, 29, 0.7);
  border-bottom: 1px solid var(--glass-border);
  z-index: 10;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-btn);
  color: var(--color-text-light);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-btn:hover {
  transform: scale(1.08);
  border-color: var(--color-gold);
}

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

.app-brand-pill {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #FFF;
  text-shadow: 0 0 12px rgba(255, 210, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-sparkle {
  color: var(--color-gold);
  animation: pulse-glow 2s infinite alternate ease-in-out;
}

.currency-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--glass-border-gold);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-gold);
  box-shadow: 0 0 12px rgba(255, 210, 0, 0.2);
}

.gem-glyph {
  font-size: 1.05rem;
}

/* SCREEN VIEW CONTROLLERS */
.view-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100% - 58px);
  position: absolute;
  top: 58px;
  left: 0;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.25s ease, transform 0.25s ease;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 12px 14px 24px 14px;
  background: url('bg.jpg') center/cover no-repeat;
  z-index: 1;
}

#home-screen,
#level-select-screen,
#game-screen,
#achievements-screen,
#shop-screen {
  background: url('bg.jpg') center/cover no-repeat;
}

.view-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  display: none !important;
}

/* BUTTON SYSTEM */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  border: none;
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  touch-action: manipulation;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-amber) 50%, var(--color-coral) 100%);
  color: #1A0D00;
  box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 153, 0, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-glass {
  background: var(--glass-bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: #FFF;
  padding: 12px 14px;
}

.btn-glass:hover {
  border-color: var(--glass-border-cyan);
  background: rgba(17, 34, 60, 0.85);
  box-shadow: var(--shadow-glow-teal);
  transform: translateY(-2px);
}

.btn-large {
  padding: 15px 22px;
  font-size: 1.1rem;
  border-radius: 18px;
}

.pulse-btn {
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 4px 15px rgba(255, 153, 0, 0.4); }
  50% { box-shadow: 0 6px 30px rgba(255, 210, 0, 0.8); }
  100% { box-shadow: 0 4px 15px rgba(255, 153, 0, 0.4); }
}

/* =======================================================
   HOME SCREEN
   ======================================================= */
#home-screen {
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 10px 14px 20px 14px;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4px;
}

.hero-logo-container {
  position: relative;
  width: clamp(96px, 24vw, 130px);
  height: clamp(96px, 24vw, 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.hero-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
  border: 2px solid var(--glass-border-gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 210, 0, 0.3);
  z-index: 2;
}

.hero-glow {
  position: absolute;
  width: 140%;
  height: 140%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 0, 0.3) 0%, rgba(0, 245, 212, 0.15) 50%, transparent 70%);
  filter: blur(20px);
  z-index: 1;
}

.floating-anim {
  animation: float-logo 4s ease-in-out infinite;
}

@keyframes float-logo {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5.2vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFEA79 50%, #FFA000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
}

.hero-tagline {
  font-size: clamp(0.75rem, 2.6vw, 0.95rem);
  color: var(--color-emerald);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
}

/* STATS GLASS PANEL */
.stats-glass-panel {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 8px;
  background: var(--glass-bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  margin: 10px 0;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  font-weight: 700;
  color: #FFF;
}

.stat-label {
  font-size: clamp(0.65rem, 2.2vw, 0.75rem);
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
}

/* HOME ACTIONS */
.home-actions-group {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.glow-btn {
  position: relative;
  overflow: hidden;
}

.glow-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(25deg);
  animation: btn-shine 3.5s infinite;
}

@keyframes btn-shine {
  0% { transform: translateX(-100%) rotate(25deg); }
  20%, 100% { transform: translateX(100%) rotate(25deg); }
}

/* =======================================================
   SUB-SCREEN HEADER
   ======================================================= */
.screen-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  width: 100%;
}

.sub-screen-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFF;
  text-align: center;
}

.sub-screen-hint {
  font-size: 0.8rem;
  color: var(--color-emerald);
  display: block;
  text-align: center;
}

.placeholder-spacer {
  width: 42px;
}

/* =======================================================
   LEVEL SELECT SCREEN
   ======================================================= */
.level-select-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

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

.level-tile {
  aspect-ratio: 1;
  background: var(--glass-bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 4px;
}

.level-tile:hover:not(.locked) {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--color-gold);
  box-shadow: 0 6px 16px rgba(255, 210, 0, 0.35);
}

.level-tile.active-current {
  border-color: var(--color-emerald);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.5);
  animation: pulse-glow 2s infinite ease-in-out;
}

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

.level-number {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFF;
}

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

.level-lock-icon {
  font-size: 1rem;
}

/* =======================================================
   GAME SCREEN & HUD
   ======================================================= */
#game-screen {
  padding: 6px 12px 12px 12px;
  justify-content: space-between;
  overflow: hidden;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2px 0;
  z-index: 5;
}

.icon-btn-pill {
  background: var(--glass-bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  color: #FFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

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

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-level-info {
  display: flex;
  flex-direction: column;
}

.hud-level-num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFF;
}

.hud-level-name {
  font-size: 0.72rem;
  color: var(--color-emerald);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.moves-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 4px 12px;
}

.badge-label {
  font-size: 0.65rem;
  color: var(--color-text-dim);
  text-transform: uppercase;
}

.badge-val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-gold);
}

.badge-par {
  font-size: 0.65rem;
  color: #94A3B8;
}

/* GAME BOARD & TEMPLE FRAME */
.game-board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-height: 0;
  gap: 8px;
}

.temple-frame {
  position: relative;
  width: 100%;
  max-width: min(88vw, 380px, 46vh);
  aspect-ratio: 1;
  background: rgba(10, 20, 35, 0.85);
  backdrop-filter: var(--glass-blur);
  border-radius: 18px;
  border: 2px solid rgba(255, 210, 0, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(0, 0, 0, 0.6);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-rune {
  position: absolute;
  color: var(--color-gold);
  font-size: 0.85rem;
  opacity: 0.7;
  text-shadow: 0 0 8px var(--color-gold);
}

.corner-tl { top: 6px; left: 8px; }
.corner-tr { top: 6px; right: 8px; }
.corner-bl { bottom: 6px; left: 8px; }
.corner-br { bottom: 6px; right: 8px; }

.board-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(6, 12, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tiles-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  z-index: 2;
}

/* Canvas Layers */
.laser-canvas, .particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.laser-canvas {
  z-index: 3;
}

.particle-canvas {
  z-index: 4;
}

/* CELL / TILE STYLING */
.grid-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.015);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease;
}

.grid-tile.has-mirror {
  cursor: pointer;
}

.grid-tile.has-mirror:hover {
  background: rgba(255, 210, 0, 0.08);
}

/* MIRROR ELEMENT */
.mirror-bezel {
  position: relative;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: radial-gradient(circle, rgba(20, 35, 55, 0.9) 0%, rgba(9, 18, 30, 0.95) 100%);
}

.mirror-bezel.hint-highlight {
  animation: mirror-hint-pulse 1s infinite alternate;
}

@keyframes mirror-hint-pulse {
  0% { box-shadow: 0 0 10px rgba(0, 245, 212, 0.5); border-color: var(--color-emerald); }
  100% { box-shadow: 0 0 25px rgba(0, 245, 212, 1); border-color: #FFF; }
}

/* Inner reflective blade/mirror line */
.mirror-blade {
  position: absolute;
  width: 4px;
  height: 90%;
  background: linear-gradient(to bottom, #FFFFFF, #B9E6FF, #FFFFFF);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px rgba(0, 180, 216, 0.6);
}

.mirror-corner-marker {
  position: absolute;
  font-size: 0.65rem;
  color: var(--color-gold);
  bottom: 2px;
  opacity: 0.7;
}

/* SPLITTER PRISM ELEMENT */
.splitter-prism {
  position: relative;
  width: 80%;
  height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.prism-diamond {
  width: 70%;
  height: 70%;
  transform: rotate(45deg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(0, 245, 212, 0.6) 50%, rgba(181, 23, 158, 0.6) 100%);
  border: 1.5px solid #FFF;
  box-shadow: 0 0 14px rgba(0, 245, 212, 0.6);
  border-radius: 4px;
}

/* EMITTER ELEMENT */
.emitter-totem {
  position: relative;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(circle, #FFA000 0%, #E65100 70%, #5D1000 100%);
  border: 2px solid var(--color-gold);
  box-shadow: 0 0 18px rgba(255, 153, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: emitter-pulse 2s infinite ease-in-out;
}

.emitter-nozzle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #FFF;
  border-radius: 50%;
  box-shadow: 0 0 10px #FFF;
}

@keyframes emitter-pulse {
  0%, 100% { transform: scale(0.95); box-shadow: 0 0 14px rgba(255, 153, 0, 0.6); }
  50% { transform: scale(1.04); box-shadow: 0 0 25px rgba(255, 210, 0, 0.95); }
}

/* TARGET CRYSTAL ELEMENT */
.target-crystal {
  position: relative;
  width: 76%;
  height: 76%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crystal-shape {
  width: 68%;
  height: 68%;
  background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 50%, #60A5FA 100%);
  clip-path: polygon(50% 0%, 100% 38%, 81% 100%, 19% 100%, 0% 38%);
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.target-crystal.energized .crystal-shape {
  background: linear-gradient(135deg, #FFD200 0%, #00F5D4 50%, #FFFFFF 100%);
  box-shadow: 0 0 28px rgba(0, 245, 212, 1), 0 0 45px rgba(255, 210, 0, 0.8);
  transform: scale(1.18);
  animation: crystal-radiance 1.2s infinite alternate ease-in-out;
}

@keyframes crystal-radiance {
  0% { transform: scale(1.15) rotate(0deg); filter: brightness(1.2); }
  100% { transform: scale(1.25) rotate(3deg); filter: brightness(1.6); }
}

/* OBSTACLE ELEMENT */
.obstacle-monolith {
  width: 82%;
  height: 82%;
  background: linear-gradient(135deg, #334155 0%, #1E293B 100%);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.1), 0 4px 10px rgba(0, 0, 0, 0.6);
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.9rem;
}

/* BONUS GEM ELEMENT */
.bonus-gem {
  font-size: 1.15rem;
  filter: drop-shadow(0 0 8px rgba(0, 245, 212, 0.8));
  animation: gem-bob 2.5s ease-in-out infinite;
  transition: all 0.3s ease;
}

.bonus-gem.collected {
  transform: scale(1.6) translateY(-15px);
  opacity: 0;
}

@keyframes gem-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* LEVEL OBJECTIVE BAR */
.level-objective-card {
  margin-top: 12px;
  padding: 8px 16px;
  background: var(--glass-bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}

.objective-icon {
  font-size: 1.1rem;
}

.objective-text {
  font-size: 0.82rem;
  color: #E2E8F0;
  line-height: 1.3;
}

/* =======================================================
   ACHIEVEMENTS SCREEN
   ======================================================= */
.achievements-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

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

.achievement-card {
  background: var(--glass-bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
}

.achievement-card.unlocked {
  border-color: var(--glass-border-gold);
  background: rgba(20, 35, 60, 0.8);
  box-shadow: 0 4px 20px rgba(255, 210, 0, 0.15);
}

.ach-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.achievement-card.unlocked .ach-icon-box {
  border-color: var(--color-gold);
  background: radial-gradient(circle, rgba(255, 210, 0, 0.2) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.ach-details {
  flex: 1;
}

.ach-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFF;
}

.ach-desc {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  margin-top: 2px;
}

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

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

.ach-reward-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-gold);
  white-space: nowrap;
}

/* =======================================================
   SKINS SHOP SCREEN
   ======================================================= */
.shop-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.shop-tab {
  background: var(--glass-bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px;
  color: var(--color-text-dim);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shop-tab.active {
  background: rgba(0, 245, 212, 0.15);
  border-color: var(--color-emerald);
  color: #FFF;
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.25);
}

.shop-scroll-view {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.shop-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-bottom: 20px;
}

.shop-items-grid.hidden {
  display: none !important;
}

.shop-card {
  background: var(--glass-bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shop-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-cyan);
}

.shop-card.equipped {
  border-color: var(--color-emerald);
  box-shadow: 0 0 18px rgba(0, 245, 212, 0.3);
}

.shop-preview-box {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.shop-item-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 4px;
}

.shop-item-desc {
  font-size: 0.72rem;
  color: var(--color-text-dim);
  margin-bottom: 10px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-shop-action {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}

/* =======================================================
   OVERLAYS & MODALS
   ======================================================= */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 9, 18, 0.72) url('bg.jpg') center/cover no-repeat;
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease;
}

.screen-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.glass-card {
  background: var(--glass-bg-panel);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-gold);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 210, 0, 0.15);
  width: 100%;
  max-width: 380px;
  padding: 24px;
  text-align: center;
  animation: modal-enter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-enter {
  0% { transform: scale(0.85) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Welcome Card Specifics */
.welcome-logo {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  border: 2px solid var(--color-gold);
  box-shadow: 0 0 20px rgba(255, 210, 0, 0.5);
  margin-bottom: 12px;
}

.game-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #FFF;
}

.game-subtitle {
  font-size: 0.85rem;
  color: var(--color-gold);
  margin-bottom: 16px;
}

.tutorial-slider {
  min-height: 120px;
  margin-bottom: 12px;
}

.tutorial-slide {
  display: none;
  flex-direction: column;
  align-items: center;
}

.tutorial-slide.active {
  display: flex;
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.tutorial-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 210, 0, 0.15);
  border: 1px solid var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.tutorial-slide h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #FFF;
}

.tutorial-slide p {
  font-size: 0.82rem;
  color: #CBD5E1;
  line-height: 1.4;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.dot.active {
  width: 20px;
  border-radius: 4px;
  background: var(--color-gold);
}

.welcome-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}

/* Victory Card Specifics */
.victory-burst {
  font-size: 2rem;
  color: var(--color-gold);
  animation: pulse-glow 1s infinite alternate;
}

.victory-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--color-gold);
  letter-spacing: 2px;
}

.victory-subtitle {
  font-size: 0.9rem;
  color: var(--color-emerald);
  margin-bottom: 14px;
}

.stars-award-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.star-award {
  color: rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.star-award.filled {
  color: var(--color-gold);
  text-shadow: 0 0 20px rgba(255, 210, 0, 0.8);
  transform: scale(1.2);
}

.victory-stats-panel {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.v-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.v-stat-row:last-child {
  border-bottom: none;
}

.v-stat-label {
  color: var(--color-text-dim);
}

.highlight-gem {
  color: var(--color-emerald);
  font-weight: 700;
}

.highlight-gold {
  color: var(--color-gold);
  font-weight: 700;
}

.victory-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  margin-bottom: 12px;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px;
}

.btn-text-link:hover {
  color: #FFF;
}

/* TOAST POPUP */
.toast-popup {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 29, 53, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-gold);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 210, 0, 0.4);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #FFF;
  z-index: 200;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-popup.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
  pointer-events: none;
}

/* =======================================================
   MOBILE PHONE RESPONSIVE ADAPTATIONS
   ======================================================= */
@media (max-width: 420px) {
  .glass-card {
    padding: 18px 14px;
    border-radius: 20px;
    max-width: 95vw;
  }
  .welcome-logo {
    width: 76px;
    height: 76px;
    border-radius: 16px;
  }
  .game-title {
    font-size: 1.5rem;
  }
  .level-grid {
    gap: 6px;
  }
  .level-number {
    font-size: 1rem;
  }
  .level-stars {
    font-size: 0.55rem;
  }
  .shop-items-grid {
    gap: 8px;
  }
  .shop-card {
    padding: 10px 8px;
  }
  .shop-preview-box {
    width: 48px;
    height: 48px;
  }
  .hud-level-name {
    max-width: 80px;
  }
}

@media (max-height: 720px) {
  .home-hero {
    margin-top: 0;
  }
  .hero-logo-container {
    width: 80px;
    height: 80px;
    margin-bottom: 4px;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .stats-glass-panel {
    margin: 6px 0;
    padding: 6px;
  }
  .home-actions-group {
    gap: 8px;
  }
  .btn-large {
    padding: 12px 18px;
  }
  .temple-frame {
    max-width: min(86vw, 340px, 42vh);
  }
  .level-objective-card {
    margin-top: 6px;
    padding: 6px 12px;
  }
}
