/* Nebula Dominion — interfaccia. Nessun font o file esterno: tutto locale. */
:root {
  --void: #090817;
  --ink: #0e0c22;
  --panel: #151231;
  --panel-2: #1c1840;
  --panel-3: #251f52;
  --line: #2c2759;
  --line-soft: #231f49;
  --text: #ece9ff;
  --muted: #9b96c9;
  --faint: #6d68a0;
  --accent: #7b6cff;
  --accent-2: #a89dff;
  --gold: #ffc857;
  --ferrite: #ee9a62;
  --prism: #6fd6ff;
  --xenon: #8fe388;
  --ok: #5fd39a;
  --warn: #ffc857;
  --danger: #ff6b7a;
  --radius: 14px;
  --radius-sm: 9px;
  --rail: 248px;
  --font: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--void) url("/assets/stars.svg") repeat fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }
.icon { flex: none; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- Struttura ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(21, 18, 49, .96), rgba(14, 12, 34, .98));
  border-right: 1px solid var(--line);
  padding: 18px 14px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; letter-spacing: 0; }

.planet-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: radial-gradient(120% 90% at 85% 0%, rgba(123, 108, 255, .22), transparent 60%), var(--panel);
  padding: 12px; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center;
}
.planet-card .planet-art { width: 64px; height: 64px; }
.planet-card b { display: block; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planet-card span { color: var(--muted); font-size: .82rem; }
.planet-switch { grid-column: 1 / -1; margin: 0; }
.planet-switch summary { cursor: pointer; color: var(--accent-2); font-size: .82rem; list-style: none; padding: 2px 0; }
.planet-switch summary::-webkit-details-marker { display: none; }
.planet-switch ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.planet-switch li a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--text); font-size: .86rem; }
.planet-switch li a:hover, .planet-switch li a[aria-current] { background: var(--panel-3); text-decoration: none; }

.nav { display: grid; gap: 2px; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--muted); font: inherit; font-weight: 550; background: none; border: 0; text-align: left; cursor: pointer; width: 100%;
}
.nav a:hover, .nav button:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--panel-3); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav .count { margin-left: auto; background: var(--danger); color: #1a0a10; border-radius: 999px; font-size: .72rem; font-weight: 750; padding: 1px 7px; }
.nav .sep { height: 1px; background: var(--line-soft); margin: 8px 6px; }
.rail-foot { margin-top: auto; color: var(--faint); font-size: .76rem; line-height: 1.4; padding: 0 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px 22px; background: rgba(9, 8, 23, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.burger { display: none; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.gauges { display: flex; gap: 10px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.gauges::-webkit-scrollbar { display: none; }
.gauge {
  position: relative; flex: 1 1 150px; min-width: 138px; max-width: 230px; padding: 7px 11px 9px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--line); display: grid; grid-template-columns: 22px 1fr; column-gap: 9px; align-items: center; overflow: hidden;
}
.gauge .icon { grid-row: 1 / 3; width: 22px; height: 22px; }
.gauge .amount { font-weight: 700; font-size: 1rem; line-height: 1.15; }
.gauge .sub { color: var(--muted); font-size: .74rem; line-height: 1.2; }
.gauge .fill { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: currentColor; opacity: .9; transition: width .8s linear; }
.gauge.res-ferrite { color: var(--ferrite); }
.gauge.res-prism { color: var(--prism); }
.gauge.res-xenon { color: var(--xenon); }
.gauge.res-energy { color: var(--gold); }
.gauge .amount, .gauge .sub { color: var(--text); }
.gauge .sub { color: var(--muted); }
.gauge.full .amount { color: var(--danger); }
.gauge.neg .amount { color: var(--danger); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.langs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.langs a { padding: 3px 9px; border-radius: 7px; color: var(--muted); font-weight: 650; font-size: .8rem; }
.langs a[aria-current] { background: var(--panel-3); color: var(--text); }
.langs a:hover { text-decoration: none; color: var(--text); }
.who { color: var(--muted); font-size: .85rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { padding: 24px 26px 40px; width: 100%; max-width: 1180px; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--muted); margin: 4px 0 0; max-width: 62ch; }
.footer { color: var(--faint); font-size: .78rem; padding: 14px 26px 22px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line-soft); }
.footer a { color: var(--muted); }

/* ---------- Componenti ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel + .panel, .stack > * + * { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.grid > .panel { margin-top: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-3); border-color: #3a3480; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #8e80ff; border-color: #8e80ff; }
.btn-danger { background: rgba(255, 107, 122, .12); border-color: rgba(255, 107, 122, .5); color: #ff9aa5; }
.btn-danger:hover { background: rgba(255, 107, 122, .22); border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 10px; font-size: .84rem; border-radius: 8px; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--panel-2); border-color: var(--line); }
.btn-primary[disabled]:hover { background: var(--accent); border-color: var(--accent); }
.inline { display: inline; margin: 0; }

.notice { padding: 11px 15px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.ok { border-color: rgba(95, 211, 154, .5); background: rgba(95, 211, 154, .1); }
.notice.error { border-color: rgba(255, 107, 122, .55); background: rgba(255, 107, 122, .1); }
.notice.warn { border-color: rgba(255, 200, 87, .5); background: rgba(255, 200, 87, .09); }
.notice .icon { margin-top: 2px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 650; background: var(--panel-3); color: var(--accent-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(95, 211, 154, .4); }
.badge.warn { color: var(--warn); border-color: rgba(255, 200, 87, .4); }
.badge.danger { color: var(--danger); border-color: rgba(255, 107, 122, .45); }
.badge.dim { color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 6px; border-radius: 999px; background: var(--ink); border: 1px solid var(--line); font-size: .84rem; font-weight: 600; }
.chip.res-ferrite .icon { color: var(--ferrite); }
.chip.res-prism .icon { color: var(--prism); }
.chip.res-xenon .icon { color: var(--xenon); }
.chip.short { border-color: rgba(255, 107, 122, .6); color: #ff9aa5; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.res-ferrite-text { color: var(--ferrite); } .res-prism-text { color: var(--prism); } .res-xenon-text { color: var(--xenon); } .res-energy-text { color: var(--gold); }

.bar { height: 7px; border-radius: 999px; background: var(--ink); border: 1px solid var(--line-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }
.bar.res-ferrite > i { background: var(--ferrite); } .bar.res-prism > i { background: var(--prism); } .bar.res-xenon > i { background: var(--xenon); }
.bar.full > i { background: var(--danger); }

.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; white-space: nowrap; }
tbody tr:hover { background: rgba(123, 108, 255, .05); }
td.num, th.num { text-align: right; }
tr.me td { background: rgba(123, 108, 255, .12); }
tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.unread .subject { font-weight: 700; }

.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.field label, .label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.field .hint { color: var(--faint); font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(123, 108, 255, .25); }
input[type=number] { font-variant-numeric: tabular-nums; }
textarea { min-height: 110px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: .92rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 600; display: inline-flex; gap: 7px; align-items: center; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current] { background: var(--panel); color: var(--text); border-color: var(--line); }
.tabs .count { background: var(--danger); color: #1a0a10; border-radius: 999px; font-size: .7rem; font-weight: 750; padding: 0 6px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.pager a:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.pager span[aria-current] { background: var(--panel-3); color: var(--text); }

.empty { text-align: center; color: var(--muted); padding: 30px 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 12px; }
.stat b { font-size: 1.35rem; font-weight: 700; }
.stat span { color: var(--muted); font-size: .82rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

.countdown { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--gold); white-space: nowrap; }
.dur { color: var(--muted); white-space: nowrap; }
.dur::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 5px; vertical-align: -1px; border: 1.6px solid currentColor; border-radius: 50%; border-top-color: transparent; opacity: .8; }

/* ---------- Panoramica ---------- */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; align-items: center; padding: 22px 26px; background: radial-gradient(90% 140% at 12% 50%, rgba(123, 108, 255, .22), transparent 60%), var(--panel); border: 1px solid var(--line); border-radius: 20px; }
.hero .planet-wrap { position: relative; display: grid; place-items: center; }
.hero .planet-art { width: 230px; height: 230px; filter: drop-shadow(0 0 30px rgba(123, 108, 255, .35)); animation: spin-slow 80s linear infinite; }
.hero .moon-art { position: absolute; right: 2px; bottom: 6px; width: 58px; height: 58px; }
@keyframes spin-slow { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.hero h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero .coords { color: var(--accent-2); font-weight: 650; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 10px 0 14px; color: var(--muted); }
.hero .facts b { color: var(--text); }
.rename summary { cursor: pointer; display: inline-flex; color: var(--muted); font-size: .85rem; list-style: none; }
.rename summary::-webkit-details-marker { display: none; }
.rename[open] form { margin-top: 8px; display: flex; gap: 8px; }
.rename input { max-width: 240px; }
.prod-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.prod-row:last-child { border-bottom: 0; }
.prod-row .bar { grid-column: 2 / 4; }
.prod-row b { font-weight: 650; }
.prod-row .sub { color: var(--muted); font-size: .82rem; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.activity li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 11px; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 11px; }
.activity li.hostile { border-color: rgba(255, 107, 122, .6); background: rgba(255, 107, 122, .09); }
.activity small { display: block; color: var(--muted); }

/* ---------- Elenchi di costruzione ---------- */
.items { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.item.locked { opacity: .72; }
.item-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, var(--panel-3), var(--ink)); border: 1px solid var(--line); color: var(--accent-2); }
.item h3 { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.item .level { font-size: .78rem; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 9px; }
.item .queued { font-size: .78rem; color: var(--gold); font-weight: 650; }
.item .desc { color: var(--muted); font-size: .88rem; margin: 3px 0 8px; max-width: 70ch; }
.item .meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.item .need { color: #ff9aa5; font-size: .84rem; margin-top: 6px; }
.item .unit-stats { color: var(--muted); font-size: .8rem; margin-top: 6px; display: flex; gap: 4px 14px; flex-wrap: wrap; }
.item .unit-stats b { color: var(--text); font-weight: 650; }
.item-act { display: grid; gap: 7px; justify-items: stretch; min-width: 138px; }
.item-act .qtyrow { display: flex; gap: 6px; }
.item-act input[type=number] { width: 86px; padding: 7px 8px; text-align: right; }
.delta { color: var(--ok); font-size: .84rem; font-weight: 650; display: inline-flex; gap: 4px; align-items: center; }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.queue li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 11px; background: var(--ink); border: 1px solid var(--line-soft); }
.queue li.running { border-color: rgba(255, 200, 87, .45); }
.queue .bar { margin-top: 5px; }

/* ---------- Flotte ---------- */
.ship-table input[type=number] { width: 100px; text-align: right; padding: 6px 8px; }
.ship-table .name { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.mission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.mission-grid label { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--ink); cursor: pointer; color: var(--muted); font-weight: 600; }
.mission-grid label:has(input:checked) { border-color: var(--accent); color: var(--text); background: var(--panel-3); }
.mission-grid input { position: absolute; opacity: 0; pointer-events: none; }
.coord-inputs { display: grid; grid-template-columns: repeat(3, 84px); gap: 8px; }
.preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.preview .stat b { font-size: 1.05rem; }
.preview .bad b { color: var(--danger); }
.mission-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.mission-tag.attack { color: #ff9aa5; }

/* ---------- Galassia ---------- */
.galaxy-nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.galaxy-nav .field { width: 92px; }
.sys-table td { padding: 7px 10px; }
.sys-table .pos { width: 40px; color: var(--faint); font-weight: 700; }
.sys-table .mini { display: inline-flex; align-items: center; gap: 9px; }
.sys-table .planet-art, .sys-table .moon-art { width: 34px; height: 34px; }
.sys-table .moon-art { width: 22px; height: 22px; }
.sys-table tr.empty-slot td { color: var(--faint); }
.sys-table td.pl-empty .short { display: none; }
.sys-table td.pl-empty { white-space: nowrap; }
.sys-table tr.own td { background: rgba(123, 108, 255, .13); }
.sys-table .tag { color: var(--gold); font-weight: 650; }
.sys-table .acts { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 4px; vertical-align: 1px; box-shadow: 0 0 8px var(--ok); }
.status-flag { color: var(--faint); font-size: .78rem; margin-left: 4px; }
.debris { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; }

/* ---------- Messaggi e rapporti ---------- */
.msg-body { white-space: pre-wrap; word-break: break-word; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.report-grid > .panel { margin-top: 0; }
.chips { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 1rem; }
.chip b { font-weight: 700; color: var(--text); }
.side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.winner { font-weight: 750; font-size: 1.15rem; }
.winner.win { color: var(--ok); } .winner.lose { color: var(--danger); } .winner.draw { color: var(--warn); }
.round-table td, .round-table th { padding: 6px 8px; font-size: .86rem; }
.unit-list { display: flex; flex-wrap: wrap; gap: 6px; }
.unit-list .chip { font-size: .8rem; }

/* ---------- Ingresso ---------- */
body.guest { background-attachment: fixed; }
.guest-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 26px; gap: 14px; }
.guest-main { max-width: 1040px; margin: 0 auto; padding: 14px 24px 50px; }
.auth-box { max-width: 440px; margin: 40px auto 0; }
.landing { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; min-height: calc(100vh - 220px); }
.landing h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -.03em; }
.landing .lead { color: var(--muted); font-size: 1.1rem; margin: 18px 0 26px; max-width: 46ch; }
.landing .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.landing .btn { padding: 12px 22px; font-size: 1rem; }
.landing .art { display: grid; place-items: center; position: relative; }
.landing .art .planet-art { width: min(380px, 80vw); height: auto; filter: drop-shadow(0 0 60px rgba(123, 108, 255, .4)); animation: spin-slow 120s linear infinite; }
.landing .art .moon-art { position: absolute; left: 4%; bottom: 8%; width: 84px; height: 84px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }
.feature { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.feature .icon { color: var(--accent-2); margin-bottom: 8px; }
.feature h3 { margin-bottom: 4px; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }
.prose { max-width: 70ch; }
.prose h2 { margin: 1.4em 0 .4em; }
.prose p, .prose li { color: #cfcaf5; }
.error-page { text-align: center; padding: 70px 10px; }
.error-page .code { font-size: 5rem; font-weight: 800; letter-spacing: -.04em; color: var(--accent); line-height: 1; }

/* ---------- Admin ---------- */
.admin-tabs { margin-bottom: 18px; }
.planet-edit { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.planet-edit:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.lvl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; }
.lvl-grid label { display: grid; grid-template-columns: 1fr 70px; gap: 8px; align-items: center; color: var(--muted); font-size: .86rem; }
.lvl-grid input { padding: 5px 8px; text-align: right; }
.thread { display: grid; gap: 12px; }
.bubble { padding: 12px 15px; border-radius: 13px; background: var(--ink); border: 1px solid var(--line-soft); max-width: 86%; }
.bubble.staff { background: var(--panel-3); border-color: var(--line); margin-left: auto; }
.bubble .who-line { color: var(--muted); font-size: .8rem; margin-bottom: 4px; display: flex; gap: 10px; justify-content: space-between; }
.copy-box { word-break: break-all; font-family: var(--mono); font-size: .85rem; padding: 10px 12px; background: var(--ink); border: 1px dashed var(--accent); border-radius: 10px; }
details.fold > summary { cursor: pointer; font-weight: 650; padding: 4px 0; }

/* ---------- Adattamento ---------- */
@media (max-width: 1020px) {
  .cols-main, .landing { grid-template-columns: minmax(0, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing .art { order: -1; }
  .landing { min-height: 0; gap: 20px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 40; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 14px 0 40px rgba(0, 0, 0, .5); }
  body.nav-open .rail { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 30; }
  .burger { display: inline-flex; align-items: center; }
  .topbar { position: static; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .topbar .burger { order: 1; }
  .topbar .top-actions { order: 2; margin-left: auto; }
  .gauges { order: 3; flex: 1 0 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .gauge { min-width: 0; max-width: none; }
  .content { padding: 18px 14px 34px; }
  .who { display: none; }
  .hero { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 18px; }
  .hero .planet-art { width: 170px; height: 170px; }
  .hero h1, .hero .facts { justify-content: center; }
  .cols-2, .cols-3, .report-grid, .features { grid-template-columns: minmax(0, 1fr); }
  .item { grid-template-columns: 62px minmax(0, 1fr); gap: 12px; }
  .item-icon { width: 46px; height: 46px; }
  .item-art { width: 62px; height: 62px; }
  .item-art .portrait { width: 62px; height: 62px; }
  .item-act { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .item-act .qtyrow input { flex: 1; width: auto; }
  .queue li { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .queue li form { grid-column: 1 / -1; }
  .guest-top { padding: 12px 14px; gap: 8px; }
  .guest-top { flex-wrap: wrap; }
  .guest-top .row { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .guest-top .btn { padding: 8px 11px; font-size: .9rem; }
  .langs a { padding: 3px 7px; }
  .guest-main { padding: 6px 14px 40px; }
  .coord-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  h1 { font-size: 1.45rem; }
  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gauge { padding: 6px 9px 8px; }
  th, td { padding: 8px 7px; }
  th.hide-sm, td.hide-sm { display: none; }
  .flight-table thead { display: none; }
  .flight-table, .flight-table tbody, .flight-table tr, .flight-table td { display: block; width: 100%; }
  .flight-table tr { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .flight-table td { border: 0; padding: 3px 4px; }
  .flight-table td.right { text-align: left; padding-top: 6px; }
  .sys-table th, .sys-table td { padding: 7px 4px; }
  .sys-table .pos { width: 24px; }
  .sys-table .mini { gap: 6px; }
  .sys-table .planet-art { width: 26px; height: 26px; }
  .sys-table td { font-size: .86rem; }
  .sys-table .debris { flex-direction: column; align-items: flex-start; gap: 0; font-size: .74rem; }
  .sys-table .debris svg { display: none; }
  .sys-table .acts { flex-wrap: nowrap; gap: 4px; }
  .sys-table .acts .btn-sm { padding: 6px 7px; }
  .sys-table td.pl-empty .long { display: none; }
  .sys-table td.pl-empty .short { display: inline; }
  .bubble { max-width: 100%; }
}
/* ---- Staff, permessi, universo, traduzioni (v9) ---- */
.perm-table { min-width: 640px; }
.perm-table th.center, .perm-table td.center { text-align: center; white-space: normal; min-width: 92px; }
.perm-table td:first-child { min-width: 220px; }
.perm-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.perm-table .group-row th { background: var(--panel-2); color: var(--accent-2); font-size: .8rem; text-align: left; padding-top: 10px; padding-bottom: 8px; letter-spacing: .02em; }
.ok-mark { color: var(--ok); font-weight: 800; }
.danger-zone { border-color: rgba(255, 107, 122, .5); background: linear-gradient(180deg, rgba(255, 107, 122, .07), transparent 120px), var(--panel); }
.danger-zone h2 { color: #ff9aa5; }
.plain-list { margin: 8px 0 14px; padding-left: 1.2em; color: var(--muted); font-size: .92rem; }
.plain-list li { margin: 3px 0; }
.tr-note { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; font-size: .82rem; }
.tr-note form { margin: 0; }
.inline-fold { display: inline-block; max-width: 100%; }
.inline-fold > summary { font-weight: 500; color: var(--muted); font-size: .82rem; padding: 0; }
.inline-fold[open] { display: block; flex-basis: 100%; }
.msg-body.orig { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--line); color: var(--muted); background: var(--panel); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Ingresso illustrato (accesso, registrazione, recupero password) ---------- */
.stage-art { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url("/assets/stage.svg") center bottom / cover no-repeat; }
@media (max-aspect-ratio: 3/5) { .stage-art { background-image: url("/assets/stage-m.svg"); } }
.stage-sky { position: absolute; z-index: -1; pointer-events: none; top: 0; left: 0; right: 0; height: 280px; overflow: hidden; }
.stage-sky::before { content: ""; position: absolute; top: 56px; left: calc(50% - 250px); width: 300px; height: 170px; background: url("/assets/stage-sky.svg") center / contain no-repeat; }
.stage-page .guest-top { position: relative; z-index: 2; }
.stage-page .langs { background: rgba(21, 18, 49, .6); backdrop-filter: blur(8px); }
.stage-page .footer { position: relative; z-index: 2; background: linear-gradient(0deg, rgba(5, 4, 18, .82), rgba(5, 4, 18, 0)); border-top-color: transparent; padding-top: 26px; }
.stage-page .footer, .stage-page .footer a { text-shadow: 0 1px 8px rgba(5, 4, 18, .9); }
.stage-page .footer a { color: #b9b4e6; }
.guest-main.stage { max-width: 1240px; padding: 0 32px 32px; }
.stage-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, 440px); gap: clamp(32px, 7vw, 110px); align-items: center; min-height: calc(100vh - 170px); }
.stage-hero { padding-top: 5vh; }
.stage-title { font-size: clamp(2.4rem, 4.6vw, 4rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 760; max-width: 14ch; text-wrap: balance; text-shadow: 0 2px 40px rgba(9, 8, 23, .9); }
.stage-hero .lead { color: #cdc8f4; font-size: 1.08rem; line-height: 1.55; margin: 20px 0 26px; max-width: 46ch; text-shadow: 0 1px 24px rgba(9, 8, 23, .95); }
.pillars { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.pillars li { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; text-shadow: 0 1px 14px rgba(9, 8, 23, .95); }
.pillars .pi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--accent-2); background: rgba(37, 31, 82, .7); border: 1px solid rgba(168, 157, 255, .28); }
.stage-form { min-width: 0; }
.stage .auth-box { max-width: none; margin: 0; position: relative; padding: 30px 30px 26px; border-radius: 22px; border: 1px solid rgba(168, 157, 255, .24);
  background: linear-gradient(180deg, rgba(30, 26, 68, .8), rgba(15, 12, 36, .86)); backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 34px 90px rgba(3, 2, 14, .6), 0 0 70px rgba(123, 108, 255, .16); }
.stage .auth-box::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent-2), #6fd6ff, transparent); opacity: .85; }
.auth-head { margin-bottom: 20px; }
.auth-head h1 { font-size: 1.65rem; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin: 6px 0 0; }
.stage .auth-box .form { gap: 16px; }
.stage .auth-box .field label { color: #b9b4e6; }
.stage .auth-box input[type=text], .stage .auth-box input[type=email], .stage .auth-box input[type=password] { height: 46px; padding: 0 14px; border-radius: 12px; background: rgba(9, 8, 23, .62); border-color: rgba(168, 157, 255, .2); }
.stage .auth-box input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(123, 108, 255, .3); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label-row .mini { font-size: .82rem; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 1rem; border-radius: 12px; width: 100%; }
.stage .btn-primary.btn-lg { background: linear-gradient(135deg, #8f81ff, #6455f0); border-color: transparent; box-shadow: 0 10px 30px rgba(123, 108, 255, .42); }
.stage .btn-primary.btn-lg:hover { background: linear-gradient(135deg, #a094ff, #7466f5); box-shadow: 0 12px 36px rgba(123, 108, 255, .55); }
.stage .btn-ghost.btn-lg { border-color: rgba(168, 157, 255, .32); background: rgba(37, 31, 82, .35); }
.stage .btn-ghost.btn-lg:hover { background: rgba(37, 31, 82, .7); }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--muted); font-size: .88rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(168, 157, 255, .3)); }
.or::after { transform: scaleX(-1); }
.stage .auth-box .check { font-size: .88rem; }
@media (max-width: 900px) {
  .guest-main.stage { padding: 0 16px 24px; }
  .stage-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; min-height: 0; padding-top: 6px; max-width: 540px; margin: 0 auto; }
  .stage-hero { padding-top: 0; }
  .stage-sky::before { left: auto; right: -70px; top: 50px; width: 190px; height: 108px; }
  .stage-title { font-size: clamp(1.9rem, 8vw, 2.5rem); max-width: 16ch; }
  .stage-hero .lead { font-size: .98rem; margin: 12px 0 0; }
  .pillars { display: none; }
  .stage .auth-box { padding: 24px 20px 20px; }
}
@media (min-width: 600px) and (max-width: 900px) { .stage-sky::before { right: 0; top: 64px; width: 250px; height: 142px; } }
@media (max-width: 900px) and (max-height: 760px) { .stage-hero .lead { display: none; } }
@media (prefers-reduced-motion: reduce) { .stage-art { animation: none; } }

/* ---------- Selettore lingua dell'ingresso: barra verticale a destra, al centro ---------- */
.langrail { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 7px 8px;
  background: linear-gradient(180deg, rgba(34, 29, 78, .92), rgba(17, 14, 42, .92)); backdrop-filter: blur(14px); border: 1px solid rgba(168, 157, 255, .45); border-radius: 18px;
  box-shadow: 0 14px 44px rgba(3, 2, 14, .6), 0 0 34px rgba(123, 108, 255, .3); }
.langrail .globe { color: var(--accent-2); margin-bottom: 2px; }
.langrail a { width: 46px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #e7e3ff; font-weight: 800; font-size: .95rem; letter-spacing: .04em; border: 1px solid transparent; transition: background .15s, border-color .15s, transform .1s; }
.langrail a:hover { background: rgba(123, 108, 255, .28); border-color: rgba(168, 157, 255, .5); text-decoration: none; transform: scale(1.06); }
.langrail a[aria-current] { background: linear-gradient(135deg, #8f81ff, #6455f0); color: #fff; box-shadow: 0 6px 18px rgba(123, 108, 255, .55); }
@media (min-width: 701px) and (max-width: 1320px) { .guest-main { padding-right: 84px; } .guest-main.stage { padding-right: 84px; } }
@media (max-width: 700px) {
  .langrail { position: static; transform: none; flex-direction: row; justify-content: center; gap: 6px; margin: 2px 14px 10px; padding: 6px 10px; border-radius: 16px; }
  .langrail .globe { margin: 0 6px 0 0; }
  .langrail a { flex: 1; max-width: 76px; height: 38px; }
}

/* ---------- Ingresso: testi in grassetto e più contrastati ---------- */
.stage-hero .lead { color: #f0edff; font-weight: 650; }
.pillars li { font-weight: 800; }
.auth-sub { color: #d9d5fa; font-weight: 650; }
.stage .auth-box .field label { color: #e4e0ff; font-weight: 750; font-size: .9rem; }
.stage .auth-box .field .hint { color: #c6c1ee; font-weight: 600; }
.stage .auth-box input[type=text], .stage .auth-box input[type=email], .stage .auth-box input[type=password] { font-weight: 600; color: #fff; }
.stage .auth-box .check { color: #e4e0ff; font-weight: 650; }
.stage .auth-box a { font-weight: 750; }
.label-row .mini { font-weight: 750; color: #c9c0ff; }
.stage .btn, .stage-page .guest-top .btn { font-weight: 800; }
.or { color: #d9d5fa; font-weight: 700; }
.stage .auth-box p, .stage .auth-box .notice, .stage-form .notice { font-weight: 650; }
.stage-page .footer, .stage-page .footer a { color: #d9d5fa; font-weight: 650; }
.stage-page .brand span { font-weight: 800; }

/* Ingresso: voci «Costruisci / Conquista / Collabora» su una riga anche a larghezze medie */
@media (min-width: 901px) and (max-width: 1180px) {
  .pillars { gap: 10px 12px; }
  .pillars li { gap: 7px; font-size: .94rem; }
  .pillars .pi { width: 34px; height: 34px; border-radius: 10px; }
}

/* ======================================================================
   v12 — missioni, mercante, strumenti, medaglie, stagioni, chat, avvisi,
   pagina iniziale, animazioni
   ====================================================================== */
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chips-row { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.chips-row .chip { font-size: .84rem; }
.sub-h { margin: 16px 0 8px; font-size: .86rem; font-weight: 700; color: var(--accent-2); letter-spacing: .02em; text-transform: uppercase; }
.bar.big { height: 12px; }
small.hint.block, .check small.hint { display: block; color: var(--faint); font-size: .8rem; font-weight: 500; margin-top: 2px; }
.check > span { min-width: 0; }
.plink { color: inherit; font-weight: 650; }
.plink:hover { color: var(--accent-2); }
.title-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 0 8px; font-size: .72rem; font-weight: 700; color: var(--gold); border: 1px solid rgba(255, 200, 87, .4); border-radius: 999px; background: rgba(255, 200, 87, .08); vertical-align: 1px; white-space: nowrap; }

/* ---- Missioni iniziali ---- */
.missions { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.mission { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.mission .m-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, var(--panel-3), var(--ink)); border: 1px solid var(--line); color: var(--accent-2); }
.mission h3 { display: flex; gap: 6px; align-items: baseline; }
.mission .m-num { color: var(--faint); font-weight: 700; }
.mission .m-body p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }
.mission .m-goal { display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; margin-top: 8px; }
.mission .bar { margin: 6px 0 2px; }
.mission .m-reward { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; font-size: .86rem; }
.mission .m-reward .icon { margin-right: 2px; }
.mission .m-action { display: grid; justify-items: end; }
.mission.state-claimed { opacity: .62; }
.mission.state-claimed .m-icon { color: var(--ok); border-color: rgba(95, 211, 154, .45); }
.mission.state-locked { opacity: .55; }
.mission.state-current { border-color: rgba(123, 108, 255, .65); box-shadow: 0 0 0 1px rgba(123, 108, 255, .25), 0 12px 34px rgba(123, 108, 255, .12); }
.mission.state-ready { border-color: rgba(255, 200, 87, .7); background: linear-gradient(90deg, rgba(255, 200, 87, .08), transparent 60%), var(--panel); }
.mission.state-ready .m-icon { color: var(--gold); border-color: rgba(255, 200, 87, .5); }
.tutorial-box { border-color: rgba(123, 108, 255, .55); background: radial-gradient(120% 100% at 0 0, rgba(123, 108, 255, .14), transparent 60%), var(--panel); }
.tutorial-box .m-goal { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-weight: 600; }
.tutorial-box .m-reward { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 10px; font-size: .86rem; }

/* ---- Mercante ---- */
.trade-grid { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); gap: 10px; align-items: end; }
.trade-arrow { display: grid; place-items: center; height: 40px; color: var(--accent-2); }
.preview-box { display: grid; gap: 4px; padding: 12px 14px; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 12px; }
.preview-box b { font-size: 1.3rem; color: var(--gold); }
.preview-box.bad { border-color: rgba(255, 107, 122, .6); }
.preview-box.bad b { color: var(--danger); }

/* ---- Strumenti ---- */
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.unit-in { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 8px; align-items: center; padding: 6px 8px 6px 10px; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 10px; }
.unit-in span { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 600; min-width: 0; }
.unit-in span .icon { color: var(--accent-2); }
.unit-in input { width: 100%; padding: 5px 7px; text-align: right; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.coords-set { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 8px 10px 10px; border: 1px solid var(--line-soft); border-radius: 12px; grid-column: span 2; }
.coords-set legend { padding: 0 6px; color: var(--accent-2); font-weight: 700; font-size: .84rem; }
.chance { display: flex; height: 30px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--ink); }
.chance span { display: grid; place-items: center; font-size: .8rem; font-weight: 750; color: #0b0a1c; min-width: 0; overflow: hidden; }
.c-win { background: var(--ok); } .c-draw { background: var(--warn); } .c-lose { background: var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--muted); font-size: .86rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---- Medaglie, stagioni, profilo ---- */
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.medal { display: grid; justify-items: center; align-content: start; gap: 5px; text-align: center; padding: 14px 10px 12px; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 14px; }
.medal b { font-size: .92rem; }
.medal small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.m-badge { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: var(--faint); background: radial-gradient(circle at 35% 30%, var(--panel-3), var(--panel)); border: 2px solid var(--line); }
.medal.got { border-color: rgba(255, 200, 87, .45); background: linear-gradient(180deg, rgba(255, 200, 87, .07), transparent 70%), var(--ink); }
.medal.got .m-badge { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 22px rgba(255, 200, 87, .3); background: radial-gradient(circle at 35% 30%, rgba(255, 200, 87, .22), var(--panel)); }
.medal.locked { opacity: .62; }
.medal-grid.compact { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.medal-grid.compact .medal { padding: 10px 8px; }
.medal-grid.compact .m-badge { width: 44px; height: 44px; }
.medal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.winners { margin-bottom: 4px; }
.winners .stat b { font-size: 1.1rem; }

/* ---- Chat di alleanza ---- */
.chat-log { list-style: none; margin: 0 0 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 360px; min-height: 120px; overflow-y: auto; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 12px; }
.chat-log li { position: relative; display: grid; gap: 1px; padding: 7px 34px 7px 11px; background: var(--panel-2); border-radius: 10px; max-width: 88%; align-self: flex-start; }
.chat-log li.mine { align-self: flex-end; background: rgba(123, 108, 255, .22); }
.c-head { display: flex; gap: 8px; align-items: baseline; font-size: .78rem; color: var(--muted); }
.c-head b { color: var(--accent-2); font-weight: 700; }
.chat-log li.mine .c-head b { color: var(--gold); }
.c-head time { color: var(--faint); }
.c-body { white-space: pre-wrap; word-break: break-word; }
.c-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 7px; color: var(--faint); cursor: pointer; opacity: 0; transition: opacity .15s; }
.chat-log li:hover .c-del, .c-del:focus-visible { opacity: 1; }
.c-del:hover { color: var(--danger); background: rgba(255, 107, 122, .12); }
@media (hover: none) { .c-del { opacity: .7; } }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; }
.chat-empty { margin: 0 0 10px; text-align: center; }
.chat-empty[hidden], .chat-error[hidden] { display: none; }
.chat-error { margin: 0 0 10px; }

/* ---- Avvisi ---- */
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.channel { padding: 14px 16px; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 14px; display: grid; gap: 8px; align-content: start; }
.channel h3 { display: flex; align-items: center; gap: 8px; }
.channel p { margin: 0; font-size: .88rem; }
.code-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; background: var(--panel-2); border: 1px dashed rgba(168, 157, 255, .5); border-radius: 10px; }
.code-box b { font-size: 1.05rem; color: var(--gold); user-select: all; }

/* ---- Guida ---- */
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.guide-toc a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font-weight: 600; font-size: .88rem; }
.guide-toc a:hover { background: var(--panel-3); text-decoration: none; }
.guide section { scroll-margin-top: 14px; }
.guide p { max-width: 74ch; color: #d3cffa; line-height: 1.6; }
.guide .panel-head h2 .icon { color: var(--accent-2); }

/* ---- Pagina iniziale ---- */
.home-card { text-align: center; }
.home-card .auth-head { margin-bottom: 14px; }
.perks { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 9px; text-align: left; }
.perks li { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #e9e6ff; }
.perks .icon { color: var(--ok); }
.home-count { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 18px 0 0; color: #d9d5fa; font-weight: 700; font-size: .9rem; }
.home-card .btn-lg + .btn-lg { margin-top: 0; }
.home-more { max-width: 1100px; margin: 38px auto 0; padding: 0 4px 24px; position: relative; z-index: 2; }
.home-h { text-align: center; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; margin: 44px 0 20px; text-shadow: 0 2px 20px rgba(5, 4, 18, .9); }
.home-h:first-child { margin-top: 0; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.step { position: relative; padding: 22px 20px 18px; background: rgba(21, 18, 49, .78); backdrop-filter: blur(8px); border: 1px solid rgba(168, 157, 255, .28); border-radius: 18px; }
.step-n { position: absolute; top: 14px; right: 16px; font-size: 2rem; font-weight: 800; color: rgba(168, 157, 255, .25); line-height: 1; }
.step-i { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; margin-bottom: 12px; color: #fff; background: linear-gradient(135deg, #8f81ff, #6455f0); box-shadow: 0 8px 22px rgba(123, 108, 255, .4); }
.step h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.step p { margin: 0; color: #e0dcfb; font-weight: 600; font-size: .92rem; }
.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.feat { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; background: rgba(21, 18, 49, .72); backdrop-filter: blur(8px); border: 1px solid rgba(168, 157, 255, .22); border-radius: 16px; }
.feat-i { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--gold); background: rgba(255, 200, 87, .1); border: 1px solid rgba(255, 200, 87, .3); }
.feat h3 { font-size: 1rem; font-weight: 800; margin-bottom: 2px; }
.feat p { margin: 0; color: #d9d5fa; font-weight: 600; font-size: .88rem; line-height: 1.45; }
.home-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; }
.home-cta .btn-lg { width: auto; min-width: 220px; padding: 0 28px; }

/* ---- Animazioni ---- */
@keyframes nd-flash { 0% { box-shadow: 0 0 0 0 rgba(255, 200, 87, .0); } 30% { box-shadow: 0 0 0 4px rgba(255, 200, 87, .55), 0 0 36px rgba(255, 200, 87, .5); } 100% { box-shadow: 0 0 0 0 rgba(255, 200, 87, 0); } }
@keyframes nd-pop { 0% { transform: scale(.96); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
li.done-flash, .queue li.done-flash, .activity li.done-flash { animation: nd-flash 1.4s ease-out 1, nd-pop .6s ease-out 1; border-color: rgba(255, 200, 87, .8); }
.countdown.done { color: var(--ok); }
.toast { position: fixed; z-index: 80; right: 16px; bottom: 16px; max-width: min(360px, calc(100vw - 32px)); padding: 11px 14px; display: flex; gap: 10px; align-items: center; background: var(--panel-3); border: 1px solid rgba(168, 157, 255, .5); border-radius: 12px; box-shadow: 0 14px 40px rgba(3, 2, 14, .6); font-weight: 650; animation: nd-pop .3s ease-out 1; }
.toast.warn { border-color: rgba(255, 107, 122, .7); background: #2a1424; }
body.no-anim *, body.no-anim *::before, body.no-anim *::after { animation: none !important; transition: none !important; }

/* ---- Adattamenti per schermi piccoli ---- */
@media (max-width: 900px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps, .feat-grid { grid-template-columns: minmax(0, 1fr); }
  .coords-set { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .mission { grid-template-columns: 44px minmax(0, 1fr); }
  .mission .m-icon { width: 44px; height: 44px; }
  .mission .m-action { grid-column: 1 / -1; justify-items: stretch; }
  .mission .m-action .btn { width: 100%; }
  .trade-grid { grid-template-columns: minmax(0, 1fr); }
  .trade-arrow { display: none; }
  .chat-log li { max-width: 96%; }
  .home-cta .btn-lg { width: 100%; }
}
@media (max-width: 420px) { .grid.cols-4 { grid-template-columns: minmax(0, 1fr); } .unit-grid { grid-template-columns: minmax(0, 1fr); } }
/* v12: piccoli ritocchi */
.grid.align-start { align-items: start; }
@media (max-width: 640px) {
  .member-actions { flex-direction: column; align-items: flex-end !important; }
  .member-actions .btn { white-space: normal; text-align: center; }
}
@media (max-width: 640px) {
  .table-wrap th, .table-wrap td { padding-left: 6px; padding-right: 6px; }
  .member-actions .btn { padding: 4px 8px; font-size: .74rem; }
}

/* ======================================================================
   v14 — Aspetto più luminoso e colorato (solo dentro il gioco: il login resta com'è)
   ====================================================================== */
body.app {
  --void: #1b2360;
  --ink: #1c2459;
  --panel: #283274;
  --panel-2: #323f87;
  --panel-3: #3f4e9f;
  --line: #4b5bb3;
  --line-soft: #3c4b9d;
  --text: #f7f6ff;
  --muted: #c6cbf2;
  --faint: #a3abe0;
  --accent: #8272ff;
  --accent-2: #cac2ff;
  --gold: #ffd166;
  --ferrite: #ffb07a;
  --prism: #78e5ff;
  --xenon: #8cf2aa;
  --ok: #62dca3;
  --danger: #ff7f90;
  background:
    url("/assets/stars.svg") repeat fixed,
    radial-gradient(1200px 700px at 90% -10%, rgba(160, 125, 255, .50), transparent 62%) fixed,
    radial-gradient(1000px 650px at -5% 110%, rgba(50, 205, 215, .30), transparent 60%) fixed,
    radial-gradient(800px 560px at 62% 118%, rgba(255, 125, 175, .20), transparent 62%) fixed,
    linear-gradient(180deg, #202969, #1a2260) fixed;
  background-color: #1d2564;
}
body.app .rail { background: linear-gradient(180deg, rgba(44, 55, 128, .97), rgba(30, 38, 94, .98)); border-right-color: var(--line); }
body.app .topbar { background: rgba(32, 41, 102, .9); border-bottom-color: var(--line); }
body.app .panel,
body.app .item,
body.app .mission,
body.app .stat { box-shadow: 0 8px 24px rgba(8, 10, 40, .24); }
body.app .panel { background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 110px), var(--panel); }
body.app .panel-head h2 .icon { color: var(--accent-2); }
body.app .planet-card { background: radial-gradient(120% 90% at 85% 0%, rgba(150, 125, 255, .34), transparent 62%), radial-gradient(90% 90% at 0% 100%, rgba(60, 200, 210, .18), transparent 60%), var(--panel-2); }
body.app .nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(127, 112, 255, .34), rgba(127, 112, 255, .12)); }
body.app .nav a:hover, body.app .nav button:hover { background: rgba(255, 255, 255, .07); }
body.app .btn:hover { border-color: #6a78d6; }
body.app .btn-primary { background: linear-gradient(135deg, #6f60f5, #5546e6); border-color: transparent; box-shadow: 0 6px 18px rgba(98, 80, 240, .35); }
body.app .btn-primary:hover { background: linear-gradient(135deg, #7d6ffb, #6252ee); }
body.app .btn-primary[disabled]:hover { background: linear-gradient(135deg, #6f60f5, #5546e6); }
body.app .langs a[aria-current] { background: var(--accent); color: #fff; }
body.app .topbar .langs { background: var(--panel-2); }
body.app tbody tr:hover { background: rgba(255, 255, 255, .05); }
body.app tr.me td { background: rgba(127, 112, 255, .2); }

/* Icone del menu, ognuna con il suo colore */
body.app .nav a .icon { color: var(--nav-c, var(--muted)); }
body.app .nav a[aria-current="page"] .icon { filter: drop-shadow(0 0 6px var(--nav-c, transparent)); }
.nav-overview { --nav-c: #b9a8ff; } .nav-buildings { --nav-c: #ffb070; } .nav-research { --nav-c: #5fe3d0; }
.nav-shipyard { --nav-c: #6fb6ff; } .nav-defense { --nav-c: #ff8aa0; } .nav-fleet { --nav-c: #ffd166; }
.nav-galaxy { --nav-c: #ff8ad8; } .nav-messages { --nav-c: #7fd0ff; } .nav-ranking { --nav-c: #ffc24d; }
.nav-alliance { --nav-c: #86f0a4; } .nav-merchant { --nav-c: #5fe3a8; } .nav-tutorial { --nav-c: #ff9ad0; }
.nav-tools { --nav-c: #7fe0e0; } .nav-medals { --nav-c: #ffd166; } .nav-guide { --nav-c: #c3baff; }
.nav-support { --nav-c: #8fb4ff; } .nav-settings { --nav-c: #b4bdf0; } .nav-admin { --nav-c: #ffb070; } .nav-logout { --nav-c: #ff9aa5; }

/* Indicatori delle risorse con il loro colore */
body.app .gauge { background: var(--panel); }
body.app .gauge.res-ferrite { background: linear-gradient(180deg, rgba(255, 171, 112, .24), rgba(255, 171, 112, .07)), var(--panel); border-color: rgba(255, 171, 112, .55); }
body.app .gauge.res-prism { background: linear-gradient(180deg, rgba(114, 226, 255, .22), rgba(114, 226, 255, .06)), var(--panel); border-color: rgba(114, 226, 255, .5); }
body.app .gauge.res-xenon { background: linear-gradient(180deg, rgba(134, 240, 164, .22), rgba(134, 240, 164, .06)), var(--panel); border-color: rgba(134, 240, 164, .5); }
body.app .gauge.res-energy { background: linear-gradient(180deg, rgba(255, 209, 102, .22), rgba(255, 209, 102, .06)), var(--panel); border-color: rgba(255, 209, 102, .5); }
body.app .gauge.full, body.app .gauge.neg { border-color: rgba(255, 117, 135, .7); }

/* Tinte per categoria (edifici, ricerche, navi, difese) */
.tone-ferrite { --tone: #ffab70; --tone-rgb: 255, 171, 112; }
.tone-prism { --tone: #72e2ff; --tone-rgb: 114, 226, 255; }
.tone-xenon { --tone: #86f0a4; --tone-rgb: 134, 240, 164; }
.tone-energy { --tone: #ffd166; --tone-rgb: 255, 209, 102; }
.tone-violet { --tone: #b4a7ff; --tone-rgb: 180, 167, 255; }
.tone-teal { --tone: #5fe3d0; --tone-rgb: 95, 227, 208; }
.tone-rose { --tone: #ff8aa0; --tone-rgb: 255, 138, 160; }
.tone-sky { --tone: #6fb6ff; --tone-rgb: 111, 182, 255; }
.tone-amber { --tone: #ffb84d; --tone-rgb: 255, 184, 77; }
.tone-pink { --tone: #ff8ad8; --tone-rgb: 255, 138, 216; }
body.app .item { border-left: 3px solid rgba(var(--tone-rgb, 180, 167, 255), .85); background: linear-gradient(90deg, rgba(var(--tone-rgb, 180, 167, 255), .13), rgba(var(--tone-rgb, 180, 167, 255), 0) 46%), var(--panel); }
body.app .item-icon { width: 58px; height: 58px; color: var(--tone, #b4a7ff); background: linear-gradient(145deg, rgba(var(--tone-rgb, 180, 167, 255), .34), rgba(var(--tone-rgb, 180, 167, 255), .09)); border-color: rgba(var(--tone-rgb, 180, 167, 255), .55); box-shadow: 0 0 20px rgba(var(--tone-rgb, 180, 167, 255), .18); }
body.app .item .level { background: rgba(var(--tone-rgb, 180, 167, 255), .26); border: 1px solid rgba(var(--tone-rgb, 180, 167, 255), .65); color: #fff; }
body.app .item.locked { opacity: .8; }
body.app .queue li.running { border-color: rgba(255, 209, 102, .6); background: linear-gradient(90deg, rgba(255, 209, 102, .1), transparent 60%), var(--ink); }

/* Testate illustrate */
.page-head.has-banner {
  position: relative; overflow: hidden; align-items: center; min-height: 150px; padding: 22px 28px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 20px; background: #2a3478 right bottom / cover no-repeat;
  box-shadow: 0 10px 30px rgba(8, 10, 40, .32);
}
.page-head.has-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18, 22, 70, .88) 0%, rgba(18, 22, 70, .6) 34%, rgba(18, 22, 70, 0) 68%); pointer-events: none; }
.page-head.has-banner > * { position: relative; }
.page-head.has-banner h1 { font-size: 1.9rem; text-shadow: 0 2px 18px rgba(10, 12, 50, .75); }
.page-head.has-banner p { max-width: min(46ch, 54%); color: #e4e6ff; text-shadow: 0 1px 12px rgba(10, 12, 50, .85); }
.page-head.has-banner .badge { background: rgba(20, 26, 78, .78); backdrop-filter: blur(6px); border-color: rgba(195, 186, 255, .5); color: #fff; }
.page-head.has-banner .row, .page-head.has-banner form { position: relative; }
.has-banner[data-scene="colony"] { background-image: url("/assets/scenes/colony.svg?v=14"); }
.has-banner[data-scene="lab"] { background-image: url("/assets/scenes/lab.svg?v=14"); background-position: right center; }
.has-banner[data-scene="dock"] { background-image: url("/assets/scenes/dock.svg?v=14"); }
.has-banner[data-scene="shield"] { background-image: url("/assets/scenes/shield.svg?v=14"); }
.has-banner[data-scene="fleet"] { background-image: url("/assets/scenes/fleet.svg?v=14"); background-position: right center; }
.has-banner[data-scene="galaxy"] { background-image: url("/assets/scenes/galaxy.svg?v=14"); background-position: right center; }
.has-banner[data-scene="signal"] { background-image: url("/assets/scenes/signal.svg?v=14"); background-position: right center; }
.has-banner[data-scene="podium"] { background-image: url("/assets/scenes/podium.svg?v=14"); }
.has-banner[data-scene="network"] { background-image: url("/assets/scenes/network.svg?v=14"); background-position: right center; }
.has-banner[data-scene="market"] { background-image: url("/assets/scenes/market.svg?v=14"); background-position: right center; }

/* Panoramica: pianeta su uno sfondo di nebulosa */
body.app .hero { background: radial-gradient(70% 120% at 12% 50%, rgba(255, 255, 255, .12), transparent 62%), linear-gradient(90deg, rgba(24, 30, 90, .5), rgba(24, 30, 90, .22)), url("/assets/scenes/home.svg?v=14") right center / cover no-repeat, var(--panel); border-color: var(--line); box-shadow: 0 12px 34px rgba(8, 10, 40, .34); }
body.app .hero .planet-art { filter: drop-shadow(0 0 34px rgba(255, 190, 140, .38)); }
body.app .hero .facts, body.app .hero .rename summary { color: #dfe2ff; }
body.app .hero h1 { text-shadow: 0 2px 16px rgba(10, 12, 50, .6); }

@media (max-width: 760px) {
  .page-head.has-banner { min-height: 118px; padding: 16px 18px; border-radius: 16px; }
  .page-head.has-banner::before { background: linear-gradient(90deg, rgba(18, 22, 70, .9) 0%, rgba(18, 22, 70, .62) 62%, rgba(18, 22, 70, .25) 100%); }
  .page-head.has-banner h1 { font-size: 1.5rem; }
  .page-head.has-banner p { max-width: 100%; }
}

/* Riquadri statistiche con un filo di colore */
body.app .stat { background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)), var(--ink); border-top: 3px solid var(--st, #8272ff); }
body.app .stats .stat:nth-child(6n+1) { --st: #8272ff; } body.app .stats .stat:nth-child(6n+2) { --st: #5fe3d0; }
body.app .stats .stat:nth-child(6n+3) { --st: #ffd166; } body.app .stats .stat:nth-child(6n+4) { --st: #ff8ad8; }
body.app .stats .stat:nth-child(6n+5) { --st: #6fb6ff; } body.app .stats .stat:nth-child(6n+6) { --st: #86f0a4; }
body.app .btn[disabled], body.app .btn.disabled { opacity: .55; }

.page-head.has-banner .btn { background: rgba(20, 26, 78, .78); backdrop-filter: blur(6px); border-color: rgba(195, 186, 255, .5); }
.page-head.has-banner .btn:hover { background: rgba(40, 50, 120, .9); }
.page-head.has-banner .btn-primary { background: linear-gradient(135deg, #6f60f5, #5546e6); }

/* ============================================================
   v17 — Bonus giornaliero, eventi a tempo, notizie, grafici
   ============================================================ */
.notice.event { border-color: rgba(255, 209, 102, .55); background: linear-gradient(90deg, rgba(255, 209, 102, .16), rgba(123, 108, 255, .12)); }
.notice.event.soon { border-style: dashed; background: rgba(123, 108, 255, .08); }
.notice.event .countdown { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }

.bonus-box { border-color: rgba(255, 209, 102, .45); background: radial-gradient(120% 100% at 100% 0, rgba(255, 209, 102, .14), transparent 60%), var(--panel); }
.bonus-box.ready { border-color: rgba(255, 209, 102, .85); box-shadow: 0 0 0 3px rgba(255, 209, 102, .14), 0 10px 30px rgba(10, 12, 50, .35); }
.bonus-box .m-reward { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .86rem; }
.streak { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.streak span { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; border: 1px solid var(--line); background: var(--ink); color: var(--muted); }
.streak span.done { background: linear-gradient(135deg, #ffd166, #ff9f43); border-color: transparent; color: #2b1d00; }
.streak span.now { border-color: #ffd166; color: #ffd166; box-shadow: 0 0 0 3px rgba(255, 209, 102, .22); animation: pulse-ring 1.6s ease-in-out infinite; }
body.no-anim .streak span.now { animation: none; }
@keyframes pulse-ring { 0%, 100% { box-shadow: 0 0 0 3px rgba(255, 209, 102, .22); } 50% { box-shadow: 0 0 0 6px rgba(255, 209, 102, .08); } }

.news-item { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.news-item:first-of-type { border-top: 0; padding-top: 0; }
.news-item h3 { margin: 0 0 4px; font-size: 1.02rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.news-item p { margin: 0 0 6px; white-space: normal; line-height: 1.5; }
.news-item .pin { font-size: .9rem; }

.chart { display: block; max-width: 100%; height: auto; font-family: inherit; }
.chart .ch-grid { stroke: rgba(195, 186, 255, .16); stroke-width: 1; }
.chart .ch-tick { fill: var(--muted); font-size: 11px; }
.chart .ch-tick-r { fill: var(--gold); }
.chart .ch-empty { fill: var(--muted); font-size: 13px; }
.chart .ch-dot { opacity: .9; }
.chart .ch-dot:hover { r: 5; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .84rem; color: var(--muted); }
.ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.trend { font-weight: 650; font-size: .88rem; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--danger); }
.bar.split { display: flex; height: 10px; }
.bar.split > i { border-radius: 0; }
.bar.split > i:first-child { border-radius: 999px 0 0 999px; }
.bar.split > i:last-child { border-radius: 0 999px 999px 0; }

/* v17 — verifica in due passaggi */
.twofa-box.required { border-color: rgba(255, 200, 87, .7); }
.twofa-box .tf-steps { margin: 0; padding-left: 20px; display: grid; grid-template-columns: 1fr; gap: 14px; }
.twofa-box .tf-steps li { line-height: 1.5; }
.twofa-box .qr-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.twofa-box .qr-wrap svg { width: 168px; height: 168px; border-radius: 10px; background: #fff; padding: 0; box-shadow: 0 6px 20px rgba(8, 10, 40, .35); }
.twofa-box code.secret { display: inline-block; font-size: 1rem; letter-spacing: .08em; padding: 6px 10px; border-radius: 8px; background: var(--ink); border: 1px solid var(--line); user-select: all; }
.twofa-box .inline-form .field { max-width: 220px; }
.recovery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.recovery code { padding: 6px 8px; border-radius: 8px; background: var(--ink); border: 1px solid var(--line); text-align: center; letter-spacing: .06em; user-select: all; }

/* v18 — pulsante mostra/nascondi password */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 92px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--text); background: var(--panel-3); }

/* v18 — menu laterale compatto: tutte le voci visibili senza scorrere su uno schermo normale */
@media (min-width: 961px) {
  .rail { padding: 12px 10px 12px; gap: 10px; }
  .brand { font-size: 1rem; }
  .planet-card { padding: 8px 10px; grid-template-columns: 46px 1fr; gap: 10px; }
  .planet-card .planet-art { width: 46px; height: 46px; }
  .planet-card b { font-size: .92rem; }
  .planet-card span { font-size: .78rem; }
  .nav { gap: 1px; }
  .nav a, .nav button { padding: 5px 10px; gap: 9px; font-size: .9rem; border-radius: 8px; }
  .nav a .icon, .nav button .icon { width: 18px; height: 18px; }
  .nav .sep { margin: 4px 6px; }
  .rail-foot { font-size: .7rem; }
}
@media (min-width: 961px) and (max-height: 840px) {
  .nav a, .nav button { padding: 3px 10px; font-size: .86rem; }
  .planet-card { grid-template-columns: 40px 1fr; }
  .planet-card .planet-art { width: 40px; height: 40px; }
  .rail-foot { display: none; }
}

/* v21: numeri del gioco nella pagina di accesso */
.auth-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.auth-stats div { text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.auth-stats b { display: block; font-size: 1.15rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.auth-stats span { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; line-height: 1.2; }
@media (max-width: 480px) { .auth-stats { grid-template-columns: repeat(2, 1fr); } }

/* v21: coppe per i primi tre in classifica (oro, argento, bronzo) */
svg.cup { vertical-align: middle; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45)); }
svg.cup-1 { filter: drop-shadow(0 0 6px rgba(255, 205, 70, .55)); }
/* Podio: i primi tre con nome e punti più grandi */
tr.podium td { padding-top: 12px; padding-bottom: 12px; }
tr.podium .plink, tr.podium td.num b { font-size: 1.22rem; font-weight: 800; letter-spacing: .01em; }
tr.podium-1 .plink { color: #ffd45e; text-shadow: 0 0 14px rgba(255, 205, 70, .35); }
tr.podium-2 .plink { color: #e9edf7; }
tr.podium-3 .plink { color: #f0b283; }
tr.podium-1 { background: linear-gradient(90deg, rgba(255, 205, 70, .12), transparent 60%); }
tr.podium-2 { background: linear-gradient(90deg, rgba(201, 207, 221, .10), transparent 60%); }
tr.podium-3 { background: linear-gradient(90deg, rgba(208, 138, 79, .12), transparent 60%); }
.pm-btn { margin-left: 4px; padding: 2px 6px; vertical-align: middle; }
.btn-xs { padding: 2px 7px; font-size: .78rem; border-radius: 7px; }

/* ---- v22: più colore e disegni ---- */
.portrait { display: block; border-radius: 20px; }
.portrait-sm { border-radius: 9px; vertical-align: middle; margin-right: 8px; }
.item-art { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 6px 18px rgba(var(--tone-rgb, 180, 167, 255), .28), 0 0 0 1px rgba(var(--tone-rgb, 180, 167, 255), .35); transition: transform .25s ease, box-shadow .25s ease; }
.item:hover .item-art { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 26px rgba(var(--tone-rgb, 180, 167, 255), .4), 0 0 0 1px rgba(var(--tone-rgb, 180, 167, 255), .6); }
.item.locked .item-art { filter: saturate(.55) brightness(.85); }
body.app .item { border: 1px solid rgba(var(--tone-rgb, 180, 167, 255), .28); border-left: 4px solid rgba(var(--tone-rgb, 180, 167, 255), .9); background: linear-gradient(100deg, rgba(var(--tone-rgb, 180, 167, 255), .16), rgba(var(--tone-rgb, 180, 167, 255), .03) 48%, rgba(var(--tone-rgb, 180, 167, 255), 0)), var(--panel); }
body.app .item:hover { border-color: rgba(var(--tone-rgb, 180, 167, 255), .55); }
.queue li .portrait-sm { margin-right: 10px; }
.fleet-ships .name .portrait-sm, td .name .portrait-sm { margin-right: 10px; }

/* Menu: ogni voce con il suo colore */
.nav a .icon { color: var(--nav-c, var(--accent-2)); filter: drop-shadow(0 0 6px rgba(0, 0, 0, .25)); }
.nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--nav-c, var(--accent)); background: linear-gradient(90deg, color-mix(in srgb, var(--nav-c, var(--accent)) 22%, transparent), var(--panel-3)); }
.nav a:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--nav-c, var(--accent)) 14%, transparent), var(--panel-2)); }
.nav .nav-overview { --nav-c: #8fb8ff; } .nav .nav-buildings { --nav-c: #ffab70; } .nav .nav-research { --nav-c: #5fe3d0; } .nav .nav-shipyard { --nav-c: #b4a7ff; }
.nav .nav-defense { --nav-c: #ff8aa0; } .nav .nav-fleet { --nav-c: #6fb6ff; } .nav .nav-galaxy { --nav-c: #ff8ad8; } .nav .nav-messages { --nav-c: #86f0a4; }
.nav .nav-ranking { --nav-c: #ffd166; } .nav .nav-alliance { --nav-c: #72e2ff; } .nav .nav-merchant { --nav-c: #ffb84d; } .nav .nav-tutorial { --nav-c: #a6ff9b; }
.nav .nav-tools { --nav-c: #c9c2ff; } .nav .nav-medals { --nav-c: #ffc857; } .nav .nav-guide { --nav-c: #9bd0ff; } .nav .nav-news { --nav-c: #ff9fb8; } .nav .nav-tech { --nav-c: #e3a1ff; }
.nav .nav-support { --nav-c: #7fe0c9; } .nav .nav-settings { --nav-c: #b8b3e0; } .nav .nav-admin { --nav-c: #ffd166; } .nav .nav-logout { --nav-c: #ff8aa0; }

/* Pannelli: titolo con riga colorata, bordo più vivo */
.panel { border-color: rgba(168, 157, 255, .22); box-shadow: 0 6px 22px rgba(6, 8, 30, .28); }
.panel-head { position: relative; padding-bottom: 10px; }
.panel-head::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: linear-gradient(90deg, rgba(168, 157, 255, .55), rgba(111, 214, 255, .35) 40%, transparent 85%); }
.panel-head h2 .icon { color: var(--accent-2); }

/* Pulsanti con sfumatura */
.btn-primary { background: linear-gradient(135deg, #8d7fff, #6a5cf0); border-color: #8d7fff; box-shadow: 0 6px 16px rgba(123, 108, 255, .3); }
.btn-primary:hover { background: linear-gradient(135deg, #9d91ff, #7a6cff); box-shadow: 0 8px 20px rgba(123, 108, 255, .42); }
.btn-danger { background: linear-gradient(135deg, rgba(255, 107, 122, .22), rgba(255, 107, 122, .1)); }

/* Tabelle: intestazioni colorate e righe alternate */
table thead th { color: var(--accent-2); background: linear-gradient(180deg, rgba(123, 108, 255, .14), rgba(123, 108, 255, .04)); }
table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .018); }

/* Risorse in alto: leggero bagliore */
.gauge { box-shadow: 0 0 0 1px rgba(255, 255, 255, .04) inset, 0 6px 18px rgba(6, 8, 30, .25); }

/* Medaglie: medaglione dorato con nastro per quelle ottenute, grigio per le altre */
.medal .m-badge { position: relative; }
.medal .m-badge::before { content: ""; position: absolute; left: 50%; top: -14px; width: 26px; height: 20px; transform: translateX(-50%); background: linear-gradient(90deg, #5a48d6 0 50%, #7b6cff 50%); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); opacity: .55; z-index: -1; }
.medal.got .m-badge { color: #4a3300; background: radial-gradient(circle at 35% 30%, #ffe9a8, #e8b020 55%, #b57b0c); border-color: #ffd770; box-shadow: 0 0 0 3px rgba(255, 200, 87, .18), 0 6px 18px rgba(255, 200, 87, .35); }
.medal.got .m-badge::before { background: linear-gradient(90deg, #d62f4f 0 50%, #ff6b7a 50%); opacity: 1; }
.medal.got .m-badge::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1.5px dashed rgba(90, 50, 0, .35); }
.medal.locked .m-badge { filter: grayscale(.6); }
.medal.locked .m-badge::before { display: none; }
.medal.got { background: linear-gradient(180deg, rgba(255, 200, 87, .12), transparent 70%), var(--ink); border-color: rgba(255, 200, 87, .55); }
.medal.got b { color: #ffe3a1; }

/* Pagina iniziale: passi illustrati e riquadri colorati */
.step-i:has(.portrait-step) { background: none; box-shadow: none; width: 56px; height: 56px; }
.portrait-step { border-radius: 15px; box-shadow: 0 8px 22px rgba(123, 108, 255, .35); }
.feat:nth-child(1) .feat-i { color: #ffab70; background: rgba(255, 171, 112, .12); border-color: rgba(255, 171, 112, .4); }
.feat:nth-child(2) .feat-i { color: #72e2ff; background: rgba(114, 226, 255, .12); border-color: rgba(114, 226, 255, .4); }
.feat:nth-child(3) .feat-i { color: #ffd166; background: rgba(255, 209, 102, .12); border-color: rgba(255, 209, 102, .4); }
.feat:nth-child(4) .feat-i { color: #86f0a4; background: rgba(134, 240, 164, .12); border-color: rgba(134, 240, 164, .4); }
.feat:nth-child(5) .feat-i { color: #ff8ad8; background: rgba(255, 138, 216, .12); border-color: rgba(255, 138, 216, .4); }
.feat:nth-child(6) .feat-i { color: #b4a7ff; background: rgba(180, 167, 255, .12); border-color: rgba(180, 167, 255, .4); }

/* Missioni delle flotte: ogni tipo con il suo colore */
.mission-grid label:has(input[value=attack]) .icon { color: #ff8aa0; } .mission-grid label:has(input[value=transport]) .icon { color: #ffb84d; }
.mission-grid label:has(input[value=deploy]) .icon { color: #6fb6ff; } .mission-grid label:has(input[value=spy]) .icon { color: #5fe3d0; }
.mission-grid label:has(input[value=colonize]) .icon { color: #86f0a4; } .mission-grid label:has(input[value=harvest]) .icon { color: #c9c2ff; }
.mission-grid label:has(input[value=expedition]) .icon { color: #ff8ad8; }
.mission-grid label:has(input:checked) { border-color: rgba(168, 157, 255, .8); background: linear-gradient(135deg, rgba(123, 108, 255, .28), rgba(123, 108, 255, .08)); box-shadow: 0 0 0 1px rgba(168, 157, 255, .35), 0 6px 18px rgba(123, 108, 255, .25); }
.mission-tag.attack { color: #ff8aa0; } .mission-tag.transport { color: #ffb84d; } .mission-tag.deploy { color: #6fb6ff; } .mission-tag.spy { color: #5fe3d0; }
.mission-tag.colonize { color: #86f0a4; } .mission-tag.harvest { color: #c9c2ff; } .mission-tag.expedition { color: #ff8ad8; }

/* v25: pallino "novità" sul menu */
.nav a .dot-new { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(95, 211, 154, .25); margin-left: auto; flex: none; }

/* ---------- Albero tecnologico ---------- */
.tech-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; font-size: .8rem; color: var(--muted); }
.tech-key { display: inline-flex; align-items: center; gap: 6px; }
.tech-key i { width: 12px; height: 12px; border-radius: 4px; background: var(--k, var(--accent)); display: inline-block; }
.tech-key i.ok { background: var(--ok); border-radius: 999px; height: 3px; width: 18px; }
.tech-key i.ko { background: var(--danger); border-radius: 999px; height: 3px; width: 18px; }
.tone-g-buildings { --k: #ffb86b; } .tone-g-research { --k: #6fe0d0; } .tone-g-ships { --k: #8fb8ff; } .tone-g-defenses { --k: #ff8aa0; } .tone-g-moon { --k: #c9c2ff; }
.tech-map-wrap { overflow: auto; border-radius: 14px; background: radial-gradient(circle at 20% 10%, rgba(123, 108, 255, .12), transparent 45%), var(--ink); border: 1px solid var(--line); padding: 4px; }
.tech-map { display: block; font-family: inherit; }
.tech-edges path { fill: none; stroke-width: 1.6; opacity: .75; }
.tech-edges path.ok { stroke: var(--ok); }
.tech-edges path.ko { stroke: var(--danger); stroke-dasharray: 5 4; }
.tech-node rect { fill: rgba(255, 255, 255, .05); stroke: var(--k, var(--line)); stroke-width: 1.4; transition: fill .2s ease; }
.tech-node.g-buildings { --k: #ffb86b; } .tech-node.g-research { --k: #6fe0d0; } .tech-node.g-ships { --k: #8fb8ff; } .tech-node.g-defenses { --k: #ff8aa0; } .tech-node.g-moon { --k: #c9c2ff; }
.tech-node.owned rect { fill: rgba(var(--accent-rgb, 123, 108, 255), .16); }
.tech-node.locked rect { stroke-dasharray: 4 3; opacity: .85; }
.tech-node:hover rect { fill: rgba(255, 255, 255, .12); }
.tech-node-name { fill: var(--text); font-size: 12.5px; font-weight: 700; }
.tech-node-sub { fill: var(--muted); font-size: 10.5px; }
.tech-node.locked .tech-node-sub { fill: #ff9aa5; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tech-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: linear-gradient(160deg, rgba(var(--tone-rgb, 180, 167, 255), .08), transparent 55%), var(--panel-2); }
.tech-card.locked { border-style: dashed; }
.tech-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tech-card-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tech-card-head b { font-size: 1rem; }
.tech-card-head .muted { font-size: .8rem; }
.portrait-md { border-radius: 13px; box-shadow: 0 4px 12px rgba(var(--tone-rgb, 180, 167, 255), .25); flex: none; }
.tech-req { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 6px; }
.tech-req > small { width: 100%; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.tech-req .chip { font-size: .78rem; padding: 1px 8px 1px 6px; }
.tech-req .chip.ok { border-color: rgba(95, 211, 154, .45); color: var(--ok); }
.tech-req .chip.ko { border-color: rgba(255, 107, 122, .55); color: #ff9aa5; }
.tech-req .chip small { opacity: .75; font-weight: 500; }

/* ======================================================================
   v28 — Ridisegno dell'interno: caratteri propri, sfondo di nebulosa,
   pannelli in vetro, strumenti delle risorse ad anello, menu a sezioni.
   ====================================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-700.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/poppins-500.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/poppins-700.woff") format("woff"); }

:root {
  --font: "Inter", "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  --display: "Poppins", "Inter", "Segoe UI", system-ui, sans-serif;
  --void: #05051a;
  --glass: rgba(22, 19, 54, .66);
  --glass-2: rgba(30, 26, 72, .55);
  --line: rgba(168, 157, 255, .2);
  --line-soft: rgba(168, 157, 255, .11);
  --accent: #8a7cff;
  --accent-rgb: 138, 124, 255;
}
body.app {
  background:
    radial-gradient(1200px 700px at 8% -10%, rgba(123, 108, 255, .22), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(255, 138, 216, .12), transparent 55%),
    radial-gradient(1000px 700px at 85% 100%, rgba(95, 227, 208, .1), transparent 55%),
    url("/assets/stars.svg") repeat fixed,
    var(--void);
  background-attachment: fixed, fixed, fixed, fixed, fixed;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
body.app h1, body.app h2, body.app h3, body.app .brand, body.app .gauge .amount, body.app .stat b, body.app .nav a, body.app .nav button,
body.app .winner, body.app .countdown, body.app .hero h1, body.app .error-page .code, body.app tr.podium .plink, body.app tr.podium td.num b,
body.app .item .level, body.app .btn-primary, body.app .tabs a, body.app .auth-stats b { font-family: var(--display); }
body.app h1 { font-weight: 700; letter-spacing: -.015em; }
body.app h2 { font-weight: 700; font-size: 1.1rem; letter-spacing: -.005em; }
body.app h3 { font-weight: 700; }
body.app .btn { font-weight: 600; }

/* --- Colonna di sinistra: vetro scuro con un raggio di luce --- */
body.app .rail {
  background: linear-gradient(180deg, rgba(28, 24, 68, .9), rgba(10, 9, 30, .94)), radial-gradient(400px 260px at 20% 0, rgba(123, 108, 255, .35), transparent 70%);
  border-right: 1px solid rgba(168, 157, 255, .14);
  box-shadow: 10px 0 40px rgba(3, 2, 14, .35);
}
body.app .rail::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 260px; background: radial-gradient(300px 200px at 30% 0, rgba(123, 108, 255, .28), transparent 70%); pointer-events: none; }
body.app .rail > * { position: relative; }
body.app .brand { font-weight: 700; letter-spacing: -.01em; }
body.app .brand small { font-family: var(--font); color: #b2acdf; }
body.app .planet-card {
  border: 1px solid rgba(168, 157, 255, .26); border-radius: 16px;
  background: radial-gradient(120% 100% at 85% 0%, rgba(123, 108, 255, .28), transparent 60%), linear-gradient(180deg, rgba(37, 31, 82, .7), rgba(20, 17, 48, .8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 22px rgba(3, 2, 14, .35);
}
body.app .planet-card .planet-art { filter: drop-shadow(0 0 14px rgba(255, 190, 140, .3)); }
body.app .planet-card b { font-family: var(--display); font-weight: 700; }
body.app .planet-card span { color: #c3bdf0; }
body.app .planet-switch summary { color: var(--accent-2); font-weight: 600; }
body.app .nav { gap: 0; }
body.app .nav-group { display: grid; gap: 0; padding-bottom: 3px; }
body.app .nav-cap { display: block; color: #8781bb; font-size: .66rem; font-weight: 600; letter-spacing: .06em; padding: 5px 10px 2px; font-family: var(--font); line-height: 1.2; }
body.app .nav a, body.app .nav button { font-weight: 500; font-size: .88rem; color: #c9c4f0; border-radius: 9px; padding: 3px 10px; gap: 9px; position: relative; }
body.app .nav a .icon, body.app .nav button .icon { width: 24px; height: 24px; padding: 4px; border-radius: 7px; background: color-mix(in srgb, var(--nav-c, var(--accent)) 14%, transparent); color: var(--nav-c, var(--accent-2)); filter: none; }
body.app .nav a:hover, body.app .nav button:hover { background: rgba(255, 255, 255, .05); color: #fff; }
body.app .nav a[aria-current="page"] {
  color: #fff; box-shadow: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--nav-c, var(--accent)) 28%, transparent), rgba(255, 255, 255, .03));
}
body.app .nav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 5px; bottom: 5px; width: 3px; border-radius: 3px; background: var(--nav-c, var(--accent)); box-shadow: 0 0 10px var(--nav-c, var(--accent)); }
body.app .nav a[aria-current="page"] .icon { background: var(--nav-c, var(--accent)); color: #10102a; box-shadow: 0 0 14px color-mix(in srgb, var(--nav-c, var(--accent)) 60%, transparent); }
body.app .nav .sep { background: rgba(168, 157, 255, .14); margin: 4px 4px 6px; }
body.app .nav .count { font-family: var(--font); }
body.app .rail-foot { color: #7f79b5; }
@media (min-width: 961px) and (max-height: 840px) {
  body.app .nav a, body.app .nav button { padding: 2px 10px; font-size: .84rem; }
  body.app .nav a .icon, body.app .nav button .icon { width: 22px; height: 22px; padding: 4px; }
  body.app .nav-cap { padding-top: 3px; font-size: .62rem; }
  body.app .rail { gap: 6px; }
}
@media (min-width: 961px) and (max-height: 740px) {
  body.app .nav-cap { display: none; }
  body.app .nav-group { padding-bottom: 2px; }
  body.app .planet-card { display: none; }
}

/* --- Barra in alto: strumenti delle risorse ad anello --- */
body.app .topbar { background: linear-gradient(180deg, rgba(8, 7, 26, .9), rgba(8, 7, 26, .72)); border-bottom: 1px solid rgba(168, 157, 255, .14); padding: 9px 22px; backdrop-filter: blur(14px) saturate(1.2); }
body.app .gauges { gap: 8px; }
body.app .gauge {
  grid-template-columns: 44px 1fr; column-gap: 10px; padding: 6px 12px 6px 8px; border-radius: 14px; min-width: 150px; max-width: 240px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)), rgba(14, 12, 36, .6);
  border: 1px solid color-mix(in srgb, var(--g, #b4a7ff) 32%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 6px 16px rgba(3, 2, 14, .3);
}
body.app .gauge.res-ferrite { --g: #ffab70; } body.app .gauge.res-prism { --g: #72e2ff; } body.app .gauge.res-xenon { --g: #86f0a4; } body.app .gauge.res-energy { --g: #ffd166; }
body.app .gauge .fill { display: none; }
body.app .gauge .ring { position: relative; grid-row: 1 / 3; width: 44px; height: 44px; display: grid; place-items: center; color: var(--g, #b4a7ff); }
body.app .gauge .ring svg { position: absolute; inset: 0; width: 44px; height: 44px; transform: rotate(-90deg); }
body.app .gauge .ring .icon { position: relative; width: 18px; height: 18px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--g, #b4a7ff) 70%, transparent)); }
body.app .gauge .ring-track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 3.2; }
body.app .gauge .ring-fill { fill: none; stroke: var(--g, #b4a7ff); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset 1s ease; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--g, #b4a7ff) 70%, transparent)); }
body.app .gauge .amount { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; color: #fff; }
body.app .gauge .sub { color: #a9a4d6; font-size: .72rem; }
body.app .gauge .sub .faint { color: #7c77ad; }
body.app .gauge.full .ring-fill, body.app .gauge.neg .ring-fill { stroke: #ff7587; }
body.app .gauge.full .amount, body.app .gauge.neg .amount { color: #ff9aa5; }
body.app .gauge.full, body.app .gauge.neg { border-color: rgba(255, 117, 135, .6); }
body.app .langs { background: rgba(14, 12, 36, .6); border-color: rgba(168, 157, 255, .22); }
body.app .langs a[aria-current] { background: var(--accent); color: #fff; }
body.app .who { color: #c3bdf0; font-weight: 500; }
body.app .burger { background: rgba(14, 12, 36, .6); }

/* --- Contenuto: pannelli in vetro --- */
body.app .content { max-width: 1240px; padding: 26px 28px 44px; }
body.app .panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0) 120px), var(--glass);
  border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 30px rgba(3, 2, 14, .32);
  backdrop-filter: blur(10px);
}
body.app .panel-head { padding-bottom: 10px; margin-bottom: 14px; }
body.app .panel-head h2 .icon { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: rgba(var(--accent-rgb), .16); color: var(--accent-2); }
body.app .panel-head::after { background: linear-gradient(90deg, rgba(168, 157, 255, .5), rgba(111, 214, 255, .3) 40%, transparent 80%); }
body.app .stat { border-radius: 14px; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)), rgba(10, 9, 30, .55); border: 1px solid var(--line-soft); }
body.app .stat b { font-size: 1.4rem; }
body.app .kv dt { color: #a9a4d6; }
body.app .empty { color: #a9a4d6; }
body.app .notice { border-radius: 14px; backdrop-filter: blur(8px); }
body.app .notice.ok { background: rgba(95, 211, 154, .12); }
body.app .notice.error { background: rgba(255, 107, 122, .12); }
body.app .badge { font-family: var(--font); font-weight: 600; }

/* Pulsanti */
body.app .btn { border-radius: 11px; background: rgba(255, 255, 255, .06); border-color: rgba(168, 157, 255, .26); transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; }
body.app .btn:hover { background: rgba(255, 255, 255, .11); border-color: rgba(168, 157, 255, .5); }
body.app .btn-primary { background: linear-gradient(135deg, #9b8eff, #6a5cf0 60%, #5a4ce0); border-color: rgba(190, 180, 255, .5); color: #fff; box-shadow: 0 8px 20px rgba(123, 108, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
body.app .btn-primary:hover { background: linear-gradient(135deg, #a89dff, #7a6cff 60%, #6657ec); box-shadow: 0 10px 26px rgba(123, 108, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .3); }
body.app .btn-primary[disabled]:hover { background: linear-gradient(135deg, #9b8eff, #6a5cf0 60%, #5a4ce0); }
body.app .btn-danger { background: linear-gradient(135deg, rgba(255, 107, 122, .24), rgba(255, 107, 122, .1)); border-color: rgba(255, 107, 122, .5); }
body.app .btn-ghost { background: transparent; }
body.app .btn-ghost:hover { background: rgba(255, 255, 255, .07); }

/* Campi e tabelle */
body.app input[type=text], body.app input[type=email], body.app input[type=password], body.app input[type=number], body.app input[type=search], body.app select, body.app textarea {
  background: rgba(8, 7, 26, .6); border-color: rgba(168, 157, 255, .22); border-radius: 11px;
}
body.app input:focus, body.app select:focus, body.app textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); }
body.app th { color: #a9a4d6; font-weight: 600; font-size: .78rem; letter-spacing: .02em; border-bottom: 1px solid rgba(168, 157, 255, .22); padding-bottom: 10px; }
body.app td { border-bottom-color: rgba(168, 157, 255, .09); }
body.app tbody tr:hover { background: rgba(var(--accent-rgb), .07); }
body.app tbody tr:last-child td { border-bottom: 0; }
body.app .tabs { border-bottom-color: rgba(168, 157, 255, .18); gap: 2px; }
body.app .tabs a { font-weight: 600; font-size: .92rem; color: #a9a4d6; }
body.app .tabs a[aria-current] { background: rgba(var(--accent-rgb), .16); color: #fff; border-color: rgba(168, 157, 255, .3); }
body.app .pager a, body.app .pager span { background: rgba(255, 255, 255, .04); }

/* Testate illustrate: più alte, bordo luminoso */
body.app .page-head.has-banner { border-radius: 22px; min-height: 160px; border-color: rgba(168, 157, 255, .3); box-shadow: 0 16px 40px rgba(3, 2, 14, .45), inset 0 1px 0 rgba(255, 255, 255, .12); }
body.app .page-head.has-banner h1 { font-size: 2rem; }
body.app .page-head.has-banner p { font-weight: 500; }
body.app .page-head:not(.has-banner) h1 { font-size: 1.7rem; }

/* Panoramica */
body.app .hero { border-radius: 22px; border-color: rgba(168, 157, 255, .3); box-shadow: 0 16px 40px rgba(3, 2, 14, .45), inset 0 1px 0 rgba(255, 255, 255, .12); }
body.app .prod-row { padding: 12px 0; }
body.app .prod-row b { font-family: var(--display); }
body.app .bar { background: rgba(8, 7, 26, .7); border-color: rgba(168, 157, 255, .14); height: 8px; }
body.app .bar > i { box-shadow: 0 0 10px rgba(255, 255, 255, .15); }
body.app .activity li { border-radius: 13px; background: rgba(8, 7, 26, .5); }

/* Schede di costruzione */
body.app .item { border-radius: 18px; padding: 16px 18px; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 18px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 8px 24px rgba(3, 2, 14, .3); backdrop-filter: blur(8px); }
body.app .item-art { width: 92px; height: 92px; border-radius: 22px; }
body.app .item-art .portrait { width: 92px; height: 92px; border-radius: 22px; }
body.app .item h3 { font-size: 1.06rem; }
body.app .item .level { font-size: .76rem; padding: 2px 10px; }
body.app .item .desc { color: #b9b4e6; }
body.app .item-act .btn-primary { padding: 10px 16px; }
body.app .queue li { border-radius: 13px; background: rgba(8, 7, 26, .5); }

/* Flotte e galassia */
body.app .mission-grid label { background: rgba(8, 7, 26, .5); border-radius: 12px; }
body.app .mission-grid label:has(input:checked) { background: rgba(var(--accent-rgb), .2); border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
body.app .sys-table tr.own td { background: rgba(var(--accent-rgb), .16); }
body.app .sys-table .planet-art { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
body.app .sys-table .acts .btn-sm { border-radius: 9px; }

/* Messaggi */
body.app tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent-2); }
body.app .bubble { border-radius: 15px; background: rgba(8, 7, 26, .55); }
body.app .bubble.staff { background: rgba(var(--accent-rgb), .18); }

/* Pié di pagina */
body.app .footer { border-top-color: rgba(168, 157, 255, .12); color: #7f79b5; }

/* Adattamento */
@media (max-width: 900px) {
  body.app .topbar { padding: 8px 12px; }
  body.app .gauge { grid-template-columns: 34px 1fr; column-gap: 7px; padding: 5px 8px 5px 6px; border-radius: 12px; min-width: 0; }
  body.app .gauge .ring, body.app .gauge .ring svg { width: 34px; height: 34px; }
  body.app .gauge .ring .icon { width: 14px; height: 14px; }
  body.app .gauge .amount { font-size: .9rem; }
  body.app .gauge .sub { font-size: .66rem; }
  body.app .content { padding: 18px 14px 36px; }
  body.app .panel { padding: 14px 14px; border-radius: 16px; }
  body.app .item { grid-template-columns: 66px minmax(0, 1fr); gap: 12px; padding: 14px; }
  body.app .item-art, body.app .item-art .portrait { width: 66px; height: 66px; border-radius: 16px; }
}
@media (max-width: 520px) {
  body.app .gauge .sub .faint { display: none; }
}
@media (prefers-reduced-motion: reduce) { body.app .gauge .ring-fill { transition: none; } }
body.no-anim .gauge .ring-fill { transition: none; }

/* Assistenza: voce del menu in giallo e grassetto quando c'è una risposta da leggere */
body.app .nav a.alert { color: #ffd166; font-weight: 700; }
body.app .nav a.alert .icon { background: rgba(255, 209, 102, .22); color: #ffd166; }
body.app .nav a.alert[aria-current="page"] .icon { background: #ffd166; color: #2b1d00; }
body.app .nav .count.gold { background: #ffd166; color: #2b1d00; }
body.app tr.ticket-waiting td { background: rgba(255, 209, 102, .08); }
body.app tr.ticket-waiting td a { color: #ffd166; font-weight: 700; }
