/* ===== BIRDIE! Roguelike Deck-Builder Styles ===== */
:root {
  --green-deep: #1a4d2e;
  --green-mid: #2d6b45;
  --green-light: #3d8b5e;
  --green-felt: #1e5c36;
  --brown-dark: #5c3d2e;
  --brown-warm: #8b6f47;
  --brown-light: #a89070;
  --cream: #f5f0e0;
  --cream-light: #faf6eb;
  --ivory: #fff8e7;
  --gold: #c9a84c;
  --gold-bright: #d4af37;
  --gold-dim: #a08535;
  --burgundy: #722f37;
  --red: #c0392b;
  --blue: #3a7bd5;
  --purple: #9b59b6;
  --white: #ffffff;
  --black: #1a1a1a;
  --gray: #666;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1);
  --shadow-deep: 0 8px 32px rgba(0,0,0,0.25);
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: var(--font-body); font-size: 15px; color: var(--black); background: var(--green-deep); }
body { display: flex; flex-direction: column; }
#app { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }

/* Screen System */
.screen { display: none; width: 100%; min-height: 100%; animation: fadeIn 0.3s ease-out; }
.screen.active { display: flex; flex-direction: column; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Title ===== */
.title-screen { background: linear-gradient(135deg, var(--green-deep) 0%, #0f3d20 50%, var(--brown-dark) 100%); align-items: center; justify-content: center; text-align: center; padding: 32px; min-height: 100vh; }
.title-logo { margin-bottom: 32px; }
.title-logo svg { width: 280px; height: auto; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }
.title-tagline { font-family: var(--font-display); font-size: 1.15rem; font-style: italic; color: var(--gold); letter-spacing: 0.05em; margin-bottom: 40px; opacity: 0.9; }
.title-buttons { display: flex; flex-direction: column; gap: 12px; width: 240px; }

/* ===== Buttons ===== */
.btn { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; padding: 12px 24px; border: 2px solid var(--gold); border-radius: 6px; cursor: pointer; transition: all var(--transition-fast); text-transform: uppercase; letter-spacing: 0.08em; }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: var(--brown-dark); }
.btn-primary:hover { background: linear-gradient(135deg, var(--gold-bright), #e0c050); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(201,168,76,0.4); }
.btn-secondary { background: transparent; color: var(--cream); border-color: var(--cream); }
.btn-secondary:hover { background: rgba(245,240,224,0.1); }
.btn-small { font-size: 0.85rem; padding: 8px 16px; }
.btn-danger { background: var(--burgundy); color: var(--cream); border-color: var(--burgundy); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Character Select ===== */
.char-select-screen { background: linear-gradient(135deg, var(--green-deep), #0f3d20); color: var(--cream); align-items: center; padding: 32px 16px; }
.char-select-screen h2 { font-family: var(--font-display); font-size: 2rem; color: var(--gold); margin-bottom: 24px; }
.char-grid { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; max-width: 900px; }
.char-card { background: rgba(245,240,224,0.06); border: 2px solid rgba(245,240,224,0.15); border-radius: 12px; padding: 20px; width: 260px; cursor: pointer; transition: all var(--transition-normal); text-align: center; }
.char-card:hover { transform: translateY(-4px); border-color: var(--gold); background: rgba(201,168,76,0.1); box-shadow: var(--shadow-card-hover); }
.char-icon { font-size: 3rem; margin-bottom: 8px; }
.char-card h3 { font-family: var(--font-display); font-size: 1.4rem; color: var(--gold); margin-bottom: 8px; }
.char-passive { font-size: 0.8rem; color: rgba(245,240,224,0.8); margin-bottom: 12px; line-height: 1.4; }
.char-stats { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.char-stat { text-align: center; }
.char-stat-label { display: block; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(245,240,224,0.5); }
.char-stat-val { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--cream); }
.char-composure { font-size: 0.8rem; color: var(--green-light); margin-bottom: 8px; }
.char-flavor { font-size: 0.75rem; font-style: italic; color: rgba(245,240,224,0.5); }

/* ===== HUD ===== */
.hud { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,0.5); padding: 8px 16px; border-bottom: 1px solid rgba(201,168,76,0.3); color: var(--cream); gap: 12px; flex-shrink: 0; flex-wrap: wrap; }
.hud-left { display: flex; align-items: center; gap: 12px; }
.hud-char { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.hud-act { font-size: 0.75rem; opacity: 0.7; }
.hud-center { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 120px; max-width: 250px; }
.hud-composure-wrap { flex: 1; height: 14px; background: rgba(255,255,255,0.1); border-radius: 7px; overflow: hidden; border: 1px solid rgba(255,255,255,0.15); }
.hud-composure-bar { height: 100%; background: linear-gradient(90deg, var(--green-mid), var(--green-light)); border-radius: 6px; transition: width 0.3s; }
.hud-composure-bar.hud-bar-warn { background: linear-gradient(90deg, #d4a84c, #e0c050); }
.hud-composure-bar.hud-bar-danger { background: linear-gradient(90deg, var(--burgundy), var(--red)); }
.hud-composure-text { font-size: 0.7rem; white-space: nowrap; }
.hud-right { display: flex; align-items: center; gap: 12px; }
.hud-gold { font-weight: 600; font-size: 0.9rem; }
.hud-relics { display: flex; gap: 4px; }
.hud-relic { font-size: 1rem; cursor: help; }

/* ===== Map ===== */
.map-screen { background: linear-gradient(180deg, #0a2e1a 0%, var(--green-deep) 100%); color: var(--cream); }
.map-title { text-align: center; padding: 16px; }
.map-title h2 { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold); }
.map-container { flex: 1; overflow-y: auto; padding: 16px; display: flex; justify-content: center; }
.map-grid { display: flex; flex-direction: column; gap: 32px; align-items: center; padding: 16px 0; }
.map-row { display: flex; gap: 40px; justify-content: center; align-items: center; }
.map-node { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; border: 3px solid var(--node-color, #666); background: rgba(0,0,0,0.4); cursor: default; transition: all var(--transition-normal); position: relative; }
.map-node.available { cursor: pointer; background: rgba(0,0,0,0.2); animation: nodePulse 1.5s infinite; }
.map-node.available:hover { transform: scale(1.15); box-shadow: 0 0 20px rgba(201,168,76,0.4); border-color: var(--gold); }
.map-node.visited { opacity: 0.35; border-style: dashed; }
.map-node.current { border-color: var(--gold-bright); box-shadow: 0 0 12px rgba(212,175,55,0.5); background: rgba(201,168,76,0.15); }
.map-node.locked { opacity: 0.25; }
.map-node-icon { pointer-events: none; }
@keyframes nodePulse { 0%, 100% { box-shadow: 0 0 4px rgba(201,168,76,0.2); } 50% { box-shadow: 0 0 16px rgba(201,168,76,0.4); } }
.map-legend { display: flex; gap: 16px; justify-content: center; padding: 12px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,0.1); }
.legend-item { font-size: 0.7rem; display: flex; align-items: center; gap: 4px; opacity: 0.6; }
.legend-icon { font-size: 0.9rem; }

/* ===== Hole Play ===== */
.tournament-play { background: var(--green-felt); color: var(--cream); overflow: hidden; }
.hole-header { background: rgba(0,0,0,0.3); padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(201,168,76,0.3); }
.hole-info h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--gold); }
.hole-details { font-size: 0.75rem; opacity: 0.7; }
.hole-energy { text-align: center; }
.energy-dots { display: flex; gap: 4px; }
.energy-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gold); background: transparent; }
.energy-dot.filled { background: var(--gold); }
.energy-label { font-size: 0.65rem; opacity: 0.6; display: block; margin-top: 2px; }
.wind-indicator { text-align: center; padding: 6px; background: rgba(100,150,200,0.2); font-size: 0.8rem; }
.hole-status-bar { text-align: center; padding: 4px 16px; font-size: 0.75rem; opacity: 0.6; display: flex; justify-content: center; gap: 16px; }

/* Hole diagram */
.hole-diagram { height: 160px; margin: 8px 16px; background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 20%, var(--green-light) 20%, var(--green-mid) 100%); border-radius: 10px; position: relative; overflow: hidden; border: 2px solid rgba(0,0,0,0.2); }
.hole-fairway { position: absolute; background: #4a9e6a; }
.hole-green { position: absolute; background: #3dbd6e; border-radius: 50%; border: 2px solid #2da85c; }
.hole-flag { position: absolute; width: 3px; height: 24px; background: var(--white); }
.hole-flag::after { content: ''; position: absolute; top: 0; left: 3px; width: 12px; height: 8px; background: var(--burgundy); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.hole-bunker { position: absolute; background: #e8d6a0; border-radius: 50%; border: 1px solid #d4c490; }
.hole-water { position: absolute; background: #4a90c4; border-radius: 50%; border: 1px solid #3d7ab3; }
.ball-marker { position: absolute; width: 10px; height: 10px; background: var(--white); border-radius: 50%; border: 1px solid #ccc; transform: translate(-50%, -50%); z-index: 5; box-shadow: 0 1px 4px rgba(0,0,0,0.4); transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); }
.tee-marker { position: absolute; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; transform: translate(-50%, -50%); z-index: 4; }
.shot-outcome { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,0.6); z-index: 10; animation: outcomePopIn 0.5s ease-out forwards; pointer-events: none; }
@keyframes outcomePopIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.outcome-great { color: #FFD700; }
.outcome-good { color: #90EE90; }
.outcome-ok { color: var(--cream); }
.outcome-poor { color: #FFA500; }
.outcome-terrible { color: #FF6347; }

/* Shot phase */
.shot-phase { padding: 6px 16px; display: flex; gap: 8px; align-items: center; justify-content: center; background: rgba(0,0,0,0.15); }
.phase-step { font-size: 0.7rem; padding: 3px 10px; border-radius: 20px; opacity: 0.35; border: 1px solid rgba(245,240,224,0.3); }
.phase-step.active { opacity: 1; background: var(--gold); color: var(--brown-dark); font-weight: 600; border-color: var(--gold); }
.phase-step.completed { opacity: 0.6; background: rgba(245,240,224,0.15); }

/* Card hand */
.card-hand-area { padding: 8px 12px; background: rgba(0,0,0,0.2); border-top: 1px solid rgba(201,168,76,0.2); }
.hand-label { font-family: var(--font-display); font-size: 0.8rem; color: var(--gold); margin-bottom: 6px; display: flex; justify-content: space-between; }
.hand-meta { font-size: 0.7rem; opacity: 0.6; }
.card-hand { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.empty-hand { text-align: center; opacity: 0.5; padding: 16px; }

/* Shot cards */
.shot-card { flex-shrink: 0; width: 120px; background: var(--cream); border: 2px solid var(--brown-light); border-radius: 8px; padding: 6px 8px; cursor: pointer; transition: all var(--transition-fast); color: var(--black); box-shadow: var(--shadow-card); position: relative; }
.shot-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card-hover); }
.shot-card.disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; }
.shot-card.rarity-uncommon { border-color: var(--blue); }
.shot-card.rarity-rare { border-color: var(--gold-bright); box-shadow: 0 2px 8px rgba(212,175,55,0.3); }
.card-top-row { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.card-energy-cost { width: 20px; height: 20px; border-radius: 50%; background: var(--green-deep); color: var(--cream); font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shot-card-type { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.card-type-tee { background: var(--green-mid); color: white; }
.card-type-approach { background: var(--blue); color: white; }
.card-type-short { background: #d4a84c; color: var(--brown-dark); }
.card-type-putt { background: var(--cream-light); color: var(--brown-dark); border: 1px solid var(--brown-light); }
.card-type-special { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: var(--brown-dark); }
.shot-card-name { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--green-deep); line-height: 1.1; }
.shot-card-icon { font-size: 1.4rem; text-align: center; margin: 2px 0; line-height: 1; }
.shot-card-power { text-align: center; }
.power-value { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--gold-dim); }
.shot-card-desc { font-size: 0.6rem; color: var(--gray); line-height: 1.2; text-align: center; }

/* Action area */
.action-area { padding: 8px 16px; text-align: center; background: rgba(0,0,0,0.25); border-top: 1px solid rgba(201,168,76,0.2); }
.action-hint { font-size: 0.8rem; opacity: 0.7; margin-bottom: 6px; }
.action-warn { color: #FFA500; opacity: 1; }

/* Hole complete overlay */
.hole-complete-overlay { flex: 1; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); }
.hole-complete-card { background: rgba(245,240,224,0.1); border: 2px solid var(--gold); border-radius: 12px; padding: 32px; text-align: center; }
.hole-complete-score { font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.hole-complete-detail { font-size: 0.9rem; opacity: 0.8; margin-bottom: 16px; }
.score-eagle { color: var(--gold-bright); }
.score-birdie { color: #90EE90; }
.score-par { color: var(--cream); }
.score-bogey { color: #FFA500; }
.score-double { color: #FF6347; }

/* ===== Rewards ===== */
.reward-screen { background: linear-gradient(135deg, var(--green-deep), #0f3d20); color: var(--cream); }
.reward-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.reward-content h2 { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); margin-bottom: 16px; }
.reward-score { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 8px; }
.reward-details { display: flex; gap: 16px; margin-bottom: 24px; font-size: 0.9rem; }
.positive { color: #90EE90; }
.negative { color: #FF6347; }
.reward-cards { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 24px; }
.reward-cards .shot-card { width: 140px; }
.relic-choices { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.relic-choice { background: rgba(245,240,224,0.06); border: 2px solid rgba(245,240,224,0.15); border-radius: 12px; padding: 20px; width: 180px; text-align: center; cursor: pointer; transition: all var(--transition-normal); }
.relic-choice:hover { border-color: var(--gold); background: rgba(201,168,76,0.1); transform: translateY(-4px); }
.relic-choice-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.relic-choice-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--gold); margin-bottom: 4px; }
.relic-choice-desc { font-size: 0.75rem; opacity: 0.7; }

/* ===== Shop ===== */
.shop-screen { background: linear-gradient(135deg, #1a3a5c, #0f2d4a); color: var(--cream); }
.shop-content { flex: 1; padding: 24px; max-width: 800px; margin: 0 auto; width: 100%; }
.shop-content h2 { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); margin-bottom: 16px; text-align: center; }
.shop-section { margin-bottom: 24px; }
.shop-section h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--cream); margin-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 4px; }
.shop-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.shop-item { position: relative; }
.shop-item.sold { opacity: 0.3; pointer-events: none; }
.shop-item.cant-afford .shot-card { opacity: 0.4; }
.shop-sold-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-weight: 700; color: var(--cream); font-size: 1rem; }
.shop-price { text-align: center; font-size: 0.85rem; font-weight: 600; margin-top: 4px; }
.shop-remove-list { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-remove-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; gap: 8px; transition: all var(--transition-fast); }
.shop-remove-card:hover { border-color: var(--red); background: rgba(192,57,43,0.1); }
.shop-remove-card.cant-afford { opacity: 0.3; pointer-events: none; }
.shop-remove-x { color: var(--red); font-weight: 700; }

/* ===== Practice / Card Remove ===== */
.practice-screen { background: linear-gradient(135deg, #3a3520, #2a2510); color: var(--cream); }
.practice-content { flex: 1; padding: 24px; max-width: 600px; margin: 0 auto; width: 100%; text-align: center; }
.practice-content h2 { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); margin-bottom: 8px; }
.practice-content p { font-size: 0.9rem; opacity: 0.7; margin-bottom: 20px; }
.practice-deck { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; text-align: left; }
.practice-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: all var(--transition-fast); font-size: 0.9rem; }
.practice-card:hover { border-color: var(--gold); background: rgba(201,168,76,0.1); }
.practice-card.already-upgraded { opacity: 0.4; cursor: default; }
.practice-card.already-upgraded:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); }
.upgrade-arrow { color: var(--gold); font-weight: 700; margin-left: auto; }
.upgrade-done { color: var(--green-light); margin-left: auto; }

/* ===== Event ===== */
.event-screen { background: linear-gradient(135deg, #2a1a3a, #1a1030); color: var(--cream); }
.event-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.event-icon { font-size: 3.5rem; margin-bottom: 16px; }
.event-content h2 { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); margin-bottom: 12px; }
.event-desc { font-size: 1rem; line-height: 1.6; max-width: 500px; margin-bottom: 24px; opacity: 0.85; }
.event-choices { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 400px; }
.event-choice { text-align: center; font-size: 0.9rem; text-transform: none; letter-spacing: 0; }

/* ===== Rest ===== */
.rest-screen { background: linear-gradient(135deg, #1a3a2a, #0f2a1a); color: var(--cream); }
.rest-content { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 32px; text-align: center; }
.rest-content h2 { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); margin-bottom: 16px; }
.rest-content p { margin-bottom: 16px; opacity: 0.8; }
.rest-divider { margin: 16px 0; font-size: 0.85rem; opacity: 0.5; }
.rest-content .practice-deck { width: 100%; max-width: 400px; }

/* ===== Boss ===== */
.boss-screen { background: linear-gradient(135deg, #3a1a1a, #2a0a0a); color: var(--cream); }
.boss-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.boss-icon { font-size: 4rem; margin-bottom: 16px; }
.boss-content h2 { font-family: var(--font-display); font-size: 2rem; color: var(--gold); margin-bottom: 12px; }
.boss-desc { font-size: 1rem; opacity: 0.8; margin-bottom: 16px; max-width: 500px; }
.boss-holes { font-size: 0.85rem; opacity: 0.7; margin-bottom: 16px; }
.boss-info { margin-bottom: 20px; font-size: 0.9rem; }
.boss-detail { font-size: 0.8rem; opacity: 0.6; margin-top: 4px; }
.boss-scores { display: flex; gap: 32px; font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 20px; }

/* ===== Act Transition ===== */
.act-transition-screen { background: linear-gradient(135deg, var(--green-deep), #0f3d20); color: var(--cream); align-items: center; justify-content: center; text-align: center; padding: 48px; }
.act-transition-screen h2 { font-family: var(--font-display); font-size: 2.5rem; color: var(--gold); margin-bottom: 12px; }
.act-name { font-family: var(--font-display); font-size: 1.4rem; font-style: italic; opacity: 0.8; margin-bottom: 32px; }

/* ===== Victory ===== */
.victory-screen { background: linear-gradient(135deg, #2a4a1a, #1a3a0a); color: var(--cream); align-items: center; justify-content: center; text-align: center; padding: 48px; }
.victory-trophy { font-size: 5rem; margin-bottom: 16px; }
.victory-screen h1 { font-family: var(--font-display); font-size: 2.5rem; color: var(--gold); margin-bottom: 8px; }
.victory-subtitle { font-size: 1.1rem; opacity: 0.8; margin-bottom: 32px; }

/* ===== Game Over ===== */
.gameover-screen { background: linear-gradient(135deg, #3a1a1a, #1a0a0a); color: var(--cream); align-items: center; justify-content: center; text-align: center; padding: 48px; }
.gameover-icon { font-size: 4rem; margin-bottom: 16px; }
.gameover-screen h1 { font-family: var(--font-display); font-size: 2.5rem; color: var(--red); margin-bottom: 8px; }
.gameover-subtitle { font-size: 1rem; opacity: 0.7; margin-bottom: 12px; }
.gameover-detail { font-size: 0.9rem; opacity: 0.6; margin-bottom: 32px; }

/* ===== Run Stats ===== */
.run-stats { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.run-stat { background: rgba(245,240,224,0.06); border: 1px solid rgba(245,240,224,0.15); border-radius: 8px; padding: 12px 20px; text-align: center; min-width: 100px; }
.run-stat-val { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--gold); }
.run-stat-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.6; margin-top: 4px; }

/* ===== How to Play ===== */
.how-to-play { background: var(--cream); }
.mgmt-header { background: linear-gradient(135deg, var(--green-deep), var(--green-mid)); color: var(--cream); padding: 16px 24px; display: flex; align-items: center; gap: 16px; }
.mgmt-header h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; flex: 1; }
.back-btn { background: none; border: 1px solid rgba(245,240,224,0.4); color: var(--cream); padding: 8px 12px; border-radius: 6px; cursor: pointer; font-family: var(--font-body); font-size: 0.85rem; transition: all var(--transition-fast); }
.back-btn:hover { background: rgba(245,240,224,0.15); border-color: var(--cream); }
.how-to-play-content { padding: 24px; max-width: 700px; margin: 0 auto; }
.how-to-play-content h3 { font-family: var(--font-display); font-size: 1.4rem; color: var(--green-deep); margin: 24px 0 12px; border-bottom: 2px solid var(--gold); padding-bottom: 8px; }
.how-to-play-content h3:first-child { margin-top: 0; }
.how-to-play-content p { margin-bottom: 12px; line-height: 1.6; color: var(--brown-dark); }
.how-to-play-content ul { margin-bottom: 12px; padding-left: 24px; }
.how-to-play-content li { margin-bottom: 8px; line-height: 1.5; color: var(--brown-dark); }

/* ===== Toast ===== */
.toast { position: fixed; top: 16px; right: 16px; background: var(--green-deep); color: var(--cream); padding: 12px 20px; border-radius: 8px; font-size: 0.9rem; box-shadow: var(--shadow-deep); z-index: 200; animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 2.7s; animation-fill-mode: forwards; border-left: 4px solid var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ===== Sound Toggle ===== */
.sound-toggle { position: fixed; top: 12px; right: 12px; background: rgba(0,0,0,0.4); border: 1px solid rgba(245,240,224,0.2); color: var(--cream); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; z-index: 50; display: flex; align-items: center; justify-content: center; transition: all var(--transition-fast); }
.sound-toggle:hover { background: rgba(0,0,0,0.6); border-color: var(--gold); }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .char-grid { flex-direction: column; align-items: center; }
  .char-card { width: 100%; max-width: 300px; }
  .map-node { width: 42px; height: 42px; font-size: 1.1rem; }
  .map-row { gap: 24px; }
  .shot-card { width: 110px; }
  .reward-cards .shot-card { width: 120px; }
  .title-logo svg { width: 220px; }
  .run-stats { gap: 8px; }
  .run-stat { min-width: 80px; padding: 8px 12px; }
}

/* ===== Scrollbar ===== */
#app::-webkit-scrollbar { width: 8px; }
#app::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
#app::-webkit-scrollbar-thumb { background: var(--brown-light); border-radius: 4px; }
#app::-webkit-scrollbar-thumb:hover { background: var(--brown-warm); }

/* ===== Deck Viewer ===== */
.deck-viewer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.75); z-index: 100; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease-out; }
.deck-viewer { background: var(--green-deep); border: 2px solid var(--gold); border-radius: 12px; width: 90%; max-width: 560px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: var(--shadow-deep); color: var(--cream); }
.deck-viewer-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid rgba(201,168,76,0.3); background: rgba(0,0,0,0.3); border-radius: 10px 10px 0 0; }
.deck-viewer-header h3 { font-family: var(--font-display); color: var(--gold); margin: 0; font-size: 1.2rem; }
.deck-viewer-close { font-size: 1rem; }
.deck-viewer-list { flex: 1; overflow-y: auto; padding: 12px 16px; }
.deck-viewer-section-label { font-family: var(--font-display); font-size: 0.9rem; color: var(--gold); margin: 12px 0 6px; padding-bottom: 4px; border-bottom: 1px solid rgba(201,168,76,0.2); }
.deck-viewer-section-label:first-child { margin-top: 0; }
.deck-viewer-card { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; margin-bottom: 4px; background: rgba(245,240,224,0.06); border: 1px solid rgba(245,240,224,0.1); font-size: 0.8rem; color: var(--cream); }
.deck-viewer-card.rarity-uncommon { border-color: var(--blue); }
.deck-viewer-card.rarity-rare { border-color: var(--gold-bright); background: rgba(212,175,55,0.08); }
.dvc-energy { width: 20px; height: 20px; border-radius: 50%; background: var(--green-mid); color: var(--cream); font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dvc-icon { font-size: 1rem; flex-shrink: 0; }
.dvc-name { font-weight: 600; flex-shrink: 0; min-width: 90px; }
.dvc-power { font-family: var(--font-display); font-weight: 700; color: var(--gold-dim); width: 28px; text-align: center; flex-shrink: 0; }
.dvc-desc { font-size: 0.65rem; opacity: 0.6; flex: 1; }

/* ===== Character Select — Locked & Ascension ===== */
.char-card.locked { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.6); }
.char-card.locked:hover { transform: none; border-color: rgba(245,240,224,0.15); background: rgba(245,240,224,0.06); box-shadow: none; }
.unlock-text { font-size: 0.75rem; color: #ffa07a; background: rgba(192,57,43,0.15); padding: 4px 10px; border-radius: 8px; margin-top: 8px; display: inline-block; }
.ascension-select { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.8rem; }
.ascension-select label { color: var(--gold); font-weight: 600; }
.ascension-select select { background: rgba(0,0,0,0.3); color: var(--cream); border: 1px solid var(--gold); border-radius: 4px; padding: 2px 6px; font-size: 0.8rem; cursor: pointer; }

/* ===== HUD Additions ===== */
.hud-deck-count { cursor: pointer; font-size: 0.85rem; padding: 2px 6px; border-radius: 4px; transition: all var(--transition-fast); }
.hud-deck-count:hover { background: rgba(201,168,76,0.2); }
.hud-ascension { font-size: 0.7rem; background: rgba(192,57,43,0.3); color: #ffa07a; padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* ===== Map Actions ===== */
.map-actions { text-align: center; padding: 4px 16px; }

/* ===== Stats Screen ===== */
.stats-screen { background: linear-gradient(135deg, var(--green-deep), #0f3d20); color: var(--cream); }
.stats-content { padding: 24px; max-width: 600px; margin: 0 auto; }
.stats-favorite { text-align: center; margin: 16px 0; font-size: 1rem; color: var(--cream); }
.stats-section-title { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold); margin: 20px 0 12px; border-bottom: 1px solid rgba(201,168,76,0.3); padding-bottom: 6px; }
.stats-char-list { display: flex; flex-direction: column; gap: 8px; }
.stats-char-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: rgba(245,240,224,0.06); border: 1px solid rgba(245,240,224,0.1); border-radius: 8px; }
.stats-char-icon { font-size: 1.5rem; }
.stats-char-name { flex: 1; font-weight: 600; }
.stats-char-asc { font-size: 0.8rem; color: var(--gold); }

/* ===== Run History Screen ===== */
.run-history-screen { background: linear-gradient(135deg, var(--green-deep), #0f3d20); color: var(--cream); }
.run-history-list { padding: 16px 24px; max-width: 600px; margin: 0 auto; overflow-y: auto; flex: 1; }
.run-history-empty { padding: 48px 24px; text-align: center; opacity: 0.6; }
.run-history-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; margin-bottom: 8px; background: rgba(245,240,224,0.06); border: 1px solid rgba(245,240,224,0.1); border-radius: 8px; gap: 12px; }
.rhi-left { display: flex; align-items: center; gap: 10px; }
.rhi-icon { font-size: 1.5rem; }
.rhi-info { display: flex; flex-direction: column; }
.rhi-name { font-weight: 600; font-size: 0.9rem; }
.rhi-date { font-size: 0.7rem; opacity: 0.5; }
.rhi-right { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.rhi-result { font-size: 0.85rem; font-weight: 600; }
.rhi-detail { font-size: 0.7rem; opacity: 0.6; }

/* ===== Victory Ascension Label ===== */
.victory-ascension { font-family: var(--font-display); font-size: 1.1rem; color: var(--gold); margin-bottom: 16px; }

/* ===== Card Animations ===== */
@keyframes cardPlayAnim { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-40px); opacity: 0; } }
@keyframes cardDrawAnim { 0% { transform: translateX(60px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
.card-play-anim { animation: cardPlayAnim 0.3s ease-out forwards; }
.card-draw-anim { animation: cardDrawAnim 0.3s ease-out; }

/* ===== Mobile Optimizations (Phase 3) ===== */
@media (max-width: 480px) {
  .deck-viewer { width: 95%; max-height: 85vh; }
  .deck-viewer-card { font-size: 0.7rem; padding: 4px 6px; }
  .dvc-desc { display: none; }
  .run-history-item { flex-direction: column; gap: 6px; }
  .rhi-right { text-align: left; }
  .stats-char-row { padding: 6px 8px; }
}
