@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../fonts/fredoka.woff2) format('woff2');
}

:root {
  --out: #14122e;
  --panel: #222959;
  --card: #2e3773;
  --text: #ffffff;
  --muted: #aab3e6;
  --green: #5ad63e;
  --green-d: #2f8f1f;
  --gold: #ffc928;
  --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: #c89a63;
  --bg2: #7a4e28;
}

* { 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: #14122e; color: var(--text);
  font-family: 'Fredoka', 'Arial Rounded MT Bold', '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; }

/* viewport-fit=cover lets the page sit under a notch or rounded corner, so keep the UI out of the
   inset areas. Resolves to 0 everywhere that has no insets, including inside the portal iframe. */
#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 ---------------- */
#stage { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto auto; }
/* grid items default to min-width:auto and would otherwise be sized by their content, letting a full
   tool belt push past the edge of a phone screen instead of shrinking */
#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(#fff 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 mode (a slow phone, see ui.js): the rays hold still - turning a layer that big was a real cost there */
.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: #fff0c2; 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; }
/* two lines before it clamps: on a phone one line cut the goal to "Buy 3..." and "Unloc..." */
.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: #3b4aa8; transition: width .3s; }
.goal.done { background: var(--green); animation: pulse 1s infinite; }
.goal.done .g-fill { display: none; }
.goal.done .g-sub { color: #0d3a05; }
.goal.done .g-title { text-shadow: var(--ol); }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* boosts */
/* the left of the mine: the mining-chest video on top (CrazyGames asked for it out in the open), the boosts under it */
#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(#ffcf5a, #ffb52e); color: #fff;
  border: .2rem solid var(--out); box-shadow: inset 0 -.3rem 0 #d17d00, 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); } }
/* the banner: a 320x50 slot at the foot of the side panel, in a box that blends with the list; the list keeps room
   under its last item, so nothing is ever covered */
#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); }
/* in CrazyGames' small desktop player (about 914x468) 25rem is under 300px - the panel widens to fit the 320px banner
   so it never spills over the mine */
@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(#ffb52e, #ff7a1a); animation: glow 1.2s infinite; }
.boost.on .b-sub { color: #fff; }
@keyframes glow { 50% { box-shadow: 0 .25rem 0 var(--out), 0 0 1.2rem #ffd23e; } }

/* feed */
#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; } }

/* rock */
/* the mining zone owns every touch inside it - no chance the browser reads a fast tap as a pan */
#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: #8dff9a; letter-spacing: 0; }
#layerName .rlv.max { color: #ffe14a; border-color: #ffe14a; }
/* the tutorial points at the badge: make it the thing on screen that moves */
#layerName.hl .rlv { animation: pulse .6s infinite; box-shadow: 0 0 .7rem #8dff9a; }
#layerName .ll { font-size: .8rem; padding: .05rem .45rem; border-radius: .6rem; background: #2c7a1f; 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; }

/* lucky rock: a short, loud window where tapping beats idling */
/* centred with auto margins, not translateX: its pulse animation sets transform, which silently dropped the
   centring and pushed the banner off the right edge on phones */
#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(#ffd23e, #ff9d2e); border: .2rem solid var(--out);
  box-shadow: 0 .25rem 0 var(--out); color: #3a2400; 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 #ffd23e) drop-shadow(0 .5rem .6rem rgba(0,0,0,.25)); animation: luckyRock .5s infinite; }
@keyframes luckyRock { 50% { filter: drop-shadow(0 0 2.2rem #fff3b0) drop-shadow(0 .5rem .6rem rgba(0,0,0,.25)); } }

/* tap combo: only your own taps feed it */
/* fixed height and visibility, not display - otherwise the whole stage reflows on every tap */
#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: #1b1f47; border: .16rem solid var(--out); overflow: hidden; }
/* a span is inline by default, and inline boxes ignore width - so the fill never drew at all */
#combo .c-fill { display: block; width: 100%; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #ffd23e, #ff5d5d); transition: transform .1s linear; }
#combo b { color: #ffe14a; 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: #1b1f47; border: .2rem solid var(--out); overflow: hidden; }
/* scaled, not resized, so the bar moves on the compositor instead of re-laying-out the mine on every hit */
#hpFill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; background: linear-gradient(#ffd98a, #f0913f); 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: #ffe14a; 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: #8dff9a; }

/* tool belt - the tools visibly swing at the rock above them */
#beltWrap { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; padding: 0 .6rem .2rem; }
/* slots shrink to fit so a full 8-tool belt still fits a phone in portrait */
#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; }
 /* the belt rests until something swings - it is driven per tap from ui.js, not on a loop,
    because the tools ride on your swing rather than mining by themselves */
.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: #3a2a00; 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: #ffe14a; }

#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: #fff; color: #2b3170; 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: #fff; }
@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: #fff; }
#layerDots i.cur { background: var(--gold); transform: scale(1.35); }
#layerDots i.lucky { box-shadow: 0 0 0 .16rem #5ad63e; }

#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: #fff; }
.pop-tag { position: absolute; z-index: 1; top: .4rem; right: .2rem; font-size: 1rem; padding: .05rem .5rem; border-radius: .6rem; background: #ff3d6e; 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: #9fd0ff; text-decoration: underline; }

/* ---------------- panel ---------------- */
#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: #1a2049; 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: #fff; }
.tab .dot { position: absolute; top: .15rem; right: .3rem; width: .9rem; height: .9rem; border-radius: 50%; background: #ff3d6e; 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: #5b68c4 transparent; overscroll-behavior: contain; touch-action: pan-y; }
#tabBody::-webkit-scrollbar { width: .5rem; }
#tabBody::-webkit-scrollbar-thumb { background: #5b68c4; border-radius: .3rem; }

.explain { font-size: .95rem; font-weight: 500; line-height: 1.25; color: #dfe4ff; background: #1a2049; border: .15rem solid var(--out); border-radius: .8rem; padding: .45rem .6rem; margin-bottom: .6rem; }
.explain b { color: #ffe14a; 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: #0d3a05; background: var(--green); border: .12rem solid var(--out); border-radius: .5rem; padding: 0 .4rem; font-weight: 700; }
.seg { display: flex; background: #1a2049; 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: #5b68c4; color: #fff; }

.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: #1a2049; 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: #5a6188; box-shadow: inset 0 -.3rem 0 #3e446a; color: #c9cde6; }
.upg.maxed .upg-cost { background: #5b68c4; box-shadow: inset 0 -.3rem 0 #3f4a96; }
.upg.locked { opacity: .6; }
.upg.locked .upg-ico svg, .upg.locked img { filter: grayscale(1); }
.upg.locked .upg-cost { background: #5a6188; box-shadow: inset 0 -.3rem 0 #3e446a; }
.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: #b565ff; box-shadow: inset 0 -.35rem 0 #7a35c4, 0 .25rem 0 var(--out); }
.btn.gold { background: #ffb52e; box-shadow: inset 0 -.35rem 0 #d17d00, 0 .25rem 0 var(--out); }
.btn.grey { background: #5a6188; box-shadow: inset 0 -.35rem 0 #3e446a, 0 .25rem 0 var(--out); }
.btn.red { background: #f0413f; box-shadow: inset 0 -.35rem 0 #a81f2a, 0 .25rem 0 var(--out); }
.btn:active { transform: translateY(.2rem); }
.btn.off { background: #5a6188; box-shadow: inset 0 -.35rem 0 #3e446a, 0 .25rem 0 var(--out); color: #c9cde6; }

/* tools + index */
.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: #141838; overflow: hidden; }
.tcard .tc-bar i { display: block; height: 100%; background: var(--gold); }
.tcard.eq { background: #35439a; }
.tcard.eq::before { content: 'MINING'; 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); }
/* the 1 in a million tool gets a shimmer so it never reads as just another card */
.tcard.ultra:not(.unknown), .odds-row.ultra:not(.unknown) { background: linear-gradient(135deg, #3a3f7a, #6b5ea8, #3a3f7a); border-color: #fff; }
.tcard.ultra:not(.unknown) .tc-name, .odds-row.ultra:not(.unknown) .o-name { color: #fff; 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: #8dff9a; }

.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: #141838; border: .2rem solid var(--out); overflow: hidden; margin: .8rem 0; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#d39bff, #9a4df0); }
.bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1rem; text-shadow: var(--ol); }

/* gems */
.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: #ff9be6; }
.gup .upg-cost { background: #d44fb5; box-shadow: inset 0 -.3rem 0 #9a2f83; }
.gup.off .upg-cost { background: #5a6188; box-shadow: inset 0 -.3rem 0 #3e446a; color: #c9cde6; }
.gup.maxed .upg-cost { background: #5b68c4; box-shadow: inset 0 -.3rem 0 #3f4a96; }
/* an inline icon in running text is sized to the text - an unsized SVG fills its whole container */
.toast svg, .explain svg, .statline svg, .q-claim svg, .sheet p svg, .sheet h2 svg { width: 1.1em; height: 1.1em; vertical-align: -.18em; }

/* shards and crafting */
.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: #7df9ff; }
.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: #9fb0e6; }
.tcard .tc-craft svg { width: .8rem; height: .8rem; }
.tcard[data-craft] { cursor: pointer; }
.tcard.afford { border-color: #7df9ff; box-shadow: 0 0 .5rem #7df9ff66; }
.tcard.afford .tc-craft { color: #7df9ff; border-color: #7df9ff; }

/* quests */
.statline.lucky-day span:first-child { display: flex; align-items: center; gap: .3rem; }
.statline.lucky-day span:last-child { color: #8dff9a; }
.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: #5a6188; border: .16rem solid var(--out); box-shadow: inset 0 -.25rem 0 #3e446a; display: inline-flex; align-items: center; justify-content: center; gap: .2rem; font-size: .95rem; text-shadow: var(--ol); color: #dfe4ff; }
.quest.done .q-claim { background: var(--green); box-shadow: inset 0 -.25rem 0 var(--green-d); color: #fff; animation: pulse .8s infinite; }
.quest.claimed { opacity: .55; }
.q-bar { position: relative; height: 1.3rem; border-radius: .7rem; background: #141838; border: .15rem solid var(--out); overflow: hidden; }
.q-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#ffe14a, #f0a52a); transition: width .2s; }
.quest.claimed .q-bar i { background: linear-gradient(#8dff9a, #3fb52a); }
.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; }

/* ---------------- overlays ---------------- */
#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: #ffe14a; }
@keyframes toast { 0% { transform: translateY(-1rem); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }

/* first-run coaching */
#coach { position: absolute; z-index: 25; pointer-events: none; max-width: 17rem; padding: .55rem .8rem; border-radius: 1rem; background: #fffbe8; color: #2a2412; 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: #b8560a; }
#coach:not(.up):not(.down):not(.right)::after { display: none; }
#coach::after { content: ''; position: absolute; width: .9rem; height: .9rem; background: #fffbe8; 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: #f0413f; 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: #0d3a05; 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, #3b4aa8, #14122e); 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: 7rem; height: 7rem; background: #fff6dc; animation: wob .7s infinite; transform-origin: 50% 90%;
  -webkit-mask: var(--pick) center/contain no-repeat; mask: var(--pick) center/contain no-repeat;
  --pick: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M6 46C10 18 28 6 50 6C72 6 90 18 94 46C84 34 70 26 50 26C30 26 16 34 6 46Z"/><rect x="43" y="22" width="14" height="74" rx="7"/></svg>'); }
.loader-text { font-size: 2.4rem; text-shadow: var(--ol); }
@keyframes wob { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

/* ---------------- portrait / narrow ---------------- */
@media (orientation: portrait) {
  html { font-size: clamp(9px, min(3.3vw, 1.72vh), 22px); }
  #app { flex-direction: column; }
  /* the mine gets most of a phone: at 43% the panel left a 360x560 player a rock 90px tall */
  #stage { flex: 1 1 64%; }
  #panel { flex: 0 0 36%; border-left: 0; border-top: .25rem solid var(--out); }
  /* the layer arrows keep their full size and spacing: smaller and closer, Chrome's touch adjustment snapped
     taps just under the belt onto the arrow and sent the player to a locked layer mid-tapping */
  #toasts { right: 0; }
  #feed { display: none; }
  .grid { grid-template-columns: repeat(5, 1fr); }
  .goal { flex-basis: 15rem; }
  .tb-right { min-width: 7rem; }
  /* stack "per swing" over "idle" so the goal chip gets the width */
  #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; }
}

/* ---------------- return-visit hooks ---------------- */
/* the pill on the mine when a geode can be summoned or the chest is full (a button, so it never mines) */
/* right-middle of the mine, mirroring the boost card on the left: clear of the toasts, the layer name and the
   centred banners that the top corner collided with on a phone */
#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: #b565ff; border: .2rem solid var(--out); box-shadow: inset 0 -.3rem 0 #7a35c4, 0 .25rem 0 var(--out); animation: pillPulse .9s infinite; }
#readyPill svg { width: 2rem; height: 2rem; }
#readyPill.chest { background: #ffb52e; box-shadow: inset 0 -.3rem 0 #d17d00, 0 .25rem 0 var(--out); }
@keyframes pillPulse { 50% { transform: translateY(-50%) scale(1.06); } }
/* the layer's own rock, lit up purple - a hue shift turned each layer a different random colour */
#rock.geode { filter: brightness(1.12) saturate(1.35) drop-shadow(0 0 .9rem #e2a6ff) drop-shadow(0 0 2.2rem #b565ff); animation: geodeGlow .8s infinite; }
@keyframes geodeGlow { 50% { filter: brightness(1.25) saturate(1.5) drop-shadow(0 0 1.3rem #f0c9ff) drop-shadow(0 0 3rem #c07bff); } }
#luckyBar.geo { background: linear-gradient(#b565ff, #6b35c4); color: #fff; text-shadow: var(--ol); }

.streak { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 1rem; background: linear-gradient(90deg, #5a2a10, #2a1a4a); 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: #ffcf6b; }
.streak small { display: block; font-size: .82rem; color: #e6d9ff; 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, #5a2f0a, #2e3773 70%); border: .2rem solid #ff9f1c; }
.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: #ffcf6b; 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: #8dff9a; }
.q-bar.track { height: 1.6rem; margin-bottom: .5rem; }
.q-bar.track i { background: linear-gradient(#ffe14a, #ff9f1c); }
.tiers { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; }
.tier { position: relative; aspect-ratio: 1; border-radius: .6rem; background: #1a2049; 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: #2c7a1f; }
.tier.got::after { content: '\2713'; position: absolute; bottom: 0; right: .25rem; font-size: .75rem; color: #fff; text-shadow: var(--ol); }
.tier.next { opacity: 1; border-color: var(--gold); box-shadow: 0 0 .4rem #ffc92899; }
.track-note { font-size: .8rem; color: var(--muted); font-weight: 500; margin: .45rem 0 0; text-align: center; }
.sheet .waiting { color: #ffcf6b; font-weight: 600; margin: .35rem 0 0; }
.tcard.limited-card:not(.unknown) { background: linear-gradient(135deg, #5a2f0a, #2e3773 75%); }
.odds-row.limited { border: .15rem solid #ff9f1c; }

/* ---------------- frenzy, special rocks, achievements, ascension ---------------- */
/* frenzy: the whole mine burns at the edges while it runs */
/* the glow is drawn once and only its opacity animates - animating a full-screen box-shadow repaints every
   frame for 20 seconds, which a cheap phone feels */
#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 #ff9a2ecc, inset 0 0 9rem 3rem #ff3d2e77; animation: frenzyEdge .5s infinite alternate; }
@keyframes frenzyEdge { from { opacity: .6; } to { opacity: 1; } }

/* players whose device asks for less motion: no endless pulsing, no burning edges flickering */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-iteration-count: 1 !important; }
  #stage.frenzy::after { animation: none; opacity: .8; }
}
#combo.charge b { color: #ffb52e; }
#combo.charge .c-fill { background: linear-gradient(90deg, #ff9f1c, #ff3d2e); }
#combo.fz { color: #fff3b0; }
#combo.fz b { color: #ff7a1a; }
#combo.fz .c-fill { background: linear-gradient(90deg, #ff3d2e, #ffe14a); transition: none; }

/* special rocks keep their layer's look and wear a coloured glow; the banner takes that colour */
#rock.sp-gold { filter: brightness(1.15) sepia(.35) saturate(1.6) drop-shadow(0 0 1.3rem #ffd23e); }
#rock.sp-crystal { filter: brightness(1.12) drop-shadow(0 0 1.3rem #7df9ff) drop-shadow(0 0 .5rem #c9fbff); }
#rock.sp-fossil { filter: sepia(.7) brightness(1.05) drop-shadow(0 0 1.1rem #d9a066); }
#luckyBar.sp { background: var(--spc); color: #1d1a38; }

/* achievements */
.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: #1a2049; 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: #141838; 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: #ffe14a; }

/* ascension */
.tcard .tc-stars { position: absolute; z-index: 1; top: .15rem; left: .3rem; font-size: .8rem; color: #ffe14a; text-shadow: var(--ol); letter-spacing: -.05em; }
.tcard.starred { border-color: #ffe14a; }
.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: #ffb52e; border: .15rem solid var(--out); box-shadow: inset 0 -.2rem 0 #d17d00; text-shadow: var(--ol); animation: pulse .8s infinite; }

/* ---------------- video ads (full-launch build only; the Basic Launch build never renders these) ---------------- */
/* the game underneath is paused and unclickable while an ad is announced or playing */
#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); }
/* an optional video: always a video icon, always says it is optional */
.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(#ffcf5a, #ffb52e); color: #3a2400; border: .2rem solid var(--out); box-shadow: inset 0 -.3rem 0 #d17d00, 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: #ffb52e; border: .16rem solid var(--out); box-shadow: inset 0 -.25rem 0 #d17d00;
  display: inline-flex; align-items: center; gap: .1rem; font-size: 1.1rem; color: #3a2400; font-weight: 700; }
.vnote { margin: .4rem 0 0; font-size: .85rem; color: var(--muted); text-align: center; }

/* ---------------- first-visit "come back tomorrow" card ---------------- */
/* it never takes a tap from the mine: only its close button is clickable */
#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 #ff7a1a; 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: #ffe14a; 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: #62e36d; opacity: .75; }
#hook .hk-day.next { background: var(--green); }
#hook .hk-day.next i { color: #0d3a05; font-weight: 700; text-shadow: none; }
#hook p { margin: 0; font-size: .95rem; line-height: 1.25; max-width: 24rem; }
#hook p b { color: #ffe14a; }
@keyframes hookIn { from { opacity: 0; transform: translateY(1rem) scale(.96); } }
@media (prefers-reduced-motion: reduce) { #hook { animation: none; } }

/* ===================== Pets & Events update ===================== */
.tab span { font-size: .8rem; white-space: nowrap; }
.tab.hidden { display: none; }
.toast img.ti { width: 1.6em; height: 1.6em; vertical-align: -.45em; }
/* pets by the rock: they stand on the ground either side and hop when you swing */
#petsRow { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.petEl { position: absolute; bottom: 2%; width: min(5.2rem, 22%); aspect-ratio: 128 / 120; transform-origin: 50% 100%; }
.petEl img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 .2rem .2rem rgba(0,0,0,.3)); animation: petIdle 2.4s ease-in-out infinite; }
.petEl.p0 { left: 4%; } .petEl.p1 { right: 4%; } .petEl.p2 { left: 4%; bottom: 34%; }
.petEl.p1 img { animation-delay: -.8s; } .petEl.p2 img { animation-delay: -1.6s; }
@keyframes petIdle { 50% { transform: translateY(-5%) scale(1.02, .98); } }
@media (orientation: portrait) { .petEl { width: min(4.4rem, 20%); } .petEl.p2 { left: auto; right: 4%; bottom: 34%; } }
/* Pets tab */
.petslots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; margin-bottom: .6rem; }
.pslot { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem .2rem .45rem; border-radius: .9rem; background: var(--panel); border: .2rem solid var(--out); box-shadow: inset 0 -.25rem 0 var(--rc, #555); text-align: center; min-width: 0; }
.pslot img { width: 4rem; height: 3.75rem; }
.pslot b { font-size: .85rem; text-shadow: var(--ol); line-height: 1.05; }
.pslot small { font-size: .7rem; color: var(--muted); line-height: 1.1; }
.pslot.empty { box-shadow: none; opacity: .7; justify-content: center; min-height: 6.5rem; }
.pslot.empty svg { width: 2rem; height: 2rem; opacity: .5; }
.freeegg { width: 100%; display: flex; align-items: center; gap: .7rem; padding: .5rem .8rem; margin-bottom: .6rem; border-radius: 1rem; background: linear-gradient(#ffcf5a, #ffb52e); border: .2rem solid var(--out); box-shadow: 0 .25rem 0 var(--out); text-align: left; animation: glow 1.2s infinite; }
.freeegg img { width: 3.6rem; height: 3.6rem; animation: eggWob 1.6s ease-in-out infinite; }
.freeegg b { display: block; font-size: 1.25rem; text-shadow: var(--ol); }
.freeegg small { font-size: .85rem; text-shadow: var(--ol); }
@keyframes eggWob { 0%, 60%, 100% { transform: none; } 70% { transform: rotate(-10deg); } 80% { transform: rotate(10deg); } 90% { transform: rotate(-5deg); } }
.upg.egg .upg-ico img, .upg.mdeal .upg-ico img { width: 100%; height: 100%; }
.eodds { font-size: .75rem; color: #8fd3ff; text-decoration: underline; align-self: flex-start; }
.pcard img { width: 100%; height: auto; aspect-ratio: 128 / 120; }
.pcard.eq { border-color: #5ad63e; }
.pcard.shiny { background: linear-gradient(#3a3f7a, #4a3f2a); }
.pc-on { position: absolute; top: .15rem; left: .15rem; z-index: 1; font-size: .62rem; padding: 0 .3rem; border-radius: .4rem; background: #5ad63e; text-shadow: var(--ol); }
.pcard .tc-sub { font-size: .66rem; line-height: 1.1; }
.odds-row img { width: 2.8rem; height: auto; }
/* boss rock */
#rock.boss { filter: saturate(1.4) hue-rotate(-25deg) drop-shadow(0 0 1rem #ff4d6d) drop-shadow(0 .5rem .6rem rgba(0,0,0,.3)); animation: bossRock .6s infinite; transform: scale(1.12); }
@keyframes bossRock { 50% { filter: saturate(1.6) hue-rotate(-25deg) drop-shadow(0 0 1.8rem #ff4d6d) drop-shadow(0 .5rem .6rem rgba(0,0,0,.3)); } }
#luckyBar.boss { background: #ff4d6d; }
/* the left column: merchant, a running event, weekend gems */
#merchBtn { width: 5.4rem; display: flex; flex-direction: column; align-items: center; gap: .05rem; padding: .3rem .2rem .4rem; border-radius: 1rem; background: linear-gradient(#8fd3ff, #4fb0ff); border: .2rem solid var(--out); box-shadow: 0 .25rem 0 var(--out); font-size: .85rem; text-shadow: var(--ol); animation: wiggle2 2s infinite; }
#merchBtn svg { width: 2rem; height: 2rem; }
#merchBtn small { font-size: .75rem; }
@keyframes wiggle2 { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-6deg); } 90% { transform: rotate(6deg); } 95% { transform: rotate(-3deg); } }
.boost.ev { background: linear-gradient(var(--ec), color-mix(in srgb, var(--ec) 60%, #14122e)); animation: glow 1.2s infinite; }
.boost.ev .b-sub, .boost.wk .b-sub { color: #fff; }
.boost.wk { background: linear-gradient(#ff9de0, #c07bff); }
@media (orientation: portrait) { #merchBtn { width: 4.6rem; } }
/* ready pill variants */
#readyPill.wheel { background: #ff8a1c; box-shadow: inset 0 -.3rem 0 #c45a00, 0 .25rem 0 var(--out); }
#readyPill.egg { background: #ff9de0; box-shadow: inset 0 -.3rem 0 #c45aa0, 0 .25rem 0 var(--out); }
/* Daily tab wheel card */
.wheelcard { margin-bottom: .55rem; }
.wheelbtn { background: #ff8a1c; }
.wheelbtn.off { background: #5a6188; color: #c9cde6; }
.wheelbtn svg { width: 1.3rem; height: 1.3rem; }
/* the wheel */
.wheel { position: relative; width: min(19rem, 78vw); margin: .2rem auto; }
.wheelsvg { width: 100%; height: auto; display: block; overflow: visible; }
.wheel .bulb { animation: bulb .8s steps(1) infinite; }
.wheel .bulb.b2 { animation-delay: .4s; }
.wheel.spinning .bulb { animation-duration: .2s; }
.wheel.spinning .bulb.b2 { animation-delay: .1s; }
@keyframes bulb { 50% { fill: #ff7a1a; } }
.wseg.win path { stroke: #fff; stroke-width: 6; }
.wres .big-num svg, .wres .big-num img { width: 1.4em; height: 1.4em; vertical-align: -.3em; }
.mdeals { display: flex; flex-direction: column; gap: .1rem; margin-top: .6rem; text-align: left; }
.upg.mdeal.maxed .upg-cost { background: #5a6188; box-shadow: inset 0 -.3rem 0 #3e446a; }
/* the full-screen egg hatching */
#modal.full { padding: 0; background: rgba(8, 6, 24, .93); }
.ostage { position: relative; width: 100%; height: 100%; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
.obg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rc) 45%, transparent), transparent 60%); opacity: .5; transition: opacity .4s; }
.burst .obg { opacity: 1; }
.orays { position: absolute; left: 50%; top: 42%; width: 140vmax; height: 140vmax; margin: -70vmax 0 0 -70vmax; background: repeating-conic-gradient(var(--rc) 0 7deg, transparent 7deg 18deg); opacity: 0; border-radius: 50%;
  animation: orays 14s linear infinite; transition: opacity .4s; -webkit-mask: radial-gradient(closest-side, #000 20%, transparent); mask: radial-gradient(closest-side, #000 20%, transparent); }
.burst .orays { opacity: .28; }
@keyframes orays { to { transform: rotate(1turn); } }
.ostack { position: relative; width: min(15rem, 50vw); height: min(15rem, 50vw); }
.oegg { position: absolute; inset: 0; will-change: transform; }
.oegg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.oglow { position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(closest-side, var(--rc), transparent); opacity: 0; filter: blur(.4rem); transition: opacity .2s; }
.opet, .osil { position: absolute; inset: -6%; }
.opet img, .osil img { width: 100%; height: 100%; filter: drop-shadow(0 .4rem 0 rgba(0,0,0,.35)); }
.osil img { filter: brightness(0); }
.otext { position: relative; z-index: 2; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .25rem; width: min(24rem, 90vw); }
.otext b { font-size: 2.2rem; text-shadow: var(--ol); line-height: 1.05; }
.otext small { font-size: 1.05rem; color: #dfe4ff; }
.otext p { font-size: .95rem; color: #dfe4ff; margin: .2rem 0 .4rem; }
.otext .rr { font-size: 1rem; padding: .1rem .7rem; border-radius: .6rem; border: .15rem solid var(--out); text-shadow: var(--ol); }
.otap { position: absolute; bottom: 4%; font-size: .9rem; color: #aab3e6; animation: pulse 1.2s ease-in-out infinite; }

.eodds { display: inline-block; margin-left: .45rem; font-size: .72rem; padding: 0 .4rem; border-radius: .5rem; background: #3a4a9a; color: #cfe6ff; text-decoration: none; vertical-align: .15em; text-shadow: none; }
.pcard.out { border-color: #5ad63e; }
#rock { position: relative; }
.bossface { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; animation: bossFace .6s ease-in-out infinite; }
@keyframes bossFace { 50% { transform: translateY(-2%); } }

/* pets beside the rock (the row is sized to the rock's box by fitPetsRow) */
#petsRow { inset: auto; }
.petEl { width: var(--pw, 4.4rem); bottom: 0; }
.petEl.p0 { left: auto; right: 100%; margin-right: -4%; }
.petEl.p1 { right: auto; left: 100%; margin-left: -4%; }
.petEl.p2 { left: auto; right: 100%; margin-right: -2%; bottom: 46%; }
@media (orientation: portrait) { .petEl { width: var(--pw, 4.4rem); } .petEl.p2 { right: auto; left: calc(100% + var(--pw) * .82); margin: 0; bottom: 0; } }
.pcard .tc-sub { white-space: normal; overflow-wrap: anywhere; }

/* ===== pets that dig (each holds a small copy of your best pickaxe) ===== */
.petEl img { animation: none; }
.pbody { position: relative; width: 100%; height: 100%; transform-origin: 50% 100%; }
.pbob { width: 100%; height: 100%; transform-origin: 50% 100%; animation: petIdle 2.6s ease-in-out infinite; }
.petEl.p1 .pbob { animation-delay: -.9s; } .petEl.p2 .pbob { animation-delay: -1.7s; }
.pbob img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 .2rem .2rem rgba(0,0,0,.3)); }
@keyframes petIdle { 0%, 100% { transform: none; } 30% { transform: translateY(-4%) scale(1.02, .98); } 55% { transform: rotate(calc(var(--dir, 1) * 4deg)); } 75% { transform: translateY(-2%) rotate(calc(var(--dir, 1) * -2deg)); } }
.ppickw { position: absolute; width: 46%; aspect-ratio: 116 / 130; bottom: 14%; left: 72%; transform: scaleX(var(--dir, 1)); transform-origin: 50% 50%; pointer-events: none; }
.petEl { --dir: 1; }
.petEl.p1 { --dir: -1; }
.petEl.p1 .ppickw { left: auto; right: 72%; }
@media (orientation: portrait) { .petEl.p2 { --dir: -1; } .petEl.p2 .ppickw { left: auto; right: 72%; } }
.ppick { width: 100%; height: 100%; display: block; transform: rotate(-25deg); transform-origin: 50% 90%; filter: drop-shadow(0 .15rem .1rem rgba(0,0,0,.3)); }

/* ===== the Lucky Wheel, full screen ===== */
.wrays { opacity: .22; }
.wx { position: absolute; z-index: 3; top: 1rem; right: 1rem; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: #ff4d6d; border: .2rem solid var(--out); font-size: 1.8rem; line-height: 1; text-shadow: var(--ol); box-shadow: 0 .2rem 0 var(--out); }
.wtitle { position: relative; z-index: 2; text-align: center; font-size: clamp(2rem, 6vmin, 3.4rem); font-weight: 700; color: #ffd23e; text-shadow: var(--ol); letter-spacing: .04em; line-height: 1; }
.wtitle small { display: block; font-size: .38em; color: #fff; letter-spacing: .02em; margin-top: .3rem; }
.wheel.big { position: relative; z-index: 2; width: min(28rem, 78vmin, 88vw); margin: 0 auto; }
.wlab { font: 700 13px Fredoka, sans-serif; fill: #fff; stroke: #14122e; stroke-width: 4.5px; paint-order: stroke fill; text-anchor: middle; dominant-baseline: middle; letter-spacing: .5px; }
.wheel .bulb { fill: #fff6a8; stroke: #14122e; stroke-width: 2; animation: chase 1.2s steps(1) infinite; }
.spinning .wheel .bulb { animation-duration: .35s; }
@keyframes chase { 0%, 18% { fill: #fff; filter: drop-shadow(0 0 4px #fff6a8); } 19%, 100% { fill: #ff9f1c; } }
.wseg { transition: opacity .3s, filter .3s; }
.wseg.dim { opacity: .45; }
.wseg.win { animation: wwin .5s ease-in-out infinite alternate; }
@keyframes wwin { to { filter: brightness(1.35) drop-shadow(0 0 8px #fff); } }
.wfoot { position: relative; z-index: 2; transition: opacity .25s, transform .25s; }
.wfoot.gone { opacity: 0; transform: scale(.7); pointer-events: none; }
.wspin { font-size: 1.7rem; padding: .55rem 2.6rem .75rem; animation: pulse 1s ease-in-out infinite; }
.wspin svg { width: 1.6rem; height: 1.6rem; }
.wconf { position: absolute; left: 50%; top: 45%; width: 0; height: 0; z-index: 4; pointer-events: none; }
.wconf i { position: absolute; width: .7rem; height: .45rem; margin: -.2rem 0 0 -.35rem; border-radius: .1rem; }
.wprize { position: absolute; z-index: 5; left: 50%; bottom: 6%; transform: translate(-50%, 0); display: flex; align-items: center; gap: .9rem; padding: .7rem 1rem .7rem .8rem;
  border-radius: 1.3rem; background: var(--card); border: .25rem solid var(--out); box-shadow: 0 .4rem 0 var(--out), 0 0 2rem color-mix(in srgb, var(--pc) 70%, transparent); max-width: 94vw; }
.wp-ico { width: 4rem; height: 4rem; flex: 0 0 4rem; display: grid; place-items: center; border-radius: 1rem; background: color-mix(in srgb, var(--pc) 35%, #1a2049); border: .18rem solid var(--out); }
.wp-ico svg, .wp-ico img { width: 80%; height: 80%; }
.wp-txt { display: flex; flex-direction: column; min-width: 0; }
.wp-txt small { font-size: .8rem; color: var(--muted); letter-spacing: .08em; }
.wp-txt b { font-size: 1.35rem; text-shadow: var(--ol); line-height: 1.1; }
@media (orientation: portrait) { .wprize { flex-wrap: wrap; justify-content: center; text-align: center; } .wp-txt { align-items: center; } }

/* ===== pet animation polish ===== */
.pcard.out img, .pslot img { animation: petIdle 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.pslot:nth-child(2) img { animation-delay: -.9s; } .pslot:nth-child(3) img { animation-delay: -1.7s; }
.hconf { top: 40%; }
.opet.shinyglow img { filter: drop-shadow(0 0 1.2rem #ffe14a) drop-shadow(0 .4rem 0 rgba(0,0,0,.35)); animation: shinyPulse 1.4s ease-in-out infinite; }
@keyframes shinyPulse { 50% { filter: drop-shadow(0 0 2.2rem #fff6a8) drop-shadow(0 .4rem 0 rgba(0,0,0,.35)); } }
@media (prefers-reduced-motion: reduce) { .pcard.out img, .pslot img, .pbob, .opet.shinyglow img { animation: none; } }

/* ===== the drawn pets (js/sprites.js): square art that bobs and blinks on its own; the ones on the right of the
   rock are mirrored so every pet faces it ===== */
.petEl { aspect-ratio: 1; }
.pbob { animation: none !important; }
.petEl.p1 .pbob { transform: scaleX(-1); }
@media (orientation: portrait) { .petEl.p2 .pbob { transform: scaleX(-1); } }
.petEl img, .pcard img, .pslot img, .opet img, .osil img, .odds-row img, .freeegg img, .toast img.ti { object-fit: contain; }
.pcard img { aspect-ratio: 1; }
.ppickw { bottom: 20%; }

/* ===== polish: event banners, event ambience, slot pops ===== */
.evintro { position: absolute; z-index: 7; left: 0; right: 0; top: 30%; display: flex; flex-direction: column; align-items: center; pointer-events: none; animation: evIn 1.9s ease-out forwards; }
.evintro b { position: relative; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1; color: #fff; text-shadow: var(--ol), 0 0 1.2rem var(--ec); letter-spacing: .03em; animation: evSlam 1.9s ease-out forwards; }
.evintro small { position: relative; font-size: 1.15rem; margin-top: .35rem; text-shadow: var(--ol); animation: evSub 1.9s ease-out forwards; }
.ei-band { position: absolute; left: -5%; right: -5%; top: -.4rem; bottom: -.5rem; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ec) 75%, transparent) 20%, color-mix(in srgb, var(--ec) 75%, transparent) 80%, transparent);
  border-top: .22rem solid var(--out); border-bottom: .22rem solid var(--out); transform: skewY(-3deg); animation: evBand 1.9s ease-out forwards; }
@keyframes evIn { 0% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes evSlam { 0% { transform: scale(2.6) rotate(-8deg); opacity: 0; } 14% { transform: scale(.92) rotate(-3deg); opacity: 1; } 22% { transform: scale(1.06) rotate(-3deg); } 30%, 78% { transform: scale(1) rotate(-3deg); } 100% { transform: scale(1.1) rotate(-3deg) translateY(-30%); } }
@keyframes evSub { 0%, 18% { opacity: 0; transform: translateY(40%); } 30%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes evBand { 0% { transform: skewY(-3deg) scaleX(0); } 16% { transform: skewY(-3deg) scaleX(1.04); } 24%, 80% { transform: skewY(-3deg) scaleX(1); } 100% { transform: skewY(-3deg) scaleX(1); opacity: 0; } }
#evFx { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; transition: background .6s; }
#evFx.ev-rush { background: radial-gradient(circle at 50% 45%, rgba(255, 210, 62, .28), transparent 65%); }
#evFx.ev-rain { background: radial-gradient(circle at 50% 45%, rgba(125, 249, 255, .22), transparent 65%); }
#evFx.ev-lucky { background: radial-gradient(circle at 50% 45%, rgba(98, 227, 109, .22), transparent 65%); }
#evFx.ev-boss { background: radial-gradient(circle at 50% 45%, rgba(255, 77, 109, .2), transparent 60%); }
#evFx.hurry { animation: hurry .6s ease-in-out infinite; }
@keyframes hurry { 50% { box-shadow: inset 0 0 6rem rgba(255, 40, 70, .55); } }
#evFx i { position: absolute; top: -12%; width: var(--sz); height: var(--sz); opacity: .75; animation: evFall 4s linear infinite; }
#evFx i svg { width: 100%; height: 100%; }
@keyframes evFall { from { transform: translateY(0) rotate(0); } to { transform: translateY(125vh) rotate(360deg); } }
.pslot.pop { animation: slotPop .45s ease-out; }
@keyframes slotPop { 0% { transform: scale(.7); } 60% { transform: scale(1.08); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .evintro, .evintro b, .evintro small, .ei-band, #evFx i, #evFx.hurry, .pslot.pop { animation: none !important; } .evintro { display: none; } }

#petsRow.wide .petEl.p2 { bottom: 0; right: calc(100% + var(--pw) * .78); margin-right: 0; }

/* on a phone the third pet stands in front of the rock's lower corner (not squeezed behind another pet) */
#petsRow.stack .petEl.p2 { left: 2%; right: auto; margin: 0; bottom: -4%; z-index: 1; --dir: 1; }
#petsRow.stack .petEl.p2 .pbob { transform: none; }
#petsRow.stack .petEl.p2 .ppickw { left: 72%; right: auto; }

/* ===== the egg hatching show ===== */
.hrow { position: relative; z-index: 2; display: flex; gap: 2.5vw; align-items: flex-end; justify-content: center; margin-top: -4vh; }
.hslot { position: relative; width: min(19rem, 48vw, 44vh); display: flex; flex-direction: column; align-items: center; }
.hrow.multi .hslot { width: min(13rem, 31vw, 34vh); }
.hscene { position: relative; width: 100%; aspect-ratio: 1 / 1.05; }
.hlight { position: absolute; left: 50%; bottom: 14%; width: 130%; height: 170%; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--rc) 55%, transparent), transparent 80%); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  opacity: calc(.15 + var(--crk, 0) * .35); transition: opacity .3s; }
.hslot.open .hlight { opacity: .75; }
.hpod { position: absolute; left: 4%; right: 4%; bottom: 0; }
.hpodsvg { width: 100%; display: block; overflow: visible; }
.hrune { animation: hrune 6s linear infinite; transform-origin: 100px 36px; transform-box: view-box; }
@keyframes hrune { to { stroke-dashoffset: -180; } }
.hegg { position: absolute; left: 20%; width: 60%; bottom: 22%; aspect-ratio: 120 / 124; }
.hegg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.heimg { filter: drop-shadow(0 0 calc(var(--crk, 0) * 1.1rem) var(--rc)) drop-shadow(0 0 calc(var(--crk, 0) * .4rem) #fff); }
.hglow { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(closest-side, var(--rc), transparent); opacity: calc(var(--crk, 0) * .85); }
.hsil, .hpet { position: absolute; left: 4%; width: 92%; bottom: 18%; aspect-ratio: 1; }
.hsil img, .hpet img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 .4rem 0 rgba(0, 0, 0, .35)); }
.hsil img { filter: brightness(0); }
.hpet.shinyglow img { filter: drop-shadow(0 0 1.2rem #ffe14a) drop-shadow(0 .4rem 0 rgba(0,0,0,.35)); animation: shinyPulse 1.4s ease-in-out infinite; }
.hfx { position: absolute; left: 50%; top: 52%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.hfx i { position: absolute; left: 0; top: 0; width: .8rem; height: .55rem; border-radius: .15rem; }
.hring { position: absolute; left: 0; top: 0; width: 9rem; height: 9rem; border-radius: 50%; border: .5rem solid var(--rc); box-shadow: 0 0 1.5rem var(--rc); }
.hcard { position: relative; margin-top: .4rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; text-align: center; min-height: 6.5rem; }
.hcard .rr { font-size: .95rem; padding: .05rem .7rem; border-radius: .6rem; border: .15rem solid var(--out); text-shadow: var(--ol); }
.hcard b { font-size: 2rem; line-height: 1.05; text-shadow: var(--ol); }
.hrow.multi .hcard b { font-size: 1.35rem; }
.hcard small { font-size: 1rem; color: #dfe4ff; }
.hcard em { font-style: normal; font-size: .9rem; color: #aab3e6; }
.hnew { position: absolute; top: -.8rem; right: 8%; font-style: normal; font-size: .85rem; padding: .05rem .45rem; border-radius: .5rem; background: #ff4d6d; border: .15rem solid var(--out); text-shadow: var(--ol); transform: rotate(8deg); animation: pulse .8s infinite; }
.hnew.lv { background: #5ad63e; }
.hide { visibility: hidden; }
.hfoot { position: relative; z-index: 2; text-align: center; margin-top: .6rem; }
.hfoot p { font-size: 1rem; color: #dfe4ff; margin-bottom: .5rem; }
.hvig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(0, 0, 0, .55)); transition: background .6s; }
.tense .hvig { background: radial-gradient(ellipse at 50% 45%, transparent 25%, rgba(0, 0, 0, .8)); }
.tense .orays { opacity: .35; animation-duration: 3s; }
.hflash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 4; }
.hrays { opacity: .18; }
@media (orientation: portrait) { .hrow.multi { gap: 1vw; } .hrow.multi .hcard b { font-size: 1.05rem; } .hrow.multi .hcard small { font-size: .78rem; } }
@media (prefers-reduced-motion: reduce) { .hrune, .hnew { animation: none; } }
.hslot { width: min(24rem, 54vw, 54vh); }
.hrow.multi .hslot { width: min(16rem, 31vw, 40vh); }
.hcard b { font-size: 2.4rem; }
.hcard small { font-size: 1.15rem; }
.hrow.multi .hcard b { font-size: 1.5rem; }

/* ===== visual pass (10 Nov) ===== */
/* phones: the side buttons move up beside the rock's top half, so the pets own the bottom corners; two pets stand on
   the mine (the third still works, it just doesn't fit beside a phone-sized rock without overlapping) */
@media (orientation: portrait) {
  #leftCol { top: 8.2rem; transform: none; }
  #readyPill { top: 8.2rem; transform: none; }
  #petsRow.stack .petEl.p2 { display: none; }
}
.pslot img { width: 5rem; height: 5rem; }

/* performance (10 Nov): the pets on the mine and in the hatching are still pictures moved only by transforms - the
   drawings' own CSS motion made the browser repaint every detailed pet every frame (60 -> 20 fps with 3 pets out) */
#evFx i { will-change: transform; }
.petEl .pbody, .petEl .ppick, .hegg, .hpet, .hsil { will-change: transform; }
.pbob { animation: petIdle 2.6s ease-in-out infinite !important; transform-origin: 50% 100%; will-change: transform; }
.petEl.p1 .pbob { animation-delay: -.9s !important; } .petEl.p2 .pbob { animation-delay: -1.7s !important; }
.petEl.p1 .pbob img { transform: scaleX(-1); }
@media (orientation: portrait) { .petEl.p1 .pbob, .petEl.p2 .pbob { transform: none; } }
@media (prefers-reduced-motion: reduce) { .pbob { animation: none !important; } }
/* performance: the hatching show's spinning rays are composited (rotating them repaints nothing), the podium runes
   stand still, and on a slow device (lite mode) the rays stop turning */
.orays { will-change: transform; }
.hrune { animation: none; }
.lite .orays { animation: none; }
.hlight, .hglow, .heimg { will-change: opacity; }

#app.fullmodal #stage, #app.fullmodal #panel { visibility: hidden; }
#app.fullmodal #stage *, #app.fullmodal #panel * { animation-play-state: paused !important; }
#modal.full { background: radial-gradient(ellipse at 50% 40%, #241c4e, #0a0820 75%); }
