/* ===== Nova Imperium — holographic space UI ===== */
:root {
  /* Theme colours: the default "Nova" theme. js/theme.js overrides these from the Options page. */
  --accent-rgb: 79, 209, 255;
  --accent2-rgb: 59, 108, 255;
  --highlight-rgb: 167, 139, 250;
  --tint-rgb: 120, 180, 255;
  --deep-rgb: 4, 8, 18;
  --surface-rgb: 10, 16, 30;
  --raised-rgb: 14, 22, 40;
  --btn1: #1fb6ff;
  --btn2: #3b6cff;
  --btn-text: #fff;
  --btn-glow-rgb: 31, 140, 255;
  --bg: #04060c;
  --text: #dbe7ff;
  --muted: #8796b5;
  --dim: #5b6782;

  --accent: rgb(var(--accent-rgb));
  --accent2: rgb(var(--accent2-rgb));
  --text-soft: color-mix(in srgb, var(--text) 65%, var(--muted));
  --panel: rgba(var(--surface-rgb), 0.72);
  --panel-strong: rgba(var(--surface-rgb), 0.9);
  --panel-soft: rgba(var(--raised-rgb), 0.55);
  --line: rgba(var(--tint-rgb), 0.16);
  --line-strong: rgba(var(--tint-rgb), 0.35);
  --cyan: var(--accent);
  --blue: var(--accent2);
  --gold: #ffc65c;
  --green: #6dffa5;
  --red: #ff5468;
  --violet: #a78bfa;
  --metal: #c3ccd9;
  --crystal: #66e3ff;
  --deut: #6dffbf;
  --energy: #ffd35c;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  --glow: 0 0 24px rgba(var(--accent-rgb), 0.25);
  --font: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  --display: 'Orbitron', 'Exo 2', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: 0.06em; margin: 0 0 0.6em; font-weight: 600; }
h2 { font-size: 18px; text-transform: uppercase; }
h3 { font-size: 14px; text-transform: uppercase; color: var(--muted); }
small { color: var(--muted); }
::selection { background: rgba(var(--accent-rgb), 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--tint-rgb), 0.2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(var(--tint-rgb), 0.35); }

.stage-canvas { display: block; width: 100%; height: 100%; }
.no-webgl { background: radial-gradient(ellipse at 30% 30%, color-mix(in srgb, var(--accent2) 22%, var(--bg)) 0%, var(--bg) 70%); }

/* ---------- panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  padding: 18px;
  position: relative;
}
.panel::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent 30%, transparent 70%, rgba(var(--highlight-rgb), 0.06));
}
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title h2 { margin: 0; }
.panel-title select { width: auto; max-width: 240px; padding: 6px 10px; }

/* ---------- buttons & inputs ---------- */
.btn {
  --c1: var(--btn1); --c2: var(--btn2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px;
  padding: 10px 18px;
  font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--btn-text); cursor: pointer;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 6px 20px rgba(var(--btn-glow-rgb), 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(var(--btn-glow-rgb), 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { filter: grayscale(1) brightness(0.6); cursor: not-allowed; box-shadow: none; }
.btn.gold { --c1: #ffc65c; --c2: #ff8a3d; box-shadow: 0 6px 20px rgba(255, 150, 60, 0.35); color: #1a1004; }
.btn.green { --c1: #3ce59b; --c2: #12a46d; box-shadow: 0 6px 20px rgba(40, 200, 130, 0.35); color: #fff; }
.btn.red { --c1: #ff5468; --c2: #c2185b; box-shadow: 0 6px 20px rgba(255, 70, 100, 0.35); color: #fff; }
.btn.ghost { background: rgba(var(--tint-rgb), 0.08); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: rgba(var(--tint-rgb), 0.16); box-shadow: inset 0 0 0 1px var(--cyan), var(--glow); }
.btn.small { padding: 6px 11px; font-size: 10.5px; border-radius: 8px; }
.btn.tiny { padding: 3px 8px; font-size: 10px; border-radius: 6px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.tiny svg { width: 14px; height: 14px; }

input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%;
  background: rgba(var(--deep-rgb), 0.7);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select option { background: rgb(var(--surface-rgb)); }
label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; letter-spacing: 0.04em; }
.field { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: 13px; }
.check input { accent-color: var(--cyan); width: 16px; height: 16px; }
input[type=range] { width: 100%; accent-color: var(--cyan); }

.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; background: rgba(var(--tint-rgb), 0.12); color: var(--muted); }
.tag.cyan { background: rgba(var(--accent-rgb), 0.15); color: var(--cyan); }
.tag.green { background: rgba(109, 255, 165, 0.13); color: var(--green); }
.tag.red { background: rgba(255, 84, 104, 0.15); color: var(--red); }
.tag.gold { background: rgba(255, 198, 92, 0.15); color: var(--gold); }
.tag.violet { background: rgba(167, 139, 250, 0.15); color: var(--violet); }

.c-metal { color: var(--metal); } .c-crystal { color: var(--crystal); } .c-deut { color: var(--deut); } .c-energy { color: var(--energy); }
.c-red { color: var(--red) !important; } .c-green { color: var(--green) !important; } .c-gold { color: var(--gold) !important; } .c-cyan { color: var(--cyan) !important; } .c-muted { color: var(--muted) !important; }

.ico { width: 18px; height: 18px; display: inline-block; vertical-align: -4px; flex: none; }
.res-img { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; flex: none; }
.ico .res-img { display: block; width: 100%; height: 100%; }

/* ---------- toasts & modals ---------- */
#toasts { position: fixed; top: 76px; right: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto;
  min-width: 260px; max-width: 380px;
  padding: 12px 16px 12px 14px;
  border-radius: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--cyan);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: toastIn 0.35s cubic-bezier(.2, 1.2, .4, 1);
  font-size: 13px;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.toast.out { animation: toastOut 0.3s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

.modal-back {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(var(--deep-rgb), 0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}
.modal { width: min(560px, 100%); max-height: 88vh; overflow: auto; animation: popIn 0.3s cubic-bezier(.2, 1.2, .4, 1); }
.modal.wide { width: min(900px, 100%); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(var(--accent-rgb), 0.15); border-top-color: var(--cyan); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== LANDING ===================== */
.landing { min-height: 100vh; position: relative; }
.landing #scene { position: fixed; inset: 0; z-index: 0; background: var(--bg) url(/img/bg-landing.jpg) center / cover no-repeat; animation: bg-drift 60s ease-in-out infinite alternate; }
@keyframes bg-drift { from { transform: scale(1); } to { transform: scale(1.08) translateX(-1.5%); } }
@media (prefers-reduced-motion: reduce) { .landing #scene { animation: none; } }
.landing .vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 32% 48%, transparent 34%, rgba(0, 0, 0, 0.5) 100%), linear-gradient(90deg, rgba(2, 4, 8, 0.42) 0%, rgba(2, 4, 8, 0.08) 46%, transparent 62%, rgba(0, 0, 0, 0.38)); }
.landing .brand { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9); }
.landing .brand h1 { text-shadow: none; }
.landing-wrap { position: relative; z-index: 2; min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(320px, 440px); gap: 40px; padding: 40px 6vw; align-items: center; }
.brand { font-family: var(--display); }
.brand .logo { display: flex; align-items: center; gap: 14px; font-size: 13px; letter-spacing: 0.4em; color: var(--muted); text-transform: uppercase; }
.brand h1 {
  font-size: clamp(42px, 7vw, 92px);
  line-height: 0.95;
  margin: 18px 0 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--accent) 35%, #fff) 45%, color-mix(in srgb, var(--accent) 60%, var(--accent2)) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(var(--accent-rgb), 0.45));
}
.brand h1.brand-logo { line-height: 0; margin: 14px 0 22px; }
.brand-logo img { display: block; width: min(100%, 560px); height: auto; }
.brand p.tagline { font-family: var(--font); font-size: 18px; color: var(--text-soft); max-width: 560px; margin: 0 0 28px; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 12px; }
.feature { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(var(--surface-rgb), 0.45); border: 1px solid var(--line); backdrop-filter: blur(8px); font-family: var(--font); }
.feature b { display: block; font-size: 13px; letter-spacing: 0.03em; }
.feature span { font-size: 12px; color: var(--muted); }
.feature .fi { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.25), rgba(var(--accent2-rgb), 0.15)); flex: none; }
.stats-line { display: flex; gap: 22px; margin-top: 26px; color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.stats-line b { display: block; color: var(--text); font-family: var(--display); font-size: 22px; letter-spacing: 0.04em; }

.auth { padding: 28px; max-height: calc(100vh - 48px); overflow: auto; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(var(--deep-rgb), 0.6); border: 1px solid var(--line); margin-bottom: 22px; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 9px; cursor: pointer; font-family: var(--display); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; transition: all 0.2s; }
.tabs button.active { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent2-rgb), 0.2)); color: #fff; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35); }
.form-error { min-height: 20px; color: var(--red); font-size: 13px; margin: 4px 0 10px; }
.form-hint { font-size: 12px; color: var(--dim); margin-top: 14px; text-align: center; }
.auth-alt { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; margin: 2px 0 4px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn.social { text-decoration: none; }
.btn.social[aria-busy="true"] { filter: brightness(0.75); cursor: progress; }
.btn.social.facebook { --c1: #1877f2; --c2: #0c63d4; color: #fff; box-shadow: 0 6px 20px rgba(24, 119, 242, 0.35); }
.btn.social.gmail { --c1: #fff; --c2: #f1f3f4; color: #1f1f1f; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }
.btn.social.discord { --c1: #5865f2; --c2: #4752c4; color: #fff; box-shadow: 0 6px 20px rgba(88, 101, 242, 0.35); }
.auth-alt .form-error { min-height: 0; margin: 0; }
.loader-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); transition: opacity 0.8s; }
.loader-screen.hide { opacity: 0; pointer-events: none; }
.loader-screen .brandmark { font-family: var(--display); letter-spacing: 0.5em; color: var(--muted); margin-top: 18px; font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .landing-wrap { grid-template-columns: minmax(0, 1fr); padding: 30px 16px; gap: 24px; }
  .features { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .stats-line { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
  .auth { padding: 22px 18px; }
  .auth .btn.block { white-space: normal; text-align: center; }
}

/* ===================== GAME ===================== */
.game #bg { position: fixed; inset: 0; z-index: 0; }
.game #bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 46%, rgba(0, 0, 0, 0.38)); pointer-events: none; }
.game[data-space-bg='art'] #bg { background: var(--bg) url(/img/bg-game.jpg) center / cover no-repeat; }
.game[data-space-bg='art'] #bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(4, 6, 12, 0.35), rgba(4, 6, 12, 0.35)), url(/img/bg-galaxy.jpg) center / cover no-repeat; opacity: 0; transition: opacity 0.8s; }
.game[data-space-bg='art'][data-page='galaxy'] #bg::before { opacity: 1; }
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 220px minmax(0, 1fr) 250px; grid-template-rows: 64px minmax(0, 1fr); grid-template-areas: 'top top top' 'nav main planets'; min-height: 100vh; }

.topbar {
  grid-area: top;
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 0 18px;
  background: rgba(var(--deep-rgb), 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.topbar .logo { font-family: var(--display); font-weight: 800; letter-spacing: 0.18em; font-size: 15px; white-space: nowrap; background: linear-gradient(90deg, #fff, color-mix(in srgb, var(--accent) 75%, #fff)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .logo small { display: block; font-size: 9px; letter-spacing: 0.35em; -webkit-text-fill-color: var(--muted); }
.resbar { display: flex; gap: 8px; flex: 1; justify-content: center; }
.res {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 12px;
  background: rgba(var(--raised-rgb), 0.65);
  border: 1px solid var(--line);
  min-width: 150px;
  cursor: default;
}
.res .ri { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.04); }
.res .ri svg { width: 24px; height: 24px; }
.res .ri .res-img { width: 30px; height: 30px; }
.res .rv { font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.res .rl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.res.full .rv { color: var(--red); }
.res .tip {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 220px; padding: 12px 14px; border-radius: 12px;
  background: var(--panel-strong); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: 12px; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; z-index: 50;
}
.res:hover .tip { opacity: 1; transform: translateX(-50%) translateY(2px); }
.tip-row { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.tip-row span:first-child { color: var(--muted); }

.userbox { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.iconbtn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(var(--raised-rgb), 0.65); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: all 0.2s; }
.iconbtn:hover { border-color: var(--cyan); box-shadow: var(--glow); text-decoration: none; }
.iconbtn svg { width: 18px; height: 18px; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 12px rgba(255, 84, 104, 0.7); }
.badge:empty { display: none; }
.alert-pill { padding: 6px 12px; border-radius: 999px; background: rgba(255, 84, 104, 0.18); border: 1px solid var(--red); color: #ffd0d6; font-family: var(--display); font-size: 11px; letter-spacing: 0.08em; animation: pulseRed 1.2s infinite; white-space: nowrap; }
.alert-pill:hover { text-decoration: none; background: rgba(255, 84, 104, 0.3); }
.clock { font-family: var(--display); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.username { font-weight: 600; }

.nav { grid-area: nav; padding: 18px 12px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 3px;
  border-radius: 10px;
  color: var(--muted);
  font-family: var(--display); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: all 0.18s;
  position: relative;
}
.nav a svg { width: 18px; height: 18px; opacity: 0.85; flex: none; }
.nav a:hover { color: var(--text); background: rgba(var(--accent-rgb), 0.07); text-decoration: none; }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.02)); box-shadow: inset 2px 0 0 var(--cyan); }
.nav a .badge { position: static; margin-left: auto; }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }

.main { grid-area: main; padding: 20px; min-width: 0; }
.page { animation: pageIn 0.35s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; text-transform: uppercase; }
.page-head .sub { color: var(--muted); font-size: 13px; }

.planets { grid-area: planets; padding: 18px 12px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.planets h3 { padding: 0 6px; display: flex; justify-content: space-between; }
.pl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 6px;
  border-radius: 12px; cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s;
}
.pl-item:hover { background: rgba(var(--accent-rgb), 0.06); border-color: var(--line); }
.pl-item.active { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent2-rgb), 0.08)); border-color: rgba(var(--accent-rgb), 0.45); box-shadow: var(--glow); }
.pl-item img, .pl-img { width: 48px; height: 48px; border-radius: 50%; mix-blend-mode: screen; flex: none; opacity: 0; transition: opacity 0.5s; }
.pl-item img.ready, .pl-img.ready { opacity: 1; }
.pl-item .pn { font-weight: 600; font-size: 13px; }
.pl-item .pc { font-size: 11.5px; color: var(--muted); }
.pl-item .moonbtn { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; background: rgba(255, 255, 255, 0.04); transition: all 0.15s; }
.pl-item .moonbtn img { width: 22px; height: 22px; }
.pl-item .moonbtn:hover, .pl-item .moonbtn.active { border-color: var(--cyan); box-shadow: var(--glow); }
.pl-item .busy { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); flex: none; }

/* ---------- item grid ---------- */
.grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: rgb(var(--deep-rgb));
  border: 1px solid var(--line);
  transition: transform 0.25s cubic-bezier(.2, .8, .3, 1), box-shadow 0.25s, border-color 0.25s;
  transform-style: preserve-3d;
  will-change: transform;
}
.card:hover { border-color: rgba(var(--accent-rgb), 0.55); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(var(--accent-rgb), 0.2); }
.card.selected { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 34px rgba(var(--accent-rgb), 0.35); }
.card .thumb { aspect-ratio: 1; width: 100%; display: block; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent2) 14%, rgb(var(--raised-rgb))), var(--bg)); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.6s, transform 0.5s; }
.card .thumb img.ready { opacity: 1; }
.card:hover .thumb img { transform: scale(1.06); }
.card .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px; background: linear-gradient(transparent, rgba(var(--deep-rgb), 0.92) 55%); }
.card .name { font-weight: 700; font-size: 12.5px; line-height: 1.2; }
.card .lvl { position: absolute; top: 8px; right: 8px; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 8px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 13px; background: rgba(var(--deep-rgb), 0.75); border: 1px solid var(--line-strong); backdrop-filter: blur(6px); }
.card .state { font-size: 11px; color: var(--muted); margin-top: 2px; }
.card.locked .thumb img { filter: grayscale(0.85) brightness(0.45); }
.card.locked::after { content: ''; position: absolute; top: 9px; left: 9px; width: 22px; height: 22px; background: no-repeat center/16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff7a8a' stroke-width='2'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"), rgba(var(--deep-rgb), 0.7); border-radius: 6px; }
.card.afford .lvl { border-color: rgba(109, 255, 165, 0.6); }
.card.working { border-color: rgba(255, 198, 92, 0.6); }
.card.working .lvl { border-color: var(--gold); color: var(--gold); }
.card .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.06); }
.card .progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ff8a3d); box-shadow: 0 0 10px var(--gold); }

/* ---------- detail panel ---------- */
.detail { display: grid; grid-template-columns: minmax(260px, 42%) 1fr; gap: 0; padding: 0; overflow: hidden; margin-bottom: 16px; min-height: 340px; }
.detail .viewer { position: relative; min-height: 340px; background: var(--bg); border-right: 1px solid var(--line); }
.detail .viewer .hint { position: absolute; left: 12px; bottom: 10px; font-size: 11px; color: var(--muted); pointer-events: none; letter-spacing: 0.06em; }
.detail:has(.viewer.art-mode) { grid-template-columns: 340px 1fr; }
.detail .viewer.art-mode { overflow: hidden; }
.detail .viewer.art-mode::before { content: ''; position: absolute; inset: -30px; background: var(--art) center / cover; filter: blur(28px) brightness(0.4); }
.detail .viewer .viewer-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: none; }
.detail .viewer.art-mode .viewer-art { display: block; }
.detail .viewer.art-mode .hint { display: none; }
.detail .viewer .view-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; }
.detail .viewer .view-toggle[hidden] { display: none; }
.detail .body { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.detail .body h2 { font-size: 20px; margin: 0; text-transform: none; letter-spacing: 0.04em; }
.detail .desc { color: var(--text-soft); font-size: 13.5px; }
.costs { display: flex; flex-wrap: wrap; gap: 8px; }
.cost { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-weight: 600; font-variant-numeric: tabular-nums; }
.cost.short { border-color: rgba(255, 84, 104, 0.5); color: var(--red); }
.cost svg, .cost .res-img { width: 18px; height: 18px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--muted); }
.req-list { display: flex; flex-wrap: wrap; gap: 6px; }
.req { font-size: 12px; padding: 3px 9px; border-radius: 8px; background: rgba(255, 84, 104, 0.1); color: #ff9aa6; border: 1px solid rgba(255, 84, 104, 0.25); }
.req.ok { background: rgba(109, 255, 165, 0.08); color: var(--green); border-color: rgba(109, 255, 165, 0.25); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: auto; }
.amount { display: flex; align-items: center; gap: 6px; }
.amount input { width: 120px; text-align: center; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.stat { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 14px; }
.stat span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- queue ---------- */
.queue { display: flex; flex-direction: column; gap: 8px; }
.q-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.q-item.current { border-color: rgba(255, 198, 92, 0.45); background: linear-gradient(90deg, rgba(255, 198, 92, 0.08), transparent); }
.q-item img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: rgb(var(--surface-rgb)); }
.q-item .qn { font-weight: 600; }
.q-item .qt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-item .grow { flex: 1; min-width: 0; }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue)); box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6); transition: width 1s linear; }
.bar.gold i { background: linear-gradient(90deg, var(--gold), #ff8a3d); box-shadow: 0 0 10px rgba(255, 198, 92, 0.6); }
.empty { color: var(--dim); font-size: 13px; padding: 10px 2px; }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- overview ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; padding: 0; overflow: hidden; min-height: 460px; margin-bottom: 16px; }
.hero .viewport { position: relative; min-height: 460px; background: var(--bg); }
.hero .viewport .title { position: absolute; left: 20px; top: 16px; pointer-events: none; }
.hero .viewport .title h1 { font-size: 28px; margin: 0; text-shadow: 0 0 30px rgba(var(--accent-rgb), 0.5); }
.hero .viewport .title div { color: var(--muted); font-family: var(--display); letter-spacing: 0.14em; font-size: 12px; }
.hero .side { padding: 20px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; background: rgba(var(--deep-rgb), 0.5); }
.events { display: flex; flex-direction: column; gap: 6px; }
.event { display: grid; grid-template-columns: 82px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); font-size: 13px; }
.event.hostile { border-color: rgba(255, 84, 104, 0.55); background: linear-gradient(90deg, rgba(255, 84, 104, 0.15), transparent); animation: pulseRed 1.6s infinite; }
.event.friendly { border-color: rgba(109, 255, 165, 0.35); }
.event .t { font-family: var(--display); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--gold); }
@keyframes pulseRed { 50% { box-shadow: 0 0 22px rgba(255, 84, 104, 0.35); } }
.mission-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 8px currentColor; background: currentColor; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.t th { text-align: left; font-family: var(--display); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(var(--surface-rgb), 0.95); }
table.t td { padding: 9px 10px; border-bottom: 1px solid rgba(var(--tint-rgb), 0.07); vertical-align: middle; }
table.t tr:hover td { background: rgba(var(--accent-rgb), 0.04); }
table.t tr.me td { background: rgba(var(--accent-rgb), 0.1); }
table.t tr.sel td { background: rgba(var(--accent-rgb), 0.12); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- galaxy ---------- */
.gal-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gal-nav .grp { display: flex; align-items: center; gap: 4px; }
.gal-nav input { width: 70px; text-align: center; padding: 8px; }
.gal-nav .lbl { font-family: var(--display); font-size: 11px; color: var(--muted); letter-spacing: 0.1em; margin-right: 4px; }
.system-3d { position: relative; height: 430px; padding: 0; overflow: hidden; margin-bottom: 16px; background: var(--bg); }
.sys-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sys-label { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(var(--deep-rgb), 0.6); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--text); transition: border-color 0.2s, background 0.2s; }
.sys-label b { color: var(--muted); margin-right: 4px; }
.sys-label small { display: block; font-size: 10px; color: var(--gold); }
.sys-label.own small { color: var(--cyan); }
.sys-label.npc small { color: var(--muted); }
.sys-label.selected { border-color: var(--cyan); background: rgba(var(--accent-rgb), 0.2); }
.gal-row-planet { display: flex; align-items: center; gap: 10px; }
.gal-row-planet img { width: 34px; height: 34px; border-radius: 50%; mix-blend-mode: screen; opacity: 0; transition: opacity 0.4s; }
.gal-row-planet img.ready { opacity: 1; }
.player-name { font-weight: 600; }
.player-name.own { color: var(--cyan); }
.player-name.npc { color: var(--muted); font-style: italic; }
.player-name.prot { color: var(--green); }
.player-name.vac { color: #9aa6c0; }
.player-name.ally { color: var(--green); }
.ally-tag { color: var(--violet); font-weight: 700; font-size: 12px; }
.status { font-size: 11px; color: var(--muted); }
.status b { font-weight: 700; margin: 0 1px; }
.st-A { color: var(--gold); } .st-v { color: #9cc8ff; } .st-b { color: var(--red); } .st-i { color: #8f99ad; } .st-II { color: #5f6880; } .st-n { color: var(--green); } .st-s { color: #ff9a4f; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: var(--muted); padding: 12px 4px 0; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.class-card { padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; gap: 12px; transition: all 0.2s; overflow: hidden; }
.class-art { position: relative; margin: -22px -22px 4px; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid color-mix(in srgb, var(--cc) 45%, transparent); }
.class-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform 0.4s; }
.class-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 55%, rgba(var(--deep-rgb), 0.85)); pointer-events: none; }
.class-card:hover .class-art img { transform: scale(1.04); }
.class-card.active { border-color: var(--cc); box-shadow: 0 0 0 1px var(--cc), 0 0 40px color-mix(in srgb, var(--cc) 30%, transparent); background: color-mix(in srgb, var(--cc) 8%, transparent); }
.class-card h2 { color: var(--cc); font-size: 22px; margin: 0; }
.class-card ul { margin: 0; padding-left: 18px; color: var(--text-soft); font-size: 13.5px; line-height: 1.7; }
.class-emblem { width: 72px; height: 72px; flex: none; object-fit: contain; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--cc) 45%, transparent)); }
.race-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.race-card { position: relative; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.race-card:hover { border-color: color-mix(in srgb, var(--rc) 55%, transparent); }
.race-card.active { border-color: var(--rc); box-shadow: 0 0 0 1px var(--rc), 0 0 40px color-mix(in srgb, var(--rc) 30%, transparent); background: color-mix(in srgb, var(--rc) 8%, transparent); }
.race-art { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--bg); border-bottom: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); }
.race-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 12%; transition: transform 0.5s; }
.race-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 60%, rgba(var(--deep-rgb), 0.9)); pointer-events: none; }
.race-card:hover .race-art img { transform: scale(1.04); }
.race-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 0 18px 18px; margin-top: -34px; position: relative; z-index: 1; }
.race-head { display: flex; align-items: center; gap: 12px; }
.race-head h2 { color: var(--rc); font-size: 20px; margin: 0; }
.race-head small { display: block; font-size: 12px; line-height: 1.3; }
.race-desc { margin: 0; color: var(--text-soft); font-size: 12.5px; }
.race-card ul { margin: 0; padding-left: 18px; color: var(--text); font-size: 13px; line-height: 1.65; }
.race-card li::marker { color: var(--rc); }
.race-emblem { width: 18px; height: 18px; flex: none; object-fit: contain; vertical-align: -4px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rc) 60%, transparent)); }
.race-emblem.big { width: 54px; height: 54px; padding: 8px; border-radius: 14px; background: rgba(var(--deep-rgb), 0.85); border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent); }
img.race-emblem.big { padding: 2px; }
.race-label { display: inline-flex; align-items: center; gap: 5px; color: var(--rc); font-weight: 600; }
a .race-label:hover { text-decoration: underline; }
.race-banner { display: flex; align-items: center; gap: 18px; padding: 14px 18px; color: var(--text); border-color: rgba(255, 198, 92, 0.45); }
.race-banner:hover { text-decoration: none; border-color: var(--gold); box-shadow: var(--shadow), 0 0 30px rgba(255, 198, 92, 0.18); }
.race-banner h2 { margin: 0 0 4px; color: var(--gold); }
.race-banner .muted { font-size: 13px; }
.race-banner .grow { flex: 1; min-width: 0; }
.race-banner-faces { display: flex; flex: none; }
.race-banner-faces img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: center 12%; border: 2px solid var(--rc); margin-left: -10px; background: var(--bg); box-shadow: 0 0 12px color-mix(in srgb, var(--rc) 45%, transparent); }
.race-banner-faces img:first-child { margin-left: 0; }
@media (max-width: 820px) {
  .race-banner { flex-wrap: wrap; }
  .race-banner-faces img { width: 38px; height: 38px; }
}
.vac-pill { padding: 6px 12px; border-radius: 999px; background: rgba(156, 200, 255, 0.15); border: 1px solid #9cc8ff; color: #cfe3ff; font-family: var(--display); font-size: 11px; letter-spacing: 0.08em; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.debris-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--gold); cursor: pointer; }
.debris-chip .res-img { width: 14px; height: 14px; vertical-align: 0; }

/* ---------- fleet ---------- */
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ship-pick { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.ship-pick img { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; }
.ship-pick .sn { font-size: 12.5px; font-weight: 600; }
.ship-pick .sa { font-size: 11px; color: var(--muted); }
.ship-pick input { padding: 6px 8px; margin-top: 4px; }
.ship-pick.disabled { opacity: 0.45; }
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.mission { padding: 12px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); cursor: pointer; text-align: center; transition: all 0.18s; font-family: var(--display); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.mission:hover:not(.disabled) { border-color: var(--mc, var(--cyan)); }
.mission.active { border-color: var(--mc, var(--cyan)); background: color-mix(in srgb, var(--mc, var(--cyan)) 16%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--mc, var(--cyan)) 30%, transparent); }
.mission.disabled { opacity: 0.3; cursor: not-allowed; }
.mission svg { width: 26px; height: 26px; display: block; margin: 0 auto 6px; color: var(--mc, var(--cyan)); }
.mission .mission-img { width: 40px; height: 40px; display: block; margin: -4px auto 4px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--mc, var(--cyan)) 45%, transparent)); transition: transform 0.18s; }
.mission:hover:not(.disabled) .mission-img, .mission.active .mission-img { transform: scale(1.1); }
.mission-head .mission-img { width: 28px; height: 28px; vertical-align: -8px; margin-right: 6px; }
.coords-input { display: flex; gap: 6px; align-items: center; }
.coords-input input { width: 70px; text-align: center; }
.summary { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 13px; }
.summary span:nth-child(odd) { color: var(--muted); }
.summary span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.capbar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.capbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); }
.capbar.over i { background: var(--red); }

/* ---------- messages ---------- */
.msg-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.msg-tabs button { position: relative; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--muted); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-family: var(--display); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.msg-tabs button.active { color: #fff; border-color: var(--cyan); background: rgba(var(--accent-rgb), 0.12); }
.msg-tabs .badge { top: -7px; right: -7px; }
.msg { border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); margin-bottom: 8px; overflow: hidden; }
.msg.unread { border-color: rgba(var(--accent-rgb), 0.45); }
.msg-head { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; }
.msg-head:hover { background: rgba(var(--accent-rgb), 0.05); }
.msg.unread .msg-head .subj { font-weight: 700; color: #fff; }
.msg-head .from { font-size: 12px; color: var(--muted); }
.msg-head .when { font-size: 12px; color: var(--dim); white-space: nowrap; }
.msg-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); white-space: pre-wrap; }
.msg-body .report { white-space: normal; }
.report h4 { font-size: 12px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; }
.report .sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.report .side { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.report .side.att { border-color: rgba(255, 84, 104, 0.35); }
.report .side.def { border-color: rgba(var(--accent-rgb), 0.35); }
.report table.t td, .report table.t th { padding: 5px 8px; }
.report .round { font-size: 12.5px; color: var(--text-soft); padding: 8px 0; border-bottom: 1px dashed var(--line); }
.report .result { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: rgba(var(--accent-rgb), 0.07); border: 1px solid var(--line-strong); }
.unit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 14px; font-size: 12.5px; }
.unit-list div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted rgba(var(--tint-rgb), 0.1); padding: 2px 0; }

/* ---------- theme picker (options) ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.theme-card { display: block; padding: 0; border: 1px solid var(--t-line); border-radius: 12px; overflow: hidden; background: var(--t-bg); color: var(--t-text); font: inherit; text-align: left; cursor: pointer; transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s; }
.theme-card:hover { transform: translateY(-2px); border-color: var(--t-accent); }
.theme-card:focus-visible { outline: 2px solid var(--t-accent); outline-offset: 2px; }
.theme-card.active { border-color: var(--t-accent); box-shadow: 0 0 0 1px var(--t-accent), 0 0 24px color-mix(in srgb, var(--t-accent) 35%, transparent); }
.tc-preview { display: block; height: 76px; padding: 10px; background: radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--t-accent2) 40%, transparent), transparent 65%), var(--t-bg); }
.tc-panel { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 8px; border-radius: 8px; background: var(--t-surface); border: 1px solid var(--t-line); }
.tc-panel i { display: block; height: 4px; border-radius: 4px; }
.tc-panel .tc-l1 { width: 72%; background: var(--t-text); opacity: 0.85; }
.tc-panel .tc-l2 { width: 46%; background: var(--t-muted); }
.tc-panel .tc-btn { width: 54%; height: 10px; margin-top: auto; background: linear-gradient(135deg, var(--t-btn1), var(--t-accent2)); box-shadow: 0 0 10px color-mix(in srgb, var(--t-accent) 45%, transparent); }
.tc-name { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--t-line); font-family: var(--display); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.tc-name::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--t-accent); box-shadow: 0 0 8px var(--t-accent); flex: none; }
.color-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 12px; }
.color-field { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); cursor: pointer; transition: border-color 0.2s; }
.color-field:hover { border-color: var(--line-strong); }
.color-field b { display: block; color: var(--text); font-size: 13px; letter-spacing: 0.02em; }
.color-field small { font-size: 11.5px; }
input[type=color] { flex: none; width: 42px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(var(--deep-rgb), 0.7); cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }
input[type=color]::-moz-color-swatch { border: 0; border-radius: 7px; }

/* ---------- misc ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hide { display: none !important; }
.loading-page { display: grid; place-items: center; min-height: 300px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.tree-item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.tree-item img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.tree-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.mobile-toggle { display: none; }

@media (max-width: 1280px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: 'top top' 'nav main' 'nav planets'; }
  .planets { position: static; height: auto; display: flex; gap: 8px; overflow-x: auto; padding: 0 20px 20px; }
  .planets h3 { display: none; }
  .pl-item { min-width: 200px; margin: 0; }
  .res { min-width: 120px; }
  .layout-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .hero, .detail, .detail:has(.viewer.art-mode) { grid-template-columns: 1fr; }
  .hero .side, .detail .viewer { border: 0; }
  .detail .viewer { min-height: 280px; }
  .res .rl { display: none; }
  .res { min-width: 0; padding-right: 10px; }
  .clock { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto; grid-template-areas: 'top' 'planets' 'main' 'nav'; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .resbar { order: 3; flex: 1 1 100%; width: 100%; justify-content: space-between; overflow-x: auto; gap: 4px; }
  .res { padding: 4px 8px 4px 4px; gap: 6px; }
  .topbar .logo { font-size: 13px; }
  .userbox { margin-left: auto; gap: 6px; }
  .username { display: none; }
  .res .ri { width: 26px; height: 26px; }
  .res .rv { font-size: 12px; }
  .nav { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; z-index: 30; display: flex; overflow-x: auto; padding: 6px; background: rgba(var(--deep-rgb), 0.95); border-top: 1px solid var(--line); }
  .nav a { flex-direction: column; gap: 3px; font-size: 9px; padding: 6px 10px; margin: 0; min-width: 72px; }
  .nav .sep { display: none; }
  .main { padding: 12px 12px 90px; }
  .grid-2, .grid-3, .report .sides { grid-template-columns: 1fr; }
  .grid-items { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .event { grid-template-columns: 70px 1fr; }
  .event > :last-child { grid-column: 1 / -1; }
}

/* ---------- sound ---------- */
.iconbtn.muted { color: var(--muted); opacity: 0.75; }
.sound-prompt { position: fixed; left: 18px; bottom: 18px; z-index: 950; width: min(380px, calc(100vw - 36px)); padding: 16px 18px; animation: popIn 0.4s cubic-bezier(.2, 1.2, .4, 1); }
.sp-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; margin-right: 12px; background: rgba(var(--accent-rgb, 79, 209, 255), 0.15); color: var(--cyan); }
.sp-icon svg { width: 24px; height: 24px; }
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.sound-grid .btn { justify-content: flex-start; }
.range-row { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.range-row span:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .sound-prompt { bottom: 84px; } }.vu { width: 120px; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.vu i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--gold) 70%, var(--red)); transition: width 0.06s linear; }
