:root {
  --ink: #18312b;
  --cream: #f7f2df;
  --paper: #fffdf4;
  --leaf: #2f7b57;
  --deep: #133f35;
  --lime: #a9d86e;
  --sun: #f3c85b;
  --coral: #ee856d;
  --sky: #82c9cf;
  --line: rgba(28, 75, 60, .16);
  --muted: #718078;
  --shadow: 0 24px 70px rgba(25, 58, 45, .18);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
html { scrollbar-width: thin; scrollbar-color: rgba(35,105,74,.3) transparent; }
body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: #e9edda;
  font-family: "Yu Gothic UI", "Hiragino Sans", Meiryo, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 3px solid #e9af3c; outline-offset: 3px; }
.hidden { display: none !important; }

.app {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 20%, rgba(255,255,231,.9), transparent 25%),
    radial-gradient(circle at 91% 62%, rgba(138,198,141,.23), transparent 30%),
    linear-gradient(135deg, #f6f3e3 0%, #edf1de 48%, #dfead5 100%);
}
.app::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .4;
  background-image: radial-gradient(rgba(33,77,57,.13) .7px, transparent .7px);
  background-size: 17px 17px;
  mask-image: linear-gradient(90deg, #000, transparent 35%, transparent 65%, #000);
}
.forest-light { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.forest-light i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #f6d96c; box-shadow: 0 0 18px #f6d96c; opacity: .35; animation: drift 9s ease-in-out infinite; }
.forest-light i:nth-child(1) { left: 6%; top: 18%; }
.forest-light i:nth-child(2) { left: 28%; top: 76%; animation-delay: -3s; }
.forest-light i:nth-child(3) { left: 67%; top: 12%; animation-delay: -6s; }
.forest-light i:nth-child(4) { left: 86%; top: 72%; animation-delay: -1.5s; }
.forest-light i:nth-child(5) { left: 51%; top: 55%; animation-delay: -4.7s; }
@keyframes drift { 50% { transform: translate(14px, -24px) scale(.65); opacity: .12; } }

.topbar {
  position: relative; z-index: 30; min-height: 72px; display: flex; align-items: center; gap: 22px;
  padding: 9px clamp(13px, 3vw, 44px); border-bottom: 1px solid var(--line);
  background: rgba(255,253,244,.77); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0; border: 0; background: transparent; text-align: left; }
.brand-mark { position: relative; width: 44px; height: 44px; display: grid; place-items: center; color: white; }
.brand-mark::before { content: ""; position: absolute; inset: 2px; border-radius: 58% 42% 60% 40% / 47% 58% 42% 53%; background: var(--leaf); transform: rotate(-16deg); box-shadow: inset -7px -6px 0 rgba(10,55,36,.12); }
.brand-mark i { position: absolute; width: 2px; height: 30px; background: rgba(255,255,255,.5); transform: rotate(38deg); }
.brand-mark b { z-index: 1; font-size: 12px; font-weight: 900; }
.brand strong { display: block; font-size: 18px; line-height: 1.05; letter-spacing: .04em; }
.brand small { color: var(--leaf); font-size: 8px; font-weight: 900; letter-spacing: .19em; }
.global-stats { margin-left: auto; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.53); overflow: hidden; }
.global-stats span { min-width: 112px; padding: 8px 15px; border-right: 1px solid var(--line); }
.global-stats span:last-child { border: 0; }
.global-stats small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.global-stats b { font-size: 14px; }
.global-stats b em { color: var(--leaf); font-style: normal; }
.top-actions { display: flex; gap: 7px; }
.circle-button { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.7); color: var(--deep); font-weight: 900; box-shadow: 0 5px 15px rgba(30,60,40,.08); }
.circle-button:hover { transform: translateY(-2px); background: #fff; }

.screen { position: relative; z-index: 2; min-height: calc(100dvh - 72px); }
.start-screen { max-width: 1460px; margin: auto; display: grid; grid-template-columns: minmax(430px, .87fr) minmax(520px, 1.13fr); align-items: center; gap: clamp(26px, 5vw, 84px); padding: clamp(28px, 5vw, 72px); }
.hero-copy { position: relative; z-index: 2; }
.eyebrow { margin: 0 0 16px; color: var(--leaf); font-size: 11px; font-weight: 900; letter-spacing: .18em; }
.eyebrow span { display: inline-block; padding: 6px 11px; border: 1px solid rgba(47,123,87,.28); border-radius: 20px; background: rgba(255,255,255,.46); }
h1 { margin: 0; font-family: Georgia, "Yu Mincho", serif; font-size: clamp(45px, 5.3vw, 80px); font-weight: 500; line-height: 1.14; letter-spacing: -.045em; }
h1 b { color: var(--leaf); font-weight: 700; }
.lead { margin: 25px 0 26px; color: #586c62; font-size: clamp(14px, 1.2vw, 17px); line-height: 2; }
.hero-features { display: flex; width: max-content; max-width: 100%; margin-bottom: 27px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-features article { min-width: 122px; padding: 14px 21px 15px 0; margin-right: 21px; border-right: 1px solid var(--line); }
.hero-features article:last-child { border-right: 0; margin: 0; }
.hero-features span { float: left; margin-right: 7px; color: var(--leaf); font: 700 31px Georgia, serif; line-height: 1; }
.hero-features b, .hero-features small { display: block; }
.hero-features b { font-size: 14px; }
.hero-features small { margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.hero-actions { display: flex; align-items: stretch; gap: 10px; }
.primary-button { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 66px; padding: 9px 25px; border: 0; border-radius: 17px; color: #fff; background: linear-gradient(135deg, #3b8c62, #246849); box-shadow: 0 13px 25px rgba(29,103,68,.23), inset 0 1px 0 rgba(255,255,255,.22); transition: .18s ease; }
.primary-button:hover { transform: translateY(-3px); box-shadow: 0 17px 30px rgba(29,103,68,.3); }
.primary-button > span { font-size: 24px; }
.primary-button b, .primary-button small { display: block; text-align: left; }
.primary-button b { font-size: 16px; }
.primary-button small { margin-top: 2px; opacity: .65; font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.primary-button.compact { min-height: 54px; padding: 8px 28px; }
.ghost-button { min-height: 58px; padding: 10px 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.55); color: var(--deep); font-weight: 800; }
.ghost-button:hover { background: #fff; }
.save-summary { display: flex; align-items: center; gap: 17px; margin-top: 21px; padding-left: 3px; }
.save-summary small, .save-summary b { display: block; }
.save-summary small { color: var(--muted); font-size: 9px; }
.save-summary b { margin-top: 2px; font-size: 13px; }
.save-summary > i { width: 1px; height: 25px; background: var(--line); }
.hero-habitat { position: relative; aspect-ratio: 1 / 1; min-width: 0; border-radius: 50% 50% 47% 53% / 53% 45% 55% 47%; overflow: hidden; background: #dce9ca; box-shadow: var(--shadow), inset 0 0 0 12px rgba(255,255,255,.45); }
.hero-habitat::before { content: ""; position: absolute; z-index: 2; inset: 11px; border: 1px solid rgba(255,255,255,.7); border-radius: inherit; pointer-events: none; }
.hero-habitat canvas { width: 100%; height: 100%; display: block; }
.hero-label { position: absolute; z-index: 3; left: 7%; bottom: 7%; padding: 12px 17px; border-radius: 13px; color: #fff; background: rgba(19,63,53,.83); backdrop-filter: blur(8px); }
.hero-label small, .hero-label b { display: block; }
.hero-label small { color: #ccebb8; font-size: 8px; letter-spacing: .16em; }
.hero-label b { margin-top: 4px; font-family: Georgia, "Yu Mincho", serif; line-height: 1.5; }
.specimen-tag { position: absolute; z-index: 3; padding: 8px 11px; border: 1px solid rgba(28,75,60,.2); border-radius: 8px; background: rgba(255,253,244,.78); color: var(--leaf); font: 10px Georgia, serif; text-align: center; backdrop-filter: blur(7px); }
.specimen-tag b { font-size: 7px; letter-spacing: .12em; }
.tag-a { top: 14%; left: 7%; transform: rotate(-5deg); }
.tag-b { right: 6%; bottom: 22%; transform: rotate(7deg); }
.start-note { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; color: var(--muted); font-size: 10px; }

.play-screen { padding: 20px clamp(14px, 3vw, 42px) 94px; }
.day-strip { max-width: 1390px; margin: 0 auto 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; }
.season-badge { padding: 8px 14px; border-radius: 20px; color: #fff; background: var(--deep); font-size: 12px; font-weight: 800; }
.day-progress { display: grid; grid-template-columns: auto minmax(70px, 1fr) auto; align-items: center; gap: 10px; }
.day-progress small { font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.day-progress > i { height: 5px; border-radius: 8px; background: rgba(44,101,75,.13); overflow: hidden; }
.day-progress > i b { display: block; width: 4%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lime), var(--leaf)); transition: width .45s; }
.day-progress em { min-width: 83px; color: #54685e; font-size: 12px; font-style: normal; font-weight: 800; }
.energy-display { display: flex; align-items: center; gap: 9px; }
.energy-display small { color: var(--muted); font-size: 10px; font-weight: 700; }
#energyPips { display: flex; gap: 5px; }
#energyPips i { width: 19px; height: 19px; display: block; border-radius: 50% 50% 50% 10%; background: var(--lime); transform: rotate(-13deg); box-shadow: inset -3px -3px 0 rgba(31,86,54,.13); transition: .25s; }
#energyPips i.used { background: #d9ddcf; transform: rotate(-13deg) scale(.75); box-shadow: none; }
.play-layout { max-width: 1390px; margin: auto; display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(350px, .64fr); gap: 17px; align-items: stretch; }
.habitat-card, .care-panel { border: 1px solid rgba(34,87,64,.13); border-radius: 23px; background: rgba(255,253,245,.79); box-shadow: 0 17px 50px rgba(36,66,48,.11); backdrop-filter: blur(12px); }
.habitat-card { overflow: hidden; }
.habitat-head { height: 69px; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.habitat-head small { color: var(--leaf); font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.habitat-head h2 { margin: 2px 0 0; font: 700 21px Georgia, "Yu Mincho", serif; }
.variant-chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 16px; color: var(--muted); background: white; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.variant-chip.rare { color: #966519; border-color: rgba(223,168,56,.4); background: #fff4c6; box-shadow: 0 0 18px rgba(243,200,91,.34); }
.canvas-shell { position: relative; min-height: 0; overflow: hidden; background: #c6dbb2; }
.canvas-shell canvas { display: block; width: 100%; aspect-ratio: 820 / 660; max-height: calc(100dvh - 230px); touch-action: manipulation; }
.weather-fx { position: absolute; inset: 0; pointer-events: none; }
.weather-fx.rain { background-image: repeating-linear-gradient(105deg, transparent 0 30px, rgba(210,241,255,.5) 31px 32px, transparent 33px 65px); opacity: .45; animation: rain .4s linear infinite; }
@keyframes rain { to { background-position: -20px 45px; } }
.stage-banner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; background: rgba(16,58,45,.74); backdrop-filter: blur(5px); animation: reveal .45s ease; }
.stage-banner small { color: #d9ef9b; font-size: 10px; font-weight: 900; letter-spacing: .24em; }
.stage-banner b { margin: 7px 0; font: 700 clamp(28px, 4vw, 48px) Georgia, "Yu Mincho", serif; }
.stage-banner span { font-size: 13px; }
@keyframes reveal { from { opacity: 0; transform: scale(1.05); } }
.float-message { position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 12px); padding: 8px 16px; border-radius: 18px; color: white; background: rgba(17,59,46,.88); font-size: 12px; font-weight: 800; opacity: 0; transition: .25s; pointer-events: none; }
.float-message.show { opacity: 1; transform: translate(-50%, 0); }
.life-track { height: 63px; display: flex; align-items: center; justify-content: center; padding: 8px 28px; }
.life-track span { min-width: 58px; color: #9aa399; text-align: center; }
.life-track span i { width: 23px; height: 23px; margin: auto; display: grid; place-items: center; border-radius: 50%; border: 1px solid #cad0c5; font-size: 9px; font-style: normal; font-weight: 900; background: #f2f2e9; }
.life-track span b { display: block; margin-top: 3px; font-size: 9px; }
.life-track span.active, .life-track span.past { color: var(--leaf); }
.life-track span.active i { color: #fff; border-color: var(--leaf); background: var(--leaf); box-shadow: 0 0 0 5px rgba(61,139,93,.12); }
.life-track span.past i { color: #fff; border-color: #8bbf6c; background: #8bbf6c; }
.life-track > em { width: clamp(22px, 5vw, 60px); height: 1px; margin: 0 4px 15px; background: #cfd6c9; }
.care-panel { padding: 15px; }
.insect-summary { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.portrait { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 17px; font-size: 29px; background: linear-gradient(145deg, #edf3d7, #dce9c5); box-shadow: inset 0 0 0 1px rgba(50,100,64,.08); }
.insect-summary small, .insect-summary b, .insect-summary span { display: block; }
.insect-summary small { color: var(--leaf); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.insect-summary b { margin: 2px 0; font-size: 17px; }
.insect-summary span { color: var(--muted); font-size: 10px; }
.insect-summary em { font-style: normal; }
.insect-summary button { width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 10px; color: var(--leaf); background: white; font-weight: 900; }
.growth-block { margin: 12px 2px; }
.growth-block > div { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; }
.growth-block > div b { color: var(--leaf); }
.growth-block > div em { font-style: normal; }
.growth-block > i { height: 8px; display: block; margin: 5px 0; overflow: hidden; border-radius: 8px; background: #e3e7da; }
.growth-block > i b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b7db73, #3f9467); box-shadow: 0 0 9px rgba(59,140,98,.3); transition: width .5s ease; }
.growth-block > small { color: var(--muted); font-size: 9px; }
.condition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.condition-grid > div { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 1px 6px; padding: 7px 9px; border: 1px solid rgba(35,91,62,.09); border-radius: 11px; background: rgba(241,244,226,.66); }
.condition-grid span { grid-row: 1 / 3; font-size: 16px; }
.condition-grid small { color: #66776e; font-size: 9px; font-weight: 800; }
.condition-grid em { font-size: 9px; font-style: normal; font-weight: 900; }
.condition-grid i { height: 4px; overflow: hidden; border-radius: 6px; background: #dce1d5; }
.condition-grid i b { display: block; height: 100%; border-radius: inherit; transition: width .35s; }
#foodFill { background: #ef9874; } #waterFill { background: #69b9c8; } #cleanFill { background: #d2b74e; } #moodFill { background: #d680a6; }
.mission-card { position: relative; margin: 9px 0; padding: 8px 70px 8px 11px; overflow: hidden; border: 1px dashed rgba(63,124,82,.3); border-radius: 11px; background: rgba(228,241,202,.54); }
.mission-card::after { content: ""; position: absolute; right: -19px; top: -23px; width: 70px; height: 70px; border-radius: 50%; background: rgba(161,210,104,.2); }
.mission-card > span { color: var(--leaf); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.mission-card p { margin: 2px 0 0; }
.mission-card p b, .mission-card p small { font-size: 10px; }
.mission-card p small { margin-left: 7px; color: var(--muted); }
.mission-card > em { position: absolute; right: 10px; top: 50%; z-index: 1; transform: translateY(-50%); color: #997119; font-size: 11px; font-style: normal; font-weight: 900; }
.mission-card.done { border-style: solid; background: #edf7d6; }
.care-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.care-actions button { min-height: 56px; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; align-content: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf7; text-align: left; transition: .15s; }
.care-actions button:hover:not(:disabled) { border-color: rgba(47,123,87,.4); transform: translateY(-2px); box-shadow: 0 7px 15px rgba(27,73,49,.1); }
.care-actions button:disabled { opacity: .43; cursor: default; }
.care-actions span { grid-row: 1 / 3; align-self: center; font-size: 21px; }
.care-actions b { font-size: 11px; }
.care-actions small { color: var(--muted); font-size: 8px; }
.day-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.explore-button, .next-button, .release-button { min-height: 49px; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; align-content: center; padding: 7px 10px; border-radius: 12px; text-align: left; }
.explore-button { border: 1px solid rgba(110,90,42,.2); background: #f7ebc7; }
.next-button { border: 0; color: white; background: var(--deep); }
.explore-button span, .next-button span, .release-button span { grid-row: 1 / 3; align-self: center; font-size: 20px; }
.explore-button b, .next-button b, .release-button b { font-size: 10px; }
.explore-button small, .next-button small, .release-button small { opacity: .72; font-size: 8px; }
.explore-button:disabled { opacity: .42; }
.release-button { width: 100%; margin-top: 8px; border: 0; color: white; background: linear-gradient(135deg, #ef8c69, #d8676b); box-shadow: 0 8px 18px rgba(200,78,67,.18); }

.garden-nav { position: fixed; z-index: 28; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; padding: 5px; border: 1px solid rgba(36,90,63,.18); border-radius: 19px; background: rgba(255,253,246,.91); box-shadow: 0 10px 35px rgba(31,65,48,.2); backdrop-filter: blur(14px); }
.garden-nav button { min-width: 100px; padding: 7px 14px; border: 0; border-radius: 14px; color: #809087; background: transparent; }
.garden-nav span, .garden-nav b { display: block; }
.garden-nav span { font-size: 17px; }
.garden-nav b { font-size: 9px; }
.garden-nav button.active { color: white; background: var(--deep); }

.overlay { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(18,46,37,.61); backdrop-filter: blur(9px); overflow-y: auto; }
.overlay-card { position: relative; width: min(910px, 100%); max-height: calc(100dvh - 36px); overflow-y: auto; padding: clamp(24px, 4vw, 44px); border: 1px solid rgba(255,255,255,.7); border-radius: 25px; background: linear-gradient(145deg, #fffef7, #edf1df); box-shadow: 0 30px 90px rgba(12,41,31,.35); animation: cardIn .27s ease; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.overlay-card h2 { margin: 5px 0 8px; font: 700 clamp(27px, 3vw, 39px) Georgia, "Yu Mincho", serif; }
.overlay-card > p:not(.eyebrow) { margin: 0 0 21px; color: #64756b; font-size: 13px; line-height: 1.8; }
.close-button { position: absolute; z-index: 2; right: 15px; top: 15px; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 20px; }
.egg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.egg-option { position: relative; min-height: 178px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.68); text-align: left; overflow: hidden; }
.egg-option:not(:disabled):hover { border-color: #73a96e; transform: translateY(-3px); box-shadow: 0 10px 22px rgba(38,87,57,.11); }
.egg-option:disabled { filter: grayscale(.6); opacity: .64; }
.egg-option > span { width: 57px; height: 57px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 50%; font-size: 30px; background: #edf2d9; }
.egg-option b, .egg-option small, .egg-option em { display: block; }
.egg-option b { font-size: 13px; }
.egg-option small { margin: 5px 0; min-height: 31px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.egg-option em { color: var(--leaf); font-size: 9px; font-style: normal; font-weight: 900; }
.egg-option.locked::after { content: "🔒"; position: absolute; right: 11px; top: 11px; }
.book-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.book-heading p, .book-heading h2 { margin-bottom: 0; }
.book-heading > span { font: 700 17px Georgia, serif; }
.book-heading > span b { color: var(--leaf); font-size: 30px; }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.book-entry { min-height: 147px; padding: 11px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.62); }
.book-entry.unknown { display: grid; place-items: center; color: #aeb6aa; background: rgba(227,231,216,.68); }
.book-entry.unknown b { font: 700 27px Georgia, serif; }
.book-entry > span { float: left; width: 43px; height: 43px; display: grid; place-items: center; margin-right: 8px; border-radius: 12px; font-size: 25px; background: #eaf0d7; }
.book-entry.rare { border-color: #d9b759; background: linear-gradient(135deg, #fffdf4, #fff2bd); }
.book-entry small, .book-entry b { display: block; }
.book-entry small { color: var(--leaf); font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.book-entry b { margin-top: 3px; font-size: 11px; }
.book-entry p { clear: both; padding-top: 8px; margin: 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.book-entry em { display: inline-block; margin-top: 7px; padding: 3px 6px; border-radius: 8px; color: #8a6b18; background: rgba(238,202,94,.21); font-size: 7px; font-style: normal; font-weight: 900; }
.upgrade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upgrade-item { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.62); }
.upgrade-item > span { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: #e8efd3; font-size: 28px; }
.upgrade-item b, .upgrade-item small { display: block; }
.upgrade-item b { font-size: 13px; }
.upgrade-item small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.upgrade-item button { min-width: 78px; padding: 8px 9px; border: 0; border-radius: 10px; color: white; background: var(--leaf); font-size: 9px; font-weight: 900; }
.upgrade-item button:disabled { color: #7b887e; background: #dce1d6; }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.how-grid article { position: relative; min-height: 128px; padding: 17px 17px 15px 55px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.58); }
.how-grid article > span { position: absolute; left: 15px; top: 17px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--leaf); font: 700 13px Georgia, serif; }
.how-grid b { font-size: 13px; }
.how-grid p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.75; }
.tip-box { margin: 11px 0 18px; padding: 12px 15px; border-radius: 13px; background: #e3edc9; }
.tip-box b { color: var(--leaf); font-size: 11px; }
.tip-box p { margin: 4px 0 0; font-size: 10px; line-height: 1.7; }
.forage-card { width: min(740px, 100%); padding: 21px; }
.forage-head { display: flex; align-items: center; justify-content: space-between; }
.forage-head small { color: var(--leaf); font-size: 8px; font-weight: 900; letter-spacing: .17em; }
.forage-head h2 { margin: 3px 0; font-size: 25px; }
.forage-head > span { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--deep); font-size: 10px; }
.forage-head > span b { font-size: 22px; }
.forage-card > p { margin: 0 0 9px !important; font-size: 10px !important; }
.forage-board { position: relative; height: min(52dvh, 430px); overflow: hidden; border-radius: 18px; background:
  linear-gradient(rgba(255,255,255,.17), transparent),
  radial-gradient(circle at 78% 12%, #f5d87b 0 4%, transparent 5%),
  linear-gradient(#8fc6b1 0 35%, #6ba66c 36% 61%, #5c8551 62% 64%, #85623d 65% 100%); touch-action: manipulation; }
.forage-board::before, .forage-board::after { content: ""; position: absolute; bottom: 20%; width: 52%; height: 45%; border-radius: 50% 50% 0 0; background: rgba(33,108,60,.4); }
.forage-board::before { left: -13%; transform: rotate(15deg); } .forage-board::after { right: -15%; transform: rotate(-19deg); }
.forage-target { position: absolute; z-index: 2; width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,253,232,.86); font-size: 27px; box-shadow: 0 6px 14px rgba(30,70,42,.19); animation: targetPop .16s ease; touch-action: manipulation; }
.forage-target.bad { background: rgba(255,218,171,.94); }
@keyframes targetPop { from { transform: scale(.3) rotate(-20deg); } }
.forage-score { display: flex; justify-content: center; gap: 35px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.forage-score b { color: var(--leaf); font-size: 16px; }
.event-card { width: min(500px, 100%); text-align: center; }
.event-icon { width: 82px; height: 82px; display: grid; place-items: center; margin: auto auto 13px; border-radius: 50%; background: #e4edc9; font-size: 43px; }
.event-card .primary-button { margin: auto; }
.result-card { width: min(720px, 100%); text-align: center; }
.release-scene { position: relative; width: 170px; height: 115px; display: grid; place-items: center; margin: -13px auto 8px; }
.release-scene > span { z-index: 1; font-size: 70px; animation: releaseFly 2s ease-in-out infinite; }
.release-scene i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 13px var(--sun); }
.release-scene i:nth-of-type(1) { left: 12%; top: 58%; }.release-scene i:nth-of-type(2) { right: 9%; top: 28%; }.release-scene i:nth-of-type(3) { right: 27%; bottom: 5%; }
@keyframes releaseFly { 50% { transform: translate(9px,-9px) rotate(4deg); } }
.grade-row { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 12px 0; }
.grade-row small { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.grade-row strong { color: var(--leaf); font: 700 49px Georgia, serif; }
.grade-row span { padding: 5px 8px; border-radius: 9px; color: #7e5e10; background: #f5d978; font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.result-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 15px 0 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.result-stats div { padding: 12px; border-right: 1px solid var(--line); }
.result-stats div:last-child { border: 0; }
.result-stats small, .result-stats b { display: block; }
.result-stats small { color: var(--muted); font-size: 8px; }
.result-stats b { margin-top: 3px; font-size: 14px; }
.result-actions { display: flex; justify-content: center; gap: 9px; }

@media (max-width: 1050px) {
  .global-stats span { min-width: 93px; padding-inline: 11px; }
  .start-screen { grid-template-columns: .9fr 1.1fr; padding-inline: 30px; }
  .play-layout { grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); }
}

@media (max-width: 820px) {
  .topbar { min-height: 62px; padding-block: 7px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand strong { font-size: 15px; }
  .global-stats span { min-width: 0; padding: 6px 8px; }
  .global-stats small { display: none; }
  .global-stats b { font-size: 11px; }
  .top-actions { gap: 4px; }
  .circle-button { width: 35px; height: 35px; }
  .screen { min-height: calc(100dvh - 62px); }
  .start-screen { grid-template-columns: 1fr; padding: 32px 22px 65px; text-align: center; }
  .hero-copy { order: 2; }
  .hero-habitat { width: min(72vw, 440px); margin: auto; }
  .hero-copy .eyebrow { display: none; }
  h1 { font-size: clamp(39px, 9vw, 62px); }
  .lead { margin: 17px auto; }
  .hero-features, .hero-actions, .save-summary { justify-content: center; margin-left: auto; margin-right: auto; }
  .play-screen { padding: 13px 12px 92px; }
  .play-layout { grid-template-columns: 1fr; }
  .canvas-shell canvas { max-height: none; }
  .care-panel { padding: 13px; }
  .egg-grid, .book-grid { grid-template-columns: repeat(2, 1fr); }
  .upgrade-grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .topbar { gap: 8px; }
  .brand > span:last-child small { display: none; }
  .brand strong { font-size: 13px; }
  .global-stats { margin-left: auto; }
  .global-stats span { padding: 6px; }
  .global-stats span:nth-child(3) { display: none; }
  .top-actions .circle-button:first-child { display: none; }
  .hero-habitat { width: min(85vw, 390px); }
  .start-screen { gap: 22px; padding: 24px 16px 68px; }
  h1 { font-size: clamp(35px, 10.2vw, 50px); }
  .lead br { display: none; }
  .hero-features { width: 100%; }
  .hero-features article { min-width: 0; flex: 1; padding: 10px 7px; margin: 0; }
  .hero-features span { float: none; margin: 0; font-size: 25px; }
  .hero-features small { display: none; }
  .hero-actions { flex-direction: column; }
  .save-summary { gap: 10px; }
  .start-note { width: 100%; text-align: center; }
  .day-strip { grid-template-columns: auto 1fr; gap: 8px; }
  .day-progress { gap: 6px; }
  .day-progress > i { display: none; }
  .energy-display { grid-column: 1 / 3; justify-content: center; }
  .habitat-head { height: 58px; padding: 9px 13px; }
  .habitat-head h2 { font-size: 17px; }
  .life-track { height: 57px; padding-inline: 10px; }
  .life-track > em { width: 19px; }
  .condition-grid { gap: 5px; }
  .condition-grid > div { padding: 6px 7px; }
  .garden-nav { width: calc(100% - 22px); justify-content: stretch; bottom: max(7px, env(safe-area-inset-bottom)); }
  .garden-nav button { min-width: 0; flex: 1; }
  .overlay { padding: 9px; }
  .overlay-card { max-height: calc(100dvh - 18px); padding: 25px 15px; border-radius: 19px; }
  .egg-grid, .book-grid { gap: 6px; }
  .egg-option { min-height: 165px; padding: 10px; }
  .egg-option > span { width: 46px; height: 46px; font-size: 25px; }
  .book-entry { min-height: 139px; }
  .how-grid { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .result-stats div:nth-child(2) { border-right: 0; }
  .result-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .result-actions { flex-direction: column; }
}

@media (max-height: 760px) and (min-width: 821px) {
  .play-screen { padding-top: 10px; }
  .day-strip { margin-bottom: 8px; }
  .habitat-head { height: 56px; }
  .life-track { height: 50px; }
  .care-panel { padding: 10px 13px; }
  .portrait { width: 45px; height: 45px; font-size: 24px; }
  .insect-summary { grid-template-columns: 45px 1fr auto; padding-bottom: 8px; }
  .growth-block { margin: 8px 2px; }
  .mission-card { margin: 6px 0; }
  .care-actions button { min-height: 48px; }
  .day-actions { margin-top: 6px; }
}

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