/* Exonis — OGame-artiges Weltraum-HUD, keine externen Ressourcen */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #04070e;
  --panel: rgba(11, 18, 32, .92);
  --panel2: #131e33;
  --border: #24384f;
  --border-glow: #2f5378;
  --text: #cfd8e8;
  --dim: #7e8ca3;
  --accent: #5fc7ff;
  --ok: #4dd97a;
  --err: #ff6161;
  --warn: #ffb84d;
  --ferrit: #d99a62;
  --silizid: #6fd8d0;
  --tritium: #7fe07f;
  --energie: #ffd166;
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
}
html, body { height: 100%; }
body {
  background: var(--bg) url("img/bg_space.webp") center top / cover no-repeat fixed;
  color: var(--text);
  font: 14px/1.5 system-ui, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin-bottom: .6em; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
h1 { font-size: 1.25rem; color: #e8f2ff; text-shadow: 0 0 12px rgba(95, 199, 255, .35); }
h2 { font-size: 1rem; color: var(--accent); }

/* ── Kopfleiste ───────────────────────────────────────────── */
.topbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 6px 14px;
  background: linear-gradient(180deg, rgba(16, 26, 46, .97), rgba(8, 13, 24, .97));
  border-bottom: 1px solid var(--border-glow);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .6);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  font-weight: 800; letter-spacing: .3em; color: var(--accent);
  text-shadow: 0 0 10px rgba(95, 199, 255, .6);
}
.resbar { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; justify-content: center; }
.restile {
  display: flex; align-items: center; gap: 8px;
  min-width: 118px; padding: 4px 10px;
  background: linear-gradient(180deg, #16233c, #0c1526);
  border: 1px solid var(--border); border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.restile svg { width: 20px; height: 20px; flex-shrink: 0; }
.restile .lbl { display: block; font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); line-height: 1.2; }
.restile .val { display: block; font-family: var(--mono); font-size: .9rem; line-height: 1.2; color: #e8f2ff; }
.restile .val.full { color: var(--warn); }
.restile .val.neg { color: var(--err); }
.restile.t-ferrit  { border-bottom: 2px solid var(--ferrit); }
.restile.t-silizid { border-bottom: 2px solid var(--silizid); }
.restile.t-tritium { border-bottom: 2px solid var(--tritium); }
.restile.t-energie { border-bottom: 2px solid var(--energie); }
.planetsel select {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 8px; max-width: 220px;
}

/* ── Grundgerüst ──────────────────────────────────────────── */
.wrap { display: flex; min-height: calc(100vh - 46px); }
.wrap.guest { align-items: center; justify-content: center; min-height: 100vh; }
.sidebar {
  width: 178px; flex-shrink: 0; padding: 10px 0 14px;
  background: linear-gradient(180deg, rgba(13, 21, 38, .96), rgba(8, 13, 24, .96));
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sidebar .navhead {
  padding: 12px 16px 4px; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .18em; color: var(--dim);
}
.sidebar a {
  padding: 7px 16px; color: var(--text);
  border-left: 3px solid transparent;
}
.sidebar a:hover {
  background: rgba(95, 199, 255, .08);
  border-left-color: var(--accent); text-decoration: none;
}
.sidebar a.active {
  background: rgba(95, 199, 255, .12);
  border-left-color: var(--accent); color: #e8f2ff;
}
.sidebar a.logout { margin-top: auto; color: var(--dim); }
.badge {
  background: var(--err); color: #fff; border-radius: 9px; padding: 0 6px;
  font-size: .75rem; font-weight: 700;
}
.content { flex: 1; padding: 18px; max-width: 1150px; }

/* ── Boxen & Tabellen ─────────────────────────────────────── */
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 14px; margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--dim); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
tr:hover td { background: rgba(95, 199, 255, .04); }
.table-scroll { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* ── Gebäudekarten (OGame-Stil) ───────────────────────────── */
.bcard {
  display: flex; gap: 14px; align-items: stretch;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px; margin-bottom: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
  transition: border-color .15s;
}
.bcard:hover { border-color: var(--border-glow); }
.bcard.locked { opacity: .75; }
.bimg { position: relative; flex-shrink: 0; width: 160px; }
.bimg img {
  display: block; width: 160px; height: 120px; object-fit: cover;
  border: 1px solid var(--border-glow); border-radius: 4px;
  background: var(--panel2);
}
.bcard.locked .bimg img { filter: grayscale(.7) brightness(.7); }
.lvl {
  position: absolute; right: -7px; top: -7px;
  min-width: 26px; height: 26px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #1d3d5c, #0e2038);
  border: 1px solid var(--accent); border-radius: 50%;
  color: #e8f2ff; font-family: var(--mono); font-size: .85rem; font-weight: 700;
  box-shadow: 0 0 8px rgba(95, 199, 255, .5);
}
.binfo { flex: 1; min-width: 0; }
.binfo h3 { font-size: .95rem; margin-bottom: 2px; color: #e8f2ff; }
.binfo h3 .stufe { color: var(--dim); font-weight: 400; letter-spacing: .04em; }
.binfo .desc { color: var(--dim); margin-bottom: 6px; }
.bmeta { font-size: .85rem; color: var(--dim); margin-top: 6px; }
.bact { display: flex; flex-direction: column; justify-content: center; gap: 6px; flex-shrink: 0; }
.bact .order-form { display: flex; flex-direction: column; gap: 6px; }
.bact .order-form input[type="number"] { width: 110px; margin: 0; }

/* ── Kosten-Chips ─────────────────────────────────────────── */
.cost { display: flex; flex-wrap: wrap; gap: 6px; }
.cost span, td.cost span {
  display: inline-block; padding: 1px 8px; white-space: nowrap;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border);
  border-radius: 3px; font-family: var(--mono); font-size: .82rem;
}
.cost .r-ferrit  { border-bottom: 2px solid var(--ferrit); }
.cost .r-silizid { border-bottom: 2px solid var(--silizid); }
.cost .r-tritium { border-bottom: 2px solid var(--tritium); }
.cost .lack { color: var(--err); border-color: rgba(255, 97, 97, .5); }
td.cost { display: table-cell; }
td.cost span { margin-right: 6px; }

/* ── Formulare ────────────────────────────────────────────── */
label { display: block; margin-bottom: 10px; color: var(--dim); }
input, select, textarea {
  width: 100%; padding: 8px 10px; margin-top: 4px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
}
input[type="number"] { width: 110px; }
button, .btn {
  display: inline-block; padding: 8px 16px;
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, rgba(95, 199, 255, .25), rgba(95, 199, 255, .08));
  color: #dff2ff; border-radius: 4px;
  cursor: pointer; font-weight: 600; letter-spacing: .04em;
  text-shadow: 0 0 6px rgba(95, 199, 255, .4);
}
button:hover, .btn:hover {
  background: linear-gradient(180deg, rgba(95, 199, 255, .4), rgba(95, 199, 255, .15));
  text-decoration: none;
}
button:disabled { opacity: .3; cursor: not-allowed; }
button.danger { border-color: var(--err); color: #ffd6d6; background: rgba(255, 97, 97, .12); text-shadow: none; }
form.inline { display: inline; }
form.inline input[type="number"] { width: 90px; margin: 0; }

/* ── Meldungen ────────────────────────────────────────────── */
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; border: 1px solid; background: var(--panel); }
.flash.ok { border-color: var(--ok); color: var(--ok); }
.flash.err { border-color: var(--err); color: var(--err); }

/* ── Übersicht: Planeten-Hero ─────────────────────────────── */
.planet-hero { display: flex; gap: 16px; align-items: center; }
.planet-hero img {
  width: 170px; height: 170px; object-fit: cover; border-radius: 50%;
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 30px rgba(95, 199, 255, .25), 0 0 60px rgba(0, 0, 0, .6);
  flex-shrink: 0;
}
.planet-hero .pdata { flex: 1; min-width: 0; }

/* ── Login/Registrierung ──────────────────────────────────── */
.authbox {
  width: 360px; max-width: 92vw; background: var(--panel); border: 1px solid var(--border-glow);
  border-radius: 8px; padding: 28px; text-align: center;
  box-shadow: 0 0 40px rgba(95, 199, 255, .12), 0 10px 40px rgba(0, 0, 0, .7);
}
.authbox h1 { letter-spacing: .3em; color: var(--accent); text-shadow: 0 0 14px rgba(95, 199, 255, .6); }
.authbox .tagline { color: var(--dim); margin-bottom: 18px; }
.authbox form { text-align: left; margin-bottom: 12px; }
.authbox button { width: 100%; margin-top: 6px; }

.ship-thumb {
  width: 48px; height: 36px; object-fit: cover; vertical-align: middle;
  margin-right: 8px; border: 1px solid var(--border); border-radius: 3px;
}

/* ── Detailkram ───────────────────────────────────────────── */
.muted { color: var(--dim); }
.ok { color: var(--ok); } .err { color: var(--err); } .warn { color: var(--warn); }
.item-name { font-weight: 600; }
.countdown { font-variant-numeric: tabular-nums; font-family: var(--mono); color: var(--warn); }
.galaxy-nav { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.galaxy-nav input { width: 70px; }
.msg-body { white-space: pre-wrap; }
.report table { margin: 8px 0; }

@media (max-width: 860px) {
  .bcard { flex-wrap: wrap; }
  .bimg, .bimg img { width: 100%; height: 140px; }
  .bact { width: 100%; flex-direction: row; }
}
@media (max-width: 760px) {
  .wrap { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .navhead { display: none; }
  .sidebar a.logout { margin-top: 0; }
  .content { padding: 12px; }
  .planet-hero { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
