:root {
  color-scheme: dark;
  --bg: #07111d;
  --panel: rgba(12, 27, 43, 0.86);
  --panel-strong: #10243a;
  --line: rgba(142, 192, 223, 0.17);
  --text: #edf7ff;
  --muted: #8da8bb;
  --metal: #8ec7e8;
  --crystal: #af91fa;
  --hydrogen: #6ee0c6;
  --energy: #ffd36a;
  --accent: #74d7ff;
  --danger: #ff8190;
  --success: #73e7ac;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 20% -5%, #193555 0, transparent 32rem), radial-gradient(circle at 100% 10%, #18255a 0, transparent 28rem), var(--bg); color: var(--text); }
button { font: inherit; }
button:focus-visible { outline: 2px solid white; outline-offset: 3px; }

.stars { position: fixed; inset: 0; z-index: -1; opacity: .35; pointer-events: none; background-image: radial-gradient(#b6e9ff 1px, transparent 1.5px), radial-gradient(#fff 1px, transparent 1.5px), radial-gradient(#6ba5d7 .8px, transparent 1.2px); background-size: 113px 131px, 167px 193px, 71px 79px; background-position: 17px 29px, 43px 91px, 83px 14px; }
.app-shell { width: min(1440px, 100%); margin: 0 auto; padding: 24px clamp(16px, 3vw, 42px) 48px; }
.topbar, .planet-strip, .resources, .dashboard-grid, .section-heading, .side-title, .upgrade-top, .upgrade-bottom, .ranking-row, .rival-top, .rival-meta { display: flex; align-items: center; }
.topbar { justify-content: space-between; gap: 16px; padding-bottom: 22px; }
.brand, .top-actions, .planet-strip, .resources, .tabs, .command-grid, .queue-summary, .queue-item, .upgrade-title, .costs, .ship-count, .expedition-status, .rival-actions, .rank-name, .full-log-entry, .mini-log-entry { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(116, 215, 255, .7); border-radius: 50%; color: var(--accent); font-size: 24px; box-shadow: 0 0 28px rgba(116, 215, 255, .25), inset 0 0 18px rgba(116, 215, 255, .14); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(18px, 3vw, 24px); letter-spacing: -.04em; }
h2 { font-size: clamp(20px, 3vw, 27px); letter-spacing: -.04em; }
h3 { font-size: 16px; letter-spacing: -.02em; }
.eyebrow { margin-bottom: 3px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .16em; }
.top-actions { gap: 9px; }
.save-status { color: var(--muted); font-size: 12px; }
.icon-button, .dialog-close { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(13, 31, 49, .8); color: var(--text); cursor: pointer; font-size: 17px; }
.icon-button:hover { border-color: rgba(116, 215, 255, .7); color: var(--accent); }
.icon-button.danger:hover { border-color: var(--danger); color: var(--danger); }

.planet-strip { gap: 13px; min-height: 96px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 17px 17px 0 0; background: linear-gradient(105deg, rgba(21, 48, 73, .9), rgba(11, 29, 48, .7)); }
.planet-orb { position: relative; width: 54px; height: 54px; flex: 0 0 auto; overflow: hidden; border: 2px solid #89e4fa; border-radius: 50%; background: linear-gradient(140deg, #4ed0b1, #236caa 47%, #0f2c75 48%, #8d65be); box-shadow: 0 0 28px #70d4f977, inset -12px -4px 16px #07142a9e; }
.planet-orb span { position: absolute; top: 6px; right: -5px; width: 45px; height: 9px; border: 2px solid rgba(221, 255, 255, .75); border-radius: 50%; transform: rotate(-25deg); }
#planet-name { font-size: 18px; }
#world-subtitle { margin-top: 3px; color: var(--muted); font-size: 12px; }
.rank-callout { margin-left: auto; padding-left: 16px; border-left: 1px solid var(--line); text-align: right; }
.rank-callout span, .rank-callout small { display: block; color: var(--muted); font-size: 11px; }
.rank-callout strong { display: block; color: var(--energy); font-size: 23px; line-height: 1.1; }

.resources { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-top: 0; background: rgba(7, 20, 34, .8); }
.resource-card { display: flex; min-width: 0; gap: 9px; align-items: center; padding: 13px 17px; border-right: 1px solid var(--line); }
.resource-card:last-child { border-right: 0; }
.resource-symbol { font-size: 20px; }
.metal .resource-symbol { color: var(--metal); }.crystal .resource-symbol { color: var(--crystal); }.hydrogen .resource-symbol { color: var(--hydrogen); }.energy .resource-symbol { color: var(--energy); }
.resource-card div { min-width: 0; }.resource-card span:not(.resource-symbol) { display: block; color: var(--muted); font-size: 11px; }.resource-card strong { display: block; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }.resource-card small { display: block; color: var(--muted); font-size: 10px; }

.tabs { gap: 3px; overflow-x: auto; margin: 20px 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(6, 19, 32, .72); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }.tab { flex: 1 0 max-content; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; padding: 10px 14px; font-size: 13px; }.tab:hover { color: var(--text); }.tab.active { background: #1a4260; box-shadow: inset 0 0 0 1px rgba(149, 222, 255, .24); color: #dcf7ff; }
.dashboard-grid { align-items: start; gap: 16px; }.content-panel { min-width: 0; flex: 1; padding: clamp(17px, 2vw, 28px); border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 18px 48px rgba(0, 0, 0, .17); }.side-panel { width: 290px; flex: 0 0 290px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); }.side-section { padding: 17px; border-bottom: 1px solid var(--line); }.side-section:last-child { border-bottom: 0; }.side-title { justify-content: space-between; font-size: 14px; font-weight: 700; }.view { display: none; }.view.active { display: block; animation: fade-in .22s ease-out; } @keyframes fade-in { from { opacity: .2; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.section-heading { justify-content: space-between; gap: 16px; margin-bottom: 20px; }.section-heading > span { flex: 0 0 auto; max-width: none; color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }.section-heading.compact { margin: 27px 0 12px; }.section-heading.compact h3 { font-size: 17px; }.prototype-badge { padding: 5px 8px; border: 1px solid rgba(116, 215, 255, .23); border-radius: 999px; background: rgba(116, 215, 255, .07); color: var(--accent); font-size: 10px; }
.command-grid { align-items: stretch; gap: 12px; }.feature-card { display: flex; min-height: 145px; flex: 1; flex-direction: column; gap: 12px; justify-content: space-between; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(125deg, rgba(27, 58, 83, .56), rgba(14, 31, 48, .6)); }.feature-card p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.55; }.feature-icon { color: var(--accent); font-size: 26px; }.offline-note { align-self: flex-start; color: var(--success); font-size: 11px; }.objective-card .secondary-button { align-self: flex-start; }.secondary-button, .action-button { border: 1px solid rgba(116, 215, 255, .46); border-radius: 8px; background: rgba(67, 159, 204, .17); color: #d9f6ff; cursor: pointer; padding: 8px 11px; font-size: 12px; font-weight: 650; }.secondary-button:hover, .action-button:not(:disabled):hover { background: rgba(82, 183, 230, .3); }.action-button { min-width: 88px; background: #1f5a7c; }.action-button:disabled { border-color: var(--line); background: rgba(123, 151, 165, .08); color: #668094; cursor: not-allowed; }.text-button { border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 3px 0; font-size: 11px; }.text-button:hover { color: white; }

.queue-summary { gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }.queue-item, .empty-queue { min-height: 43px; gap: 9px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 16, 27, .5); color: var(--muted); font-size: 11px; }.queue-item strong { color: var(--text); font-size: 12px; }.queue-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }.queue-dot.research { background: var(--crystal); box-shadow: 0 0 10px var(--crystal); }.queue-dot.ship { background: var(--hydrogen); box-shadow: 0 0 10px var(--hydrogen); }
.mini-log, .full-log { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: rgba(5, 15, 26, .55); }.mini-log-entry, .full-log-entry { gap: 10px; padding: 10px 12px; border-bottom: 1px solid rgba(142, 192, 223, .1); }.mini-log-entry:last-child, .full-log-entry:last-child { border-bottom: 0; }.log-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); }.log-dot.good { background: var(--success); }.log-dot.warn { background: var(--energy); }.log-time { flex: 0 0 auto; color: #668599; font-size: 10px; }.log-copy { color: #c7d8e4; font-size: 12px; line-height: 1.4; }

.upgrade-list { display: grid; gap: 10px; }.upgrade-card { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(5, 17, 29, .48); }.upgrade-top { align-items: flex-start; justify-content: space-between; gap: 12px; }.upgrade-title { gap: 10px; }.upgrade-icon { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(116, 215, 255, .25); border-radius: 9px; background: rgba(116, 215, 255, .08); color: var(--accent); font-size: 17px; }.upgrade-card.research-card .upgrade-icon { border-color: rgba(175, 145, 250, .3); background: rgba(175, 145, 250, .09); color: var(--crystal); }.upgrade-card.ship-card .upgrade-icon { border-color: rgba(110, 224, 198, .3); background: rgba(110, 224, 198, .09); color: var(--hydrogen); }.upgrade-title p { margin-top: 3px; color: var(--muted); font-size: 11px; }.level-badge { flex: 0 0 auto; color: var(--accent); font-size: 12px; font-weight: 700; }.upgrade-description { margin: 11px 0 13px; color: #b7cad8; font-size: 12px; line-height: 1.55; }.upgrade-bottom { justify-content: space-between; gap: 14px; }.costs { gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }.cost { white-space: nowrap; }.cost.metal { color: var(--metal); }.cost.crystal { color: var(--crystal); }.cost.hydrogen { color: var(--hydrogen); }.build-time { color: #8baabd; font-size: 10px; }.requirement { margin-top: 8px; color: var(--danger); font-size: 10px; }
.fleet-status, .expedition-status { min-height: 69px; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid rgba(110, 224, 198, .22); border-radius: 10px; background: rgba(110, 224, 198, .06); color: #ccefe6; font-size: 12px; }.fleet-status strong, .expedition-status strong { color: var(--hydrogen); }.ship-count { gap: 7px; color: var(--muted); font-size: 11px; }.ship-count strong { color: var(--text); font-size: 17px; }
.rival-list { display: grid; gap: 10px; }.rival-card { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(5, 17, 29, .48); }.rival-top { gap: 10px; }.rival-emblem { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 16px; }.rival-top h3 { font-size: 14px; }.rival-top p, .rival-meta { color: var(--muted); font-size: 11px; }.rival-rank { margin-left: auto; color: var(--energy); font-size: 12px; font-weight: 700; }.rival-meta { justify-content: space-between; margin: 13px 0; }.rival-actions { gap: 9px; justify-content: flex-end; }.rival-actions span { margin-right: auto; color: var(--muted); font-size: 10px; }.ranking-list { display: grid; gap: 5px; margin-top: 13px; }.ranking-row { gap: 8px; padding: 9px 7px; border-radius: 8px; color: var(--muted); font-size: 11px; }.ranking-row.current { background: rgba(116, 215, 255, .11); color: #e5f9ff; }.ranking-row .rank-num { width: 16px; color: var(--energy); font-weight: 700; }.rank-name { min-width: 0; flex: 1; gap: 6px; }.rank-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.ranking-score { color: inherit; font-variant-numeric: tabular-nums; }.tip-section { background: linear-gradient(155deg, rgba(69, 84, 169, .2), rgba(9, 23, 38, .4)); }.tip-section p:last-child { color: #bed4e5; font-size: 12px; line-height: 1.55; }
.galaxy-overview { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border: 1px solid rgba(116, 215, 255, .2); border-radius: 10px; background: rgba(116, 215, 255, .06); }.galaxy-overview strong { color: var(--accent); font-size: 13px; }.galaxy-overview span { color: var(--muted); font-size: 11px; }.galaxy-filters { display: flex; flex-wrap: wrap; gap: 6px; overflow: visible; margin: 12px 0; }.galaxy-filter { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 17, 29, .5); color: var(--muted); cursor: pointer; padding: 7px 9px; font-size: 11px; }.galaxy-filter:hover, .galaxy-filter.active { border-color: rgba(116, 215, 255, .55); background: rgba(116, 215, 255, .13); color: #dff8ff; }.planet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }.planet-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(5, 17, 29, .48); }.planet-top { display: flex; align-items: center; gap: 8px; }.planet-top h3 { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.planet-top p { margin-top: 2px; color: var(--muted); font-size: 10px; }.planet-orb-mini { width: 24px; height: 24px; flex: 0 0 auto; border: 1px solid var(--planet-color); border-radius: 50%; background: radial-gradient(circle at 32% 28%, #dffcff 0, var(--planet-color) 24%, #17295f 70%); box-shadow: 0 0 12px color-mix(in srgb, var(--planet-color), transparent 55%); }.planet-owner { margin-top: 11px; color: #c5dbe8; font-size: 11px; }.planet-meta { display: flex; justify-content: space-between; gap: 7px; margin: 10px 0; color: var(--muted); font-size: 10px; }.planet-meta span:first-child { color: var(--metal); }.planet-meta span:last-child { color: var(--energy); }.planet-trait { min-height: 32px; margin: -2px 0 10px; color: #9db6c7; font-size: 10px; line-height: 1.45; }.galaxy-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; color: var(--muted); font-size: 11px; }.galaxy-pagination div { display: flex; gap: 6px; }.galaxy-pagination .secondary-button { padding: 6px 9px; font-size: 11px; }.galaxy-pagination .secondary-button:disabled { border-color: var(--line); background: rgba(123, 151, 165, .08); color: #668094; cursor: not-allowed; }
.toast { position: fixed; z-index: 10; right: 18px; bottom: 20px; max-width: min(340px, calc(100vw - 36px)); transform: translateY(80px); border: 1px solid rgba(116, 215, 255, .35); border-radius: 9px; background: #173a52; box-shadow: 0 12px 28px rgba(0, 0, 0, .3); color: white; opacity: 0; padding: 11px 14px; pointer-events: none; transition: .22s ease; font-size: 12px; }.toast.show { transform: translateY(0); opacity: 1; }.help-dialog { width: min(570px, calc(100% - 32px)); border: 1px solid rgba(116, 215, 255, .35); border-radius: 15px; background: #10253b; color: var(--text); padding: 28px; box-shadow: 0 30px 90px #000a; }.help-dialog::backdrop { background: rgba(0, 6, 12, .75); backdrop-filter: blur(3px); }.dialog-close { position: absolute; top: 13px; right: 13px; }.help-dialog h2 { padding-right: 30px; margin-bottom: 15px; }.help-dialog ol { display: grid; gap: 10px; padding-left: 19px; color: #c5d6e1; font-size: 13px; line-height: 1.55; }.dialog-note { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--accent); font-size: 12px; line-height: 1.45; }

@media (max-width: 980px) { .dashboard-grid { display: block; }.side-panel { width: auto; margin-top: 16px; }.side-panel .side-section:first-child { display: none; } .ranking-list { grid-template-columns: repeat(2, 1fr); }.tip-section { display: none; } }
@media (max-width: 680px) { .app-shell { padding: 13px 12px 32px; }.topbar { padding: 4px 3px 17px; }.brand-mark { width: 36px; height: 36px; font-size: 19px; }.save-status { display: none; }.planet-strip { min-height: 77px; padding: 12px; }.planet-orb { width: 45px; height: 45px; }.rank-callout { padding-left: 10px; }.resources { grid-template-columns: repeat(2, 1fr); }.resource-card { padding: 10px 11px; border-bottom: 1px solid var(--line); }.resource-card:nth-child(2) { border-right: 0; }.resource-card:nth-child(3), .resource-card:nth-child(4) { border-bottom: 0; }.resource-card strong { font-size: 15px; }.resource-symbol { font-size: 17px; }.tabs { margin: 13px 0; }.tab { padding: 9px 12px; font-size: 12px; }.content-panel { padding: 16px 13px; border-radius: 12px; }.section-heading { align-items: flex-start; margin-bottom: 15px; }.section-heading > span { display: none; }.command-grid { display: grid; grid-template-columns: 1fr; }.feature-card { min-height: 119px; }.upgrade-card { padding: 13px; }.upgrade-bottom { align-items: flex-end; }.costs { gap: 5px; }.action-button { min-width: 73px; padding: 8px; }.ranking-list { grid-template-columns: 1fr; }.rival-actions { align-items: center; }.planet-grid { grid-template-columns: 1fr; }.galaxy-overview { align-items: flex-start; flex-direction: column; gap: 3px; }.galaxy-pagination { align-items: flex-start; flex-direction: column; }.help-dialog { padding: 23px 18px; } }
