:root {
  --navy: #071d31;
  --blue: #0d3a58;
  --gold: #f4b62d;
  --paper: #fffaf0;
  --ink: #17364c;
  --line: #d5bd8d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--navy);
  font-family: Arial, Helvetica, sans-serif;
}

.topbar {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 9px max(20px, calc((100vw - 1380px) / 2));
  border-bottom: 1px solid rgba(20, 42, 58, 0.16);
  background: #f7f2e7;
}
.brand {
  display: block;
  width: 190px;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
}
.mission {
  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;
}
.mission i {
  color: #54a65c;
  font-size: 10px;
  font-style: normal;
  animation: pulse 1.8s ease-in-out infinite;
}

.hero {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  width: min(1200px, calc(100% - 2rem));
  margin: auto;
  padding: clamp(2.5rem, 7vw, 5rem) 0;
}
.hero-copy { color: #fff; }
.hero-copy > p:first-child {
  color: #ffc743;
  font-weight: 900;
  letter-spacing: 0.13em;
}
.hero h1 {
  margin: 0.4rem 0;
  font: 900 clamp(2.5rem, 6vw, 5rem) / 0.95 Georgia, serif;
}
.hero h1 em {
  display: block;
  color: #ffd165;
  font-style: normal;
}
.hero-copy > p:nth-of-type(2) {
  max-width: 40rem;
  color: #d6e5ee;
  font-size: 1.12rem;
  line-height: 1.65;
}
.hero a {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  color: #ffd165;
  background: var(--gold);
  font-weight: 900;
  text-decoration: none;
}
.hero img {
  display: block;
  width: 100%;
  border: 4px solid #c99328;
  border-radius: 1.3rem;
  box-shadow: 0 1.5rem 3rem #0008;
}
.rule {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding: 1rem;
  border: 1px solid #a98030;
  border-radius: 1rem;
  color: #fff2d0;
  background: #113c58;
  text-align: center;
  line-height: 1.5;
}
.rule b { color: #ffd165; }

.game-area {
  padding: 4rem 1rem;
  background: linear-gradient(#fffdf4f7, #eee0bff7);
}
.heading { text-align: center; }
.heading p {
  margin: 0;
  color: #8b5a12;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.heading h2 {
  margin: 0.4rem 0 1.4rem;
  color: #0a304c;
  font: 900 clamp(2rem, 4vw, 3.3rem) Georgia, serif;
}
.game-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 1rem;
  width: min(1180px, 100%);
  min-height: 650px;
  margin: auto;
}
.panel,
.notebook {
  border: 2px solid #caa75e;
  border-radius: 1.2rem;
  background: #fffef8;
  box-shadow: 0 1rem 2.5rem #4a321326;
}
.panel { padding: 1rem; }
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  color: #fff;
  background: var(--blue);
}
.toolbar > div {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.toolbar > div span {
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  background: #ffffff18;
}
.toolbar b { color: #ffd05d; }
.people {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}
.people button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 64px;
  padding: 0.55rem;
  border: 2px solid var(--line);
  border-radius: 0.8rem;
  color: var(--ink);
  background: #fff9e9;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}
.people button .avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  overflow: hidden;
}
.avatar img,
.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.people button small {
  display: block;
  color: #735f3b;
  font-size: 0.68rem;
}
.people button.selected {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}
.people button.selected small { color: #d7e6ef; }
.people button.done {
  color: #23583b;
  border-color: #7aa889;
  background: #e6f4e8;
}
.desk {
  min-height: 430px;
  padding: clamp(1rem, 3vw, 2rem);
  border: 2px dashed #cdbb90;
  border-radius: 1rem;
  background: #fffdf6;
}
.empty {
  padding: 5rem 1rem;
  text-align: center;
}
.empty > b,
.portrait {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: auto;
  border-radius: 50%;
  overflow: hidden;
  color: #0b3049;
  background: #ffc643;
  font: 900 1.7rem Georgia, serif;
}
.person-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #eadbb9;
}
.person-head .portrait { margin: 0; }
.person-head h3 {
  margin: 0;
  color: #0b3553;
  font: 900 1.6rem Georgia, serif;
}
.person-head p {
  margin: 0.2rem 0;
  color: #6f5d3b;
}
.person-head > span:last-child {
  margin-left: auto;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  color: #fff;
  background: #78579a;
  font-size: 0.8rem;
  font-weight: 900;
}
.question { margin-top: 1.2rem; }
.question > p {
  color: #815513;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.question h2 { font-size: 1.2rem; }
.options {
  display: grid;
  gap: 0.6rem;
}
.options button {
  padding: 0.85rem 1rem;
  border: 2px solid var(--line);
  border-radius: 0.8rem;
  color: var(--ink);
  background: #fffaf0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.options button:hover,
.options button:focus {
  border-color: #d79518;
  outline: 2px solid #f7bd3f55;
}
.options button.correct {
  border-color: #5a9a70;
  background: #e6f5e9;
}
.options button.wrong {
  border-color: #cb7975;
  background: #fff0ef;
}
.feedback,
.response {
  margin-top: 0.8rem;
  padding: 0.85rem;
  border-radius: 0.7rem;
  line-height: 1.5;
}
.feedback {
  color: #782f2a;
  border-left: 5px solid #bb4c45;
  background: #fff0ed;
}
.response {
  color: #3f2b56;
  border: 1px solid #b89bd1;
  background: #f5effa;
}
.response button,
.conclusion button.next {
  margin-top: 0.7rem;
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #244c67;
  font-weight: 900;
  cursor: pointer;
}
.status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
  color: #62553d;
  font-weight: 700;
}
.status button,
.notebook > button {
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 0.6rem;
  color: #fff;
  background: #173f5b;
  font-weight: 900;
  cursor: pointer;
}
.status button:disabled { opacity: 0.45; }
.notebook {
  padding: 1rem;
  background: repeating-linear-gradient(#fffdf4 0 30px, #cbdce8 31px 32px);
}
.notebook > p {
  margin: 0;
  color: #8a5a16;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.notebook h3 {
  margin: 0.3rem 0 1rem;
  font: 900 1.5rem Georgia, serif;
}
.notebook ol {
  display: grid;
  gap: 0.65rem;
  max-height: 380px;
  padding-left: 1.5rem;
  overflow: auto;
}
.notebook li { line-height: 1.4; }
.notebook li b,
.notebook li small { display: block; }
.notebook li small { color: #3e5360; }
.notebook .blank {
  padding: 0.8rem;
  border: 1px dashed #a88d5c;
  border-radius: 0.6rem;
  list-style: none;
  color: #6a5c42;
  text-align: center;
}
.meter {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 2px solid #25465b33;
}
.meter > b {
  display: flex;
  justify-content: space-between;
}
.meter > i {
  display: block;
  height: 10px;
  margin: 0.5rem 0;
  border-radius: 999px;
  background: #d8cfb9;
  overflow: hidden;
}
.meter > i span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #d99a1b, #489966);
}
.meter small { color: #66583f; }
.notebook > button {
  width: 100%;
  margin-top: 1rem;
}
.overlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  border-radius: 1.2rem;
  color: #fff;
  background: #061f33f7;
  text-align: center;
}
.overlay[hidden] { display: none !important; }
.overlay > div { max-width: 590px; }
.overlay h2 {
  margin: 0.4rem 0;
  color: #ffd05e;
  font: 900 clamp(1.8rem, 4vw, 2.7rem) Georgia, serif;
}
.overlay p { line-height: 1.55; }
.overlay button {
  padding: 0.8rem 1.1rem;
  border: 0;
  border-radius: 999px;
  color: #09283e;
  background: #ffc13a;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.seal {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  margin: auto;
  border: 3px solid #ffcc55;
  border-radius: 50%;
  color: #ffcc55;
  font: 900 0.78rem / 1.5 Arial, sans-serif;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin: 1rem 0;
}
.result-grid b {
  color: #ffd05e;
  font-size: 1.6rem;
}
.result-grid small { display: block; }
.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: auto;
  padding: 4rem 0;
}
.skills article {
  padding: 1.2rem;
  border-top: 4px solid var(--gold);
  border-radius: 0.8rem;
  color: #dce8ef;
  background: #10364f;
}
.skills article > b,
.skills h3 { color: #ffd064; }
.skills h3 { margin: 0.45rem 0; }
.skills p {
  margin: 0;
  line-height: 1.5;
}
footer {
  padding: 1.4rem;
  color: #c4d5df;
  border-top: 1px solid #9f772d55;
  background: #041522;
  text-align: center;
}

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

@media (max-width: 1000px) {
  .hero,
  .game-shell { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .notebook { min-height: 280px; }
}

@media (max-width: 700px) {
  .topbar {
    min-height: 90px;
    gap: 12px;
    padding-inline: 12px;
  }
  .brand { width: 150px; }
  .mission {
    padding: 7px 9px;
    font-size: 0.62rem;
  }
  .hero { width: calc(100% - 1rem); }
  .game-area { padding: 3rem 0.5rem; }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .people { grid-template-columns: repeat(2, 1fr); }
  .desk { min-height: 500px; }
  .person-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .person-head > span:last-child { margin-left: 0; }
  .status {
    align-items: flex-start;
    flex-direction: column;
  }
  .skills {
    grid-template-columns: 1fr;
    width: calc(100% - 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.sk-game-intro h1 {
  color: #ffd05e;
}
