/* Living Grove: quiet scenery, a rich board, and permanent companions. */
:root { --ink:#3d2849; --muted:#66536e; --surface:#fffaf0; --line:#dfd0d9; --purple:#715096; }
body { isolation:isolate; background:#eaf5e8; }
.ambient { display:none; }
.grove-scenery { position:fixed; inset:0; z-index:-1; pointer-events:none; overflow:hidden; }
.grove-scenery svg { width:100%; height:100%; object-fit:cover; }
.grove-scenery::after { content:''; position:absolute; inset:0; background:linear-gradient(#e8f6f066,#fff8ed22 45%,#e1f0df55); }
.header { background:#fffaf0ed; border-color:#d7d7c7; backdrop-filter:blur(12px); }
.brand { color:#432d50; }
.nav-button.active { background:#e5eddb; color:#345b37; }
.wallet-pill,.round-button { background:#fffdf5; border-color:#d9cbd7; }
.wallet-gift { color:#876123; }
.wallet-gift[title="Daily gift"] { box-shadow:0 0 0 3px #f8e1a255; }
.page-heading,.left-rail { display:none; }
main { padding-top:18px; }
.game-layout { grid-template-columns:minmax(380px,600px) minmax(240px,290px); gap:28px; max-width:960px; margin:auto; }
.game-card { background:#fffaf2; border:1px solid #ddced7; box-shadow:0 10px 35px #49345112; }
.game-stats { border-radius:16px; padding:8px; background:#fff3de; }
.moves-stat strong { color:#4a2856; font-weight:800; }
.score-track { background:#e4d9e8; }
.score-track>div { background:linear-gradient(90deg,#ad79c4,#76529b); }
.board-wrap { background:#46284c; border:2px solid #ac81a5; border-radius:21px; box-shadow:inset 0 2px 7px #21122c66,0 4px 0 #39233f,0 8px 20px #36203d20; }
.tile { background:#65436d; border:1px solid #805a8580; box-shadow:inset 0 2px 3px #2e183946; }
.board-row:nth-child(2n) .tile:nth-child(2n),.board-row:nth-child(2n+1) .tile:nth-child(2n+1) { background:#59385f; }
.tile .gem-art { filter:drop-shadow(0 2px 1px #24122c55) saturate(1.1); }
.tile:hover:not(:disabled) { background:#785482; }
.tile.personal { background:#735939!important; border-color:#e3bd63; box-shadow:inset 0 0 0 1px #f5db93,0 1px 2px #21122b55; }
.tile.personal::after { background:#ffdfa2; color:#745019; }
.tile.frost { background:#5b7f98; border-color:#b4e4f4; }
.tile.selected { outline:3px solid #f4d6ff; outline-offset:0; box-shadow:0 0 0 4px #9870b9; z-index:8; }
.tile.hint { outline:3px solid #9be8d8; outline-offset:0; }
.tile:focus-visible { outline-color:#fff5c6; }
.tile.effect-target { background:#a573ab!important; box-shadow:inset 0 0 0 2px #eac8ff; }
.tile.effect-target.effect-evolution-root { background:#498363!important; box-shadow:inset 0 0 0 2px #d6f7b9; }
.tile.effect-source { outline-color:#ffe09a; }
.tile.traveling-seed { outline:3px solid #b9f3a3; outline-offset:0; z-index:7; }
.tile.traveling-seed::before { content:''; position:absolute; left:-2px; bottom:-2px; width:11px; height:15px; border-radius:80% 20% 75% 25%; background:#a7e66f; border:2px solid #fcffda; z-index:6; box-shadow:0 1px 3px #203b2f66; }
.board-feedback { min-height:28px; padding-top:7px; }
.stardust-readout { font-size:13px; }
.evolution-strip { margin:5px 0 9px; border:1px solid #c5d4b6; border-radius:13px; background:#eef5e7; }
.pip-strip-button { display:flex; align-items:center; gap:9px; padding:7px 10px; width:100%; min-height:48px; text-align:left; }
.pip-strip-button>svg { width:34px; height:34px; }
.pip-strip-button>span:not(.gift-state) { flex:1; min-width:0; }
.pip-strip-button b { display:block; font-size:13px; color:#375d3d; }
.pip-strip-button small { display:block; font-size:12px; line-height:1.35; color:#4d6250; margin-top:2px; }
.gift-state { padding:4px 7px; background:#fff8e8; border:1px solid #dbc898; border-radius:20px; font-size:11px; color:#725423; font-weight:700; }
.game-note.quiet-note { display:none; }
.boosters { border-color:#e0d5d7; }
.booster { color:#4c4f46; font-weight:600; }
.booster-art { width:50px; height:47px; background:linear-gradient(#f6ffe9,#e1edcf); border:1px solid #9ab189; border-bottom:3px solid #728f62; box-shadow:0 3px 6px #3b593715; }
.booster-art>svg { color:#567247; }
.booster.active .booster-art { background:#cce7ad; box-shadow:0 0 0 3px #cbe8b1; border-color:#668f4b; }
.booster-count { background:#6e527e; }
.completed-next { display:flex; justify-content:center; margin:10px 0; }
.completed-next:empty { display:none; }
.right-rail { padding-top:52px; }
.spirit-card { background:#fffaf0; border-color:#d9d0cb; }
.spirit-card.type-0 { background:linear-gradient(145deg,#f5faeb,#e4f0dd); }
.spirit-card.type-2 { background:linear-gradient(145deg,#fff4f4,#f7e4eb); }
.spirit-skill { border-color:#d7d8c8; }
.spirit-portrait .evolved-pip-art { width:100%; height:100%; object-fit:contain; }
.primary-button { background:linear-gradient(#6b9a55,#507d40); border:1px solid #456c39; border-bottom:3px solid #36562d; color:#fff; box-shadow:0 3px 8px #35542c15; }
.primary-button:hover:not(:disabled) { background:linear-gradient(#729f5e,#548244); }
.secondary-button { background:#fffaf0; border-color:#cdbaca; }
.modal { background:#fffbf4; border:1px solid #d9c7d4; }
.modal h2 { color:#492a57; }
.modal-hero-gem img,.results-art img { width:100%; height:100%; object-fit:contain; }
.evolution-hero { width:200px; height:200px; margin:10px auto; }
.evolution-hero img { width:100%; height:100%; object-fit:contain; }
.evolution-panel { padding:20px; border:1px solid #c7d6b9; background:#f0f6e8; border-radius:20px; margin:22px 0; }
.evolution-panel h3 { margin:5px 0 10px; color:#36543b; }
.evolution-panel p { font-size:14px; margin:10px 0; }
.evolution-preview { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:16px 0; }
.evolution-preview>div { background:#fffdf4; border:1px solid #dce1cb; border-radius:16px; padding:12px; display:flex; flex-direction:column; align-items:center; }
.evolution-preview img,.evolution-preview svg { width:100%; height:135px; object-fit:contain; }
.evolution-preview b { font-size:14px; color:#5d4967; margin-top:5px; }
.evolution-requirements { list-style:none; padding:0; margin:14px 0; }
.evolution-requirements li { display:flex; gap:8px; align-items:center; font-size:14px; padding:10px 0; color:#61545f; border-top:1px solid #d5dfc8; }
.evolution-requirements b { margin-left:auto; white-space:nowrap; }
.evolution-requirements .done { color:#375f3a; }
.talent-options { display:grid; gap:10px; margin:16px 0; }
.talent-choice { display:flex; align-items:center; text-align:left; width:100%; gap:10px; border:1px solid #c9c9b8; padding:13px; background:#fffdf4; border-radius:14px; min-height:80px; }
.talent-choice.chosen { border:2px solid #73975d; padding:12px; background:#e4f0d8; }
.talent-choice span { flex:1; }
.talent-choice b { display:block; font-size:15px; color:#39533b; }
.talent-choice small { display:block; font-size:13px; line-height:1.4; margin-top:4px; color:#556453; }
.talent-choice em { font-size:12px; font-weight:700; color:#5a733f; font-style:normal; }
.form-choice { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding-top:12px; border-top:1px solid #d4dec7; }
.form-choice>b { margin-right:auto; font-size:14px; }
.form-choice button[aria-pressed="true"] { background:#dceacb; border-color:#8aab73; }
.evolved-pip-art { object-fit:contain; }
.evolved-pip-art.skin-aurora { filter:drop-shadow(0 0 10px #66c9c388); }
.evolved-pip-art.skin-starlight { filter:drop-shadow(0 0 10px #e7bf5288); }
.collection-item .gem img { width:100%; height:100%; object-fit:contain; }
.result-stars { color:#d69b24; text-shadow:0 2px 0 #fff4cf; }
.continue-balance { font-size:14px; color:#615062; }
.purchase-note { color:#685d6b; }
.mobile-nav { background:#fffaf0f5; }
body.playing .mobile-nav { display:none; }
body.playing .toast { bottom:max(20px,env(safe-area-inset-bottom)); }

@media(min-width:901px) and (max-height:900px) {
  main { padding-top:10px; }
  .game-layout { grid-template-columns:minmax(360px,560px) minmax(240px,280px); max-width:868px; }
  .game-card { padding:10px 14px; }
  .board-wrap { max-width:clamp(300px,calc(100dvh - 420px),390px); }
  .game-card:has(.obstacle-goal:nth-child(4)) .board-wrap { max-width:clamp(300px,calc(100dvh - 450px),360px); }
  .game-stats { padding:7px; }
  .evolution-strip { margin:4px 0 7px; }
  .pip-strip-button { padding:5px 8px; min-height:44px; }
  .boosters { padding-top:8px; }
}
@media(min-width:901px) and (max-width:1100px) {
  .nav { display:flex; }
  .nav-button { font-size:0; padding:9px; }
  .nav-button svg { width:20px; height:20px; }
}
@media(max-width:900px) {
  .header { min-height:64px; padding:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left)); }
  main { padding:10px max(12px,env(safe-area-inset-right)) 80px max(12px,env(safe-area-inset-left)); }
  body.playing main { padding-bottom:max(16px,env(safe-area-inset-bottom)); }
  .game-layout { max-width:600px; gap:24px; }
  .level-heading { margin-bottom:7px; min-height:40px; }
  .level-heading h2 { font-size:20px; }
  .game-card { padding:10px 12px; }
  .game-stats { margin-bottom:9px; padding:7px; }
  .board-wrap { max-width:520px; }
  .obstacle-goals { gap:5px; margin-bottom:8px; }
  .obstacle-goal { padding:4px 6px; min-height:30px; font-size:12px; gap:4px; }
  .level-briefing { display:none; }
  .board-feedback { min-height:27px; padding-top:7px; }
  .right-rail { padding-top:0; }
  .below-game { margin-top:5px; }
  .below-game>span { display:none; }
  .below-game .text-button { margin-left:auto; }
  .evolution-strip { margin:4px 0 7px; }
  .boosters { padding-top:8px; }
  .booster { min-height:62px; gap:4px; }
  .evolution-panel { padding:16px; }
}
@media(max-width:520px) {
  .header { min-height:58px; gap:8px; }
  .brand { font-size:23px; gap:5px; }
  .brand small { font-size:8px; letter-spacing:1.3px; margin-top:5px; }
  .brand-mark { width:32px; height:32px; }
  .wallet { gap:4px; }
  .wallet-pill { min-height:38px; min-width:48px; padding:7px; gap:4px; font-size:12px; }
  .wallet-pill svg { width:16px; height:16px; }
  .wallet-gift { display:grid!important; width:38px; height:38px; }
  .wallet-gift svg { width:18px; height:18px; }
  main { padding:7px max(8px,env(safe-area-inset-right)) 80px max(8px,env(safe-area-inset-left)); }
  .level-heading h2 { font-size:18px; }
  .level-heading h2 span { display:none; }
  .world-label { font-size:10px; }
  .game-card { padding:9px; border-radius:20px; }
  .game-stats { grid-template-columns:51px minmax(80px,1fr) 100px; gap:8px; }
  .moves-stat { padding-right:7px; }
  .moves-stat strong { font-size:29px; }
  .moves-stat span { font-size:10px; margin-top:3px; }
  .score-stat>div:first-child { margin-bottom:7px; }
  .score-stat>div>span { font-size:10px; }
  .score-stat strong { font-size:13px; }
  .score-stat small { font-size:11px; }
  .goal-stat>span { font-size:10px; }
  .goal-stat strong { font-size:13px; }
  .board-wrap { padding:4px; border-radius:16px; }
  .game-card:has(.obstacle-goal:nth-child(4)) .board-wrap { max-width:100%; }
  .obstacle-goal { font-size:11px; }
  .obstacle-goal>svg { width:18px; height:18px; }
  .board.size-8,.board.size-9 { --tile-gap:2px; }
  .tile { border-radius:7px; padding:0; }
  .pip-strip-button { padding:6px; gap:6px; min-height:44px; }
  .pip-strip-button>svg { width:30px; height:30px; }
  .pip-strip-button b { font-size:12px; }
  .pip-strip-button small { font-size:11px; }
  .gift-state { font-size:10px; padding:3px 5px; }
  .game-note { min-height:36px; font-size:12px; padding-block:5px; }
  .boosters { gap:16px; }
  .booster { font-size:11px; min-width:72px; }
  .booster-art { width:44px; height:40px; }
  .evolution-preview { gap:10px; }
  .evolution-preview img,.evolution-preview svg { height:110px; }
  .talent-choice { gap:8px; }
  .talent-choice em { display:none; }
}
@media(prefers-reduced-motion:reduce) {
  .tile.hint { outline-color:#9de5d5; }
  .evolution-hero,.evolved-pip-art { animation:none; }
}
@media(forced-colors:active) {
  .tile.traveling-seed { outline:3px dashed Highlight; }
  .talent-choice.chosen { border:3px solid Highlight; }
  .pip-strip-button,.evolution-panel { border:1px solid ButtonText; }
}
