/* Apex Idle: portrait, dark navy panels with gold accents */
#screen-idle {
  --i-bg: #10141d; --i-panel: #1b2230; --i-panel2: #232c3d; --i-line: rgba(255, 255, 255, 0.08); --i-text: #e9ecf3;
  --i-muted: #98a2b8; --i-gold: #f2c14e; --i-gold2: #c8922a; --i-green: #3ecf5a; --i-red: #d23c43; --i-blue: #5ad1e8;
  padding: 0; background: var(--i-bg); color: var(--i-text);
}
.idle { position: absolute; inset: 0; }
.i-loading { display: grid; place-items: center; height: 100%; color: var(--i-muted); font-weight: 700; }
.i-shell {
  position: absolute; inset: 0; display: flex; flex-direction: column; margin: 0 auto; max-width: 560px;
  padding: 0 calc(var(--sar) + 10px) 0 calc(var(--sal) + 10px);
}
.i-shell h2, .i-shell h3 { text-shadow: none; color: var(--i-text); letter-spacing: 0.5px; }
.i-shell h2 { font-size: 18px; margin: 0; }
.i-shell h3 { font-size: 13px; margin: 0 0 8px; color: #cfd5e3; display: flex; align-items: center; gap: 6px; }
.i-shell h3 small, .i-shell h2 small { font-weight: 700; color: var(--i-muted); text-transform: none; letter-spacing: 0; margin-left: auto; font-size: 12px; }
.i-shell h2 small { margin-left: 6px; }
.muted { color: var(--i-muted); font-size: 13px; margin: 0 0 8px; }

/* ---- top bar ---- */
/* a flat bar in the page colour from the very top edge: Safari shows a blurred copy of it behind its status
   bar, and a plain colour there does not look foggy */
/* the top menu: a slightly lighter bar with a gold line and a shadow, so it reads as separate from the page */
.i-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #10141d 0%, #1a2232 100%);
  border-bottom: 2px solid rgba(242, 193, 78, 0.55);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 6px 14px rgba(0, 0, 0, 0.45);
  margin: 0 -10px 4px; padding: calc(var(--sat) + 2px) 10px 8px; }
/* upright: the bar's content sits 2% of the screen lower; the navy still runs up to the top edge */
@media (orientation: portrait) { .i-top { padding-top: calc(var(--sat) + 2px + 2vh); } .i-toasts { top: calc(var(--sat) + 60px + 2vh); } }.i-ic { appearance: none; border: 1px solid var(--i-line); background: var(--i-panel2); color: var(--i-text); width: 38px; height: 38px; border-radius: 10px; font-size: 17px; flex: none; cursor: pointer; }
.i-wealth { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; font-size: 13px; min-width: 0; }
.i-wealth .lbl { color: var(--i-muted); font-size: 11px; }
.i-wealth .v { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.i-wealth .v i { font-style: normal; font-size: 13px; }
.i-wealth .cash b { color: #ffe08a; }

/* ---- current training ---- */
.i-active { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 8px 10px; border-radius: 12px; background: linear-gradient(180deg, #222b3c, #1a2130); border: 1px solid var(--i-line); }
.i-active.idle-none { opacity: 0.85; }
.i-act-ic { position: relative; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; flex: none;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c, #888) 45%, #2a3346), #161c28); border: 1px solid color-mix(in srgb, var(--c, #888) 60%, transparent); }
.i-act-ic em, .i-skill em { position: absolute; top: -6px; left: -6px; font-style: normal; font-size: 11px; font-weight: 900; min-width: 22px; height: 18px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center; background: #0c0f15; border: 1px solid var(--i-line); color: #fff; }
.i-act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.i-act-body small { color: var(--i-muted); font-size: 12px; }
.i-act-title { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; color: #ffe08a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.i-act-side { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.i-act-side small { color: var(--i-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.i-stop { appearance: none; border: 1px solid #ff8b8f; background: linear-gradient(#e24b52, #a3242b); color: #fff; font: 900 12px system-ui, sans-serif; letter-spacing: 1px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }

/* ---- bars ---- */
.i-bar { position: relative; height: 10px; border-radius: 6px; background: #0b0e15; border: 1px solid var(--i-line); overflow: hidden; }
.i-bar.big { height: 18px; border-radius: 9px; }
.i-bar > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #3aa6c8, #5ad1e8); border-radius: inherit; }
.i-bar .bt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.i-bar.big .bt { font-size: 11.5px; }
.i-card .i-bar, .i-quest .i-bar { height: 16px; border-radius: 8px; margin: 4px 0; }
.i-bar.red > i { background: linear-gradient(90deg, #a3242b, #ff6b6b); }
.story .i-bar > i, .daily .i-bar > i { background: linear-gradient(90deg, var(--i-gold2), var(--i-gold)); }

/* ---- main scroller and bottom nav ---- */
.i-main { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 14px; }
/* sits low: partly over the home bar area, which still leaves the buttons easy to tap */
.i-nav { display: flex; gap: 6px; padding: 6px 0 max(0px, calc(var(--sab) - 16px - 2vh)); background: var(--i-bg); border-top: 1px solid var(--i-line); }
/* in Safari (not from the home screen) its toolbar floats over the bottom edge: keep the buttons clear of it */
@media (display-mode: browser) { .i-nav { padding-bottom: max(2px, calc(var(--sab) + 6px - 2vh)); } }
.i-nav button { position: relative; flex: 1; appearance: none; border: 1px solid var(--i-line); background: var(--i-panel); color: var(--i-muted); border-radius: 12px; padding: 5px 0 6px;
  font: 800 10.5px system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.i-nav button span { font-size: 21px; line-height: 1.1; }
.i-nav button.on { color: #ffe08a; border-color: var(--i-gold); background: linear-gradient(180deg, #2d2a1d, #1b2230); box-shadow: 0 0 10px rgba(242, 193, 78, 0.25); }
.i-nav .dot { position: absolute; top: 4px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--i-red); box-shadow: 0 0 6px var(--i-red); }
.i-nav .dot.gold { background: var(--i-gold); box-shadow: 0 0 6px var(--i-gold); }

/* ---- skills ---- */
.i-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; background: var(--i-panel); border: 1px solid var(--i-line); border-radius: 14px; }
.i-skill { position: relative; appearance: none; cursor: pointer; border: 1px solid var(--i-line); background: var(--i-panel2); color: var(--i-text); border-radius: 12px; padding: 10px 4px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; font: inherit; overflow: hidden; }
.i-skill em { top: 4px; left: auto; right: 4px; }
.i-skill .ic { font-size: 30px; line-height: 1.1; }
.i-skill b { font-size: 11.5px; font-weight: 700; }
.i-skill u { position: absolute; left: 8px; right: 8px; bottom: 4px; height: 3px; border-radius: 2px; background: #0b0e15; text-decoration: none; }
.i-skill u::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--f, 0) * 100%); background: var(--c); border-radius: 2px; }
.i-skill.sel { border-color: var(--i-gold); box-shadow: inset 0 0 0 1px var(--i-gold), 0 0 12px rgba(242, 193, 78, 0.25); }
.i-skill.busy { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 25%, #232c3d), #232c3d); }
.i-skill .on { position: absolute; top: 6px; left: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--i-green); box-shadow: 0 0 6px var(--i-green); }
.i-discover { margin: 8px 0; padding: 10px; border: 1px dashed rgba(255, 255, 255, 0.18); border-radius: 12px; text-align: center; color: var(--i-muted); font-size: 13px; font-weight: 700; }
.i-discover small { display: block; font-weight: 500; font-size: 11.5px; }

.i-card { background: var(--i-panel); border: 1px solid var(--i-line); border-radius: 14px; padding: 12px; margin: 8px 0; }
.i-card p { margin: 4px 0 8px; font-size: 13px; color: #c4cbda; }
.i-card.hero { background: linear-gradient(160deg, #2a2a1c, #1b2230 60%); border-color: rgba(242, 193, 78, 0.3); }
.skillp .sp-head { display: flex; gap: 10px; align-items: center; }
.skillp .sp-head .ic { font-size: 32px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 22%, #161c28); flex: none; }
.skillp .sp-head h2 { font-size: 22px; font-variant: small-caps; }
.skillp .sp-head p { margin: 2px 0 0; color: var(--i-muted); font-size: 12px; }
.skillp > .i-bar { height: 10px; margin: 10px 0 3px; }
.skillp > .i-bar > i { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000), var(--c)); }
.sp-xp { text-align: right; color: var(--i-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sp-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }
.i-pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 10px; background: var(--i-panel2); border: 1px solid var(--i-line); font-size: 12.5px; font-weight: 700; }
.i-pill.boost { color: #ffe08a; }
.i-pill.capped { border-color: var(--i-gold); }

.i-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border-radius: 10px; background: var(--i-panel2); border: 1px solid var(--i-line); color: var(--i-text); font-size: 13px; font-weight: 700; margin: 0; cursor: pointer; }
.i-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.i-toggle i { position: relative; width: 44px; height: 26px; border-radius: 13px; background: #0b0e15; border: 1px solid var(--i-line); transition: background 0.2s; }
.i-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #cfd5e3; transition: transform 0.2s; }
.i-toggle input:checked + i { background: var(--i-green); }
.i-toggle input:checked + i::after { transform: translateX(18px); background: #fff; }

.i-gear { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: linear-gradient(90deg, rgba(62, 207, 90, 0.12), rgba(62, 207, 90, 0.03)); border: 1px solid rgba(62, 207, 90, 0.3); }
.i-gear .ic { font-size: 26px; }
.i-gear .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.i-gear .txt b { color: var(--i-green); font-size: 14px; }
.i-gear .txt small { color: var(--i-muted); font-size: 11.5px; }
.i-gear .txt .next { color: #c4cbda; }

/* ---- lists ---- */
.i-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.i-list.flat { gap: 6px; }
.i-train, .i-row, .i-district, .i-quest { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--i-panel); border: 1px solid var(--i-line); }
.i-list.flat .i-row, .i-list.flat .i-quest { background: var(--i-panel2); }
.i-train .ic, .i-row .ic, .i-district .ic, .i-quest .ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 24px; flex: none; background: #141a26; border: 1px solid var(--i-line); }
.i-train .ic { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 30%, #2a3346), #141a26); }
.i-row .ic.on { box-shadow: 0 0 0 2px var(--i-green); }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.txt b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
.txt b small { color: var(--i-muted); font-weight: 700; font-size: 11.5px; }
.txt small { color: var(--i-muted); font-size: 12px; }
.txt .xp { color: var(--i-blue); }
.txt .cash, .cash { color: #ffe08a; }
.i-train.active { border-color: var(--i-gold); background: linear-gradient(90deg, #2d2a1d, #1b2230); }
.i-train.locked, .i-row.locked { opacity: 0.45; }
.i-row.owned { opacity: 0.75; }
.i-row.next { border-color: rgba(242, 193, 78, 0.45); }
.lock, .own, .busy { font-size: 12px; font-weight: 800; color: var(--i-muted); white-space: nowrap; }
.own { color: var(--i-green); }
.busy { color: #ffe08a; }
.i-empty { color: var(--i-muted); text-align: center; padding: 10px; font-size: 13px; }

.i-btn { appearance: none; cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.15); background: var(--i-panel2); color: var(--i-text); border-radius: 10px;
  padding: 9px 14px; font: 900 13px system-ui, sans-serif; white-space: nowrap; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.i-btn small { font-size: 10.5px; font-weight: 700; opacity: 0.85; }
.i-btn.gold { background: linear-gradient(#ffd977, #e0a526); color: #2a1d00; border-color: #ffe9a8; box-shadow: 0 0 10px rgba(242, 193, 78, 0.3); }
.i-btn.red { background: linear-gradient(#e24b52, #a3242b); color: #fff; border-color: #ff8b8f; }
.i-btn.ghost { background: transparent; color: var(--i-muted); }
.i-btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.i-btn:active:not(:disabled) { transform: scale(0.97); }
.i-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.i-center { display: flex; justify-content: center; margin: 10px 0 4px; }
.i-form { display: flex; gap: 8px; }
.i-form input { flex: 1; min-height: 42px; border-radius: 10px; border: 1px solid var(--i-line); background: #0b0e15; color: var(--i-text); padding: 8px 12px; font-size: 16px; }
.i-note { color: var(--i-muted); font-size: 12px; text-align: center; margin: 10px 6px; }
.i-note.left { text-align: left; margin: 4px 2px 8px; line-height: 1.4; }
.i-warn { margin: 6px 0; padding: 8px 10px; border-radius: 10px; font-size: 13px; color: #ffd9b0 !important; background: rgba(255, 154, 107, 0.12); border: 1px solid rgba(255, 154, 107, 0.45); }
.i-note b { color: #cfd5e3; }
/* success chance and averages per hour */
.i-rates { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; font-weight: 800; color: var(--i-muted); font-variant-numeric: tabular-nums; }
.i-rates .xp, .txt .rates .xp { color: var(--i-blue); }
.i-rates .cash { color: #ffe08a; }
.txt small.rates { font-weight: 700; font-variant-numeric: tabular-nums; }
.sc.lo { color: #ff9a6b; }
.sc.md { color: var(--i-gold); }
.sc.hi { color: var(--i-green); }

/* ---- family ---- */
.fam-head .fh-top { display: flex; gap: 10px; align-items: center; }
.fam-head .crest { font-size: 30px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(#3b3220, #1b1a14); border: 1px solid rgba(242, 193, 78, 0.5); }
.fam-head small { color: var(--i-muted); font-size: 12px; }
.i-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.i-stats span { background: var(--i-panel2); border: 1px solid var(--i-line); border-radius: 10px; padding: 7px 4px; text-align: center; display: flex; flex-direction: column; }
.i-stats b { font-size: 14px; font-variant-numeric: tabular-nums; }
.i-stats small { font-size: 11px; }
.i-goal b { font-size: 13px; }
.i-goal small { display: block; color: var(--i-muted); font-size: 11.5px; }
.i-goal .i-bar > i { background: linear-gradient(90deg, #2f9b45, var(--i-green)); }
.i-row .lv { display: grid; grid-template-columns: repeat(2, auto); gap: 2px 6px; font-size: 11px; font-weight: 800; }
.i-row .lv i { font-style: normal; color: var(--c); white-space: nowrap; }
.live { color: var(--i-green); }
.heist.live { border-color: rgba(242, 193, 78, 0.55); background: linear-gradient(160deg, #2a2618, #1b2230 70%); }
.heist .role { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.heist .role .i-bar > i { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, #000), var(--c)); }
.reward { margin-top: 8px; font-size: 12.5px; color: #c4cbda; }
.reward b { color: #ffe08a; }
.i-timer { font-variant-numeric: tabular-nums; }
.i-log { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; font-size: 13px; }
.i-log li { padding: 6px 0; border-bottom: 1px solid var(--i-line); color: #c4cbda; }
.i-log time { display: block; font-size: 10.5px; color: var(--i-muted); }

/* ---- city ---- */
.i-district { border-left: 4px solid var(--o); }
.i-district .owner { color: var(--o); font-weight: 800; }
.i-district.mine { background: linear-gradient(90deg, rgba(62, 207, 90, 0.13), var(--i-panel) 60%); }
.good { color: var(--i-green); font-weight: 800; }
.mid { color: var(--i-gold); font-weight: 800; }
.bad { color: #ff7b80; font-weight: 800; }
.war { border-color: rgba(210, 60, 67, 0.6); background: linear-gradient(160deg, #2e1b1e, #1b2230 70%); }
.i-board { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.i-board li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--i-line); }
.i-board .pl { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--i-panel2); font-size: 11px; font-weight: 900; }
.i-board li:nth-child(1) .pl { background: linear-gradient(#fff2a8, #c8922a); color: #2a1d00; }
.i-board li:nth-child(2) .pl { background: linear-gradient(#fff, #8a959c); color: #222; }
.i-board li:nth-child(3) .pl { background: linear-gradient(#ffd2a6, #8a4f1d); color: #2a1200; }
.i-board small { color: var(--i-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.i-board .tl { font-weight: 800; color: #ffe08a; font-variant-numeric: tabular-nums; }

/* ---- quests ---- */
.i-quest.ready { border-color: var(--i-gold); box-shadow: 0 0 10px rgba(242, 193, 78, 0.25); }
.i-quest.claimed { opacity: 0.55; }
.chest { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px; border-radius: 12px; background: var(--i-panel2); border: 1px dashed rgba(242, 193, 78, 0.4); }
.chest .big { font-size: 32px; }
.chest.ready { border-style: solid; border-color: var(--i-gold); animation: glow 1.4s ease-in-out infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 4px rgba(242, 193, 78, 0.3); } to { box-shadow: 0 0 16px rgba(242, 193, 78, 0.7); } }
.story h2 { color: #ffe08a; margin: 2px 0; }
.story.ready { border-color: var(--i-gold); }

/* ---- quests: Daily / Main quest switch, Route 66 map, quest line ---- */
.i-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; padding: 4px; border-radius: 12px; background: var(--i-panel); border: 1px solid var(--i-line); }
.i-seg button { position: relative; appearance: none; border: 0; border-radius: 9px; padding: 10px 6px; background: transparent; color: var(--i-muted); font: 800 13.5px system-ui, sans-serif; cursor: pointer; }
.i-seg button.on { background: linear-gradient(#ffd977, #e0a526); color: #2a1d00; box-shadow: 0 0 10px rgba(242, 193, 78, 0.3); }
.i-seg .dot { position: absolute; top: 5px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--i-red); box-shadow: 0 0 6px var(--i-red); }
.center { text-align: center; }
.route { display: block; width: 100%; height: auto; margin: 2px 0 4px; border-radius: 14px; }
.route .sand { fill: #c98e4f; }
.route .mesa { fill: #9c5a2e; opacity: 0.75; }
.route .mesa.far { fill: #b06a38; opacity: 0.55; }
.route .hills { fill: #6f8f4a; opacity: 0.55; }
.route .deco { font-size: 14px; }
.route .road { fill: none; stroke: #2b2b30; stroke-width: 9; stroke-linecap: round; }
.route .road-line { fill: none; stroke: #ffd24a; stroke-width: 1.4; stroke-dasharray: 5 5; stroke-linecap: round; }
.route .shield path { fill: #f6f3e8; stroke: #1b1b1f; stroke-width: 1.6; }
.route .shield .s1 { font: 900 6px system-ui, sans-serif; fill: #1b1b1f; }
.route .shield .s2 { font: 900 13px system-ui, sans-serif; fill: #1b1b1f; }
.route .spot { cursor: pointer; }
.route .spot .dot { fill: #5b6378; stroke: #1b1b1f; stroke-width: 2; }
.route .spot.now .dot { fill: #f2c14e; }
.route .spot.done .dot { fill: #3ecf5a; }
.route .spot.sel .dot { stroke: #fff; stroke-width: 2.5; }
.route .spot .ic { font: 900 8px system-ui, sans-serif; fill: #1b1b1f; pointer-events: none; }
.route .spot.locked .ic { font-size: 7px; }
.route .spot .lbl { font: 900 9.5px system-ui, sans-serif; fill: #fff; paint-order: stroke; stroke: #3b2410; stroke-width: 3px; pointer-events: none; }
.route .spot.locked .lbl { fill: #e8d9c4; }
.route .pulse { fill: none; stroke: #f2c14e; stroke-width: 2; transform-origin: center; transform-box: fill-box; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { from { opacity: 0.9; transform: scale(0.8); } to { opacity: 0; transform: scale(1.9); } }
.i-btn.big { padding: 12px 16px; font-size: 14px; white-space: normal; }
.i-cur { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; background: var(--i-panel2); border: 1px solid var(--i-line); }
.i-cur.ready { border-color: var(--i-gold); box-shadow: 0 0 10px rgba(242, 193, 78, 0.25); }
.i-cur .ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 24px; flex: none; background: #141a26; border: 1px solid var(--i-line); }
.i-cur .qt { color: #c4cbda; margin: 2px 0; }
.i-qlist { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.i-qlist li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--i-line); color: var(--i-muted); }
.i-qlist .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--i-panel2); font-size: 11px; font-weight: 900; flex: none; }
.i-qlist .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.i-qlist small { font-size: 11px; color: #c9b27a; white-space: nowrap; }
.i-qlist li.done { opacity: 0.55; }
.i-qlist li.done .n { background: var(--i-green); color: #0b2a10; }
.i-qlist li.now { color: var(--i-text); font-weight: 800; }
.i-qlist li.now .n { background: var(--i-gold); color: #2a1d00; }

/* ---- skills you have not unlocked yet ---- */
.i-skill.locked { opacity: 0.55; background: #171d29; }
.i-skill.locked .ic { filter: grayscale(0.8); }
.i-skill.locked .where { font-size: 9.5px; color: var(--i-muted); font-weight: 700; line-height: 1.1; }
.i-skill.locked em { font-size: 10px; }
.locked-skill { opacity: 0.85; }
.locked-skill h3 small { margin-left: auto; }
.unlock-note { padding: 7px 10px; border-radius: 10px; background: rgba(242, 193, 78, 0.1); border: 1px solid rgba(242, 193, 78, 0.35); font-size: 13px; }
.unlock-note b { color: #ffe08a; }

/* ---- auto quest ---- */
.i-auto { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 8px 10px; border-radius: 12px; background: var(--i-panel2); border: 1px dashed rgba(90, 209, 232, 0.4); font-size: 12.5px; color: #c4cbda; }
.i-auto span { flex: 1; }
.i-auto.on { border-style: solid; border-color: var(--i-blue); background: linear-gradient(90deg, rgba(90, 209, 232, 0.16), var(--i-panel2)); }
.i-auto.on b { color: var(--i-blue); }
.i-auto-tag { font-size: 10.5px; font-weight: 900; letter-spacing: 0.5px; color: var(--i-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- level-up pop-up ---- */
.i-level { position: absolute; inset: 0; z-index: 45; display: none; place-items: center; padding: 24px; background: rgba(5, 7, 12, 0.55); }
.i-level.on { display: grid; animation: fadein 0.2s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.i-lvl { width: min(100%, 340px); text-align: center; padding: 20px 18px 16px; border-radius: 18px; border: 1px solid var(--i-gold);
  background: radial-gradient(circle at 50% 0%, rgba(242, 193, 78, 0.28), transparent 60%), var(--i-panel);
  box-shadow: 0 0 30px rgba(242, 193, 78, 0.35), 0 12px 30px rgba(0, 0, 0, 0.6); animation: pop 0.45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.i-lvl .burst { position: relative; width: 76px; height: 76px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 40px;
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--c, #f2c14e) 55%, #2a3346), #161c28); border: 2px solid var(--c, #f2c14e);
  box-shadow: 0 0 22px color-mix(in srgb, var(--c, #f2c14e) 60%, transparent); }
.i-lvl .burst em { position: absolute; bottom: -6px; right: -6px; font-style: normal; font-weight: 900; font-size: 15px; min-width: 30px; height: 26px; padding: 0 6px;
  border-radius: 13px; display: grid; place-items: center; background: linear-gradient(#ffd977, #e0a526); color: #2a1d00; border: 2px solid #10141d; }
.i-lvl h2 { color: #ffe08a !important; font-size: 22px; margin: 2px 0 4px; }
.i-lvl .lv { margin: 0 0 10px; font-size: 14.5px; color: var(--i-text); }
.i-lvl .lv small { color: var(--i-muted); }
.i-lvl .max { color: #ffe08a; font-weight: 800; margin: 0 0 8px; }
.i-lvl ul { list-style: none; margin: 0 0 14px; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.i-lvl li { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 10px; background: var(--i-panel2); border: 1px solid var(--i-line); font-size: 13px; color: #dfe4ee; }
.i-lvl li span { font-size: 18px; }

/* ---- toasts and modal ---- */
.i-toasts { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--sat) + 60px); width: min(92%, 420px); display: flex; flex-direction: column; gap: 6px; z-index: 30; pointer-events: none; }
.i-toast { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: rgba(20, 26, 38, 0.96); border: 1px solid var(--i-line); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); font-size: 13.5px; animation: tin 0.25s ease-out; transition: opacity 0.4s, transform 0.4s; }
.i-toast.out { opacity: 0; transform: translateY(-8px); }
.i-toast.level, .i-toast.heist, .i-toast.daily { border-color: var(--i-gold); background: linear-gradient(90deg, #3a3018, #1b2230); }
.i-toast.level b { color: #ffe08a; }
.i-toast.raid, .i-toast.fail, .i-toast.err { border-color: var(--i-red); }
.i-toast.war { border-color: var(--i-blue); }
@keyframes tin { from { opacity: 0; transform: translateY(-10px) scale(0.96); } }
.i-modal { position: absolute; inset: 0; z-index: 40; background: rgba(5, 7, 12, 0.7); display: grid; place-items: center; padding: 20px; }
.i-modal .i-card { width: min(100%, 420px); max-height: 80vh; overflow-y: auto; }
.away h2 { color: #ffe08a; font-size: 22px; }
.i-sum { list-style: none; margin: 8px 0; padding: 0; }
.i-sum li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--i-line); font-size: 14px; }
.i-sum b { color: var(--i-blue); }
.i-sum em { font-style: normal; color: var(--i-gold); margin-left: 4px; }

@media (max-width: 370px) {
  .i-grid { gap: 6px; padding: 8px; }
  .i-skill .ic { font-size: 26px; }
  .i-nav button { font-size: 9.5px; }
}
