:root {
  color-scheme: dark;
  --bg: #090a0b;
  --panel: rgba(24, 26, 29, 0.88);
  --panel-strong: rgba(31, 34, 38, 0.95);
  --surface: #111315;
  --surface-2: #171a1d;
  --text: #f6f3eb;
  --muted: #a7aaa6;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #d64242;
  --accent-soft: rgba(214, 66, 66, 0.16);
  --ok: #58bd78;
  --warn: #d9b458;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(214, 66, 66, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 240px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 36px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 100% 42px, 42px 100%;
  opacity: 0.72;
  content: "";
}

button,
input {
  font: inherit;
}

a {
  color: #f1b6b6;
  text-underline-offset: 4px;
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.brand-link {
  display: inline-block;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
  transition:
    filter 180ms ease,
    transform 180ms ease;
}

.brand-link:hover {
  filter: drop-shadow(0 0 24px rgba(214, 66, 66, 0.24));
  transform: translateY(-1px);
}

.brand-link:hover h1,
.brand-link:focus-visible h1 {
  color: #fff;
  text-shadow:
    0 0 28px rgba(214, 66, 66, 0.34),
    0 0 12px rgba(255, 255, 255, 0.12);
}

.brand-link:focus-visible {
  outline: 2px solid rgba(214, 66, 66, 0.78);
  outline-offset: 8px;
  border-radius: 10px;
}

.brand-stack {
  display: grid;
  gap: 6px;
}

.brand-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scp-logo {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 28px;
  aspect-ratio: 1;
  opacity: 0.82;
  filter:
    drop-shadow(0 0 10px rgba(214, 66, 66, 0.2))
    drop-shadow(0 2px 0 rgba(0, 0, 0, 0.34));
}

.scp-logo img {
  display: block;
  width: 100%;
  height: 100%;
  filter: invert(1) contrast(0.92) brightness(0.88);
  object-fit: cover;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(42px, 8vw, 82px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 36px rgba(214, 66, 66, 0.2);
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

h3 {
  margin-bottom: 4px;
  font-size: 26px;
}

.stats {
  display: flex;
  gap: 10px;
}

.stats div {
  min-width: 92px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    var(--panel);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.stats span {
  display: block;
  font-size: 26px;
  font-weight: 800;
}

.stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.briefing,
.result-panel,
.dev-panel,
.card,
.solved-list,
.credits-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: var(--shadow-soft);
}

.briefing,
.result-panel,
.dev-panel {
  margin-bottom: 18px;
  padding: 18px;
}

.dev-panel {
  position: relative;
  z-index: 1;
}

.dev-answers {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.dev-answers > strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dev-answers > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dev-answer-chip {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.dev-answer-chip span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dev-answer-chip b {
  font-size: 14px;
}

.dev-answer-chip small {
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-answer-chip.copied {
  border-color: rgba(88, 189, 120, 0.72);
  box-shadow: 0 0 0 1px rgba(88, 189, 120, 0.22);
}

.is-static-render .card,
.is-static-render .solved-list,
.is-static-render .attempt-card,
.is-static-render .trait-tile,
.is-static-render .emoji-chip,
.is-static-render .protocol-field,
.is-static-render .fact-field,
.is-static-render .redaction {
  animation: none !important;
  transition-duration: 1ms !important;
}

.briefing p,
.result-panel p,
.dev-panel p,
.footer p,
.card-subtitle {
  color: var(--muted);
  line-height: 1.55;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.lang-toggle {
  min-width: 54px;
}

.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 6vh 18px 32px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  animation: modal-backdrop-in 180ms ease both;
}

.modal-overlay[hidden],
.panel-content[hidden] {
  display: none;
}

.modal-dialog {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(860px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    #1a1d20;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  transform-origin: 50% 0;
  animation: modal-dialog-in 260ms cubic-bezier(.2, .85, .22, 1) both;
}

.modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 4px;
  padding: 0;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.top-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.top-panel-head h2 {
  margin-bottom: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.75);
  padding-bottom: 8px;
  font-size: clamp(34px, 5vw, 54px);
}

.panel-content {
  display: grid;
  gap: 12px;
}

.how-to-panel ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.how-to-panel strong {
  color: var(--text);
}

.progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.progress-step {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    #121416;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.progress-step strong,
.progress-step span {
  display: block;
}

.progress-step strong {
  color: var(--text);
  font-size: 14px;
}

.progress-step span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.progress-step.current {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(214, 66, 66, 0.18), transparent),
    #161719;
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(214, 66, 66, 0.18), 0 16px 38px rgba(214, 66, 66, 0.08);
  transform: translateY(-2px);
}

.progress-step.done {
  border-color: rgba(79, 173, 112, 0.75);
  background:
    linear-gradient(180deg, rgba(79, 173, 112, 0.12), transparent),
    #121719;
  color: var(--ok);
}

.progress-step:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.progress-step.revealed {
  border-color: rgba(88, 189, 120, 0.55);
  background:
    linear-gradient(180deg, rgba(88, 189, 120, 0.16), transparent),
    #121719;
}

.online-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
  margin-bottom: 18px;
}

.info-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(18, 20, 22, 0.86);
  box-shadow: var(--shadow-soft);
}

.info-panel h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.archive-panel {
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  align-content: start;
  gap: 18px;
  padding: 14px 16px;
}

.panel-kicker {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.yesterday-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.yesterday-item {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 10px 5px 5px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.yesterday-item .scp-portrait {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.yesterday-item .scp-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yesterday-item strong,
.yesterday-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yesterday-item small {
  display: none;
}

.leaderboard-panel {
  align-content: start;
  padding-bottom: 18px;
}

.leaderboard-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.player-name-field {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.player-name-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 14, 15, 0.82);
  color: var(--text);
  outline: none;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.full-leaderboard-list {
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.leaderboard-list li.is-player {
  border-color: rgba(88, 189, 120, 0.5);
  background: rgba(88, 189, 120, 0.09);
}

.leaderboard-panel > .leaderboard-list {
  gap: 4px;
}

.leaderboard-panel > .leaderboard-list li {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 34px;
  padding: 5px 8px;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.018);
}

.leaderboard-panel > .leaderboard-list .rank {
  font-size: 14px;
}

.leaderboard-panel > .leaderboard-list .leader-name {
  font-size: 14px;
}

.leaderboard-panel > .leaderboard-list .leader-score {
  font-size: 12px;
}

.rank {
  color: var(--accent);
  font-weight: 900;
}

.leader-name {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-score,
.leaderboard-status {
  color: var(--muted);
  font-size: 13px;
}

.leaderboard-status {
  margin-bottom: 0;
}

.game {
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 5;
  margin-bottom: 18px;
}

.game + .result-panel {
  margin-top: 0;
}

.card {
  min-height: 430px;
  overflow: visible;
  position: relative;
  animation: card-enter 260ms ease-out both;
  transition:
    border-color 260ms ease,
    box-shadow 260ms ease,
    background-color 260ms ease;
}

.card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.045) 50%, transparent 100%);
  background-position: 120% 0;
  background-size: 220% 100%;
  animation: scan-sheen 780ms ease 120ms both;
  content: "";
  display: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card.is-victory {
  border-color: rgba(88, 189, 120, 0.92);
  background:
    radial-gradient(circle at 18% 12%, rgba(88, 189, 120, 0.26), transparent 30rem),
    linear-gradient(180deg, rgba(88, 189, 120, 0.13), rgba(18, 28, 21, 0.92)),
    var(--panel);
  box-shadow:
    0 0 0 1px rgba(88, 189, 120, 0.34),
    0 0 42px rgba(88, 189, 120, 0.28),
    var(--shadow);
  animation:
    card-enter 260ms ease-out both,
    victory-pulse 1100ms ease-out both;
}

.card.is-victory::after {
  position: absolute;
  inset: -2px;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 0%, rgba(172, 255, 193, 0.42), transparent 44%),
    linear-gradient(180deg, rgba(88, 189, 120, 0.18), transparent 55%);
  content: "";
  opacity: 0.55;
  animation: victory-glow 1400ms ease-out both;
}

.card.is-victory::before {
  background:
    linear-gradient(90deg, transparent 0%, rgba(163, 255, 190, 0.35) 50%, transparent 100%);
  animation: victory-sheen 1150ms ease-out both;
  display: block;
}

.card.is-victory .card-header {
  border-bottom-color: rgba(88, 189, 120, 0.42);
  background:
    linear-gradient(90deg, rgba(88, 189, 120, 0.22), transparent 48%),
    var(--panel-strong);
}

.card.is-victory .clearance-mark {
  border-color: rgba(88, 189, 120, 0.78);
  background:
    linear-gradient(135deg, rgba(88, 189, 120, 0.38), transparent 55%),
    #08130d;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 0 24px rgba(88, 189, 120, 0.25);
}

.card.is-victory .badge,
.card.is-victory .message.ok {
  color: var(--ok);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(214, 66, 66, 0.11), transparent 38%),
    var(--panel-strong);
}

.level {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.card-marker {
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 8px;
}

.clearance-mark {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(214, 66, 66, 0.18), transparent 55%),
    #0d0e0f;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.card-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.hint-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hint-list li {
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  line-height: 1.35;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.hint-list li.visible {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.visual-challenge,
.drawing-panel {
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 16px;
  align-items: stretch;
}

.mystery-portrait {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0e0f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.drawing-panel .mystery-portrait {
  min-height: 420px;
}

.mystery-portrait .scp-portrait {
  width: 100%;
  height: 100%;
  border: 0;
}

.drawing-reveal {
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.drawing-reveal img {
  position: relative;
  z-index: 1;
  transform: scale(var(--drawing-scale, 1.08));
  transition: transform 520ms ease;
}

.paint-sketch-image {
  width: 100%;
  height: 100%;
  background: #fff;
  object-fit: contain;
  image-rendering: pixelated;
  transform-origin: center;
}

.classification-panel,
.classic-panel,
.emoji-panel,
.redacted-file,
.protocol-panel,
.incident-panel {
  display: grid;
  gap: 14px;
  min-height: 210px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-2);
  padding: 16px;
}

.classic-panel p,
.emoji-panel p,
.drawing-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.drawing-hint {
  color: var(--muted);
  font-family: "Courier New", ui-monospace, monospace;
  letter-spacing: 0.01em;
}

.classic-attempts {
  display: grid;
  gap: 14px;
}

.classic-attempt {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(13, 14, 15, 0.66);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.classic-attempt.is-new {
  animation: attempt-reveal 420ms cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: var(--attempt-delay, 0ms);
}

.guess-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(214, 66, 66, 0.13), transparent 55%),
    rgba(255, 255, 255, 0.025);
}

.guess-summary .scp-portrait {
  width: 48px;
  height: 48px;
}

.source-portrait-link,
.source-title-link,
.source-inline-link,
.source-chip {
  color: inherit;
  text-decoration: none;
}

.source-portrait-link {
  display: inline-flex;
  border-radius: 8px;
}

.source-title-link {
  display: inline-block;
  margin-top: 2px;
  border-radius: 6px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.source-inline-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
  color: var(--text);
  font-weight: 900;
}

.source-portrait-link:hover .scp-portrait,
.source-title-link:hover,
.source-inline-link:hover,
.source-chip:hover {
  border-color: rgba(229, 77, 77, 0.65);
  color: var(--text);
  filter: brightness(1.12);
}

.guess-summary span,
.trait-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guess-summary strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 18px;
}

.trait-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.trait-tile {
  position: relative;
  display: flex;
  min-height: 116px;
  flex-direction: column;
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #111315;
  overflow: hidden;
  transform-origin: center;
}

.trait-tile.is-new {
  animation: tile-reveal 680ms cubic-bezier(.18, .9, .2, 1.1) both;
  animation-delay: var(--tile-delay, 0ms);
}

.trait-tile::before {
  position: absolute;
  inset: 0;
  opacity: 0.72;
  content: "";
}

.trait-tile.match::before {
  background: linear-gradient(145deg, rgba(88, 189, 120, 0.5), rgba(88, 189, 120, 0.12));
}

.trait-tile.partial::before {
  background: linear-gradient(145deg, rgba(217, 180, 88, 0.48), rgba(217, 180, 88, 0.12));
}

.trait-tile.miss::before {
  background: linear-gradient(145deg, rgba(96, 101, 108, 0.46), rgba(96, 101, 108, 0.1));
}

.trait-tile > * {
  position: relative;
  z-index: 1;
}

.status-dot {
  display: block;
  width: 10px;
  height: 10px;
  margin-bottom: 10px;
  border-radius: 50%;
  box-shadow: 0 0 18px currentColor;
}

.trait-tile.match .status-dot {
  background: var(--ok);
  color: var(--ok);
}

.trait-tile.partial .status-dot {
  background: var(--warn);
  color: var(--warn);
}

.trait-tile.miss .status-dot {
  background: #8d9299;
  color: #8d9299;
}

.trait-value {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 11px;
}

.trait-value span {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  padding: 6px 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent),
    rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: clamp(9px, calc(19px - (var(--chars) * 0.62px)), 14px);
  font-weight: 760;
  line-height: 1.12;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.trait-tile.wide {
  grid-column: auto;
}

.trait-tile.match .trait-value span {
  border-color: rgba(88, 189, 120, 0.3);
  background:
    linear-gradient(180deg, rgba(88, 189, 120, 0.14), rgba(88, 189, 120, 0.045)),
    rgba(255, 255, 255, 0.04);
}

.trait-tile.partial .trait-value span {
  border-color: rgba(217, 180, 88, 0.32);
  background:
    linear-gradient(180deg, rgba(217, 180, 88, 0.16), rgba(217, 180, 88, 0.045)),
    rgba(255, 255, 255, 0.04);
}

.trait-tile.miss .trait-value span {
  color: #e4e1da;
}

.trait-tile.match {
  border-color: rgba(88, 189, 120, 0.46);
}

.trait-tile.partial {
  border-color: rgba(217, 180, 88, 0.46);
}

.trait-tile.miss {
  border-color: rgba(255, 255, 255, 0.1);
}

.trait-tile:hover {
  transform: translateY(-2px);
}

.classic-empty {
  display: grid;
  gap: 6px;
}

.classic-empty strong,
.classic-empty span {
  display: block;
}

.classic-table-wrap {
  overflow-x: auto;
}

.classic-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.classic-table th,
.classic-table td {
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
  animation: cell-in 260ms ease both;
}

.classic-table th {
  background: #0d0e0f;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}

.classic-table td span,
.classic-table td strong {
  display: block;
}

.classic-table td span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.classic-table td strong {
  margin-top: 4px;
  font-size: 13px;
}

.classic-table .match {
  background: linear-gradient(180deg, rgba(79, 173, 112, 0.34), rgba(79, 173, 112, 0.2));
}

.classic-table .partial {
  background: linear-gradient(180deg, rgba(208, 169, 73, 0.34), rgba(208, 169, 73, 0.2));
}

.classic-table .miss {
  background: linear-gradient(180deg, rgba(92, 96, 101, 0.34), rgba(92, 96, 101, 0.2));
}

.empty-table {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
}

.emoji-panel {
  justify-items: start;
}

.emoji-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.emoji-line span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    #0d0e0f;
  font-size: 30px;
  box-shadow: var(--shadow-soft);
  animation: emoji-pop 360ms cubic-bezier(.18, .9, .2, 1.2) both;
}

.class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.class-row span,
.stamp {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.class-row strong {
  color: var(--text);
  font-size: 24px;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-grid span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  background: #0d0e0f;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.tag-grid .redacted-chip {
  color: var(--muted);
}

.redacted-file p,
.protocol-panel p,
.incident-panel p {
  margin-bottom: 0;
  color: var(--text);
  font-family: "Courier New", ui-monospace, monospace;
  line-height: 1.65;
}

.classification-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.classification-list li {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) 1fr;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045), transparent 62%),
    rgba(13, 14, 15, 0.66);
  font-family: "Courier New", ui-monospace, monospace;
}

.classification-list li.visible {
  border-color: rgba(214, 66, 66, 0.34);
  animation: rise-in 260ms ease both;
}

.classification-list li.locked {
  color: var(--muted);
}

.classification-list span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.classification-list strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.protocol-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: protocol;
}

.protocol-list li {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 12px 12px 46px;
  background: rgba(13, 14, 15, 0.62);
  color: var(--text);
  font-family: "Courier New", ui-monospace, monospace;
  line-height: 1.45;
  counter-increment: protocol;
}

.protocol-list li::before {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 900;
  content: counter(protocol);
}

.protocol-list li.visible {
  border-color: rgba(214, 66, 66, 0.32);
  animation: rise-in 260ms ease both;
}

.protocol-list li.locked {
  color: var(--muted);
}

.redaction {
  color: var(--accent);
  letter-spacing: 0.05em;
  white-space: nowrap;
  animation: redact-pulse 1.8s ease-in-out infinite;
}

.stamp {
  width: fit-content;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 6px 8px;
  color: #f0bbbb;
  background: rgba(214, 66, 66, 0.08);
}

.danger-stamp {
  border-color: #d0a949;
  color: #f0d99c;
}

.side-note {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  color: var(--muted) !important;
}

.answer-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  z-index: 30;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 12px;
  background: rgba(13, 14, 15, 0.86);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus {
  border-color: var(--accent);
  background: #0d0e0f;
  box-shadow: 0 0 0 4px rgba(214, 66, 66, 0.12);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent),
    var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, background 160ms ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(214, 66, 66, 0.16);
  filter: brightness(1.05);
}

button:not(:disabled):active {
  transform: translateY(0);
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(214, 66, 66, 0.75);
  outline-offset: 3px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary-button {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    #24272b;
}

.danger-button {
  background: #3a2424;
  color: #ffd7d7;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.suggestions {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  width: min(100%, 540px);
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 14, 15, 0.96);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  overflow: auto;
  animation: menu-in 140ms ease both;
}

.suggestion {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 140ms ease, transform 140ms ease;
}

.suggestion:hover,
.suggestion:focus {
  background: #171a1d;
  transform: translateX(2px);
}

.suggestion strong,
.suggestion span {
  display: block;
}

.suggestion span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.scp-portrait {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #151719;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.scp-portrait::after {
  position: absolute;
  right: 5px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--icon-color, var(--accent));
  content: "";
}

.scp-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message {
  min-height: 22px;
  color: var(--warn);
  font-size: 14px;
}

.message.ok {
  color: var(--ok);
}

.next-level-button {
  justify-self: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent),
    var(--ok);
  color: #07150c;
}

.source {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.yesterday-note {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

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

.yesterday-note small {
  color: var(--muted);
  font-size: 13px;
}

.guess-history {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(13, 14, 15, 0.48);
}

.guess-history > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guess-history > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.history-chip:hover {
  background: rgba(229, 77, 77, 0.08);
  transform: translateY(-1px);
}

.history-chip .scp-portrait {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.solved-list {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
  padding: 14px;
  animation: rise-in 360ms ease both;
}

.solved-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.solved-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.solved-main .scp-portrait {
  width: 38px;
  height: 38px;
}

.card-marker .scp-portrait {
  width: 70px;
  height: 70px;
}

.footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 14px;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-dialog-in {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.975);
    filter: blur(2px);
  }
  70% {
    opacity: 1;
    transform: translateY(2px) scale(1.002);
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes emoji-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cell-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes attempt-reveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tile-reveal {
  0% {
    opacity: 0;
    transform: rotateX(-80deg) translateY(14px) scale(0.94);
    filter: blur(3px);
  }
  60% {
    opacity: 1;
    transform: rotateX(8deg) translateY(0) scale(1.015);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: rotateX(0deg) translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes redact-pulse {
  0%, 100% {
    opacity: 0.78;
  }
  50% {
    opacity: 1;
  }
}

@keyframes scan-sheen {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

@keyframes victory-pulse {
  0% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-2px) scale(1.008);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes victory-sheen {
  from {
    background-position: -140% 0;
  }
  to {
    background-position: 140% 0;
  }
}

@keyframes victory-glow {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0.72;
  }
  100% {
    opacity: 0.42;
  }
}

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

.credits-list {
  display: grid;
  gap: 12px;
}

.credits-list article {
  padding: 16px;
}

.credits-list p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 22px, 860px);
    padding: 22px 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats {
    width: 100%;
  }

  .stats div {
    flex: 1;
  }

  .progress {
    grid-template-columns: repeat(5, minmax(40px, 1fr));
  }

  .online-grid {
    grid-template-columns: 1fr;
  }

  .archive-panel {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .leaderboard-head {
    flex-direction: column;
  }

  .player-name-field {
    width: 100%;
  }

  .full-leaderboard-list {
    max-height: 360px;
  }

  .trait-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trait-tile.wide {
    grid-column: span 2;
  }

  .trait-tile {
    min-height: 108px;
  }

  .answer-row {
    grid-template-columns: 1fr;
  }

  .suggestions {
    width: 100%;
  }

  .visual-challenge,
  .drawing-panel {
    grid-template-columns: 1fr;
  }

  .mystery-portrait {
    min-height: 260px;
  }

  .drawing-panel .mystery-portrait {
    min-height: 330px;
  }
}
