:root {
    --bg: #071113; --panel: #0d1b1e; --frame: #2f6f73; --ink: #F1F5EC; --dim: #8FA8A6;
    --gold: #C5E62E; --teal: #1f5a5e; --lime: #C5E62E; --cream: #F3E7C3; --cyan: #99F2FF; --green: #59FF73; --red: #FF5A4D; --uplift: #FFD940; --fallout: #B26BFF; --magenta: #FF40D9;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 "Trebuchet MS", "Segoe UI", system-ui, sans-serif; overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 34px; color: var(--gold); letter-spacing: 0.5px; }
h2 { font-size: 20px; }
h3, h4 { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); margin: 10px 0 6px; }
button { font: inherit; color: inherit; cursor: pointer; }
ul { margin: 0; padding-left: 18px; }
li { margin: 4px 0; }
.eyebrow { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--cyan); }
.meta { color: var(--dim); font-size: 13px; }
.panel { background: var(--panel); border: 2px solid var(--frame); border-radius: 6px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fatal { padding: 40px; }

.btn { background: #12282b; border: 2px solid var(--frame); border-radius: 5px; padding: 8px 14px; font-weight: 700; }
.btn:hover:not(:disabled) { border-color: var(--cyan); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--lime); color: #10200a; border-color: var(--lime); }
.btn.primary:hover:not(:disabled) { background: #dcf56a; border-color: #fff; }
.btn.ghost { background: transparent; color: var(--dim); }
.btn.big { font-size: 18px; padding: 12px 26px; }

/* ── title page ── */
.title { position: relative; height: 100%; overflow: hidden; cursor: pointer; background: radial-gradient(120% 90% at 50% 18%, #1c4a4e 0%, #12292d 46%, #0a1719 100%); }
/* The crew picture is 16:9 with its top third left clear for the logo. It sits on the bottom edge at the largest size that fits. */
.title-stage { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100vw, 177.78vh); aspect-ratio: 16 / 9; }
.title-art { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
/* The logo is fitted by width and by height, so a taller or wider one still clears the crew's heads. */
.title-logo { position: absolute; left: 50%; top: 3%; transform: translateX(-50%); max-width: 62%; max-height: 30%; user-select: none; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45)); }
/* A window wider than the picture shows ground and dusk to either side of it. */
.title::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: min(9vh, 5.06vw); background: linear-gradient(#3b2f33, #241c20); }
.title::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(7, 17, 19, 0.85) 0%, transparent 14%, transparent 86%, rgba(7, 17, 19, 0.85) 100%), linear-gradient(transparent 82%, rgba(7, 17, 19, 0.8) 100%); }
/* The painted scene fills the window and is cropped from the center, so the logo is placed against the window. */
.title-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; visibility: hidden; user-select: none; }
.title.painted .title-bg { visibility: visible; }
.title.painted .title-stage { inset: 0; transform: none; width: auto; aspect-ratio: auto; }
.title.painted::before { display: none; }
.title.painted::after { background: linear-gradient(transparent 76%, rgba(7, 17, 19, 0.7) 100%); }
.title-go { position: absolute; left: 50%; bottom: 3.5vh; transform: translateX(-50%); z-index: 1; min-width: 180px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5); }
.logo.type { font-weight: 800; font-style: italic; text-transform: uppercase; color: var(--cream); line-height: 0.95; letter-spacing: 1px; }
.logo.type span { display: block; font-size: 0.5em; color: var(--lime); }
.title-logo.type { text-align: center; font-size: min(11vw, 19vh); max-height: none; }
.mast-logo { display: block; height: 78px; margin: -6px 0 2px -6px; }
.mast-logo.type { height: auto; font-size: 30px; margin: 0 0 4px; }

/* ── roster, briefing, wrap-up ── */
.screen { height: 100%; overflow: auto; padding: 28px clamp(16px, 4vw, 56px); display: flex; flex-direction: column; gap: 18px; max-width: 1400px; margin: 0 auto; }
.masthead p { color: var(--dim); margin-top: 4px; }
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.slot { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.slot.on { box-shadow: 0 0 0 2px rgba(255, 217, 102, 0.15) inset; }
.slot.empty { align-items: center; justify-content: center; min-height: 300px; color: var(--dim); border-style: dashed; font-weight: 700; font-size: 17px; gap: 4px; }
.slot.empty:hover { color: var(--ink); border-color: var(--cyan); }
.slot.empty .plus { font-size: 44px; line-height: 1; color: var(--cyan); }
.slot.empty small { font-weight: 400; font-size: 13px; }
.slot-top { display: flex; gap: 12px; align-items: center; }
.portrait { width: 84px; height: 84px; object-fit: cover; object-position: 50% 0; background: linear-gradient(#1f5a5e, #0d2b2e); border: 2px solid var(--frame); border-radius: 6px; flex: none; }
.slot-id { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.field input { background: #0a0b12; border: 2px solid var(--frame); border-radius: 4px; padding: 6px 8px; font: 700 18px inherit; color: var(--ink); width: 100%; letter-spacing: 0; text-transform: none; }
.field input:focus { outline: none; border-color: var(--cyan); }
.classes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.class { display: grid; grid-template-columns: 22px 1fr; text-align: left; background: #10232a; border: 2px solid #24484c; border-radius: 4px; padding: 5px 8px; column-gap: 6px; }
.class .glyph { grid-row: span 2; color: var(--c); font-size: 18px; align-self: center; }
.class .cname { font-weight: 700; font-size: 14px; }
.class .cskills { font-size: 11px; color: var(--dim); }
.class.sel { border-color: var(--c); background: #17373b; }
.class:hover { border-color: var(--c); }
.blurb { color: var(--dim); font-size: 13px; min-height: 38px; }
.slot-actions { display: flex; gap: 8px; margin-top: auto; }
.slot-actions .btn:first-child { flex: 1; }
.dispatch { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 20px; flex-wrap: wrap; }
.dispatch h2 { color: var(--gold); font-size: 24px; }
/* The expeditions on offer, a tier at a time. One is picked; the Dispatch button below is for that one. */
.orders { display: flex; flex-direction: column; gap: 10px; }
.orders .tier { display: flex; flex-direction: column; gap: 6px; }
.order-row { display: flex; gap: 8px; flex-wrap: wrap; }
.order { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; padding: 9px 13px; flex: 1 1 220px; min-width: 0; color: var(--ink); cursor: pointer; }
.order b { font-size: 16px; }
.order .meta { font-size: 12.5px; }
.order.on { border-color: var(--gold); box-shadow: 0 0 18px -8px var(--gold); }
.order.on b { color: var(--gold); }
/* One the player has finished. */
.order.done b::before { content: '✓ '; color: var(--lime); }

.briefing { max-width: 1000px; }
.brief { display: flex; gap: 22px; padding: 22px; align-items: flex-start; }
.brief-text p { margin-top: 12px; font-size: 17px; line-height: 1.55; }
.brief-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.brief-cols .panel { padding: 8px 18px 16px; }
.holo { position: relative; width: 190px; height: 210px; flex: none; border: 2px solid var(--cyan); border-radius: 6px; overflow: hidden; background: #061820; animation: flicker 3.2s infinite; }
.holo img { position: absolute; left: 50%; top: 8px; height: 330px; transform: translateX(-50%); filter: grayscale(1) sepia(1) hue-rotate(140deg) saturate(3) brightness(1.15); opacity: 0.9; }
.holo.bust img { top: 0; left: 0; width: 100%; height: 100%; transform: none; object-fit: cover; object-position: 50% 10%; }
.holo .scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(153, 242, 255, 0.16) 0 2px, transparent 2px 5px); animation: scan 1.4s linear infinite; }
@keyframes scan { to { background-position: 0 10px; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: 1; } 50% { opacity: 0.82; } 53% { opacity: 1; } }
.objs { list-style: none; padding: 0; }
.objs .done { color: var(--green); }
.objs .missed { color: var(--dim); }
.reward { font-size: 18px; }
.reward b { font-size: 34px; color: var(--gold); margin: 0 6px 0 0; }
.reward b + b, .reward b:nth-of-type(2) { margin-left: 18px; }

/* ── Scout setup ── */
.pad { padding: 12px 18px 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; background: #0d1b1e; border: 2px solid #24484c; border-radius: 20px; padding: 5px 14px 5px 6px; color: var(--dim); font-weight: 700; }
.step span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #24484c; color: var(--ink); font-size: 13px; }
.step.on { border-color: var(--lime); color: var(--ink); }
.step.on span { background: var(--lime); color: #10200a; }
.step.done span { background: var(--teal); }
.class-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 12px; }
.class-card { display: grid; grid-template-columns: 120px 1fr; gap: 12px; text-align: left; padding: 10px 14px 10px 6px; align-items: center; }
.class-card img { width: 120px; height: 150px; object-fit: contain; }
.class-card h2 { color: var(--c); }
.class-card p { color: var(--dim); font-size: 13px; margin: 4px 0; }
.class-card.sel { border-color: var(--c); background: #12292d; box-shadow: 0 0 18px -6px var(--c); }
.class-card:hover { border-color: var(--c); }
.stat-line { font: 700 13px Consolas, monospace; color: var(--cream); }
.tree-names { display: flex; gap: 6px; flex-wrap: wrap; }
.tree-names span, .chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px; border: 1px solid #2f6f73; color: var(--cream); background: #0a171a; white-space: nowrap; margin-right: 4px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.chips .chip { margin: 0; }
.chip.feat { display: inline-block; padding: 1px 8px; border-color: var(--lime); color: var(--lime); }   /* the sheet's .feat rows are a grid; a chip is not */
.chip.feat.basic { border-color: #2f6f73; color: var(--dim); }
.chip.feat.spell { border-color: var(--cyan); color: var(--cyan); }
.chip.plus { border-style: dashed; color: var(--dim); }
.chip.plus.got { border-style: solid; border-color: var(--green); color: var(--green); }
.class-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.gets li { margin: 7px 0; }
.tree-line { margin: 8px 0; }
.levels { width: 100%; border-collapse: collapse; font-size: 14px; }
.levels th { text-align: left; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); padding: 4px 8px; border-bottom: 1px solid #24484c; }
.levels td { padding: 6px 8px; border-bottom: 1px solid #16302f; }
.levels tr.now td { color: var(--lime); font-weight: 700; }
.points { font-size: 20px; font-weight: 800; color: var(--green); }
.points.left { color: var(--lime); }
.points .meta { font-weight: 400; }
.tree { display: flex; flex-direction: column; gap: 8px; }
.tree-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tree-head h2 { color: var(--lime); }
.rank { display: flex; align-items: center; gap: 8px; flex: none; }
.rank b { font: 900 26px Consolas, monospace; min-width: 22px; text-align: center; }
.rank .btn { width: 38px; padding: 4px 0; font-size: 20px; line-height: 1.1; }
.bonus { font-size: 13px; font-weight: 700; padding: 5px 10px; border: 1px dashed #2f6f73; border-radius: 5px; color: var(--dim); }
.bonus.got { border-style: solid; border-color: var(--green); color: var(--green); }
.feat-row { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px 10px; border: 2px solid #1c3c40; border-radius: 6px; background: #0a171a; }
.feat-row .n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #1c3c40; font-weight: 800; }
.feat-row b { margin-right: 8px; font-size: 16px; }
.feat-row p { margin-top: 3px; font-size: 13px; color: var(--dim); }
.feat-row.locked { opacity: 0.55; }
.feat-row.next { border-color: #3f8085; cursor: pointer; }
.feat-row.next:hover { border-color: var(--lime); }
.feat-row.got { border-color: var(--lime); background: #12292d; }
.feat-row.got .n { background: var(--lime); color: #10200a; }
.feat-row.got p { color: var(--ink); }
.spell-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; margin-top: 10px; }
.spell { text-align: left; background: #0a171a; border: 2px solid #24484c; border-radius: 6px; padding: 10px 12px; }
.spell b { display: block; font-size: 17px; margin-bottom: 4px; }
.spell p { color: var(--dim); font-size: 13px; margin-top: 6px; }
.spell.sel { border-color: var(--cyan); background: #0f2a30; }
.spell.sel b { color: var(--cyan); }
.spell:hover { border-color: var(--cyan); }
.todo { color: var(--lime); font-weight: 700; font-size: 13px; }
.crew-line { margin: 8px 0; }
.slot-id h2 { line-height: 1.1; }
.slot-actions { flex-wrap: wrap; }

@media (max-width: 1100px) {
    .brief { flex-direction: column; }
    .brief-cols { grid-template-columns: 1fr; }
    .two { grid-template-columns: 1fr; }
}

/* Phones: no page zoom on a double tap, no pull-to-refresh, no grey flash on a tap. */
html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { touch-action: manipulation; }
@media (max-width: 600px) {
    .screen { padding: 16px 12px; gap: 14px; }
    h1 { font-size: 26px; }
    .brief { padding: 14px; }
    .holo { align-self: center; }
    .dispatch { padding: 12px 14px; }
    .btn.big { font-size: 16px; padding: 11px 18px; }
}

/* ── character sheet ── */
.sheets { display: flex; flex-direction: column; gap: 18px; }
.sheet { --c: var(--lime); background: var(--panel); border: 2px solid var(--frame); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.sheet.on { border-color: var(--c); box-shadow: 0 0 22px -10px var(--c); }
.sheet .label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--dim); margin: 0; }
.sheet-head { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.sheet-head .portrait { width: 64px; height: 64px; border-color: var(--c); }
.field-box { display: flex; flex-direction: column; justify-content: flex-end; min-width: 120px; padding: 4px 10px 3px; border-bottom: 2px solid #3f8085; }
.field-box b { font-size: 18px; line-height: 1.2; color: var(--cream); white-space: nowrap; }
.field-box .label { border-top: 1px solid #24484c; padding-top: 2px; margin-top: 3px; }
.field-box.wide { min-width: 200px; flex: 1; }
.field-box.small { min-width: 64px; text-align: center; }
.field-box.small b { font: 800 22px Consolas, monospace; color: var(--ink); }
.field-box .callsign { font-size: 26px; color: var(--c); }
.sheet-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }

.sheet-body { display: grid; grid-template-columns: minmax(250px, 0.85fr) minmax(360px, 1.45fr) minmax(280px, 1fr); gap: 12px; align-items: start; }
.sheet .box { position: relative; border: 2px solid #24484c; border-radius: 6px; padding: 16px 12px 10px; background: #0a171a; }
.sheet .box > .label { position: absolute; top: -8px; left: 10px; padding: 0 6px; background: var(--panel); color: var(--cream); }
.mid { display: flex; flex-direction: column; gap: 14px; }

.stats { display: flex; flex-direction: column; gap: 7px; }
.stat { display: grid; grid-template-columns: 58px 1fr 38px; gap: 10px; align-items: center; border: 1px solid #1c3c40; border-radius: 5px; padding: 6px 8px; background: #0d1b1e; }
.stat.own { border-color: #3f8085; }
.stat .die { display: grid; place-items: center; height: 46px; font: 900 22px Consolas, monospace; color: var(--dim); border: 2px solid #2f6f73; border-radius: 8px; background: #071113; }
.stat-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.stat-text b { font-size: 15px; text-transform: uppercase; letter-spacing: 1px; }
.stat-text .meta { font-size: 12px; }
.track { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--cream); margin-top: 2px; flex-wrap: wrap; }
.track i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid #3f8085; display: inline-block; }
.track i:first-of-type { margin-left: 4px; }
.track i.at { border-radius: 2px; }
.track i.got { background: var(--c); border-color: var(--c); }
.track em { font-style: normal; color: var(--dim); margin-left: 4px; }
.stat .mod { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--c); font: 800 15px Consolas, monospace; color: var(--ink); }
.stat .mod.zero { border-color: #24484c; color: var(--dim); }
.stats .foot { font-size: 12px; color: var(--dim); margin-top: 2px; }

.vitals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.vital { display: flex; flex-direction: column; align-items: center; text-align: center; }
.vital b { font: 900 34px/1.1 Consolas, monospace; color: var(--ink); }
.vital b small { font-size: 18px; color: var(--dim); }
.vital b.turn { font-size: 26px; line-height: 1.3; }
.vital:first-child { border-color: var(--red); }
.vital:first-child b { color: var(--red); }
.vital .meta { font-size: 11px; line-height: 1.3; }

.arms { width: 100%; border-collapse: collapse; font-size: 14px; }
.arms th { text-align: left; font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--dim); padding: 2px 8px 4px; border-bottom: 1px solid #2f6f73; }
.arms td { padding: 6px 8px; border-bottom: 1px solid #16302f; white-space: nowrap; }
.arms tr.has-note td { border-bottom: none; padding-bottom: 1px; }
.arms td.name { font-weight: 700; color: var(--cream); white-space: normal; }
.arms td.num { font: 800 15px Consolas, monospace; }
.arms tr.note td { white-space: normal; color: var(--dim); font-size: 12px; padding-top: 0; }
.arms tr.none td { color: var(--dim); font-style: italic; }
.arms .tag { font-size: 9px; letter-spacing: 1px; border: 1px solid var(--cyan); color: var(--cyan); border-radius: 8px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; }

.feats { display: flex; flex-direction: column; gap: 12px; }
.feat-tree { display: flex; flex-direction: column; gap: 4px; }
.feat-tree-head { display: flex; gap: 8px; align-items: baseline; border-bottom: 1px solid #2f6f73; padding-bottom: 3px; margin-bottom: 2px; }
.feat-tree-head b { color: var(--c); font-size: 15px; }
.feat-tree-head span { font-size: 12px; font-weight: 700; }
.feat-tree-head .meta { margin-left: auto; }
.feat { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; padding: 3px 0; }
.feat .lvl { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; border: 1px solid #2f6f73; font: 700 12px Consolas, monospace; color: var(--dim); }
.feat b { font-size: 14px; }
.feat p { font-size: 12px; color: var(--dim); margin-top: 1px; line-height: 1.35; }
.feat.got .lvl { background: var(--c); border-color: var(--c); color: #10200a; }
.feat.open b { color: #4d6b6a; font-weight: 400; }

.prose p { margin: 8px 0; }

@media (max-width: 1250px) {
    .sheet-body { grid-template-columns: minmax(250px, 0.8fr) minmax(360px, 1.4fr); }
    .sheet-body .feats { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
    .sheet-body, .sheet-body .feats { grid-template-columns: 1fr; }
    .vitals { grid-template-columns: repeat(2, 1fr); }
}

.slot.empty.enlist { min-height: 110px; flex-direction: row; gap: 12px; }
.slot.empty.enlist small { margin-left: 6px; }
.callsign-field { max-width: 420px; }
.callsign-row { display: flex; gap: 8px; }
.callsign-row .btn { flex: none; letter-spacing: 0; text-transform: none; font-size: 14px; color: var(--ink); }
.callsign-row .roll-name { display: grid; place-items: center; padding: 4px 9px; }
.callsign-row .roll-name:active svg { transform: rotate(90deg); }
.callsign-row .roll-name svg { transition: transform 0.15s; }
.sheet-intro { font-size: 14px; margin: -4px 0 0; }
/* A sheet on a phone: one column, nothing wider than the screen. */
@media (max-width: 800px) {
    .sheet-body > *, .sheet .box { min-width: 0; }
    .sheet .arms td { white-space: normal; }
}
@media (max-width: 600px) {
    .sheet { padding: 10px 8px; }
    .sheet .box { padding: 14px 8px 8px; }
    .field-box, .field-box.wide { min-width: 0; }
    .field-box.wide { flex-basis: calc(100% - 80px); }
    .stat { grid-template-columns: 46px 1fr 34px; gap: 8px; padding: 5px 6px; }
    .stat .die { height: 40px; font-size: 19px; }
    .stat .mod { width: 34px; height: 34px; }
    .sheet .arms th, .sheet .arms td { padding-left: 4px; padding-right: 4px; }
    .vitals { grid-template-columns: repeat(4, 1fr); }
    .vital b { font-size: 28px; }
}

/* ── the roster: one row a Scout ── */
.roster-list { display: flex; flex-direction: column; gap: 10px; }
.scout-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.scout-row.on { border-color: var(--c); box-shadow: 0 0 18px -8px var(--c); }
.scout-row .portrait { border-color: var(--c); }
.scout-row .who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.scout-row .who b { font-size: 20px; line-height: 1.15; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions .btn { position: relative; min-width: 72px; }
.row-actions .btn.danger { border-color: var(--red); color: var(--red); }
.row-actions .badge { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--lime); color: #10200a; font-size: 11px; line-height: 18px; }
.scout-row.enlist { justify-content: center; border-style: dashed; color: var(--dim); font-weight: 700; font-size: 16px; min-height: 64px; }
.scout-row.enlist:hover { color: var(--ink); border-color: var(--cyan); }
.scout-row.enlist .plus { font-size: 30px; line-height: 1; color: var(--cyan); }
.sheet-view { position: fixed; inset: 0; z-index: 20; background: rgba(4, 10, 12, 0.82); overflow: auto; padding: 24px clamp(8px, 3vw, 40px); }
.sheet-view .sheet { max-width: 1300px; margin: 0 auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
@media (max-width: 600px) {
    .scout-row { flex-wrap: wrap; gap: 10px; padding: 10px; }
    .row-actions { width: 100%; justify-content: stretch; }
    .row-actions .btn { flex: 1; min-width: 0; padding: 8px 6px; }
    .sheet-view { padding: 8px; }
}

/* ── the loadout: three picks and one piece of gear ── */
.loadout { max-width: 980px; margin: 0 auto; padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.loadout-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.loadout-head .portrait { width: 64px; height: 64px; border-color: var(--c); }
.loadout-head .who { display: flex; flex-direction: column; min-width: 150px; }
.loadout-head .name { font: 800 24px inherit; color: var(--c); line-height: 1.15; }
.loadout-head input.name { background: #0a0b12; border: 2px solid var(--frame); border-radius: 4px; padding: 2px 8px; width: 12ch; }
.loadout-head input.name:focus { outline: none; border-color: var(--cyan); }
.loadout-head .always { flex: 1; min-width: 220px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.loadout-head .always p { flex: 1 1 100%; margin: 0; }
.loadout h3 { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 0; }
.loadout h3 .count { color: var(--lime); letter-spacing: 0; text-transform: none; font-size: 13px; }
.loadout h3.nudge .count { animation: nudge 0.5s ease-out; }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); color: var(--red); } 75% { transform: translateX(4px); color: var(--red); } }
.pick-grid, .gear-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 8px; }
.pick { display: flex; flex-direction: column; gap: 3px; text-align: left; background: #0d1b1e; border: 2px solid #24484c; border-radius: 8px; padding: 8px 10px; min-height: 64px; }
.pick:hover { border-color: var(--cyan); }
.pick.on { border-color: var(--lime); background: #14301f; box-shadow: 0 0 14px -6px var(--lime); }
.pick.dim { opacity: 0.5; }
.pick .pk-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pick .pk-top b { font-size: 15px; }
.pick.on .pk-top b::before { content: '✓ '; color: var(--lime); }
.pick .pk-top i { font-style: normal; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.pick .pk-text { font-size: 12.5px; color: #c9d6d3; line-height: 1.3; }
.pick .pk-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.pick .pk-tags em { font-style: normal; font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--cyan); }
.pick .pk-tags em.duo { color: var(--uplift); }
/* What a pick costs is plain colored type. (An older `.bonus` box elsewhere in this file is kept off it.) */
.pick .pk-tags em.bonus { color: #6aa9ff; font-size: 10.5px; font-weight: 400; padding: 0; border: 0; }
.pick .pk-tags em.move { color: var(--lime); }
/* An ability is listed, not chosen. */
.pick.own { border-style: dashed; background: transparent; cursor: default; }
/* The levels still to come, shown on request. */
.loadout .btn.later { align-self: flex-start; letter-spacing: 0; text-transform: none; font-size: 14px; color: var(--ink); }
.loadout .later-level h3 { margin-top: 4px; }
.pick.later { opacity: 0.8; }
/* What a pet does, under its name. */
.pick .pk-trick { font-size: 12px; color: #c9d6d3; line-height: 1.3; } .pick .pk-trick b { color: var(--lime); }
/* A property of a weapon or a pick: what it has going for it against a creature's traits. */
/* The question asked at the debrief: one button for each answer. */
.answers-row { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.answers-row .btn { text-align: left; white-space: normal; }
/* The question and its answers fit one phone screen: the hologram is small and stays beside them. */
.brief.asking { flex-direction: row; align-items: flex-start; }
.brief.asking .holo { width: 132px; height: 146px; align-self: flex-start; }
.brief.asking .holo img { height: 230px; top: 6px; }
.brief.asking .brief-text { flex: 1; min-width: 0; }
.brief.asking h1 { font-size: 22px; }
/* While a mission's pictures are fetched: one bar, filling. */
.loading { position: fixed; left: 50%; top: 50%; width: min(320px, 60vw); height: 8px; transform: translate(-50%, -50%); border: 1.5px solid var(--frame); border-radius: 5px; overflow: hidden; }
.loading i { display: block; height: 100%; background: var(--lime); transition: width 0.15s ease-out; }
/* A trait of the ground wears the same tag in a cooler color. */
em.prop.ground { color: #9fdfe6; background: rgba(153, 242, 255, 0.08); border-color: rgba(153, 242, 255, 0.38); }
/* At the foot of a page or a sheet that shows tags: what each of the ones shown means. */
.glossary { margin: 0; padding-top: 10px; border-top: 1.5px solid var(--frame); display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: baseline; }
.glossary > div { display: contents; }
.glossary dd { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--dim); }
/* What a pick has going for it: a quiet outlined tag, the same wherever it is shown. */
em.prop, .pick .pk-tags em.prop { font-style: normal; font-size: 10.5px; line-height: 1.5; letter-spacing: 0.6px; text-transform: uppercase; color: #d3e98a; background: rgba(197, 230, 46, 0.08); border: 1px solid rgba(197, 230, 46, 0.38); border-radius: 3px; padding: 0 5px; white-space: nowrap; }
.chip em.prop { margin-left: 5px; }
.beast { margin: 4px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.pick.passive .pk-top b { color: var(--cyan); }
.loadout .next { margin: 0; }
.chip.feat.gear { border-color: var(--uplift); color: var(--uplift); }
.chip.feat.pet { border-color: #8f86b8; color: var(--ink); }
.crew-who { display: flex; align-items: center; gap: 10px; }
.crew-who .btn { margin-left: auto; position: relative; padding: 4px 12px; }
.crew-who .badge, .row-actions .badge { width: auto; }
.scout-row .who .chips { margin-top: 3px; }
@media (max-height: 520px) {
    .loadout { padding: 8px 12px 10px; gap: 5px; }
    .loadout-head .portrait { width: 44px; height: 44px; }
    .loadout-head .name { font-size: 19px; }
    .pick { padding: 5px 8px; min-height: 0; }
    .pick .pk-text { font-size: 12px; }
}
.pick .pk-top img.pk-ic { width: 28px; height: 28px; object-fit: contain; flex: none; align-self: center; margin-right: -2px; }
.pick .pk-top b { flex: 1; }
