:root {
  color-scheme: dark;
  --ink: #eaf0e7;
  --muted: #9ca8a0;
  --faint: #67766d;
  --dark: #0c1210;
  --panel: #111916;
  --line: rgba(202, 220, 200, .12);
  --lime: #b5ed84;
  --gold: #ffd879;
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { overflow-x: hidden; background: #0b1210; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { color: inherit; font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, #game-canvas:focus-visible { outline: 2px solid rgba(196, 242, 155, .95); outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.app-shell { min-height: 100dvh; isolation: isolate; overflow: hidden; position: relative; }
.screen { display: none; min-height: 100dvh; position: relative; z-index: 1; }
.screen.active { display: flex; animation: appear .48s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.ambient-glow { position: fixed; pointer-events: none; z-index: 0; width: 46vw; height: 46vw; opacity: .13; filter: blur(105px); border-radius: 50%; }
.ambient-glow-one { background: #397a45; left: -31vw; top: 15vh; }
.ambient-glow-two { background: #635134; right: -35vw; bottom: -25vh; }

.title-screen { align-items: center; min-height: 100dvh; background: #0b1210; }
.title-art { position: absolute; inset: 0; background: linear-gradient(118deg, #101813, #243f32 44%, #141b18); background-image: url("assets/hero.png"); background-position: center; background-size: cover; animation: titleDrift 22s ease-in-out infinite alternate; }
@keyframes titleDrift { to { transform: scale(1.06); } }
.title-vignette { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9, 15, 12, .94) 0%, rgba(9, 15, 12, .80) 35%, rgba(9, 15, 12, .34) 65%, rgba(9, 15, 12, .16) 100%), linear-gradient(0deg, rgba(8, 12, 10, .65), transparent 30%); }
.title-copy { position: relative; margin-left: clamp(35px, 10vw, 150px); max-width: 590px; padding: 90px 0; }
.eyebrow, .section-label { color: var(--lime); font-size: 10px; font-weight: 700; letter-spacing: .19em; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 15px var(--lime); }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; }
.title-copy h1 { margin: 30px 0 14px; font-size: clamp(78px, 13vw, 154px); line-height: .78; letter-spacing: -.075em; }
.title-copy h1 span, .wordmark span { color: var(--lime); }
.title-description { margin: 28px 0 32px; color: #d5dbd1; font-family: var(--serif); font-size: clamp(16px, 2vw, 21px); }
.title-actions { display: flex; align-items: center; gap: 12px; }
.button { min-height: 51px; padding: 0 20px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 600; transition: background .2s, color .2s, transform .2s, opacity .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { display: flex; align-items: center; justify-content: space-between; gap: 23px; color: #111911; background: var(--lime); }
.button-primary:hover { background: #caf89f; }
.button-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.button-arrow { font-size: 18px; }
.button-quiet { border-color: var(--line); background: rgba(14, 20, 16, .50); }
.button-quiet:hover { background: rgba(181, 237, 132, .1); }
.title-footer { display: flex; align-items: center; gap: 12px; margin-top: 63px; color: #c1c8bd; font-size: 10px; }
.footer-divider { width: 3px; height: 3px; background: #9ca99b; border-radius: 50%; }
.title-corner { position: absolute; right: 37px; bottom: 32px; color: #d1ddd1; font-size: 9px; letter-spacing: .14em; }
.title-corner span { color: var(--lime); margin: 0 7px; }

.map-screen, .loadout-screen, .game-screen, .modes-screen, .shop-screen, .zen-screen { flex-direction: column; }
.top-bar { width: min(1120px, calc(100% - 64px)); height: 85px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.back-button { border: 0; background: none; color: var(--muted); font-size: 13px; }
.back-button:hover { color: var(--ink); }
.wordmark { font-family: var(--serif); font-size: 17px; }
.icon-button { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, .025); font-size: 15px; }
.icon-button:hover { border-color: rgba(181, 237, 132, .42); color: var(--lime); }
.header-actions, .map-actions { display: flex; align-items: center; gap: 9px; }
.coin-pill { min-height: 35px; padding: 0 12px; border: 1px solid rgba(255, 216, 121, .25); border-radius: 20px; color: var(--gold); background: rgba(157, 120, 45, .1); font-size: 12px; font-weight: 600; white-space: nowrap; }
.map-content { width: min(890px, calc(100% - 64px)); margin: 74px auto 38px; }
.map-content h2, .loadout-intro h2 { margin-top: 13px; font-size: clamp(39px, 6vw, 64px); letter-spacing: -.055em; }
.map-subtitle, .loadout-intro p { color: var(--muted); font-size: 14px; }
.world-list { margin-top: 43px; display: grid; gap: 18px; }
.world-card { overflow: hidden; position: relative; padding: 24px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(135deg, rgba(48, 70, 51, .2), rgba(15, 22, 18, .75)); }
.world-card.locked { opacity: .51; }
.world-card:nth-child(2) { background: linear-gradient(135deg, rgba(43, 65, 85, .25), rgba(15, 22, 18, .8)); }
.world-card:nth-child(3) { background: linear-gradient(135deg, rgba(88, 54, 39, .25), rgba(15, 22, 18, .8)); }
.world-card:nth-child(4) { background: linear-gradient(135deg, rgba(53, 61, 94, .33), rgba(15, 22, 18, .84)); }
.world-card:nth-child(5) { background: linear-gradient(135deg, rgba(120, 66, 38, .34), rgba(15, 22, 18, .85)); }
.world-header { display: flex; align-items: center; justify-content: space-between; }
.world-number { color: var(--lime); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.world-title { margin: 6px 0 3px; font-family: var(--serif); font-size: 26px; }
.world-description { color: var(--muted); font-size: 11px; }
.world-completion { color: var(--muted); font-size: 11px; }
.level-path { display: flex; justify-content: space-between; position: relative; margin: 23px 4px 0; }
.level-path:before { position: absolute; top: 21px; left: 23px; right: 23px; height: 1px; background: var(--line); content: ""; }
.level-node { position: relative; z-index: 1; display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid rgba(173, 197, 171, .24); border-radius: 50%; background: #111916; color: var(--muted); font-size: 11px; }
.level-node.available { color: var(--lime); border-color: var(--lime); box-shadow: 0 0 18px rgba(181, 237, 132, .13); }
.level-node.completed { color: #111911; border-color: var(--lime); background: var(--lime); }
.level-node:disabled { opacity: .54; cursor: not-allowed; }
.map-footer { width: min(890px, calc(100% - 64px)); margin: 0 auto 40px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }

.loadout-content { width: min(790px, calc(100% - 64px)); margin: 63px auto 55px; }
.level-tag { color: var(--muted); font-size: 12px; }
.threat-panel { margin: 29px 0; padding: 17px 19px; border: 1px solid var(--line); border-radius: 8px; background: rgba(30, 39, 33, .38); }
.threat-list { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.terrain-note { margin-top: 11px; color: #b7c89b; font-size: 11px; line-height: 1.5; }
.terrain-note:empty { display: none; }
.threat-item { display: flex; gap: 7px; align-items: center; }
.threat-item span { font-size: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.selection-count { font-size: 12px; color: var(--lime); }
.seed-grid { margin: 17px 0 25px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.seed-card { min-height: 117px; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: rgba(28, 37, 30, .55); }
.seed-card:hover:not(:disabled), .seed-card.selected { border-color: rgba(181, 237, 132, .85); background: rgba(91, 139, 72, .14); }
.seed-card:disabled { opacity: .42; cursor: not-allowed; }
.seed-card.locked-hidden { opacity: .31; }
.seed-card-header { display: flex; align-items: start; justify-content: space-between; }
.plant-glyph { font-size: 29px; }
.seed-cost { color: var(--gold); font-size: 11px; }
.seed-name { display: block; margin: 7px 0 3px; font-size: 12px; font-weight: 600; }
.seed-role { display: block; color: var(--muted); font-size: 10px; }
.start-level-button { min-width: 220px; }

.game-screen { height: 100dvh; min-height: 610px; max-width: 1440px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 58px); }
.game-top { flex: 0 0 75px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.game-level-title { margin-top: 4px; color: var(--muted); font-size: 11px; }
.game-controls { display: flex; gap: 9px; }
.battle-layout { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 19px; padding: 19px 0; }
.seed-tray { flex: 0 0 90px; align-self: stretch; max-height: 640px; margin: auto 0; display: flex; flex-direction: column; gap: 8px; }
.sun-bank { min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(255, 216, 121, .3); border-radius: 8px; background: rgba(153, 118, 42, .13); }
.sun-icon { color: var(--gold); font-size: 17px; }
#sun-count { color: var(--gold); font-size: 20px; font-weight: 700; line-height: 1.1; }
.sun-label { color: #bca875; font-size: 8px; letter-spacing: .13em; }
.battle-seeds { display: flex; flex: 1; flex-direction: column; gap: 7px; overflow-y: auto; scrollbar-width: none; }
.battle-seeds::-webkit-scrollbar { display: none; }
.battle-seed { position: relative; overflow: hidden; flex: 1; min-height: 60px; max-height: 78px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: rgba(29, 40, 31, .8); text-align: center; }
.battle-seed.selected { border-color: var(--lime); background: rgba(105, 155, 83, .21); }
.battle-seed.poor { opacity: .52; }
.battle-seed .plant-glyph { display: block; font-size: 23px; line-height: 1.15; }
.battle-seed .seed-cost { display: block; font-size: 10px; }
.seed-key { position: absolute; top: 4px; left: 6px; color: var(--faint); font-size: 9px; }
.cooldown-mask { position: absolute; right: 0; bottom: 0; left: 0; background: rgba(7, 11, 9, .74); pointer-events: none; transition: height .12s linear; }
.shovel-button { min-height: 53px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 7px; background: rgba(29, 40, 31, .8); font-size: 19px; }
.shovel-button.active { border-color: #f2a07c; color: #f2a07c; }
.shovel-button small { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.board-wrap { position: relative; flex: 0 1 auto; width: min(100%, calc((100dvh - 187px) * 1.72), 1170px); max-height: min(680px, calc(100dvh - 187px)); aspect-ratio: 1.72; border: 1px solid rgba(171, 190, 170, .22); border-radius: 12px; overflow: hidden; background: #17271a; box-shadow: 0 20px 80px rgba(0, 0, 0, .36); }
#game-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: manipulation; }
.wave-announcement { position: absolute; top: 42%; right: 0; left: 0; text-align: center; font-family: var(--serif); font-size: clamp(20px, 4vw, 47px); color: #ffdf90; text-shadow: 0 4px 18px #000; opacity: 0; pointer-events: none; transition: opacity .35s; }
.wave-announcement.visible { opacity: 1; }
.tutorial-hint { position: absolute; right: 15px; bottom: 13px; left: 15px; text-align: center; color: #f1f3e5; text-shadow: 0 2px 8px #000; font-size: 11px; pointer-events: none; opacity: .9; transition: opacity .3s; }
.game-bottom { flex: 0 0 69px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.objective-text, .quit-link { color: var(--muted); font-size: 11px; }
.quit-link { border: 0; background: none; }
.quit-link:hover { color: #f1ad91; }
.wave-track { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; letter-spacing: .07em; }
.wave-progress { position: relative; width: clamp(100px, 19vw, 260px); height: 5px; border-radius: 4px; background: #26342a; }
#wave-fill { width: 0; height: 100%; border-radius: 4px; background: var(--lime); transition: width .35s; }
.wave-marks { position: absolute; inset: 0; display: flex; justify-content: space-evenly; }
.wave-marks i { width: 2px; height: 8px; transform: translateY(-1px); background: #83946d; }

.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: none; align-items: center; justify-content: center; padding: 22px; background: rgba(5, 9, 7, .76); backdrop-filter: blur(8px); }
.modal-backdrop.open { display: flex; }
.modal-card { width: min(490px, 100%); max-height: min(720px, 90dvh); overflow-y: auto; padding: 32px; border: 1px solid rgba(203, 218, 199, .2); border-radius: 13px; background: #131b17; box-shadow: 0 26px 110px rgba(0, 0, 0, .55); }
.modal-card:focus { outline: none; }
.modal-card.wide { width: min(760px, 100%); }
.modal-emblem { margin-bottom: 12px; font-size: 43px; }
.modal-card h2 { font-size: 37px; letter-spacing: -.04em; }
.modal-card > p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.reward-card { display: flex; align-items: center; gap: 13px; margin-top: 20px; padding: 13px; border: 1px solid rgba(181, 237, 132, .35); border-radius: 8px; background: rgba(181, 237, 132, .075); }
.reward-card strong, .reward-card span { display: block; }
.reward-card strong { font-size: 13px; }
.reward-card span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.reward-card .plant-glyph { font-size: 32px; }
.almanac-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.almanac-entry { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(31, 41, 33, .58); }
.almanac-entry h3 { margin: 7px 0 4px; font-size: 16px; }
.almanac-entry p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.almanac-stats { margin-top: 8px; color: var(--gold); font-size: 9px; }
.toast { position: fixed; z-index: 20; right: 26px; bottom: 22px; max-width: 350px; padding: 12px 17px; border: 1px solid var(--line); border-radius: 8px; background: #172019; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }

.modes-content, .shop-content, .zen-content { width: min(925px, calc(100% - 64px)); margin: 73px auto 60px; }
.modes-content h2, .shop-content h2, .zen-content h2 { margin-top: 12px; font-size: clamp(42px, 7vw, 66px); letter-spacing: -.055em; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 38px; }
.mode-card { position: relative; min-height: 178px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; text-align: left; background: linear-gradient(145deg, rgba(49, 70, 51, .33), rgba(15, 20, 17, .9)); }
.mode-card:hover:not(:disabled), .challenge-card:hover:not(:disabled) { border-color: rgba(181, 237, 132, .67); }
.mode-card:disabled, .challenge-card:disabled { opacity: .49; cursor: not-allowed; }
.mode-icon { display: block; font-size: 32px; }
.mode-name { display: block; margin-top: 14px; font-family: var(--serif); font-size: 19px; }
.mode-description { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.mode-lock { position: absolute; top: 17px; right: 15px; color: var(--faint); font-size: 9px; }
.challenge-section { margin-top: 36px; }
.challenge-section h3 { font-size: 24px; }
.challenge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.challenge-card { min-height: 79px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; text-align: left; background: rgba(26, 35, 28, .71); }
.challenge-card strong { display: block; margin-top: 5px; font-size: 11px; }
.challenge-card span { color: var(--muted); font-size: 10px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 35px; }
.shop-item { min-height: 179px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: rgba(27, 37, 30, .72); }
.shop-item-icon { font-size: 28px; }
.shop-item h3 { margin-top: 9px; font-size: 18px; }
.shop-item p { min-height: 29px; margin: 5px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.shop-buy { min-height: 33px; padding: 0 11px; border: 1px solid rgba(255, 216, 121, .4); border-radius: 5px; background: rgba(255, 216, 121, .07); color: var(--gold); font-size: 10px; }
.shop-buy:disabled { opacity: .4; cursor: not-allowed; }
.zen-plants { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; margin-top: 35px; }
.zen-pot { position: relative; min-height: 151px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; background: rgba(32, 49, 34, .59); }
.zen-pot .plant-glyph { font-size: 48px; }
.zen-pot strong { font-size: 10px; }
.zen-pot small { color: var(--muted); font-size: 9px; }
.zen-pot .zen-heart { position: absolute; top: 8px; right: 10px; color: #ed91aa; font-size: 13px; }
.zen-actions { display: flex; gap: 11px; margin-top: 26px; }
.achievement-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.achievement { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 7px; }
.achievement.locked { opacity: .45; }
.achievement b { display: block; font-size: 11px; }
.achievement small { color: var(--muted); font-size: 9px; }
.conveyor-label { padding: 4px 0; text-align: center; color: var(--gold); font-size: 8px; letter-spacing: .12em; }
.boss-health { height: 6px; margin-top: 7px; border-radius: 4px; background: rgba(255, 102, 86, .18); overflow: hidden; }
.boss-health span { display: block; height: 100%; background: #ed806c; }

/* The interface breathes alongside the illustrated, animated battlefield. */
@keyframes gardenGlow { 0%, 100% { opacity: .72; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.14); } }
@keyframes sunlightTurn { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes seedBreathe { 0%, 100% { box-shadow: 0 0 0 rgba(181, 237, 132, 0); } 50% { box-shadow: 0 0 19px rgba(181, 237, 132, .25); } }
@keyframes cardArrive { from { opacity: 0; transform: translateY(17px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes glyphSway { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-4px); } }
@keyframes waveReveal { 0% { opacity: 0; transform: scale(.85) translateY(13px); letter-spacing: .07em; } 22% { opacity: 1; transform: scale(1.05) translateY(0); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.045) translateY(-8px); } }
@keyframes modalArrive { from { opacity: 0; transform: translateY(19px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes progressSheen { from { transform: translateX(-160%); } to { transform: translateX(310%); } }
@keyframes titleSparkle { 0%, 100% { opacity: .22; transform: translate3d(0, 0, 0); } 50% { opacity: .8; transform: translate3d(14px, -22px, 0); } }
@keyframes walletShimmer { 0%, 80%, 100% { border-color: rgba(255, 216, 121, .25); } 88% { border-color: rgba(255, 216, 121, .76); } }

.ambient-glow-one { animation: gardenGlow 9s ease-in-out infinite; }
.ambient-glow-two { animation: gardenGlow 12s ease-in-out 1.6s infinite reverse; }
.status-dot { animation: gardenGlow 2s ease-in-out infinite; }
.title-vignette::after { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle at 67% 26%, rgba(232, 246, 173, .75) 0 1px, transparent 3px), radial-gradient(circle at 79% 48%, rgba(255, 228, 163, .78) 0 2px, transparent 5px), radial-gradient(circle at 53% 69%, rgba(192, 246, 168, .75) 0 1.5px, transparent 4px), radial-gradient(circle at 89% 32%, rgba(225, 246, 176, .7) 0 1px, transparent 3px), radial-gradient(circle at 73% 77%, rgba(255, 218, 143, .78) 0 1.5px, transparent 4px); content: ""; animation: titleSparkle 5.6s ease-in-out infinite; }
.title-copy > * { animation: cardArrive .75s both; }
.title-copy > :nth-child(2) { animation-delay: .1s; }
.title-copy > :nth-child(3) { animation-delay: .19s; }
.title-copy > :nth-child(4) { animation-delay: .28s; }
.title-copy > :nth-child(5) { animation-delay: .37s; }
.world-card, .mode-card, .shop-item, .zen-pot { animation: cardArrive .48s both; }
.world-card:nth-child(2), .mode-card:nth-child(2), .shop-item:nth-child(2), .zen-pot:nth-child(2) { animation-delay: .06s; }
.world-card:nth-child(3), .mode-card:nth-child(3), .shop-item:nth-child(3), .zen-pot:nth-child(3) { animation-delay: .12s; }
.world-card:nth-child(4), .mode-card:nth-child(4), .shop-item:nth-child(4), .zen-pot:nth-child(4) { animation-delay: .18s; }
.world-card:nth-child(5), .mode-card:nth-child(5), .shop-item:nth-child(5), .zen-pot:nth-child(5) { animation-delay: .24s; }
.mode-card, .seed-card, .shop-item, .challenge-card, .level-node, .zen-pot { transition: transform .22s cubic-bezier(.2, .7, .2, 1), border-color .22s, background .22s, box-shadow .22s; }
.mode-card:hover:not(:disabled), .seed-card:hover:not(:disabled), .shop-item:hover, .challenge-card:hover:not(:disabled), .zen-pot:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0, 0, 0, .2); }
.level-node.available { animation: seedBreathe 2.3s ease-in-out infinite; }
.level-node:hover:not(:disabled) { transform: translateY(-3px) scale(1.11); }
.sun-icon { display: inline-block; animation: sunlightTurn 12s linear infinite; }
.sun-bank { position: relative; overflow: hidden; }
.sun-bank::after { position: absolute; inset: -45%; pointer-events: none; background: conic-gradient(from 0deg, transparent, rgba(255, 216, 121, .08), transparent 32%, transparent 67%, rgba(255, 216, 121, .06), transparent); content: ""; animation: sunlightTurn 12s linear infinite; }
.sun-bank > * { position: relative; z-index: 1; }
.battle-seed.selected { animation: seedBreathe 1.35s ease-in-out infinite; }
.battle-seed .plant-glyph, .mode-icon, .zen-pot .plant-glyph { display: block; transform-origin: 50% 82%; animation: glyphSway 3.1s ease-in-out infinite; }
.battle-seed:nth-child(2n) .plant-glyph, .mode-card:nth-child(2n) .mode-icon, .zen-pot:nth-child(2n) .plant-glyph { animation-delay: -.8s; }
.battle-seed:nth-child(3n) .plant-glyph, .mode-card:nth-child(3n) .mode-icon { animation-delay: -1.55s; }
.coin-pill { animation: walletShimmer 5.7s ease-in-out infinite; }
.wave-announcement.visible { animation: waveReveal 2.2s cubic-bezier(.19, .68, .22, 1) both; }
.modal-backdrop.open .modal-card { animation: modalArrive .28s cubic-bezier(.18, .72, .2, 1) both; }
.wave-progress { overflow: hidden; }
#wave-fill { position: relative; overflow: hidden; }
#wave-fill::after { position: absolute; inset: 0; width: 35%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); content: ""; animation: progressSheen 2.4s ease-in-out infinite; }
.button-arrow { transition: transform .2s; }
.button-primary:hover .button-arrow { transform: translateX(4px); }
.audio-settings { display: grid; gap: 21px; margin: 26px 0 4px; }
.audio-setting { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: 12px; }
.audio-setting output { color: var(--lime); font-size: 11px; }
.audio-setting input { grid-column: 1 / -1; width: 100%; accent-color: var(--lime); }
.audio-description { display: grid; gap: 7px; color: var(--muted); font-size: 10px; }

@media (max-width: 720px) {
  .title-copy { margin-left: 28px; margin-right: 22px; }
  .title-footer { flex-wrap: wrap; margin-top: 40px; }
  .title-corner { display: none; }
  .top-bar { width: calc(100% - 34px); height: 68px; }
  .back-button span { display: none; }
  .map-content, .loadout-content { width: calc(100% - 38px); margin-top: 45px; }
  .map-footer { width: calc(100% - 38px); }
  .map-footer { flex-wrap: wrap; gap: 13px; }
  .map-actions { width: 100%; }
  .map-actions .button { min-height: 42px; padding: 0 10px; font-size: 10px; }
  .level-node { width: 27px; height: 27px; font-size: 8px; }
  .level-path:before { top: 13px; }
  .seed-grid { grid-template-columns: repeat(2, 1fr); }
  .modes-content, .shop-content, .zen-content { width: calc(100% - 38px); margin-top: 48px; }
  .mode-grid, .challenge-grid, .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .zen-plants { grid-template-columns: repeat(3, 1fr); }
  .title-actions { flex-wrap: wrap; }
  .title-actions .button { min-height: 42px; padding: 0 12px; font-size: 11px; }
  .battle-coins { min-height: 31px; padding: 0 7px; font-size: 10px; }
  .game-controls { gap: 4px; }
  .game-controls .icon-button { width: 31px; height: 34px; font-size: 13px; }
  .achievement-list { grid-template-columns: 1fr; }
  .game-screen { min-height: 480px; padding: 0 10px; }
  .game-top { flex-basis: 62px; }
  .battle-layout { gap: 8px; }
  .seed-tray { flex-basis: 62px; gap: 5px; }
  .sun-bank { min-height: 57px; }
  #sun-count { font-size: 16px; }
  .battle-seeds { gap: 4px; }
  .battle-seed { min-height: 44px; padding: 3px; }
  .battle-seed .plant-glyph { font-size: 17px; }
  .shovel-button { min-height: 43px; }
  .game-bottom { flex-basis: 60px; }
  .objective-text { display: none; }
  .modal-card { padding: 24px; }
  .almanac-grid { grid-template-columns: 1fr; }
}

@media (max-width: 470px) {
  .game-controls .battle-coins { display: none; }
  .game-level-title { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 720px) and (orientation: portrait) {
  .game-screen { min-height: 100dvh; padding: 0 9px; }
  .game-top { flex-basis: 67px; gap: 7px; }
  .game-brand { min-width: 0; }
  .game-brand .wordmark { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
  .game-level-title { max-width: 126px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
  .battle-layout { flex-direction: column; justify-content: center; align-items: stretch; gap: 11px; padding: 13px 0; }
  .seed-tray { flex: 0 0 auto; align-self: stretch; max-height: none; margin: 0; flex-direction: row; gap: 5px; }
  .sun-bank { flex: 0 0 52px; min-height: 68px; }
  .sun-icon { font-size: 15px; }
  .sun-label { font-size: 7px; }
  .battle-seeds { min-width: 0; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 5px; scroll-snap-type: x mandatory; }
  .battle-seed { flex: 0 0 52px; min-height: 68px; max-height: none; padding: 4px 2px; scroll-snap-align: start; }
  .battle-seed .plant-glyph { font-size: 20px; }
  .battle-seed .seed-cost { font-size: 9px; }
  .shovel-button { flex: 0 0 44px; min-height: 68px; font-size: 16px; }
  .shovel-button small { font-size: 7px; }
  .board-wrap { flex: none; width: 100%; max-height: none; aspect-ratio: 12 / 7; border-radius: 9px; }
  .tutorial-hint { right: 7px; bottom: 7px; left: 7px; font-size: 8px; }
  .game-bottom { flex-basis: 64px; gap: 7px; }
  .wave-track { min-width: 0; gap: 6px; font-size: 8px; }
  .wave-progress { width: clamp(78px, 29vw, 145px); }
  .quit-link { flex: 0 0 auto; font-size: 10px; }
  .toast { right: 12px; bottom: 14px; left: 12px; max-width: none; }
}

@media (max-height: 650px) and (min-width: 721px) {
  .game-top { flex-basis: 54px; }
  .game-bottom { flex-basis: 52px; }
  .battle-layout { padding: 11px 0; }
  .sun-bank { min-height: 58px; }
  .battle-seed { min-height: 45px; }
  .board-wrap { max-height: calc(100dvh - 128px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
