/* Voidfront - command-deck theme.
   Blue-slate surfaces, brass for actions and resources, coral reserved for hostile things.
   Fonts are self-hosted (Chakra Petch for headings, Inter for text); see /fonts for licences. */

@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/chakra-petch-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/chakra-petch-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/chakra-petch-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/chakra-petch-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/chakra-petch-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/chakra-petch-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }


:root {
  --ink: #0f1a24;
  --deep: #132330;
  --panel: #1a2d3c;
  --raise: #213a4c;
  --line: #2c4457;
  --text: #dde7ee;
  --muted: #8ea5b4;
  --brass: #dca845;
  --brass-ink: #1d1604;
  --teal: #52b8a8;
  --coral: #ec6a55;
  --ore: #cf9163;
  --crystal: #7fb7e6;
  --fuel: #7bd3a0;
  --energy: #e6d36a;
  --serif: "Chakra Petch", "Bahnschrift", "Segoe UI Semibold", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 2px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font: 16px/1.5 var(--sans); min-height: 100vh; }
a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5rem; letter-spacing: .02em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; max-width: 62ch; }
ul { padding: 0; margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--brass); color: var(--brass-ink); padding: .5rem .75rem; z-index: 50; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--deep); border-right: 1px solid var(--line); padding: 1.25rem 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--text); padding: 0 1.25rem 1.25rem; letter-spacing: .01em; }
.brand:hover { text-decoration: none; color: var(--brass); }
.rail ul { list-style: none; }
.rail li a { display: flex; justify-content: space-between; align-items: center; padding: .55rem 1.25rem; color: var(--muted); border-left: 3px solid transparent; }
.rail li a:hover { color: var(--text); background: rgba(255, 255, 255, .03); text-decoration: none; }
.rail li a[aria-current="page"] { color: var(--text); border-left-color: var(--brass); background: rgba(220, 168, 69, .08); }
.badge { background: var(--coral); color: #260b06; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 0 .45rem; min-width: 1.35rem; text-align: center; }
.rail-foot { margin-top: auto; padding: 1rem 1.25rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.rail-foot form { margin-top: .5rem; }
.wallet { display: block; color: var(--text); margin-bottom: .25rem; }
.wallet b { color: var(--brass); }

.main-col { min-width: 0; }
.resbar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; padding: .7rem clamp(1rem, 3vw, 2.5rem); background: rgba(19, 35, 48, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.gauge { min-width: 0; display: grid; grid-template-columns: 1fr auto; column-gap: .5rem; align-items: baseline; }
.gauge-name { color: var(--muted); font-size: .85rem; }
.gauge-val { font-weight: 650; font-size: 1.05rem; text-align: right; }
.gauge-rate { grid-column: 1 / -1; font-size: .75rem; color: var(--muted); }
.gauge-bar { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin: .2rem 0; }
.gauge-bar i { display: block; height: 100%; background: var(--g, var(--brass)); border-radius: 2px; }
.gauge.is-full .gauge-val { color: var(--coral); }
.g-ore { --g: var(--ore); } .g-crystal { --g: var(--crystal); } .g-fuel { --g: var(--fuel); } .g-energy { --g: var(--energy); }
.g-energy.is-short .gauge-val { color: var(--coral); }

main { padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 70rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head p { color: var(--muted); margin: 0; }

/* ---------- notices ---------- */

.flash, .alert { margin: 0; padding: .7rem clamp(1rem, 3vw, 2.5rem); border-left: 4px solid var(--teal); background: rgba(82, 184, 168, .12); }
.flash-error { border-color: var(--coral); background: rgba(236, 106, 85, .13); }
.flash-info { border-color: var(--crystal); background: rgba(127, 183, 230, .12); }
.alert-hostile { border-color: var(--coral); background: rgba(236, 106, 85, .18); font-weight: 600; }
.notice { border-left: 3px solid var(--brass); padding: .6rem .9rem; background: rgba(220, 168, 69, .09); margin: 0 0 1.5rem; max-width: 62ch; }
.notice p:last-child { margin: 0; }

/* ---------- controls ---------- */

.btn { display: inline-block; font: inherit; font-weight: 650; padding: .5rem 1rem; border-radius: var(--radius); border: 1px solid var(--brass); background: var(--brass); color: var(--brass-ink); cursor: pointer; text-align: center; }
.btn:hover { background: #e7b856; text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--line); }
.btn-quiet:hover { background: var(--raise); }
.btn-danger { background: transparent; color: var(--coral); border-color: var(--coral); }
.btn-danger:hover { background: rgba(236, 106, 85, .15); }
.btn-sm { padding: .3rem .65rem; font-size: .875rem; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
.linkbtn:hover { color: var(--text); }

label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  font: inherit; color: var(--text); background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .65rem; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brass); outline-offset: 0; border-color: var(--brass); }
input[type="number"] { font-variant-numeric: tabular-nums; }
.field { margin-bottom: 1rem; max-width: 24rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; color: var(--text); font-size: .9rem; max-width: 40rem; }
.check input { margin-top: .25rem; flex: none; }
.form-error { color: var(--coral); margin: 0 0 1rem; font-weight: 600; }
.inline { display: inline; }
.row-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row-form input[type="number"], .row-form input[type="text"] { width: 7rem; }

/* ---------- ledgers: ruled lists instead of cards ---------- */

.section { margin: 0 0 2.25rem; }
.section > h2 { padding-bottom: .4rem; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.ledger { list-style: none; }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1.5rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.entry-main h3 { margin: 0 0 .15rem; }
.entry-main p { margin: 0; color: var(--muted); font-size: .9rem; max-width: 60ch; }
.entry-meta { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.entry-act { text-align: right; min-width: 9.5rem; }
.entry-act .btn { min-width: 9.5rem; }
.entry.is-locked { opacity: .55; }
.lvl { color: var(--brass); font-weight: 600; }
.cost { display: inline-flex; gap: .85rem; flex-wrap: wrap; }
.cost span::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); margin-right: .3rem; }
.cost .c-ore { --c: var(--ore); } .cost .c-crystal { --c: var(--crystal); } .cost .c-fuel { --c: var(--fuel); }
.cost .short { color: var(--coral); }
.tag { display: inline-block; font-size: .78rem; padding: .05rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: .35rem; }
.tag-hostile { color: var(--coral); border-color: var(--coral); }
.tag-ok { color: var(--teal); border-color: var(--teal); }
.tag-brass { color: var(--brass); border-color: var(--brass); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .85rem; padding: .4rem .6rem .4rem 0; border-bottom: 1px solid var(--line); }
td { padding: .55rem .6rem .55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; }
.scroll-x { overflow-x: auto; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, max-content)); gap: .25rem 2rem; margin: .5rem 0 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 0; font-weight: 600; }

/* ---------- planets ---------- */

.orb {
  --size: 44px; --o-hi: #8fd1c2; --o-mid: #3f8f86; --o-lo: #173c47; --o-glow: rgba(82, 184, 168, .25);
  width: var(--size); height: var(--size); border-radius: 50%; flex: none; position: relative; overflow: hidden;
  background: radial-gradient(circle at 32% 28%, var(--o-hi), var(--o-mid) 48%, var(--o-lo) 100%);
  box-shadow: inset calc(var(--size) * -.12) calc(var(--size) * -.14) calc(var(--size) * .3) rgba(0, 0, 0, .6), 0 0 calc(var(--size) * .45) var(--o-glow);
}
.orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; mix-blend-mode: soft-light;
  background: repeating-linear-gradient(172deg, transparent 0 9%, rgba(255, 255, 255, .18) 9% 13%, transparent 13% 24%); background-size: 100% 200%; animation: drift 90s linear infinite; }
@keyframes drift { to { background-position: 0 -200%; } }
.orb-xl { --size: 150px; } .orb-sm { --size: 30px; } .orb-xs { --size: 18px; }
.orb.hot { --o-hi: #f0a574; --o-mid: #b4512f; --o-lo: #3d1a14; --o-glow: rgba(236, 106, 85, .28); }
.orb.cold { --o-hi: #e4f2f8; --o-mid: #86aec8; --o-lo: #27435a; --o-glow: rgba(160, 205, 235, .24); }
.orb.skin-nebula { --o-hi: #dcb0ff; --o-mid: #7a42c4; --o-lo: #22123f; --o-glow: rgba(170, 110, 255, .4); }
.orb.skin-ember { --o-hi: #ffd08a; --o-mid: #d6481f; --o-lo: #2b0c08; --o-glow: rgba(255, 120, 60, .4); }
.orb.skin-frost { --o-hi: #f4fbff; --o-mid: #62a8d6; --o-lo: #14304a; --o-glow: rgba(120, 200, 255, .4); }

.planet-head { display: flex; gap: 1.75rem; align-items: center; margin-bottom: 1.75rem; flex-wrap: wrap; }

/* ---------- galaxy: twelve orbits along one line ---------- */

.orbit { list-style: none; position: relative; margin: 1rem 0; }
.orbit::before { content: ""; position: absolute; left: 3.2rem; top: 1rem; bottom: 1rem; width: 1px; background: var(--line); }
.orbit li { position: relative; display: grid; grid-template-columns: 2rem 2.5rem minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .55rem 0; }
.orbit .slot { color: var(--muted); font-size: .85rem; text-align: right; }
.orbit .dot { display: grid; place-items: center; }
.orbit .empty-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px dashed var(--muted); background: var(--ink); }
.orbit .who { color: var(--muted); font-size: .9rem; }
.orbit li.is-own .name { color: var(--brass); }
.orbit li.is-empty .name { color: var(--muted); }
.orbit .acts { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.pager { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.pager .field { margin: 0; max-width: 6rem; }

/* ---------- misc ---------- */

.queue { list-style: none; }
.queue li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2rem; }
.ship-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem 1.5rem; }
.ship-pick { display: grid; grid-template-columns: 1fr 6rem; gap: .5rem; align-items: center; }
.ship-pick label { margin: 0; color: var(--text); }
.ship-pick small { display: block; color: var(--muted); }
.mission-pick { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mission-pick label { display: flex; gap: .4rem; align-items: center; color: var(--text); }
.coords { display: flex; gap: .5rem; max-width: 18rem; }
.coords input { width: 100%; text-align: center; }
.report { max-width: 46rem; }
.win { color: var(--teal); } .loss { color: var(--coral); }
details { margin: .75rem 0; } summary { cursor: pointer; color: var(--muted); }
.pack { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.price { font-weight: 650; }
.gold { color: #f2c14e; }
.is-me td { color: var(--brass); font-weight: 600; }

/* ---------- public pages ---------- */

body.public { background: radial-gradient(1100px 600px at 78% -5%, #1c3a4d 0%, transparent 60%), var(--ink); }
.pubbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem clamp(1rem, 4vw, 3rem); }
.pubbar nav { display: flex; gap: 1.25rem; align-items: center; }
.pub { padding: 2rem clamp(1rem, 4vw, 3rem) 3rem; max-width: 64rem; margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3rem; align-items: center; padding: 2rem 0 3rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.08; }
.hero p { font-size: 1.1rem; color: #b9cad5; }
.hero-art { display: grid; place-items: center; position: relative; min-height: 22rem; }
.hero-art .ring { position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.hero-art .ring:nth-child(1) { width: 15rem; height: 15rem; }
.hero-art .ring:nth-child(2) { width: 21rem; height: 21rem; border-style: dashed; }
.hero-art .moon { position: absolute; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.points h3 { color: var(--brass); }
.points p { color: var(--muted); }
.auth { max-width: 26rem; margin: 2rem auto; }
.pubfoot { padding: 2rem clamp(1rem, 4vw, 3rem); color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); display: flex; gap: 1.5rem; flex-wrap: wrap; }
.legal { max-width: 46rem; }
.legal h2 { margin-top: 1.5rem; }
.todo { background: rgba(220, 168, 69, .15); padding: 0 .25rem; border-radius: 3px; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  body.game { padding-bottom: calc(4.1rem + env(safe-area-inset-bottom)); }
  .shell { grid-template-columns: 1fr; }
  .main-col { padding: 0; }
  main { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  /* the menu becomes a bottom tab bar: five main places and a More sheet */
  .rail { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; z-index: 30; padding: 0 0 env(safe-area-inset-bottom); flex-direction: row; border-right: 0; border-top: 1px solid var(--line); background: rgba(15, 26, 36, .97); backdrop-filter: blur(8px); }
  .brand, .rail-foot, .rail li.sec { display: none; }
  .rail ul.nav-main { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; margin: 0; }
  .rail ul.nav-main > li { min-width: 0; }
  .rail ul.nav-main > li > a { min-height: 3.6rem; padding: .35rem .1rem; border-left: 0; border-top: 3px solid transparent; justify-content: center; align-items: center; text-align: center; font-size: .7rem; letter-spacing: 0; gap: .25rem; flex-direction: column; overflow: hidden; }
  .rail ul.nav-main > li > a[aria-current="page"] { border-left-color: transparent; border-top-color: var(--brass); }
  .rail ul.nav-main > li > a .badge { position: absolute; top: .3rem; right: max(.25rem, 12%); }
  .rail li { position: relative; }
  .more-li { display: block; }
  .more summary { list-style: none; cursor: pointer; min-height: 3.6rem; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .7rem; letter-spacing: 0; position: relative; }
  .more summary .badge { position: absolute; top: .3rem; right: max(.25rem, 12%); }
  .more summary::-webkit-details-marker { display: none; }
  .more[open] summary { color: var(--text); }
  .more-panel { position: fixed; left: 0; right: 0; bottom: calc(3.6rem + env(safe-area-inset-bottom)); background: var(--deep); border-top: 1px solid var(--line); padding: .5rem 1rem 1rem; max-height: 65vh; overflow-y: auto; box-shadow: 0 -12px 30px rgba(0, 0, 0, .4); }
  .more-panel ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .75rem; list-style: none; padding: 0; }
  .more-panel li a { display: flex; flex-direction: row; justify-content: space-between; min-height: 2.9rem; align-items: center; padding: .5rem .25rem; font-size: 1rem; border-top: 0; border-bottom: 1px solid var(--line); color: var(--text); }
  .more-foot { margin: .75rem 0 .5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; letter-spacing: 0; }
  .more-foot a { display: inline; }
  /* resource bar: one slim row, details live on the pages */
  .resbar { position: sticky; top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem .75rem; padding: .45rem max(.75rem, env(safe-area-inset-left)); }
  .resbar .gauge { grid-template-columns: 1fr; text-align: left; }
  .resbar .gauge-name { font-size: .7rem; }
  .resbar .gauge-val { text-align: left; font-size: .95rem; }
  .resbar .gauge-rate, .resbar .g-energy:not(.is-short) { display: none; }
  .resbar .g-energy.is-short { grid-column: 1 / -1; }
  .resbar .g-energy.is-short .gauge-rate { display: block; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 16rem; order: -1; }
  .entry { grid-template-columns: 1fr; }
  .entry-act { text-align: left; min-width: 0; }
  .orbit::before { left: 2.9rem; }
  .orbit li { grid-template-columns: 1.5rem 2.2rem minmax(0, 1fr); }
  .orbit .acts { grid-column: 3; justify-content: flex-start; }
  /* comfortable thumbs, and 16px fields so iOS does not zoom on focus */
  .btn, .btn-sm { min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; }
  .linkbtn { padding: .5rem .25rem; }
  input, select, textarea { font-size: 16px; min-height: 2.75rem; }
  input[type="checkbox"], input[type="radio"] { min-height: 0; width: 1.25rem; height: 1.25rem; }
  .row-form { gap: .6rem; }
  .row-form .field, .field { max-width: none; }
  .coords { max-width: none; }
  .page-head h1 { font-size: 1.6rem; }
  table { font-size: .9rem; }
  .cols { grid-template-columns: 1fr; }
}
@media (min-width: 861px) { .more-li { display: none; } }

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

/* ---------- command-deck finish ---------- */

body { font-feature-settings: "tnum" 1, "cv11" 1; letter-spacing: .005em; }
.rail li a { font-family: var(--serif); font-weight: 500; letter-spacing: .04em; font-size: .98rem; }
.brand { letter-spacing: .12em; font-size: 1.35rem; }
.gauge-val, .wallet b, .timer, .lvl, th { font-family: var(--serif); }
.gauge-val { font-weight: 600; letter-spacing: .02em; }
.btn, .btn-sm, .linkbtn { font-family: var(--serif); font-weight: 600; letter-spacing: .04em; }
.btn { padding: .55rem 1.1rem; }
.page-head h1::after { content: ""; display: block; width: 2.75rem; height: 3px; margin-top: .6rem; background: var(--brass); box-shadow: 0 0 12px rgba(220, 168, 69, .55); }
.section > h2, main > h2 { padding-left: .7rem; border-left: 3px solid var(--brass); }
.notice, .flash, .alert { border-radius: var(--radius); }
.gauge-bar { height: 4px; }
.gauge-bar i { box-shadow: 0 0 8px var(--g, var(--brass)); }

/* ---- social pages ---- */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; background: rgba(255, 255, 255, .02); margin-bottom: 1rem; }
.card.is-current { border-color: var(--brass); }
.card h4 { margin: .9rem 0 .25rem; font-size: .9rem; color: var(--muted); }
.plain { list-style: none; margin: 0 0 .5rem; padding: 0; }
.plain li { padding: .15rem 0 .15rem 1rem; position: relative; }
.plain.good li::before { content: '+'; position: absolute; left: 0; color: var(--teal); }
.plain.bad li::before { content: '\2212'; position: absolute; left: 0; color: var(--coral); }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.tabs a { padding: .5rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--brass); }
.chatlog { list-style: none; margin: 1rem 0; padding: .5rem .75rem; min-height: 5rem; max-height: min(24rem, 42vh); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, .18); }
.chatmsg { padding: .2rem 0; overflow-wrap: anywhere; }
.chatmsg .who { font-weight: 650; }
.chatmsg.mine .who { color: var(--brass); }
.chatmsg .where { color: var(--muted); font-size: .8rem; }
textarea { font: inherit; color: inherit; background: var(--deep); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .65rem; width: 100%; }

/* ---- goals ---- */
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: .4rem 0 .2rem; max-width: 22rem; }
.meter i { display: block; height: 100%; background: var(--brass); }
.streak { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; margin: 1rem 0; padding: 0; }
.streak li { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .4rem; display: grid; gap: .15rem; text-align: center; font-size: .8rem; }
.streak .d { color: var(--muted); }
.streak .past { border-color: var(--teal); }
.streak .now { border-color: var(--brass); background: rgba(220, 168, 69, .12); }
@media (max-width: 40rem) { .streak { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.nextstep { border-left: 3px solid var(--brass); padding: .6rem .9rem; background: rgba(220, 168, 69, .09); margin: 0 0 1.5rem; max-width: 62ch; }

/* ---- game builder output ---- */
.ti { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -.3em; margin-right: .45rem; }
.rail li a .ti { width: 1.4rem; height: 1.4rem; margin-right: .6rem; flex: none; }
.rail li a { justify-content: flex-start; }
.rail li a .badge { margin-left: auto; }
body.game.has-bg .main-col > main { background: transparent; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.slot { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; display: grid; gap: .5rem; align-content: start; }
.slot-art { height: 5rem; display: grid; place-items: center; background: rgba(0, 0, 0, .25); border-radius: var(--radius); overflow: hidden; }
.slot-art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.slot-art.wide img { width: 100%; height: 100%; object-fit: cover; }
.slot-pick { cursor: pointer; justify-self: start; }
.slot-pick:focus-within { outline: 2px solid var(--brass); outline-offset: 2px; }
@media (max-width: 860px) {
  .rail ul.nav-main > li > a .ti { margin: 0 0 .1rem; width: 1.5rem; height: 1.5rem; }
  .rail ul.nav-main > li > a { justify-content: center; }
}

/* planet switcher */
.planet-switch { display: flex; gap: .5rem; align-items: center; padding: .5rem 1rem 0; }
.planet-switch select { flex: 1 1 auto; max-width: 22rem; min-width: 0; }

.away { border: 1px solid var(--accent, #4fd1c5); border-radius: 6px; padding: .9rem 1.1rem; margin: 1rem 0; background: rgba(255,255,255,.03); }
.away h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.away ul { margin: 0 0 .6rem; padding-left: 1.2rem; }

/* Side rail: scrolls on its own when the window is short (log out stays reachable) */
@media (min-width: 861px) {
  .rail { height: 100vh; height: 100dvh; max-height: 100dvh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .rail > * { flex-shrink: 0; }
  .rail-foot { padding-bottom: 1rem; }
}
