@font-face {
    font-family: 'Oxanium';
    src: url('/assets/fonts/oxanium-regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Oxanium';
    src: url('/assets/fonts/oxanium-semibold.ttf') format('truetype');
    font-weight: 600;
    font-display: swap;
}

:root {
    --bg: #070b10;
    --panel: #0e151f;
    --panel-soft: #121b27;
    --line: #1b2836;
    --text: #cbd8e6;
    --muted: #6d8298;
    --accent: #38b8ff;
    --ok: #3deb9e;
    --warn: #ff9e2e;
    --bad: #ff6b6b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(1100px 520px at 50% -10%, rgba(56, 184, 255, 0.10), transparent 70%),
        radial-gradient(760px 420px at 10% 110%, rgba(219, 122, 255, 0.06), transparent 70%);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Oxanium', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.shell {
    max-width: 1140px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

a {
    color: var(--accent);
}

/* ---- login ---------------------------------------------------------- */

.gate {
    min-height: 78vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 18px;
}

.gate h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gate p {
    margin: 0;
    max-width: 460px;
    color: var(--muted);
}

.gate .hint {
    font-size: 12px;
}

.badges {
    margin-top: 12px;
}

.steam-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 13px 26px;
    border: 1px solid rgba(56, 184, 255, 0.45);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(56, 184, 255, 0.18), rgba(56, 184, 255, 0.06));
    color: #eaf6ff;
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
}

.steam-button:hover {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(56, 184, 255, 0.28), rgba(56, 184, 255, 0.10));
}

/* ---- header --------------------------------------------------------- */

.identity {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.identity img {
    width: 72px;
    height: 72px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

.identity .who {
    flex: 1;
    min-width: 0;
}

.identity h1 {
    margin: 0 0 2px;
    font-size: 24px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.identity .sub {
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.logout {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.logout:hover {
    border-color: var(--bad);
    color: var(--bad);
}

/* ---- stats ---------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.stat .value {
    font-size: 26px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.stat .value .of {
    color: var(--muted);
    font-size: 16px;
}

.stat .label {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---- sections ------------------------------------------------------- */

section {
    margin-top: 34px;
}

section > h2 {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

section > h2 .count {
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0;
}

.empty {
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

/* ---- cores ---------------------------------------------------------- */

.cores {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 12px;
}

.core {
    position: relative;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--rarity, var(--line));
    border-radius: 8px;
    background: var(--panel);
}

.core.inactive {
    opacity: 0.55;
}

/* MineralCoreRarity ordinals - the CSP forbids inline styles, so the colour
   travels as a class instead of a style attribute. */
.core.r0 { --rarity: #94adbd; }
.core.r1 { --rarity: #3deb9e; }
.core.r2 { --rarity: #38b8ff; }
.core.r3 { --rarity: #db7aff; }
.core.r4 { --rarity: #ff9e2e; }
.core.r5 { --rarity: #fff252; }

.core .kind {
    font-weight: 600;
}

.core .rarity {
    color: var(--rarity, var(--muted));
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.core dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 12px;
    margin: 12px 0 0;
    font-size: 13px;
}

.core dt {
    color: var(--muted);
}

.core dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.core .fav {
    position: absolute;
    top: 12px;
    right: 14px;
    color: var(--warn);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge.ok    { border-color: rgba(61, 235, 158, 0.4); color: var(--ok); }
.badge.busy  { border-color: rgba(56, 184, 255, 0.4); color: var(--accent); }
.badge.warn  { border-color: rgba(255, 158, 46, 0.4); color: var(--warn); }
.badge.bad   { border-color: rgba(255, 107, 107, 0.4); color: var(--bad); }
.badge.muted { color: var(--muted); }

/* ---- runs ----------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    white-space: nowrap;
}

th {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(27, 40, 54, 0.6);
}

tr:last-child td {
    border-bottom: none;
}

td.num {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ---- error ---------------------------------------------------------- */

.notice {
    max-width: 560px;
    margin: 12vh auto 0;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    text-align: center;
}

.notice h1 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
}

.notice p {
    margin: 0 0 18px;
    color: var(--muted);
}

.footer {
    margin-top: 40px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}
