:root {
  --game-bg: #020303;
  --game-panel: rgba(10, 12, 14, .78);
  --game-border: rgba(0, 255, 106, .22);
  --game-pink: #ff4fd8;
  --game-text: #f5f5f7;
  --game-dim: rgba(245, 245, 247, .68);
  --green: #00ff6a;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

.interrogation-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 79, 216, .12), transparent 28%),
    radial-gradient(circle at 78% 12%, rgba(0, 255, 106, .12), transparent 28%),
    var(--game-bg);
  color: var(--game-text);
  overflow-x: hidden;
}

.interrogation-page [hidden] {
  display: none !important;
}

#interrogationRain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .16;
  pointer-events: none;
  z-index: 0;
}

.game-nav,
.game-hero,
.game-shell,
.result-shell {
  position: relative;
  z-index: 1;
}

.game-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 54px);
  background: linear-gradient(180deg, rgba(0, 0, 0, .82), transparent);
}

.game-logo,
.game-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--game-text);
  font-weight: 800;
  text-decoration: none;
}

.game-logo .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

.game-back {
  color: var(--game-dim);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 12px;
  text-transform: uppercase;
}

.game-hero {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 128px 0 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: clamp(28px, 5vw, 58px);
  align-items: center;
}

.game-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--green);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 12px;
  text-transform: uppercase;
}

.game-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.game-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(48px, 7vw, 94px);
  line-height: .96;
}

.game-hero-copy > p {
  max-width: 650px;
  margin: 0 0 22px;
  color: var(--game-dim);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.62;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 255, 106, .06);
  color: rgba(245, 245, 247, .76);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 12px;
}

.interrogation-art {
  position: relative;
  min-height: 360px;
  border: 0;
  border-radius: 26px;
  overflow: hidden;
  background: rgba(0, 0, 0, .5);
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, .7),
    0 28px 90px rgba(0, 0, 0, .44);
}

.compact-art {
  max-height: 440px;
}

.interrogation-art img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.04);
}

.interrogation-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .58));
}

.art-scanline {
  position: absolute;
  inset: -60% 0 auto;
  height: 48%;
  background: linear-gradient(180deg, transparent, rgba(0, 255, 106, .14), transparent);
  mix-blend-mode: screen;
  animation: scanSweep 5.8s ease-in-out infinite;
}

.art-question {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  display: grid;
  width: min(80%, 310px);
  justify-items: center;
  gap: 10px;
  padding: 22px 18px;
  background: linear-gradient(145deg, rgba(3, 12, 9, .82), rgba(3, 9, 12, .64));
  box-shadow: 0 22px 54px rgba(0, 0, 0, .42), 0 0 42px rgba(0, 255, 106, .13);
  transform: translate(-50%, -50%);
  text-align: center;
  backdrop-filter: blur(9px);
}

.art-question > span {
  color: var(--green);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 12px;
  letter-spacing: .18em;
}

.art-question > strong {
  color: var(--game-text);
  font-size: clamp(19px, 2.2vw, 27px);
  line-height: 1.12;
}

.art-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
  background: var(--green);
  color: #001408;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 0 0 0 rgba(0, 255, 106, 0), 0 0 28px rgba(0, 255, 106, .34);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-radius .22s var(--ease);
}

.art-play:hover,
.art-play:focus-visible {
  border-radius: 999px;
  box-shadow: 0 0 0 8px rgba(0, 255, 106, .1), 0 0 48px rgba(0, 255, 106, .72);
  outline: none;
  transform: translateY(-2px);
}

.game-shell,
.result-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 112px 0 72px;
}

.game-topline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.game-topline span {
  color: var(--green);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 13px;
}

.progress {
  grid-column: 1 / -1;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--game-pink));
  box-shadow: 0 0 24px rgba(0, 255, 106, .35);
  transition: width .24s var(--ease);
}

.click-map-wrap {
  margin-bottom: 18px;
  padding: 14px 16px 18px;
  border: 1px solid rgba(0, 255, 106, .18);
  border-radius: 22px;
  background: rgba(0, 0, 0, .38);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .28);
}

.click-map-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--game-text);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 12px;
}

.click-map-head span {
  color: rgba(245, 245, 247, .54);
}

.click-map {
  position: relative;
  height: 156px;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  background: #020504;
}

.click-map::before,
.click-map::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.click-map::before {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 255, 106, .2), transparent 42%),
    linear-gradient(90deg, rgba(0, 0, 0, .76), rgba(0, 0, 0, .22) 45%, rgba(0, 0, 0, .78)),
    linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, .72)),
    url("/assets/vysluch-map-agent-bg.webp") center 43% / cover no-repeat;
  filter: saturate(1.15) contrast(1.08);
  opacity: .74;
}

.click-map::after {
  z-index: 1;
  background:
    repeating-linear-gradient(90deg, rgba(0, 255, 106, .14) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(180deg, rgba(0, 255, 106, .08) 0 1px, transparent 1px 13px),
    radial-gradient(circle at 78% 28%, rgba(255, 79, 216, .18), transparent 24%);
  mix-blend-mode: screen;
  opacity: .42;
  animation: mapCodeDrift 13s linear infinite;
}

#mapLines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(0, 255, 106, .28));
}

#mapLines path {
  fill: none;
  stroke: rgba(0, 255, 106, .42);
  stroke-width: .82;
  stroke-linecap: round;
  stroke-dasharray: 1.4 3.8;
  animation: routeFlow 4.8s linear infinite;
}

#mapLines path:nth-child(3n) {
  stroke: rgba(255, 79, 216, .34);
}

#mapLines path:nth-child(4n) {
  stroke-width: .48;
  opacity: .72;
}

.map-node {
  position: absolute;
  z-index: 4;
  left: var(--x);
  top: var(--y);
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 255, 106, .52);
  border-radius: 50%;
  background: rgba(0, 255, 106, .12);
  color: var(--game-text);
  cursor: pointer;
  transform: translate(-50%, -50%);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 10px;
  box-shadow: 0 0 20px rgba(0, 255, 106, .16);
}

.map-node.is-current {
  background: rgba(255, 79, 216, .26);
  border-color: rgba(255, 79, 216, .8);
  animation: nodePulse 1.35s ease-in-out infinite;
}

.map-node.is-done {
  background: var(--green);
  color: #001407;
}

.map-node.is-locked {
  opacity: .35;
  cursor: default;
}

.clicker-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
}

.evidence-panel,
.clicker-board,
.question-panel,
.typing-gate,
.result-card {
  border: 1px solid var(--game-border);
  border-radius: 24px;
  background: var(--game-panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
  backdrop-filter: blur(16px) saturate(1.1);
}

.evidence-panel {
  position: sticky;
  top: 92px;
  min-height: 480px;
  align-self: start;
  padding: 20px;
}

.panel-label,
.question-label {
  color: var(--green);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 11px;
  text-transform: uppercase;
}

.evidence-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
  align-content: start;
}

.evidence-item {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(0, 255, 106, .07);
  color: rgba(245, 245, 247, .72);
  font-size: 10px;
  line-height: 1.25;
  animation: evidenceReveal .24s var(--ease);
}

.evidence-item strong,
.evidence-item span,
.evidence-item small {
  display: block;
  overflow-wrap: anywhere;
}

.evidence-item strong {
  color: var(--game-text);
  font-size: 10.5px;
  line-height: 1.18;
}

.evidence-item span {
  margin-top: 3px;
}

.evidence-item small {
  margin-top: 3px;
  color: var(--green);
  font-size: 8px;
  line-height: 1.18;
}

.clicker-area {
  display: grid;
  gap: 16px;
}

.question-panel {
  padding: clamp(18px, 3vw, 28px);
}

.question-panel h2 {
  margin: 8px 0 8px;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.08;
}

.question-panel p {
  margin: 0 0 14px;
  color: rgba(245, 245, 247, .64);
  line-height: 1.55;
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.answer-option {
  border: 1px solid rgba(0, 255, 106, .2);
  border-radius: 15px;
  background: rgba(0, 0, 0, .38);
  color: var(--game-text);
  cursor: pointer;
  min-height: 74px;
  padding: 12px;
  text-align: left;
  font: inherit;
  font-weight: 800;
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}

.answer-option span {
  display: block;
  color: rgba(245, 245, 247, .62);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 4px;
}

.answer-option:hover,
.answer-option:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: rgba(0, 255, 106, .5);
  background: rgba(0, 255, 106, .1);
}

.answer-option.is-custom {
  border-color: rgba(255, 79, 216, .34);
  background: rgba(255, 79, 216, .08);
}

.custom-answer-wrap {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.custom-answer-wrap textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(0, 0, 0, .36);
  color: var(--game-text);
  padding: 14px;
  font: inherit;
  resize: vertical;
}

.clicker-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-height: 500px;
  padding: 18px;
  background:
    linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, .88)),
    url("/assets/vysluch-cajtov-interrogation.webp") center / cover;
}

.click-card {
  position: relative;
  min-height: 100px;
  border: 1px solid rgba(0, 255, 106, .18);
  border-radius: 16px;
  background: rgba(0, 0, 0, .46);
  color: var(--game-text);
  cursor: pointer;
  padding: 12px;
  text-align: left;
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease), opacity .18s var(--ease);
}

.click-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.click-card span {
  color: rgba(245, 245, 247, .62);
  font-size: 12px;
  line-height: 1.35;
}

.click-card small {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: var(--green);
  font-family: var(--mono, "JetBrains Mono", monospace);
}

.click-card.is-current {
  border-color: rgba(255, 79, 216, .82);
  background: rgba(255, 79, 216, .12);
  box-shadow: 0 0 28px rgba(255, 79, 216, .18);
  animation: nodePulse 1.4s ease-in-out infinite;
}

.click-card.is-done {
  border-color: rgba(0, 255, 106, .58);
  background: rgba(0, 255, 106, .12);
}

.click-card.is-locked {
  opacity: .34;
  cursor: default;
}

.click-card.is-pop {
  animation: clickPop .34s var(--ease);
}

.typing-gate {
  padding: clamp(22px, 4vw, 36px);
}

.typing-gate h2 {
  margin: 10px 0 10px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
}

.typing-gate p {
  color: rgba(245, 245, 247, .64);
  line-height: 1.65;
}

.typing-gate textarea,
#caseOutput {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(0, 0, 0, .36);
  color: var(--game-text);
  padding: 16px;
  font: inherit;
  resize: vertical;
}

.typing-gate textarea {
  min-height: 120px;
  margin: 12px 0;
}

.next-btn {
  width: 100%;
  border: 1px solid rgba(0, 255, 106, .3);
  border-radius: 16px;
  background: rgba(0, 255, 106, .12);
  color: var(--game-text);
  cursor: pointer;
  padding: 16px 18px;
  text-align: center;
  font: inherit;
  font-weight: 900;
  transition: transform .18s var(--ease), background .18s var(--ease);
}

.next-btn:hover {
  transform: translateY(-2px);
  background: rgba(0, 255, 106, .18);
}

.error {
  min-height: 22px;
  color: #ff6c7c !important;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 12px !important;
}

.result-card {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 56px);
  text-align: center;
}

.result-card h2 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.04;
}

.result-card > p {
  max-width: 720px;
  margin: 0 auto 24px;
  color: rgba(245, 245, 247, .7);
  line-height: 1.7;
}

#caseOutput {
  min-height: 330px;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 13px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.result-note {
  margin-top: 18px !important;
  color: rgba(245, 245, 247, .46) !important;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 12px;
}

@keyframes scanSweep {
  0%, 15% { transform: translateY(0); opacity: 0; }
  32% { opacity: .9; }
  65% { transform: translateY(280%); opacity: .25; }
  100% { transform: translateY(280%); opacity: 0; }
}

@keyframes nodePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(255, 79, 216, .24), 0 0 22px rgba(255, 79, 216, .26); }
  50% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 0 14px rgba(255, 79, 216, 0), 0 0 34px rgba(255, 79, 216, .38); }
}

.click-card.is-current {
  animation-name: cardPulse;
}

@keyframes cardPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes clickPop {
  0% { transform: scale(.98); }
  55% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes mapCodeDrift {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 44px 0, 0 26px, 0 0; }
}

@keyframes routeFlow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -18; }
}

@keyframes evidenceReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .game-hero,
  .clicker-layout {
    grid-template-columns: 1fr;
  }

  .interrogation-art {
    min-height: 320px;
  }

  .evidence-panel {
    position: static;
    min-height: auto;
    order: 2;
  }

  .clicker-area {
    order: 1;
  }

  .clicker-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .answer-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .game-nav {
    padding: 14px 18px;
  }

  .game-back {
    font-size: 11px;
  }

  .game-hero,
  .game-shell,
  .result-shell {
    width: min(100% - 28px, 1120px);
  }

  .game-hero {
    padding-top: 104px;
  }

  .game-hero h1 {
    font-size: 52px;
  }

  .interrogation-art {
    min-height: 250px;
  }

  .game-topline {
    grid-template-columns: 1fr;
  }

  .click-map {
    height: 128px;
  }

  .map-node {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .clicker-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: auto;
  }

  .typing-gate {
    padding: 14px;
  }

  .question-panel {
    padding: 14px;
  }

  .question-panel h2 {
    font-size: 23px;
  }

  .question-panel p {
    display: none;
  }

  .answer-option {
    min-height: 54px;
    padding: 10px 12px;
  }

  .answer-option span {
    display: none;
  }

  .custom-answer-wrap textarea {
    min-height: 62px;
  }

  .typing-gate h2 {
    font-size: 23px;
    margin: 6px 0;
  }

  .typing-gate p {
    display: none;
  }

  .typing-gate textarea {
    min-height: 58px;
    margin: 6px 0;
  }

  .typing-gate .next-btn {
    padding: 12px 14px;
  }

  .click-card {
    min-height: 92px;
  }

  .result-actions .btn,
  #startGame {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .art-scanline,
  .click-map::after,
  #mapLines path,
  .map-node,
  .click-card {
    animation: none !important;
  }

  * {
    scroll-behavior: auto !important;
  }
}
