:root {
  --ink: #ecf0d8;
  --muted: #9fae96;
  --lime: #d9f45f;
  --lime-dark: #98b43c;
  --forest: #14261d;
  --forest-2: #1b3025;
  --cream: #f0ecd7;
  --rust: #d76c42;
  --line: rgba(231, 240, 210, .13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 3%, rgba(126, 154, 79, .12), transparent 27rem),
    radial-gradient(circle at 93% 35%, rgba(78, 115, 82, .11), transparent 32rem),
    #101c16;
  font-family: "DM Sans", system-ui, sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.page-shell { width: min(1380px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border: 1px solid rgba(217, 244, 95, .7); color: var(--lime);
  display: grid; place-items: center; transform: rotate(45deg); border-radius: 5px;
}
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand strong { display: block; font: 900 19px/1 "Fraunces", serif; letter-spacing: .12em; }
.brand small { display: block; margin-top: 5px; font: 700 8px/1 "DM Sans", sans-serif; letter-spacing: .32em; color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; }
.icon-button {
  width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.025);
  display: grid; place-items: center; color: var(--muted); cursor: pointer; transition: .2s ease;
}
.icon-button:hover { color: var(--lime); border-color: rgba(217,244,95,.4); transform: translateY(-1px); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main { padding: 72px 0 32px; }
.hero-copy { display: grid; grid-template-columns: 1fr 370px; align-items: end; gap: 60px; margin: 0 auto 52px; width: min(1180px, 100%); }
.eyebrow { color: var(--lime); font-size: 10px; font-weight: 800; letter-spacing: .22em; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.eyebrow span { width: 22px; height: 1px; background: currentColor; display: inline-block; }
.eyebrow.center { justify-content: center; }
h1, h2 { font-family: "Fraunces", Georgia, serif; }
h1 { font-size: clamp(44px, 5vw, 76px); line-height: .98; letter-spacing: -.04em; margin: 0; max-width: 780px; }
h1 em { color: var(--lime); font-weight: 700; }
.intro { color: var(--muted); font: 500 14px/1.75 "DM Sans", sans-serif; margin: 0 0 5px; border-left: 1px solid rgba(217,244,95,.45); padding-left: 24px; }

.game-card { background: #1a2a21; box-shadow: 0 30px 100px rgba(0,0,0,.28); border: 1px solid rgba(245,247,218,.13); border-radius: 4px; overflow: hidden; }
.game-toolbar { min-height: 122px; padding: 15px 22px; display: flex; gap: 19px; align-items: stretch; background: linear-gradient(180deg, #22362a, #1b2e24); border-bottom: 1px solid rgba(255,255,255,.09); }
.resource-pill { width: 118px; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; border-right: 1px solid var(--line); }
.resource-pill strong { display: block; font: 800 24px/1 "Fraunces", serif; }
.resource-pill small { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .2em; margin-top: 5px; }
.resource-orb { width: 34px; height: 34px; border-radius: 50%; position: relative; background: radial-gradient(circle at 36% 31%, #f7ffb0 0 9%, #d9f45f 24%, #789d34 75%); box-shadow: 0 0 25px rgba(217,244,95,.26); }
.resource-orb::before, .resource-orb::after, .resource-orb i::before, .resource-orb i::after { content:""; position: absolute; width: 5px; height: 5px; background: var(--lime); transform: rotate(45deg); opacity:.7; }
.resource-orb::before { left:-7px; top:7px; }.resource-orb::after { right:-6px; top:19px; }.resource-orb i::before { top:-7px; left:20px; }.resource-orb i::after { bottom:-6px; left:8px; }

.plant-tray { display: flex; flex: 1; gap: 10px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 1px; }
.plant-card {
  min-width: 138px; flex: 1; max-width: 190px; position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid rgba(255,255,255,.13); border-radius: 3px; background: #263d2e; color: var(--ink); cursor: pointer;
  transition: .2s ease; box-shadow: inset 0 0 30px rgba(0,0,0,.08); text-align: left; padding: 7px 9px;
}
.plant-card:hover:not(.disabled) { border-color: rgba(217,244,95,.56); transform: translateY(-2px); }
.plant-card.selected { border: 2px solid var(--lime); background: #304a33; box-shadow: 0 0 0 2px rgba(217,244,95,.08), inset 0 0 30px rgba(217,244,95,.05); }
.plant-card.disabled { filter: saturate(.4); opacity: .48; cursor: not-allowed; }
.card-cost { position: absolute; right: 25px; top: 8px; font: 800 12px/1 "DM Sans", sans-serif; }
.mini-orb { position: absolute; right: 10px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px rgba(217,244,95,.4); }
.plant-name { position: absolute; z-index: 3; left: 8px; bottom: 6px; right: 7px; font-size: 8px; letter-spacing: .1em; font-weight: 800; color: #dce4c8; }
.cooldown-mask { position:absolute; z-index:4; inset:0; transform-origin: bottom; background: rgba(7,14,10,.68); pointer-events:none; transform:scaleY(0); }

.plant-art { position: absolute; width: 53px; height: 55px; left: 50%; top: 46%; transform: translate(-50%,-50%); }
.plant-art::after { content:""; position:absolute; width:7px; height:25px; background:#678943; border-radius:8px; left:25px; top:28px; box-shadow: -11px 8px 0 -2px #809d4e, 11px 5px 0 -2px #4e763f; }
.plant-art i, .plant-art b { position:absolute; display:block; }
.sprout-art i { width:36px; height:31px; left:8px; top:5px; background:#8ec348; border-radius:50% 45% 45% 50%; box-shadow: inset -7px -5px 0 #669934; }
.sprout-art i::after { content:""; position:absolute; right:-11px; top:9px; border-left:13px solid #7cae3e; border-top:7px solid transparent; border-bottom:7px solid transparent; }
.sprout-art b { width:6px; height:6px; background:#18251c; border-radius:50%; left:28px; top:13px; box-shadow:-13px 1px 0 -2px #cde875; }
.bloom-art i { width:26px; height:26px; border-radius:50%; background:#7b4d25; left:13px; top:9px; box-shadow:0 -12px 0 -4px #f1bd4f, 0 12px 0 -4px #e6a43b, -12px 0 0 -4px #f0ba43, 12px 0 0 -4px #d89835, -9px -9px 0 -4px #ffd25b, 9px 9px 0 -4px #d79332, 9px -9px 0 -4px #f5c24a, -9px 9px 0 -4px #eaae39; }
.bloom-art b { width:4px;height:4px;background:#1e251c;border-radius:50%;left:20px;top:18px;box-shadow:9px 0 #1e251c; }
.bulb-art i { width:42px; height:41px; left:5px; top:1px; border-radius:48% 48% 46% 46%; background:#9a6d42; box-shadow:inset -8px -5px #715238, inset 5px 5px #b78a59; }
.bulb-art b { width:5px;height:7px;border-radius:50%;left:17px;top:16px;background:#302820;box-shadow:16px 0 #302820; }
.bulb-art b::after { content:"";position:absolute;width:12px;height:6px;border-bottom:2px solid #4a382b;border-radius:50%;left:4px;top:9px; }
.frost-art i { width:37px; height:33px; left:7px; top:4px; background:#86c9bb; border-radius:50% 42% 45% 50%; box-shadow:inset -8px -5px #4e978d; }
.frost-art i::after { content:"";position:absolute;right:-12px;top:9px;border-left:14px solid #72baae;border-top:7px solid transparent;border-bottom:7px solid transparent; }
.frost-art b { width:7px;height:7px;border-radius:50%;left:27px;top:13px;background:#153331;box-shadow:-13px -6px 0 -2px #d5fff2; }

.shovel-button { width:94px; flex:0 0 auto; background:transparent; border:1px dashed rgba(255,255,255,.17); color:var(--muted); cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; border-radius:3px; transition:.2s; }
.shovel-button svg { width:26px; height:26px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round; }
.shovel-button span { font-size:7px;letter-spacing:.15em;font-weight:800; }
.shovel-button:hover,.shovel-button.active { color:#efcf96;border-color:#efcf96;background:rgba(239,207,150,.07); }

.canvas-wrap { position:relative; width:100%; background:#233a26; aspect-ratio:1200/650; min-height:390px; overflow:hidden; }
#gameCanvas { width:100%; height:100%; display:block; cursor:crosshair; touch-action:none; }
.canvas-vignette { position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 85px rgba(6,16,9,.5); }
.toast { position:absolute;z-index:7;left:50%;top:18px;transform:translate(-50%,-10px);padding:9px 16px;background:rgba(14,28,20,.9);border:1px solid rgba(217,244,95,.3);color:#eaf0cf;font-size:11px;font-weight:700;letter-spacing:.04em;opacity:0;transition:.25s;pointer-events:none;white-space:nowrap; }
.toast.show { opacity:1;transform:translate(-50%,0); }

.start-overlay,.pause-overlay,.end-overlay { position:absolute;z-index:6;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:radial-gradient(circle,rgba(28,52,36,.86),rgba(7,18,11,.94));backdrop-filter:blur(3px);padding:24px;transition:.35s ease; }
.start-overlay.hidden,.pause-overlay.hidden,.end-overlay.hidden { opacity:0;visibility:hidden;pointer-events:none; }
.overlay-emblem { width:58px;height:58px;border:1px solid var(--lime);transform:rotate(45deg);display:grid;place-items:center;margin-bottom:25px;color:var(--lime);box-shadow:0 0 35px rgba(217,244,95,.08); }
.overlay-emblem span { transform:rotate(-45deg);font-size:20px; }
.start-overlay h2,.pause-overlay h2,.end-overlay h2 { font-size:clamp(36px,4vw,58px);letter-spacing:-.03em;margin:0 0 12px; }
.start-overlay>p:not(.eyebrow),.pause-overlay>p:not(.eyebrow),.end-overlay>p:not(.eyebrow) { color:#a8b49f;font-size:14px;line-height:1.6;margin:0 0 26px; }
.start-overlay small { color:#718477;font-size:9px;letter-spacing:.08em;margin-top:18px; }
.primary-button { min-width:210px;height:50px;padding:0 22px;border:0;background:var(--lime);color:#1b281d;font-size:10px;font-weight:900;letter-spacing:.15em;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:18px;box-shadow:0 10px 32px rgba(0,0,0,.2);transition:.2s; }
.primary-button:hover { background:#ecff84;transform:translateY(-2px);box-shadow:0 14px 36px rgba(0,0,0,.3); }
.primary-button svg { width:16px;fill:none;stroke:currentColor;stroke-width:2; }
.end-icon { color:var(--lime);font-size:30px;margin-bottom:15px; }
.end-stats { display:flex;align-items:center;gap:24px;margin-bottom:27px; }
.end-stats span { min-width:62px; }.end-stats strong { display:block;font:800 23px/1 "Fraunces",serif; }.end-stats small { display:block;color:#829184;font-size:7px;letter-spacing:.14em;margin-top:6px; }.end-stats i { width:1px;height:30px;background:var(--line); }

.game-status { height:70px;display:flex;align-items:center;padding:0 25px;gap:21px;background:#17271f;border-top:1px solid rgba(255,255,255,.08); }
.wave-copy { display:flex;align-items:center;gap:11px;white-space:nowrap; }.wave-copy>span { font-size:8px;letter-spacing:.15em;color:var(--muted);font-weight:800; }.wave-copy strong { font:800 17px/1 "Fraunces",serif; }.wave-copy b { font:inherit; }.wave-copy b:first-child{color:var(--lime);}
.progress-track { height:5px;position:relative;background:#0e1c16;flex:1;border-radius:2px;box-shadow:inset 0 1px 3px rgba(0,0,0,.45); }
.progress-fill { position:absolute;left:0;top:0;bottom:0;width:0;background:linear-gradient(90deg,#79963c,var(--lime));border-radius:2px;box-shadow:0 0 10px rgba(217,244,95,.2);transition:width .25s; }
.progress-track>i { position:absolute;top:-3px;width:1px;height:11px;background:#677363; }
.enemy-marker { position:absolute;left:0;top:50%;transform:translate(-50%,-55%);color:#e4e4cf;font-size:19px;transition:left .25s;filter:drop-shadow(0 1px 1px #000); }
.status-tip { color:#66796d;font-size:8px;font-weight:700;letter-spacing:.06em;white-space:nowrap; }.status-tip span{margin:0 5px;}.status-tip kbd{border:1px solid rgba(255,255,255,.17);padding:3px 5px;border-radius:2px;font:inherit;color:#9eac9d;}

.field-notes { width:min(1180px,100%);margin:68px auto 54px;display:grid;grid-template-columns:32px 1fr 1px 32px 1fr 1px 32px 1fr;gap:18px;align-items:start; }
.note-index { width:29px;height:29px;border:1px solid rgba(217,244,95,.4);display:grid;place-items:center;color:var(--lime);font:800 9px/1 "DM Sans";transform:rotate(45deg); }
.note-index::first-line { transform:rotate(-45deg); }.field-notes strong { font-size:9px;letter-spacing:.13em; }.field-notes p{font-size:11px;line-height:1.55;color:#76887c;margin:7px 0 0;}.note-line{height:46px;background:var(--line);}
.page-footer { height:73px;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;color:#4e6457;font-size:7px;font-weight:800;letter-spacing:.14em; }

@media (max-width: 900px) {
  .page-shell{width:min(100% - 24px,1380px)} main{padding-top:45px}.hero-copy{grid-template-columns:1fr;gap:22px}.intro{max-width:520px}.resource-pill{width:96px}.game-toolbar{padding:12px;gap:10px}.plant-card{min-width:116px}.shovel-button{width:72px}.field-notes{grid-template-columns:32px 1fr;}.note-line{display:none}.canvas-wrap{min-height:360px;}.status-tip{display:none}
}

@media (max-width: 620px) {
  .page-shell{width:100%}.topbar{padding:0 17px;height:78px}.hero-copy{padding:0 18px;margin-bottom:35px}h1{font-size:42px}.intro{font-size:13px}.game-card{border-left:0;border-right:0}.game-toolbar{flex-wrap:wrap;height:auto}.resource-pill{height:84px}.plant-tray{order:1;flex-basis:100%;}.plant-card{height:89px;min-width:120px}.shovel-button{height:84px;margin-left:auto}.canvas-wrap{aspect-ratio:auto;height:465px;min-height:0}#gameCanvas{object-fit:fill}.game-status{height:61px;padding:0 14px}.field-notes{padding:0 20px;margin-top:50px}.page-footer{padding:0 17px}.page-footer span:first-child{display:none}.topbar-actions{gap:4px}
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior:auto!important; transition-duration:.01ms!important; animation-duration:.01ms!important; } }
