@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=Manrope:wght@400;500;600;700;800&display=swap");

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: #f5efe2;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 8%, rgba(244, 182, 37, 0.14), transparent 23rem),
    radial-gradient(circle at 92% 25%, rgba(32, 160, 211, 0.09), transparent 28rem),
    #f5efe2;
  font-family: "Manrope", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.page {
  --navy: #102b3e;
  --navy-soft: #27475b;
  --paper: #f5efe2;
  --cream: #fffaf0;
  --gold: #f4b625;
  --gold-deep: #d4940e;
  --blue: #20a0d3;
  --green: #4f8d50;
  --red: #b54b3d;
  width: min(1400px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  color: var(--navy);
}

.topbar {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(16, 43, 62, 0.16);
}

.brand {
  display: block;
  width: 190px;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
}

.missionStatus {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  color: #356e3c;
  background: rgba(70, 133, 72, 0.1);
  border: 1px solid rgba(70, 133, 72, 0.28);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.missionStatus i {
  width: 7px;
  height: 7px;
  background: #54a65c;
  border-radius: 50%;
  animation: statusPulse 1.8s ease-in-out infinite;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 52px 0 38px;
}

.hero > div:first-child {
  max-width: 900px;
}

.hero p,
.caseHeading p,
.evidenceIntro p {
  margin: 0;
  color: var(--gold-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.2px;
}

.hero h1 {
  margin: 10px 0 12px;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(40px, 5.8vw, 76px);
  letter-spacing: -3px;
  line-height: 0.98;
}

.hero > div > span {
  color: var(--navy-soft);
  font-size: 15px;
  line-height: 1.6;
}

.missionSeal {
  width: 104px;
  height: 104px;
  display: grid;
  place-content: center;
  flex: 0 0 auto;
  background: var(--gold);
  border: 3px solid var(--navy);
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px var(--paper), 6px 8px 0 rgba(16, 43, 62, 0.12);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(5deg);
}

.missionSeal span {
  display: block;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 33px;
  letter-spacing: 0;
  line-height: 1;
}

.gameShell {
  display: grid;
  grid-template-columns: minmax(270px, 0.8fr) minmax(560px, 1.7fr);
  gap: 24px;
  align-items: start;
}

.caseFile,
.boardCard,
.evidenceList {
  background: rgba(255, 250, 240, 0.94);
  border: 1px solid rgba(16, 43, 62, 0.16);
  box-shadow: 0 22px 60px rgba(41, 48, 43, 0.12);
}

.caseFile {
  position: sticky;
  top: 18px;
  padding: 24px;
}

.caseHeading,
.evidenceIntro {
  display: flex;
  align-items: center;
  gap: 12px;
}

.caseHeading strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.step {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: var(--navy);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.clue {
  margin: 24px 0 14px;
  padding: 22px 18px 22px 22px;
  color: var(--navy);
  background: #fffdf7;
  border: 0;
  border-left: 5px solid var(--gold);
  box-shadow: inset 0 0 0 1px rgba(16, 43, 62, 0.1);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.46;
}

.clue mark {
  display: inline-block;
  padding: 1px 5px;
  color: var(--navy);
  background: linear-gradient(transparent 58%, rgba(244, 182, 37, 0.55) 58%);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 0.68em;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
}

.wordInfo {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--navy-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.feedback {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 12px;
  color: var(--navy-soft);
  background: rgba(32, 160, 211, 0.08);
  border: 1px solid rgba(32, 160, 211, 0.18);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.feedback > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: var(--blue);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
}

.feedback.correct {
  color: #2d6635;
  background: rgba(79, 141, 80, 0.1);
  border-color: rgba(79, 141, 80, 0.24);
}

.feedback.correct > span {
  background: var(--green);
}

.feedback.wrong {
  color: #87372e;
  background: rgba(181, 75, 61, 0.08);
  border-color: rgba(181, 75, 61, 0.2);
}

.feedback.wrong > span {
  background: var(--red);
}

.hintButton {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  color: var(--navy);
  background: var(--gold);
  border: 1px solid var(--gold-deep);
  border-radius: 2px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: 160ms ease;
}

.hintButton:hover,
.hintButton:focus-visible {
  background: var(--navy);
  color: white;
  outline: none;
}

.sourceNote {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed rgba(16, 43, 62, 0.2);
}

.sourceNote span,
.sourceNote strong,
.sourceNote small {
  display: block;
}

.sourceNote span,
.sourceNote small {
  color: var(--navy-soft);
  font-size: 9px;
}

.sourceNote strong {
  margin: 3px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
}

.boardCard {
  padding: 22px;
}

.stats {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 16px;
}

.stats > div span,
.stats > div strong {
  display: block;
}

.stats > div span {
  margin-bottom: 4px;
  color: var(--navy-soft);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.3px;
}

.stats > div strong {
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 22px;
  line-height: 1;
}

.stats i {
  width: 1px;
  align-self: stretch;
  background: rgba(16, 43, 62, 0.14);
}

.stats button {
  min-height: 40px;
  margin-left: auto;
  padding: 0 14px;
  color: var(--navy);
  background: transparent;
  border: 1px solid rgba(16, 43, 62, 0.26);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.grid {
  position: relative;
  display: grid;
  gap: clamp(2px, 0.45vw, 7px);
  width: 100%;
  aspect-ratio: 1;
  padding: clamp(8px, 1.6vw, 20px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--navy);
  background-size: 24px 24px;
  border: 7px solid var(--navy);
  box-shadow: 0 14px 35px rgba(16, 43, 62, 0.2);
  user-select: none;
}

.cell {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--navy);
  background: #fffaf0;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 3px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.11);
  cursor: crosshair;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(11px, 1.65vw, 21px);
  line-height: 1;
  touch-action: none;
  transition: 100ms ease;
}

.cell:hover,
.cell:focus-visible {
  z-index: 2;
  background: #fff1c8;
  outline: 3px solid var(--gold);
}

.cell.selected {
  z-index: 3;
  color: var(--navy);
  background: var(--gold);
  border-color: #ffe49b;
  outline: 2px solid white;
  transform: scale(1.08);
}

.cell.found {
  color: white;
  background: var(--green);
  border-color: #8fbd8e;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.cell.hint {
  animation: hintPulse 430ms ease-in-out 4 alternate;
}

.instructions {
  margin: 15px 0 0;
  color: var(--navy-soft);
  font-size: 11px;
  text-align: center;
}

.instructions span {
  margin-right: 7px;
  color: var(--gold-deep);
  font-size: 18px;
  font-weight: 900;
}

.completePanel {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: white;
  background: rgba(16, 43, 62, 0.92);
  text-align: center;
  backdrop-filter: blur(4px);
  animation: reveal 280ms ease both;
}

.completeStamp {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  color: var(--navy);
  background: var(--gold);
  border: 4px solid white;
  border-radius: 50%;
  font-size: 30px;
  font-weight: 900;
  transform: rotate(-8deg);
}

.completePanel p {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.2px;
}

.completePanel h2 {
  max-width: 510px;
  margin: 0;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(27px, 4vw, 47px);
  line-height: 1.05;
}

.finalStats {
  display: flex;
  gap: 22px;
  margin-top: 18px;
}

.finalStats span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.finalStats strong {
  display: block;
  color: white;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 22px;
}

.completeActions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.completePanel button,
.completePanel a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.completePanel button {
  color: var(--navy);
  background: var(--gold);
  border: 0;
  cursor: pointer;
}

.completePanel a {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.48);
}

.completePanel a:hover,
.completePanel a:focus-visible {
  color: var(--navy);
  background: white;
  outline: none;
}

.evidenceList {
  display: grid;
  grid-template-columns: minmax(250px, 0.6fr) 1.5fr;
  gap: 28px;
  margin-top: 24px;
  padding: 24px 28px;
}

.evidenceIntro h2 {
  margin: 4px 0 0;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 19px;
}

.chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.chips span {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  color: var(--navy-soft);
  background: var(--paper);
  border: 1px solid rgba(16, 43, 62, 0.12);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.chips b {
  color: var(--gold-deep);
  font-size: 9px;
}

.chips .solvedChip {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.chips .solvedChip b {
  color: #d7f5d6;
}

.footer {
  min-height: 115px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--navy-soft);
  font-size: 10px;
}

.footer span {
  font-weight: 900;
  letter-spacing: 1.5px;
}

.footer p {
  font-style: italic;
}

@keyframes hintPulse {
  from {
    background: #fffaf0;
    outline: 0 solid transparent;
  }
  to {
    background: var(--gold);
    outline: 4px solid rgba(244, 182, 37, 0.35);
    transform: scale(1.12);
  }
}

@keyframes reveal {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes statusPulse {
  50% { opacity: 0.35; }
}

@media (max-width: 980px) {
  .gameShell {
    grid-template-columns: 1fr;
  }

  .caseFile {
    position: static;
  }

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

@media (max-width: 680px) {
  .page {
    width: min(100% - 22px, 1400px);
  }

  .topbar {
    min-height: 90px;
    gap: 8px;
    padding-block: 7px;
  }

  .brand {
    width: 150px;
  }

  .missionStatus {
    width: 11px;
    height: 11px;
    overflow: hidden;
    padding: 0;
    border: 0;
    font-size: 0;
  }

  .missionStatus i {
    flex: 0 0 auto;
  }

  .hero {
    align-items: flex-start;
    padding: 38px 0 28px;
  }

  .hero h1 {
    font-size: clamp(39px, 13.5vw, 57px);
    letter-spacing: -2px;
  }

  .hero > div > span {
    font-size: 13px;
  }

  .missionSeal {
    display: none;
  }

  .caseFile,
  .boardCard {
    padding: 14px;
  }

  .clue {
    margin-top: 18px;
    padding: 17px 13px 17px 17px;
    font-size: 18px;
  }

  .wordInfo {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .stats {
    gap: 10px;
  }

  .stats > div span {
    font-size: 6px;
    letter-spacing: 0.7px;
  }

  .stats > div strong {
    font-size: 17px;
  }

  .stats i {
    display: none;
  }

  .stats button {
    width: 39px;
    min-height: 39px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .stats button::first-letter {
    font-size: 20px;
  }

  .grid {
    gap: 2px;
    padding: 7px;
    border-width: 4px;
  }

  .cell {
    border-radius: 2px;
    font-size: clamp(9px, 3vw, 14px);
  }

  .instructions {
    font-size: 9px;
  }

  .evidenceList {
    padding: 20px 14px;
  }

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

  .completeActions {
    width: min(260px, 100%);
    flex-direction: column;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
  }

  .footer p {
    margin: 0;
  }
}

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