:root {
  color-scheme: light;
  --out: #654529; --panel: #fff7df; --card: #fffdf3;
  --text: #513722; --muted: #82694c; --green: #69c344; --green-d: #3b892e;
  --gold: #ffc641; --ol: 0 2px 0 #fff8; --line: #dbc69a;
}
html { font-size: clamp(12px, min(1.15vw, 2vh), 20px); }
body { background: #e5edc3; font-family: 'Trebuchet MS', 'Malgun Gothic', system-ui, sans-serif; font-weight: 700; }
button { transition: transform .08s, background .15s; }
button:focus-visible { outline: 3px solid #2580b4; outline-offset: 3px; }
button:active { transform: translateY(2px); }
#stage { grid-template-rows: 3.2rem auto 1fr auto auto; padding: .6rem 1.3rem .3rem; }
#bg { background: linear-gradient(#fff4cf55, #fff4cf00 45%, #e0c97422), url('../assets/forest.png') center / cover; }
#bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(140deg, var(--bg1), transparent 60%); opacity: .09; pointer-events: none; }
#rays { display: none; }
#brand { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: .6rem; pointer-events: none; }
#brand img { width: 2.6rem; height: 2.6rem; }
#brand strong { font-size: 1.7rem; letter-spacing: -.05em; color: #4f742a; text-shadow: 0 2px #fff9; }
#brand span { color: #5b733b; font-size: .8rem; margin-left: .8rem; }
#topbar { padding: .5rem 0; gap: .8rem; align-items: center; }
.tb-left { gap: .4rem; }
.icon-btn { width: 2.6rem; height: 2.6rem; background: #fff7dfe8; border: 2px solid #8d7346; border-radius: .8rem; box-shadow: 0 3px #8d7346; color: #6a5436; }
.icon-btn svg { width: 1.5rem; height: 1.5rem; }
.tb-right { background: #fff4cfef; padding: .45rem .75rem; border: 2px solid #d9ac49; border-radius: 1rem; min-width: 9rem; box-shadow: 0 3px #cba54c; }
#coins { color: #754b17; font-size: 2rem; text-shadow: none; gap: .45rem; }
#coins .ico svg { width: 1.8rem; height: 1.8rem; }
#income { font-size: .72rem; color: #82602e; text-shadow: none; }
#income span { white-space: nowrap; }
.goal { background: #fff9e7ef; border: 2px solid #a38650; border-radius: 1rem; box-shadow: 0 3px #a38650; flex-basis: 22rem; padding: .5rem .7rem; color: #654529; }
.goal svg { width: 1.5rem; height: 1.5rem; color: #956b2c; }
.goal .g-title { font-size: .92rem; line-height: 1.25; }
.goal .g-sub { color: #92733b; font-size: .72rem; margin-top: .15rem; }
.goal .g-fill { background: #daeaa8; }
.goal.done { background: #ffcf4b; border-color: #bd811c; box-shadow: 0 3px #bd811c, 0 0 0 4px #ffe18366; animation: pulse 1.7s infinite; }
.goal.done .g-title { color: #624414; text-shadow: none; }
.goal.done .g-sub { color: #805a16; }
#rockZone { padding: .6rem 0 .25rem; gap: .25rem; }
#layerName { gap: .45rem; text-shadow: none; }
#layerName .ln { font-size: 1.5rem; color: #35592b; background: #fff9dfdf; padding: .25rem .9rem; border-radius: 1rem; border: 2px solid #8da96a; box-shadow: 0 3px #657c4766; }
#layerName .rlv, #layerName .ll { background: #fff8deeb; color: #65753c; border: 1px solid #aeb878; padding: .25rem .45rem; font-size: .72rem; }
#layerName .ll { background: #e6f1b9; color: #4e7c2b; }
#forestReadout { position: absolute; top: 9.5rem; left: 1.5rem; font-size: .7rem; color: #536b35; background: #fff8ddce; padding: .2rem .5rem; border-radius: .5rem; z-index: 2; pointer-events: none; }
#rockWrap { padding: .3rem 0; }
#rock { height: 95%; max-height: 27rem; filter: drop-shadow(0 .6rem .2rem #34532122); transform-origin: 50% 86%; }
.tree-state { display: none; }
.tree-state-0 { display: block; }
#rock[data-ck="1"] .tree-state-0, #rock[data-ck="2"] .tree-state-0, #rock[data-ck="3"] .tree-state-0 { display: none; }
#rock[data-ck="1"] .tree-state-1, #rock[data-ck="2"] .tree-state-2, #rock[data-ck="3"] .tree-state-3 { display: block; }
#rock.geode { filter: drop-shadow(0 0 1rem #b098e8); }
#rock.lucky, #rock.sp-gold { filter: drop-shadow(0 0 1.2rem #fff083); }
#rock.sp-crystal { filter: drop-shadow(0 0 1rem #a4e5ff); }
#rock.sp-fossil { filter: drop-shadow(0 0 1rem #ffa0b7); }
#rockZone.locked #rock { filter: brightness(.55) saturate(.35); }
#rockLock { color: #fff4cf; filter: drop-shadow(0 3px #614d34); }
#underRock { gap: .3rem; min-height: 5.4rem; }
#tapHint { color: #3d602b; font-size: .95rem; background: #fff9dce6; padding: .22rem .8rem; border-radius: 1rem; pointer-events: none; }
#hpBar { width: 20rem; max-width: 75vw; height: 1.55rem; background: #d8c9a3; border: 2px solid #6d773b; border-radius: .85rem; box-shadow: 0 3px #ffffff66; }
#hpFill { background: linear-gradient(#a4e66c, #65bc3c); box-shadow: inset 0 3px #cff4a866; border-radius: .7rem; }
#hpText { font-size: .86rem; color: #355a20; text-shadow: 0 1px #f7ffe8; }
#hpText.onehit { color: #75440f; }
#oddsBtn { background: #fff9e1dc; border: 1px solid #aeae77; color: #526f33; font-size: .75rem; box-shadow: 0 2px #a4ab66; }
#combo { height: 1.3rem; font-size: .78rem; color: #54712f; text-shadow: none; }
#combo b { color: #b5611e; font-size: .9rem; }
#combo .c-track { background: #e4deba; border: 1px solid #ad9d56; height: .55rem; width: 5rem; }
#combo .c-fill { background: #ffca3d; }
#luckyBar { top: 2.8rem; font-size: .85rem; padding: .25rem .6rem; border: 2px solid #ac772b; background: #ffdb5b; color: #694819; box-shadow: 0 3px #ac772b; }
#beltWrap { padding: .3rem 0; }
#belt { height: 4.6rem; gap: .6rem; }
.bslot { width: 4.4rem; border: 2px solid #9b7b45; border-radius: .8rem; background: #fff7d9e6; box-shadow: 0 3px #9b7b4566; }
.bslot .bswing { transform-origin: 50% 85%; }
.bslot.empty { height: 3.6rem; border: 2px dashed #9eac6b; border-radius: .8rem; background: #f8f8d688; }
.bslot .b-lv { color: #fffbe9; background: #73a746; border: 1px solid #476927; border-radius: .4rem; font-size: .65rem; text-shadow: none; }
#beltLabel { color: #42612b; font-size: .78rem; text-shadow: 0 1px #ffffbbaa; background: #fff9d3c9; border-radius: 1rem; padding: .2rem .6rem; width: fit-content; margin: .4rem auto 0; white-space: normal; }
#beltLabel b { color: #8b570f; }
#layerNav { padding: .5rem 0; gap: 1rem; }
.nav-btn { width: 2.8rem; height: 2.8rem; border: 2px solid #688741; border-radius: .8rem; box-shadow: 0 3px #688741; background: #f8ffe5; color: #507833; font-size: 1.8rem; padding: 0; }
.nav-btn.nudge { background: #ffdb52; color: #754f18; border-color: #a27d26; box-shadow: 0 3px #a27d26, 0 0 0 4px #ffd14444; }
#layerDots { gap: .45rem; }
#layerDots i { width: .55rem; height: .55rem; border: 1px solid #7e9556; background: #e2e9bc; }
#layerDots i.open { background: #82b853; }
#layerDots i.cur { background: #ffcc49; border-color: #9b7428; transform: scale(1.3); }
#panel { flex: 0 0 27rem; background: #fff4d8; border-left: 4px solid #987348; }
#panelHeading { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem .7rem; color: #74542b; }
#panelHeading strong { font-size: 1.1rem; }
#panelHeading small { font-size: .72rem; color: #92744e; }
#tabs { padding: .4rem .6rem; gap: .35rem; border-bottom: 2px solid #dac497; background: #f0dfb5; }
.tab { background: #fff8e6; border: 2px solid #d5bd8e; border-radius: .7rem; box-shadow: 0 2px #cbb182; color: #8a704a; padding: .6rem .1rem; font-size: .8rem; gap: .3rem; }
.tab svg { width: 1.45rem; height: 1.45rem; }
.tab.on { background: #76c850; border-color: #478c31; box-shadow: 0 2px #478c31; color: #234b1d; text-shadow: none; }
.tab .dot { background: #ffbb37; border: 1px solid #ac7928; width: .55rem; height: .55rem; }
#tabBody { padding: 1rem; background: #fff5de; }
.sec-head { margin-bottom: .65rem; }
#tabBody h3 { color: #79542b; font-size: 1rem; }
.seg { background: #e8d8b4; border: 2px solid #c1a573; border-radius: .7rem; }
.seg button { color: #8b7045; border-radius: .5rem; font-size: .8rem; }
.seg button.on { background: #78b84d; color: #254319; text-shadow: none; }
.upg { background: #fcfff4; border: 2px solid #9bbb71; border-radius: .85rem; box-shadow: 0 3px #acc880; margin-bottom: .7rem; padding: .65rem .6rem; gap: .6rem; }
.upg:not(.off):not(.locked):not(.maxed) { background: #ecfbd4; border-color: #63ac3a; }
.upg:hover { filter: brightness(1.025); }
.upg-ico { background: #e1f0bd; color: #507133; border: 1px solid #bdd297; border-radius: .65rem; width: 2.5rem; height: 2.7rem; flex-basis: 2.5rem; }
.upg-ico svg { width: 1.65rem; height: 1.65rem; }
.upg-name { color: #49632c; font-size: .98rem; }
.upg-name span { font-size: .65rem; color: #8e975d; margin-left: .35rem; }
.upg-desc { color: #626943; font-size: .75rem; line-height: 1.35; margin-top: .2rem; }
.upg-cost { flex-basis: 5.3rem; height: 2.6rem; border: 2px solid #479629; background: linear-gradient(#87d957, #66bd3f); border-radius: .65rem; color: #1e3d15; box-shadow: 0 3px #479629; font-size: .94rem; text-shadow: none; }
.upg-cost svg { width: 1.1rem; height: 1.1rem; color: #84651b; }
.vcard { background: #ffe39a; border: 2px solid #d4ab52; color: #7c5b21; box-shadow: 0 2px #d4ab52; text-shadow: none; }
.vcard small { color: #977033; }
.upg.off, .upg.locked { background: #f5f0e4; border-color: #d7ccb5; box-shadow: 0 3px #e4d9c2; }
.upg.off .upg-cost, .upg.locked .upg-cost { background: #e2d9c4; border-color: #bbae92; color: #907f64; box-shadow: 0 2px #bbae92; text-shadow: none; }
.upg.locked .upg-name, .upg.locked .upg-desc { color: #a59a82; }
.upg.maxed .upg-cost { background: #c6d69b; color: #637445; border-color: #9aad76; text-shadow: none; }
.gup .upg-cost { background: #87c2e1; border-color: #528faa; box-shadow: 0 3px #528faa; }
.explain, .empty-note { font-size: .84rem; line-height: 1.7; color: #886d4a; }
.explain b { color: #598637; }
.grid { gap: .6rem; }
.tcard { border: 2px solid #d8c59f; border-radius: .8rem; background: #fffdf4; padding: .4rem .2rem .5rem; box-shadow: inset 0 -3px var(--rc); }
.tcard.eq { background: #ecf6cf; border-color: #8ebf55; }
.tcard.eq::before { content: '장착'; color: #fff; background: #76ad43; border: 0; border-radius: .5rem; font-size: .55rem; text-shadow: none; top: .5rem; }
.tcard .tc-name { color: #705332; font-size: .67rem; text-shadow: none; }
.tcard .tc-sub { color: #8b7454; font-size: .65rem; }
.tcard .tc-lv { color: #538533; font-size: .68rem; text-shadow: none; }
.tcard .tc-bar { background: #e9dfc7; border: 0; height: .25rem; }
.tcard .tc-craft { background: #eed8ab; color: #8b6435; border: 1px solid #d0b580; box-shadow: none; }
.tcard.unknown img { opacity: .35; filter: grayscale(1); }
.tcard.ultra:not(.unknown) { background: #fff0b4; border-color: #e4b542; }
.tcard.limited:not(.unknown) { background: #f9e6c0; border-color: #d5a54c; }
.tcard.limited-card:not(.unknown) { background: #fff0c8; }
.tcard.ultra:not(.unknown) .tc-name { color: #9a671b; text-shadow: none; }
.odds-row.ultra:not(.unknown), .odds-row.limited { background: #fff0c3; border-color: #d9b253; }
.odds-row.ultra:not(.unknown) .o-name { color: #9a671b; text-shadow: none; }
.odds-row .o-pct { color: #a57225; }
.streak { background: #f4e8be; border: 2px solid #d3b26d; }
.streak b { color: #916a25; }
.streak small { color: #95784b; }
.limited .lim-txt small, .limited .lim-txt span { color: #927141; }
.limited .lim-txt b, .limited .lim-txt em { color: #9d7026; text-shadow: none; }
.tc-stars, .tc-asc { color: #bc8b22; text-shadow: none; }
.badge.got { background: #eef6ce; }
.gemhead { color: #6195b2; text-shadow: none; }
.rainbow { animation: none; }
.statline, .quest, .day, .tier, .odds-row, .badge, .dcard, .limited { background: #fffbed; border-color: #d8c399; border-radius: .7rem; color: #79603d; box-shadow: none; }
.statline, .quest, .odds-row { font-size: .85rem; }
.quest { border: 2px solid #dac69e; padding: .7rem; }
.q-t { font-size: .85rem; }
.q-bar, .bar { border: 1px solid #c9b68e; background: #e8dfc7; border-radius: .6rem; }
.q-bar i, .bar i { background: #92c857; }
.q-bar span, .bar span { color: #695b39; text-shadow: 0 1px #fff; }
.q-claim { background: #e6ddc6; color: #917956; border: 1px solid #c0af8c; box-shadow: none; }
.quest.done .q-claim { background: #ffd149; color: #785219; border-color: #c89a2e; box-shadow: 0 2px #c89a2e; }
.btn { border: 2px solid #74994c; border-radius: .75rem; padding: .6rem 1rem; color: #fff; font-size: .9rem; text-shadow: 0 1px #3c722c; }
.btn.green { background: #7bcc50; color: #264719; text-shadow: none; box-shadow: 0 3px #528f31; }
.btn.gold { background: #ffd050; border-color: #ba8c25; color: #76531c; box-shadow: 0 3px #ba8c25; text-shadow: none; }
.btn.purple { background: #a088dc; border-color: #7761ac; box-shadow: 0 3px #7761ac; }
.btn.grey, .btn.off { background: #e1d7bf; border-color: #b8a888; color: #8e7d5f; text-shadow: none; box-shadow: 0 2px #b8a888; }
.btn.red { background: #e49270; border-color: #b76e4b; box-shadow: 0 3px #b76e4b; }
.btn svg { width: 1.2rem; height: 1.2rem; }
#modal { background: #3d422978; backdrop-filter: blur(3px); }
.sheet { background: #fff6df; border: 3px solid #ad8550; border-radius: 1.25rem; box-shadow: 0 8px #6e522c55, 0 2rem 6rem #29391e55; }
.sheet h2 { color: #78552f; font-size: 1.55rem; text-shadow: none; }
.sheet p { color: #8a6f4c; font-size: .88rem; line-height: 1.65; }
.sheet .close { color: #91704a; background: #ead8b3; border: 1px solid #c6ab7d; box-shadow: none; }
.big-num { color: #a97620; text-shadow: none; }
.toast, #coach { background: #fff9e4; color: #72542e; border: 2px solid #bd985b; border-radius: .9rem; box-shadow: 0 4px #82663355; font-size: .86rem; line-height: 1.6; }
#coach { max-width: 23rem; padding: .6rem .8rem; }
#coach b { color: #45912b; }
#leftCol { top: 13rem; left: .7rem; transform: none; }
.boost, #chestAd, #readyPill { background: #ffdb68; color: #795721; border: 2px solid #bd8f32; border-radius: .8rem; box-shadow: 0 3px #bd8f32; text-shadow: none; }
.boost .b-name, .boost .b-sub { color: #795721; text-shadow: none; }
#readyPill { font-size: .85rem; }
#feed { top: 12.5rem; right: .8rem; }
.feed-line { color: #74512e; background: #fff9e4e6; border: 1px solid #c9ad72; border-radius: .6rem; font-size: .75rem; text-shadow: none; }
.pop-rays { background: radial-gradient(circle, #fff07dbb, transparent 65%); }
.pop-name { color: #fffce6; text-shadow: 2px 2px #664825, -1px -1px #664825, 1px -1px #664825, -1px 1px #664825; font-size: 1.2rem; }
.pop-tag { background: #ffcf4a; color: #795718; border: 1px solid #b9932e; border-radius: .5rem; text-shadow: none; }
.pop-tag.eq { background: #86ca5b; color: #385a22; }
.pop-rar, .pop-odds { background: #fff9dfe0; border-radius: .5rem; color: #7c6241; text-shadow: none; font-size: .8rem; padding: .1rem .4rem; }
.pop-rar .pop-odds { color: #856d46; }
#loader { background: #f1f6d5; gap: 1rem; }
.loader-pick { background: url('../assets/brand.svg') center / contain no-repeat; mask: none; -webkit-mask: none; animation: pulse 1s infinite; }
.loader-text { color: #56872f; font-size: 2rem; text-shadow: none; }
#hook { background: #fff6d7f5; border: 2px solid #c6a14f; border-radius: 1rem; box-shadow: 0 4px #b4965555; color: #7d6236; }
#hook .hk-day { background: #eadcb7; border-color: #ceba87; color: #917041; }
#hook .hk-day.next { background: #b9de79; color: #567831; }

@media (orientation: portrait) {
  html { font-size: clamp(11px, 3.3vw, 14px); }
  #app { flex-direction: column; }
  #stage { flex: 1 1 61%; min-height: 0; padding: .3rem .6rem 0; grid-template-rows: 2.5rem auto 1fr auto auto; }
  #brand img { width: 2rem; height: 2rem; }
  #brand strong { font-size: 1.4rem; }
  #brand span { display: none; }
  #topbar { gap: .4rem; padding: .3rem 0; }
  .icon-btn { width: 2.25rem; height: 2.25rem; }
  .icon-btn svg { width: 1.3rem; height: 1.3rem; }
  .tb-left { gap: .25rem; }
  .tb-right { min-width: 5.8rem; padding: .3rem .4rem; border-radius: .75rem; }
  #coins { font-size: 1.45rem; gap: .2rem; }
  #coins .ico svg { width: 1.2rem; height: 1.2rem; }
  #income { font-size: .6rem; }
  #income .idle { display: block; }
  #income .idle::before { content: ''; }
  .goal { padding: .35rem .4rem; gap: .3rem; border-radius: .7rem; }
  .goal .g-title { font-size: .78rem; }
  .goal .g-sub { font-size: .65rem; }
  .goal svg { width: 1.1rem; height: 1.1rem; }
  #forestReadout { display: none; }
  #rockZone { padding: .4rem 0 0; }
  #layerName .ln { font-size: 1.15rem; padding: .2rem .6rem; }
  #layerName .rlv, #layerName .ll { font-size: .61rem; padding: .18rem .3rem; }
  #rock { max-height: 17rem; }
  #underRock { gap: .18rem; min-height: 4.9rem; }
  #tapHint { font-size: .82rem; }
  #hpBar { width: 17rem; height: 1.35rem; }
  #hpText { font-size: .76rem; }
  #oddsBtn { font-size: .65rem; padding: .15rem .6rem; }
  #combo { height: 1rem; font-size: .65rem; }
  #belt { height: 3rem; gap: .45rem; }
  .bslot { width: 3.6rem; }
  .bslot.empty { height: 2.65rem; }
  #beltLabel { font-size: .64rem; margin-top: .2rem; }
  #layerNav { padding: .4rem 0; }
  .nav-btn { width: 2.2rem; height: 2.2rem; font-size: 1.6rem; }
  #panel { flex: 0 0 38%; min-height: 0; border-left: 0; border-top: 3px solid #a0814c; }
  #panelHeading { display: none; }
  #tabs { padding: .4rem .5rem; gap: .3rem; }
  .tab { padding: .45rem .1rem; flex-direction: row; justify-content: center; gap: .25rem; font-size: .8rem; }
  .tab svg { width: 1.1rem; height: 1.1rem; }
  #tabBody { padding: .7rem; }
  .upg { padding: .6rem; margin-bottom: .6rem; }
  .upg-name { font-size: 1.02rem; }
  .upg-desc { font-size: .81rem; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #leftCol { top: 12rem; left: .5rem; }
  #feed { top: 11.5rem; right: .5rem; max-width: 8rem; }
  #chestAd { width: 4rem; }
  .boost { width: 4rem; }
  #coach { font-size: .8rem; }
}
@media (max-height: 540px) and (orientation: landscape) {
  #brand span, #panelHeading, #forestReadout { display: none; }
  #stage { grid-template-rows: 2rem auto 1fr auto auto; }
  #brand strong { font-size: 1.3rem; }
  #brand img { width: 1.8rem; height: 1.8rem; }
  #belt { height: 2.6rem; }
  #tapHint { display: none; }
  #underRock { min-height: 3.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
