:root {
  --navy: #071a3d;
  --navy-2: #0d2c5e;
  --red: #e3271c;
  --red-dark: #b91712;
  --paper: #f3eddf;
  --cream: #fffaf0;
  --ink: #101828;
  --muted: #5c6575;
  --white: #fff;
  --shadow: 0 24px 70px rgba(3, 14, 38, 0.3);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--white);
  background:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(135deg, #040f27, var(--navy) 58%, #0b2a5d);
  background-size: 32px 32px, 32px 32px, auto;
  font-family: "Arial Narrow", "Roboto Condensed", "Franklin Gothic Medium", Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: -70px;
  left: 20px;
  z-index: 100;
  padding: 12px 18px;
  color: var(--white);
  background: var(--red);
}

.skip-link:focus {
  top: 20px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  width: min(var(--max), calc(100% - 40px));
  min-height: 86px;
  margin: 0 auto;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}

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

.brand img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.brand span {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand strong {
  font-size: 1.02rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand small {
  margin-top: 6px;
  color: #bfcce0;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.back-link,
.text-button {
  color: #d8e2f0;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.back-link {
  padding: 8px 0;
  border-bottom: 2px solid var(--red);
}

main {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.game-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 50px;
  padding: 72px 0 46px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 17px;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow span {
  padding: 5px 9px;
  color: var(--white);
  background: var(--red);
  transform: skew(-4deg);
}

.game-intro h1 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 950;
  letter-spacing: -0.05em;
  line-height: 0.9;
  text-transform: uppercase;
}

.game-intro h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 2px var(--red);
}

.game-intro > div > p:last-child {
  max-width: 680px;
  margin: 24px 0 0;
  color: #cbd7e8;
  font-family: Arial, sans-serif;
  font-size: 1rem;
}

.rules {
  display: grid;
  gap: 10px;
  min-width: 180px;
}

.rules span {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: #b9c7dc;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rules strong {
  color: var(--red);
  font-size: 1.4rem;
}

.game-shell {
  overflow: hidden;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: var(--shadow);
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 22px 26px;
  border-bottom: 1px solid rgba(7,26,61,0.16);
}

.round-label {
  margin: 0 0 3px;
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-toolbar h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
}

.progress-block {
  min-width: 190px;
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: right;
  text-transform: uppercase;
}

.progress-track {
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  background: #d7dbe2;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 300ms ease;
}

.scene {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #020817;
  cursor: crosshair;
  user-select: none;
  touch-action: manipulation;
}

.scene-image {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  image-orientation: from-image;
}

.spotter-target {
  --spotter-size: 8;
  --spotter-fluid: 6.4vw;
  position: absolute;
  z-index: 3;
  width: clamp(42px, calc(24px + var(--spotter-fluid)), 118px);
  min-width: 42px;
  max-width: 118px;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
  transform: translate(-50%, -50%) rotate(-5deg);
  transition: filter 180ms ease, transform 180ms ease;
  touch-action: manipulation;
}

.spotter-target img {
  width: 100%;
  pointer-events: none;
}

.spotter-target:hover,
.spotter-target:focus-visible {
  outline: 3px dashed rgba(255,255,255,0.9);
  outline-offset: 4px;
  transform: translate(-50%, -50%) rotate(-5deg) scale(1.08);
}

.scene.is-solved .spotter-target {
  z-index: 5;
  filter: drop-shadow(0 0 18px #fff) drop-shadow(0 0 28px var(--red));
  transform: translate(-50%, -50%) rotate(0) scale(1.45);
}

.scene.show-hint .spotter-target {
  animation: hint-pulse 850ms ease;
}

@keyframes hint-pulse {
  0%, 100% { filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }
  50% { filter: drop-shadow(0 0 22px #fff) drop-shadow(0 0 35px var(--red)); }
}

.search-message {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 8;
  padding: 10px 16px;
  color: var(--white);
  background: rgba(7,26,61,0.92);
  border-left: 5px solid var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  transform: translate(-50%, 15px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.search-message.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.game-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 26px;
  border-top: 1px solid rgba(7,26,61,0.16);
}

.game-controls p {
  margin: 0;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
}

.game-controls p strong {
  color: var(--navy);
  text-transform: uppercase;
}

.game-controls > div {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 0 auto;
}

.text-button {
  padding: 7px 0;
  cursor: pointer;
  color: var(--navy);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--red);
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 34px 20px;
  color: #9fb0c9;
  background: #030d22;
  border-top: 1px solid rgba(255,255,255,0.1);
}

footer img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

footer p {
  max-width: 420px;
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2,8,23,0.83);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(470px, 100%);
  padding: 42px 38px 34px;
  color: var(--ink);
  background: var(--cream);
  box-shadow: 12px 12px 0 var(--red), var(--shadow);
  text-align: center;
}

.case-stamp {
  position: absolute;
  top: -16px;
  left: 50%;
  padding: 8px 15px;
  color: var(--white);
  background: var(--red);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-2deg);
}

.modal-card > img {
  width: 96px;
  height: 130px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.modal-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 8vw, 3.6rem);
  font-weight: 950;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-transform: uppercase;
}

.modal-card p {
  margin: 17px auto 0;
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.score-line {
  font-size: 0.82rem;
  font-weight: 700;
}

.primary-button {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  cursor: pointer;
  color: var(--white);
  background: var(--red);
  border: 2px solid var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--red-dark);
}

.modal-card > a {
  display: inline-block;
  margin-top: 18px;
  color: var(--navy);
  border-bottom: 2px solid var(--red);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .game-header {
    min-height: 72px;
  }

  .brand img {
    width: 50px;
    height: 50px;
  }

  .brand small {
    display: none;
  }

  .back-link {
    font-size: 0.66rem;
  }

  .game-intro {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 52px;
  }

  .game-intro h1 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .rules {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-toolbar,
  .game-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress-block {
    width: 100%;
    text-align: left;
  }

  .game-controls > div {
    width: 100%;
    justify-content: space-between;
  }

  .spotter-target {
    min-width: 38px;
    max-width: 82px;
  }
}

@media (max-width: 480px) {
  .game-header,
  main {
    width: min(100% - 26px, var(--max));
  }

  .brand strong {
    font-size: 0.78rem;
  }

  .back-link {
    max-width: 95px;
    line-height: 1.2;
    text-align: right;
  }

  .game-intro {
    padding-top: 42px;
  }

  .game-intro h1 em {
    -webkit-text-stroke-width: 1px;
  }

  .game-toolbar,
  .game-controls {
    padding: 18px;
  }

  .rules span {
    flex-direction: column;
    gap: 2px;
  }

  .modal-card {
    padding-inline: 24px;
  }
}

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