/* Adalia Academy: dark sci-fi theme
   One stylesheet for the whole site. Colours are defined once below. */

/* ---------- Fonts (stored on this site; licences in assets/fonts) ---------- */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Jura"; font-weight: 300; font-display: swap; src: url("../fonts/jura-300.woff2") format("woff2"); }
@font-face { font-family: "Jura"; font-weight: 400; font-display: swap; src: url("../fonts/jura-400.woff2") format("woff2"); }
@font-face { font-family: "Jura"; font-weight: 500; font-display: swap; src: url("../fonts/jura-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); }

/* ---------- Colours and settings ---------- */

:root {
    color-scheme: dark;

    --bg: #080f1c;            /* deep space navy */
    --surface: #0e1828;       /* panels */
    --surface-2: #142236;     /* raised panels, hover */
    --border: #1f3048;
    --border-strong: #2c4566;
    --text: #e5edf6;
    --muted: #94a3b8;
    --accent: #38bdf8;        /* sky-blue: links, buttons, highlights */
    --accent-soft: rgba(56, 189, 248, 0.12);
    --accent-glow: rgba(56, 189, 248, 0.10);    /* faint glow at the top of the page */
    --on-accent: #04121c;
    /* Resource groups, as in the game client (theme.js resources) */
    --res-volatile: #5bc0f5;
    --res-organic: #68d346;
    --res-metal: #f8852c;
    --res-rare-earth: #f63637;
    --res-fissile: #8a1aff;

    /* Class colours, taken from the live Influence game client */
    --miner: #ff984f;
    --engineer: #ff564d;
    --merchant: #ffd94f;
    --scientist: #4f90ff;
    --pilot: #884fff;
    --pilot-text: #a67bff;    /* lighter Pilot purple, readable as small text */

    /* In-game crewmate card frame */
    --card-frame: #267590;
    --card-strip: #12242a;

    /* Crew action counts, as in the game's Objectives tabs */
    --action-ready: #00fff0;
    --action-ready-bg: #00403c;
    --action-progress: #57d5ff;
    --action-progress-bg: #1b5467;

    --up: #4ade80;
    --down: #ff564d;

    --font-head: "Jura", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --radius: 10px;
    --max-width: 1100px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* Anything marked hidden stays hidden, even if its style sets display: flex or grid */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    color: var(--text);
    font: 16px/1.65 var(--font-body);
    /* Faint starfield and a soft glow at the top of the page */
    background-image:
        radial-gradient(1px 1px at 12% 18%, #ffffff55 50%, transparent 51%),
        radial-gradient(1px 1px at 72% 9%, #ffffff40 50%, transparent 51%),
        radial-gradient(1px 1px at 38% 62%, #ffffff30 50%, transparent 51%),
        radial-gradient(1px 1px at 88% 44%, #ffffff45 50%, transparent 51%),
        radial-gradient(1px 1px at 22% 88%, #ffffff35 50%, transparent 51%),
        radial-gradient(1px 1px at 58% 30%, #ffffff25 50%, transparent 51%),
        radial-gradient(1px 1px at 5% 50%, #ffffff30 50%, transparent 51%),
        radial-gradient(1px 1px at 94% 80%, #ffffff35 50%, transparent 51%),
        radial-gradient(900px 500px at 80% -10%, var(--accent-glow), transparent 70%);
    background-attachment: fixed;
}

main { flex: 1; }

/* Headings use Jura, light like the original Academy site:
   the largest headings are lightest, smaller ones a touch firmer to stay readable */
h1, h2, h3 {
    font-family: var(--font-head);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0.01em;
    margin: 0 0 0.5em;
}
h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 300; }
h2 { font-size: 27px; margin-top: 1.4em; }
h3 { font-size: 21px; }

p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #7dd3fc; }

img { max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.block { padding-top: 48px; padding-bottom: 48px; }

.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.lede { color: var(--muted); font-size: 18px; max-width: 60ch; }

.label {
    display: inline-block;
    font: 500 12px/1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 20;
    background: var(--accent);
    color: var(--on-accent);
    padding: 8px 12px;
    border-radius: 6px;
}
.skip-link:focus { left: 8px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    font: 600 14px/1 var(--font-body);
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--on-accent);
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.2s, background-color 0.2s;
}
.btn:hover { color: var(--on-accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }
/* Switched-off buttons lose their filled background, so give the text a colour that shows on the page */
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; background: transparent; color: var(--muted); border-color: var(--border-strong); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(8, 15, 28, 0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    /* Matches the brand logo file: Jura 500, letter-spacing 0.16em */
    font: 500 17px/1 var(--font-head);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.logo:hover { color: var(--text); }
.logo-accent { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.site-nav a:hover, .site-nav a.is-active { color: var(--text); }
.site-nav a.is-active { box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }

/* Drop-down under a menu item (e.g. My Assets → Crews, Asteroids, Ships) */
.nav-group { position: relative; }
.nav-parent::after { content: "▾"; margin-left: 5px; font-size: 11px; color: var(--muted); }
.nav-submenu {
    display: none;
    position: absolute;
    left: -14px;
    top: 100%;
    z-index: 20;
    min-width: 170px;
    padding-top: 10px;            /* invisible bridge, so the menu stays open while the pointer moves down */
}
.nav-group:hover .nav-submenu,
.nav-group:focus-within .nav-submenu { display: block; }
.site-nav .nav-submenu a {
    display: block;
    white-space: nowrap;    /* "Crews & Crewmates" on one line */
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-top-width: 0;
    color: var(--muted);
}
.site-nav .nav-submenu a:first-child { border-top-width: 1px; border-radius: var(--radius) var(--radius) 0 0; }
.site-nav .nav-submenu a:last-child { border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.site-nav .nav-submenu a:hover { color: var(--accent); }
.site-nav .nav-submenu a.is-current { color: var(--text); }

.menu-toggle {
    display: none;
    margin-left: auto;
    font: 500 13px/1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
}

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

.wallet { position: relative; }
.wallet-button { font-family: var(--font-mono); font-weight: 500; }

.wallet-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 15;
    width: 300px;
    max-width: calc(100vw - 32px);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.wallet-menu-label { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.wallet-menu-label span { color: var(--text); }
.wallet-menu-address { font-size: 12px; word-break: break-all; color: var(--text); margin: 0 0 12px; }
.wallet-menu a,
.wallet-menu button {
    display: block;
    width: 100%;
    text-align: left;
    font: 500 14px/1 var(--font-body);
    color: var(--text);
    background: transparent;
    border: 0;
    border-top: 1px solid var(--border);
    padding: 11px 2px;
    cursor: pointer;
}
.wallet-menu a { text-decoration: none; }
.wallet-menu a:hover,
.wallet-menu button:hover { color: var(--accent); }

.wallet-dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 22px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.wallet-dialog::backdrop { background: rgba(2, 6, 14, 0.7); backdrop-filter: blur(2px); }
.wallet-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wallet-dialog h2 { font-size: 24px; margin: 0; }
.dialog-close {
    font: 400 26px/1 var(--font-body);
    color: var(--muted);
    background: transparent;
    border: 0;
    padding: 4px 8px;
    cursor: pointer;
}
.dialog-close:hover { color: var(--text); }
.wallet-intro { font-size: 14px; color: var(--muted); margin: 10px 0 18px; }

.wallet-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wallet-option-main {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    font: 500 15px/1.2 var(--font-body);
    color: var(--text);
    text-align: left;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}
button.wallet-option-main { cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
button.wallet-option-main:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wallet-option-main.is-unavailable { opacity: 0.6; }
.wallet-icon { width: 28px; height: 28px; flex: none; border-radius: 6px; }
.wallet-icon-blank {
    display: grid;
    place-items: center;
    font: 500 14px/1 var(--font-mono);
    color: var(--muted);
    border: 1px solid var(--border-strong);
}
.wallet-name { flex: 1; }
.wallet-tag {
    font: 500 11px/1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
button.wallet-option-main .wallet-tag { color: var(--up); }
.wallet-help { font-size: 13px; color: var(--muted); margin: 6px 2px 0; }
.wallet-option-note { font-size: 13px; color: var(--muted); padding: 2px; }
.wallet-status { font-size: 14px; color: var(--accent); margin: 14px 0 0; min-height: 1em; }
.wallet-status:empty { display: none; }
.wallet-error { font-size: 14px; color: #ff8a84; margin: 14px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ---------- Hero ---------- */

.hero { padding: 72px 0 32px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); max-width: 16ch; }
/* ---------- Panels with corner brackets ---------- */

.panel {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.panel::before, .panel::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 0 solid var(--accent);
    opacity: 0.8;
    pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius); }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--radius); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card-link { color: inherit; text-decoration: none; transition: border-color 0.2s, transform 0.2s; }
.card-link:hover { color: inherit; border-color: var(--border-strong); transform: translateY(-2px); }
.card-link h3 { margin-top: 2px; }
.card-link p { color: var(--muted); margin: 0; font-size: 15px; }

.section-title { margin-bottom: 20px; }
.section-title h2 { margin: 0; }

/* ---------- Professor Grey's notes ---------- */

.prof-note {
    display: flex;
    gap: 20px;
    align-items: center;
    background: linear-gradient(135deg, rgba(79, 144, 255, 0.12), rgba(56, 189, 248, 0.05));
    border: 1px solid #23406e;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 24px 0;
    font-size: 18px;
    line-height: 1.55;
}
.prof-portrait {
    flex: none;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--scientist);
}
.prof-heading { font-family: var(--font-head); font-size: 22px; font-weight: 500; color: var(--scientist); letter-spacing: 0.04em; margin: 0 0 6px; }
.prof-note p:last-child { margin-bottom: 0; }

/* ---------- Class colours ---------- */

.chip {
    display: inline-block;
    font: 500 13px/1 var(--font-mono);
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: color-mix(in srgb, currentColor 12%, transparent);
}
.chip.miner { color: var(--miner); }
.chip.engineer { color: var(--engineer); }
.chip.merchant { color: var(--merchant); }
.chip.scientist { color: var(--scientist); }
.chip.pilot { color: var(--pilot-text); border-color: var(--pilot); }

/* Crewmate cards, matching the in-game portrait style:
   the class colour fades up from near-black inside a thin teal frame */
.crew-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--card-strip); border-radius: 4px; width: max-content; max-width: 100%; }
.crewmate-card {
    --class-colour: var(--miner);
    position: relative;
    width: 78px;
    height: 98px;
    border: 1px solid var(--card-frame);
    background: linear-gradient(180deg, #020304 0%, color-mix(in srgb, var(--class-colour) 55%, #000) 100%);
    overflow: hidden;
}
.crewmate-card.miner { --class-colour: var(--miner); }
.crewmate-card.engineer { --class-colour: var(--engineer); }
.crewmate-card.merchant { --class-colour: var(--merchant); }
.crewmate-card.scientist { --class-colour: var(--scientist); }
.crewmate-card.pilot { --class-colour: var(--pilot); }

/* ---------- My Assets ---------- */

.assets { display: grid; gap: 20px; margin-top: 28px; }
/* Filter buttons, e.g. All / Light Transports / Shuttles (one chosen at a time) */
.asset-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.filter-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 500 12px/1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
}
.filter-button:hover { color: var(--text); }
.filter-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.filter-button:disabled { opacity: 0.4; cursor: default; }
.filter-count { color: var(--text); }
.asset-filters-below { margin-top: 10px; }    /* a second row of buttons, under the asteroid buttons */

.assets-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.assets-toolbar p { margin: 0; font-size: 13px; }
.assets-message h2 { margin-top: 0; }

/* View an address (read-only), my-assets.js */
.view-bar:empty { display: none; }
.view-bar { margin-top: 24px; }
.view-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-color: var(--accent); }
.view-banner p { margin: 0; }
.view-fold summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.view-fold .view-form { margin-top: 12px; }
.view-form { margin-top: 20px; max-width: 640px; }
.view-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.view-row { display: flex; gap: 8px; }
.view-row input { flex: 1; min-width: 0; padding: 8px 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.view-error { color: #f5b84a; margin: 8px 0 0; font-size: 14px; }
.view-help { margin: 8px 0 0; font-size: 14px; }

.crew-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crew-head h2 { margin: 0; font-size: 24px; }
.crew-head h2 .panel-number { margin-left: 0.35em; }    /* the "(Crew #54)" after a name, set a little apart */
.crew-head .label { margin: 0; }

/* Asteroid and ship panels: the game's card image beside a list of details */
.asset-body { display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: start; margin-top: 18px; }
/* Smaller, tighter details beside the 200px card image, so the two match in height */
.asset-body .crew-details { border-top: 0; padding-top: 0; gap: 7px; font-size: 14px; line-height: 1.35; }
.asset-body .crew-detail dt { font-size: 11px; }
/* Panels with a ninth row (e.g. Light Transports: propellant and cargo) space their rows a little closer */
.asset-body .crew-details:has(> :nth-child(9)) { gap: 3.5px; }
/* Settler asteroid cards in the Where to start guide, styled like My Assets cards (no picture) */
.settler-card { margin: 20px 0; }
.prose h2.section-gap { margin-top: 56px; }    /* extra room before a new part of a guide */
.settler-card .crew-head h3 { margin: 0; font-size: 28px; }
.settler-card p { margin: 14px 0; }
/* Details on the left, the resource ring on the right (above on phones) */
.settler-body { display: grid; grid-template-columns: 1fr 190px; gap: 24px; align-items: start; margin-top: 16px; }
.resource-ring { width: 100%; height: auto; max-width: 190px; margin-top: 8px; }
.settler-body .settler-more, .settler-body .settler-recruit { grid-column: 1 / -1; }    /* full width below the ring */
.settler-body .settler-more { margin-top: -10px; }
.resource-ring circle { fill: none; stroke-width: 7; }
.resource-ring .ring-volatile { stroke: var(--res-volatile); }
.resource-ring .ring-organic { stroke: var(--res-organic); }
.resource-ring .ring-metal { stroke: var(--res-metal); }
.resource-ring .ring-rare-earth { stroke: var(--res-rare-earth); }
.resource-ring .ring-fissile { stroke: var(--res-fissile); }
.resource-ring text { text-anchor: middle; font-family: var(--font-head); }
.resource-ring .ring-top { font-size: 9.5px; fill: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.resource-ring .ring-bottom { font-size: 11px; fill: var(--text); text-transform: uppercase; letter-spacing: 0.08em; }
@media (max-width: 800px) {
    .settler-body { grid-template-columns: minmax(0, 1fr); }
    /* On phones each label sits above its value, and lists shrink to fit */
    .settler-card .crew-details .crew-detail { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .settler-card .crew-detail dd, .settler-body > * { min-width: 0; }
    .settler-card .crew-head { justify-content: center; text-align: center; }    /* asteroid name centred */
    .settler-card dd .resource-groups { grid-template-columns: 8.5em minmax(0, 1fr); gap: 6px; }    /* same gap beside the boxes as between them */
    .building-states { grid-template-columns: 8.5em minmax(0, 1fr); gap: 2px 6px; }
    /* The group's bonus goes under its name, leaving more room for the list */
    .resource-groups .resource-group { display: grid; grid-template-columns: max-content 1fr; align-content: center; column-gap: 6px; row-gap: 0; }
    .resource-groups .resource-share { grid-column: 1 / -1; margin-left: 0; padding-left: 0; text-align: center; }
    /* Resources in a column, no commas (CO2 and CO for the long names: tried and
       switched off by Ross, 31 Oct 2026; to bring them back, show .name-short
       and hide .name-full here) */
    .resource-groups .resource-item { display: block; }
    .resource-groups .resource-sep, .resource-groups .resource-break { display: none; }
    .resource-ring { order: -1; max-width: 160px; margin: 4px auto 0; }
}
.settler-card .crew-details { border-top: 0; padding-top: 0; gap: 8px; }
.settler-card .crew-detail { grid-template-columns: 105px 1fr; align-items: center; }    /* labels centred against their details */
.settler-card .settler-recruit { margin: 14px 0 0; }
/* Resources grouped as in the game (resource_groups() in site.php): the group
   name in its game colour with its icon, then its resources; a long list
   wraps under its first resource, not under the group name */
.resource-groups { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; }
/* On asteroid cards the box column has a fixed width, so the boxes line up
   from card to card */
.settler-card .resource-groups { grid-template-columns: 12.5em minmax(0, 1fr); }    /* room for "Rare earths +30%" */
/* Buildings rows ("Habitat | Closed"): the same two columns as the resources,
   so Open, Closed and Planned line up with the resource lists */
.building-states { display: grid; grid-template-columns: 12.5em minmax(0, 1fr); gap: 2px 22px; }
/* Each group name in a box tinted with its colour, its share on the right;
   the box grows to the height of its list, with the name centred in it */
.resource-group { display: flex; align-items: center; align-self: stretch; gap: 6px; font-weight: 600; white-space: nowrap;
    padding: 1px 8px; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 4px;
    background: color-mix(in srgb, currentColor 10%, transparent); }
.resource-group svg { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }
.resource-group.volatile { color: var(--res-volatile); }
.resource-group.organic { color: var(--res-organic); }
.resource-group.metal { color: var(--res-metal); }
.resource-group.rare-earth { color: var(--res-rare-earth); }
.resource-group.fissile { color: var(--res-fissile); }
.resource-share { margin-left: auto; padding-left: 14px; font-weight: 400; opacity: 0.9; }
.resource-item { white-space: nowrap; }    /* "Rhabdite 2%" never splits */
.resource-item .name-short { display: none; }    /* short names (CO2, CO): only when the full ones don't fit */
/* Each resource list measures its own width: when it is too narrow for
   "Carbon Monoxide 10%", the two long names shorten to CO2 and CO */
.resource-groups > span:not(.resource-group) { container-type: inline-size; }
@container (max-width: 11em) {    /* about the width of "Carbon Monoxide 10%" */
    .resource-item .name-full { display: none; }
    .resource-item .name-short { display: inline; }
}
.resource-none { color: var(--muted); }
.asset-image { width: 150px; height: 200px; border-radius: 6px; background: var(--surface-2); }
.asset-bonuses { display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (max-width: 640px) {
    .asset-body { grid-template-columns: 1fr; }
}

.crew-body { display: grid; grid-template-columns: auto minmax(220px, 1fr); gap: 28px; align-items: start; margin: 18px 0; }
/* Always as wide as a full crew of five, so the "Good at" column lines up across crews */
.crew-row { display: grid; grid-template-columns: repeat(5, 104px); gap: 12px; }

.crew-strengths-title {
    font: 500 12px/1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 4px 0 10px;
}
.crew-strengths ul { list-style: none; margin: 0; padding: 0; }
.crew-strengths li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    cursor: help;
}
.crew-strengths li:last-child { border-bottom: 0; }
.strength-bonus { font-family: var(--font-mono); color: var(--up); white-space: nowrap; }

@media (max-width: 900px) {
    .crew-body { grid-template-columns: 1fr; }
}
/* Phones: fit as many cards per row as the screen allows */
@media (max-width: 640px) {
    .crew-row { grid-template-columns: repeat(auto-fill, 104px); }
}
.crewmate { margin: 0; width: 104px; }
.crewmate .crewmate-card { width: 104px; height: 130px; display: grid; place-items: end center; }
.crewmate .crewmate-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.crewmate-initial { font: 300 40px/1 var(--font-head); color: var(--text); align-self: center; }
.crewmate figcaption { display: grid; margin-top: 8px; justify-items: start; }
/* One line each for first name and surname, so every class badge lines up */
.crewmate-name {
    display: block;
    width: 100%;
    min-height: 1.3em;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.crewmate-first { font-size: 16px; }
.crewmate-collection {
    display: block;
    width: 100%;
    min-height: 1.5em;
    margin-top: 4px;
    font: 500 12px/1.5 var(--font-body);   /* narrower than the mono font, so "Arvad Specialist" fits the card */
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Class badge: full card width, square corners, centred text */
.crewmate .chip { justify-self: stretch; text-align: center; border-radius: 0; font-size: 11px; padding: 5px 8px; margin-top: 6px; }

.crew-details { display: grid; gap: 10px; margin: 0; border-top: 1px solid var(--border); padding-top: 14px; }
.crew-detail { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; }
.crew-detail dt { font: 500 12px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.crew-detail dd { margin: 0; }

.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.status.is-ready::before { background: var(--up); box-shadow: 0 0 8px var(--up); }
.status.is-busy::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.action-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.action-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font: 500 12px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.action-count { color: var(--text); }
.action-pill.is-ready { background: var(--action-ready-bg); color: var(--action-ready); }
.action-pill.is-progress { background: var(--action-progress-bg); color: var(--action-progress); }
.action-pill.is-none { background: var(--surface-2); color: var(--muted); }
.action-pill.is-none .action-count { color: var(--muted); }

.food { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.food-bar { width: 160px; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.food-bar span { display: block; height: 100%; border-radius: inherit; }
.food-bar.is-fed span { background: var(--up); }
.food-bar.is-rationing span { background: #f5b84a; }
.food-bar.is-starving span { background: var(--down); }
.food-bar.is-hold span { background: var(--accent); }    /* ship cargo and propellant */
.food-text { font-size: 14px; }
.food-text.is-rationing { color: #f5b84a; }
.food-text.is-starving { color: #ff8a84; }

/* ---------- Tutor crews (Training Ground page) ---------- */

.tutorial-crews-box { margin-top: 40px; }
.tutorial-crews-box h2,
.prose .tutorial-crews-box h2 { margin: 4px 0 6px; }    /* also inside a lesson */
.tutorial-crews { display: grid; gap: 28px; margin-top: 18px; }    /* "Available now" above "Currently hired" */
.tutor-group .label { display: block; margin: 0 0 10px; }
.tutor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tutorial-crew { display: grid; gap: 12px; align-content: start; }
.tutorial-crew h3 { margin: 0; font-size: 20px; }
/* A line under the crewmates and under the bonuses, none between bonus rows (Ross) */
.tutorial-crew .crew-strengths { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.tutorial-crew .crew-strengths li, .prose .tutorial-crew .crew-strengths li { border-bottom: 0; padding: 3px 0; }
.tutorial-crew-terms { display: grid; gap: 4px; font-size: 13px; color: var(--text); }
.tutorial-crew-terms p, .prose .tutorial-crew-terms p { margin: 0; }
/* Everything but the bonuses is centred, and the price stands out (Ross, 1 Nov 2026) */
.tutorial-crew { text-align: center; }
.tutorial-crew .crew-strengths { text-align: left; }
.tutorial-crew .btn, .tutorial-crew .hire-form .btn { justify-self: center; }
.tutorial-crew .hire-form label { justify-content: center; }
.tutorial-crew .hire-review { text-align: left; }
.tutorial-crew .hire-buttons { justify-content: center; }
.tutorial-crew-rate, .prose .tutorial-crew-rate { font-size: 18px; font-weight: 500; }
/* Flagship crews (Ross, 1 Nov 2026): a label, a glow, and the crewmates' cards */
.tutorial-crew.is-flagship { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 28px color-mix(in srgb, var(--accent) 35%, transparent); }
.prose .tutorial-crew-flag, .tutorial-crew-flag { margin: 0 0 -6px; color: var(--accent); }
/* Flagship crews sit first, centred, one card wide */
.tutor-flagships { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.tutor-flagships .tutorial-crew { width: min(100%, 380px); }
/* The crewmates' full cards from My Crews, at about half size (zoom keeps the layout right) */
.tutorial-crew-crewmates { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
/* 56px each, so five fit side by side on a card; the class name beneath in its colour */
.tutorial-crew-crewmates .crewmate { width: 56px; }
.tutorial-crew-crewmates .crewmate-card { width: 56px; height: 70px; display: grid; place-items: end center; }
.tutorial-crew-crewmates .crewmate-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tutorial-crew-crewmates .crewmate-initial { font-size: 24px; }
.tutorial-crew-crewmates .crewmate-class, .prose .tutorial-crew-crewmates .crewmate-class { display: block; margin-top: 5px; font: 600 12px/1.2 var(--font-body); text-align: center; white-space: nowrap; }
.crewmate-class.miner { color: var(--miner); }
.crewmate-class.engineer { color: var(--engineer); }
.crewmate-class.scientist { color: var(--scientist); }
.crewmate-class.merchant { color: var(--merchant); }
.crewmate-class.pilot { color: var(--pilot-text); }
.tutorial-crew .status { margin: 0; font-size: 14px; }
.tutorial-crew .btn { justify-self: center; }
/* The "Good at" list on a hire desk card (inside a lesson's prose, so undo its bullets) */
.tutorial-crew .crew-strengths-title { margin: 0 0 6px; }
.prose .tutorial-crew .crew-strengths ul { margin: 0; }
.prose .tutorial-crew .crew-strengths li { margin: 0; padding: 5px 0; font-size: 13px; }
.prose .tutorial-crew .crew-strengths li::before { content: none; }
.prose .tutorial-crew .crew-strengths p.muted { margin: 0; font-size: 13px; }

/* ---------- Guide and section pages ---------- */

.with-sidebar {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 48px;
    align-items: start;
}
.sidebar { position: sticky; top: 88px; font-size: 14px; }
.sidebar-heading {
    font: 600 12px/1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}
.sidebar a {
    display: block;
    color: var(--muted);
    text-decoration: none;
    padding: 6px 10px;
    border-left: 2px solid var(--border);
}
.sidebar a:hover { color: var(--text); }
.sidebar a.is-active { color: var(--text); border-left-color: var(--accent); background: var(--accent-soft); }
.sidebar .mono { font-size: 12px; opacity: 0.7; line-height: inherit; }
/* Number in its own column, so a title that wraps lines up under its first word, not under the number */
.sidebar a, .sidebar-planned { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; }

.content { max-width: 72ch; }
.assets[data-assets="asteroids"] { max-width: 72ch; }    /* My Asteroids cards as wide as the guide's asteroid cards */

/* Guide pages */
.sidebar-planned { display: block; padding: 6px 10px; color: var(--muted); opacity: 0.55; border-left: 2px solid var(--border); }
.guide-checked { font-size: 12px; color: var(--muted); margin: -6px 0 28px; letter-spacing: 0.06em; }
.prose h2 { font-size: 24px; margin: 1.8em 0 0.5em; }
.prose .prof-note { margin: 28px 0; }
.guide-sources { margin-top: 48px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.guide-sources .label { margin-bottom: 8px; }
.guide-sources ul { margin: 0 0 10px; }
.guide-sources p.muted { margin: 0; font-size: 14px; }
.guide-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }
.guide-nav-link { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); max-width: 48%; }
.guide-nav-link:hover { border-color: var(--accent); color: var(--text); }
.guide-nav-link .label { margin: 0; }
.guide-nav-link.is-next { text-align: right; margin-left: auto; }

.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }

.guide-list { list-style: none; counter-reset: guide; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--border); }
.guide-list li {
    counter-increment: guide;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
ol.guide-list li::before {
    content: counter(guide, decimal-leading-zero);
    font: 500 12px/1 var(--font-mono);
    color: var(--muted);
    width: 24px;
}
/* A section's introduction isn't counted as a lesson */
ol.guide-list li.is-intro { counter-increment: none; }
ol.guide-list li.is-intro::before { content: 'Intro'; font-size: 10px; }
.guide-list li > span:first-of-type { color: var(--muted); }
.guide-list.compact { border-top: 0; margin-top: 8px; }
.guide-list.compact li { padding: 6px 0; font-size: 15px; border-bottom: 0; gap: 10px; }
/* The site's bullets: small sky-blue squares. "prose" marks the main text of a
   guide or article; its ordinary bulleted lists get them automatically. */
.prose ul { list-style: none; padding-left: 0; }
.prose ul li { position: relative; padding-left: 18px; margin: 6px 0; }
.prose ul.spaced li { margin: 14px 0; }    /* longer bullets, read as short paragraphs */
/* Short labelled facts, e.g. a settler asteroid's Status and Infrastructure */
.prose dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; }
.prose dl.facts dt { font: 600 12px/1.6 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.prose dl.facts dd { margin: 0; }
.prose ul li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.65em;
    width: 5px;
    height: 5px;
    background: var(--accent);
}

/* The same bullets on the All guides page, so the guides stand apart from the section description */
ul.guide-list.compact li::before {
    content: "";
    flex: none;
    width: 5px;
    height: 5px;
    background: var(--accent);
}

.badge {
    margin-left: auto;
    flex: none;
    font: 500 11px/1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 5px 9px;
}

.catalogue { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 32px; }
.catalogue h2 { font-size: 22px; margin: 0 0 6px; }
.catalogue h2 a { color: var(--text); text-decoration: none; }
.catalogue h2 a:hover { color: var(--accent); }
.catalogue .count { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

/* ---------- Influence Control ---------- */

/* Admin pages swap the sky-blue accent for signal green (Ross's option A),
   so they never look like guide pages. Green is not a class colour. */
body.admin {
    --accent: #34d399;
    --accent-soft: rgba(52, 211, 153, 0.12);
    --accent-glow: rgba(52, 211, 153, 0.08);
}
/* The warning strip at the top of every admin page */
.admin-strip {
    font: 500 12px/1.4 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    padding: 9px 16px;
    color: #6ee7b7;
    background: #0b2a22;
    border-bottom: 1px solid var(--accent);
}
.admin-caveats { margin-top: 28px; }
.admin-caveats .label { margin: 0; }
.admin-caveats h2 { margin: 8px 0 0; }
.admin-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 28px; }
.admin-tool h2 { margin: 8px 0; font-size: 22px; }
.admin-tool .label, .admin-tool p { margin: 0; }

/* Bulk Leases */

.lease-plan { margin-top: 24px; }
.lease-plan .label { margin: 0; }
.lease-plan p { margin: 8px 0 0; }
.lease-plan-fields { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 14px; }
/* Bulk Rename's name pattern: the + signs sit between the boxes, level with them */
.name-pattern { column-gap: 14px; }
.lease-plan-fields .name-plus { align-self: flex-end; display: flex; align-items: center; height: 36px; font: 300 22px/1 var(--font-head); color: var(--muted); }
.lease-plan-fields label { display: grid; gap: 6px; font: 500 12px/1.2 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lease-plan-fields span { display: flex; align-items: center; gap: 8px; font: 400 14px var(--font-body); text-transform: none; letter-spacing: 0; color: var(--text); }
.lease-plan-fields input, .lease-plan-fields select {
    width: 7.5em;
    font: 500 15px var(--font-mono);
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 7px 10px;
}
.lease-plan-fields input[type="text"] { width: 10em; }
/* Crew Delegation: a full 66-character Starknet address fits */
.lease-plan-fields input.delegation-address { width: min(44em, calc(100vw - 80px)); font-size: 13px; }
.lease-plan-fields select { width: auto; }
.lease-plan-fields input:focus, .lease-plan-fields select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.lease-plan-fields input:disabled { opacity: 0.6; }
.lease-plan .lease-plan-error { color: #ff8a84; }    /* same as .wallet-error */
.lease-plan .lease-plan-note { font-size: 14px; }
.lease-plan-warning { color: var(--accent); }
/* A lease with paid time left after its job: the owner may want to refund it */
.lease-table .lease-unused { display: block; margin-top: 4px; font-size: 13px; color: var(--accent); }
.lease-status-filters { margin-top: 10px; }
.lease-resource-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.lease-resource-filter label { display: inline-flex; align-items: center; gap: 8px; }
.lease-resource-filter.lease-resource-second { margin-top: 8px; }
.lease-resource-filter select, .lease-resource-filter input {
    font: 500 13px var(--font-mono);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 6px 8px;
}
.lease-resource-filter input { width: 4.5em; }
.lease-resource-filter input.lease-search { width: min(22em, 70vw); font-family: var(--font-body); }
.lease-resource-filter input.lease-min { width: 6em; }    /* Move Core Samples: the least tonnes left */
.lease-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 16px; }
.lease-selection p { margin: 0 0 0 auto; font-size: 13px; }
/* The table scrolls sideways on its own on narrow screens, never the page */
.lease-table-wrap { overflow-x: auto; margin-top: 12px; }
/* One font and size in every cell; second lines are a little smaller */
.lease-table { font: 14px/1.45 var(--font-body); margin: 0; min-width: 900px; }
/* Cells stay on one line (the table scrolls sideways if it must), except
   the longer notes under a lease */
/* Cells sit in the middle of each row (Ross, 28 Oct 2026) */
.lease-table td { vertical-align: middle; white-space: nowrap; }
.lease-table .lease-tenant, .lease-table .lease-unused { white-space: normal; min-width: 18em; }
/* Asset Transfer: the long details line wraps, so the Planned change pill stays in view */
.lease-table .asset-details { white-space: normal; min-width: 16em; }
.lease-table td:first-child, .lease-table th:first-child { width: 28px; padding-right: 0; }
.lease-table input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.lease-table .lease-permission { display: block; font-size: 13px; margin-top: 2px; }
/* Sortable column headings: click to sort, click again to reverse */
.sort-button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sort-button:hover { color: var(--text); }
.sort-button::after { content: " ↕"; opacity: 0.4; }
th[aria-sort="ascending"] .sort-button, th[aria-sort="descending"] .sort-button { color: var(--accent); }
th[aria-sort="ascending"] .sort-button::after { content: " ↑"; opacity: 1; }
th[aria-sort="descending"] .sort-button::after { content: " ↓"; opacity: 1; }
.change-pill {
    display: inline-block;
    font: 14px/1.2 var(--font-body);
    white-space: nowrap;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--muted);
}
.change-add, .change-public, .change-change, .change-private { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
/* One resource, or one part of a lease, per line */
.lease-table .lease-resources span, .lease-table .lease-term { display: block; white-space: nowrap; }
/* Resources matching the resource filter get a faint box (an inset outline,
   so lines don't move); every line has the same padding to stay aligned */
.lease-table .lease-resources span { width: fit-content; margin-left: -5px; padding: 1px 5px; border-radius: 3px; }
.lease-table .lease-resources span + span { margin-top: 4px; }
.lease-table .lease-resources .resource-match {
    background: var(--accent-glow);
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.5);
}
.lease-table .lease-tenant { display: block; margin-top: 4px; font-size: 13px; }
.change-ok { color: var(--text); }
.lease-batch-size { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.lease-batch-size select {
    font: 500 13px var(--font-mono);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 6px 8px;
}
.lease-review { margin-top: 20px; }
.lease-review .label { margin: 0; }
.lease-review h2 { margin: 8px 0 0; }
.lease-batches { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 8px; }
.lease-batch {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
}
.lease-batch-state { font-size: 12px; color: var(--muted); }
.lease-batch-signing .lease-batch-state, .lease-batch-pending .lease-batch-state { color: var(--accent); }
.lease-batch-succeeded { border-color: var(--accent); }
.lease-batch-succeeded .lease-batch-state { color: var(--accent); }
.lease-batch-failed { border-color: #ff8a84; }
.lease-batch-failed .lease-batch-state { color: #ff8a84; }    /* same as .wallet-error */
.lease-batch a { font-size: 12px; }
.lease-batch-message { flex-basis: 100%; margin: 0; font-size: 14px; }
.lease-review-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.lease-review-buttons p { margin: 0; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { font: 600 12px/1.2 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
td.num { font-family: var(--font-mono); }
.table-wrap { overflow-x: auto; }    /* lets a wide table scroll on phones */
/* Starter packs: the comparison table on wide screens, one card per pack on
   phones, where three columns don't fit (Ross, 1 Nov 2026) */
.pack-cards { display: none; }
.pack-card { margin: 12px 0; padding: 16px 18px; }
.pack-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.pack-card-head h3 { margin: 0; color: var(--accent); }
.pack-price { font-family: var(--font-mono); font-size: 18px; }
.pack-card .crew-details { border-top: 0; padding-top: 0; gap: 6px; }
.pack-card .crew-detail { grid-template-columns: 8.5em minmax(0, 1fr); align-items: baseline; }
@media (max-width: 640px) {
    .pack-table { display: none; }
    .pack-cards { display: block; }
}
/* Centre every column except the row labels on the left */
.centred-columns td, .centred-columns thead th { text-align: center; }
/* Each column drawn as its own box (the starter pack comparison), with no
   lines across the rows. The left-hand row labels stay outside the boxes. */
.boxed-columns { border-collapse: separate; border-spacing: 10px 0; table-layout: fixed; }
/* Equal boxes: a long cell wraps onto more lines instead of widening its box */
.boxed-columns thead th:first-child { width: 19%; }
.boxed-columns thead th:not(:first-child) { width: 27%; }
.boxed-columns th, .boxed-columns td { border-bottom: none; vertical-align: baseline; }    /* top-aligned, labels level with the first line */
.boxed-columns thead th:not(:first-child),
.boxed-columns td { background: var(--surface); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.boxed-columns thead th:not(:first-child) { border-top: 1px solid var(--border); border-radius: 6px 6px 0 0; color: var(--accent); padding-top: 14px; }
.boxed-columns tbody tr:last-child td { border-bottom: 1px solid var(--border); border-radius: 0 0 6px 6px; padding-bottom: 14px; }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; padding: 28px 0; margin-top: 40px; }
.site-footer strong { color: var(--text); }
.site-footer p { margin: 0 0 6px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }

/* ---------- Phones and small screens ---------- */

@media (max-width: 800px) {
    .menu-toggle { display: inline-block; }
    .topbar-inner { flex-wrap: wrap; }
    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 8px 0 18px;
    }
    .site-nav.is-open { display: flex; }
    .wallet-menu { left: 0; right: auto; }
    /* Phone menu: no hovering, so the sub-items are always listed, indented */
    .nav-parent::after { content: none; }
    .nav-submenu { display: block; position: static; min-width: 0; padding: 10px 0 0 16px; }
    .site-nav .nav-submenu a { padding: 6px 0; background: none; border: 0; box-shadow: none; white-space: normal; }

    .with-sidebar { grid-template-columns: 1fr; gap: 24px; }
    .sidebar { position: static; order: 2; }

    .hero { padding-top: 48px; }
}

/* Narrow phones: the Professor's portrait sits above his message */
@media (max-width: 520px) {
    .prof-note { flex-direction: column; align-items: flex-start; }
    .prof-portrait { width: 104px; height: 104px; }
}

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

/* ---------- SWAY icon (the game's own, added by add_sway_icons() in site.php) ---------- */
.sway { white-space: nowrap; }
.sway-icon svg {
    width: 1.05em;
    height: 1.05em;
    margin-right: 0.12em;
    vertical-align: -0.17em;
}

/* ---------- Training Ground progress (course pages) ---------- */

.training-progress { margin-top: 40px; }
.training-progress h2 { margin: 4px 0 6px; }
.training-progress-body { display: grid; gap: 18px; margin-top: 14px; }
.training-progress-body p { margin: 0; }
.progress-crews { margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.progress-heading { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.training-progress-body .progress-heading { margin-bottom: 8px; }
.progress-heading .mono { font-size: 13px; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.progress-bar.is-done span { background: var(--up); }
.training-progress-body .progress-note { margin-top: 6px; font-size: 14px; color: var(--muted); }
.training-progress-body .is-done { color: var(--up); }
.progress-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.training-progress-body .progress-targets, .crew-training .progress-targets { margin-top: 8px; }
.progress-target { font: 500 12px/1 var(--font-mono); padding: 4px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
.progress-target.is-done { color: var(--up); border-color: currentColor; }
/* The Training row on a hired tutor crew's card in My Crews */
.crew-training { display: grid; gap: 14px; }
.crew-detail:has(.crew-training) { align-items: start; }
.crew-detail:has(.crew-training) dt { padding-top: 3px; }
.crew-training .progress-heading { margin: 0 0 6px; font-size: 14px; }

/* ---------- Tutor Crew Listings (Influence Control) ---------- */

.tutor-listings { display: grid; gap: 16px; margin-top: 20px; }
.tutor-listing h2 { margin: 0; font-size: 20px; }
.tutor-listing > p { margin: 6px 0 0; }
.tutor-listing-crewmates { margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; }
.tutor-listing-status { font-size: 15px; }
.tutor-listing-warning { color: #f5b84a; }
.tutor-listing .lease-review-buttons { margin-top: 14px; }

/* Hiring on the hire desk (Hiring an Academy crew lesson) */
.hire-form { display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.hire-form label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.hire-form input { width: 5.5em; padding: 6px 8px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.hire-form .btn { justify-self: start; }
.prose .hire-total, .hire-total { margin: 0; font-size: 14px; color: var(--text); }
.hire-review { display: grid; gap: 8px; font-size: 14px; }
.hire-review ul { margin: 0; }
.hire-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.prose .hire-state, .hire-state { margin: 0; font-size: 13px; }
.prose .hire-elsewhere, .hire-elsewhere { margin: 0; font-size: 13px; }
/* List Crews for Hire: the "After the hire" check on each listed crew */
.after-hire { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; font-size: 14px; }
.after-hire summary { cursor: pointer; font-family: var(--font-mono); font-size: 13px; }
.after-hire ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* A draft course ('draft' => true in guides-list.php), shown only to people with the link */
.draft-note { display: inline-block; margin: 0 0 16px; padding: 4px 10px; border: 1px dashed #f5b84a; border-radius: 6px; color: #f5b84a; font-size: 14px; }
