:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #141a22;
  --panel-alt: #1b2330;
  --border: #2a3542;
  --text: #e6edf3;
  --text-dim: #8b98a5;
  --accent: #3ea6ff;
  --accent-dim: #1d4e73;
  --critical: #ff4d4f;
  --high: #ff9f43;
  --medium: #ffd43b;
  --low: #6c8cff;
  --success: #2ecc71;
  --danger: #ff4d4f;
  --button-text: #06131f;
  --danger-button-text: #2a0505;
  --finding-count-text: #2a0505;
  --everyone: #ffb547;
  --everyone-accent-dim: #7a5214;
  --everyone-button-text: #2a1a02;
  --technical-accent: #3ea6ff;
  --time-accent: #b18cff;
  --radius: 10px;
}

:root[data-color-mode="light"] {
  color-scheme: light;
  --bg: #f5f8fc;
  --panel: #ffffff;
  --panel-alt: #e9f0f7;
  --border: #b8c7d6;
  --text: #1b2735;
  --text-dim: #4c6174;
  --accent: #0b579b;
  --accent-dim: #9abbd9;
  --critical: #ae2530;
  --high: #a24f00;
  --medium: #775700;
  --low: #335aa7;
  --success: #147348;
  --danger: #ae2530;
  --button-text: #ffffff;
  --danger-button-text: #ffffff;
  --finding-count-text: #ffffff;
  --everyone: #875100;
  --everyone-accent-dim: #c99f64;
  --everyone-button-text: #ffffff;
  --technical-accent: #0b579b;
  --time-accent: #6d48a7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body { padding-bottom: env(safe-area-inset-bottom); }

h1, h2, h3 { margin: 0 0 4px; font-weight: 600; }
p { margin: 0; color: var(--text-dim); }

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

button {
  font: inherit;
  border: none;
  border-radius: var(--radius);
  padding: 12px 18px;
  background: var(--accent);
  color: var(--button-text);
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.secondary { background: var(--panel-alt); color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); color: var(--danger-button-text); }

input, select {
  font: inherit;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
}
input { width: 100%; }

.hidden { display: none !important; }

/* --- layout shells --- */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 96px;
}
.page.wide { max-width: 1200px; }

.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  z-index: 10;
}
.topbar-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.topbar-row > :first-child { min-width: 0; }
.appearance-toggle { padding: 6px 10px; font-size: 0.82em; white-space: nowrap; }

.bottombar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* --- login --- */
.login-card {
  max-width: 360px;
  margin: 20vh auto 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-error { color: var(--danger); min-height: 1.2em; font-size: 0.9em; }

/* --- badges / status --- */
.badge {
  display: inline-block;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge.critical { background: color-mix(in srgb, var(--critical) 25%, transparent); color: var(--critical); }
.badge.high { background: color-mix(in srgb, var(--high) 25%, transparent); color: var(--high); }
.badge.medium { background: color-mix(in srgb, var(--medium) 25%, transparent); color: var(--medium); }
.badge.low { background: color-mix(in srgb, var(--low) 25%, transparent); color: var(--low); }

.conn-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); display: inline-block;
}
.conn-dot.connected { background: var(--success); }

/* --- budget bar --- */
.budget-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--panel-alt);
  overflow: hidden;
  border: 1px solid var(--border);
}
.budget-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease, background 0.2s ease;
}
.budget-bar-fill.over { background: var(--danger); }

/* --- finding cards --- */
.finding-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.finding-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.finding-grid .finding-card { margin-bottom: 0; }
.finding-card.hardened { border-color: var(--success); }
.finding-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.finding-title { font-weight: 600; margin: 6px 0 4px; }
.finding-desc { font-size: 0.9em; line-height: 1.4; }
.finding-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.finding-cost { color: var(--text-dim); font-size: 0.85em; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--panel-alt); border: 1px solid var(--border);
  border-radius: 999px; transition: 0.15s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: var(--text-dim); border-radius: 50%; transition: 0.15s;
}
.switch input:checked + .slider { background: var(--accent-dim); border-color: var(--success); }
.switch input:checked + .slider::before { transform: translateX(20px); background: var(--success); }
.switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

.category-heading {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8em;
  color: var(--text-dim);
  margin: 20px 0 8px;
}

/* --- attack log --- */
.log-line {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text-dim);
}
.log-line.step { color: var(--text); }
.log-line.step { border-left: 3px solid var(--border); padding-left: 8px; }
.log-line.sev-critical { border-left-color: var(--critical); }
.log-line.sev-high { border-left-color: var(--high); }
.log-line.sev-medium { border-left-color: var(--medium); }
.log-line.sev-low { border-left-color: var(--low); }
.log-line.wave { color: var(--accent); font-weight: 600; border-bottom-style: solid; margin-top: 6px; }

.impact-banner {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  margin: 16px 0;
}
.impact-banner .impact-label { font-size: 1.3em; font-weight: 700; }

/* --- facilitator: roster + race grid --- */
.roster-table, .scoreboard-table {
  width: 100%;
  border-collapse: collapse;
}
.roster-table th, .roster-table td,
.scoreboard-table th, .scoreboard-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.roster-table th, .scoreboard-table th { color: var(--text-dim); font-weight: 500; font-size: 0.85em; }

.race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.race-lane {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 220px;
}
.race-lane h3 { display: flex; justify-content: space-between; align-items: center; }
.race-log { max-height: 260px; overflow-y: auto; margin-top: 10px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--panel-alt); font-size: 0.8em; }
.pill.rank-1 { background: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); }

.section { margin-bottom: 28px; }
.muted { color: var(--text-dim); font-size: 0.9em; }

/* --- deployment (level) picker --- */
.level-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.level-card {
  background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color 0.15s;
}
.level-card:hover { border-color: var(--accent-dim); }
.level-card.selected { border-color: var(--accent); }
.level-card h3 { margin-bottom: 6px; }
.level-card p { margin-bottom: 10px; font-size: 0.88em; line-height: 1.4; }
.level-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.level-stats span { background: var(--panel-alt); border-radius: 999px; padding: 2px 9px; font-size: 0.78em; color: var(--text-dim); }

/* --- topology diagram --- */
.diagram { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.diagram-node { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.diagram-connector { width: 2px; height: 18px; background: var(--border); }
.diagram-connector.horizontal { width: 24px; height: 2px; align-self: center; margin-top: -20px; }
.diagram-icon { width: 30px; height: 30px; display: block; }
.diagram-label { font-size: 0.72em; text-align: center; color: var(--text-dim); max-width: 92px; overflow-wrap: break-word; }
.diagram-cidr { color: var(--text-dim); font-size: 0.78em; font-family: "SF Mono", Menlo, monospace; }

.diagram-gateway { display: flex; align-items: flex-start; justify-content: center; }
.diagram-gateway-orphan { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-left: 22px; opacity: 0.9; }
.diagram-orphan-note {
  font-size: 0.65em; color: var(--critical); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
}

.diagram-vcn-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px;
  width: 100%;
}
.diagram-vcn-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.diagram-vcn-header .diagram-icon { width: 22px; height: 22px; }
.diagram-vcn-title { font-weight: 600; }

.diagram-subnet-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
  background: var(--panel-alt);
}
.diagram-subnet-box.public { border-color: var(--accent-dim); }
.diagram-subnet-header { display: flex; align-items: center; gap: 6px; font-size: 0.85em; margin-bottom: 8px; flex-wrap: wrap; }

.diagram-instances { display: flex; gap: 10px; flex-wrap: wrap; }

.diagram-resource-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px; border-radius: 8px; border: 2px solid var(--border);
  background: var(--panel); min-width: 72px; position: relative;
}
.diagram-vcn-box.sev-critical, .diagram-subnet-box.sev-critical, .diagram-resource-card.sev-critical { border-color: var(--critical); }
.diagram-vcn-box.sev-high, .diagram-subnet-box.sev-high, .diagram-resource-card.sev-high { border-color: var(--high); }
.diagram-vcn-box.sev-medium, .diagram-subnet-box.sev-medium, .diagram-resource-card.sev-medium { border-color: var(--medium); }
.diagram-vcn-box.sev-low, .diagram-subnet-box.sev-low, .diagram-resource-card.sev-low { border-color: var(--low); }
.diagram-vcn-box.all-hardened, .diagram-subnet-box.all-hardened, .diagram-resource-card.all-hardened { border-color: var(--success); }

.diagram-finding-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--critical); color: var(--finding-count-text); font-size: 0.65em; font-weight: 700;
  border-radius: 999px; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.diagram-finding-count.zero { display: none; }
.diagram-vcn-header .diagram-finding-count, .diagram-subnet-header .diagram-finding-count {
  position: static; margin-left: auto;
}

.diagram-side-groups { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; margin-top: 16px; width: 100%; }
.diagram-side-group { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.diagram-side-group-title { font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.diagram-side-items { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

@keyframes diagram-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.65); }
  50% { box-shadow: 0 0 0 9px rgba(255, 77, 79, 0); }
}
.diagram-resource-card.under-attack, .diagram-subnet-box.under-attack, .diagram-vcn-box.under-attack {
  animation: diagram-pulse 1s ease-in-out infinite;
  border-color: var(--critical);
}

.diagram.compact .diagram-icon { width: 20px; height: 20px; }
.diagram.compact .diagram-vcn-header .diagram-icon { width: 16px; height: 16px; }
.diagram.compact .diagram-label { font-size: 0.62em; max-width: 64px; }
.diagram.compact .diagram-vcn-box { padding: 8px; }
.diagram.compact .diagram-subnet-box { padding: 6px; margin-top: 6px; }
.diagram.compact .diagram-resource-card { min-width: 54px; padding: 5px; }
.diagram.compact .diagram-cidr { display: none; }

/* --- toasts + confirm modal (replacements for alert()/confirm()) --- */
.toast-container {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: var(--panel-alt); border: 1px solid var(--danger); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); font-size: 0.9em; max-width: 320px;
}
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; max-width: 360px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* --- timer, rounds, scans, evidence, hints --- */
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
@media (max-width: 380px) {
  .topbar-right { gap: 6px; }
  .appearance-toggle { padding: 5px 7px; font-size: 0.72em; }
}
.countdown {
  font-family: "SF Mono", Menlo, monospace; font-weight: 700; font-size: 0.95em;
  background: var(--panel-alt); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
}
.countdown.urgent { color: var(--critical); border-color: var(--critical); }

.round-banner {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  border: 1px solid var(--accent-dim); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 14px; font-size: 0.9em; line-height: 1.4;
}
.round-banner strong { display: block; margin-bottom: 2px; }
.waves-note { margin-bottom: 12px; line-height: 1.4; }

.category-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scan-btn { padding: 4px 10px; font-size: 0.85em; text-transform: none; letter-spacing: 0; }
.scan-done { color: var(--success); text-transform: none; letter-spacing: 0; }
.badge.reopened { background: color-mix(in srgb, var(--critical) 25%, transparent); color: var(--critical); margin-left: 6px; }
.finding-paid { margin-left: 8px; font-size: 0.85em; color: var(--text-dim); }
.badge.found { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); margin-left: 6px; }

.evidence {
  font-family: "SF Mono", Menlo, monospace; font-size: 0.78em; line-height: 1.4;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 8px; margin: 4px 0 6px; color: var(--text); overflow-wrap: anywhere;
}
.finding-hint { font-size: 0.8em; color: var(--accent); margin-top: 6px; }

.lobby-options { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.checkbox-label { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 0.9em; cursor: pointer; }
.checkbox-label input { width: auto; }

/* --- facilitator: group setup --- */
.group-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.group-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.group-row input { flex: 1 1 160px; min-width: 0; }

/* --- group join codes: readable from across the room on the projector --- */
.group-codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 18px; }
.group-code-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-align: center;
}
.group-code-name { font-size: 1.1em; font-weight: 600; margin-bottom: 8px; word-break: break-word; }
.group-code-value {
  font-family: "SF Mono", Menlo, monospace; font-size: 2.4em; font-weight: 700;
  letter-spacing: 0.08em; color: var(--accent);
}

.scoreboard-table tr.me { color: var(--accent); font-weight: 700; }

/* --- debrief --- */
.wave-result { margin-top: 4px; }
.wave-result .impact-label { font-size: 1.05em; }
.debrief { margin-top: 8px; }
.debrief-summary { margin: 4px 0 12px; line-height: 1.4; }
.debrief-section { margin-bottom: 16px; }
.debrief-section h3 { font-size: 0.95em; }
.debrief-section > p { font-size: 0.82em; margin-bottom: 6px; }
.debrief-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 6px;
}
.debrief-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.debrief-item-title { font-weight: 600; font-size: 0.9em; }
.debrief-item-extra { margin-left: auto; font-size: 0.8em; color: var(--text-dim); }
.debrief-item .evidence { margin-bottom: 0; }
.debrief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.debrief-card { background: var(--panel-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
details summary { cursor: pointer; }

/* --- technical vs everyone game: always visibly labelled --- */
.mode-chip {
  display: inline-block; margin: 2px 0 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78em; font-weight: 700; letter-spacing: 0.02em;
}
.mode-chip.technical { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.mode-chip.everyone { background: color-mix(in srgb, var(--everyone) 25%, transparent); color: var(--everyone); }

body.audience-everyone { --accent: var(--everyone); --accent-dim: var(--everyone-accent-dim); }
body.audience-everyone button:not(.secondary) { color: var(--everyone-button-text); }

.level-group { margin-top: 22px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); }
.level-group.technical { border-left: 5px solid var(--technical-accent); }
.level-group.everyone { border-left: 5px solid var(--everyone); }
.level-group-title { font-size: 1.1em; }
.level-group > p { margin-top: 2px; }
.level-card-kind { font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.level-card.technical .level-card-kind { color: var(--technical-accent); }
.level-card.everyone .level-card-kind { color: var(--everyone); }
.level-card.everyone.selected { border-color: var(--everyone); }

/* --- everyone game cards --- */
.finding-picture { font-size: 1.9em; line-height: 1; display: block; margin-bottom: 6px; }
.audience-everyone .evidence {
  font-family: inherit; font-style: italic; font-size: 0.85em;
  background: color-mix(in srgb, var(--everyone) 8%, var(--bg));
}
.budget-bar-fill.time { background: var(--time-accent); }
.cloud-name { margin-top: 6px; font-size: 0.8em; color: var(--technical-accent); }
.cloud-bridge { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--technical-accent); color: var(--text); font-size: 0.88em; line-height: 1.4; }
.debrief-picture { font-size: 1.2em; }

/* --- floor-plan diagram --- */
.diagram-emoji { display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; }
.diagram-vcn-header .diagram-emoji { font-size: 18px; }
.diagram.compact .diagram-emoji { font-size: 16px; }
.audience-everyone .diagram-cidr { display: none; }
.audience-everyone .under-attack { position: relative; }
.audience-everyone .under-attack::after {
  content: "🦹"; position: absolute; left: -10px; top: -12px; font-size: 20px;
  animation: burglar-bob 0.8s ease-in-out infinite;
}
@keyframes burglar-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Administrator account management */
.admin-page { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.admin-header p { margin-top: 4px; max-width: 60ch; }
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-table-wrap { overflow-x: auto; }
.admin-page input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.admin-page .col-select { width: 64px; }
.admin-page .roster-table tbody tr:last-child td { border-bottom: none; }
.admin-page .roster-table td button { padding: 6px 12px; font-size: 0.9em; }
.admin-page .admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-page .admin-header .admin-actions button { padding: 8px 14px; }
.admin-field { display: flex; align-items: center; gap: 10px; }
.admin-group-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.admin-group-rows input { width: 100%; }

/* --- help modal (web/static/help.js) --- */
.help-dialog { width: 90vw; max-width: 90vw; height: min(88vh, 900px); padding: 0; border: 1px solid var(--border, #888); border-radius: 12px; background: var(--panel, #fff); color: inherit; overflow: hidden; }
.help-dialog[open] { display: flex; flex-direction: column; }
.help-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.help-bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border, #888); }
.help-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.help-tab[aria-selected="true"] { outline: 2px solid var(--accent, #6c8cff); }
.help-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* Cooperative game (coop.html) */
.coop-meters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.coop-meter { border: 1px solid var(--border, #444); border-radius: 8px; padding: 6px 10px; min-width: 110px; }
.coop-meter .value { font-size: 1.15em; font-weight: 600; }
.coop-meter.low .value { color: #d9534f; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.role-card { border: 1px solid var(--border, #444); border-radius: 10px; padding: 12px; }
.role-card.mine { outline: 2px solid #3b82f6; }
.role-card.taken { opacity: 0.65; }
.coop-section { margin: 18px 0; }
.coop-card { border: 1px solid var(--border, #444); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.coop-card .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.coop-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.coop-card.violation { border-color: #d9534f; }
.status-pill { font-size: 0.8em; border-radius: 999px; padding: 2px 8px; border: 1px solid currentColor; }
.status-requested { color: var(--accent, #6c8cff); }
.status-proposed { color: #b58900; } .status-approved { color: #3b82f6; } .status-executed { color: #2e9d57; }
.status-rejected, .status-sent_back { color: #d9534f; } .status-cancelled { color: #888; }
.decision-log li { margin: 2px 0; }
.budget-request-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.budget-request-form input[type="number"] { width: 110px; }
.budget-request-form input[type="text"] { flex: 1 1 200px; }

/* --- Facilitator test groups switch & tabs --- */
.test-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.test-groups-panel {
  background: var(--panel);
  border: 2px solid var(--accent-dim);
  border-radius: var(--radius);
  overflow: hidden;
}
.test-tabs-header {
  background: var(--panel-alt);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.test-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.test-role-tabs {
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.test-tab {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9em;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.test-tab[aria-selected="true"] {
  background: var(--accent);
  color: var(--button-text);
  border-color: var(--accent);
}
.test-tab-content {
  padding: 18px;
}
.test-submit-bar {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Executive & Cooperative Role Dashboards (CEO, CISO, CTO) --- */
.dash-banner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.dash-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.dash-banner-header h3 {
  margin: 0;
  font-size: 1.25em;
}
.dash-banner-subtext {
  margin: 0;
  font-size: 0.9em;
  color: var(--text-dim);
  line-height: 1.45;
}
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.dash-kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.dash-kpi-label {
  font-size: 0.78em;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dash-kpi-val {
  font-size: 1.35em;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0;
}
.dash-kpi-sub {
  font-size: 0.8em;
  color: var(--text-dim);
}
.dash-chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 16px 0;
}
.dash-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.dash-chart-header h4 {
  margin: 0;
}
.financial-chart {
  width: 100%;
  height: auto;
  max-height: 200px;
  display: block;
}
.dash-radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.dash-radar-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}
.dash-radar-card h4 {
  margin: 0 0 8px 0;
  font-size: 0.95em;
  color: var(--text);
}
.dash-severity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82em;
  font-weight: 600;
  border: 1px solid var(--border);
}
.dash-chip.critical { border-color: var(--critical); color: var(--critical); }
.dash-chip.high { border-color: var(--high); color: var(--high); }
.dash-chip.medium { border-color: var(--medium); color: var(--medium); }
.dash-chip.low { border-color: var(--low); color: var(--low); }
.dash-progress-track {
  width: 100%;
  height: 8px;
  background: var(--panel-alt);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}
.dash-progress-bar {
  height: 100%;
  background: var(--success);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.subtext-callout {
  background: var(--panel-alt);
  border-left: 4px solid var(--accent);
  padding: 8px 14px;
  border-radius: 4px;
  margin: 8px 0 14px 0;
  font-size: 0.88em;
  color: var(--text);
  line-height: 1.4;
}

/* Triad Diagnostic & Crisis Management styling */
.dash-diagnostic-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.dash-diagnostic-card.healthy {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 5%, var(--panel));
}
.dash-diagnostic-card.warning {
  border-color: var(--high);
  background: color-mix(in srgb, var(--high) 5%, var(--panel));
}
.dash-diagnostic-card.danger {
  border-color: var(--critical);
  background: color-mix(in srgb, var(--critical) 5%, var(--panel));
}
.dash-diagnostic-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.dash-diagnostic-badge {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.dash-diagnostic-badge.healthy { color: var(--success); }
.dash-diagnostic-badge.warning { color: var(--high); }
.dash-diagnostic-badge.danger { color: var(--critical); }
.dash-diagnostic-subbadge {
  font-size: 0.75em;
  color: var(--text-dim);
  font-weight: 500;
}
.dash-diagnostic-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.dash-diagnostic-icon-frame {
  font-size: 2.2em;
  line-height: 1;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  flex-shrink: 0;
}
.dash-diagnostic-title-wrap {
  flex: 1;
}
.dash-diagnostic-title {
  font-size: 1.22em;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
}
.dash-diagnostic-verdict {
  font-size: 0.94em;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}
.dash-diagnostic-body {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 10px;
}
.dash-diagnostic-desc {
  font-size: 0.9em;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 10px 0;
}
.dash-diagnostic-advice {
  background: var(--panel-alt);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.86em;
  line-height: 1.45;
  color: var(--text);
}
.dash-diagnostic-advice strong {
  color: var(--accent);
}
.dash-diagnostic-list {
  margin: 0 0 10px 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 0.9em;
  line-height: 1.5;
}
.dash-diagnostic-list li {
  margin-bottom: 4px;
}

.dash-crisis-box {
  background: color-mix(in srgb, var(--critical) 8%, var(--panel));
  border: 1px solid var(--critical);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 14px 0;
}
.dash-crisis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dash-crisis-title {
  font-weight: 700;
  color: var(--critical);
  font-size: 1.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-crisis-clocks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-clock-pill {
  background: var(--panel);
  border: 1px solid var(--critical);
  color: var(--critical);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78em;
  font-weight: 600;
  white-space: nowrap;
}
.dash-crisis-roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.dash-crisis-role-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--critical);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.84em;
  color: var(--text);
  line-height: 1.45;
}
.dash-crisis-role-card p {
  margin: 0;
}
.dash-crisis-role-badge {
  display: inline-block;
  font-weight: 700;
  font-size: 0.85em;
  color: var(--critical);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

/* --- Executive Comms (Role Chat, Context Cards & Readiness) --- */
.coop-comms-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0;
}
.coop-comms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.coop-comms-header h3 {
  margin: 0;
  font-size: 1.05em;
}
.coop-ready-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ready-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text-dim);
}
.ready-pill.is-ready {
  border-color: var(--success);
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, var(--panel));
}
.coop-chat-channels {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.chat-channel-btn {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82em;
  font-weight: 600;
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.chat-channel-btn.active {
  background: var(--accent);
  color: var(--button-text);
  border-color: var(--accent);
}
.coop-chat-feed {
  max-height: 230px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}
.chat-msg {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88em;
}
.chat-msg.mine {
  border-left: 3px solid var(--accent);
}
.chat-msg.direct {
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
}
.chat-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.chat-msg-sender {
  font-weight: 700;
  color: var(--text);
}
.chat-msg-channel {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.92em;
}
.chat-msg-text {
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.chat-context-card {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--panel-alt);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 0.85em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.coop-chat-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.chat-preset-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78em;
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.chat-preset-chip:hover:not(:disabled) {
  border-color: var(--accent);
}
.coop-chat-compose {
  display: flex;
  gap: 8px;
  align-items: center;
}
.coop-chat-compose input {
  flex: 1;
  min-width: 0;
}
.card-share-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.card-share-btn {
  padding: 4px 9px;
  font-size: 0.78em;
}

/* ===== Competitive game visual refresh (R-081) ===== */

/* --- header meters --- */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; margin-top: 10px; }
.meter { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 6px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.meter-name { font-size: 0.74em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.meter-value { font-size: 1.35em; font-weight: 700; font-variant-numeric: tabular-nums; }
.meter-label { margin-top: 4px; font-size: 0.78em; }
.meter .budget-bar-track { height: 14px; }
.budget-bar-fill.warn { background: var(--high); }
.budget-bar-fill.risk.low { background: var(--success); }
.budget-bar-fill.risk.mid { background: var(--high); }
.budget-bar-fill.risk.high { background: var(--critical); }
.meter.flash { animation: meter-flash 0.7s ease-out; }
@keyframes meter-flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.cost-float { position: absolute; right: 12px; top: 2px; font-weight: 700; color: var(--high); opacity: 0; pointer-events: none; }
.cost-float.refund { color: var(--success); }
.cost-float.flash { animation: cost-float 1.1s ease-out; }
@keyframes cost-float { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-18px); } }

.countdown { font-size: 1.35em; padding: 4px 14px; min-width: 4.2ch; text-align: center; }
.countdown.urgent { background: color-mix(in srgb, var(--critical) 18%, var(--panel-alt)); animation: urgent-pulse 1s ease-in-out infinite; }
@keyframes urgent-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* --- finding cards --- */
.finding-card { border-left: 5px solid var(--border); transition: border-color 0.2s, background 0.2s, transform 0.2s; }
.finding-card.sev-critical { border-left-color: var(--critical); }
.finding-card.sev-high { border-left-color: var(--high); }
.finding-card.sev-medium { border-left-color: var(--medium); }
.finding-card.sev-low { border-left-color: var(--low); }
.finding-card.hardened { background: color-mix(in srgb, var(--success) 7%, var(--panel)); border-color: var(--success); border-left-color: var(--success); }
.finding-card.just-fixed { animation: card-fixed 0.8s ease-out; }
@keyframes card-fixed { 0% { transform: scale(0.97); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 70%, transparent); } 60% { transform: scale(1.015); } 100% { transform: scale(1); box-shadow: 0 0 0 12px transparent; } }
.badge.fixed-tag { background: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); margin-left: 6px; }
.chip { display: inline-block; background: var(--panel-alt); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; color: var(--text); }
.finding-card.hardened .finding-cost.chip { border-color: var(--success); }

/* --- diagram: exposure of the way in, attack trail --- */
.diagram-connector { transition: background 0.3s; }
.diagram-connector.exposed { background: repeating-linear-gradient(to bottom, var(--critical) 0 6px, transparent 6px 10px); width: 3px; animation: flow-down 0.8s linear infinite; }
.diagram-connector.partial { background: var(--high); width: 3px; }
.diagram-connector.secure { background: var(--success); width: 3px; }
.diagram-connector.horizontal.exposed { background: repeating-linear-gradient(to right, var(--critical) 0 6px, transparent 6px 10px); width: 24px; height: 3px; animation: none; }
.diagram-connector.horizontal.partial, .diagram-connector.horizontal.secure { width: 24px; height: 3px; }
@keyframes flow-down { to { background-position: 0 10px; } }
.diagram-subnet-box, .diagram-vcn-box { position: relative; }
.diagram-resource-card .diagram-icon { width: 38px; height: 38px; padding: 6px; background: var(--panel-alt); border-radius: 10px; }
.diagram-resource-card .diagram-emoji { padding: 0; }
.diagram.compact .diagram-resource-card .diagram-icon { width: 28px; height: 28px; padding: 4px; }
.diagram-resource-card { transition: border-color 0.3s, background 0.3s; }
.diagram-resource-card.all-hardened { background: color-mix(in srgb, var(--success) 8%, var(--panel)); }
.diagram-resource-card.breached, .diagram-subnet-box.breached, .diagram-vcn-box.breached {
  border-color: var(--critical); border-style: solid; background: color-mix(in srgb, var(--critical) 12%, var(--panel));
}
.diagram-trail-step {
  position: absolute; left: -8px; bottom: -8px; z-index: 2;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px;
  background: var(--critical); color: var(--finding-count-text); font-size: 0.7em; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* --- attack timeline --- */
#attack-log, .race-log { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 14px; }
.log-line { position: relative; line-height: 1.45; }
.log-line::before {
  content: ""; position: absolute; left: -21px; top: 0.9em; width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); border: 2px solid var(--bg);
}
.log-line.step.sev-critical::before { background: var(--critical); }
.log-line.step.sev-high::before { background: var(--high); }
.log-line.step.sev-medium::before { background: var(--medium); }
.log-line.step.sev-low::before { background: var(--low); }
.log-line.wave::before { background: var(--accent); }
.log-chip { margin-right: 8px; font-family: inherit; vertical-align: 1px; }
.log-line.step { animation: log-in 0.35s ease-out; }
@keyframes log-in { from { opacity: 0; transform: translateX(-8px); } }

/* --- outcome banner --- */
.impact-banner { position: relative; overflow: hidden; }
#attack-view { position: relative; overflow: hidden; }
.outcome-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px; text-align: left;
  padding: 14px 18px; margin-bottom: 14px; border-radius: var(--radius); border: 2px solid var(--border);
}
.outcome-banner.held { border-color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--panel)); color: var(--success); }
.outcome-banner.breached { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 12%, var(--panel)); color: var(--critical); }
.outcome-icon { font-size: 2.4em; line-height: 1; }
.outcome-banner strong { display: block; font-size: 1.35em; letter-spacing: 0.02em; }
.outcome-detail { display: block; color: var(--text); font-size: 0.9em; margin-top: 2px; }
.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: confetti-fall 2.6s ease-in forwards; }
@keyframes confetti-fall { to { transform: translate(var(--drift, 0), 420px) rotate(540deg); opacity: 0; } }
.race-lane { position: relative; overflow: hidden; transition: border-color 0.3s; }
.race-lane.held { border-color: var(--success); }
.race-lane.breached { border-color: var(--critical); }
.pill.held { background: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); font-weight: 700; }
.pill.breached { background: color-mix(in srgb, var(--critical) 25%, transparent); color: var(--critical); font-weight: 700; }

/* --- scoreboard: podium, rating bars, rank arrows --- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 16px 0 22px; }
.podium:empty { display: none; }
.podium-step { flex: 1 1 0; max-width: 200px; text-align: center; min-width: 0; }
.podium-medal { font-size: 2em; line-height: 1.1; }
.podium-name { font-weight: 700; overflow-wrap: anywhere; }
.podium-rating { color: var(--text-dim); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.podium-block {
  background: var(--panel-alt); border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
  font-size: 1.5em; font-weight: 700; display: flex; align-items: flex-start; justify-content: center; padding-top: 6px;
  animation: podium-rise 0.7s ease-out backwards;
}
.podium-step.rank-1 .podium-block { height: 96px; background: color-mix(in srgb, var(--medium) 22%, var(--panel-alt)); }
.podium-step.rank-2 .podium-block { height: 68px; }
.podium-step.rank-3 .podium-block { height: 48px; }
.podium-step.me .podium-name, .podium-step.me .podium-block { color: var(--accent); }
@keyframes podium-rise { from { height: 0; opacity: 0; } }
.podium.projector { margin: 24px 0 30px; }
.podium.projector .podium-step { max-width: 320px; }
.podium.projector .podium-medal { font-size: 3.4em; }
.podium.projector .podium-name { font-size: 1.8em; }
.podium.projector .podium-rating { font-size: 1.4em; }
.podium.projector .podium-block { font-size: 2.2em; }
.rating-bar { height: 8px; border-radius: 999px; background: var(--panel-alt); border: 1px solid var(--border); overflow: hidden; margin-bottom: 4px; min-width: 90px; }
.rating-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.6s ease-out; }
.rank-arrow { font-size: 0.8em; font-weight: 700; margin-left: 4px; }
.rank-arrow.up { color: var(--success); }
.rank-arrow.down { color: var(--critical); }
.scoreboard-table tr.me { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.scoreboard-table.projector, #scoreboard-view .scoreboard-table { font-variant-numeric: tabular-nums; }

/* --- phones --- */
@media (max-width: 480px) {
  .meters { grid-template-columns: 1fr 1fr; }
  .meter-value { font-size: 1.1em; }
  .meter-label { display: none; }
  .podium { gap: 6px; }
  .podium-name { font-size: 0.85em; }
  .outcome-banner { flex-direction: column; text-align: center; }
}

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