:root {
  /* Green Nature Theme */
  --sky-top: #4A90E2; --sky-bot: #87CEEB;
  --grass: #4CAF50; --dirt: #3E2723;
  --bg-panel: rgba(255, 255, 255, 0.95);
  --text-dark: #1B5E20; --text-mid: #2E7D32;
  --border: rgba(46, 125, 50, 0.2);
  --primary: #FF9800; --primary-hover: #F57C00;
  --ok: #2ECC71; --bad: #E74C3C;
  --display: 'Playfair Display', Georgia, serif;
  --body: 'Jost', sans-serif;
  --card-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: linear-gradient(to bottom, var(--sky-top), var(--sky-bot)); color: var(--text-dark); font-family: var(--body); font-size: 16px; user-select: none; }

#bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.btn-global-home { position: fixed; top: 15px; left: 15px; z-index: 1000; background: var(--bg-panel); border: 2px solid var(--border); border-radius: 8px; padding: 8px 16px; font-family: var(--body); font-weight: 700; color: var(--text-dark); cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: all 0.2s; }
.btn-global-home:hover { background: var(--primary); color: white; border-color: var(--primary); }

.screen { display: none; position: fixed; inset: 0; z-index: 10; flex-direction: column; align-items: center; justify-content: flex-start; overflow-y: auto; padding: 24px 20px 36px; }
.screen.active { display: flex; }
#screen-game { display: none; padding: 0; background: transparent; overflow: hidden; }
#screen-game.active { display: block; } /* Fixed absolute positioning context */

/* PANELS */
.home-wrap, .intro-wrap, .lc-wrap { display: flex; flex-direction: column; align-items: center; gap: 24px; width: 100%; max-width: 540px; background: var(--bg-panel); border-radius: 16px; padding: 32px; box-shadow: var(--card-shadow); margin-top: 2vh; }
.hero-title, .intro-title, .lc-title { font-family: var(--display); font-size: clamp(2.5rem, 8vw, 4rem); font-weight: 900; color: var(--text-dark); line-height: 1.1; text-align: center; }
.hero-title em { font-style: italic; color: var(--primary); }
.hero-sub, .intro-desc { color: var(--text-mid); text-align: center; font-size: 1.1rem; }
.hero-divider, .intro-divider, .lc-divider { display: flex; align-items: center; gap: 12px; justify-content: center; width: 100%; }
.hero-divider span:not(.divider-gem), .intro-divider span:not(.divider-gem), .lc-divider span:not(.divider-gem) { height: 1px; flex: 1; max-width: 60px; background: linear-gradient(to right, transparent, var(--border), transparent); }
.top-badge, .intro-sector-tag, .lc-sector-tag { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em; color: var(--primary); border: 1px solid var(--primary); border-radius: 40px; padding: 6px 16px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.badge-dot { width: 6px; height: 6px; background: var(--primary); border-radius: 50%; }

/* COLLECTIONS */
.collection-panel { width: 100%; background: #f8f9fa; border-radius: 12px; padding: 16px; border: 1px solid var(--border); }
.panel-header { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: 700; color: var(--text-mid); margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.collection-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 40px; align-items: center; }
.empty-msg { font-size: 0.85rem; color: var(--text-mid); font-style: italic; }
.coll-item { font-size: 1.8rem; background: white; border: 1px solid var(--border); border-radius: 8px; padding: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* BUTTONS */
.btn-primary { font-family: var(--body); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em; color: white; background: var(--primary); border: none; border-radius: 8px; padding: 16px 40px; cursor: pointer; transition: 0.2s; width: 100%; max-width: 380px; box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4); text-transform: uppercase; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-outline { font-family: var(--body); font-size: 0.9rem; font-weight: 600; color: var(--text-mid); background: transparent; border: 2px solid var(--border); border-radius: 8px; padding: 14px 30px; cursor: pointer; transition: 0.2s; text-transform: uppercase; letter-spacing: 0.05em; }
.btn-outline:hover { border-color: var(--text-dark); color: var(--text-dark); }
.diff-row, .lc-btns { display: flex; gap: 10px; width: 100%; justify-content: center; flex-wrap: wrap; }
.diff-btn { flex: 1; min-width: 80px; padding: 12px 10px; border-radius: 8px; border: 1px solid var(--border); background: #f8f9fa; color: var(--text-mid); font-weight: 600; cursor: pointer; transition: 0.2s; font-family: var(--body); font-size: 0.85rem; }
.diff-btn.active, .diff-btn:hover { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 10px rgba(255,152,0,0.2); }
.lc-stats { display: flex; width: 100%; justify-content: center; gap: 10px; text-align: center; }
.lc-stats div { flex: 1; background: #f8f9fa; padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.fs-val { font-family: var(--display); font-size: 1.5rem; font-weight: 700; color: var(--primary); display: block; }
.fs-lbl { font-size: 0.6rem; color: var(--text-mid); text-transform: uppercase; font-weight: 600; margin-top: 4px; display: block; }

/* HUD & GAME AREA */
.game-hud { position: absolute; top: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 12px 110px; background: rgba(255,255,255,0.9); border-bottom: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.hud-chip { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em; color: var(--text-dark); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; background: rgba(76, 175, 80, 0.1); text-transform: uppercase; }
.hud-score-wrap { text-align: right; }
.hud-lbl { font-size: 0.55rem; letter-spacing: 0.1em; color: var(--text-mid); text-transform: uppercase; font-weight: 700; margin-bottom: 2px; }
.hud-score { font-family: var(--display); font-size: 1.6rem; font-weight: 700; color: var(--primary); line-height: 1; }

.timer-outer { position: absolute; top: 61px; left: 0; right: 0; height: 4px; background: rgba(0,0,0,0.1); z-index: 28; }
.timer-fill { height: 100%; background: var(--primary); transition: width 0.1s linear; }

.target-stage { position: absolute; top: 65px; left: 50%; transform: translateX(-50%); z-index: 25; text-align: center; background: var(--bg-panel); padding: 12px 32px; border-radius: 0 0 20px 20px; box-shadow: var(--card-shadow); border: 1px solid var(--border); border-top: none; pointer-events: none; }
.target-eyebrow { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em; color: var(--text-mid); text-transform: uppercase; margin-bottom: 4px; }
.target-word { font-family: var(--display); font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 900; color: var(--text-dark); line-height: 1; }
.target-footer { display: flex; justify-content: center; gap: 16px; margin-top: 8px; font-size: 0.75rem; color: var(--text-mid); font-weight: 700; }

.altitude-meter { position: absolute; right: 20px; top: 140px; bottom: 120px; width: 14px; background: rgba(255, 255, 255, 0.6); border: 2px solid white; border-radius: 10px; z-index: 25; box-shadow: 0 4px 10px rgba(0,0,0,0.1); display: flex; justify-content: center; }
.altitude-meter::before { content: 'ALT'; position: absolute; top: -24px; font-size: 0.6rem; font-weight: 700; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.4); letter-spacing: 0.1em; }
.alt-indicator { position: absolute; bottom: 50%; left: -6px; width: 22px; height: 8px; background: var(--primary); border-radius: 4px; border: 1px solid white; box-shadow: 0 2px 5px rgba(230,126,34,0.5); }

/* CARGO BOX */
.cargo-box { position: absolute; bottom: 20px; right: 20px; width: 180px; min-height: 80px; background: var(--bg-panel); border: 3px solid var(--primary); border-radius: 12px; z-index: 25; padding: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); display: flex; flex-direction: column; align-items: center; }
.cargo-box-title { font-size: 0.65rem; font-weight: 700; color: var(--primary); letter-spacing: 0.1em; margin-bottom: 8px; text-transform: uppercase; }
.cargo-box-items { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cargo-box-items span { font-size: 1.6rem; background: white; border-radius: 6px; border: 1px solid var(--border); padding: 2px; }

/* PLAY FIELD */
.play-field { position: absolute; inset: 0; overflow: hidden; }
.ground-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: var(--grass); border-top: 6px solid #388E3C; border-bottom: 20px solid var(--dirt); z-index: 5; }
.trees-layer { position: absolute; bottom: 55px; left: 0; right: 0; top: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.env-tree { position: absolute; bottom: 0; font-size: 6rem; line-height: 1; transform-origin: bottom center; animation: treeWave 3s ease-in-out infinite alternate; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3)); }
@keyframes treeWave { 0% { transform: rotate(-6deg); } 100% { transform: rotate(6deg); } }

/* THE PLANE */
.char-wrap { position: absolute; left: 80px; z-index: 20; will-change: transform; display: flex; flex-direction: column; align-items: center; }
.char-body { font-size: 4rem; display: block; filter: drop-shadow(0 12px 10px rgba(0,0,0,0.25)); animation: planeBob 1.5s ease-in-out infinite alternate; }
@keyframes planeBob { 0% { transform: translateY(-4px) rotate(1deg); } 100% { transform: translateY(4px) rotate(-1deg); } }

/* OBJECTS & OBSTACLES */
.objects-layer { position: absolute; inset: 0; z-index: 15; pointer-events: none; }
.obj-btn { position: absolute; top: 0; left: 0; background: rgba(255,255,255,0.95); border: 3px solid white; border-radius: 50%; width: 76px; height: 76px; display: flex; justify-content: center; align-items: center; box-shadow: 0 6px 15px rgba(0,0,0,0.12); will-change: transform; }
.obj-emoji { font-size: 2.8rem; line-height: 1; margin-top: 4px; }

/* ANIMATIONS & EFFECTS */
.anim-cargo { position: fixed; z-index: 999; font-size: 3.5rem; pointer-events: none; transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); }
.game-flash { position: absolute; inset: 0; z-index: 50; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.game-flash.f-ok { background: rgba(46, 204, 113, 0.15); opacity: 1; }
.game-flash.f-bad { background: rgba(231, 76, 60, 0.4); opacity: 1; }