/* Galaxy theme: every screen shares the cosmic phone's look (deep violet sky,
   glass cards, lavender-to-pink actions, mint highlights). Loaded last. */
:root {
  --bg: #0b0722;
  --panel: rgba(255,255,255,.065);
  --panel2: rgba(255,255,255,.1);
  --line: rgba(255,255,255,.13);
  --text: #f6f3ff;
  --muted: #b9b0dc;
  --lime: #8ff0c8;
  --orange: #ffb38a;
  --blue: #9ec9ff;
  --pink: #f6a8e6;
  --glow: #a98bff;
  --grad: linear-gradient(135deg, #f7b2ff 0%, #c39bff 50%, #9c8bff 100%);
  --glass: linear-gradient(160deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
}
html { background: #07051a; }
body {
  background:
    radial-gradient(60vw 50vh at 0% 8%, rgba(255,61,207,.20), transparent 70%),
    radial-gradient(70vw 60vh at 100% 35%, rgba(0,170,255,.16), transparent 70%),
    radial-gradient(70vw 50vh at 30% 100%, rgba(255,120,80,.12), transparent 70%),
    radial-gradient(120% 90% at 50% 0%, #1c1150 0%, #0b0722 50%, #05040f 100%) fixed;
  background-attachment: fixed;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .65;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 120px 140px, #dcd4ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 210px 60px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 280px 220px, #ffd9f5 50%, transparent 51%);
  background-size: 300px 260px;
}
.shell, .main { background: transparent; }

/* Navigation */
.shell .sidebar { background: rgba(12,8,36,.72); backdrop-filter: blur(18px); border-color: var(--line); }
.shell .bottom-nav { background: rgba(14,9,40,.82); border-color: rgba(255,255,255,.1); backdrop-filter: blur(22px); box-shadow: 0 -12px 40px rgba(60,20,140,.35); }
.shell .bottom-nav .taskbar-toggle { background: linear-gradient(180deg, #3a2a7a, #24185a); border-color: rgba(195,155,255,.45); color: #fff; }
.shell .nav button.active, .shell .bottom-nav button.active { color: var(--lime); }
.shell .phone-pill, .shell .wallet-pill, .shell .shop-pill, .shell .profile-orb, .shell .account-link {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: var(--text); backdrop-filter: blur(10px);
}

/* Headings get the phone clock's soft gradient */
.shell .intro h1, .shell .section-heading h2, .shell .life-hero h1 {
  font-family: 'DM Sans', system-ui, sans-serif; font-weight: 700; letter-spacing: -.03em;
  background: linear-gradient(180deg, #ffffff 20%, #d9c8ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.shell .intro h1 em, .shell .life-hero h1 em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.shell .eyebrow, .shell .eyebrow.accent { color: #d8c6ff; letter-spacing: .16em; }

/* Glass cards */
.shell :is(.panel, .stat, .country-card, .asset-card, .metric-tile, .profile-tile, .challenge-card, .time-block,
  .job-card, .city-card, .shop-card, .shopping-summary, .home-status, .trip-card, .route-card, .worth-bar,
  .journal-entry, .result, .activity, .xp-strip, .owned-item, .income-total) {
  background: var(--glass); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 40px -26px rgba(40,10,120,.8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.shell :is(.activity, .owned-item):hover { border-color: rgba(195,155,255,.5); }
.shell .route-card.selected { border-color: var(--lime); background: linear-gradient(160deg, rgba(143,240,200,.16), rgba(255,255,255,.04)); }
.shell .job-card.cash, .shell .job-current.cash { background: linear-gradient(160deg, rgba(255,200,90,.13), rgba(255,255,255,.03)); }
.shell .life-hero { background: linear-gradient(160deg, #3a1f86 0%, #1a1150 60%, #120b38 100%); border: 1px solid var(--line); border-radius: 26px; }
.shell .life-hero .hero-skyline { opacity: .75; mix-blend-mode: screen; }
.shell .story { border-radius: 22px; border: 1px solid var(--line); }
.shell .choice { background: rgba(20,12,60,.45); border-color: rgba(255,255,255,.16); }
.shell .level-badge { background: var(--grad); color: #1a0b33; }
.shell .bar { background: rgba(255,255,255,.1); }
.shell .bar i, .shell .bar span { background: linear-gradient(90deg, #8ff0c8, #9c8bff); }
.shell .bar.pink i, .shell .bar.pink span { background: linear-gradient(90deg, #ff9bd8, #c39bff); }

/* Actions */
.shell .btn, dialog .btn { background: var(--grad); color: #1a0b33; border: 0; border-radius: 14px; box-shadow: 0 10px 26px -12px rgba(195,155,255,.9); }
.shell .btn:hover:not(:disabled), dialog .btn:hover:not(:disabled) { filter: brightness(1.07); background: var(--grad); }
.shell .btn.secondary, dialog .btn.secondary { background: rgba(255,255,255,.07); color: var(--text); border: 1px solid rgba(255,255,255,.16); box-shadow: none; }
.shell .btn.secondary:hover:not(:disabled), dialog .btn.secondary:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.shell .btn.danger { background: transparent; color: var(--orange); border: 1px solid rgba(255,179,138,.35); box-shadow: none; }
.shell .filter { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #e4dcff; }
.shell .filter.active { background: var(--grad); border-color: transparent; color: #1a0b33; }
.shell .chip { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: #ddd4ff; }
.shell .chip.lime { color: var(--lime); background: rgba(143,240,200,.08); border-color: rgba(143,240,200,.3); }
.shell .chip.cash { background: rgba(255,200,90,.14); color: #ffd98f; border-color: rgba(255,200,90,.35); }
.shell .feature-link { border-radius: 22px; border: 1px solid var(--line); }
.shell .account-initial, .shell .avatar-edit { background: var(--grad); color: #1a0b33; }
.shell :is(select, input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea),
dialog :is(select, input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea) {
  background: rgba(10,6,30,.55); border-color: rgba(255,255,255,.16); color: var(--text); border-radius: 12px;
}
input[type=range] { accent-color: #c39bff; }

/* Dialogs share the look */
dialog { background: linear-gradient(170deg, #22145a, #0e0930); color: var(--text); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(120,80,255,.25); }
dialog::backdrop { background: rgba(5,3,20,.7); backdrop-filter: blur(6px); }
#toast { background: rgba(30,18,80,.92); border: 1px solid rgba(195,155,255,.4); color: #fff; backdrop-filter: blur(12px); }
.shell .busy-panel { backdrop-filter: blur(16px); }

/* Feature tiles and scenes */
.shell .feature-link { background: linear-gradient(125deg, rgba(160,110,255,.30), rgba(60,40,160,.22) 55%, rgba(255,110,200,.14)); border: 1px solid rgba(255,255,255,.14); color: var(--text); }
.shell .feature-link:hover { background: linear-gradient(125deg, rgba(180,130,255,.40), rgba(70,50,180,.3) 55%, rgba(255,120,210,.2)); }
.shell .feature-link :is(h2, h3, strong) { color: #fff; }
.shell .balance-card { background: radial-gradient(at 90% 0, #7a4cff 0%, #3a2190 45%, #1a1150 100%); border: 1px solid rgba(195,155,255,.35); }
.shell :is(.home-stage, .walk-plan) { background: radial-gradient(ellipse at 50% 40%, #2d1d6e 0%, #120b38 100%); }
.shell .studio-preview { background: var(--glass); border-color: var(--line); border-radius: 26px; }
.shell .avatar-stage.large { background: radial-gradient(ellipse at 50% 30%, #6b45e0 0%, #2a1a72 45%, #120b38 100%); border-radius: 22px; }
.shell .studio-controls { background: var(--glass); border-radius: 26px; }
.shell .preset-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; }
.shell .preset-card:hover { border-color: #c39bff; }
.shell .preset-card[aria-pressed="true"] { border-color: #c39bff; box-shadow: 0 0 0 2px #c39bff; }
.shell .preset-card[aria-pressed="true"]::after { background: var(--grad); color: #1a0b33; }
.shell .panel :is(h2, h3) { font-family: 'DM Sans', system-ui, sans-serif; font-weight: 700; letter-spacing: -.01em; }

/* ---- Avatar builder ---- */
.preset-art { background: radial-gradient(ellipse at 50% 30%, #5a3bc4 0%, #22155c 70%); }
.preset-art.custom, .preset-art.drawn { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #5a3bc4 0%, #22155c 70%); }
.preset-art.drawn svg, .preset-art.custom svg { height: 100%; width: auto; }
.avatar-studio .preset-cards { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); max-height: 560px; overflow-y: auto; padding: 4px; margin: 8px -4px; }
.builder-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 6px 0 18px; padding-bottom: 2px; }
.builder-tabs::-webkit-scrollbar { display: none; }
.builder-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #e4dcff; font: 600 .85rem/1 'DM Sans', system-ui, sans-serif; cursor: pointer; }
.builder-tab[aria-selected="true"] { background: var(--grad); color: #1a0b33; border-color: transparent; }
.builder-panel[hidden] { display: none; }
.avatar-studio > *, .studio-controls, .avatar-customise { min-width: 0; }
.chip-field { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.chip-field legend { font-size: .9rem; padding: 0; margin-bottom: 10px; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip { position: relative; cursor: pointer; }
.choice-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #e4dcff; font-size: .85rem; font-weight: 600; transition: .15s; }
.choice-chip input:checked + span { background: var(--grad); color: #1a0b33; border-color: transparent; box-shadow: 0 6px 18px -8px #c39bff; }
.choice-chip input:focus-visible + span { outline: 3px solid #fff; outline-offset: 2px; }
.choice-chip.toggle input:checked + span::before { content: '✓ '; white-space: pre; }
.avatar-studio .avatar-toggles, .setup-avatar .avatar-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.avatar-toggles .choice-chip input { width: auto; height: auto; }
.build-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.build-card { position: relative; display: grid; justify-items: center; gap: 4px; padding: 8px 4px 10px; border-radius: 16px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); cursor: pointer; font-size: .8rem; font-weight: 600; }
.build-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.build-art { display: block; height: 92px; }
.build-art svg { height: 100%; width: auto; }
.build-card:has(input:checked) { border-color: #c39bff; box-shadow: 0 0 0 2px #c39bff; background: rgba(195,155,255,.12); }
.builder-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.builder-save { padding-top: 12px; margin-top: 8px; }
.avatar-camera .quick-save { display: none; }
.avatar-camera { flex-wrap: wrap; }
@media (max-width: 650px) {
  .avatar-studio { grid-template-columns: minmax(0, 1fr); }
  .avatar-studio .studio-preview { position: sticky; top: 0; z-index: 3; padding: 10px; background: linear-gradient(170deg, #241566, #120b38); border-radius: 0 0 24px 24px; margin: 0 -4px; box-shadow: 0 14px 30px -12px rgba(0,0,0,.7); }
  .avatar-camera .quick-save { display: inline-flex; min-height: 40px; padding: 0 16px; width: auto; }
  .avatar-studio .avatar-stage.large { height: 210px; }
  .avatar-studio .avatar-camera { gap: 6px; flex-wrap: nowrap; }
  .avatar-studio .avatar-camera .filter, .avatar-camera .quick-save { margin: 0; align-items: center; min-height: 36px; padding: 0 11px; font-size: .78rem; white-space: nowrap; }
  .avatar-studio .studio-title { display: none; }
  .avatar-studio .avatar-camera { margin-top: 10px; }
  .avatar-studio .preset-cards { max-height: none; }
  .avatar-studio .preset-art { height: 150px; }
}

/* ---- Characters ---- */
.character-list { display: grid; gap: 10px; margin: 14px 0; }
.character-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); }
.character-card.active { border-color: rgba(143,240,200,.45); background: linear-gradient(160deg, rgba(143,240,200,.12), rgba(255,255,255,.03)); }
.character-face { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #6b45e0, #22155c); }
.character-face svg { width: 100%; height: 100%; }
.character-info { display: grid; gap: 2px; min-width: 0; }
.character-info strong { font-size: 1.05rem; }
.character-info small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.character-card > .chip { grid-column: 2; justify-self: start; }
.character-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.character-actions .btn { flex: 1; min-height: 42px; }
.character-actions .btn.secondary { flex: 0 0 auto; }
@media (min-width: 700px) {
  .character-card { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .character-card > .chip, .character-actions { grid-column: 3; }
}
.admin-move { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(242,193,78,.35); }
.admin-move small { color: #f2c14e; font-weight: 700; letter-spacing: .04em; }
.admin-move .button-row { margin-top: 8px; flex-wrap: wrap; }
.admin-move .btn { min-height: 38px; padding: 0 14px; background: linear-gradient(135deg, #ffd876, #e0a83a); color: #231703; }

/* ---- Job ranks and the tax pull-down ---- */
.job-rank { margin: 10px 0 14px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid var(--line); display: grid; gap: 8px; }
.job-rank-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rank-name { font-weight: 700; color: #ffd876; }
.rank-steps { display: flex; gap: 4px; }
.rank-steps i { width: 18px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); }
.rank-steps i.on { background: linear-gradient(90deg, #ffd876, #e0a83a); }
.perf { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.perf small { color: var(--muted); }
.perf .bar { margin: 0; }
.promo-note { color: var(--muted); line-height: 1.4; }
details.tax-panel { padding: 0; overflow: hidden; }
details.tax-panel summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; }
details.tax-panel summary::-webkit-details-marker { display: none; }
details.tax-panel summary span:first-child { display: grid; gap: 3px; }
details.tax-panel summary small { color: var(--muted); }
.tax-toggle { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: rgba(255,255,255,.08); transition: transform .2s; }
details.tax-panel[open] .tax-toggle { transform: rotate(180deg); }
.tax-body { padding: 0 20px 20px; border-top: 1px solid var(--line); }
.tax-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.tax-figures div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); }
.tax-figures small { color: var(--muted); font-size: .75rem; }
.tax-body h4 { margin: 0 0 8px; }
