/* Main background */
.outerContainer {
    position: absolute;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    margin-top: 24px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--bg-main);
    background-image:
            radial-gradient(ellipse at 20% 0%, rgba(245, 168, 0, 0.06) 0%, transparent 50%),
            radial-gradient(ellipse at 80% 100%, rgba(30, 60, 120, 0.25) 0%, transparent 55%),
            linear-gradient(160deg, #0d1520 0%, #0a1228 55%, #060d1a 100%);
}

/* ─── Story panel ─── */
.container {
    max-width: 1100px;
    margin: 36px auto 80px auto;
    padding: 36px 42px;
    background: rgba(8, 14, 26, 0.72);
    border: 1.5px solid var(--border-soft);
    border-radius: 6px;
    box-shadow:
            0 24px 80px rgba(0, 0, 0, 0.55),
            inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
}

/* ─── Header ─── */
.header {
    padding: 8px 0 24px 0;
    margin-bottom: 24px;
    border-bottom: 1.5px solid var(--border-soft);
}

h1, h2 {
    text-align: center;
    margin: 0;
    padding: 0;
}

h1 {
    font-family: var(--font-display);
    font-size: 30pt;
    font-weight: 400;
    color: var(--text-strong);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 3px 3px 0 var(--shadow-hard);
}

h2 {
    font-size: 10pt;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.byline {
    color: var(--text-muted);
    font-style: italic;
}

/* ─── Base paragraph ─── */
p {
    font-size: 13pt;
    line-height: 1.8em;
    color: var(--text-main);
    font-weight: 400;
    margin: 0 0 10px 0;
}

strong { color: var(--text-strong); font-weight: 700; }
em { font-style: italic; color: #a0c4e8; }

a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}
a:hover { color: #ffc94d; }

.unclickable {
    color: #3a5570;
    cursor: not-allowed;
    font-weight: 700;
}

/* ─── Images ─── */
.ink-image {
    display: block;
    width: 30%;
    max-width: 30%;
    margin: 24px auto;
    border-radius: 4px;
    border: 1.5px solid var(--border-soft);
    box-shadow: 4px 4px 0 var(--shadow-hard);
}

/* ══════════════════════════════════════
   INK CLASS DEFINITIONS
   ══════════════════════════════════════ */

/* ─── game-title ─── */
p.game-title {
    font-family: var(--font-display);
    font-size: 36pt;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-strong);
    text-align: center;
    text-shadow: 4px 4px 0 var(--shadow-hard);
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 20px 0 4px 0 !important;
    margin: 0 !important;
    line-height: 1.1;
}

/* ─── game-subtitle ─── */
p.game-subtitle {
    font-family: var(--font-display);
    font-size: 13pt;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    text-align: center;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 28px 0 !important;
    margin: 0 !important;
}

/* ─── section-heading ─── */
p.section-heading {
    font-family: var(--font-display);
    font-size: 13pt;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d1520;
    background: var(--accent) !important;
    border: 3px solid #111 !important;
    border-radius: 2px !important;
    box-shadow:
            3px 3px 0 #111,
            4px 4px 0 rgba(0,0,0,0.15),
            inset 0 1px 0 rgba(255,255,255,0.25),
            inset 0 -2px 0 rgba(0,0,0,0.15) !important;
    padding: 6px 18px !important;
    margin: 24px 0 16px 4px !important;
    display: inline-block !important;
    width: auto !important;
    transform: rotate(-0.8deg);
    transform-origin: left center;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

p.section-heading::before,
p.section-heading::after { display: none !important; }

/* ─── scene-meta ─── */
p.scene-meta {
    font-family: var(--font-display) !important;
    font-size: 13pt !important;
    font-weight: 400 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #0d1520 !important;
    background: rgba(180, 200, 230, 0.92) !important;
    border: 3px solid #111 !important;
    border-radius: 2px !important;
    box-shadow:
            3px 3px 0 #111,
            4px 4px 0 rgba(0,0,0,0.15),
            inset 0 1px 0 rgba(255,255,255,0.35),
            inset 0 -2px 0 rgba(0,0,0,0.1) !important;
    padding: 6px 18px !important;
    margin: 0 0 16px 4px !important;
    display: inline-block !important;
    width: auto !important;
    transform: rotate(-0.8deg) !important;
    transform-origin: left center !important;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.15) !important;
}

/* ─── intro-text, body-text, callout ───
   Full rethink: no boxes at all. The comic/noir character lives in
   section-heading, scene-meta, player-block and the buttons — flowing
   prose just needs to be well-set and readable. Special Elite gives
   it a dossier/case-file character without needing a frame around it.
   Requires loading the font once via Google Fonts in index.html:
   <link href="https://fonts.googleapis.com/css2?family=Special+Elite&display=swap" rel="stylesheet">

   intro-text = narration / in-world voice (brighter, blue-white)
   body-text  = explanatory / continuing prose (slightly more muted)
   callout    = a labelled aside, marked with a gold arrow instead of
                italics + border, used for sub-points like the five
                competence dimensions or branching "if X then Y" notes */
p.intro-text {
    font-family: 'Special Elite', var(--font-main), monospace !important;
    font-size: 13pt !important;
    font-weight: 400 !important;
    font-style: normal !important;
    line-height: 1.85 !important;
    letter-spacing: 0.01em !important;
    color: #dce8f5 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 14px 0 !important;
}

p.intro-text::before,
p.intro-text::after { display: none !important; }

p.body-text {
    font-family: 'Special Elite', var(--font-main), monospace !important;
    font-size: 13pt !important;
    font-weight: 400 !important;
    line-height: 1.85 !important;
    letter-spacing: 0.01em !important;
    color: #b8c8da !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 14px 0 !important;
}

p.callout {
    font-family: 'Special Elite', var(--font-main), monospace !important;
    font-size: 11.5pt !important;
    font-weight: 400 !important;
    font-style: normal !important;
    line-height: 1.7 !important;
    color: #a8c4e0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 0 24px !important;
    margin: 0 0 10px 0 !important;
    position: relative !important;
}

p.callout::before {
    content: '▸';
    position: absolute;
    left: 2px;
    top: 0;
    color: var(--accent);
    font-size: 12pt;
}

p.callout::after { display: none !important; }

/* ─── player-block ─── */
p.player-block {
    font-family: var(--font-main);
    font-size: 12pt;
    font-weight: 400;
    color: #d8e8f0;
    background: rgba(8, 14, 28, 0.7) !important;
    border: 1.5px solid var(--border-soft) !important;
    border-left: 3px solid var(--accent) !important;
    border-radius: 0 4px 4px 0 !important;
    box-shadow: 3px 3px 0 var(--shadow-hard) !important;
    padding: 14px 18px !important;
    margin: 6px 0 !important;
    line-height: 1.75;
}

p.player-block::first-line {
    font-family: var(--font-display);
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Structured allocation summaries keep board package decisions scannable:
   selected services are rows, while totals and insurance exposure have their
   own visual hierarchy inside the existing player-block document style. */
p.player-block .allocation-summary-services {
    display: block;
    margin: 6px 0 10px;
}

p.player-block .allocation-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 3px 0;
    line-height: 1.35;
    color: #d8e8f0;
}

p.player-block .allocation-summary-cost {
    flex: 0 0 auto;
    color: #b8c8da;
    font-family: var(--font-mono);
}

p.player-block .allocation-summary-financials {
    display: grid;
    gap: 3px;
    padding-top: 9px;
    border-top: 1px solid var(--border-soft);
    line-height: 1.35;
}

p.player-block .allocation-summary-total,
p.player-block .allocation-summary-coverage,
p.player-block .allocation-summary-hospital-share {
    display: block;
    font-family: var(--font-mono);
    font-size: 11pt;
}

p.player-block .allocation-summary-total {
    color: var(--text-strong);
    font-weight: 700;
}

p.player-block .allocation-summary-coverage {
    color: #b8c8da;
}

p.player-block .allocation-summary-hospital-share {
    color: #f0a0a0;
    font-weight: 700;
}

/* ─── ransom-note ─── */
p.ransom-note {
    font-family: var(--font-mono) !important;
    font-size: 11pt !important;
    line-height: 1.9 !important;
    color: #e8d5c0 !important;
    background: rgba(20, 4, 4, 0.92) !important;
    border: 2px solid #8b0000 !important;
    border-top: 3px solid #cc0000 !important;
    border-radius: 4px !important;
    box-shadow: 4px 4px 0 #1a0000, inset 0 0 40px rgba(180, 0, 0, 0.08) !important;
    padding: 24px 28px !important;
    margin: 8px 0 16px 0 !important;
    position: relative !important;
    backdrop-filter: blur(4px) !important;
}

p.ransom-note::before {
    content: '⚠ README_RESTORE.txt';
    display: block;
    font-family: var(--font-mono);
    font-size: 9pt;
    color: #cc0000;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a0000;
}

p.ransom-note::after {
    display: none !important;
}

/* ─── data-table ─── */
p.data-table {
    font-family: var(--font-mono) !important;
    font-size: 10.5pt !important;
    line-height: 2 !important;
    color: #c8daf0 !important;
    background: rgba(6, 14, 30, 0.88) !important;
    border: 1.5px solid var(--border-soft) !important;
    border-top: 2.5px solid var(--accent) !important;
    border-radius: 4px !important;
    box-shadow: 3px 3px 0 var(--shadow-hard) !important;
    padding: 18px 22px !important;
    margin: 8px 0 16px 0 !important;
    white-space: pre-wrap !important;
}

p.data-table::before {
    content: '📋 BACKUP ASSESSMENT — CONFIDENTIAL';
    display: block;
    font-size: 8.5pt;
    color: var(--accent);
    letter-spacing: 0.12em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(245, 168, 0, 0.2);
}

p.data-table::after {
    display: none !important;
}

/* ─── status-table ───
   General-purpose table for in-story HTML tables (system status
   overviews, etc.). Unlike data-table, the header is written directly
   in the Ink content (as a .status-title span) instead of being
   hardcoded via CSS, so the same class works for any table title and
   any number of rows. */
p.status-table {
    background: rgba(6, 14, 30, 0.88) !important;
    border: 1.5px solid var(--border-soft) !important;
    border-top: 2.5px solid var(--accent) !important;
    border-radius: 4px !important;
    box-shadow: 3px 3px 0 var(--shadow-hard) !important;
    padding: 18px 22px !important;
    margin: 8px 0 16px 0 !important;
}

p.status-table .status-title {
    display: block;
    font-family: var(--font-mono);
    font-size: 8.5pt;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(245, 168, 0, 0.2);
}

/* ─── report-heading ───
   A detached comic tab for labelling a document/result that follows
   (e.g. the status-table right after it). Same comic-badge family as
   section-heading (hard border, shadow, slight rotation) but in a
   cream/paper tone instead of gold, so it doesn't read as a decision
   marker. Negative bottom margin lets it overlap the box below it,
   like a tab sticking out of a folder. Always tag the very next
   element (status-table) directly after this in the Ink file. */
p.report-heading {
    font-family: var(--font-display) !important;
    font-size: 12pt !important;
    font-weight: 400 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: #0d1520 !important;
    background: #e8ddc8 !important;
    border: 3px solid #111 !important;
    border-radius: 2px !important;
    box-shadow:
            3px 3px 0 #111,
            4px 4px 0 rgba(0,0,0,0.15),
            inset 0 1px 0 rgba(255,255,255,0.3),
            inset 0 -2px 0 rgba(0,0,0,0.1) !important;
    padding: 6px 16px !important;
    margin: 16px 0 -2px 6px !important;
    display: inline-block !important;
    width: auto !important;
    transform: rotate(0.8deg);
    transform-origin: left center;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.15);
    position: relative !important;
    z-index: 2 !important;
}

p.report-heading::before,
p.report-heading::after { display: none !important; }

p.status-table table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 10.5pt;
    color: #c8daf0;
}

p.status-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

p.status-table td:first-child {
    color: #f0ebe0;
    white-space: nowrap;
    width: 30%;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.green  { background: #3fae5a; box-shadow: 0 0 4px #3fae5a; }
.status-dot.yellow { background: #f5c518; box-shadow: 0 0 4px #f5c518; }
.status-dot.red    { background: #d6342c; box-shadow: 0 0 4px #d6342c; }

/* ─── status-grid (dashboard variant of status-table) ───
   DEPRECATED — the original markup for this used <div> elements,
   which are invalid inside the <p class="status-table"> that Ink
   generates. Browsers auto-close the <p> at the first <div>, which
   both breaks the grid and leaves a stray empty box. Kept here only
   for reference; use status-list below for new tables. */
.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.status-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0 0 4px 4px;
    padding: 12px 14px;
}

.status-card.sev-green  { border-top: 3px solid #3fae5a; }
.status-card.sev-yellow { border-top: 3px solid #f5c518; }
.status-card.sev-red    { border-top: 3px solid #d6342c; }

.status-card .label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 9pt;
    color: #8fa3bd;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 6px 0;
}

.status-card .label .status-dot {
    flex-shrink: 0;
    margin-right: 0;
}

.status-card .value {
    display: block;
    font-family: var(--font-mono);
    font-size: 11pt;
    color: #f0ebe0;
    font-weight: 700;
    margin: 0;
}

/* ─── status-list (recommended) ───
   Compact row-based status readout. Name on the left, status text on
   the right in its own severity color (plus a small dot for
   redundancy with the colorblind-safe text label itself). Built
   entirely from <span> elements so it stays valid inside the
   Ink-generated <p class="status-table">. */
.status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    border-left: 3px solid transparent;
}

.status-row.sev-yellow { border-left-color: #f5c518; }
.status-row.sev-red    { border-left-color: #d6342c; }
.status-row.sev-green  { border-left-color: #3fae5a; }

.status-row .status-dot {
    margin-right: 0;
}

.status-row .sys-name {
    font-family: var(--font-mono);
    font-size: 11pt;
    color: #f0ebe0;
    letter-spacing: 0.04em;
    flex: 1;
}

.status-row .sys-value {
    font-family: var(--font-mono);
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-row.sev-yellow .sys-value { color: #f5c518; }
.status-row.sev-red    .sys-value { color: #ff6b63; }
.status-row.sev-green  .sys-value { color: #5ecb7d; }

/* ─── backup-table ───
   Multi-column comparison table (e.g. backup type vs. age vs.
   infection/backdoor risk). A real <table> can't be used here for
   the same reason <div> couldn't: it's invalid inside the
   Ink-generated <p>. Built as a CSS grid on <span> elements instead.
   Keep the whole thing on a single line in the Ink source (no blank
   lines inside it) — multi-line HTML inside one CLASS block has
   produced a stray empty box before. */
.backup-table {
    display: grid;
    grid-template-columns: 1.6fr 0.9fr 1fr 1fr;
    gap: 8px 10px;
}

.bt-header {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 8.5pt;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(245, 168, 0, 0.25);
    padding-bottom: 8px;
}

.bt-label {
    font-family: var(--font-mono);
    font-size: 11pt;
    color: #f0ebe0;
    font-weight: 700;
}

.bt-age {
    font-family: var(--font-mono);
    font-size: 11pt;
    color: #8fa3bd;
}

.bt-risk {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11pt;
    font-weight: 700;
}

.bt-risk .status-dot { margin-right: 0; }

.bt-risk.sev-red    { color: #ff6b63; }
.bt-risk.sev-yellow { color: #f5c518; }
.bt-risk.sev-green  { color: #5ecb7d; }

.bt-footnotes {
    display: block;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-family: var(--font-mono);
    font-size: 9.5pt;
    color: #e8a35c;
    line-height: 1.7;
}



@media screen and (max-width: 980px) {
    .status-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════
   CHOICES
   ══════════════════════════════════════ */

.choice {
    text-align: left;
    line-height: 1.6em;
    margin: 8px 0;
}

:not(.choice) + .choice {
    padding-top: 0.8em;
}

.choice a,
.choice span {
    display: block;
    font-family: var(--font-display);
    font-size: 13pt;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 13px 22px;
    border-radius: 6px;
    color: #f0ebe0 !important;
    background: linear-gradient(160deg, #1c2a3e 0%, #141e2e 60%, #0d1520 100%);
    border: 2px solid #080e18;
    outline: 1px solid rgba(255, 255, 255, 0.07);
    outline-offset: -3px;
    box-shadow:
            0 2px 0 rgba(255,255,255,0.05) inset,
            0 -1px 0 rgba(0,0,0,0.4) inset,
            3px 3px 0 #060c14;
    transition: transform 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease, color 0.12s ease;
    text-decoration: none;
    cursor: pointer;
}

.choice a:hover {
    color: #ffffff !important;
    background: linear-gradient(160deg, #263548 0%, #1c2a3e 60%, #141e2e 100%);
    transform: translate(-2px, -2px);
    box-shadow:
            0 2px 0 rgba(255,255,255,0.07) inset,
            0 -1px 0 rgba(0,0,0,0.4) inset,
            5px 5px 0 #060c14;
}

.choice a:active {
    transform: translate(1px, 1px);
    box-shadow:
            0 1px 0 rgba(255,255,255,0.04) inset,
            1px 1px 0 #060c14;
}

.choice span.unclickable {
    color: #3a5570;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.5;
}

/* ─── End ─── */
.end {
    text-align: center;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18pt;
    letter-spacing: 0.1em;
    color: var(--text-strong);
    padding: 32px 0;
    text-shadow: 3px 3px 0 var(--shadow-hard);
}

/* ─── Inky visibility ─── */
.container .hide     { opacity: 0; }
.container .invisible { display: none; }
.container > *       { opacity: 1; }

@media screen and (prefers-reduced-motion: no-preference) {
    .container > * { transition: opacity 0.6s ease; }
}

/* ══════════════════════════════════════
   MOBILE
   ══════════════════════════════════════ */

@media screen and (max-width: 980px) {
    .outerContainer { margin-top: 44px; }

    .container {
        max-width: none;
        margin: 16px 12px 60px 12px;
        padding: 24px 20px;
        border-radius: 4px;
    }

    h1 { font-size: 22pt; }
    h2 { font-size: 10pt; }
    p  { font-size: 12pt; }

    p.game-title   { font-size: 26pt !important; }
    p.intro-text   { font-size: 12.5pt !important; }
    p.body-text    { font-size: 12.5pt !important; }

    .choice a,
    .choice span {
        font-size: 12pt;
        padding: 12px 14px;
    }
}

/* ─── handoff-p1 (Player 1 device handoff) ─── */
p.handoff-p1 {
    font-family: var(--font-display) !important;
    font-size: 16pt !important;
    font-weight: 400 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    text-align: center !important;
    color: #f0ebe0 !important;
    background: linear-gradient(160deg, #1a2e50 0%, #0f1e38 100%) !important;
    border: 3px solid #2a5aaa !important;
    border-top: 4px solid #4895ef !important;
    border-radius: 6px !important;
    box-shadow: 5px 5px 0 #060c14 !important;
    padding: 28px 24px !important;
    margin: 24px 0 16px 0 !important;
    line-height: 1.4 !important;
}

p.handoff-p1::before {
    content: '▶ PLAYER 1';
    display: block;
    font-size: 9pt;
    color: #4895ef;
    letter-spacing: 0.2em;
    margin-bottom: 10px;
}

p.handoff-p1::after { display: none !important; }

/* ─── handoff-p2 (Player 2 device handoff) ─── */
p.handoff-p2 {
    font-family: var(--font-display) !important;
    font-size: 16pt !important;
    font-weight: 400 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    text-align: center !important;
    color: #f0ebe0 !important;
    background: linear-gradient(160deg, #2a1a10 0%, #1a0e08 100%) !important;
    border: 3px solid #aa5a2a !important;
    border-top: 4px solid var(--accent) !important;
    border-radius: 6px !important;
    box-shadow: 5px 5px 0 #060c14 !important;
    padding: 28px 24px !important;
    margin: 24px 0 16px 0 !important;
    line-height: 1.4 !important;
}

p.handoff-p2::before {
    content: '▶ PLAYER 2';
    display: block;
    font-size: 9pt;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 10px;
}

p.handoff-p2::after { display: none !important; }

p.choice.unclickable {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

p.choice.unclickable a {
    pointer-events: none;
    text-decoration: none;
    color: inherit;
}
