/* CVE Game. Surfaces, type and chips follow cve-security.com's theme tokens. */

:root {
  --navy: #1a2744;
  --navy-light: #2a3f66;
  --blue: #4a90d9;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-800: #1f2937;

  --bg: #ffffff;
  --bg-alt: var(--gray-50);
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-muted: var(--gray-100);
  --text: var(--gray-800);
  --text-strong: var(--navy);
  --text-muted: var(--gray-600);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --accent: var(--blue);
  --accent-ink: #2b5fb3;
  --accent-pale: #e8f0fe;
  --btn-bg: #2b5fb3;
  --btn-bg-hover: #1a2744;
  --btn-ink: #ffffff;

  --ink-critical: #b91c1c;
  --ink-high: #c2410c;
  --ink-medium: #b45309;
  --ink-low: #15803d;
  --tint-critical: rgba(220, 38, 38, 0.1);
  --tint-high: rgba(234, 88, 12, 0.12);
  --tint-medium: rgba(217, 119, 6, 0.14);
  --tint-low: rgba(22, 163, 74, 0.14);
  --ink-good: #15803d;
  --tint-good: rgba(22, 163, 74, 0.12);
  --ink-bad: #b91c1c;
  --tint-bad: rgba(220, 38, 38, 0.09);
  --ink-warn: #92400e;
  --tint-warn: rgba(217, 119, 6, 0.13);

  --term-bg: #0b1220;
  --term-bar: #152038;
  --term-border: #243352;
  --term-ink: #dbe9ff;
  --term-dim: #8fa3c4;
  --term-accent: #6baaf0;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, Menlo, monospace;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --container: 1120px;
  --gutter: 16px;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0f1830;
  --surface: #152038;
  --surface-elevated: #1c2a48;
  --surface-muted: #1a2440;
  --text: #e5e7eb;
  --text-strong: #f3f4f6;
  --text-muted: #9aa3b2;
  --border: #243352;
  --border-strong: #33446b;
  --accent: #6baaf0;
  --accent-ink: #6baaf0;
  --accent-pale: rgba(107, 170, 240, 0.15);
  --btn-bg: #6baaf0;
  --btn-bg-hover: #8fc0f5;
  --btn-ink: #0b1220;

  --ink-critical: #f87171;
  --ink-high: #fb923c;
  --ink-medium: #fbbf24;
  --ink-low: #4ade80;
  --tint-critical: rgba(248, 113, 113, 0.14);
  --tint-high: rgba(251, 146, 60, 0.14);
  --tint-medium: rgba(251, 191, 36, 0.14);
  --tint-low: rgba(74, 222, 128, 0.14);
  --ink-good: #4ade80;
  --tint-good: rgba(74, 222, 128, 0.12);
  --ink-bad: #f87171;
  --tint-bad: rgba(248, 113, 113, 0.12);
  --ink-warn: #fbbf24;
  --tint-warn: rgba(251, 191, 36, 0.12);

  --term-bg: #0f1830;
  --term-bar: #1c2a48;
  --term-border: #33446b;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--text-strong);
}

button {
  font: inherit;
  color: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip:focus {
  top: 8px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 8px var(--gutter);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-strong);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand__mark {
  color: var(--accent-ink);
  flex: none;
}

.brand__by {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}

.brand__by:hover {
  text-decoration: underline;
}

.controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text-strong);
  border-color: var(--accent);
}

.icon-btn[aria-pressed="true"],
.icon-btn[aria-checked="true"] {
  background: var(--accent-pale);
  border-color: var(--accent);
  color: var(--text-strong);
}

svg {
  flex: none;
}

.icon-btn__label {
  display: none;
}

.seg {
  display: inline-flex;
}

.seg .icon-btn {
  border-radius: 0;
  margin-left: -1px;
}

.seg .icon-btn:first-child {
  margin-left: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.seg .icon-btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.seg .icon-btn[aria-checked="true"] {
  position: relative;
  z-index: 1;
}

@media (min-width: 720px) {
  .icon-btn__label {
    display: inline;
  }
  .icon-btn {
    padding: 0 10px;
  }
}

/* ---------- Layout ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px var(--gutter) 32px;
}

main:focus {
  outline: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.site-footer p {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px var(--gutter);
}

.noscript {
  padding: 24px 0;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

h1 {
  color: var(--text-strong);
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1:focus,
h2:focus {
  outline: none;
}

h2 {
  color: var(--text-strong);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.muted {
  color: var(--text-muted);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--text-strong);
}

.btn--primary {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-ink);
}

.btn--primary:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-bg-hover);
  color: var(--btn-ink);
}

.btn--lg {
  min-height: 52px;
  padding: 10px 28px;
  font-size: 1.08rem;
}

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  min-height: 36px;
  padding: 4px 10px;
}

.btn[disabled] {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn--quiet[disabled] {
  background: transparent;
  border-color: transparent;
}

.btn--block {
  width: 100%;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.alert {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--ink-bad);
  border-radius: var(--radius-md);
  background: var(--tint-bad);
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
}

/* ---------- Opening ---------- */

.intro {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(8px, 4vh, 40px) 0 16px;
  display: grid;
  gap: 22px;
  justify-items: start;
}

.term {
  width: 100%;
  border: 1px solid var(--term-border);
  border-radius: var(--radius-lg);
  background: var(--term-bg);
  color: var(--term-ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: var(--font-mono);
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: var(--term-bar);
  border-bottom: 1px solid var(--term-border);
  color: var(--term-dim);
  font-size: 0.72rem;
}

.term__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--term-dim);
}

.term__title {
  margin-left: 8px;
}

.term__body {
  padding: clamp(20px, 6vw, 44px) clamp(16px, 5vw, 40px);
  background-image: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
}

.term__line {
  color: var(--term-dim);
  font-size: 0.82rem;
}

.term__headline {
  margin-top: 10px;
  color: var(--term-ink);
  font-family: var(--font-mono);
  font-size: clamp(1.45rem, 6.4vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-shadow: 0 0 18px rgba(107, 170, 240, 0.45);
}

.term__prompt {
  color: var(--term-accent);
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.12em;
  vertical-align: -0.12em;
  background: var(--term-accent);
}

.intro__lede {
  font-size: 1.1rem;
  max-width: 56ch;
}

.intro__meta {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ---------- Briefing ---------- */

.brief {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  justify-items: start;
}

.brief__lead {
  font-size: 1.15rem;
  color: var(--text-strong);
  font-weight: 500;
}

.slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.slot-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-strong);
  font-weight: 700;
}

.slot-pill small {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.steps {
  display: grid;
  gap: 10px;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 40px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-pale);
  color: var(--text-strong);
  font-weight: 700;
  font-size: 0.86rem;
}

.note {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  font-size: 0.92rem;
}

/* ---------- Round ---------- */

.round__head {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.round__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
}

.round__brief {
  color: var(--text-muted);
  max-width: 70ch;
}

.total {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
}

.total strong {
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.round__grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.cards {
  display: grid;
  gap: 10px;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card--pick {
  cursor: pointer;
}

.card--pick:hover {
  border-color: var(--border-strong);
}

.card.is-armed,
.card.is-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.card.is-open {
  border-style: dashed;
  border-color: var(--accent);
}

.card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}

.letter {
  flex: none;
  align-self: center;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

:root[data-theme="dark"] .letter {
  background: #33446b;
}

.card__id {
  color: var(--text-strong);
  font-weight: 600;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.card__product {
  flex-basis: 100%;
  color: var(--text-strong);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.chip b {
  font-weight: 800;
}

.chip--critical {
  background: var(--tint-critical);
  color: var(--ink-critical);
}

.chip--high {
  background: var(--tint-high);
  color: var(--ink-high);
}

.chip--medium {
  background: var(--tint-medium);
  color: var(--ink-medium);
}

.chip--low {
  background: var(--tint-low);
  color: var(--ink-low);
}

.chip__by {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.card__desc {
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.card__warning {
  margin-top: 8px;
  padding: 7px 10px;
  border-left: 3px solid var(--ink-warn);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--tint-warn);
  font-size: 0.84rem;
  line-height: 1.45;
}

.card__warning strong {
  color: var(--ink-warn);
}

.card__slot {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.slot-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.slot-btn.is-set {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-pale);
  color: var(--text-strong);
  font-weight: 700;
}

.slot-btn[aria-pressed="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.clear-btn {
  flex: none;
  width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.clear-btn:hover {
  color: var(--ink-bad);
  border-color: var(--ink-bad);
}

/* ---------- Deadline panel / tray ---------- */

.panel {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 calc(var(--gutter) * -1);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  box-shadow: 0 -6px 16px -8px rgba(0, 0, 0, 0.25);
  display: grid;
  gap: 8px;
}

.panel__title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.panel__drag {
  display: none;
}

.deadlines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.deadline {
  display: grid;
  justify-items: center;
  gap: 0;
  min-height: 48px;
  padding: 5px 4px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-strong);
  cursor: pointer;
  touch-action: manipulation;
  line-height: 1.25;
  user-select: none;
  -webkit-user-select: none;
}

.deadline__days {
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.deadline__state {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.deadline.is-used {
  border-style: dashed;
  background: var(--surface-muted);
}

.deadline.is-used .deadline__days {
  color: var(--text-muted);
}

.deadline[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-pale);
  box-shadow: 0 0 0 2px var(--accent);
}

.deadline[aria-pressed="true"] .deadline__days,
.deadline[aria-pressed="true"] .deadline__state {
  color: var(--text-strong);
}

.panel__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  pointer-events: none;
  padding: 6px 14px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--text-strong);
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -120%);
}

body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
}

/* The tray is sticky only while there is room for it. With enlarged text or a
   short viewport it falls back into the page so nothing is hidden. */
@media (max-height: 520px) {
  .panel {
    position: static;
    box-shadow: none;
  }
}

/* ---------- Reveal ---------- */

.scoreline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: baseline;
  margin: 10px 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
}

.scoreline__item {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.scoreline__item strong {
  margin-left: 4px;
  color: var(--text-strong);
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.card__facts {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.card__facts dt {
  display: inline;
  color: var(--text-muted);
}

.card__facts dd {
  display: inline;
  color: var(--text);
  font-weight: 600;
}

.card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 6px;
  font-size: 0.82rem;
}

.outcome {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.outcome--blocked {
  color: var(--ink-good);
  background: var(--tint-good);
}

.outcome--compromised {
  color: var(--ink-bad);
  background: var(--tint-bad);
}

.outcome--neutral {
  color: var(--text-muted);
  background: var(--surface-muted);
  border-style: dashed;
}

.tl {
  border-bottom: 1px solid var(--border);
}

.tl__row {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.tl__when {
  display: grid;
  align-content: start;
  line-height: 1.35;
}

.tl__date {
  color: var(--text-strong);
  font-weight: 700;
  font-size: 0.9rem;
}

.tl__day {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.tl__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.tl__who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tl__who .letter {
  width: 18px;
  height: 18px;
  font-size: 0.66rem;
  border-radius: 5px;
}

.tl__text {
  margin-top: 3px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.tl__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  margin-top: 4px;
  font-size: 0.8rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.7;
  white-space: nowrap;
}

.tag--team {
  background: var(--accent-pale);
  color: var(--accent-ink);
}

.tag--attack {
  border: 1px solid var(--text-muted);
  color: var(--text);
}

.tag--news {
  background: var(--surface-muted);
  color: var(--text);
}

.tag--cisa {
  background: var(--navy);
  color: #fff;
}

:root[data-theme="dark"] .tag--cisa {
  background: #33446b;
}

.tag--note {
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.tl__row--blocked .tl__text,
.tl__row--compromised .tl__text {
  padding-left: 10px;
  border-left: 3px solid var(--ink-good);
}

.tl__row--compromised .tl__text {
  border-left-color: var(--ink-bad);
}

.reveal__actions {
  margin-top: 16px;
}

.reveal__title {
  font-size: 1.25rem;
}

.cases {
  display: grid;
  gap: 14px;
}

.case {
  display: grid;
  gap: 4px 24px;
  padding: 14px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.case--blocked {
  border-left-color: var(--ink-good);
}

.case--compromised {
  border-left-color: var(--ink-bad);
}

.case__rank {
  margin-bottom: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.case__what {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.case__what strong {
  color: var(--text-strong);
}

.case__closing {
  padding: 10px 0 2px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.case .tl {
  margin-top: 10px;
}

.case .card__links {
  margin-top: 10px;
}

/* ---------- Final ---------- */

.final {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.final__score {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.final__num {
  font-size: clamp(3rem, 16vw, 5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text-strong);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
}

.stat dt {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stat dd {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.rounds-list {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rounds-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.rounds-list li:first-child {
  border-top: 0;
}

.rounds-list__name {
  font-weight: 600;
  color: var(--text-strong);
}

.promo {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--accent-pale);
  display: grid;
  gap: 10px;
}

.promo p {
  max-width: 62ch;
}

/* ---------- Desktop ---------- */

@media (min-width: 480px) {
  .card--pick {
    grid-template-columns: minmax(0, 1fr) 9.5rem;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
  }
  .card--pick .card__slot {
    flex-direction: column;
  }
  .card--pick .slot-btn {
    min-height: 48px;
  }
  .card--pick .clear-btn {
    width: 100%;
    min-height: 30px;
  }
  .card__product {
    flex-basis: auto;
  }
}

@media (min-width: 900px) {
  main {
    padding-top: 28px;
  }
  .round__grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
  }
  .panel {
    top: 16px;
    bottom: auto;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-alt);
    box-shadow: none;
    gap: 12px;
  }
  .panel__drag {
    display: inline;
  }
  .panel__title {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }
  .deadlines {
    grid-template-columns: minmax(0, 1fr);
  }
  .deadline {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: baseline;
    gap: 10px;
    min-height: 54px;
    padding: 8px 14px;
    cursor: grab;
  }
  .deadline__days {
    font-size: 1.15rem;
  }
  .deadline__state {
    font-size: 0.8rem;
    justify-self: end;
  }
  .panel__actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .case {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    padding: 18px 20px;
  }
  .case .tl {
    margin-top: 0;
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .cursor {
    animation: blink 1.1s steps(1, end) infinite;
  }
  .card,
  .deadline,
  .slot-btn,
  .btn {
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  }
  .reveal--animate .tl__row {
    animation: rise 0.36s ease both;
    animation-delay: calc(var(--i, 0) * 140ms);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (forced-colors: active) {
  .card.is-armed,
  .card.is-target,
  .deadline[aria-pressed="true"] {
    outline: 3px solid Highlight;
  }
}
