/* ============ Lowpoly Digger — UI stylesheet ============ */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { width:100%; height:100%; overflow:hidden; background:#0b1220; font-family:'Segoe UI', 'Trebuchet MS', system-ui, sans-serif; touch-action:none; }
#app { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; }
#frame { position:relative; background:#000; overflow:hidden; box-shadow:0 0 60px rgba(0,0,0,.6); cursor:var(--cur-point, default); }
#scene { position:absolute; inset:0; width:100%; height:100%; display:block; cursor:var(--cur-point, default); }
/* every interactive element uses the "action" cursor variant of the equipped skin */
#ui button, #ui .clickable, #ui input, #ui select { cursor:var(--cur-act, pointer); }

/* UI layer is authored at 1920x1080 and scaled to fit the frame */
#ui, #fx-layer {
  position:absolute; top:0; left:0; width:1920px; height:1080px;
  transform-origin:top left; pointer-events:none; user-select:none;
}
#ui * { pointer-events:none; }
#ui .clickable, #ui button, #ui input, #ui select { pointer-events:auto; }

/* ---------- Loading screen ---------- */
#loading { position:fixed; inset:0; z-index:100; background:linear-gradient(180deg,#0e2a4a 0%,#1d6a8f 55%,#e8c37a 100%); display:flex; align-items:center; justify-content:center; transition:opacity .5s; }
#loading.hidden { opacity:0; pointer-events:none; }
.load-card { text-align:center; color:#fff; }
.load-title { font-size:56px; font-weight:800; text-shadow:0 4px 0 rgba(0,0,0,.25); letter-spacing:1px; }
.load-sub { margin-top:6px; font-size:18px; opacity:.85; }
.load-bar { width:320px; height:14px; margin:26px auto 10px; background:rgba(0,0,0,.35); border-radius:8px; overflow:hidden; }
.load-fill { height:100%; width:5%; border-radius:8px; background:linear-gradient(90deg,#ffd76a,#ff9d5c); transition:width .3s; }
.load-tip { font-size:14px; opacity:.75; }

/* ---------- HUD ---------- */
/* full-width centred row (see #bottom-bar note) so the resource chips never wrap early */
#hud { position:absolute; top:16px; left:0; right:0; display:flex; gap:10px; flex-wrap:wrap; justify-content:center; padding:0 12px; pointer-events:none; }
.res { display:flex; align-items:center; gap:8px; background:rgba(10,18,32,.72); border:2px solid rgba(255,255,255,.14); border-radius:16px; padding:9px 14px 9px 11px; color:#fff; backdrop-filter:blur(6px); min-width:130px; }
.res .ico { font-size:28px; filter:drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.res .val { font-size:27px; font-weight:800; text-shadow:0 2px 0 rgba(0,0,0,.35); }
.res .lbl { font-size:14px; opacity:.7; text-transform:uppercase; letter-spacing:1px; display:block; margin-top:-3px; }
.res.bump .val { animation:bump .25s; }
@keyframes bump { 50% { transform:scale(1.25); color:#ffe38a; } }

#stat-chip { position:absolute; top:16px; left:18px; background:rgba(10,18,32,.6); border:2px solid rgba(255,255,255,.12); border-radius:14px; padding:8px 14px; color:#cfe8ff; font-size:17px; line-height:1.5; }
#stat-chip b { color:#fff; }

/* rewarded-ad boost badges (one per active boost) */
#boost-badges { position:absolute; top:96px; left:0; right:0; display:flex; gap:8px; justify-content:center; flex-wrap:wrap; padding:0 12px; pointer-events:none; }
.boost-badge { background:linear-gradient(180deg,rgba(90,60,20,.92),rgba(50,32,10,.94)); border:2px solid #ffd76a; border-radius:13px; padding:6px 13px; color:#ffe38a; font-size:15px; font-weight:800; letter-spacing:.5px; text-shadow:0 1px 0 rgba(0,0,0,.5); box-shadow:0 3px 14px rgba(255,215,106,.28); white-space:nowrap; animation:glowpulse 1.6s infinite; }

/* active-play combo indicator */
#combo { position:absolute; top:150px; left:50%; transform:translateX(-50%); text-align:center; color:#ffd76a; font-weight:900; font-size:30px; letter-spacing:1px; text-shadow:0 3px 0 rgba(0,0,0,.5), 0 0 16px rgba(255,190,90,.7); pointer-events:none; white-space:nowrap; }
#combo.mid { color:#ffb04f; font-size:34px; }
#combo.hot { color:#ff6a3f; font-size:40px; text-shadow:0 3px 0 rgba(0,0,0,.55), 0 0 24px rgba(255,90,40,.9); animation:comboshake .5s infinite; }
#combo .combo-mult { display:block; font-size:15px; font-weight:800; color:#ffe38a; letter-spacing:0; margin-top:-2px; text-shadow:0 2px 0 rgba(0,0,0,.5); }
@keyframes comboshake { 0%,100% { transform:translateX(-50%) rotate(-1.5deg); } 50% { transform:translateX(-50%) rotate(1.5deg); } }

#top-bar { position:absolute; top:16px; right:18px; display:flex; flex-direction:column; align-items:flex-end; gap:6px; z-index:12; pointer-events:none; max-width:min(420px, 42vw); }
#top-bar-btns { display:flex; gap:8px; align-items:center; flex-wrap:nowrap; pointer-events:none; transition:opacity .15s, visibility 0s; }
/* a panel is a modal: hide the crew toggles so they can't collide with the panel's
   tab strip / close button on narrow frames (toasts stay visible).
   visibility (delayed so the fade still plays) is what actually stops hit-testing —
   pointer-events on this container alone loses to `#ui button { pointer-events:auto }`,
   which left the invisible toggles clickable behind the open panel. */
#ui.menu-open #top-bar-btns { opacity:0; visibility:hidden; pointer-events:none; transition:opacity .15s, visibility 0s linear .15s; }
#ui.menu-open #top-bar-btns button { pointer-events:none; }
#top-bar .ghost-btn { position:static; white-space:nowrap; padding:10px 15px; font-size:15px; pointer-events:auto; flex-shrink:0; }
.crew-toggle.on { border-color:rgba(139,231,154,.65); color:#d8ffe4; }
.crew-toggle.off { border-color:rgba(255,130,110,.45); color:#ffc4b8; background:rgba(40,22,22,.75); }
.crew-toggle.dim { opacity:.55; }
.crew-toggle .crew-lbl { font-size:14px; margin-left:2px; }

/* compact, dismissible rewarded offer shown occasionally during live play */
#crew-offer { position:absolute; top:108px; right:18px; z-index:11; width:270px; min-height:86px;
  display:grid; grid-template-columns:42px 1fr auto; align-items:center; gap:8px; padding:10px 10px;
  border:2px solid rgba(255,215,106,.65); border-radius:15px; color:#fff;
  background:linear-gradient(180deg,rgba(36,50,75,.96),rgba(15,27,47,.97));
  box-shadow:0 7px 24px rgba(0,0,0,.4),0 0 18px rgba(255,190,70,.16); backdrop-filter:blur(7px); }
#crew-offer.hidden { display:none; }
#ui.menu-open #crew-offer, #ui.ad-locked #crew-offer { display:none; }
.crew-offer-close { position:absolute; top:-10px; right:-10px; width:36px; height:36px; padding:0; border-radius:50%;
  border:2px solid rgba(255,255,255,.35); background:#7a3232; color:#fff; font-size:20px; font-weight:900; line-height:1; }
.co-icon { width:42px; height:42px; display:flex; align-items:center; justify-content:center; color:#ffd76a; }
.co-copy { min-width:0; display:flex; flex-direction:column; line-height:1.2; }
.co-title { color:#ffe38a; font-size:15px; }
.co-sub { margin-top:3px; color:#b9cce8; font-size:12.5px; }
.co-watch { min-height:42px; padding:8px 11px; border:2px solid rgba(139,231,154,.65); border-radius:11px;
  background:linear-gradient(180deg,#2c7b43,#205c32); color:#edfff1; font-size:13px; font-weight:900; white-space:nowrap; }
.co-watch:disabled { opacity:.6; }

/* ---------- quest tracker ---------- */
#quest-chip { position:absolute; top:106px; left:18px; width:226px; background:rgba(10,18,32,.72); border:2px solid rgba(255,255,255,.14); border-radius:14px; padding:10px 14px; color:#fff; cursor:pointer; transition:border-color .15s, transform .12s; backdrop-filter:blur(6px); }
#quest-chip:hover { border-color:#7fd1ff; transform:translateY(-2px); }
#quest-chip .qc-title { font-weight:800; font-size:17px; }
#quest-chip .qc-desc { font-size:14px; color:#9fb6d8; margin:2px 0 7px; }
#quest-chip .qc-bar { height:12px; background:rgba(0,0,0,.45); border-radius:7px; overflow:hidden; }
#quest-chip .qc-fill { height:100%; width:0%; background:linear-gradient(90deg,#7fd1ff,#8be79a); transition:width .25s; }
#quest-chip .qc-count { font-size:14px; font-weight:700; color:#cfe8ff; margin-top:5px; text-align:right; }
#quest-chip.claimable { border-color:#ffd76a; animation:glowpulse 1.2s infinite; }
#quest-chip.claimable .qc-count { color:#ffe38a; }
#quest-chip.claimable .qc-fill { background:linear-gradient(90deg,#ffd76a,#ff9d5c); }

/* One contextual retention action sits below the quest tracker. It is hidden during
   onboarding and menus, and only the highest-priority ready/return state is shown. */
#return-chip { position:absolute; top:248px; left:18px; width:226px; min-height:66px; display:flex; align-items:center; gap:10px;
  padding:9px 12px; border:2px solid rgba(127,209,255,.42); border-radius:14px; color:#eaf6ff; text-align:left;
  background:linear-gradient(180deg,rgba(24,49,78,.9),rgba(11,26,46,.92)); backdrop-filter:blur(6px);
  box-shadow:0 5px 18px rgba(0,0,0,.28); transition:transform .12s,border-color .15s; }
#return-chip:hover { transform:translateY(-2px); border-color:#7fd1ff; }
#return-chip .rc-ico { width:32px; height:32px; display:flex; align-items:center; justify-content:center; flex:0 0 32px; }
#return-chip .rc-copy { min-width:0; display:flex; flex-direction:column; gap:2px; }
#return-chip .rc-title { font-size:15px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#return-chip .rc-sub { font-size:12.5px; font-weight:650; color:#a9c4e7; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#return-chip.ready { border-color:#ffd76a; background:linear-gradient(180deg,rgba(78,55,22,.94),rgba(44,31,16,.94)); }
#return-chip.ready .rc-title { color:#ffe38a; }
#return-chip.active { border-color:#7fd1ff; }
#return-chip.available { border-color:rgba(139,231,154,.65); }
#return-chip.available .rc-title { color:#bff7cc; }
#return-chip.goal { border-color:rgba(183,148,246,.7); background:linear-gradient(180deg,rgba(50,38,78,.94),rgba(25,22,48,.94)); }
#return-chip.goal .rc-title { color:#d8b8ff; }
#ui.menu-open #return-chip { display:none; }

/* quests panel */
.roadmap-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:10px; margin-bottom:16px; }
.roadmap-card { appearance:none; min-width:0; min-height:142px; display:flex; flex-direction:column; padding:13px 14px;
  border:2px solid rgba(127,209,255,.22); border-radius:14px; color:#eaf3ff; text-align:left; font:inherit;
  background:linear-gradient(180deg,rgba(35,54,84,.78),rgba(20,32,54,.82)); transition:transform .12s,border-color .15s,background .15s; }
.roadmap-card:hover { transform:translateY(-2px); border-color:#7fd1ff; }
.roadmap-card.is-next { border-color:#ffd76a; background:linear-gradient(180deg,rgba(77,57,27,.82),rgba(43,34,23,.86)); box-shadow:0 0 18px rgba(255,215,106,.13); }
.roadmap-card.done { border-color:rgba(139,231,154,.42); background:rgba(139,231,154,.07); opacity:.78; }
.rm-head { display:flex; align-items:center; gap:8px; min-width:0; }
.rm-ico { width:28px; height:28px; display:flex; align-items:center; justify-content:center; flex:0 0 28px; }
.rm-name { min-width:0; flex:1; font-size:15px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rm-state { flex:0 0 auto; padding:2px 7px; border-radius:12px; border:1px solid rgba(127,209,255,.3); color:#a9c4e7; font-size:10.5px; font-weight:900; letter-spacing:.5px; text-transform:uppercase; }
.roadmap-card.is-next .rm-state { color:#ffe38a; border-color:rgba(255,215,106,.55); background:rgba(255,215,106,.1); }
.roadmap-card.done .rm-state { color:#bff7cc; border-color:rgba(139,231,154,.48); }
.rm-progress { display:block; min-height:34px; margin-top:9px; color:#fff; font-size:13.5px; font-weight:800; line-height:1.3; }
.rm-bar { display:block; width:100%; height:9px; margin:7px 0 8px; }
.roadmap-card.done .qfill { background:linear-gradient(90deg,#4fdc7c,#8be79a); }
.rm-benefit { display:block; margin-top:auto; color:#9fb6d8; font-size:12px; font-weight:650; line-height:1.3; }
.roadmap-count { margin-left:auto; padding:2px 10px; border:1px solid rgba(255,215,106,.35); border-radius:20px; color:#ffe38a; background:rgba(255,215,106,.1); font-size:13px; white-space:nowrap; }
.sect-title.after-roadmap { margin-top:20px; }
.quest-card { display:flex; gap:18px; align-items:center; background:rgba(127,209,255,.07); border:2px solid rgba(127,209,255,.35); border-radius:16px; padding:18px 20px; margin-bottom:16px; }
.quest-card .qico { font-size:46px; filter:drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.quest-card .qinfo { flex:1; }
.upcoming { opacity:.55; }

/* achievements grid */
.ach-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.ach-card { background:rgba(255,255,255,.05); border:2px solid rgba(255,255,255,.1); border-radius:14px; padding:12px 14px; }
.ach-card.unlocked { border-color:#ffd76a; background:rgba(255,215,106,.09); }
.ach-card .aico { font-size:28px; }
.ach-card .aname { font-weight:800; font-size:15.5px; margin-top:3px; }
.ach-card .adesc { font-size:13.5px; color:#9fb6d8; margin:3px 0 7px; line-height:1.35; }
.ach-card .abar { height:8px; background:rgba(0,0,0,.4); border-radius:5px; overflow:hidden; }
.ach-card .afill { height:100%; background:linear-gradient(90deg,#7fd1ff,#8be79a); }
.ach-card .aprog { font-size:13px; color:#cfe8ff; font-weight:700; margin-top:3px; text-align:right; }
.ach-card .areward { font-size:14px; color:#ffe38a; font-weight:800; margin-top:6px; }
.ach-card.unlocked .areward { color:#8be79a; }

/* ---------- Bottom bar ---------- */
/* full-width flex row (centred via justify-content) so all buttons share one line;
   left:50%+translateX would cap the shrink-to-fit width and force an early wrap */
#bottom-bar { position:absolute; bottom:16px; left:0; right:0; display:flex; gap:10px; flex-wrap:wrap; justify-content:center; padding:0 10px; }
/* The open panel has its own complete tab row. Hiding the underlying navigation
   also keeps Quest/Season notification badges from escaping above the panel on
   short landscape screens (their positive z-index otherwise outlives the button). */
#ui.menu-open #bottom-bar { visibility:hidden; pointer-events:none; }
.bar-btn { position:relative; display:flex; flex-direction:column; align-items:center; gap:2px; background:linear-gradient(180deg,rgba(38,58,92,.92),rgba(16,26,46,.94)); border:2px solid rgba(140,190,255,.28); border-radius:16px; color:#fff; padding:10px 13px; font-size:17px; font-weight:700; cursor:pointer; transition:transform .12s, border-color .12s; text-shadow:0 1px 0 rgba(0,0,0,.5); }
.bar-btn .bico { font-size:30px; }
.bar-btn:hover { transform:translateY(-4px); border-color:#ffd76a; }
.bar-btn:active { transform:scale(.94); }
.bar-btn.attention { animation:glowpulse 1.2s infinite; border-color:#ffd76a; }
.nav-badge { position:absolute; top:-8px; right:-8px; min-width:26px; height:26px; padding:0 6px; display:flex; align-items:center; justify-content:center;
  border-radius:14px; border:2px solid #fff3c2; background:#df5d3c; color:#fff; font-size:13px; font-weight:900;
  line-height:1; text-shadow:0 1px 1px rgba(0,0,0,.5); box-shadow:0 3px 10px rgba(0,0,0,.45); z-index:2; }

/* ---------- Zoom buttons ---------- */
#zoom-btns { position:absolute; bottom:110px; right:18px; display:flex; flex-direction:column; gap:8px; z-index:10; }
.zoom-btn { width:52px; height:52px; border-radius:14px; border:2px solid rgba(140,190,255,.35); background:rgba(10,18,32,.72); color:#fff; font-size:30px; font-weight:800; cursor:pointer; transition:transform .1s, border-color .12s; backdrop-filter:blur(6px); text-shadow:0 2px 0 rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center; line-height:1; }
.zoom-btn:hover { border-color:#ffd76a; transform:scale(1.08); }
.zoom-btn:active { transform:scale(.92); }
#ui.menu-open #zoom-btns { display:none; }

@keyframes glowpulse { 50% { box-shadow:0 0 22px 4px rgba(255,215,106,.55); } }

/* ---------- Menu banner ad (320x50) ---------- */
/* Lives outside #ui (see index.html) so the UI layer's scale transform can never
   shrink or stretch the ad. Mounted only while a menu is open.
   Positioned top-right. Transparent container used directly for CrazyGames SDK. */
#banner-slot { position:absolute; top:8px; right:8px; z-index:40; pointer-events:auto; }
/* exact 320x50 transparent content box for CrazyGames SDK */
#banner-host { box-sizing:content-box; width:320px; height:50px; overflow:hidden; background:transparent; border:none; box-shadow:none; }
/* the two transient gameplay indicators mean nothing in a menu */
#ui.banner-on #boost-badges, #ui.banner-on #combo { display:none; }
/* In menu/banner mode, reserve space on the right so HUD resource chips (like the diamond gem chip) never overlap with the top-right banner */
#ui.menu-open #hud, #ui.banner-on #hud {
  padding-right: var(--banner-right-pad, 345px);
  padding-left: var(--stat-left-pad, 210px);
  transition: padding .15s;
}

/* ---------- Panel ---------- */
#panel-wrap { position:absolute; inset:0; display:none; align-items:flex-start; justify-content:center; background:rgba(4,8,16,.45); padding-top:var(--panel-top-padding, 90px); padding-bottom:16px; }
#panel-wrap.open { display:flex; }
/* fixed size: switching tabs must never change the panel's aspect ratio */
#panel { position:relative; width:min(1080px, 96%); height:calc(100% - 10px); max-height:calc(100% - 10px); background:linear-gradient(180deg,#1b2a44,#111c31); border:3px solid rgba(140,190,255,.3); border-radius:22px; color:#fff; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 24px 80px rgba(0,0,0,.6); }
/* tabs share the row evenly; on frames too narrow for all of them they wrap to a
   second row instead of overflowing the panel and being clipped by its overflow */
#panel-tabs { display:flex; flex-wrap:wrap; gap:4px; padding:12px 62px 0 14px; background:rgba(0,0,0,.25); }
.ptab { flex:1; text-align:center; padding:12px 5px; border-radius:12px 12px 0 0; background:rgba(255,255,255,.05); color:#9fb6d8; font-weight:700; font-size:17px; cursor:pointer; border:none; }
.ptab.active { background:linear-gradient(180deg,#2c4368,#22334f); color:#ffd76a; }
/* the whole panel is interactive: wheel + touch scrolling must reach #panel-body */
#panel, #panel * { pointer-events:auto; }
#panel-body { padding:20px 24px; overflow-y:auto; flex:1; min-height:0; touch-action:pan-y; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
  scrollbar-width:thin; scrollbar-color:rgba(140,190,255,.35) transparent; }
#panel-close { position:absolute; top:12px; right:12px; width:44px; height:44px; border-radius:12px; border:2px solid rgba(255,120,120,.4); background:rgba(60,20,25,.8); color:#ff9d9d; font-size:22px; font-weight:800; cursor:pointer; z-index:3; }
/* slim rounded scrollbar, inset from the panel corners */
#panel-body::-webkit-scrollbar { width:8px; }
#panel-body::-webkit-scrollbar-track { background:transparent; margin:14px 0; }
#panel-body::-webkit-scrollbar-thumb { background:rgba(140,190,255,.28); border-radius:8px; }
#panel-body::-webkit-scrollbar-thumb:hover { background:rgba(140,190,255,.5); }
#panel-body::-webkit-scrollbar-corner { background:transparent; }

/* inline SVG icons */
svg.icon { display:inline-block; vertical-align:-4px; flex-shrink:0; filter:drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.res .ico svg.icon, .bar-btn .bico svg.icon { vertical-align:middle; }
.bar-btn .bico { display:flex; align-items:center; justify-content:center; height:32px; }
.upg .uico, .quest-card .qico { display:flex; align-items:center; justify-content:center; }
.gem-card .gico, .cos-item .cico, .ach-card .aico { display:flex; align-items:center; justify-content:center; height:32px; }

.sect-title { font-size:23px; font-weight:800; color:#ffd76a; margin:6px 0 12px; display:flex; align-items:center; gap:9px; }
.sect-note { font-size:16px; color:#9fb6d8; margin-bottom:14px; line-height:1.5; }

/* upgrade rows */
.upg { display:flex; align-items:center; gap:14px; background:rgba(255,255,255,.05); border:2px solid rgba(255,255,255,.08); border-radius:14px; padding:12px 14px; margin-bottom:10px; }
.upg .uico { font-size:32px; width:46px; text-align:center; }
.upg .uinfo { flex:1; }
.upg .uname { font-weight:800; font-size:18px; }
.upg .uname .ulvl { color:#7fd1ff; font-size:15px; margin-left:8px; }
.upg .udesc { font-size:15px; color:#9fb6d8; margin-top:2px; }
.upg .ueff { font-size:15px; color:#8be79a; margin-top:2px; }
.buy-btn { min-width:154px; padding:10px 14px; border-radius:12px; border:2px solid rgba(139,231,154,.45); background:linear-gradient(180deg,#2c6b3f,#1d4a2c); color:#d8ffe2; font-weight:800; font-size:16px; cursor:pointer; transition:transform .1s; }
.buy-btn:hover { transform:scale(1.04); }
.buy-btn:active { transform:scale(.95); }
.buy-btn.cant { border-color:rgba(255,255,255,.15); background:linear-gradient(180deg,#3a4356,#232a3a); color:#8091ab; cursor:not-allowed; }
.buy-btn.gem-cost { border-color:rgba(213,143,255,.5); background:linear-gradient(180deg,#5b2c6b,#3c1d4a); color:#f0d8ff; }
.buy-btn.gem-cost.cant { border-color:rgba(255,255,255,.15); background:linear-gradient(180deg,#3a4356,#232a3a); color:#8091ab; }
.buy-btn.maxed { border-color:rgba(139,231,154,.6); background:rgba(139,231,154,.12); color:#8be79a; cursor:default; }

/* contextual rewarded-ad boost shown in Forge and Merchant */
.context-boost { border-color:rgba(255,215,106,.3); background:rgba(255,215,106,.06); }
.context-boost.active { border-color:rgba(139,231,154,.5); background:rgba(139,231,154,.08); }

/* optional Shop boost catalogue */
.shop-boosts { margin:10px 0 16px; padding:11px; border:2px solid rgba(255,215,106,.35); border-radius:14px;
  background:rgba(255,215,106,.045); }
.shop-boosts-title { display:flex; align-items:center; gap:7px; margin-bottom:9px; color:#ffe38a; font-size:15px; font-weight:900; }
.shop-boosts-title span { color:#b9cce8; font-size:12px; font-weight:600; }
.shop-boost-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.shop-boost-card { min-width:0; display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 8px;
  text-align:center; border:2px solid rgba(255,255,255,.12); border-radius:12px; background:rgba(255,255,255,.045); }
.shop-boost-card.active { border-color:rgba(139,231,154,.5); background:rgba(139,231,154,.08); }
.shop-boost-card .sbc-icon { height:28px; color:#ffd76a; }
.shop-boost-card .sbc-name { min-height:34px; display:flex; align-items:center; color:#ffe38a; font-size:13px; font-weight:900; line-height:1.2; }
.shop-boost-card .sbc-desc { flex:1; color:#aebfda; font-size:11px; line-height:1.3; }
.shop-boost-card .sbc-desc b { color:#dcecff; }
.shop-boost-card .buy-btn { width:100%; min-width:0; margin-top:4px; padding:8px 5px; font-size:12px; }

/* CrazyGames account card (Settings) */
.user-card { display:flex; align-items:center; gap:14px; background:rgba(127,209,255,.08); border:2px solid rgba(127,209,255,.3); border-radius:14px; padding:12px 16px; margin-bottom:14px; }
.user-card .user-av { width:52px; height:52px; border-radius:50%; object-fit:cover; border:2px solid rgba(255,255,255,.25); display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.25); flex-shrink:0; }
.user-card .user-name { font-weight:800; font-size:18px; color:#fff; }
.user-card .user-sub { font-size:13.5px; color:#9fb6d8; margin-top:2px; }

/* prestige / rebirth */
.relic-hero { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin:6px 0 16px; }
.relic-hero .rh-stat { flex:1; min-width:120px; max-width:220px; text-align:center; background:rgba(183,148,246,.08); border:2px solid rgba(183,148,246,.32); border-radius:14px; padding:14px 10px; }
.relic-hero .rh-val { font-size:30px; font-weight:900; color:#d8b8ff; text-shadow:0 2px 0 rgba(0,0,0,.35); }
.relic-hero .rh-val.ready { color:#8be79a; }
.relic-hero .rh-lbl { font-size:13px; color:#9fb6d8; margin-top:2px; display:flex; align-items:center; justify-content:center; gap:5px; }
.buy-btn.relic-cost { border-color:rgba(183,148,246,.55); background:linear-gradient(180deg,#5b2c8b,#3c1d5a); color:#e8d8ff; }
.buy-btn.relic-cost.cant { border-color:rgba(255,255,255,.15); background:linear-gradient(180deg,#3a4356,#232a3a); color:#8091ab; }
#prestige-go { border-color:rgba(183,148,246,.6); background:linear-gradient(180deg,#6a3ac8,#3c1d6a); color:#e8d8ff; }
#prestige-go.cant { opacity:.5; cursor:not-allowed; }

/* ---------- Guardian banner ---------- */
/* Sits under the HUD chips, centred: the one moment the game asks the player to
   drop everything and hit something, so it gets the top-centre slot and nothing else. */
#guardian-hud { --guardian-color:#b06cff; position:absolute; top:96px; left:50%; transform:translateX(-50%); width:340px;
  background:rgba(28,14,48,.86); border:2px solid var(--guardian-color); border-radius:14px; padding:8px 14px 9px;
  color:#e8d8ff; text-align:center; backdrop-filter:blur(6px);
  box-shadow:0 4px 22px rgba(176,108,255,.35); z-index:14; }
#guardian-hud .gh-name { font-weight:800; font-size:16px; display:flex; align-items:center;
  justify-content:center; gap:7px; letter-spacing:.5px; }
#guardian-hud .gh-bar { height:12px; background:rgba(0,0,0,.5); border-radius:7px; overflow:hidden; margin:6px 0 4px; }
#guardian-hud .gh-fill { height:100%; width:100%; background:linear-gradient(90deg,var(--guardian-color),#ffeaff); transition:width .12s linear; }
#guardian-hud .gh-time { font-size:15px; font-weight:800; color:var(--guardian-color); font-variant-numeric:tabular-nums; }
#guardian-hud.urgent { border-color:#ff6a3f; box-shadow:0 4px 22px rgba(255,106,63,.5); animation:comboshake .5s infinite; }
#guardian-hud.urgent .gh-time { color:#ff9d7a; }
#ui.banner-on #guardian-hud, #ui.menu-open #guardian-hud { display:none; }

/* ---------- Artifacts ---------- */
.gear-slots { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin-bottom:6px; }
.gear-slot { background:rgba(255,255,255,.05); border:2px dashed rgba(255,255,255,.18); border-radius:14px;
  padding:11px 9px; text-align:center; cursor:pointer; transition:border-color .12s, transform .12s; min-height:104px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; }
.gear-slot:hover { border-color:#7fd1ff; }
.gear-slot.empty .gs-plus { font-size:26px; color:#6a7a92; font-weight:800; line-height:1; }
.gear-slot .gs-lbl { font-size:11.5px; color:#8091ab; }
.gear-slot .gs-name { font-weight:800; font-size:14px; }
.gear-slot .gs-rar { font-size:11.5px; font-weight:800; letter-spacing:1px; text-transform:uppercase; }
.gear-slot .gs-eff { font-size:12.5px; color:#8be79a; }

.gear-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(158px, 1fr)); gap:9px; }
.gear-card { background:rgba(255,255,255,.05); border:2px solid rgba(255,255,255,.12); border-radius:13px;
  padding:10px; display:flex; flex-direction:column; gap:2px; }
.gear-card .gc-top { display:flex; align-items:center; justify-content:space-between; }
.gear-card .gc-n { font-weight:800; font-size:14px; color:#cfe8ff; }
.gear-card .gc-name { font-weight:800; font-size:14px; }
.gear-card .gc-rar { font-size:11px; font-weight:800; letter-spacing:1px; text-transform:uppercase; }
.gear-card .gc-eff { font-size:12.5px; color:#8be79a; margin-bottom:5px; }
.gear-card .gc-actions { display:flex; gap:5px; margin-top:auto; }
.gear-card .gc-btn { flex:1; padding:7px 6px; font-size:12px; min-height:0; }
.gear-card .gc-fuse { border-color:rgba(183,148,246,.55); color:#d8b8ff; }
.gear-card.is-equipped { border-color:#8be79a; background:rgba(139,231,154,.09); }
.resonance-tracks { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px 12px; }
.resonance-track { background:rgba(255,255,255,.04); border:1px solid rgba(255,215,106,.18); border-radius:10px; padding:8px 10px; }
.resonance-track .sh-top { font-size:12.5px; margin-bottom:5px; }
.resonance-track .qbar { height:8px; margin:0; }
.artifact-set-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.artifact-set-card { padding:9px 11px; border:1px solid rgba(255,255,255,.13); border-radius:11px; background:rgba(255,255,255,.035); opacity:.72; }
.artifact-set-card.active { opacity:1; border-color:#8be79a; background:rgba(139,231,154,.09); box-shadow:0 0 14px rgba(139,231,154,.09); }
.artifact-set-card .as-head { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px; font-weight:800; color:#cfe8ff; }
.artifact-set-card .as-head span:last-child { font-size:10px; letter-spacing:.8px; color:#8297b8; }
.artifact-set-card.active .as-head span:last-child { color:#8be79a; }
.artifact-set-card .as-req { margin-top:5px; color:#aebed7; font-size:11px; }
.artifact-set-card .as-eff { margin-top:3px; color:#8be79a; font-size:11.5px; }

/* rarity colouring, shared by slots and cards */
.r0 .gs-rar, .r0 .gc-rar { color:#9aa3ad; }
.r1 .gs-rar, .r1 .gc-rar { color:#7fd1ff; }
.r2 .gs-rar, .r2 .gc-rar { color:#b06cff; }
.r3 .gs-rar, .r3 .gc-rar { color:#ffd76a; }
.gear-slot.r1, .gear-card.r1 { border-color:rgba(127,209,255,.45); border-style:solid; }
.gear-slot.r2, .gear-card.r2 { border-color:rgba(176,108,255,.5); border-style:solid; }
.gear-slot.r3, .gear-card.r3 { border-color:rgba(255,215,106,.55); border-style:solid; }
.gear-slot.r0 { border-style:solid; }

#ui.compact #guardian-hud { top:62px; width:250px; padding:6px 11px 7px; border-radius:11px; }
#ui.compact #guardian-hud .gh-name { font-size:13px; }
#ui.compact #guardian-hud .gh-bar { height:9px; margin:5px 0 3px; }
#ui.compact #guardian-hud .gh-time { font-size:12.5px; }
#ui.compact.narrow #guardian-hud { top:130px; }
#ui.compact .gear-slots { gap:6px; }
#ui.compact .gear-slot { padding:8px 6px; min-height:86px; border-radius:11px; }
#ui.compact .gear-slot .gs-name { font-size:12.5px; }
#ui.compact .gear-slot .gs-eff, #ui.compact .gear-slot .gs-rar { font-size:11px; }
#ui.compact .gear-slot .gs-lbl { font-size:10.5px; }
#ui.compact .gear-grid { grid-template-columns:repeat(auto-fill, minmax(132px, 1fr)); gap:6px; }
#ui.compact .gear-card { padding:8px; border-radius:11px; }
#ui.compact .gear-card .gc-name { font-size:12.5px; }
#ui.compact .gear-card .gc-eff { font-size:11px; }
#ui.compact .gear-card .gc-btn { font-size:11px; padding:8px 5px; }
#ui.compact .resonance-tracks { gap:6px; }
#ui.compact .resonance-track { padding:6px 8px; }
#ui.compact .resonance-track .sh-top { font-size:11px; }
#ui.compact .artifact-set-grid { gap:6px; }
#ui.compact .artifact-set-card { padding:6px 8px; }
#ui.compact .artifact-set-card .as-head { font-size:11px; }
#ui.compact .artifact-set-card .as-req, #ui.compact .artifact-set-card .as-eff { font-size:9.5px; }
#ui.compact .gear-slot:hover { transform:none; }

/* ---------- Season track ---------- */
.season-timer { font-size:14px; font-weight:800; color:#cfe8ff; background:rgba(127,209,255,.12);
  border:1px solid rgba(127,209,255,.35); border-radius:20px; padding:2px 11px; margin-left:auto; white-space:nowrap; }
.season-hero { display:flex; align-items:center; gap:16px; background:rgba(255,215,106,.07);
  border:2px solid rgba(255,215,106,.3); border-radius:16px; padding:14px 16px; margin-bottom:14px; }
.sh-tier { text-align:center; min-width:76px; }
.sh-tier .sh-num { font-size:38px; font-weight:900; color:#ffd76a; line-height:1; text-shadow:0 2px 0 rgba(0,0,0,.35); }
.sh-tier .sh-lbl { font-size:13px; color:#9fb6d8; margin-top:2px; }
.sh-bar-wrap { flex:1; min-width:0; }
.sh-top { display:flex; justify-content:space-between; gap:10px; font-size:15px; font-weight:800; margin-bottom:6px; }
.sh-top span { color:#cfe8ff; font-weight:700; }
.sh-sub { font-size:13.5px; color:#9fb6d8; margin-top:5px; }
.sh-sub b { color:#ffe38a; }

/* A grid, not a long list: thirty tiers have to be scannable at a glance so the
   player can see how far the next reward is without scrolling through all of them. */
.season-track { display:grid; grid-template-columns:repeat(auto-fill, minmax(132px, 1fr)); gap:8px; }
.season-tier { background:rgba(255,255,255,.05); border:2px solid rgba(255,255,255,.1);
  border-radius:12px; padding:9px 10px; display:flex; flex-direction:column; gap:3px; }
.season-tier .st-n { font-size:12px; font-weight:800; color:#9fb6d8; letter-spacing:1px; }
.season-tier .st-r { font-size:14px; font-weight:700; }
.season-tier .st-state { font-size:12.5px; color:#9fb6d8; font-weight:700; }
.season-tier.st-ready { border-color:#ffd76a; background:rgba(255,215,106,.1); cursor:pointer;
  animation:glowpulse 1.6s infinite; }
.season-tier.st-ready .st-state { color:#ffe38a; }
.season-tier.st-ready:hover { transform:translateY(-2px); }
.season-tier.st-claimed { border-color:rgba(139,231,154,.45); background:rgba(139,231,154,.08); opacity:.75; }
.season-tier.st-claimed .st-state { color:#8be79a; }
.season-tier.st-locked { opacity:.55; }
.season-tier.st-capstone { border-color:rgba(183,148,246,.5); background:rgba(183,148,246,.09); }
.season-tier.st-capstone.st-ready { border-color:#ffd76a; }
.cprice.season-locked { color:#b79af6; }

/* ---------- Expeditions ---------- */
.quest-jumpbar { position:sticky; top:-1px; z-index:4; display:flex; gap:8px; margin:-8px 0 14px; padding:8px;
  border:1px solid rgba(127,209,255,.24); border-radius:12px; background:rgba(15,27,47,.96); box-shadow:0 7px 18px rgba(0,0,0,.25); }
.quest-jumpbar .ghost-btn { flex:1; min-width:0; padding:8px 10px; font-size:13px; }
.quest-jumpbar .ghost-btn.attention { color:#ffe38a; border-color:rgba(255,215,106,.55); }
.quest-section-anchor { scroll-margin-top:62px; }
.first-exp-guide { display:flex; align-items:center; gap:11px; margin:4px 0 10px; padding:10px 12px;
  border:1px solid rgba(99,230,190,.5); border-radius:12px; color:#d9f9ef; background:rgba(99,230,190,.08);
  font-size:12.5px; line-height:1.4; }
.first-exp-guide>span { flex:0 0 auto; color:#63e6be; }
.exp-choices { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:9px; }
.exp-card { background:rgba(127,209,255,.06); border:2px solid rgba(127,209,255,.3); border-radius:14px;
  position:relative; padding:12px 10px; text-align:center; transition:border-color .12s, transform .12s; }
.exp-card:hover { border-color:#ffd76a; transform:translateY(-2px); }
.exp-card.first-exp-recommended { border-color:#ffd76a; background:rgba(255,215,106,.09); padding-top:28px; animation:glowpulse 1.6s infinite; }
.ec-recommended { position:absolute; top:5px; left:7px; right:7px; color:#ffe38a; font-size:9.5px; font-weight:900;
  text-transform:uppercase; letter-spacing:.05em; }
.exp-card .ec-ico { display:flex; align-items:center; justify-content:center; height:28px; }
.exp-card .ec-name { font-weight:800; font-size:15px; margin-top:3px; }
.exp-card .ec-time { font-size:20px; font-weight:900; color:#7fd1ff; }
.exp-card .ec-haul { font-size:12.5px; color:#9fb6d8; line-height:1.5; margin-top:3px; }
.exp-card .ec-scale { min-height:28px; margin-top:5px; font-size:10.5px; line-height:1.25; color:#63e6be; }
.exp-active { border-color:rgba(127,209,255,.4); }
.exp-claim-actions { display:flex; flex-direction:column; gap:7px; min-width:210px; }
.exp-claim-actions .buy-btn { width:100%; min-width:210px; }
.helper-paused { color:#ffad83; }
.exp-journey { display:grid; grid-template-columns:100px minmax(120px,1fr) 120px; align-items:center; gap:10px;
  margin:5px 0 10px; padding:10px 12px; border:1px solid rgba(127,209,255,.25); border-radius:13px;
  background:linear-gradient(90deg,rgba(62,128,155,.13),rgba(80,58,145,.14)); overflow:hidden; }
.exp-shore,.exp-destination { display:flex; flex-direction:column; align-items:center; gap:2px; color:#bcd1ee;
  font-size:11px; font-weight:800; text-align:center; }
.exp-destination { color:#ffe38a; }
.exp-route-line { position:relative; height:7px; border-radius:8px; background:rgba(255,255,255,.1); }
.exp-route-line>span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#4fd8c8,#7fd1ff); }
.exp-runner { position:absolute; top:-22px; left:4%; color:#7fd1ff; animation:expedition-march 4s ease-in-out infinite; }
.exp-runner.r1 { animation-delay:-1.25s; opacity:.82; }
.exp-runner.r2 { animation-delay:-2.5s; opacity:.68; }
.exp-journey.returning .exp-runner { animation-direction:reverse; color:#ffd76a; }
@keyframes expedition-march { 0% { left:3%; transform:translateY(1px) rotate(-4deg); } 50% { transform:translateY(-3px) rotate(4deg); } 100% { left:86%; transform:translateY(1px) rotate(-4deg); } }

.expedition-crew-fx { position:absolute; left:50%; top:48%; z-index:70; width:430px; padding:16px 20px;
  transform:translate(-50%,-50%); border:2px solid rgba(127,209,255,.55); border-radius:18px;
  background:linear-gradient(180deg,rgba(30,50,80,.98),rgba(13,25,45,.98)); box-shadow:0 18px 60px rgba(0,0,0,.6);
  pointer-events:none; animation:exp-fx-card 2.6s both; }
.ecf-label { color:#ffe38a; font-size:19px; font-weight:900; text-align:center; margin-bottom:12px; }
.ecf-track { position:relative; height:52px; border-bottom:3px dashed rgba(127,209,255,.25); }
.ecf-bot { position:absolute; left:12px; bottom:5px; color:#7fd1ff; animation:exp-fx-bot 2.1s ease-in-out both; }
.ecf-bot.b1 { animation-delay:.12s; bottom:4px; opacity:.86; }
.ecf-bot.b2 { animation-delay:.24s; bottom:3px; opacity:.72; }
.ecf-goal { position:absolute; right:10px; bottom:5px; color:#ffd76a; }
.expedition-crew-fx.return .ecf-bot { animation-direction:reverse; color:#ffd76a; }
@keyframes exp-fx-bot { 0% { left:12px; transform:translateY(0) rotate(-5deg); } 45% { transform:translateY(-7px) rotate(5deg); } 100% { left:340px; transform:translateY(0) rotate(-5deg); } }
@keyframes exp-fx-card { 0% { opacity:0; transform:translate(-50%,-42%) scale(.94); } 10%,82% { opacity:1; transform:translate(-50%,-50%) scale(1); } 100% { opacity:0; transform:translate(-50%,-55%) scale(.98); } }

#ui.compact .season-hero { gap:11px; padding:10px 11px; margin-bottom:10px; border-radius:12px; }
#ui.compact .sh-tier { min-width:56px; }
#ui.compact .sh-tier .sh-num { font-size:27px; }
#ui.compact .sh-tier .sh-lbl { font-size:11px; }
#ui.compact .sh-top { font-size:12.5px; }
#ui.compact .sh-sub { font-size:11.5px; }
#ui.compact .season-timer { font-size:11.5px; padding:2px 9px; }
#ui.compact .season-track { grid-template-columns:repeat(auto-fill, minmax(112px, 1fr)); gap:6px; }
#ui.compact .season-tier { padding:7px 8px; border-radius:10px; }
#ui.compact .season-tier .st-r { font-size:12px; }
#ui.compact .season-tier .st-state, #ui.compact .season-tier .st-n { font-size:11px; }
#ui.compact .season-tier.st-ready:hover, #ui.compact .exp-card:hover { transform:none; }
#ui.compact .exp-journey { grid-template-columns:72px minmax(90px,1fr) 82px; gap:6px; padding:8px; }
#ui.compact .expedition-crew-fx { width:min(390px,88%); padding:12px 15px; }
#ui.compact .exp-choices { grid-template-columns:repeat(auto-fit, minmax(118px, 1fr)); gap:6px; }
#ui.compact .exp-card { padding:9px 7px; border-radius:11px; }
#ui.compact .exp-card .ec-name { font-size:12.5px; }
#ui.compact .exp-card .ec-time { font-size:16px; }
#ui.compact .exp-card .ec-haul { font-size:11px; }
#ui.compact .exp-card .ec-scale { min-height:24px; font-size:9.5px; }

/* ---------- Daily tasks + Shards ---------- */
.daily-count, .shard-count { font-size:14px; font-weight:800; color:#ffe38a; background:rgba(255,215,106,.12);
  border:1px solid rgba(255,215,106,.35); border-radius:20px; padding:2px 11px; margin-left:auto; white-space:nowrap; }
.daily-task.task-ready { border-color:#ffd76a; background:rgba(255,215,106,.09); animation:glowpulse 1.6s infinite; }
.daily-task.task-done { opacity:.6; }
.daily-task.task-done .qfill { background:linear-gradient(90deg,#8be79a,#4fdc7c); }
.daily-task.daily-local { border-color:rgba(127,209,255,.38); background:rgba(74,150,220,.07); }
.daily-task.daily-local.task-ready { border-color:#ffd76a; background:rgba(255,215,106,.09); }
.daily-task.daily-away:not(.task-done) { border-style:dashed; }
.daily-biome-tag { display:inline-flex; align-items:center; gap:4px; padding:2px 7px; border-radius:12px;
  background:rgba(127,209,255,.11); border:1px solid rgba(127,209,255,.28); vertical-align:2px; white-space:nowrap; }
.buy-btn.shard-cost { border-color:rgba(255,215,106,.5); background:linear-gradient(180deg,#8a6a24,#5c4414); color:#ffe8c2; }
.buy-btn.shard-cost.cant { border-color:rgba(255,255,255,.15); background:linear-gradient(180deg,#3a4356,#232a3a); color:#8091ab; }
.shard-item { border-color:rgba(255,215,106,.28); }

#ui.compact .daily-count, #ui.compact .shard-count { font-size:11.5px; padding:2px 9px; }
#ui.compact .daily-biome-tag { padding:1px 6px; gap:3px; }

/* ---------- Relic Tree ---------- */
/* Branch groups, so the four paths read as separate choices rather than one long
   shopping list. A locked node stays visible (and legible) on purpose: seeing what
   the next tier costs is what makes spending Relics a decision. */
.relic-branch { margin-bottom:18px; }
.rb-head { display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin:0 0 9px; padding-bottom:7px;
  border-bottom:2px solid rgba(183,148,246,.28); }
.rb-head .rb-name { font-size:19px; font-weight:800; color:#d8b8ff; }
.rb-head .rb-desc { font-size:14px; color:#9fb6d8; flex:1; }
.rb-head .rb-lv { font-size:13px; font-weight:800; color:#cfe8ff; background:rgba(183,148,246,.14);
  border:1px solid rgba(183,148,246,.35); border-radius:20px; padding:3px 10px; white-space:nowrap; }
.relic-node.node-owned { border-color:rgba(183,148,246,.4); background:rgba(183,148,246,.07); }
.relic-node.node-locked { opacity:.62; }
.relic-node .node-req { font-size:13.5px; color:#b79af6; margin-top:3px; font-weight:700; }
.relic-node .buy-btn[disabled] { cursor:not-allowed; }
/* ---- Ascension (second prestige layer, inside the Prestige panel) ---- */
.relic-hero.asc-hero .rh-stat { background:rgba(255,215,106,.08); border-color:rgba(255,215,106,.32); }
.relic-hero.asc-hero .rh-val { color:#ffe38a; }
.relic-hero.asc-hero .rh-val.ready { color:#8be79a; }
.asc-bar { height:9px; border-radius:999px; background:rgba(255,255,255,.09); overflow:hidden; margin:0 0 14px; }
.asc-fill { height:100%; width:0%; background:linear-gradient(90deg,#ffd76a,#ff9d5c); transition:width .25s; }
.asc-node.node-owned { border-color:rgba(255,215,106,.4); background:rgba(255,215,106,.07); }
.asc-node .buy-btn[disabled] { cursor:not-allowed; }
.buy-btn.asc-cost { background:linear-gradient(180deg,#ffd76a,#e0a33c); border-color:#c98a24; color:#3a2a08; }
.buy-btn.asc-cost.cant { background:linear-gradient(180deg,#5a5148,#463f38); border-color:#3a342e; color:#9a917f; }
.buy-btn.asc-cost.maxed { background:linear-gradient(180deg,#4a5a48,#3a453a); border-color:#33402f; color:#9ac09a; }
.asc-warn { display:flex; gap:9px; align-items:flex-start; margin:2px 0 14px; padding:11px 14px;
  border-radius:12px; font-size:14.5px; line-height:1.45; color:#ffe0a8;
  background:rgba(255,168,74,.10); border:2px solid rgba(255,168,74,.34); }
.asc-warn b { color:#fff2cf; }
.asc-warn svg { flex:0 0 auto; margin-top:2px; }


#ui.compact .rb-head { gap:7px; margin-bottom:7px; padding-bottom:5px; }
#ui.compact .rb-head .rb-name { font-size:15px; }
#ui.compact .rb-head .rb-desc { font-size:12px; }
#ui.compact .rb-head .rb-lv { font-size:11px; padding:2px 8px; }
#ui.compact .relic-branch { margin-bottom:12px; }
#ui.compact .relic-node .node-req { font-size:11.5px; }
#ui.compact .asc-bar { height:7px; margin:0 0 9px; }
#ui.compact .asc-node .buy-btn { min-height:var(--tap); }
#ui.compact .asc-warn { font-size:11.5px; padding:7px 10px; gap:6px; margin:2px 0 9px; border-radius:9px; }


/* crush / convert */
.big-row { display:flex; gap:12px; margin:12px 0; flex-wrap:wrap; }
.action-btn { padding:14px 26px; border-radius:14px; font-size:18px; font-weight:800; cursor:pointer; border:2px solid rgba(255,205,120,.5); background:linear-gradient(180deg,#8a5a24,#5c3a14); color:#ffe8c2; transition:transform .1s; }
.action-btn:hover { transform:scale(1.05); }
.action-btn:active { transform:scale(.94); }
.action-btn.cant { opacity:.45; cursor:not-allowed; }
.reward-choice { min-width:250px; min-height:54px; }
.qbar { height:20px; background:rgba(0,0,0,.4); border-radius:10px; overflow:hidden; margin:10px 0; border:1px solid rgba(255,255,255,.12); }
.qfill { height:100%; background:linear-gradient(90deg,#ffb35c,#ff7a4f); width:0%; transition:width .15s linear; }
.qfill.gemfill { background:linear-gradient(90deg,#b06cff,#6cc8ff); }
.gem-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:12px; }
.gem-card { background:rgba(255,255,255,.05); border:2px solid rgba(255,255,255,.1); border-radius:14px; padding:12px; text-align:center; }
.gem-card .gico { font-size:30px; }
.gem-card .gname { font-weight:800; font-size:16px; margin-top:4px; }
.gem-card .gcount { font-size:21px; font-weight:800; color:#ffe38a; }
.gem-card .gval { font-size:14px; color:#9fb6d8; }

/* Gemdex */
.dex-cat { margin-bottom:16px; }
.dex-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:10px; }
.dex-item { background:rgba(255,255,255,.05); border:2px solid rgba(255,255,255,.1); border-radius:14px; padding:12px 8px; text-align:center; }
.dex-item.locked { opacity:.5; border-style:dashed; }
.dex-item .dex-ico { font-size:30px; height:34px; display:flex; align-items:center; justify-content:center; }
.dex-item.locked .dex-ico { color:#6a7a92; font-weight:900; }
.dex-item .dex-name { font-weight:700; font-size:14.5px; margin-top:4px; }
.dex-item .dex-val { font-size:13px; color:#9fb6d8; margin-top:2px; }
.dex-done { color:#8be79a; font-size:14px; font-weight:800; margin-left:6px; }

/* cosmetics */
.cos-cat { margin-bottom:18px; }
.cos-items { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.cos-item { background:rgba(255,255,255,.05); border:2px solid rgba(255,255,255,.1); border-radius:14px; padding:12px 8px; text-align:center; cursor:pointer; transition:border-color .12s; }
.cos-item:hover { border-color:#7fd1ff; }
.cos-item.equipped { border-color:#8be79a; background:rgba(139,231,154,.12); }
.cos-item .cico { font-size:30px; }
.cos-item .cname { font-size:14.5px; font-weight:700; margin-top:4px; }
.cos-item .cprice { font-size:14.5px; color:#ffe38a; font-weight:800; margin-top:3px; }
.cos-item .cprice.owned { color:#8be79a; }

/* portal */
.portal-hero { text-align:center; padding:8px 0 16px; }
.portal-hero .pico { font-size:70px; filter:drop-shadow(0 0 18px rgba(140,120,255,.8)); }
.biome-row { display:flex; align-items:center; gap:14px; background:rgba(255,255,255,.05); border:2px solid rgba(255,255,255,.1); border-radius:14px; padding:14px; margin-bottom:10px; }
.biome-row.active-biome { border-color:#ffd76a; }
.biome-row .bico2 { font-size:38px; }
.biome-row .binfo { flex:1; }
.biome-row .bname { font-weight:800; font-size:19px; }
.biome-row .bdesc { font-size:15px; color:#9fb6d8; line-height:1.4; }

/* settings */
.set-row { display:flex; align-items:center; justify-content:space-between; gap:16px; background:rgba(255,255,255,.05); border-radius:12px; padding:12px 16px; margin-bottom:10px; }
.set-row label { font-weight:700; font-size:17px; }
.set-row input[type=range] { width:280px; accent-color:#ffb35c; cursor:pointer; }
.set-row select { background:#22334f; color:#fff; border:2px solid rgba(255,255,255,.2); border-radius:8px; padding:8px 12px; font-size:16px; font-weight:700; cursor:pointer; }
.set-row .toggle { width:60px; height:32px; border-radius:16px; background:#3a4356; border:none; cursor:pointer; position:relative; transition:background .15s; }
.set-row .toggle.on { background:#2c6b3f; }
.set-row .toggle::after { content:''; position:absolute; top:4px; left:4px; width:24px; height:24px; border-radius:50%; background:#fff; transition:left .15s; }
.set-row .toggle.on::after { left:32px; }

.ghost-btn { padding:10px 18px; border-radius:12px; border:2px solid rgba(140,190,255,.35); background:rgba(30,45,75,.8); color:#cfe8ff; font-weight:800; font-size:15px; cursor:pointer; }
.ghost-btn:hover { border-color:#ffd76a; }
.danger-btn { border-color:rgba(255,120,120,.4); color:#ff9d9d; }

/* ---------- world-space fx ---------- */
.dmg-num { position:absolute; font-size:30px; font-weight:900; color:#fff; text-shadow:0 2px 0 #000, 0 0 8px rgba(0,0,0,.5); transform:translate(-50%,-50%); animation:dmgfloat .8s forwards; will-change:transform,opacity; }
.dmg-num.crit { color:#ffcf3f; font-size:44px; }
.dmg-num.heal { color:#8be79a; font-size:26px; }
@keyframes dmgfloat { 0% { opacity:0; transform:translate(-50%,-30%) scale(.5);} 15% { opacity:1; transform:translate(-50%,-60%) scale(1.15);} 100% { opacity:0; transform:translate(-50%,-190%) scale(1);} }
.hp-bar { position:absolute; width:110px; height:12px; background:rgba(0,0,0,.55); border:2px solid rgba(255,255,255,.5); border-radius:7px; transform:translate(-50%,-50%); overflow:hidden; }
.hp-fill { height:100%; background:linear-gradient(90deg,#8be79a,#ffd76a,#ff6b5c); background-size:110px 100%; transition:width .1s; }

/* ---------- cosmetic click effects ---------- */
.fx { position:absolute; pointer-events:none; transform:translate(-50%,-50%); will-change:transform,opacity; }
.fx-spark { width:24px; height:4px; border-radius:2px; background:linear-gradient(90deg,#fff3c8,#ffd76a 40%,transparent); transform-origin:0 50%; animation:fxspark .45s ease-out forwards; }
@keyframes fxspark {
  0%   { opacity:1; transform:translate(0,-2px) rotate(var(--rot)) translateX(4px) scaleX(.4); }
  100% { opacity:0; transform:translate(0,-2px) rotate(var(--rot)) translateX(40px) scaleX(1); }
}
.fx-star { font-size:24px; color:#ffd76a; text-shadow:0 0 10px rgba(255,215,106,.9); animation:fxpop .65s ease-out forwards; }
@keyframes fxpop {
  0%   { opacity:0; transform:translate(-50%,-50%) scale(.2) rotate(0deg); }
  25%  { opacity:1; }
  100% { opacity:0; transform:translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.25) rotate(170deg); }
}
.fx-heart { font-size:23px; color:#ff8ac8; text-shadow:0 0 9px rgba(255,138,200,.8); animation:fxrise .85s ease-out forwards; }
.fx-bubble { width:var(--s); height:var(--s); border:2.5px solid rgba(140,220,255,.9); border-radius:50%; background:rgba(140,220,255,.16); animation:fxrise .9s ease-out forwards; }
@keyframes fxrise {
  0%   { opacity:0; transform:translate(-50%,-50%) scale(.35); }
  20%  { opacity:1; }
  100% { opacity:0; transform:translate(calc(-50% + var(--dx)), calc(-50% - 78px)) scale(1); }
}
.fx-ring { width:16px; height:16px; border:4px solid #ffd76a; border-radius:50%; box-shadow:0 0 20px rgba(255,215,106,.85), inset 0 0 10px rgba(255,255,255,.6); animation:fxring .5s ease-out forwards; }
@keyframes fxring {
  0%   { opacity:1; transform:translate(-50%,-50%) scale(.3); }
  100% { opacity:0; transform:translate(-50%,-50%) scale(5); }
}

/* automation toggle rows + equipped card shimmer */
.auto-row { border:2px solid rgba(139,231,154,.3); }
.on-tag { color:#8be79a; font-size:12px; font-weight:800; margin-left:8px; letter-spacing:1px; }
.off-tag { color:#ff9d9d; font-size:12px; font-weight:800; margin-left:8px; letter-spacing:1px; }
.cos-item { transition:border-color .12s, transform .12s; }
.cos-item:hover { transform:translateY(-3px); }
.cos-item.equipped { animation:equipglow 2.2s infinite; }
@keyframes equipglow { 50% { box-shadow:0 0 14px rgba(139,231,154,.4); } }

/* toast + offline */
#toasts { display:flex; flex-direction:column; gap:5px; align-items:flex-end; pointer-events:none; width:100%; max-width:280px; }
.toast { background:rgba(12,22,40,.88); border:2px solid rgba(255,215,106,.45); color:rgba(255,232,176,.94); padding:7px 12px; border-radius:10px; font-weight:700; font-size:15px; line-height:1.3; max-width:280px; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; animation:toastin 2.8s forwards; text-shadow:0 1px 0 rgba(0,0,0,.45); backdrop-filter:blur(5px); box-shadow:0 4px 14px rgba(0,0,0,.35); }
.toast svg.icon { vertical-align:-3px; margin-right:2px; }
@keyframes toastin { 0% { opacity:0; transform:translateX(18px);} 10% { opacity:1; transform:none;} 82% { opacity:1;} 100% { opacity:0; transform:translateX(10px);} }

#offline-pop, #daily-pop, #guardian-break { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(4,8,16,.6); z-index:55; }
.offline-breakdown { display:flex; justify-content:center; gap:8px; flex-wrap:wrap; margin:4px 0 10px; }
.offline-breakdown span { padding:5px 10px; border:1px solid rgba(127,209,255,.32); border-radius:16px; background:rgba(127,209,255,.08); color:#bcd2ef; font-size:13px; font-weight:700; }
.offline-breakdown b { color:#eaf6ff; }
.offline-note { max-width:620px; margin:0 auto; color:#9fb6d8; font-size:13.5px; line-height:1.45; }
.offline-note b { color:#ffe38a; }
.off-card { background:linear-gradient(180deg,#1b2a44,#111c31); border:3px solid #ffd76a; border-radius:20px; padding:34px 48px; text-align:center; color:#fff; max-width:92%; }
.off-card h2 { color:#ffd76a; margin-bottom:10px; font-size:30px; display:flex; align-items:center; justify-content:center; gap:8px; }
.off-card .off-amt { font-size:36px; font-weight:900; color:#ffe38a; margin:12px 0; }
#daily-pop .off-card { border-color:#8be79a; }
#daily-pop .off-card h2 { color:#8be79a; }
.guardian-result-card { min-width:440px; }
.guardian-result-rewards { color:#ffe38a; font-size:21px; font-weight:800; margin:12px 0; }
.guardian-ad-countdown { color:#cfe0f0; font-size:16px; margin-top:12px; }
.guardian-ad-countdown b { color:#fff; }

/* One lock covers canvas and DOM controls throughout the SDK auction. The ad is
   rendered outside the game layer, so this cannot block the creative itself. */
#ui.ad-locked { pointer-events:none; }
.daily-track { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin:14px 0 6px; }
.dt-cell { width:44px; height:44px; border-radius:10px; background:rgba(255,255,255,.06); border:2px solid rgba(255,255,255,.14); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:17px; color:#9fb6d8; }
.dt-cell.done { background:rgba(139,231,154,.16); border-color:rgba(139,231,154,.5); color:#8be79a; }
.dt-cell.today { background:linear-gradient(180deg,#2c6b3f,#1d4a2c); border-color:#ffd76a; color:#ffe38a; transform:scale(1.12); box-shadow:0 0 14px rgba(255,215,106,.4); }

/* confirm dialog (custom, replaces blocked window.confirm) */
#confirm-pop { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(4,8,16,.66); z-index:60; }
#confirm-pop .off-card { border-color:#ff8a6a; max-width:520px; }
#confirm-pop .off-card h2 { color:#ff9d7a; }
#confirm-pop .cf-msg { font-size:17px; line-height:1.5; margin:4px 0 6px; color:#e6eeff; }
#confirm-pop .cf-row { display:flex; justify-content:center; gap:14px; margin-top:22px; }
#confirm-pop .danger-btn { border-color:#ff8a6a; background:linear-gradient(180deg,#8a2e24,#5c1a14); color:#ffd9cc; }

/* tutorial */
#tut-box { position:absolute; left:50%; bottom:140px; transform:translateX(-50%); width:640px; background:rgba(10,20,38,.94); border:3px solid #7fd1ff; border-radius:18px; padding:18px 22px; color:#fff; text-align:center; box-shadow:0 10px 40px rgba(0,0,0,.5); transition:bottom .25s; }
#tut-box.world-target { top:145px; bottom:auto; }
/* .menu-open, not :has(#panel-wrap.open): openPanel/closePanel toggle the class in
   lockstep with the panel, and :has() only shipped in Firefox 121 — on the older
   Firefox that real players are still on, a :has() rule is dropped silently and the
   tutorial box sat on top of the open panel. */
#ui.menu-open #tut-box { top:auto; bottom:6px; z-index:5; }
#tut-box .tstep { color:#7fd1ff; font-size:14px; font-weight:800; letter-spacing:1px; }
#tut-box .ttext { font-size:22px; font-weight:700; margin:8px 0 12px; line-height:1.45; }
#tut-ring { position:absolute; width:90px; height:90px; border:5px solid #ffd76a; border-radius:50%; transform:translate(-50%,-50%); animation:ringpulse 1s infinite; box-shadow:0 0 20px rgba(255,215,106,.7); }
@keyframes ringpulse { 50% { transform:translate(-50%,-50%) scale(1.25); opacity:.6; } }

/* Shown when the WebGL context goes away — sits inside #frame so it covers the game
   but not the page, and stays above every panel. */
#fatal { position:absolute; inset:0; z-index:90; display:flex; align-items:center; justify-content:center;
  background:rgba(4,8,16,.82); backdrop-filter:blur(3px); }
#fatal .fatal-card { background:linear-gradient(180deg,#1b2a44,#111c31); border:3px solid #ff8a6a;
  border-radius:18px; padding:22px 28px; text-align:center; color:#fff; max-width:80%;
  display:flex; flex-direction:column; gap:14px; align-items:center; }
#fatal .fatal-msg { font-size:19px; font-weight:700; line-height:1.45; }

.hidden { display:none !important; }

/* ============================================================================
   Compact UI — phones in landscape
   ----------------------------------------------------------------------------
   The layer above is authored against 1920x1080. A phone in landscape gives the
   scaled layer roughly 1083x500 of LOGICAL room, which is less than half the
   height the layout assumes: the HUD chips ran into the stat chip, the ten
   bottom-bar buttons wrapped onto a second row that reached the zoom buttons,
   and the panel was left ~220 real px tall with its content scrolling past ten
   screens. Everything below re-tunes those pieces for that budget.

   The switch is a class, not a media query, on purpose: #ui is transform-scaled,
   so the viewport size says nothing about the space the layout actually has.
   main.js sets .compact from the layer's own logical height (COMPACT_UI_H).
   ============================================================================ */

/* Sizes here are LOGICAL px inside the scaled layer, not screen px. In compact
   mode the layer always sits at the 0.75 scale floor (a frame wide enough to
   scale past it is also too tall to be compact), so --tap is the logical size
   that lands on a ~44px physical touch target. Use it for anything tappable. */
#ui.compact { --tap:59px; }

/* ---------- HUD + corner chips ---------- */
#ui.compact #hud { top:10px; gap:7px; padding:0 190px; }
#ui.compact .res { min-width:0; gap:6px; padding:6px 11px 6px 8px; border-radius:13px; border-width:2px; }
#ui.compact .res .ico { font-size:21px; }
#ui.compact .res .ico svg.icon { width:21px; height:21px; }
#ui.compact .res .val { font-size:20px; }
#ui.compact .res .lbl { font-size:10.5px; letter-spacing:.5px; margin-top:-2px; }

#ui.compact #stat-chip { top:10px; left:12px; padding:6px 10px; font-size:13px; line-height:1.45; border-radius:11px; }

#ui.compact #quest-chip { top:70px; left:12px; width:178px; padding:7px 10px; border-radius:11px; }
#ui.compact #quest-chip .qc-title { font-size:14px; }
#ui.compact #quest-chip .qc-desc { font-size:11.5px; margin:1px 0 5px; }
#ui.compact #quest-chip .qc-bar { height:9px; }
#ui.compact #quest-chip .qc-count { font-size:11.5px; margin-top:3px; }

#ui.compact #return-chip { top:160px; left:12px; width:178px; min-height:52px; gap:7px; padding:6px 9px; border-radius:11px; }
#ui.compact #return-chip .rc-ico { width:25px; height:25px; flex-basis:25px; }
#ui.compact #return-chip .rc-ico svg.icon { width:21px; height:21px; }
#ui.compact #return-chip .rc-title { font-size:12px; }
#ui.compact #return-chip .rc-sub { font-size:10.5px; }

#ui.compact #boost-badges { top:64px; padding:0 190px; }
#ui.compact .boost-badge { font-size:12px; padding:4px 9px; border-radius:10px; }

#ui.compact #combo { top:104px; font-size:23px; }
#ui.compact #combo.mid { font-size:26px; }
#ui.compact #combo.hot { font-size:30px; }
#ui.compact #combo .combo-mult { font-size:12px; }

/* ---------- top-right controls ---------- */
#ui.compact #top-bar { top:10px; right:12px; gap:5px; max-width:min(300px, 34%); }
#ui.compact #top-bar .ghost-btn { padding:8px 11px; font-size:12.5px; min-height:var(--tap); border-radius:10px; }
#ui.compact .crew-toggle .crew-lbl { font-size:11.5px; }
#ui.compact #toasts { max-width:210px; }
#ui.compact .toast { font-size:12px; padding:5px 9px; max-width:210px; }
#ui.compact #crew-offer { top:82px; right:12px; width:230px; min-height:72px; grid-template-columns:34px 1fr auto;
  gap:6px; padding:8px; border-radius:12px; }
#ui.compact .crew-offer-close { top:-9px; right:-9px; width:var(--tap); height:var(--tap); font-size:18px; }
#ui.compact .co-icon { width:34px; height:34px; }
#ui.compact .co-title { font-size:12.5px; }
#ui.compact .co-sub { font-size:10.5px; }
#ui.compact .co-watch { min-height:var(--tap); padding:7px 9px; font-size:11.5px; }

/* ---------- bottom bar: all ten buttons on one row ---------- */
/* min-width/height keep every button a comfortable target once the 0.75 layer
   scale is applied (60 logical px lands at 45 real px). */
/* Wrapping stays on: at the compact sizes the ten buttons total ~700 logical px,
   so they sit on one row on any landscape phone and only fall to a second row on a
   layer too narrow to hold them (portrait) — where wrapping beats spilling out of
   the frame. */
#ui.compact #bottom-bar { bottom:10px; gap:6px; padding:0 8px; }
#ui.compact .bar-btn {
  padding:6px 7px; font-size:11.5px; gap:1px; border-radius:12px; border-width:2px;
  min-width:var(--tap); min-height:var(--tap); flex:0 1 auto;
}
#ui.compact .bar-btn .bico { height:24px; font-size:22px; }
#ui.compact .bar-btn .bico svg.icon { width:23px; height:23px; }
#ui.compact .bar-btn:hover { transform:none; }   /* no hover state on touch */
#ui.compact .nav-badge { top:-6px; right:-6px; min-width:22px; height:22px; padding:0 5px; font-size:11px; border-width:2px; }

/* ---------- zoom buttons: clear of the bottom bar ---------- */
#ui.compact #zoom-btns { bottom:88px; right:12px; gap:6px; }
#ui.compact .zoom-btn { width:var(--tap); height:var(--tap); font-size:24px; border-radius:12px; }

/* ---------- panel ---------- */
#ui.compact #panel-wrap { padding-bottom:10px; }
#ui.compact #panel { width:98%; border-width:2px; border-radius:16px; }
#ui.compact #panel-tabs { padding:7px 50px 0 8px; gap:3px; }
#ui.compact .ptab { font-size:12.5px; padding:9px 3px; min-height:var(--tap); border-radius:9px 9px 0 0; }
#ui.compact #panel-close { top:7px; right:7px; width:var(--tap); height:var(--tap); font-size:18px; border-radius:10px; }
#ui.compact #panel-body { padding:12px 14px; }

#ui.compact .sect-title { font-size:17px; margin:4px 0 8px; gap:7px; }
#ui.compact .sect-note { font-size:12.5px; margin-bottom:9px; line-height:1.45; }
#ui.compact .quest-jumpbar { gap:5px; margin:-5px 0 10px; padding:5px; border-radius:10px; }
#ui.compact .quest-jumpbar .ghost-btn { min-height:var(--tap); padding:7px 6px; font-size:11px; }

#ui.compact .upg { gap:9px; padding:8px 10px; margin-bottom:7px; border-radius:11px; }
#ui.compact .upg .uico { font-size:24px; width:32px; }
#ui.compact .upg .uname { font-size:14.5px; }
#ui.compact .upg .uname .ulvl { font-size:12.5px; margin-left:6px; }
#ui.compact .upg .udesc, #ui.compact .upg .ueff { font-size:12px; }
#ui.compact .buy-btn { min-width:104px; padding:9px 10px; font-size:13px; min-height:var(--tap); border-radius:10px; }
#ui.compact .buy-btn:hover, #ui.compact .action-btn:hover, #ui.compact .cos-item:hover { transform:none; }
#ui.compact .shop-boosts { margin:7px 0 11px; padding:8px; border-radius:11px; }
#ui.compact .shop-boosts-title { margin-bottom:7px; font-size:13px; }
#ui.compact .shop-boost-grid { grid-template-columns:repeat(4,minmax(108px,1fr)); gap:6px; overflow-x:auto; padding-bottom:3px; }
#ui.compact .shop-boost-card { padding:8px 6px; border-radius:10px; }
#ui.compact .shop-boost-card .sbc-name { min-height:29px; font-size:11.5px; }
#ui.compact .shop-boost-card .sbc-desc { font-size:10px; }
#ui.compact .shop-boost-card .buy-btn { min-height:var(--tap); font-size:11px; }
#ui.compact .action-btn { padding:11px 18px; font-size:14.5px; min-height:var(--tap); border-radius:11px; }
#ui.compact .ghost-btn { padding:9px 13px; font-size:12.5px; min-height:var(--tap); }
#ui.compact .reward-choice { min-width:190px; min-height:var(--tap); }
#ui.compact .exp-claim-actions { min-width:170px; gap:5px; }
#ui.compact .exp-claim-actions .buy-btn { min-width:170px; }

#ui.compact .ach-grid, #ui.compact .gem-grid { grid-template-columns:repeat(2,1fr); gap:7px; }
#ui.compact .cos-items { grid-template-columns:repeat(3,1fr); gap:7px; }
#ui.compact .dex-grid { grid-template-columns:repeat(auto-fit, minmax(96px, 1fr)); gap:7px; }
#ui.compact .ach-card, #ui.compact .gem-card, #ui.compact .cos-item, #ui.compact .dex-item {
  padding:9px 8px; border-radius:11px;
}
#ui.compact .ach-card .aname { font-size:13px; }
#ui.compact .ach-card .adesc { font-size:11.5px; }
#ui.compact .gem-card .gname, #ui.compact .cos-item .cname, #ui.compact .dex-item .dex-name { font-size:12.5px; }
#ui.compact .gem-card .gcount { font-size:16px; }

#ui.compact .quest-card { gap:11px; padding:11px 12px; margin-bottom:9px; border-radius:12px; }
#ui.compact .quest-card .qico { font-size:30px; }
#ui.compact .roadmap-grid { grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); gap:7px; margin-bottom:10px; }
#ui.compact .roadmap-card { min-height:118px; padding:9px 10px; border-radius:11px; }
#ui.compact .roadmap-card:hover { transform:none; }
#ui.compact .rm-head { gap:6px; }
#ui.compact .rm-ico { width:23px; height:23px; flex-basis:23px; }
#ui.compact .rm-name { font-size:12.5px; }
#ui.compact .rm-state { padding:1px 5px; font-size:9px; }
#ui.compact .rm-progress { min-height:28px; margin-top:6px; font-size:11.5px; }
#ui.compact .rm-bar { height:7px; margin:5px 0 6px; }
#ui.compact .rm-benefit { font-size:10.5px; }
#ui.compact .roadmap-count { padding:1px 8px; font-size:11px; }
#ui.compact .sect-title.after-roadmap { margin-top:13px; }
#ui.compact .biome-row { gap:10px; padding:10px; margin-bottom:7px; border-radius:11px; }
#ui.compact .biome-row .bico2 { font-size:27px; }
#ui.compact .biome-row .bname { font-size:15px; }
#ui.compact .biome-row .bdesc { font-size:12px; }
#ui.compact .portal-hero { padding:4px 0 9px; }
#ui.compact .portal-hero .pico { font-size:46px; }
#ui.compact .relic-hero { gap:8px; margin:4px 0 10px; }
#ui.compact .relic-hero .rh-stat { min-width:92px; padding:9px 7px; border-radius:11px; }
#ui.compact .relic-hero .rh-val { font-size:21px; }
#ui.compact .relic-hero .rh-lbl { font-size:11px; }

#ui.compact .set-row { gap:10px; padding:8px 11px; margin-bottom:7px; border-radius:10px; }
#ui.compact .set-row label { font-size:13px; }
#ui.compact .set-row input[type=range] { width:150px; }
#ui.compact .set-row select { padding:7px 9px; font-size:13px; min-height:var(--tap); }
#ui.compact .user-card { gap:10px; padding:9px 11px; margin-bottom:10px; border-radius:11px; }
#ui.compact .user-card .user-av { width:40px; height:40px; }
#ui.compact .user-card .user-name { font-size:14.5px; }
#ui.compact .user-card .user-sub { font-size:11.5px; }

/* ---------- popups: must never outgrow the layer ---------- */
#ui.compact .off-card { padding:16px 20px; border-width:2px; border-radius:15px; max-width:94%; max-height:92%; overflow-y:auto; }
#ui.compact .off-card h2 { font-size:20px; margin-bottom:6px; gap:6px; }
#ui.compact .off-card .off-amt { font-size:25px; margin:7px 0; }
#ui.compact .guardian-result-card { min-width:0; }
#ui.compact .guardian-result-rewards { font-size:16px; margin:8px 0; }
#ui.compact .guardian-ad-countdown { font-size:13px; margin-top:8px; }
#ui.compact .offline-breakdown { gap:5px; margin-bottom:7px; }
#ui.compact .offline-breakdown span { padding:3px 7px; font-size:10.5px; }
#ui.compact .offline-note { font-size:11px; line-height:1.35; }
#ui.compact .daily-track { gap:5px; margin:9px 0 4px; }
#ui.compact .dt-cell { width:33px; height:33px; font-size:13px; border-radius:8px; }
#ui.compact #confirm-pop .cf-msg { font-size:13px; }
#ui.compact #confirm-pop .cf-row { gap:10px; margin-top:14px; }

/* ---------- tutorial ---------- */
#ui.compact #tut-box { width:min(520px, 92%); bottom:88px; padding:11px 14px; border-width:2px; border-radius:14px; }
#ui.compact #tut-box.world-target { top:96px; bottom:auto; }
#ui.compact #tut-box .tstep { font-size:11px; }
#ui.compact #tut-box .ttext { font-size:15px; margin:5px 0 8px; line-height:1.4; }
#ui.compact #tut-ring { width:64px; height:64px; border-width:4px; }

/* ---------- portrait fallback ----------
   The game is submitted landscape-only, so the platform asks the player to rotate
   before they ever get here. This just keeps that moment tidy: the layer is too
   narrow for one row of buttons, so the two secondary chips step aside rather than
   sit underneath the second row. */
#ui.compact.narrow #stat-chip, #ui.compact.narrow #quest-chip, #ui.compact.narrow #return-chip { display:none; }
/* the button bar needs two rows here, so the HUD drops below the top-bar controls
   instead of sharing their line, and pinch replaces the zoom buttons */
#ui.compact.narrow #hud { top:78px; padding:0 12px; }
#ui.compact.narrow #zoom-btns { display:none; }
#ui.compact.narrow #bottom-bar { gap:5px; }
/* transient decorations only — keep the optional crew offer available on mobile */
#ui.compact.narrow #boost-badges, #ui.compact.narrow #combo { display:none; }
#ui.compact.narrow #crew-offer { top:142px; right:10px; width:220px; }

/* ---------- world-space fx (the fx layer is scaled the same way) ---------- */
#fx-layer.compact .dmg-num { font-size:22px; }
#fx-layer.compact .dmg-num.crit { font-size:31px; }
#fx-layer.compact .dmg-num.heal { font-size:19px; }
#fx-layer.compact .hp-bar { width:78px; height:9px; }
