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

* { box-sizing: border-box; }
html { min-width: 320px; background: #efe8d8; }
body { margin: 0; }
button { font: inherit; }

.page {
  --navy: #082d48;
  --navy-deep: #041d31;
  --gold: #f3b51b;
  --gold-deep: #d79108;
  --cream: #fbf5e7;
  --paper: #fffdf7;
  --ink: #163247;
  --muted: #61727d;
  --line: rgba(8, 45, 72, 0.16);
  --green: #2f8a59;
  --red: #b84135;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(8, 45, 72, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 45, 72, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 8% 8%, rgba(243, 181, 27, 0.22), transparent 25rem),
    #efe8d8;
  background-size: 28px 28px, 28px 28px, auto, auto;
  font-family: "Manrope", Arial, sans-serif;
}

.topbar,
.hero,
.briefing,
.gameShell,
.feedbackBar,
.learning,
.cardPreview,
.footer {
  width: min(1460px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
}

.brandMark {
  width: 46px;
  height: 51px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--gold);
  border: 3px solid var(--navy);
  border-radius: 50% 50% 46% 46% / 42% 42% 58% 58%;
  box-shadow: inset 0 0 0 3px #efe8d8;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 24px;
  transform: rotate(-4deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 19px;
  letter-spacing: -0.5px;
  line-height: 1;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.missionStatus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #2b704a;
  background: rgba(47, 138, 89, 0.09);
  border: 1px solid rgba(47, 138, 89, 0.24);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.missionStatus i {
  width: 7px;
  height: 7px;
  background: #4ab873;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(74, 184, 115, 0.14);
}

.hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 38px;
  align-items: center;
  padding-block: 46px;
}

.hero > div > p,
.briefCopy p,
.matrixHeading p,
.clueHeading p,
.learning > div > p,
.cardPreview > div > p {
  margin: 0;
  color: var(--gold-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.2px;
}

.hero h1 {
  margin: 8px 0 14px;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(56px, 7vw, 98px);
  letter-spacing: -4px;
  line-height: 0.92;
  text-transform: uppercase;
}

.hero h1 span {
  display: block;
  color: var(--gold);
  text-shadow:
    -2px -2px 0 var(--navy), 2px -2px 0 var(--navy),
    -2px 2px 0 var(--navy), 2px 2px 0 var(--navy);
}

.hero > div > strong {
  display: block;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.hero aside {
  display: flex;
  gap: 18px;
  padding: 26px;
  color: white;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 12px 12px 0 rgba(243, 181, 27, 0.55);
  transform: rotate(1deg);
}

.hero aside > span {
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--navy);
  background: var(--gold);
  border-radius: 50%;
  font-size: 30px;
}

.hero aside b {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 1.5px;
}

.hero aside p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 1.55;
}

.briefing {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(400px, 1.45fr) auto;
  gap: 24px;
  align-items: center;
  padding: 22px 26px;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(8, 45, 72, 0.09);
}

.briefCopy,
.matrixHeading,
.clueHeading {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.briefCopy h2,
.matrixHeading h2,
.clueHeading h2,
.learning h2,
.cardPreview h2 {
  margin: 3px 0 0;
  font-family: "Archivo Black", Impact, sans-serif;
  letter-spacing: -0.7px;
}

.briefCopy h2 {
  font-size: 19px;
}

.briefCopy small {
  display: block;
  margin-top: 5px;
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
}

.modeButtons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.modeButtons button {
  min-height: 68px;
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  transition: 160ms ease;
}

.modeButtons b,
.modeButtons span {
  display: block;
}

.modeButtons b {
  color: var(--ink);
  font-size: 12px;
}

.modeButtons span {
  margin-top: 4px;
  font-size: 9px;
}

.modeButtons button:hover,
.modeButtons button:focus-visible,
.modeButtons .activeMode {
  background: rgba(243, 181, 27, 0.18);
  border-color: var(--gold-deep);
  outline: none;
}

.modeButtons .activeMode {
  box-shadow: inset 4px 0 0 var(--gold);
}

.startButton,
.feedbackBar button,
.hintButton,
.successOverlay button {
  min-height: 48px;
  padding: 0 18px;
  color: var(--navy);
  background: var(--gold);
  border: 1px solid var(--gold-deep);
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  transition: 160ms ease;
}

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

.startButton:disabled,
.feedbackBar button:disabled,
.hintButton:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.startButton span {
  margin-left: 8px;
  font-size: 18px;
}

.gameShell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 22px;
  align-items: start;
  margin-top: 24px;
}

.boardArea,
.cluePanel,
.feedbackBar,
.learning,
.cardPreview {
  background: rgba(255, 253, 247, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(8, 45, 72, 0.1);
}

.boardArea {
  position: relative;
  min-width: 0;
  padding: 20px;
}

.statsBar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
  margin-bottom: 17px;
  padding: 8px 12px;
  color: white;
  background: var(--navy);
}

.statsBar div span,
.statsBar div strong {
  display: block;
}

.statsBar div span {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.25px;
}

.statsBar div strong {
  color: var(--gold);
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 19px;
}

.statsBar > i {
  width: 1px;
  height: 31px;
  background: rgba(255, 255, 255, 0.18);
}

.statsBar button {
  min-height: 38px;
  margin-left: auto;
  padding: 0 12px;
  color: white;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 2px;
  cursor: pointer;
  font-size: 11px;
}

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

.matrices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.matrixCard {
  min-width: 0;
  padding: 16px;
  background: var(--cream);
  border: 1px solid var(--line);
}

.matrixHeading {
  margin-bottom: 14px;
}

.matrixHeading > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--navy);
  background: var(--gold);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
}

.matrixHeading h2 {
  font-size: 17px;
}

.tableScroll {
  overflow-x: auto;
  scrollbar-color: var(--gold) rgba(8, 45, 72, 0.08);
}

.logicTable {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: white;
}

.logicTable th,
.logicTable td {
  height: 55px;
  padding: 0;
  border: 1px solid rgba(8, 45, 72, 0.12);
  text-align: center;
}

.logicTable thead th {
  height: 66px;
  color: var(--navy);
  background: #f0e7d5;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.logicTable thead th:first-child {
  width: 116px;
}

.logicTable thead b,
.logicTable thead span {
  display: block;
}

.logicTable thead b {
  margin-bottom: 4px;
  color: var(--gold-deep);
  font-size: 18px;
}

.logicTable tbody th {
  padding: 0 8px;
  background: #f8f1e3;
  text-align: left;
}

.logicTable tbody th i {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-right: 7px;
  color: white;
  border-radius: 50%;
  font-size: 8px;
  font-style: normal;
}

.logicTable tbody th span {
  font-size: 10px;
}

.markButton {
  width: 100%;
  height: 100%;
  padding: 0;
  color: rgba(8, 45, 72, 0.18);
  background: white;
  border: 0;
  cursor: pointer;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 24px;
  transition: 110ms ease;
}

.markButton:hover:not(:disabled),
.markButton:focus-visible:not(:disabled) {
  background: rgba(243, 181, 27, 0.16);
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

.markButton.no {
  color: var(--red);
  background: rgba(184, 65, 53, 0.07);
}

.markButton.yes {
  color: var(--green);
  background: rgba(47, 138, 89, 0.11);
}

.markButton:disabled {
  cursor: default;
}

.lockedOverlay,
.successOverlay {
  position: absolute;
  inset: 93px 20px 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: white;
  background: rgba(4, 29, 49, 0.91);
  text-align: center;
  backdrop-filter: blur(5px);
}

.lockedOverlay[hidden],
.successOverlay[hidden] {
  display: none;
}

.lockedOverlay > span,
.successOverlay > span {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--gold);
  border: 4px solid white;
  border-radius: 50%;
  font-size: 31px;
}

.lockedOverlay h2,
.successOverlay h2 {
  margin: 14px 0 6px;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(26px, 4vw, 44px);
}

.lockedOverlay p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

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

.successOverlay > strong {
  font-size: 14px;
}

.successOverlay > small {
  max-width: 600px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.55;
}

.successOverlay button {
  margin-top: 18px;
}

.cluePanel {
  position: sticky;
  top: 16px;
  padding: 20px;
}

.clueHeading h2 {
  font-size: 20px;
}

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

.cluePanel li {
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: 9px;
  align-items: start;
  padding: 10px;
  background: #f4eddf;
  border-left: 3px solid var(--gold);
}

.cluePanel li > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: white;
  background: var(--navy);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 900;
}

.cluePanel li p {
  margin: 0;
  color: #445965;
  font-size: 11px;
  line-height: 1.45;
}

.legend {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.legend b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 3px;
}

.legendNo {
  color: var(--red);
  background: rgba(184, 65, 53, 0.1);
}

.legendYes {
  color: var(--green);
  background: rgba(47, 138, 89, 0.12);
}

.hintButton {
  width: 100%;
  margin-top: 14px;
  background: transparent;
  border-color: rgba(8, 45, 72, 0.28);
}

.feedbackBar {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  padding: 16px 18px;
}

.feedbackBar > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--navy);
  background: var(--gold);
  border-radius: 50%;
  font-size: 22px;
}

.feedbackBar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.learning {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: center;
  margin-top: 24px;
  padding: 26px;
}

.learning h2 {
  font-size: 24px;
}

.learning ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learning li {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: #f4eddf;
}

.learning li > b {
  color: var(--gold-deep);
  font-family: "Archivo Black", Impact, sans-serif;
}

.learning li strong,
.learning li span {
  display: block;
}

.learning li strong {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 11px;
}

.learning li span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.cardPreview {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-top: 24px;
  padding: 24px;
}

.cardPreview h2 {
  font-size: 27px;
}

.cardPreview > div > span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.cardPreview img {
  display: block;
  width: 100%;
  border: 7px solid white;
  box-shadow: 0 10px 30px rgba(8, 45, 72, 0.16);
}

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

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

.footer p {
  margin: 0;
  font-style: italic;
}

@media (max-width: 1120px) {
  .briefing {
    grid-template-columns: 1fr 1.4fr;
  }

  .startButton {
    grid-column: 1 / -1;
  }

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

  .cluePanel {
    position: static;
  }

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

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero aside {
    transform: none;
  }

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

  .startButton {
    grid-column: auto;
  }

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

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

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

@media (max-width: 600px) {
  .topbar,
  .hero,
  .briefing,
  .gameShell,
  .feedbackBar,
  .learning,
  .cardPreview,
  .footer {
    width: min(100% - 22px, 1460px);
  }

  .topbar {
    min-height: 76px;
  }

  .brandMark {
    width: 40px;
    height: 45px;
    font-size: 21px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small {
    font-size: 7px;
  }

  .missionStatus {
    width: 11px;
    height: 11px;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
  }

  .missionStatus i {
    width: 10px;
    height: 10px;
  }

  .hero {
    gap: 25px;
    padding-block: 38px 30px;
  }

  .hero h1 {
    font-size: clamp(48px, 17vw, 69px);
    letter-spacing: -3px;
  }

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

  .hero aside {
    padding: 18px;
  }

  .briefing {
    padding: 17px;
  }

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

  .boardArea,
  .cluePanel,
  .learning,
  .cardPreview {
    padding: 12px;
  }

  .statsBar {
    gap: 9px;
    padding: 7px;
  }

  .statsBar > i {
    display: none;
  }

  .statsBar div span {
    font-size: 6px;
    letter-spacing: 0.8px;
  }

  .statsBar div strong {
    font-size: 15px;
  }

  .statsBar button {
    width: 38px;
    padding: 0;
    font-size: 17px;
  }

  .statsBar button span {
    display: none;
  }

  .matrixCard {
    padding: 10px;
  }

  .logicTable {
    min-width: 100%;
  }

  .logicTable thead th:first-child {
    width: 84px;
  }

  .logicTable th,
  .logicTable td {
    height: 48px;
  }

  .logicTable thead th {
    height: 56px;
    font-size: 6px;
  }

  .logicTable thead b {
    font-size: 14px;
  }

  .logicTable tbody th {
    padding-inline: 4px;
  }

  .logicTable tbody th i {
    width: 23px;
    height: 23px;
    margin-right: 3px;
    font-size: 7px;
  }

  .logicTable tbody th span {
    font-size: 8px;
  }

  .lockedOverlay,
  .successOverlay {
    inset: 85px 12px 12px;
  }

  .cluePanel ol {
    grid-template-columns: 1fr;
  }

  .feedbackBar {
    grid-template-columns: 34px 1fr;
    padding: 12px;
  }

  .feedbackBar > span {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .feedbackBar p {
    font-size: 10px;
  }

  .feedbackBar button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .learning ul {
    grid-template-columns: 1fr;
  }

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

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