/* ===== Variables ===== */
:root {
  --bg-deep: #06060a;
  --bg-panel: #0d0d14;
  --bg-card: #111118;
  --border: #1e1e2e;
  --border-glow: #2a2a40;
  --text: #c8c8d4;
  --text-dim: #6a6a7a;
  --accent: #c9a227;
  --accent-dim: #8a7020;
  --accent-glow: rgba(201, 162, 39, 0.25);
  --success: #3d9a6a;
  --success-glow: rgba(61, 154, 106, 0.3);
  --danger: #9a3d3d;
  --mono: 'IBM Plex Mono', monospace;
  --serif: 'Playfair Display', Georgia, serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden],
.quest-locked {
  display: none !important;
}

/* ===== Auth ===== */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 162, 39, 0.08) 0%, transparent 55%),
    var(--bg-deep);
  padding: 2rem 1rem;
}

.auth-screen[hidden] {
  display: none !important;
}

.auth-terminal-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1.2rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.auth-panel {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.auth-panel[hidden] {
  display: none;
}

.auth-badge {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-align: center;
  margin-bottom: 0.8rem;
}

.auth-title {
  font-family: var(--serif);
  font-size: 2rem;
  text-align: center;
  color: #e8e8f0;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.auth-form-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: #e8e8f0;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.auth-panel .field-label {
  margin-top: 0.8rem;
}

.auth-panel .field-label:first-of-type {
  margin-top: 0;
}

.auth-panel .answer-input {
  margin-top: 0.35rem;
}

.auth-btn {
  width: 100%;
  margin-top: 1.2rem;
}

.auth-panel > .auth-btn + .auth-btn {
  margin-top: 0.6rem;
}

.btn-link {
  display: block;
  width: 100%;
  margin-top: 0.8rem;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-link:hover {
  color: var(--accent);
}

.quest-app[hidden] {
  display: none !important;
}

.quest-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: rgba(6, 6, 15, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.quest-back-btn {
  flex-shrink: 0;
  font-size: 0.65rem !important;
  padding: 0.15rem 0;
  margin-right: auto;
}

.quest-topbar-label {
  flex: 1;
  text-align: center;
}

.quest-topbar[hidden] {
  display: none !important;
}

.quest-topbar-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.quest-topbar-label strong {
  color: var(--accent);
  font-weight: 600;
}

.quest-app {
  padding-top: 2.6rem;
}

.btn-logout {
  margin-left: 0;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ===== Admin panel ===== */
.admin-app {
  --admin-panel-width: min(1200px, calc(100vw - 3rem));
  min-height: 100vh;
  padding: 2rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(61, 154, 106, 0.08) 0%, transparent 45%),
    var(--bg-deep);
}

.admin-app > .admin-header,
.admin-app > .admin-stats,
.admin-app > .evidence-card {
  width: var(--admin-panel-width);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.admin-app .evidence-card {
  max-width: 1200px;
  padding: 2rem 2.25rem;
}

.admin-app[hidden] {
  display: none !important;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.admin-badge {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--success);
  display: block;
  margin-bottom: 0.5rem;
}

.admin-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: #e8e8f0;
  margin-bottom: 0.3rem;
}

.admin-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  min-width: 0;
  padding: 1.2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-align: center;
}

.stat-num {
  display: block;
  font-family: 'Orbitron', var(--mono);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.admin-table-card {
  margin-bottom: 0;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.admin-section-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: #e8e8f0;
}

.admin-refresh {
  width: auto;
  padding: 0.5rem 1.2rem;
  margin-top: 0;
}

.admin-updated {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.admin-table th {
  text-align: left;
  padding: 0.7rem 0.8rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(201, 162, 39, 0.04);
}

.admin-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 2rem !important;
}

.admin-danger-card {
  margin-bottom: 1.5rem;
  border-color: rgba(154, 61, 61, 0.45);
}

.admin-danger-text {
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.admin-danger-feedback {
  margin-top: 0.8rem;
  min-height: 1.2rem;
}

.btn-danger {
  width: auto;
  min-width: 280px;
  max-width: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.2rem;
  border: 1px solid #9a3d3d;
  background: rgba(154, 61, 61, 0.15);
  color: #e8a0a0;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(154, 61, 61, 0.3);
  border-color: #c05050;
}

.admin-actions {
  text-align: right;
  white-space: nowrap;
}

.btn-admin-reset-one {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(154, 61, 61, 0.5);
  background: transparent;
  color: #c08080;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-admin-reset-one:hover {
  background: rgba(154, 61, 61, 0.2);
  color: #e8a0a0;
}

.btn-admin-reset-quest {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid rgba(154, 61, 61, 0.45);
  background: transparent;
  color: #c08080;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
}

.btn-admin-reset-quest:hover {
  background: rgba(154, 61, 61, 0.22);
  color: #e8a0a0;
  border-color: rgba(196, 80, 80, 0.65);
}

.progress-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  line-height: 1.4;
}

.progress-badge.progress-active {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.progress-badge.progress-done {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-glow);
}

.terminal-bar {
  display: flex;
  align-items: center;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--mono);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Atmospheric overlays ===== */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
}

/* ===== Screens ===== */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
}

.screen-step {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #0a0a12 50%, var(--bg-deep) 100%);
  border-top: 1px solid var(--border);
}

/* ===== Welcome Screen ===== */
.screen-welcome {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 162, 39, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(30, 30, 60, 0.4) 0%, transparent 50%),
    var(--bg-deep);
}

.terminal-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1.2rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333;
}

.terminal-dot:nth-child(1) { background: #5a3a3a; }
.terminal-dot:nth-child(2) { background: #5a5a3a; }
.terminal-dot:nth-child(3) { background: #3a5a3a; }

.terminal-title {
  margin-left: 0.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Ticker */
.ticker-wrap {
  position: absolute;
  top: 2.5rem;
  left: 0;
  right: 0;
  overflow: hidden;
  background: rgba(201, 162, 39, 0.08);
  border-bottom: 1px solid rgba(201, 162, 39, 0.15);
  padding: 0.4rem 0;
}

.ticker {
  display: flex;
  gap: 4rem;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}

.ticker span::before {
  content: '▸ ';
  opacity: 0.5;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Welcome content */
.welcome-content {
  max-width: 640px;
  text-align: center;
  margin-top: 3rem;
  animation: fadeUp 1s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.detective-silhouette {
  color: var(--accent);
  opacity: 0.35;
  margin-bottom: 1.5rem;
}

.detective-silhouette svg {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.glitch-label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.welcome-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 500;
  color: #e8e8f0;
  margin-bottom: 2rem;
  line-height: 1.3;
}

.welcome-title .accent {
  color: var(--accent);
}

.welcome-text {
  text-align: left;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 2.5rem;
}

.welcome-text p + p {
  margin-top: 1rem;
}

.welcome-text strong {
  color: var(--accent);
  font-weight: 500;
}

/* Buttons */
.btn {
  position: relative;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 1rem 2.5rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.btn-primary:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 30px var(--accent-glow), inset 0 0 30px rgba(201, 162, 39, 0.05);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.1), transparent);
  transform: translateX(-100%);
  animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.btn-check {
  width: 100%;
  margin-top: 1rem;
}

.btn-check.correct {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-glow);
}

.btn-check.correct:hover {
  box-shadow: 0 0 25px var(--success-glow);
  background: rgba(61, 154, 106, 0.2);
}

.btn-check:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Scroll hint — only before quest starts */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

body.quest-started .scroll-hint {
  display: none;
}

.scroll-hint span {
  display: block;
  width: 20px;
  height: 32px;
  border: 1px solid var(--text-dim);
  border-radius: 10px;
  position: relative;
}

.scroll-hint span::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 6px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 0.3; }
}

/* ===== Step Screen ===== */
.step-header {
  text-align: center;
  margin-bottom: 2rem;
  max-width: 600px;
}

.step-badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 0.3rem 1rem;
  margin-bottom: 1rem;
}

.step-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: #e8e8f0;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.step-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Evidence card */
.evidence-card {
  position: relative;
  max-width: 560px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.evidence-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.evidence-stamp {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--danger);
  border: 2px solid var(--danger);
  padding: 0.2rem 0.5rem;
  transform: rotate(12deg);
  opacity: 0.7;
}

.evidence-text {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 2rem;
  padding-right: 3rem;
}

/* Audio block */
.audio-block {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.btn-play {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: rgba(201, 162, 39, 0.1);
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.btn-play:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: scale(1.05);
}

.btn-play.playing {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-glow);
}

.play-icon {
  margin-left: 3px;
}

.btn-play.playing .play-icon {
  margin-left: 0;
}

.audio-info {
  flex: 1;
  min-width: 0;
}

.audio-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.audio-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.audio-wave span {
  display: block;
  width: 3px;
  height: 8px;
  background: var(--accent-dim);
  border-radius: 2px;
  transition: height 0.15s ease;
}

.audio-wave.active span {
  animation: waveBar 0.8s ease-in-out infinite alternate;
}

.audio-wave.active span:nth-child(1) { animation-delay: 0s; }
.audio-wave.active span:nth-child(2) { animation-delay: 0.1s; }
.audio-wave.active span:nth-child(3) { animation-delay: 0.2s; }
.audio-wave.active span:nth-child(4) { animation-delay: 0.15s; }
.audio-wave.active span:nth-child(5) { animation-delay: 0.25s; }
.audio-wave.active span:nth-child(6) { animation-delay: 0.05s; }
.audio-wave.active span:nth-child(7) { animation-delay: 0.3s; }
.audio-wave.active span:nth-child(8) { animation-delay: 0.12s; }
.audio-wave.active span:nth-child(9) { animation-delay: 0.22s; }
.audio-wave.active span:nth-child(10) { animation-delay: 0.08s; }

@keyframes waveBar {
  0% { height: 6px; background: var(--accent-dim); }
  100% { height: 22px; background: var(--accent); }
}

/* Answer block */
.answer-block {
  position: relative;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

.answer-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.8rem 1rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.input-row .answer-input {
  width: auto;
  flex: 1;
  min-width: 0;
}

.answer-input:focus {
  border-color: var(--accent-dim);
}

.answer-input.correct {
  border-color: var(--success);
  color: var(--success);
}

.answer-input.wrong {
  border-color: var(--danger);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.btn-hint {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-hint:hover,
.btn-hint.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.hint-tooltip {
  position: absolute;
  top: -2.8rem;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--accent-dim);
  padding: 0.5rem 0.8rem;
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
  z-index: 10;
  animation: fadeUp 0.2s ease;
}

.hint-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 18px;
  width: 10px;
  height: 10px;
  background: var(--bg-panel);
  border-right: 1px solid var(--accent-dim);
  border-bottom: 1px solid var(--accent-dim);
  transform: rotate(45deg);
}

.hint-tooltip-wide {
  top: auto;
  bottom: calc(100% + 0.5rem);
  white-space: normal;
  max-width: 280px;
  line-height: 1.5;
}

.hint-tooltip-wide::after {
  bottom: -6px;
  top: auto;
}

.accent-inline {
  color: var(--accent);
  font-weight: 500;
}

/* Logo evidence */
.logo-evidence {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.cafe-logo {
  max-width: 220px;
  width: 100%;
  height: auto;
  border-radius: 4px;
  filter: sepia(0.15) contrast(1.05);
  position: relative;
  z-index: 1;
}

.coffee-stain {
  position: absolute;
  top: 20%;
  right: 15%;
  width: 80px;
  height: 80px;
  background: radial-gradient(ellipse, rgba(80, 50, 30, 0.45) 0%, rgba(80, 50, 30, 0.2) 40%, transparent 70%);
  border-radius: 50% 40% 60% 30%;
  transform: rotate(-15deg);
  z-index: 2;
  pointer-events: none;
}

.coffee-stain::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 10px;
  width: 40px;
  height: 30px;
  background: radial-gradient(ellipse, rgba(80, 50, 30, 0.3) 0%, transparent 70%);
  border-radius: 50%;
}

.logo-caption {
  margin-top: 0.8rem;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}

.task-text {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-left: 2px solid var(--accent-dim);
  background: rgba(201, 162, 39, 0.04);
}

/* Success overlay */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 80, 50, 0.92);
  animation: successFadeIn 0.4s ease;
}

.success-overlay[hidden] {
  display: none;
}

@keyframes successFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.success-flash {
  animation: greenFlash 0.8s ease;
}

@keyframes greenFlash {
  0% { background: var(--bg-deep); }
  30% { background: #0a2a1a; }
  100% { background: var(--bg-deep); }
}

.success-content {
  text-align: center;
  animation: successPop 0.5s ease 0.2s both;
}

@keyframes successPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  border: 3px solid #5fd68a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #5fd68a;
  box-shadow: 0 0 40px rgba(95, 214, 138, 0.4);
}

.success-message {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  color: #e8fff0;
  margin-bottom: 0.5rem;
}

.success-redirect {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: rgba(232, 255, 240, 0.7);
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.feedback {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.feedback.error {
  color: var(--danger);
}

.feedback.success {
  color: var(--success);
}

/* Locked step */
.screen-locked .locked-card {
  text-align: center;
  padding: 3rem 2rem;
}

.locked-text {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ===== Part 2: TV ===== */
.screen-part2 {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(40, 60, 90, 0.15) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-deep) 0%, #080810 100%);
}

.tv-block {
  width: 100%;
  max-width: 640px;
  margin-bottom: 2rem;
}

.tv-set {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tv-antenna {
  position: absolute;
  top: -28px;
  width: 3px;
  height: 36px;
  background: linear-gradient(180deg, var(--text-dim), #444);
  transform-origin: bottom center;
}

.tv-antenna-left {
  left: 28%;
  transform: rotate(-28deg);
}

.tv-antenna-right {
  right: 28%;
  transform: rotate(28deg);
}

.tv-antenna::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dim);
}

.tv-frame {
  width: 100%;
  background: linear-gradient(145deg, #2a2a32, #1a1a22);
  border-radius: 16px;
  padding: 1.2rem 1.2rem 0.8rem;
  border: 3px solid #3a3a48;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tv-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-case-label {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 3;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.75);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--accent-dim);
}

.tv-video {
  width: 92%;
  height: 88%;
  object-fit: contain;
  display: block;
}

.tv-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.tv-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 20, 40, 0.4) 100%);
  pointer-events: none;
  z-index: 2;
}

.tv-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0.4rem 0.2rem;
}

.tv-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #555, #222);
  border: 1px solid #444;
}

.tv-speaker {
  flex: 1;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    #333 0px,
    #333 3px,
    transparent 3px,
    transparent 6px
  );
  border-radius: 2px;
}

.tv-stand {
  width: 40%;
  height: 14px;
  background: linear-gradient(180deg, #2a2a32, #1a1a22);
  border-radius: 0 0 4px 4px;
  margin-top: -2px;
}

.part2-card {
  max-width: 640px;
  width: 100%;
}

.part2-text {
  padding-right: 0;
}

.cipher-label {
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

/* Letter picker drums */
.letter-picker {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.letter-drum {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.drum-arrow {
  width: 44px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--accent);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
}

.drum-arrow:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.drum-arrow:active {
  transform: scale(0.95);
}

.drum-window {
  width: 44px;
  height: 52px;
  overflow: hidden;
  border: 2px solid var(--border-glow);
  background: var(--bg-deep);
  position: relative;
}

.drum-window::before,
.drum-window::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  z-index: 1;
  pointer-events: none;
}

.drum-window::before {
  top: 0;
  background: linear-gradient(180deg, var(--bg-deep), transparent);
}

.drum-window::after {
  bottom: 0;
  background: linear-gradient(0deg, var(--bg-deep), transparent);
}

.drum-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.drum-strip::-webkit-scrollbar {
  display: none;
}

.drum-strip li {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-dim);
  scroll-snap-align: center;
  user-select: none;
}

.drum-strip li.active {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

.letter-picker.solved .drum-window {
  border-color: var(--success);
  box-shadow: 0 0 20px var(--success-glow);
}

.letter-picker.solved .drum-strip li.active {
  color: var(--success);
  text-shadow: 0 0 12px var(--success-glow);
}

.part2-hint-block {
  text-align: center;
}

.btn-hint-text {
  margin: 0 auto;
}

.hint-quote {
  position: relative;
  top: auto;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.8rem;
  font-style: italic;
  line-height: 1.6;
  text-align: center;
}

.hint-quote::after {
  display: none;
}

/* ===== Part 3: Notebook ===== */
.screen-part3 {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(60, 80, 100, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(201, 162, 39, 0.05) 0%, transparent 45%),
    var(--bg-deep);
}

.part3-card {
  max-width: 560px;
  width: 100%;
}

.part3-text {
  padding-right: 0;
}

.notebook-evidence {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  position: relative;
}

.notebook-evidence::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(80, 50, 30, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.notebook-img {
  max-width: 100%;
  width: 320px;
  height: auto;
  display: block;
  transform: rotate(-1.5deg);
  filter: sepia(0.2) contrast(1.05) brightness(0.95);
  box-shadow:
    4px 6px 20px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  border-radius: 2px;
}

.notebook-caption {
  margin-top: 0.8rem;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}

.part3-fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.part3-field {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.part3-field-locked {
  opacity: 0;
  transform: translateY(12px);
}

.part3-field-locked.unlocked {
  opacity: 1;
  transform: translateY(0);
}

.field-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

/* ===== Part 4: Timer & Neon ===== */
.screen-part4 {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(180, 60, 120, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 30%, rgba(60, 120, 200, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(201, 162, 39, 0.06) 0%, transparent 50%),
    #050508;
  min-height: 100vh;
}

.part4-timer-section {
  position: relative;
  width: 100%;
  max-width: 720px;
  text-align: center;
  padding: 2rem 1rem 3rem;
  margin-bottom: 2rem;
}

.neon-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}

.neon-glow-left {
  top: 10%;
  left: -5%;
  background: #e040a0;
}

.neon-glow-right {
  top: 20%;
  right: -5%;
  background: #4080e0;
}

.countdown-title {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  margin-bottom: 2.5rem;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}

.countdown-digit {
  font-family: 'Orbitron', var(--mono);
  font-size: clamp(2.2rem, 8vw, 3.8rem);
  font-weight: 700;
  color: #fff;
  text-shadow:
    0 0 10px rgba(255, 100, 180, 0.8),
    0 0 30px rgba(100, 150, 255, 0.5),
    0 0 60px rgba(201, 162, 39, 0.3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-top: 0.5rem;
  text-transform: uppercase;
}

.countdown-sep {
  font-family: 'Orbitron', var(--mono);
  font-size: clamp(1.8rem, 6vw, 3rem);
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 1.2rem;
  animation: colonBlink 1s step-end infinite;
}

@keyframes colonBlink {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.2; }
}

.agent-note {
  max-width: 520px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-left: 3px solid var(--accent-dim);
  text-align: left;
}

.agent-note p {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.7;
  font-style: italic;
}

.part4-card {
  max-width: 560px;
  width: 100%;
  margin-bottom: 2rem;
}

.part4-step-header {
  margin-bottom: 1rem;
}

.part4-step-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: #e8e8f0;
  font-weight: 500;
}

.part4-text {
  padding-right: 0;
}

.part4-step-locked {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.part4-step-locked.unlocked {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Part 5: Rock Archive ===== */
.screen-part5 {
  position: relative;
  background: linear-gradient(180deg, #0a080c 0%, #120e14 50%, #0a080c 100%);
  overflow: hidden;
}

.equalizer-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 0 1rem 2rem;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.equalizer-bg span {
  display: block;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), #e040a0);
  border-radius: 2px;
  animation: eqBar 0.8s ease-in-out infinite alternate;
}

@keyframes eqBar {
  0% { height: 8px; }
  100% { height: var(--eq-h, 60px); }
}

.screen-part5 > *:not(.equalizer-bg) {
  position: relative;
  z-index: 1;
}

.retro-player {
  width: 100%;
  max-width: 600px;
  margin-bottom: 2rem;
  border: 3px solid #3a3040;
  border-radius: 12px;
  background: linear-gradient(145deg, #1e1824, #121018);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.retro-player-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  background: #0a080c;
  border-bottom: 1px solid #3a3040;
}

.retro-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e040a0;
  animation: retroBlink 2s ease-in-out infinite;
}

.retro-dot:nth-child(2) {
  background: var(--accent);
  animation-delay: 0.3s;
}

@keyframes retroBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.retro-label {
  margin-left: 0.5rem;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: #a080c0;
}

.retro-display {
  padding: 1.5rem;
  background: #0d0a10;
  border: inset 2px rgba(160, 128, 192, 0.15);
}

.retro-line {
  display: block;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.retro-text {
  font-size: 0.88rem;
  color: #c8b8d8;
  line-height: 1.7;
}

.retro-vu {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
  margin-top: 1.2rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(160, 128, 192, 0.2);
}

.retro-vu span {
  flex: 1;
  background: linear-gradient(180deg, #e040a0, var(--accent));
  border-radius: 1px;
  animation: vuBar 0.6s ease-in-out infinite alternate;
}

.retro-vu span:nth-child(1) { animation-delay: 0s; }
.retro-vu span:nth-child(2) { animation-delay: 0.1s; }
.retro-vu span:nth-child(3) { animation-delay: 0.2s; }
.retro-vu span:nth-child(4) { animation-delay: 0.15s; }
.retro-vu span:nth-child(5) { animation-delay: 0.25s; }

@keyframes vuBar {
  0% { height: 6px; }
  100% { height: 28px; }
}

.part5-card {
  max-width: 560px;
  width: 100%;
  margin-bottom: 2rem;
}

.part5-step-header {
  margin-bottom: 1rem;
}

.part5-step-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: #e8e8f0;
  font-weight: 500;
}

.part5-text {
  padding-right: 0;
}

.part5-step-locked {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.part5-step-locked.unlocked {
  opacity: 1;
  transform: translateY(0);
}

.scramble-letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 1.2rem;
  background: var(--bg-panel);
  border: 1px dashed var(--accent-dim);
}

.scramble-letter {
  width: 40px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-deep);
  border: 1px solid var(--border-glow);
  animation: letterPop 0.4s ease backwards;
}

@keyframes letterPop {
  from { opacity: 0; transform: scale(0.8) rotate(-5deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.photo-evidence {
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
  padding: 0;
  border: 2px solid var(--border);
  background: var(--bg-panel);
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.photo-evidence:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 24px var(--accent-glow);
}

.osint-photo {
  width: 100%;
  height: auto;
  display: block;
  max-height: 320px;
  object-fit: cover;
}

.photo-zoom-hint {
  display: block;
  padding: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.6);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeUp 0.25s ease;
}

.photo-lightbox[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border: 1px solid var(--text-dim);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.2s;
}

.lightbox-close:hover {
  border-color: var(--accent);
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border: 2px solid var(--accent-dim);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

/* ===== Part 6: Intercity Network ===== */
.screen-part6 {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(60, 100, 160, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(201, 162, 39, 0.06) 0%, transparent 45%),
    var(--bg-deep);
}

.part6-briefing,
.part6-submit-card {
  max-width: 720px;
  width: 100%;
  margin-bottom: 2rem;
}

.part6-briefing-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.part6-text {
  padding-right: 0;
}

.nav-rules-label {
  display: block;
  color: var(--accent);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.photo-upload-block {
  position: relative;
}

.photo-upload-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.photo-upload-row .btn-upload {
  flex: 1;
  width: auto;
}

.location-card .nav-hint-tooltip {
  top: auto;
  bottom: calc(100% + 0.5rem);
  left: 0;
  right: auto;
  max-width: 100%;
  white-space: normal;
  line-height: 1.5;
  color: var(--text-dim);
}

.location-card .nav-hint-tooltip::after {
  top: auto;
  bottom: -6px;
  right: 18px;
  border-right: 1px solid var(--accent-dim);
  border-bottom: 1px solid var(--accent-dim);
  border-top: none;
  border-left: none;
}

.locations-sequence {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 2rem;
}

.location-card.location-done {
  opacity: 0.55;
  pointer-events: none;
}

.location-card.location-done .btn-submit-point {
  display: none;
}

.btn-submit-point {
  width: 100%;
  margin-top: 1rem;
}

.btn-submit-point:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 960px;
  margin-bottom: 2rem;
}

.location-card {
  display: flex;
  flex-direction: column;
}

.location-title {
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}

.location-intel {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.location-intel p + p {
  margin-top: 0.2rem;
}

.location-riddle {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
  font-style: italic;
  line-height: 1.6;
  margin: 0 0 1.2rem;
  padding: 0.8rem;
  border-left: 2px solid var(--border-glow);
  background: var(--bg-panel);
}

.btn-upload {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.8rem;
  border: 1px dashed var(--accent-dim);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-upload:hover {
  background: var(--accent-glow);
  border-style: solid;
}

.btn-upload.uploaded {
  border-color: var(--success);
  border-style: solid;
  color: var(--success);
  background: var(--success-glow);
}

.photo-preview {
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.btn-submit-report {
  width: 100%;
  margin-top: 1rem;
}

.btn-submit-report:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Verification overlay */
.verification-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(5, 5, 12, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.verification-overlay[hidden] {
  display: none;
}

.verification-content {
  max-width: 480px;
  text-align: center;
  padding: 2rem;
  border: 1px solid var(--accent-dim);
  background: var(--bg-card);
}

.verification-spinner {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.95); }
}

.verification-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .evidence-card {
    padding: 1.5rem;
  }

  .evidence-text {
    padding-right: 0;
    margin-top: 1.5rem;
  }

  .evidence-stamp {
    position: relative;
    top: auto;
    right: auto;
    display: inline-block;
    margin-bottom: 1rem;
  }

  .hint-tooltip {
    right: auto;
    left: 0;
    white-space: normal;
    max-width: 100%;
  }

  .hint-tooltip::after {
    right: auto;
    left: 18px;
  }

  .hint-tooltip-wide {
    max-width: 100%;
  }

  .letter-picker {
    gap: 0.35rem;
  }

  .drum-arrow,
  .drum-window {
    width: 38px;
  }

  .drum-strip li {
    font-size: 1.2rem;
  }

  .countdown-unit {
    min-width: 58px;
  }

  .countdown-sep {
    margin-bottom: 0.8rem;
  }
}

/* ===== Часть 7: Звёздный синод ===== */
.screen-part7 {
  position: relative;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
}

.part7-cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, #1a1035 0%, #06060f 45%, #020208 100%);
}

.cosmos-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 30% 65%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(200, 220, 255, 0.9), transparent),
    radial-gradient(1px 1px at 70% 45%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 85% 75%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 15% 85%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 45% 90%, rgba(232, 168, 124, 0.8), transparent),
    radial-gradient(1px 1px at 92% 10%, rgba(255, 255, 255, 0.7), transparent);
  animation: starsTwinkle 6s ease-in-out infinite alternate;
}

@keyframes starsTwinkle {
  from { opacity: 0.65; }
  to { opacity: 1; }
}

.cosmos-nebula {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 20% 60%, rgba(120, 40, 180, 0.15), transparent),
    radial-gradient(ellipse 40% 35% at 80% 25%, rgba(200, 80, 60, 0.12), transparent);
}

.martian-zodiac {
  position: absolute;
  top: 42%;
  left: 50%;
  width: min(72vw, 380px);
  height: min(72vw, 380px);
  transform: translate(-50%, -50%);
  animation: zodiacSpin 100s linear infinite;
}

@keyframes zodiacSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.zodiac-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(232, 168, 124, 0.35);
  box-shadow: 0 0 30px rgba(232, 100, 60, 0.15), inset 0 0 40px rgba(232, 168, 124, 0.05);
}

.zodiac-ring-inner {
  inset: 18%;
  border-color: rgba(126, 200, 227, 0.3);
  animation: zodiacSpin 70s linear infinite reverse;
}

.zodiac-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(2rem, 8vw, 3.2rem);
  color: #e85d4c;
  text-shadow: 0 0 24px rgba(232, 93, 76, 0.9), 0 0 48px rgba(232, 93, 76, 0.4);
  animation: corePulse 3s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

.zodiac-glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 1.1rem;
  color: #e8a87c;
  text-shadow: 0 0 10px rgba(232, 168, 124, 0.9);
  transform: rotate(calc(var(--i) * 30deg)) translateY(calc(-1 * min(36vw, 190px)));
  animation: glyphPulse 2.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.15s);
}

@keyframes glyphPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.cosmos-planet {
  position: absolute;
  font-size: 1.4rem;
  text-shadow: 0 0 14px currentColor;
  animation: planetOrbit 20s linear infinite;
}

.cosmos-planet-1 {
  top: 18%;
  left: 12%;
  color: #a8d8ea;
  animation-duration: 24s;
}

.cosmos-planet-2 {
  top: 22%;
  right: 10%;
  color: #ffd6e0;
  animation-duration: 18s;
  animation-direction: reverse;
}

.cosmos-planet-3 {
  bottom: 20%;
  left: 18%;
  color: #f4a261;
  animation-duration: 28s;
}

@keyframes planetOrbit {
  from { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(12px, -8px) rotate(90deg); }
  50% { transform: translate(0, -14px) rotate(180deg); }
  75% { transform: translate(-12px, -6px) rotate(270deg); }
  to { transform: translate(0, 0) rotate(360deg); }
}

.cosmos-constellation {
  position: absolute;
  width: 120px;
  height: 80px;
  opacity: 0.5;
  background:
    radial-gradient(circle, rgba(126, 200, 227, 0.9) 1.5px, transparent 2px),
    radial-gradient(circle, rgba(126, 200, 227, 0.7) 1px, transparent 1.5px);
  background-size: 40px 30px, 55px 40px;
  background-position: 0 0, 20px 15px;
  filter: drop-shadow(0 0 6px rgba(126, 200, 227, 0.6));
  animation: constellationGlow 4s ease-in-out infinite alternate;
}

.cosmos-constellation-1 { top: 12%; right: 22%; }
.cosmos-constellation-2 { bottom: 15%; right: 8%; animation-delay: 1.5s; }

@keyframes constellationGlow {
  from { opacity: 0.3; }
  to { opacity: 0.7; }
}

.part7-content {
  position: relative;
  z-index: 1;
  padding: 2rem 1rem 4rem;
  max-width: 680px;
  margin: 0 auto;
}

.part7-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.part7-badge {
  display: inline-block;
  margin-bottom: 0.6rem;
}

.part7-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 5vw, 2rem);
  letter-spacing: 0.12em;
  color: #e8a87c;
  text-shadow: 0 0 20px rgba(232, 168, 124, 0.4);
  margin: 0;
}

.part7-protocol,
.part7-manifest,
.cosmic-navigator {
  margin-bottom: 1.5rem;
  background: rgba(8, 8, 18, 0.82);
  backdrop-filter: blur(8px);
}

.part7-alert {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: #7ec8e3;
  text-shadow: 0 0 12px rgba(126, 200, 227, 0.5);
  margin-bottom: 1rem;
  text-align: center;
}

.part7-intro {
  font-size: 0.88rem;
  line-height: 1.7;
}

.part7-manifest-title {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
}

.part7-manifest-body {
  font-size: 0.84rem;
  line-height: 1.75;
  color: var(--text);
}

.part7-manifest-body p {
  margin-bottom: 1rem;
}

.part7-manifest-body em {
  color: var(--text-dim);
  font-style: italic;
}

.cosmic-nav-title {
  font-size: 0.95rem;
  color: #7ec8e3;
  text-align: center;
  margin-bottom: 0.4rem;
  letter-spacing: 0.08em;
}

.cosmic-nav-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.cosmic-picker {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cosmic-drum-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.cosmic-drum-label {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-dim);
}

.cosmic-drum .drum-window {
  width: 56px;
  border-color: rgba(126, 200, 227, 0.4);
  box-shadow: 0 0 16px rgba(126, 200, 227, 0.1);
}

.cosmic-drum-wide .drum-window {
  width: 108px;
}

.cosmic-drum .drum-strip li {
  font-size: 1rem;
}

.cosmic-drum-wide .drum-strip li {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.cosmic-drum .drum-arrow {
  color: #7ec8e3;
  border-color: rgba(126, 200, 227, 0.35);
}

.cosmic-picker.cosmic-solved .drum-window {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(61, 154, 106, 0.35);
}

.cosmic-picker.cosmic-solved .drum-strip li.active {
  color: var(--success);
}

.cosmic-feedback {
  text-align: center;
  margin-top: 1rem;
}

body.cosmic-freeze .part7-content {
  pointer-events: none;
  animation: cosmicFlash 1.6s ease;
}

@keyframes cosmicFlash {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.6); }
  100% { filter: brightness(1); }
}

/* ===== Экран победы ===== */
.screen-victory {
  position: relative;
  min-height: 100vh;
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 220, 150, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 180, 120, 0.15) 0%, transparent 50%),
    linear-gradient(165deg, #2a1810 0%, #4a2c1a 35%, #3d2218 70%, #1a0f0a 100%);
  z-index: 2;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.victory-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px solid rgba(255, 220, 150, 0.35);
  background: rgba(30, 18, 12, 0.75);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 60px rgba(255, 180, 100, 0.15);
  animation: victoryReveal 1s ease both;
}

@keyframes victoryReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.victory-stamp {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: #c9a227;
  border: 1px solid rgba(201, 162, 39, 0.5);
  padding: 0.3rem 0.8rem;
  margin-bottom: 1rem;
}

.victory-title {
  font-family: var(--display);
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  color: #ffe8c8;
  letter-spacing: 0.1em;
  margin: 0 0 1.2rem;
  text-shadow: 0 0 24px rgba(255, 200, 120, 0.4);
}

.victory-lead {
  font-family: var(--display);
  font-size: 0.9rem;
  color: #7ec8e3;
  letter-spacing: 0.06em;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.victory-text {
  font-size: 0.88rem;
  line-height: 1.75;
  color: #e8d5c4;
  margin-bottom: 1.5rem;
}

.victory-wedding {
  font-family: var(--display);
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  color: #ffd6a5;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(255, 200, 120, 0.35);
}

.victory-date {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 1.5rem;
}

.victory-date strong {
  color: #c9a227;
  font-size: 1.25rem;
}

.victory-footer {
  font-size: 0.82rem;
  line-height: 1.7;
  color: #c4a88a;
}

@media (max-width: 480px) {
  .part7-content {
    padding: 1.5rem 0.75rem 3rem;
  }

  .martian-zodiac {
    opacity: 0.45;
  }

  .cosmic-drum .drum-window {
    width: 48px;
  }

  .cosmic-drum-wide .drum-window {
    width: 92px;
  }
}

/* ===== Quest hub ===== */
.quest-instance[hidden] {
  display: none !important;
}

.quest-hub {
  min-height: calc(100vh - 3rem);
  padding: 1.5rem 1rem 4rem;
}

.quest-hub-content {
  max-width: 720px;
  margin: 0 auto;
}

.quest-hub-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.quest-hub-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin: 0 0 0.5rem;
  color: var(--text);
}

.quest-hub-lead {
  color: var(--text-dim);
  margin: 0 0 1.75rem;
  line-height: 1.6;
}

.quest-hub-list {
  display: grid;
  gap: 1rem;
}

.quest-hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  background: rgba(12, 12, 24, 0.85);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.quest-hub-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(61, 154, 106, 0.12);
}

.quest-hub-card-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
}

.quest-hub-card-title {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--text);
}

.quest-hub-card-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.quest-hub-card-action {
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}

.quest-hub-empty,
.quest-hub-loading {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 1rem 0;
}

.screen-104 .welcome-title {
  font-size: clamp(1.35rem, 3.5vw, 2rem);
}

.quest-104-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ===== Admin quest toggles ===== */
.admin-quests-card {
  margin-bottom: 1.5rem;
}

.admin-quests-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.admin-quests-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-quest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: rgba(8, 8, 18, 0.6);
}

.admin-quest-row.quest-toggle-off {
  opacity: 0.72;
}

.admin-quest-info {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}

.admin-quest-badge {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border);
}

.admin-quest-title {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.admin-quest-sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.quest-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  cursor: pointer;
  flex-shrink: 0;
}

.quest-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.quest-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(80, 80, 100, 0.5);
  border-radius: 12px;
  transition: background 0.2s;
}

.quest-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ccc;
  border-radius: 50%;
  transition: transform 0.2s;
}

.quest-toggle-input:checked + .quest-toggle-slider {
  background: rgba(61, 154, 106, 0.55);
}

.quest-toggle-input:checked + .quest-toggle-slider::after {
  transform: translateX(20px);
  background: var(--accent);
}

.quest-toggle-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.admin-stage-cell {
  min-width: 180px;
}

.progress-badge-line {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.45rem;
}

.progress-badge-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.progress-badge-line:last-child {
  margin-bottom: 0;
}

.progress-quest-tag {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .admin-app {
    --admin-panel-width: calc(100vw - 2rem);
    padding: 1.25rem 1rem 3rem;
  }

  .admin-app .evidence-card {
    padding: 1.5rem 1.25rem;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-quest-row {
    flex-direction: column;
    align-items: stretch;
  }

  .quest-toggle {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .quest-back-btn {
    font-size: 0.6rem !important;
  }
}

/* ===== Delo 104 · Радиоперехват ===== */
.screen-104-part {
  padding: 1.5rem 1rem 4rem;
}

.step-header-104 {
  max-width: 820px;
  margin: 0 auto 1.25rem;
}

.radio-telescope-wrap {
  max-width: 820px;
  margin: 0 auto;
}

.radio-telescope-panel {
  position: relative;
  border: 3px solid #4a4035;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #2a2418 0%, #1a1610 100%);
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.6),
    0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.radio-panel-stains {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90px 70px at 78% 22%, rgba(101, 67, 33, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 60px 45px at 12% 88%, rgba(80, 55, 28, 0.28) 0%, transparent 70%),
    radial-gradient(ellipse 40px 30px at 55% 60%, rgba(90, 60, 30, 0.15) 0%, transparent 70%);
}

.radio-panel-pie {
  position: absolute;
  top: 0.65rem;
  right: 0.85rem;
  font-size: 1.75rem;
  transform: rotate(-12deg);
  filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.5));
  z-index: 2;
}

.radio-panel-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #c4a574;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.radio-panel-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3d9a6a;
  box-shadow: 0 0 8px #3d9a6a;
  animation: radio-led-blink 2s ease-in-out infinite;
}

@keyframes radio-led-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.radio-panel-time {
  margin-left: auto;
  color: #e8c878;
}

.radio-panel-screen {
  position: relative;
  border: 2px inset #3d3528;
  background: #0a1208;
  padding: 1rem 1.1rem;
  min-height: 220px;
  box-shadow: inset 0 0 24px rgba(61, 154, 106, 0.08);
  z-index: 1;
}

.radio-panel-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(61, 154, 106, 0.04) 3px, rgba(61, 154, 106, 0.04) 4px);
  pointer-events: none;
}

.radio-briefing {
  position: relative;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: #7fd99a;
  text-shadow: 0 0 6px rgba(61, 154, 106, 0.35);
  margin: 0 0 0.85rem;
}

.radio-briefing-mission {
  color: #a8e8b8;
  border-top: 1px dashed rgba(61, 154, 106, 0.25);
  padding-top: 0.75rem;
}

.radio-panel-controls {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  position: relative;
  z-index: 1;
}

.radio-knob {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #5a5040;
  background: radial-gradient(circle at 35% 35%, #6a6050, #2a2418);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.5);
}

.radio-knob-active {
  border-color: #c9a227;
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.4);
}

.answer-block-104 {
  padding: 0 0.25rem;
}

.answer-input-radio {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  max-width: 200px;
}

#screen-104-p1-2 {
  position: relative;
}

.radio-signal-card {
  position: relative;
  overflow: hidden;
}

.radio-static-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 2px,
      rgba(255, 255, 255, 0.03) 2px,
      rgba(255, 255, 255, 0.03) 4px
    );
  opacity: 0.85;
  transition: opacity 1.2s ease;
}

.radio-static-overlay.clearing {
  animation: static-fade 1.2s ease forwards;
}

@keyframes static-fade {
  to { opacity: 0; }
}

#screen-104-p1-2.radio-signal-locking .radio-signal-card {
  filter: contrast(1.2) brightness(0.7);
}

#screen-104-p1-2.radio-signal-clear .radio-signal-card {
  filter: none;
}

.audio-block-104 {
  margin-bottom: 1rem;
}

.morse-block {
  margin-top: 1.5rem;
  text-align: center;
}

.morse-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.morse-hint-text {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin: 0;
}

.hint-tooltip-morse {
  max-width: 360px;
  text-align: left;
  margin: 0 auto 1rem;
}

.hint-tooltip-morse code {
  font-family: var(--mono);
  color: var(--accent);
}

.morse-codes-ref {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.morse-codes-ref p {
  margin: 0;
}

.morse-codes-ref strong {
  color: var(--accent);
}

.evidence-text-highlight {
  font-size: 1rem;
  color: #e8d5a8;
}

.transmission-banner {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3d9a6a;
  text-align: center;
  padding: 0.55rem 0.75rem;
  margin: 0 0 1rem;
  border: 1px solid rgba(61, 154, 106, 0.35);
  background: rgba(61, 154, 106, 0.08);
  animation: transmission-pulse 2.4s ease-in-out infinite;
}

@keyframes transmission-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.corrupted-audio-file {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  border: 2px dashed rgba(201, 162, 39, 0.45);
  background: rgba(20, 16, 10, 0.55);
}

.corrupted-audio-icon {
  font-size: 2rem;
  line-height: 1;
  opacity: 0.85;
  flex-shrink: 0;
}

.corrupted-audio-meta {
  flex: 1;
  min-width: 0;
}

.corrupted-audio-name {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.corrupted-audio-status {
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #e8a040;
  margin-bottom: 0.65rem;
}

.corrupted-audio-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
}

.corrupted-audio-wave span {
  flex: 1;
  max-width: 8px;
  background: linear-gradient(180deg, #c9a227 0%, #6a5020 100%);
  border-radius: 2px;
  animation: corrupted-wave 1.1s ease-in-out infinite;
  opacity: 0.55;
}

.corrupted-audio-wave span:nth-child(3n) { animation-delay: 0.1s; height: 45%; }
.corrupted-audio-wave span:nth-child(3n+1) { animation-delay: 0.25s; height: 75%; }
.corrupted-audio-wave span:nth-child(3n+2) { animation-delay: 0.4s; height: 30%; }

@keyframes corrupted-wave {
  0%, 100% { transform: scaleY(0.6); opacity: 0.4; }
  50% { transform: scaleY(1.15); opacity: 0.85; }
}

.informant-quote {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-dim);
  font-style: italic;
  background: rgba(0, 0, 0, 0.2);
}

.analyst-alert {
  margin-bottom: 1.25rem;
}

.btn-download-secret {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.geo-answer-block {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.route-card {
  overflow: hidden;
}

.route-map-panel {
  margin: 1.25rem 0;
  border: 2px solid #3d3528;
  border-radius: 6px;
  background: #0a0e14;
  overflow: hidden;
}

.route-map-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8aa0b8;
  border-bottom: 1px solid rgba(80, 90, 110, 0.35);
  background: rgba(0, 0, 0, 0.35);
}

.route-map-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4a9fd4;
  box-shadow: 0 0 6px #4a9fd4;
  animation: route-led-pulse 2s ease-in-out infinite;
}

@keyframes route-led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.route-map-progress {
  margin-left: auto;
  color: #3d9a6a;
}

.route-map-wrap {
  padding: 0.75rem;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(60, 120, 180, 0.08) 0%, transparent 55%),
    #070b10;
}

.route-map-svg {
  display: block;
  width: 100%;
  height: auto;
}

.route-map-path {
  filter: drop-shadow(0 0 4px rgba(61, 154, 106, 0.45));
  transition: stroke-dashoffset 0.65s ease;
}

.route-map-dot {
  fill: #c9a227;
  filter: drop-shadow(0 0 6px rgba(201, 162, 39, 0.7));
  transition: cx 0.65s ease, cy 0.65s ease;
}

.route-marker {
  fill: #6a7588;
  stroke: #1a1f28;
  stroke-width: 2;
}

.route-marker-start {
  fill: #9a3d3d;
}

.route-marker-end {
  fill: #3d9a6a;
}

.route-marker-label {
  font-family: var(--mono);
  font-size: 9px;
  fill: #8aa0b8;
  text-anchor: middle;
}

.route-transcript {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.route-segment {
  margin: 0;
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-dim);
  border-left: 3px solid rgba(80, 90, 110, 0.45);
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 0.35s, background 0.35s, color 0.35s;
}

.route-segment-read {
  border-left-color: #3d9a6a;
  background: rgba(61, 154, 106, 0.06);
  color: var(--text);
}

.route-segment-final {
  font-style: italic;
  opacity: 0.9;
}

.route-address-form {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.route-address-lead {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 1rem;
}

.route-address-fields {
  display: grid;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  max-width: 420px;
}

.route-input-short {
  max-width: 120px;
}

@media (min-width: 520px) {
  .route-address-fields {
    grid-template-columns: 1fr 100px 100px;
    grid-template-rows: auto auto;
    align-items: end;
  }

  .route-address-fields .field-label:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  .route-address-fields #answer-104-street { grid-column: 1; grid-row: 2; }
  .route-address-fields .field-label:nth-of-type(2) { grid-column: 2; grid-row: 1; }
  .route-address-fields #answer-104-house { grid-column: 2; grid-row: 2; }
  .route-address-fields .field-label:nth-of-type(3) { grid-column: 3; grid-row: 1; }
  .route-address-fields #answer-104-building { grid-column: 3; grid-row: 2; }
}

.morse-input-window {
  max-width: 320px;
  margin: 0 auto 1.25rem;
  border: 2px solid #4a4035;
  border-radius: 6px;
  background: linear-gradient(180deg, #2a2418 0%, #1a1610 100%);
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.morse-window-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c4a574;
  border-bottom: 1px solid #3d3528;
  background: rgba(0, 0, 0, 0.25);
}

.morse-window-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3d9a6a;
  box-shadow: 0 0 6px #3d9a6a;
  flex-shrink: 0;
}

.morse-window-title {
  flex: 1;
}

.morse-window-letter {
  color: #e8c878;
  white-space: nowrap;
}

.morse-window-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.75rem;
  background: #0a1208;
  min-height: 88px;
}

.morse-tape {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.45rem;
  width: 100%;
  min-height: 3rem;
}

.morse-tape-empty {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(127, 217, 154, 0.45);
  text-align: center;
  line-height: 1.5;
}

.morse-tape-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0.15rem 0.35rem;
  font-family: var(--mono);
  font-size: 1.45rem;
  line-height: 1;
  color: #a8ffbf;
  text-shadow: 0 0 10px rgba(61, 154, 106, 0.45);
  border: 1px solid rgba(61, 154, 106, 0.25);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
}

.morse-tape-symbol-new {
  animation: morse-tape-pop 0.35s ease;
  border-color: rgba(127, 217, 154, 0.55);
  box-shadow: 0 0 12px rgba(61, 154, 106, 0.25);
}

@keyframes morse-tape-pop {
  0% { transform: scale(0.6); opacity: 0.4; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

.morse-input-window.morse-window-done .morse-tape-symbol {
  color: #3d9a6a;
  border-color: rgba(61, 154, 106, 0.45);
}

.morse-input-window.morse-window-done .morse-window-led {
  background: #c9a227;
  box-shadow: 0 0 6px #c9a227;
}

.morse-tap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  max-width: min(68vw, 220px);
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  padding: 1rem;
  font-family: var(--display);
  font-size: clamp(0.82rem, 3.2vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #e53935 0%, #b71c1c 55%, #7f0000 100%);
  border: 4px solid #ff6b6b;
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 8px 0 #5a0000,
    0 14px 28px rgba(211, 47, 47, 0.4),
    inset 0 -4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.08s, box-shadow 0.08s;
  touch-action: none;
  user-select: none;
}

.morse-tap-label {
  display: block;
  text-align: center;
  pointer-events: none;
}

.morse-tap-btn:hover {
  filter: brightness(1.08);
}

.morse-tap-btn.pressed,
.morse-tap-btn:active {
  transform: translateY(5px) scale(0.98);
  box-shadow:
    0 3px 0 #5a0000,
    0 6px 16px rgba(211, 47, 47, 0.3),
    inset 0 -2px 8px rgba(0, 0, 0, 0.2);
}

.morse-tap-btn.morse-shock {
  animation: morse-shock 0.5s ease;
  border-color: #ffeb3b;
}

@keyframes morse-shock {
  0%, 100% { filter: none; }
  25%, 75% { filter: brightness(2) hue-rotate(-30deg); }
  50% { filter: brightness(0.5); }
}

.morse-tap-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.morse-success {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(61, 154, 106, 0.45);
  background: rgba(61, 154, 106, 0.08);
}

.morse-success-title {
  font-family: var(--display);
  font-size: 1.1rem;
  color: #3d9a6a;
  margin: 0 0 0.5rem;
}

.morse-success-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}

/* ===== Delo 104 · Часть 3 · Штурм ===== */
.tactical-tablet {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  border: 3px solid #2a3540;
  border-radius: 8px;
  background:
    linear-gradient(165deg, #1a2228 0%, #0d1218 45%, #141c24 100%);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.55),
    0 16px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(100, 140, 180, 0.12);
  overflow: hidden;
}

.tactical-tablet-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 40, 40, 0.03) 2px,
      rgba(255, 40, 40, 0.03) 4px
    );
}

.tactical-laser {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff4444 0%, rgba(255, 0, 0, 0.4) 45%, transparent 70%);
  box-shadow: 0 0 12px #ff2222, 0 0 24px rgba(255, 0, 0, 0.5);
  animation: tactical-laser-blink 1.2s ease-in-out infinite;
}

.tactical-laser::before,
.tactical-laser::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 60, 60, 0.85), transparent);
  transform-origin: left center;
}

.tactical-laser-1 {
  top: 22%;
  left: 18%;
  animation-delay: 0s;
}

.tactical-laser-1::before { transform: rotate(-18deg); }
.tactical-laser-1::after { transform: rotate(142deg); width: 90px; }

.tactical-laser-2 {
  top: 55%;
  right: 14%;
  animation-delay: 0.4s;
}

.tactical-laser-2::before { transform: rotate(210deg); width: 100px; }

.tactical-laser-3 {
  bottom: 20%;
  left: 42%;
  animation-delay: 0.75s;
}

.tactical-laser-3::before { transform: rotate(-35deg); width: 80px; }

@keyframes tactical-laser-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.tactical-tablet-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8ab4d4;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(100, 140, 180, 0.2);
  position: relative;
  z-index: 3;
}

.tactical-tablet-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 8px #e53935;
  animation: radio-led-blink 1.1s ease-in-out infinite;
}

.tactical-tablet-status {
  margin-left: auto;
  color: #ff6b6b;
  font-weight: 700;
}

.tactical-tablet-body {
  position: relative;
  z-index: 1;
  padding: 1.25rem 1.35rem 1.5rem;
}

.tactical-radio-chatter {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: rgba(138, 180, 212, 0.45);
  margin: 0 0 1rem;
  font-style: italic;
}

.tactical-headline {
  font-family: var(--display);
  font-size: clamp(1rem, 4vw, 1.25rem);
  letter-spacing: 0.06em;
  color: #7ec8ff;
  text-shadow: 0 0 12px rgba(126, 200, 255, 0.35);
  margin: 0 0 1rem;
}

.tactical-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-dim);
  margin: 0 0 0.85rem;
}

.tactical-alert {
  color: #ffb4b4;
  border-left: 3px solid #e53935;
  padding-left: 0.85rem;
  margin-bottom: 1.25rem;
}

.tactical-tablet-body .btn-primary {
  margin-top: 0.5rem;
}

.lock-card {
  max-width: 820px;
  margin: 0 auto;
}

.lock-panel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem 0 0.75rem;
}

.lock-panel {
  position: relative;
  width: min(100%, 280px);
  padding: 1.35rem 1.1rem 1.1rem;
  border-radius: 10px;
  background:
    linear-gradient(145deg, #4a4f56 0%, #2c3036 35%, #1e2228 100%);
  border: 3px solid #5a6068;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.08),
    inset 0 -6px 16px rgba(0, 0, 0, 0.45),
    0 12px 28px rgba(0, 0, 0, 0.45);
}

.lock-panel-screws {
  position: absolute;
  inset: 8px;
  pointer-events: none;
  background:
    radial-gradient(circle 4px at 0 0, #888 0%, #555 60%, transparent 65%),
    radial-gradient(circle 4px at 100% 0, #888 0%, #555 60%, transparent 65%),
    radial-gradient(circle 4px at 0 100%, #888 0%, #555 60%, transparent 65%),
    radial-gradient(circle 4px at 100% 100%, #888 0%, #555 60%, transparent 65%);
}

.lock-display-wrap {
  margin-bottom: 1rem;
  text-align: center;
}

.lock-display-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: #8a9098;
  margin-bottom: 0.35rem;
}

.lock-display {
  font-family: var(--mono);
  font-size: 1.65rem;
  letter-spacing: 0.35em;
  padding: 0.55rem 0.75rem;
  color: #ff3b30;
  text-shadow: 0 0 10px rgba(255, 59, 48, 0.55);
  background: #0a0c0e;
  border: 2px inset #1a1e22;
  border-radius: 4px;
  box-shadow: inset 0 0 18px rgba(255, 59, 48, 0.12);
  transition: color 0.2s, text-shadow 0.2s;
}

.lock-display-filled {
  color: #ff6b35;
}

.lock-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.lock-key {
  aspect-ratio: 1.35;
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: #e8eaed;
  background: linear-gradient(180deg, #5c636b 0%, #3a4048 100%);
  border: 2px solid #6a7179;
  border-radius: 6px;
  box-shadow:
    0 3px 0 #252930,
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s;
}

.lock-key:hover:not(:disabled) {
  filter: brightness(1.1);
}

.lock-key:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 #252930,
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lock-key:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lock-key-clear {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: #ffb4b4;
}

.lock-key-hint {
  font-size: 1.25rem;
  color: #ffd54f;
  background: linear-gradient(180deg, #6a5a30 0%, #4a3f22 100%);
  border-color: #8a7840;
}

.lock-hint-reveal {
  margin-top: 0.85rem;
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: #ffd54f;
  text-shadow: 0 0 12px rgba(255, 213, 79, 0.35);
  animation: lock-hint-pop 0.35s ease;
}

@keyframes lock-hint-pop {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.lock-panel-shake {
  animation: lock-shake 0.45s ease;
}

@keyframes lock-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.lock-panel-open {
  border-color: #3d9a6a;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.08),
    inset 0 -6px 16px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(61, 154, 106, 0.35);
}

.lock-panel-open .lock-display {
  color: #3d9a6a;
  text-shadow: 0 0 10px rgba(61, 154, 106, 0.55);
}

/* ===== Delo 104 · Взлом двери ===== */
.breach-overlay-104 {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050608;
  overflow: hidden;
  pointer-events: none;
}

.breach-overlay-104.breach-active {
  pointer-events: auto;
}

.breach-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background:
    linear-gradient(90deg, #1a1e24 0%, #3a424c 18%, #2a3038 50%, #1e2228 100%);
  border: 3px solid #5a6470;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  z-index: 2;
  transition: transform 1.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.breach-door-left {
  left: 0;
  transform-origin: left center;
  border-right: 2px solid #6a7480;
}

.breach-door-right {
  right: 0;
  transform-origin: right center;
  border-left: 2px solid #6a7480;
}

.breach-overlay-104.breach-open .breach-door-left {
  transform: translateX(-102%) rotateY(18deg);
}

.breach-overlay-104.breach-open .breach-door-right {
  transform: translateX(102%) rotateY(-18deg);
}

.breach-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 230, 150, 0.95) 0%, rgba(255, 180, 80, 0.4) 35%, transparent 70%);
  opacity: 0;
  z-index: 1;
  transition: opacity 0.6s ease 0.5s;
}

.breach-overlay-104.breach-open .breach-light {
  opacity: 1;
}

.breach-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  z-index: 5;
  pointer-events: none;
}

.breach-overlay-104.breach-flash .breach-flash {
  animation: breach-flash-pulse 0.55s ease-out forwards;
}

@keyframes breach-flash-pulse {
  0% { opacity: 0; }
  15% { opacity: 0.95; }
  100% { opacity: 0; }
}

.breach-burst {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.breach-pixel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px;
  background: #ff3b30;
  box-shadow: 0 0 12px #ff6b35;
  opacity: 0;
}

.breach-overlay-104.breach-bursting .breach-pixel:nth-child(1) { animation: breach-pixel 0.7s ease-out 0.05s forwards; --bx: -120px; --by: -80px; }
.breach-overlay-104.breach-bursting .breach-pixel:nth-child(2) { animation: breach-pixel 0.75s ease-out 0.08s forwards; --bx: 90px; --by: -110px; background: #ffd54f; }
.breach-overlay-104.breach-bursting .breach-pixel:nth-child(3) { animation: breach-pixel 0.65s ease-out 0.02s forwards; --bx: -60px; --by: 100px; background: #7ec8ff; }
.breach-overlay-104.breach-bursting .breach-pixel:nth-child(4) { animation: breach-pixel 0.8s ease-out 0.1s forwards; --bx: 140px; --by: 40px; }
.breach-overlay-104.breach-bursting .breach-pixel:nth-child(5) { animation: breach-pixel 0.72s ease-out 0.04s forwards; --bx: -150px; --by: 20px; background: #3d9a6a; }
.breach-overlay-104.breach-bursting .breach-pixel:nth-child(6) { animation: breach-pixel 0.68s ease-out 0.06s forwards; --bx: 30px; --by: 130px; background: #ffd54f; }
.breach-overlay-104.breach-bursting .breach-pixel:nth-child(7) { animation: breach-pixel 0.78s ease-out 0.03s forwards; --bx: -90px; --by: -130px; }
.breach-overlay-104.breach-bursting .breach-pixel:nth-child(8) { animation: breach-pixel 0.7s ease-out 0.09s forwards; --bx: 110px; --by: -50px; background: #7ec8ff; }

@keyframes breach-pixel {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--bx), var(--by)) scale(0.2); }
}

.breach-caption {
  position: relative;
  z-index: 6;
  font-family: var(--display);
  font-size: clamp(1rem, 4.5vw, 1.45rem);
  letter-spacing: 0.14em;
  color: #ffe8a0;
  text-shadow: 0 0 20px rgba(255, 200, 80, 0.6);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease 0.9s, transform 0.5s ease 0.9s;
}

.breach-overlay-104.breach-open .breach-caption {
  opacity: 1;
  transform: scale(1);
}

/* ===== Delo 104 · Финальные титры ===== */
body.quest-104-final-active {
  overflow: hidden;
}

.screen-104-final {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 162, 39, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(126, 200, 255, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #0a0e14 0%, #121820 40%, #0d1018 100%);
  z-index: 400;
}

.screen-104-final[hidden] {
  display: none !important;
}

.credits-104-viewport {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.credits-104-viewport::before,
.credits-104-viewport::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 18vh;
  z-index: 2;
  pointer-events: none;
}

.credits-104-viewport::before {
  top: 0;
  background: linear-gradient(to bottom, #0a0e14 0%, rgba(10, 14, 20, 0.85) 45%, transparent 100%);
}

.credits-104-viewport::after {
  bottom: 0;
  background: linear-gradient(to top, #0d1018 0%, rgba(13, 16, 24, 0.85) 45%, transparent 100%);
}

.credits-104-track {
  width: 100%;
  will-change: transform;
}

.credits-104-spacer-top {
  height: 18vh;
}

.credits-104-spacer-bottom {
  height: 38vh;
}

.credits-104-wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.credits-104-hero {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}

.credits-104-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: #ffd54f;
  margin: 0 0 0.75rem;
}

.credits-104-quote-lost {
  border-left-color: #e57373;
  background: rgba(229, 115, 115, 0.08);
  color: #e8d0d0;
}

.credits-104-static {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(138, 180, 212, 0.55);
  font-style: normal;
}

.credits-104-curator-alert {
  border-color: rgba(229, 115, 115, 0.35);
  background: rgba(229, 115, 115, 0.06);
}

.credits-104-curator-alert .credits-104-curator-badge {
  color: #e57373;
}

.credits-104-title {
  font-family: var(--display);
  font-size: clamp(1.15rem, 4.5vw, 1.65rem);
  letter-spacing: 0.08em;
  color: #ffe8c8;
  text-shadow: 0 0 20px rgba(255, 200, 120, 0.35);
  margin: 0 0 1rem;
  line-height: 1.35;
}

.credits-104-lead {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0;
}

.credits-104-quote {
  margin: 0 0 1.75rem;
  padding: 1rem 1.15rem;
  border-left: 3px solid #ffd54f;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #e8dcc8;
  font-style: italic;
  background: rgba(255, 213, 79, 0.06);
}

.credits-104-curator {
  margin-bottom: 2rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.06);
}

.credits-104-curator-badge {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: #c9a227;
  margin: 0 0 0.75rem;
}

.credits-104-curator-text {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-dim);
  margin: 0;
}

.credits-104-roll {
  margin-bottom: 2rem;
}

.credits-104-section-title {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8ab4d4;
  margin: 0 0 0.85rem;
  padding-top: 0.5rem;
}

.credits-104-actors-title {
  margin-top: 1.75rem;
  color: #ffd54f;
}

.credits-104-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.credits-104-list li {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #c8d0d8;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.credits-104-list li .credits-role {
  display: inline-block;
  min-width: 7.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6a8098;
}

.credits-104-agents li {
  color: #ffe8a0;
  font-family: var(--display);
  letter-spacing: 0.04em;
}

.credits-104-loading {
  color: var(--text-dim);
  font-style: italic;
}

.credits-104-signoff {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: rgba(138, 180, 212, 0.85);
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px dashed rgba(138, 180, 212, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  body.quest-104-final-active {
    overflow: auto;
  }

  .screen-104-final {
    position: relative;
    inset: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    z-index: 2;
  }

  .credits-104-viewport {
    overflow: visible;
    height: auto;
  }

  .credits-104-viewport::before,
  .credits-104-viewport::after {
    display: none;
  }

  .credits-104-spacer-top,
  .credits-104-spacer-bottom {
    display: none;
  }
}
