:root {
  --out: #0b2731;
  --panel: #23414a;
  --card: #426456;
  --text: #eee8d9;
  --muted: #a4c8c6;
  --green: #9dbba3;
  --green-d: #426456;
  --gold: #d6b57b;
  --ol: .07em 0 var(--out), -.07em 0 var(--out), 0 .07em var(--out), 0 -.07em var(--out), .05em .05em var(--out), -.05em .05em var(--out), .05em -.05em var(--out), -.05em -.05em var(--out), 0 .14em var(--out);
  --bg1: #d6b57b;
  --bg2: #426456;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: clamp(9px, min(1.45vw, 2.5vh), 22px); height: 100%; }
body {
  height: 100%; overflow: hidden; background: #0b2731; color: var(--text);
  font-family: 'Segoe UI', 'Segoe UI', system-ui, sans-serif; font-weight: 600;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; }
img { -webkit-user-drag: none; pointer-events: none; }
.hidden { display: none !important; }


#app { position: fixed; inset: 0; display: flex;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }


#stage { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto auto; }

#stage > * { min-width: 0; }
#bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, var(--bg1), var(--bg2) 85%); transition: opacity .3s; }
#rays {
  position: absolute; left: 50%; top: 42%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; opacity: .1; pointer-events: none;
  background: repeating-conic-gradient(#eee8d9 0 9deg, transparent 9deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 38%); mask-image: radial-gradient(circle, #000 0, transparent 38%);
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lite #rays { animation: none; }

#topbar { position: relative; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; padding: .7rem .8rem 0; }
.tb-left { display: flex; gap: .45rem; flex: 0 0 auto; }
.icon-btn {
  width: 3rem; height: 3rem; border-radius: .9rem; background: var(--panel); border: .2rem solid var(--out);
  box-shadow: 0 .25rem 0 var(--out); display: grid; place-items: center; transition: transform .08s;
}
.icon-btn svg { width: 1.8rem; height: 1.8rem; }
.icon-btn:active { transform: translateY(.2rem); box-shadow: 0 .05rem 0 var(--out); }

.tb-right { text-align: right; flex: 0 0 auto; min-width: 9rem; }
#coins { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; font-size: 2.3rem; line-height: 1; font-weight: 700; text-shadow: var(--ol); }
#coins .ico svg { width: 2.1rem; height: 2.1rem; display: block; }
#income { font-size: 1.15rem; color: #d6b57b; text-shadow: var(--ol); margin-top: .25rem; }
#income .idle::before { content: ' \B7  '; }

.goal {
  flex: 0 1 22rem; min-width: 0; display: flex; align-items: center; gap: .5rem; padding: .4rem .7rem; text-align: left;
  background: var(--panel); border: .2rem solid var(--out); border-radius: 1rem; box-shadow: 0 .25rem 0 var(--out); position: relative; overflow: hidden;
}
.goal svg { width: 1.9rem; height: 1.9rem; flex: 0 0 auto; position: relative; }
.goal .g-txt { flex: 1; min-width: 0; position: relative; }

.goal .g-title { font-size: 1.05rem; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goal .g-sub { font-size: .85rem; color: var(--muted); }
.goal .g-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #426456; transition: width .3s; }
.goal.done { background: var(--green); animation: pulse 1s infinite; }
.goal.done .g-fill { display: none; }
.goal.done .g-sub { color: #0b2731; }
.goal.done .g-title { text-shadow: var(--ol); }
@keyframes pulse { 50% { transform: scale(1.04); } }



#leftCol { position: absolute; z-index: 3; left: .8rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: .55rem; }
#boosts { display: flex; flex-direction: column; gap: .55rem; }
#chestAd { width: 5.4rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem .2rem .45rem; border-radius: 1rem;
  font-size: .82rem; line-height: 1.05; text-align: center; text-shadow: var(--ol); background: linear-gradient(#d6b57b, #d6b57b); color: #eee8d9;
  border: .2rem solid var(--out); box-shadow: inset 0 -.3rem 0 #426456, 0 .25rem 0 var(--out); animation: chestNudge 2.4s ease-in-out infinite; }
#chestAd svg { width: 2rem; height: 2rem; }
#chestAd small { display: inline-flex; align-items: center; gap: .15rem; font-size: .72rem; }
#chestAd small svg { width: 1rem; height: 1rem; }
#chestAd:active { transform: translateY(.15rem); }
@keyframes chestNudge { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-5deg); } 90% { transform: rotate(5deg); } 95% { transform: rotate(-3deg); } }

#bannerBox { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: none; justify-content: center; align-items: center; padding: .35rem 0;
  background: var(--card); border-top: .2rem solid var(--out); }
#panel.hasbanner #bannerBox { display: flex; }
#panel.hasbanner #tabBody { padding-bottom: calc(50px + 1.6rem); }

@media (orientation: landscape) { #panel.hasbanner { flex-basis: max(25rem, calc(320px + 1.25rem)); } }
.boost {
  width: 5.4rem; padding: .35rem .2rem .3rem; border-radius: 1rem; background: var(--panel); border: .2rem solid var(--out); box-shadow: 0 .25rem 0 var(--out);
  display: flex; flex-direction: column; align-items: center; line-height: 1.05;
}
.boost .b-ico { width: 2.2rem; height: 2.2rem; }
.boost .b-ico svg { width: 100%; height: 100%; }
.boost .b-name { font-size: .95rem; text-shadow: var(--ol); }
.boost .b-sub { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .2rem; }
.boost .b-sub svg { width: 1.1rem; height: 1.1rem; }
.boost.on { background: linear-gradient(#d6b57b, #c29983); animation: glow 1.2s infinite; }
.boost.on .b-sub { color: #eee8d9; }
@keyframes glow { 50% { box-shadow: 0 .25rem 0 var(--out), 0 0 1.2rem #d6b57b; } }


#feed { position: absolute; z-index: 2; right: .8rem; top: 6.2rem; width: 15rem; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; pointer-events: none; }
.feed-line { font-size: .9rem; padding: .15rem .55rem; border-radius: .6rem; background: rgba(20, 18, 46, .62); white-space: nowrap; animation: feedIn .25s; transition: opacity .6s; }
.feed-line b { font-weight: 700; }
@keyframes feedIn { from { transform: translateX(2rem); opacity: 0; } }



#rockZone { touch-action: none; position: relative; z-index: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: .2rem 0 .1rem; }
#layerName { font-size: 1.5rem; text-shadow: var(--ol); letter-spacing: .02em; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .1rem .45rem; line-height: 1.1; }
#layerName .rlv { font-size: .85rem; padding: .05rem .45rem; border-radius: .6rem; background: rgba(20, 18, 46, .55); border: .13rem solid var(--out); color: #9dbba3; letter-spacing: 0; }
#layerName .rlv.max { color: #d6b57b; border-color: #d6b57b; }

#layerName.hl .rlv { animation: pulse .6s infinite; box-shadow: 0 0 .7rem #9dbba3; }
#layerName .ll { font-size: .8rem; padding: .05rem .45rem; border-radius: .6rem; background: #426456; border: .13rem solid var(--out); display: inline-flex; align-items: center; gap: .2rem; letter-spacing: 0; }
#layerName .ll svg { width: .95rem; height: .95rem; }
#rockWrap { flex: 1 1 0; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; }
#rock { height: 96%; max-height: 22rem; aspect-ratio: 200 / 212; transform-origin: 50% 85%; will-change: transform; filter: drop-shadow(0 .5rem .6rem rgba(0, 0, 0, .25)); }
#rock svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ck { display: none; }
#rock[data-ck="1"] .ck1, #rock[data-ck="2"] .ck1, #rock[data-ck="2"] .ck2, #rock[data-ck="3"] .ck { display: block; }
#rockZone.locked #rock { filter: brightness(.35) saturate(.6); }
#rockLock { position: absolute; width: 5rem; height: 5rem; display: none; pointer-events: none; }
#rockLock svg { width: 100%; height: 100%; }
#rockZone.locked #rockLock { display: block; }
#rockZone.locked #hpBar, #rockZone.locked #oddsBtn { display: none; }



#luckyBar { position: absolute; z-index: 4; top: .4rem; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: calc(100% - 1rem); display: flex; align-items: center; gap: .5rem;
  padding: .3rem 1rem .4rem; border-radius: 1rem; background: linear-gradient(#d6b57b, #c29983); border: .2rem solid var(--out);
  box-shadow: 0 .25rem 0 var(--out); color: #0b2731; font-size: 1.2rem; font-weight: 700; white-space: nowrap; animation: luckyPop .3s, pulse .6s .3s infinite; }
#luckyBar svg { width: 1.5rem; height: 1.5rem; }
#luckyBar i { font-style: normal; font-variant-numeric: tabular-nums; }
@keyframes luckyPop { from { transform: scale(.4); opacity: 0; } }
#rock.lucky { filter: drop-shadow(0 0 1.2rem #d6b57b) drop-shadow(0 .5rem .6rem rgba(0,0,0,.25)); animation: luckyRock .5s infinite; }
@keyframes luckyRock { 50% { filter: drop-shadow(0 0 2.2rem #d6b57b) drop-shadow(0 .5rem .6rem rgba(0,0,0,.25)); } }



#combo { display: flex; align-items: center; gap: .45rem; height: 1.5rem; font-size: 1.05rem; text-shadow: var(--ol); }
#combo.off { visibility: hidden; }
#combo .c-track { width: 8rem; height: .8rem; border-radius: .5rem; background: #23414a; border: .16rem solid var(--out); overflow: hidden; }

#combo .c-fill { display: block; width: 100%; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #d6b57b, #c29983); transition: transform .1s linear; }
#combo b { color: #d6b57b; font-size: 1.25rem; }
#combo.hot b { animation: pulse .5s infinite; }

#underRock { display: flex; flex-direction: column; align-items: center; gap: .35rem; min-height: 4.4rem; justify-content: flex-start; }
#hpBar { position: relative; width: 17rem; height: 1.9rem; border-radius: 1rem; background: #23414a; border: .2rem solid var(--out); overflow: hidden; }

#hpFill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; background: linear-gradient(#d6b57b, #c29983); border-radius: .7rem; transition: transform .08s linear; }
#hpText { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.05rem; text-shadow: var(--ol); }
#hpText.onehit { color: #d6b57b; font-size: .95rem; letter-spacing: .02em; }
.chip { font-size: .95rem; padding: .2rem .8rem; border-radius: 1rem; background: rgba(20, 18, 46, .6); display: inline-flex; align-items: center; gap: .3rem; }
.chip svg { width: 1.1rem; height: 1.1rem; }
.chip u { text-decoration: none; color: #9dbba3; }


#beltWrap { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; padding: 0 .6rem .2rem; }

#belt { display: flex; justify-content: center; align-items: flex-end; gap: .5rem; height: 5.4rem; max-width: 100%; }
.bslot { flex: 0 1 4.4rem; min-width: 0; height: 100%; position: relative; display: flex; align-items: flex-end; justify-content: center; }
 
.bslot .bswing { width: 100%; height: 100%; transform-origin: 50% 92%; transform: rotate(-36deg); }
.bslot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bslot .b-lv { position: absolute; bottom: -.2rem; left: 50%; transform: translateX(-50%); font-size: .8rem; padding: 0 .35rem; border-radius: .5rem; background: var(--gold); color: #0b2731; border: .14rem solid var(--out); white-space: nowrap; }
.bslot.empty { border: .2rem dashed rgba(20, 18, 46, .4); border-radius: .9rem; height: 3.6rem; }

.bslot img.rainbow { animation: hue 2.4s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
#beltLabel { margin-top: .5rem; font-size: 1.05rem; text-shadow: var(--ol); display: flex; align-items: center; justify-content: center; gap: .3rem; flex-wrap: wrap; white-space: nowrap; }
#beltLabel svg:not(:first-child) { margin-left: .7rem; }
#beltLabel svg { width: 1.3rem; height: 1.3rem; }
#beltLabel b { color: #d6b57b; }

#layerNav { position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .3rem 0 .6rem; }
.nav-btn { width: 3.2rem; height: 3.2rem; font-size: 2.6rem; line-height: .8; padding-bottom: .35rem; border-radius: 50%; background: #eee8d9; color: #426456; border: .2rem solid var(--out); box-shadow: 0 .25rem 0 var(--out); font-weight: 700; }
.nav-btn:active { transform: translateY(.2rem); box-shadow: 0 .05rem 0 var(--out); }
.nav-btn:disabled { opacity: .35; pointer-events: none; }
.nav-btn.nudge { animation: nudge .7s infinite; background: var(--green); color: #eee8d9; }
@keyframes nudge { 50% { transform: translateX(.35rem) scale(1.08); } }
#layerDots { display: flex; gap: .4rem; align-items: center; }
#layerDots i { width: .8rem; height: .8rem; border-radius: 50%; background: rgba(20, 18, 46, .45); border: .12rem solid var(--out); }
#layerDots i.open { background: #eee8d9; }
#layerDots i.cur { background: var(--gold); transform: scale(1.35); }
#layerDots i.lucky { box-shadow: 0 0 0 .16rem #9dbba3; }

#fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; }
#flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; }
#pops { position: absolute; inset: 0; z-index: 7; pointer-events: none; }

.pop { position: absolute; width: 13rem; margin-left: -6.5rem; text-align: center; animation: popIn 1s both; --dx: 0%; }
.pop img { width: 9rem; height: 9rem; display: block; margin: 0 auto -.4rem; position: relative; }
.pop-name { font-size: 1.5rem; text-shadow: var(--ol); position: relative; line-height: 1.05; }
.pop-rar { font-size: 1.15rem; font-weight: 700; text-shadow: var(--ol); position: relative; text-transform: uppercase; letter-spacing: .05em; }
.pop-odds { font-size: 1rem; text-shadow: var(--ol); position: relative; opacity: .95; }
.pop-rar .pop-odds { font-size: .8em; text-transform: none; letter-spacing: 0; color: #eee8d9; }
.pop-tag { position: absolute; z-index: 1; top: .4rem; right: .2rem; font-size: 1rem; padding: .05rem .5rem; border-radius: .6rem; background: #c29983; border: .15rem solid var(--out); transform: rotate(12deg); animation: pulse .5s infinite; }
.pop-tag.eq { background: var(--green); top: auto; bottom: 4.6rem; right: 0; transform: rotate(-8deg); }
.pop-rays { position: absolute; left: 50%; top: 4.5rem; width: 22rem; height: 22rem; margin: -11rem 0 0 -11rem; border-radius: 50%; opacity: .55; display: none;
  background: repeating-conic-gradient(var(--rc) 0 12deg, transparent 12deg 24deg); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 68%); mask-image: radial-gradient(circle, #000 20%, transparent 68%); animation: spin 5s linear infinite; }
.pop.glow .pop-rays { display: block; }
.pop.big { width: 18rem; margin-left: -9rem; }
.pop.big img { width: 13rem; height: 13rem; }
.pop.big .pop-name { font-size: 2.1rem; }
.pop.big .pop-rar { font-size: 1.9rem; }
.pop.big .pop-odds { font-size: 1.3rem; }
.pop.big .pop-rays { width: 34rem; height: 34rem; margin: -17rem 0 0 -17rem; top: 6.5rem; }
@keyframes popIn {
  0% { transform: translate(var(--dx), 2rem) scale(.2); opacity: 0; }
  14% { transform: translate(var(--dx), -1rem) scale(1.12); opacity: 1; }
  22% { transform: translate(var(--dx), 0) scale(1); }
  80% { transform: translate(var(--dx), -.6rem) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), 5rem) scale(.15); opacity: 0; }
}

.legal { margin: .9rem 0 0; font-size: .85rem; line-height: 1.35; opacity: .62; text-align: center; }
.legal a { color: #a4c8c6; text-decoration: underline; }


#panel { flex: 0 0 25rem; display: flex; flex-direction: column; background: var(--panel); border-left: .25rem solid var(--out); position: relative; z-index: 8; min-height: 0; }
#tabs { display: flex; gap: .3rem; padding: .6rem .6rem 0; }
.tab { flex: 1; padding: .45rem .1rem .4rem; border-radius: .9rem .9rem 0 0; background: #23414a; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .9rem; position: relative; border: .2rem solid var(--out); border-bottom: 0; }
.tab svg { width: 1.7rem; height: 1.7rem; }
.tab.on { background: var(--card); color: #eee8d9; }
.tab .dot { position: absolute; top: .15rem; right: .3rem; width: .9rem; height: .9rem; border-radius: 50%; background: #c29983; border: .15rem solid var(--out); display: none; animation: pulse .8s infinite; }
.tab.notify .dot { display: block; }
#tabBody { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; background: var(--card); border-top: .2rem solid var(--out); padding: .7rem; scrollbar-width: thin; scrollbar-color: #a4c8c6 transparent; overscroll-behavior: contain; touch-action: pan-y; }
#tabBody::-webkit-scrollbar { width: .5rem; }
#tabBody::-webkit-scrollbar-thumb { background: #a4c8c6; border-radius: .3rem; }

.explain { font-size: .95rem; font-weight: 500; line-height: 1.25; color: #a4c8c6; background: #23414a; border: .15rem solid var(--out); border-radius: .8rem; padding: .45rem .6rem; margin-bottom: .6rem; }
.explain b { color: #d6b57b; font-weight: 700; }

.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .55rem; gap: .5rem; }
.sec-head h3 { font-size: 1.15rem; font-weight: 600; }
.sec-head small { color: var(--muted); font-size: .9rem; font-weight: 500; }
.sec-head .mastered { color: #0b2731; background: var(--green); border: .12rem solid var(--out); border-radius: .5rem; padding: 0 .4rem; font-weight: 700; }
.seg { display: flex; background: #23414a; border-radius: .8rem; padding: .2rem; border: .15rem solid var(--out); }
.seg button { padding: .2rem .7rem; border-radius: .6rem; font-size: .95rem; color: var(--muted); }
.seg button.on { background: #a4c8c6; color: #eee8d9; }

.upg { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem; margin-bottom: .5rem; border-radius: 1rem; background: var(--panel); border: .2rem solid var(--out); box-shadow: 0 .2rem 0 var(--out); text-align: left; transition: transform .06s; }
.upg:active { transform: translateY(.15rem); box-shadow: 0 .05rem 0 var(--out); }
.upg-ico { flex: 0 0 3rem; height: 3rem; border-radius: .8rem; background: #23414a; display: grid; place-items: center; }
.upg-ico svg { width: 2.1rem; height: 2.1rem; }
.upg-txt { flex: 1; min-width: 0; }
.upg-name { font-size: 1.1rem; display: flex; gap: .4rem; align-items: baseline; }
.upg-name span { font-size: .85rem; color: var(--gold); }
.upg-desc { font-size: .88rem; color: var(--muted); font-weight: 500; line-height: 1.15; }
.upg-cost { flex: 0 0 6.2rem; height: 2.7rem; border-radius: .8rem; background: var(--green); border: .18rem solid var(--out); box-shadow: inset 0 -.3rem 0 var(--green-d); display: flex; align-items: center; justify-content: center; gap: .25rem; font-size: 1.1rem; text-shadow: var(--ol); padding-bottom: .2rem; }
.upg-cost svg { width: 1.2rem; height: 1.2rem; }
.upg.off .upg-cost { background: #426456; box-shadow: inset 0 -.3rem 0 #426456; color: #a4c8c6; }
.upg.maxed .upg-cost { background: #a4c8c6; box-shadow: inset 0 -.3rem 0 #426456; }
.upg.locked { opacity: .6; }
.upg.locked .upg-ico svg, .upg.locked img { filter: grayscale(1); }
.upg.locked .upg-cost { background: #426456; box-shadow: inset 0 -.3rem 0 #426456; }
.upg.locked .upg-cost svg { width: 1.7rem; height: 1.7rem; }
.upg.bought { animation: bump .18s; }
@keyframes bump { 50% { transform: scale(1.05); } }

.btn { padding: .5rem 1.4rem .7rem; border-radius: 1rem; font-size: 1.3rem; font-weight: 700; text-shadow: var(--ol); border: .2rem solid var(--out); display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn svg { width: 1.5rem; height: 1.5rem; }
.btn.green { background: var(--green); box-shadow: inset 0 -.35rem 0 var(--green-d), 0 .25rem 0 var(--out); }
.btn.purple { background: #b5b4bf; box-shadow: inset 0 -.35rem 0 #b5b4bf, 0 .25rem 0 var(--out); }
.btn.gold { background: #d6b57b; box-shadow: inset 0 -.35rem 0 #426456, 0 .25rem 0 var(--out); }
.btn.grey { background: #426456; box-shadow: inset 0 -.35rem 0 #426456, 0 .25rem 0 var(--out); }
.btn.red { background: #c29983; box-shadow: inset 0 -.35rem 0 #426456, 0 .25rem 0 var(--out); }
.btn:active { transform: translateY(.2rem); }
.btn.off { background: #426456; box-shadow: inset 0 -.35rem 0 #426456, 0 .25rem 0 var(--out); color: #a4c8c6; }


.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; margin-bottom: .9rem; }
.tcard { position: relative; border-radius: .9rem; background: var(--panel); border: .2rem solid var(--out); padding: .2rem .2rem .35rem; text-align: center; overflow: hidden; box-shadow: inset 0 -.25rem 0 var(--rc, #555); }
.tcard img { width: 100%; aspect-ratio: 1; display: block; }
.tcard .tc-name { font-size: .78rem; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.tcard .tc-sub { font-size: .75rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tcard .tc-lv { font-size: .78rem; color: var(--gold); text-shadow: var(--ol); position: relative; }
.tcard .tc-bar { height: .45rem; margin: .15rem .2rem 0; border-radius: .3rem; background: #0b2731; overflow: hidden; }
.tcard .tc-bar i { display: block; height: 100%; background: var(--gold); }
.tcard.eq { background: #426456; }
.tcard.eq::before { content: 'ACTIVE'; position: absolute; z-index: 1; top: .3rem; left: -1.7rem; transform: rotate(-38deg); background: var(--green); font-size: .58rem; padding: 0 1.7rem; border: .1rem solid var(--out); }
.tcard.unknown img { filter: brightness(0); opacity: .3; }
.tcard.unknown { box-shadow: none; }
.tcard.unknown .tc-name { color: var(--muted); }

.tcard.ultra:not(.unknown), .odds-row.ultra:not(.unknown) { background: linear-gradient(135deg, #426456, #b5b4bf, #426456); border-color: #eee8d9; }
.tcard.ultra:not(.unknown) .tc-name, .odds-row.ultra:not(.unknown) .o-name { color: #eee8d9; text-shadow: var(--ol); }

.empty-note { text-align: center; color: var(--muted); padding: 2rem 1rem; font-weight: 500; font-size: 1.05rem; }

.statline { display: flex; justify-content: space-between; padding: .45rem .7rem; border-radius: .7rem; background: var(--panel); margin-bottom: .35rem; font-size: 1rem; }
.statline span:last-child { color: var(--gold); }
.statline em { font-style: normal; color: #9dbba3; }

.rb { text-align: center; }
.rb-ico svg { width: 5rem; height: 5rem; }
.rb h2 { font-size: 1.7rem; text-shadow: var(--ol); }
.rb p { color: var(--muted); font-weight: 500; font-size: .98rem; margin: .3rem 0 .8rem; line-height: 1.25; }
.bar { position: relative; height: 2rem; border-radius: 1rem; background: #0b2731; border: .2rem solid var(--out); overflow: hidden; margin: .8rem 0; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#b5b4bf, #b5b4bf); }
.bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1rem; text-shadow: var(--ol); }


.gemhead { display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: 2.2rem; text-shadow: var(--ol); }
.gemhead svg { width: 2.6rem; height: 2.6rem; }
.gemhead small { font-size: 1rem; color: var(--muted); align-self: flex-end; margin-bottom: .45rem; }
.rb p b { color: #b5b4bf; }
.gup .upg-cost { background: #b5b4bf; box-shadow: inset 0 -.3rem 0 #426456; }
.gup.off .upg-cost { background: #426456; box-shadow: inset 0 -.3rem 0 #426456; color: #a4c8c6; }
.gup.maxed .upg-cost { background: #a4c8c6; box-shadow: inset 0 -.3rem 0 #426456; }

.toast svg, .explain svg, .statline svg, .q-claim svg, .sheet p svg, .sheet h2 svg { width: 1.1em; height: 1.1em; vertical-align: -.18em; }


.statline.shards span:first-child { display: flex; align-items: center; gap: .3rem; }
.statline.shards small { color: var(--muted); font-size: .8rem; font-weight: 500; }
.statline.shards span:last-child { color: #a4c8c6; }
.tcard .tc-craft { position: absolute; top: .25rem; right: .25rem; z-index: 1; display: flex; align-items: center; gap: .1rem; font-size: .68rem; padding: 0 .25rem; border-radius: .4rem; background: rgba(20, 24, 56, .9); border: .1rem solid var(--out); color: #a4c8c6; }
.tcard .tc-craft svg { width: .8rem; height: .8rem; }
.tcard[data-craft] { cursor: pointer; }
.tcard.afford { border-color: #a4c8c6; box-shadow: 0 0 .5rem #a4c8c666; }
.tcard.afford .tc-craft { color: #a4c8c6; border-color: #a4c8c6; }


.statline.lucky-day span:first-child { display: flex; align-items: center; gap: .3rem; }
.statline.lucky-day span:last-child { color: #9dbba3; }
.quest { background: var(--panel); border: .2rem solid var(--out); border-radius: 1rem; padding: .55rem .6rem .6rem; margin-bottom: .5rem; }
.q-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.q-t { flex: 1; font-size: 1.02rem; line-height: 1.15; }
.q-claim { flex: 0 0 auto; min-width: 4.6rem; height: 2.2rem; padding: 0 .5rem; border-radius: .7rem; background: #426456; border: .16rem solid var(--out); box-shadow: inset 0 -.25rem 0 #426456; display: inline-flex; align-items: center; justify-content: center; gap: .2rem; font-size: .95rem; text-shadow: var(--ol); color: #a4c8c6; }
.quest.done .q-claim { background: var(--green); box-shadow: inset 0 -.25rem 0 var(--green-d); color: #eee8d9; animation: pulse .8s infinite; }
.quest.claimed { opacity: .55; }
.q-bar { position: relative; height: 1.3rem; border-radius: .7rem; background: #0b2731; border: .15rem solid var(--out); overflow: hidden; }
.q-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#d6b57b, #d6b57b); transition: width .2s; }
.quest.claimed .q-bar i { background: linear-gradient(#9dbba3, #426456); }
.q-bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; text-shadow: var(--ol); }
.statline.q-bonus span:first-child { display: flex; align-items: center; gap: .3rem; }


#toasts { position: absolute; z-index: 20; left: 0; right: 25rem; top: 4.6rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; pointer-events: none; }
.toast { padding: .35rem 1rem; border-radius: 1rem; background: rgba(20, 18, 46, .88); border: .15rem solid var(--out); font-size: 1.05rem; animation: toast 2.6s both; display: flex; align-items: center; gap: .4rem; }
.toast img { width: 2rem; height: 2rem; }
.toast b { color: #d6b57b; }
@keyframes toast { 0% { transform: translateY(-1rem); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }


#coach { position: absolute; z-index: 25; pointer-events: none; max-width: 17rem; padding: .55rem .8rem; border-radius: 1rem; background: #d6b57b; color: #0b2731; border: .22rem solid var(--out); box-shadow: 0 .3rem 0 var(--out); font-size: 1.05rem; line-height: 1.2; text-align: center; animation: coachIn .25s, coachBob 1.4s .25s infinite; }
#coach b { color: #426456; }
#coach:not(.up):not(.down):not(.right)::after { display: none; }
#coach::after { content: ''; position: absolute; width: .9rem; height: .9rem; background: #d6b57b; border: .22rem solid var(--out); border-top: 0; border-left: 0; transform: rotate(45deg); }
#coach.up::after { top: -.62rem; left: calc(50% - .45rem); transform: rotate(-135deg); }
#coach.down::after { bottom: -.62rem; left: calc(50% - .45rem); }
#coach.right::after { right: -.62rem; top: calc(50% - .45rem); transform: rotate(-45deg); }
@keyframes coachIn { from { transform: scale(.7); opacity: 0; } }
@keyframes coachBob { 50% { transform: translateY(-.35rem); } }

#modal { position: absolute; inset: 0; z-index: 30; background: rgba(10, 9, 30, .72); display: grid; place-items: center; padding: 1rem; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(30rem, 100%); max-height: 100%; overflow-y: auto; background: var(--card); border: .25rem solid var(--out); border-radius: 1.4rem; padding: 1.1rem; text-align: center; box-shadow: 0 .5rem 0 var(--out); animation: sheet .2s; position: relative; }
@keyframes sheet { from { transform: scale(.85); } }
.sheet h2 { font-size: 1.8rem; text-shadow: var(--ol); margin-bottom: .5rem; }
.sheet p { color: var(--muted); font-weight: 500; margin-bottom: .7rem; line-height: 1.25; }
.sheet .big-num { font-size: 2.2rem; color: var(--gold); text-shadow: var(--ol); display: flex; align-items: center; justify-content: center; gap: .4rem; margin: .4rem 0; }
.sheet .big-num svg { width: 2.2rem; height: 2.2rem; }
.sheet .row { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: .9rem; }
.sheet .close { position: absolute; right: .7rem; top: .6rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #c29983; border: .2rem solid var(--out); font-size: 1.3rem; line-height: 1; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; margin: .8rem 0; }
.day { border-radius: .6rem; background: var(--panel); border: .15rem solid var(--out); padding: .3rem .1rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.day svg { width: 1.5rem; height: 1.5rem; }
.day .d-n { font-size: .72rem; color: var(--muted); }
.day .d-r { font-size: .68rem; color: var(--muted); line-height: 1.05; }
.day.done { opacity: .45; }
.day.now { background: var(--green); border-color: var(--out); animation: pulse 1s infinite; }
.day.now .d-n, .day.now .d-r { color: #0b2731; font-weight: 700; }

.finds { display: flex; justify-content: center; gap: .5rem; margin: .6rem 0; }
.finds .tcard { width: 6.5rem; }
.odds-row { display: flex; align-items: center; gap: .6rem; padding: .25rem .6rem; border-radius: .8rem; background: var(--panel); margin-bottom: .3rem; text-align: left; }
.odds-row img { width: 2.8rem; height: 2.8rem; }
.odds-row.unknown img { filter: brightness(0); opacity: .3; }
.odds-row .o-name { flex: 1; font-size: 1.05rem; line-height: 1.1; }
.odds-row .o-name small { display: block; font-size: .8rem; }
.odds-row .o-pct { font-size: 1.05rem; color: var(--gold); text-align: right; }
.odds-row .o-pct small { display: block; font-size: .78rem; color: var(--muted); font-weight: 500; }

#loader { position: absolute; inset: 0; z-index: 50; background: radial-gradient(circle, #426456, #0b2731); display: grid; place-content: center; justify-items: center; gap: 1rem; transition: opacity .35s; }
#app:not(.loading) #loader { opacity: 0; pointer-events: none; }
.loader-pick { width: 5rem; height: 5rem; }
.loader-text { font-size: 2.4rem; text-shadow: var(--ol); }
@keyframes wob { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }


@media (orientation: portrait) {
  html { font-size: clamp(9px, min(3.3vw, 1.72vh), 22px); }
  #app { flex-direction: column; }
  
  #stage { flex: 1 1 64%; }
  #panel { flex: 0 0 36%; border-left: 0; border-top: .25rem solid var(--out); }
  
  #toasts { right: 0; }
  #feed { display: none; }
  .grid { grid-template-columns: repeat(5, 1fr); }
  .goal { flex-basis: 15rem; }
  .tb-right { min-width: 7rem; }
  
  #income { font-size: 1rem; line-height: 1.1; }
  #income span { display: block; }
  #income .idle::before { content: none; }
  .goal .g-title { font-size: .95rem; }
  #coins { font-size: 1.9rem; }
  .boost { width: 4.6rem; }
  #belt { height: 4.6rem; gap: .25rem; }
  .bslot { flex-basis: 3.6rem; }
  .bslot .b-lv { font-size: .7rem; padding: 0 .2rem; }
  #beltLabel { font-size: .92rem; margin-top: .35rem; }
  #beltLabel svg:not(:first-child) { margin-left: .35rem; }
}




#readyPill { position: absolute; z-index: 5; right: .6rem; top: 42%; transform: translateY(-50%); width: 5.4rem; display: flex; flex-direction: column;
  align-items: center; gap: .1rem; padding: .35rem .2rem .45rem; border-radius: 1rem; font-size: .82rem; line-height: 1.05; text-align: center;
  text-shadow: var(--ol); background: #b5b4bf; border: .2rem solid var(--out); box-shadow: inset 0 -.3rem 0 #b5b4bf, 0 .25rem 0 var(--out); animation: pillPulse .9s infinite; }
#readyPill svg { width: 2rem; height: 2rem; }
#readyPill.chest { background: #d6b57b; box-shadow: inset 0 -.3rem 0 #426456, 0 .25rem 0 var(--out); }
@keyframes pillPulse { 50% { transform: translateY(-50%) scale(1.06); } }

#rock.geode { filter: brightness(1.12) saturate(1.35) drop-shadow(0 0 .9rem #b5b4bf) drop-shadow(0 0 2.2rem #b5b4bf); animation: geodeGlow .8s infinite; }
@keyframes geodeGlow { 50% { filter: brightness(1.25) saturate(1.5) drop-shadow(0 0 1.3rem #b5b4bf) drop-shadow(0 0 3rem #b5b4bf); } }
#luckyBar.geo { background: linear-gradient(#b5b4bf, #b5b4bf); color: #eee8d9; text-shadow: var(--ol); }

.streak { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 1rem; background: linear-gradient(90deg, #23414a, #23414a); border: .2rem solid var(--out); margin-bottom: .55rem; }
.streak svg { width: 2.4rem; height: 2.4rem; flex: 0 0 auto; }
.streak b { display: block; font-size: 1.1rem; color: #d6b57b; }
.streak small { display: block; font-size: .82rem; color: #b5b4bf; font-weight: 500; line-height: 1.2; }
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .55rem; }
.dcard { display: flex; flex-direction: column; gap: .3rem; padding: .5rem; border-radius: 1rem; background: var(--panel); border: .2rem solid var(--out); min-width: 0; }
.dc-top { display: flex; align-items: center; gap: .35rem; font-size: 1rem; }
.dc-top svg { width: 1.7rem; height: 1.7rem; flex: 0 0 auto; }
.dcard small { font-size: .76rem; color: var(--muted); font-weight: 500; line-height: 1.2; flex: 1; }
.btn.small { font-size: 1rem; padding: .3rem .6rem .45rem; border-radius: .8rem; }
.limited { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 1rem; margin-bottom: .55rem;
  background: linear-gradient(135deg, #23414a, #426456 70%); border: .2rem solid #d6b57b; }
.lim-img { flex: 0 0 4rem; height: 4rem; }
.lim-img img { width: 100%; height: 100%; }
.lim-img.unknown img { filter: brightness(0); opacity: .45; }
.lim-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.lim-txt small { font-size: .75rem; color: #d6b57b; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.lim-txt b { font-size: 1.2rem; text-shadow: var(--ol); }
.lim-txt span { font-size: .82rem; color: var(--muted); font-weight: 500; }
.lim-txt em { font-style: normal; color: #9dbba3; }
.q-bar.track { height: 1.6rem; margin-bottom: .5rem; }
.q-bar.track i { background: linear-gradient(#d6b57b, #d6b57b); }
.tiers { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; }
.tier { position: relative; aspect-ratio: 1; border-radius: .6rem; background: #23414a; border: .15rem solid var(--out); display: grid; place-items: center; opacity: .55; }
.tier svg { width: 55%; height: 55%; }
.tier span { position: absolute; top: .05rem; left: .25rem; font-size: .62rem; color: var(--muted); }
.tier.got { opacity: 1; background: #426456; }
.tier.got::after { content: '\2713'; position: absolute; bottom: 0; right: .25rem; font-size: .75rem; color: #eee8d9; text-shadow: var(--ol); }
.tier.next { opacity: 1; border-color: var(--gold); box-shadow: 0 0 .4rem #d6b57b99; }
.track-note { font-size: .8rem; color: var(--muted); font-weight: 500; margin: .45rem 0 0; text-align: center; }
.sheet .waiting { color: #d6b57b; font-weight: 600; margin: .35rem 0 0; }
.tcard.limited-card:not(.unknown) { background: linear-gradient(135deg, #23414a, #426456 75%); }
.odds-row.limited { border: .15rem solid #d6b57b; }




#stage.frenzy::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; will-change: opacity;
  box-shadow: inset 0 0 4rem 1.4rem #c29983cc, inset 0 0 9rem 3rem #c2998377; animation: frenzyEdge .5s infinite alternate; }
@keyframes frenzyEdge { from { opacity: .6; } to { opacity: 1; } }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-iteration-count: 1 !important; }
  #stage.frenzy::after { animation: none; opacity: .8; }
}
#combo.charge b { color: #d6b57b; }
#combo.charge .c-fill { background: linear-gradient(90deg, #d6b57b, #c29983); }
#combo.fz { color: #d6b57b; }
#combo.fz b { color: #c29983; }
#combo.fz .c-fill { background: linear-gradient(90deg, #c29983, #d6b57b); transition: none; }


#rock.sp-gold { filter: brightness(1.15) sepia(.35) saturate(1.6) drop-shadow(0 0 1.3rem #d6b57b); }
#rock.sp-crystal { filter: brightness(1.12) drop-shadow(0 0 1.3rem #a4c8c6) drop-shadow(0 0 .5rem #a4c8c6); }
#rock.sp-fossil { filter: sepia(.7) brightness(1.05) drop-shadow(0 0 1.1rem #c29983); }
#luckyBar.sp { background: var(--spc); color: #0b2731; }


.seg.wide { margin-bottom: .6rem; }
.seg.wide button { flex: 1; }
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.badge { display: flex; align-items: center; gap: .45rem; padding: .4rem .45rem; border-radius: .8rem; background: #23414a; border: .15rem solid var(--out); opacity: .6; min-width: 0; }
.badge svg { flex: 0 0 1.8rem; width: 1.8rem; height: 1.8rem; filter: grayscale(1); }
.badge div { min-width: 0; display: flex; flex-direction: column; line-height: 1.1; flex: 1; }
.badge b { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge small { font-size: .7rem; color: var(--muted); font-weight: 500; }
.badge .bb { display: block; height: .3rem; margin-top: .2rem; border-radius: .2rem; background: #0b2731; overflow: hidden; }
.badge .bb i { display: block; height: 100%; background: var(--gold); }
.badge.got { opacity: 1; background: var(--panel); border-color: var(--gold); }
.badge.got svg { filter: none; }
.badge.got b { color: #d6b57b; }


.tcard .tc-stars { position: absolute; z-index: 1; top: .15rem; left: .3rem; font-size: .8rem; color: #d6b57b; text-shadow: var(--ol); letter-spacing: -.05em; }
.tcard.starred { border-color: #d6b57b; }
.tcard .tc-asc { position: absolute; z-index: 2; left: .15rem; right: .15rem; bottom: .15rem; font-size: .7rem; padding: .15rem 0 .25rem; text-align: center;
  border-radius: .55rem; background: #d6b57b; border: .15rem solid var(--out); box-shadow: inset 0 -.2rem 0 #426456; text-shadow: var(--ol); animation: pulse .8s infinite; }



#adShield { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(12, 10, 30, .72); }
#adShield .as-box { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1rem 1.6rem; border-radius: 1.2rem; background: var(--panel); border: .22rem solid var(--out); box-shadow: 0 .3rem 0 var(--out); text-shadow: var(--ol); }
#adShield b { font-size: 1.7rem; }
#adShield small { font-size: .95rem; color: var(--muted); }

.vcard { display: flex; align-items: center; gap: .6rem; width: 100%; margin-bottom: .6rem; padding: .45rem .7rem; border-radius: 1rem; text-align: left;
  background: linear-gradient(#d6b57b, #d6b57b); color: #0b2731; border: .2rem solid var(--out); box-shadow: inset 0 -.3rem 0 #426456, 0 .2rem 0 var(--out); }
.vcard svg { flex: 0 0 auto; width: 2rem; height: 2rem; }
.vcard b { display: block; font-size: 1.05rem; }
.vcard small { display: block; font-size: .8rem; font-weight: 500; opacity: .85; }
.vcard:active { transform: translateY(.15rem); }
.btn.small svg, .q-swap svg { width: 1.2rem; height: 1.2rem; }
.q-swap { flex: 0 0 auto; height: 2.2rem; padding: 0 .4rem; margin-right: .3rem; border-radius: .7rem; background: #d6b57b; border: .16rem solid var(--out); box-shadow: inset 0 -.25rem 0 #426456;
  display: inline-flex; align-items: center; gap: .1rem; font-size: 1.1rem; color: #0b2731; font-weight: 700; }
.vnote { margin: .4rem 0 0; font-size: .85rem; color: var(--muted); text-align: center; }



#hook { position: absolute; z-index: 9; left: 0; right: 0; bottom: 5.2rem; margin: 0 auto; width: max-content; max-width: calc(100% - 1.2rem);
  pointer-events: none; display: grid; gap: .45rem; padding: .7rem .9rem .8rem; border-radius: 1.1rem; background: rgba(20, 18, 46, .92);
  border: .2rem solid #c29983; box-shadow: 0 .3rem 0 var(--out), 0 0 1.6rem rgba(255, 122, 26, .35); text-shadow: var(--ol); animation: hookIn .35s ease-out; }
#hook.out { opacity: 0; transform: translateY(.6rem); transition: opacity .35s, transform .35s; }
#hook .hk-x { pointer-events: auto; position: absolute; top: -.7rem; right: -.6rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--panel); border: .16rem solid var(--out); font-size: 1.2rem; line-height: 1; }
#hook .hk-top { display: flex; align-items: center; gap: .45rem; font-size: 1.15rem; }
#hook .hk-top svg { width: 1.5rem; height: 1.5rem; }
#hook .hk-top span { margin-left: auto; color: #d6b57b; display: inline-flex; align-items: center; gap: .25rem; padding-left: .8rem; }
#hook .hk-top span svg { width: 1.1rem; height: 1.1rem; }
#hook .hk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; }
#hook .hk-day { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .25rem .1rem; border-radius: .55rem; background: var(--panel); border: .13rem solid var(--out); min-width: 2.6rem; font-size: .9rem; }
#hook .hk-day svg { width: 1.2rem; height: 1.2rem; }
#hook .hk-day i { font-style: normal; font-size: .62rem; color: var(--muted); white-space: nowrap; }
#hook .hk-day.done { color: #9dbba3; opacity: .75; }
#hook .hk-day.next { background: var(--green); }
#hook .hk-day.next i { color: #0b2731; font-weight: 700; text-shadow: none; }
#hook p { margin: 0; font-size: .95rem; line-height: 1.25; max-width: 24rem; }
#hook p b { color: #d6b57b; }
@keyframes hookIn { from { opacity: 0; transform: translateY(1rem) scale(.96); } }
@media (prefers-reduced-motion: reduce) { #hook { animation: none; } }
