@font-face {
  font-family: Lora;
  src: url("/assets/lora-400.woff2");
}
@font-face {
  font-family: Lora;
  src: url("/assets/lora-600.woff2");
  font-weight: 600;
}
@font-face {
  font-family: Playfair;
  src: url("/assets/playfair-display-600.woff2");
  font-weight: 600;
}
@font-face {
  font-family: Playfair;
  src: url("/assets/playfair-display-700.woff2");
  font-weight: 700;
}
@font-face {
  font-family: Vibes;
  src: url("/assets/great-vibes-400.woff2");
}
@font-face {
  font-family: Cinzel;
  src: url("/assets/cinzel-decorative-400.woff2");
}
:root {
  --navy: #15304a;
  --cream: #fbf3e2;
  --red: #b3242b;
  --green: #1f5c40;
  --gold: #c9a24a;
  --muted: #5f625e;
  --border: #ded0b5;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: Lora, Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #2c87ab;
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: Playfair, Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}
h1 {
  font-size: clamp(2rem, 3.4vw, 3.5rem);
}
h2 {
  font-size: clamp(1.8rem, 2.8vw, 2.7rem);
}
h3 {
  font-size: 1.45rem;
}
p {
  margin-bottom: 1.15em;
}
header {
  max-width: 1440px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 5%;
  gap: 25px;
}
header nav {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 0.9rem;
}
.brand {
  font-family: Vibes, cursive;
  font-size: 39px;
  line-height: 1;
  color: var(--red);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.brand span {
  font-family: Lora, serif;
  font-size: 8px;
  letter-spacing: 2px;
  line-height: 2;
  margin-top: 4px;
  color: var(--navy);
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  background: var(--red);
  border: 1px solid var(--red);
  color: #fff8e9;
  padding: 16px 26px;
  border-radius: 5px;
  line-height: 1.4;
  font-weight: 600;
  transition:
    background 0.18s,
    transform 0.18s;
}
.button:hover {
  background: #912129;
  transform: translateY(-1px);
}
.button.outline {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}
.button.outline:hover {
  background: #15304a0a;
}
.button.small {
  padding: 11px 19px;
  font-size: 0.9rem;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 10px 4px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.text-button:hover {
  color: var(--red);
}
.quiet-link {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.demo-bar {
  background: #eadfc8;
  text-align: center;
  font:
    11px/1.5 Lora,
    serif;
  letter-spacing: 0.04em;
  padding: 4px;
  color: #504a3d;
}
.hero {
  background: var(--navy);
  color: var(--cream);
  position: relative;
  overflow: hidden;
  padding-bottom: 52px;
}
.bunting {
  display: block;
  width: 100%;
  height: auto;
  max-height: 105px;
}
.hero-inner {
  max-width: 1440px;
  margin: auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 10px;
  padding: 27px 5% 0;
  align-items: center;
}
.hero-copy {
  position: relative;
  z-index: 1;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2.6px;
  font-weight: 600;
  margin-bottom: 18px;
  line-height: 1.7;
}
.hero .eyebrow {
  color: #dec58d;
}
.hero h1 {
  font-size: clamp(3.7rem, 6.3vw, 7rem);
  line-height: 1.04;
  letter-spacing: -2.8px;
  margin: 0 0 22px;
}
.hero h1 span {
  display: block;
  font-family: Cinzel, serif;
  font-size: 0.24em;
  letter-spacing: 6px;
  font-weight: 400;
  line-height: 2.6;
  color: var(--gold);
}
.script {
  font-family: Vibes, cursive;
  font-weight: 400;
}
.subtitle {
  color: #e2bf69;
  font-size: clamp(2rem, 3vw, 3.5rem);
  line-height: 1.2;
  margin-bottom: 28px;
  white-space: nowrap;
}
.story {
  font-size: 16px;
  max-width: 525px;
  color: #e1e0d7;
  line-height: 1.85;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 12px;
  color: #eddfbc;
  margin: 25px 0 30px;
}
.buy {
  background: #bd3136;
  padding: 18px 24px;
}
.buy b {
  margin-left: 5px;
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
}
.purchase-note {
  font-size: 11px;
  color: #c4c6c6;
  letter-spacing: 0.4px;
  margin: 13px 0 0;
}
.hero-picture {
  align-self: center;
}
.house-art {
  display: block;
  width: 100%;
  height: auto;
}
.illustration-note {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.7px;
  color: #e5d4ab;
  margin: -13px 0 0;
}
.illustration-note span {
  color: var(--gold);
  padding: 0 12px;
}
.how-section {
  padding: 70px 6% 65px;
  max-width: 1400px;
  margin: auto;
}
.section-title {
  text-align: center;
}
.section-title .eyebrow {
  color: var(--green);
}
.section-title h2 {
  margin-bottom: 16px;
}
.section-title > p:last-child {
  color: var(--muted);
  font-size: 14px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 45px;
  margin-top: 45px;
}
.steps article {
  position: relative;
  padding-left: 60px;
}
.step-number {
  font-family: Cinzel, serif;
  position: absolute;
  left: 0;
  top: -5px;
  font-size: 29px;
  color: #ae8537;
}
.steps h3 {
  font-size: 21px;
  margin-bottom: 12px;
}
.steps p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
  max-width: 300px;
}
.catalog-section {
  max-width: 1400px;
  margin: auto;
  padding: 30px 6% 80px;
  border-top: 1px solid var(--border);
}
.catalog-section h2 {
  font-size: 30px;
}
.catalog-section .eyebrow {
  margin-top: 35px;
  color: var(--green);
}
.catalog-grid {
  display: grid;
  gap: 20px;
}
.catalog-card {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 28px 35px;
  border: 1px solid #c8b487;
  border-radius: 8px;
  background: #f7edda;
}
.catalog-card:hover {
  border-color: var(--red);
}
.catalog-star {
  font-size: 55px;
  color: var(--red);
}
.catalog-card h3 {
  margin: 0 0 5px;
}
.catalog-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.catalog-card div > span {
  font-size: 12px;
}
.catalog-card > b {
  margin-left: auto;
}
footer {
  border-top: 1px solid var(--border);
  max-width: 1440px;
  margin: auto;
  padding: 35px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 11px;
}
footer small {
  font-size: 10px;
  color: var(--muted);
}
.paper,
.letter-paper,
.puzzle-paper {
  background: #fffaf0;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 7px 30px #53402306;
}
.center {
  max-width: 680px;
  margin: 60px auto;
  padding: 50px;
  text-align: center;
  min-height: 330px;
}
.center .button {
  margin: 10px 5px;
}
.center form {
  text-align: left;
}
.center form .button {
  width: 100%;
  margin: 18px 0;
}
.entry-layout {
  max-width: 1250px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 55px;
  align-items: center;
  padding: 45px 5% 90px;
  margin: auto;
}
.entry-art {
  border-radius: 50% 50% 8px 8px;
  background: var(--navy);
  padding: 25px;
}
.entry-card {
  padding: 40px;
}
.entry-card h1 {
  font-size: 36px;
}
.entry-card > p {
  font-size: 15px;
}
.entry-card .button {
  width: 100%;
  margin-top: 20px;
}
.entry-card .quiet-link {
  display: inline-block;
  margin-top: 25px;
  font-size: 13px;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #bcad91;
  border-radius: 4px;
  background: #fffdf7;
  color: var(--navy);
  padding: 12px 15px;
  margin-top: 8px;
  min-height: 48px;
}
textarea {
  resize: vertical;
}
.code-input {
  text-transform: uppercase;
  font-size: 28px;
  letter-spacing: 5px;
  text-align: center;
}
.notice {
  padding: 16px 20px;
  background: #f2e5c7;
  border-left: 3px solid #bd933e;
  border-radius: 3px;
  font-size: 15px;
  margin: 20px 0;
}
.notice.error {
  background: #fae6dd;
  color: #8f2827;
  border-color: #b3242b;
}
.notice.success {
  background: #e7eedf;
  color: #20563d;
  border-color: #427b4e;
}
.notice:empty,
#message:empty {
  display: none;
}
.access-code {
  font-family: Cinzel, serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: 6px;
  color: var(--green);
  margin: 25px 0;
}
.game-shell {
  max-width: 1380px;
  padding: 5px 5% 70px;
  margin: auto;
}
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 15px 0 20px;
}
.game-top .quiet-link {
  font-size: 14px;
}
.game-top p {
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0;
}
.timer-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--navy);
  padding: 10px 22px;
  border-radius: 6px;
  color: var(--cream);
  min-width: 160px;
}
.timer-box span {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #e1c989;
}
.timer-box strong {
  font:
    600 34px/1.3 Lora,
    serif;
  font-variant-numeric: tabular-nums;
}
.chest-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #eee3cb;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 24px;
}
.digit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 8px;
  color: #777163;
  font-size: 12px;
}
.digit + .digit {
  border-left: 1px solid #d9caad;
}
.digit .symbol {
  font-size: 25px;
  color: #a0813f;
}
.digit b {
  font-size: 25px;
  font-family: Cinzel, serif;
  min-width: 20px;
}
.digit.found {
  color: var(--green);
  background: #e2e8d7;
}
.letter-paper {
  max-width: 820px;
  margin: 0 auto;
  padding: 55px 65px;
  position: relative;
}
.letter-paper:before,
.puzzle-paper:before {
  content: "✥";
  font: 48px/1 Georgia;
  position: absolute;
  right: 18px;
  top: 15px;
  color: #2a648e33;
}
.letter-paper h1 {
  font-size: 36px;
  margin-bottom: 30px;
}
.letter-paper p {
  font-size: 20px;
  line-height: 1.8;
}
.letter-paper .eyebrow {
  font-size: 10px;
}
.signature {
  font-size: 46px !important;
  color: var(--green);
  text-align: right;
  margin: 10px 0 20px;
}
.letter-paper .helper {
  font-size: 12px;
  color: var(--muted);
  margin-top: 15px;
}
.puzzle-paper {
  padding: 38px 45px;
  position: relative;
}
.challenge-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.challenge-heading h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  margin: 0;
}
.challenge-heading .eyebrow {
  font-size: 10px;
  margin-bottom: 6px;
  color: var(--green);
}
.challenge-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 65px;
  height: 70px;
  flex: none;
  background: var(--navy);
  color: var(--gold);
  border-radius: 4px;
  font:
    27px Cinzel,
    serif;
}
.statement {
  font-size: 22px;
  line-height: 1.75;
  max-width: 1050px;
}
.challenge-art {
  margin: 30px 0;
  text-align: center;
}
.alphabet {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 6px;
  max-width: 850px;
  margin: 0 auto 30px;
}
.alphabet > div {
  border: 1px solid #dcd1b9;
  background: #f7edda;
  border-radius: 4px;
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.alphabet b {
  font-size: 21px;
}
.alphabet small {
  font-size: 13px;
  color: var(--muted);
}
.cipher-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 28px;
}
.letter-word {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.letter {
  position: relative;
  margin: 0;
}
.letter input {
  padding: 4px;
  text-align: center;
  text-transform: uppercase;
  font-size: 23px;
  min-height: 48px;
  width: 44px;
  margin: 0;
  border-bottom: 3px solid #b7aa8e;
}
.letter small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}
.starred input {
  background: #fae9b7;
  border-color: #ad8330;
}
.star-label {
  position: absolute;
  top: -22px;
  left: 0;
  right: 0;
  font-size: 15px;
  color: #9b701c;
}
.anagrams {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 900px;
  margin: auto;
}
.anagram {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.scramble {
  font-weight: 600;
  letter-spacing: 3px;
  font-size: 19px;
  text-align: left;
}
.anagram-arrow {
  color: #8f794c;
}
.tree {
  max-width: 520px;
  width: 100%;
  height: auto;
}
.count-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
}
.legend {
  text-align: left;
  font-size: 15px;
  max-width: 250px;
}
.swatch {
  display: inline-block;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 12px;
  border: 1px solid #85784b;
}
.swatch.red {
  background: #c44740;
}
.swatch.gold {
  background: repeating-linear-gradient(45deg, #dcaf45 0 4px, #734f1e 4px 6px);
}
.swatch.green {
  background: radial-gradient(#183e2b 25%, #6ba773 26%);
  background-size: 7px 7px;
}
.helper {
  font-size: 12px;
  color: var(--muted);
}
.countable {
  cursor: pointer;
}
.countable:hover {
  filter: brightness(1.15);
}
.count-check {
  display: none;
  fill: white;
  stroke: #15304a;
  stroke-width: 0.7px;
  font-size: 28px;
  font-weight: bold;
  pointer-events: none;
}
.countable[aria-pressed="true"] .count-check {
  display: block;
}
.countable[aria-pressed="true"] {
  opacity: 0.65;
}
.trays {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}
.trays svg {
  width: min(43%, 340px);
}
.logic-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 30px;
  align-items: start;
}
.logic-clues {
  text-align: left;
  padding-left: 23px;
  font-size: 18px;
}
.logic-clues li {
  padding: 6px 0;
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table small {
  display: block;
  font-size: 10px;
}
thead {
  background: #eee3cb;
}
caption {
  caption-side: bottom;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
}
.logic th,
.logic td {
  border: 1px solid #d6c8ab;
  text-align: center;
  padding: 8px;
}
.logic th {
  font-size: 13px;
}
.logic-cell {
  background: #fffdf5;
  border: 0;
  color: var(--green);
  width: 100%;
  min-width: 43px;
  min-height: 45px;
  font-size: 25px;
}
.mirror-frame {
  max-width: 700px;
  padding: 24px;
  margin: 0 auto 20px;
  border: 12px ridge #bd9c53;
  border-radius: 60px;
  background: #eadfcb;
}
.mirror-frame img {
  width: 100%;
  display: block;
  transition: transform 0.8s;
}
.flipped {
  transform: scaleX(-1);
}
.clock-face {
  width: 260px;
  max-width: 100%;
  height: auto;
}
#answer-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}
#answer-form input {
  max-width: 430px;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 2px;
  font-size: 22px;
  margin: 0;
}
#answer-form label {
  margin: 0;
  text-align: center;
}
#answer-form .number-answer {
  max-width: 130px;
}
#answer-form .button {
  margin-top: 5px;
}
.hints {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.hints p {
  flex-basis: 100%;
  margin: 0;
  background: #f4ead3;
  padding: 12px 18px;
  font-size: 17px;
  color: var(--navy);
}
.lock-wheels {
  display: flex;
  gap: 20px;
  padding: 30px 0;
}
.lock-wheels label {
  width: 110px;
}
.lock-wheels label > span {
  font-size: 13px;
}
.lock-wheels select {
  font:
    40px Cinzel,
    serif;
  text-align: center;
  padding: 12px;
}
.envelope-dialog {
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: var(--cream);
  color: var(--navy);
  max-width: 580px;
  width: 90%;
  text-align: center;
  padding: 40px;
  font:
    20px/1.6 Lora,
    serif;
}
.envelope-dialog::backdrop {
  background: #10263dce;
}
.envelope-icon {
  font-size: 80px;
  color: var(--red);
  animation: envelope 0.7s ease-out;
}
.envelope-dialog .eyebrow {
  color: var(--green);
}
@keyframes envelope {
  from {
    transform: translateY(25px) rotate(-8deg);
    opacity: 0;
  }
  to {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
}
.results {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 25px;
  background: #ede7d3;
  border-radius: 6px;
}
.recipe {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 35px;
}
.recipe li {
  font-size: 17px;
  margin-bottom: 12px;
}
.recipe h2 {
  font-size: 30px;
}
.recipe h3 {
  margin-top: 30px;
}
.diploma-form {
  border-top: 1px solid var(--border);
  padding: 35px 0;
  margin-top: 35px;
}
.diploma-form .button {
  margin-top: 18px;
}
.admin-shell {
  max-width: 1400px;
  padding: 35px 5% 70px;
  margin: auto;
}
.admin-shell section {
  margin-top: 50px;
}
.admin-games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}
.game-settings {
  padding: 25px;
  max-width: 500px;
}
.game-settings label {
  margin-top: 20px;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox input {
  width: 22px;
  height: 22px;
  min-height: 0;
  margin: 0;
}
.gift-section {
  padding: 30px;
}
.gift-section form {
  display: flex;
  gap: 25px;
  align-items: end;
  flex-wrap: wrap;
}
.gift-section label {
  flex: 1;
  min-width: 180px;
}
.sales {
  min-width: 820px;
}
.sales td {
  font-size: 12px;
}
.sale-code {
  font-weight: 600;
  white-space: nowrap;
}
.mail {
  padding: 25px;
  margin-top: 20px;
}
.mail pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    14px/1.7 Lora,
    serif;
}
.legal {
  max-width: 850px;
  margin: 45px auto 70px;
  padding: 50px;
}
.legal h1 {
  font-size: 38px;
}
.loading {
  text-align: center;
  padding: 150px 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 15px;
  top: 10px;
  z-index: 10;
  background: white;
  padding: 15px;
}
@media (min-width: 1600px) {
  .game-shell {
    max-width: 1650px;
  }
  .puzzle-paper {
    padding: 45px 70px;
  }
  .statement {
    font-size: 28px;
  }
  .challenge-heading h1 {
    font-size: 48px;
  }
  .letter-paper {
    max-width: 1000px;
  }
  .letter-paper p {
    font-size: 26px;
  }
  .alphabet {
    max-width: 1050px;
  }
  .alphabet b {
    font-size: 30px;
  }
  .letter input {
    width: 60px;
    min-height: 64px;
    font-size: 32px;
  }
  .anagrams {
    max-width: 1200px;
  }
  .scramble {
    font-size: 26px;
  }
  .tree {
    max-width: 590px;
  }
  .logic-clues {
    font-size: 24px;
  }
  .logic th {
    font-size: 20px;
  }
  .logic-cell {
    min-height: 66px;
    font-size: 32px;
  }
  .timer-box strong {
    font-size: 43px;
  }
  .hints p {
    font-size: 23px;
  }
  .digit {
    font-size: 17px;
  }
  .button {
    font-size: 21px;
  }
}
@media (max-width: 1000px) {
  .hero-inner {
    padding-top: 15px;
    grid-template-columns: 1.1fr 1fr;
  }
  .hero h1 {
    font-size: 6.8vw;
  }
  .subtitle {
    font-size: 3vw;
  }
  .story {
    font-size: 14px;
  }
  .facts {
    font-size: 10px;
    gap: 8px 12px;
  }
  .buy {
    font-size: 13px;
    padding: 15px;
  }
  .hero-picture {
    margin: 0 -10px;
  }
  .steps {
    gap: 25px;
  }
  .steps article {
    padding-left: 0;
    padding-top: 50px;
  }
  .entry-layout {
    gap: 30px;
  }
  .entry-card {
    padding: 28px;
  }
  .anagram {
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
  }
  .scramble {
    min-width: 180px;
  }
  .logic-layout {
    grid-template-columns: 1fr;
  }
  .logic-clues {
    columns: 2;
  }
  .letter input {
    width: 38px;
    font-size: 20px;
  }
  .game-shell {
    padding-left: 3%;
    padding-right: 3%;
  }
  .puzzle-paper {
    padding: 30px;
  }
  .letter-paper {
    padding: 35px 40px;
  }
  .how-link {
    display: none;
  }
  footer small {
    display: none;
  }
}
@media (max-width: 650px) {
  body {
    font-size: 15px;
  }
  header {
    padding: 17px 5%;
    gap: 10px;
  }
  header nav {
    gap: 10px;
    font-size: 11px;
  }
  .brand {
    font-size: 32px;
  }
  .brand span {
    font-size: 6px;
  }
  .button.small {
    font-size: 11px;
    padding: 10px 13px;
  }
  .hero {
    padding-bottom: 35px;
  }
  .bunting {
    width: 180%;
    max-width: none;
    transform: translateX(-20%);
  }
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 10px 7% 0;
    text-align: center;
  }
  .hero .eyebrow {
    font-size: 9px;
    letter-spacing: 1.7px;
    margin-top: 10px;
  }
  .hero h1 {
    font-size: 16vw;
    letter-spacing: -2px;
  }
  .hero h1 span {
    letter-spacing: 5px;
  }
  .subtitle {
    font-size: 8vw;
    white-space: normal;
    margin-bottom: 20px;
  }
  .story {
    font-size: 13px;
    line-height: 1.8;
  }
  .facts {
    justify-content: center;
    font-size: 10px;
    margin: 20px 0;
    gap: 6px 13px;
  }
  .buy {
    font-size: 14px;
    width: 100%;
    padding: 17px 12px;
    gap: 8px;
  }
  .purchase-note {
    font-size: 10px;
  }
  .hero-picture {
    max-width: 440px;
    width: 100%;
    margin: 12px auto 0;
  }
  .house-art {
    margin: 0 auto;
  }
  .illustration-note {
    font-size: 10px;
    margin-top: -15px;
  }
  .how-section {
    padding: 45px 7%;
  }
  .section-title h2 {
    font-size: 29px;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 35px;
  }
  .steps article {
    padding: 0 0 0 54px;
  }
  .step-number {
    font-size: 27px;
  }
  .steps h3 {
    font-size: 21px;
  }
  .steps p {
    max-width: none;
    margin: 0;
    font-size: 13px;
  }
  .catalog-section {
    padding: 20px 7% 45px;
  }
  .catalog-section h2 {
    font-size: 27px;
  }
  .catalog-card {
    padding: 20px;
    gap: 15px;
  }
  .catalog-card h3 {
    font-size: 20px;
  }
  .catalog-star {
    font-size: 35px;
  }
  .catalog-card p {
    font-size: 12px;
  }
  .catalog-card div > span {
    font-size: 10px;
  }
  footer {
    flex-direction: column;
    padding: 30px 5%;
    gap: 25px;
  }
  footer nav {
    justify-content: center;
    font-size: 10px;
  }
  .entry-layout {
    display: block;
    padding: 20px 5% 50px;
  }
  .entry-art {
    display: none;
  }
  .entry-card {
    padding: 30px 25px;
  }
  .entry-card h1 {
    font-size: 31px;
  }
  .center {
    margin: 25px 5% 50px;
    padding: 30px 25px;
  }
  .code-input {
    font-size: 25px;
    letter-spacing: 3px;
  }
  .game-top {
    align-items: flex-start;
    gap: 10px;
  }
  .game-top > div:first-child {
    max-width: 55%;
  }
  .game-top .quiet-link {
    font-size: 11px;
  }
  .game-top p {
    font-size: 10px;
    line-height: 1.5;
  }
  .timer-box {
    min-width: 115px;
    padding: 9px 10px;
  }
  .timer-box span {
    font-size: 7px;
  }
  .timer-box strong {
    font-size: 28px;
  }
  .digit {
    flex-wrap: wrap;
    gap: 0 6px;
    padding: 8px 4px;
    font-size: 9px;
  }
  .digit .symbol {
    font-size: 18px;
  }
  .digit b {
    width: 100%;
    text-align: center;
    font-size: 20px;
  }
  .chest-bar {
    margin-bottom: 15px;
  }
  .game-shell {
    padding-bottom: 35px;
  }
  .letter-paper {
    padding: 30px 23px;
  }
  .letter-paper h1 {
    font-size: 27px;
  }
  .letter-paper p {
    font-size: 17px;
  }
  .signature {
    font-size: 36px !important;
  }
  .puzzle-paper {
    padding: 25px 16px;
  }
  .challenge-heading {
    gap: 12px;
  }
  .challenge-heading h1 {
    font-size: 24px;
  }
  .challenge-badge {
    width: 42px;
    height: 55px;
    font-size: 20px;
  }
  .challenge-heading .eyebrow {
    font-size: 8px;
  }
  .statement {
    font-size: 18px;
    line-height: 1.7;
  }
  .alphabet {
    gap: 3px;
    grid-template-columns: repeat(13, 1fr);
  }
  .alphabet > div {
    padding: 4px 0;
  }
  .alphabet b {
    font-size: 14px;
  }
  .alphabet small {
    font-size: 9px;
  }
  .cipher-words {
    gap: 17px;
  }
  .letter-word {
    gap: 3px;
  }
  .letter input {
    width: 25px;
    min-height: 38px;
    font-size: 17px;
    padding: 1px;
  }
  .cipher-words .letter input {
    width: 34px;
  }
  .letter small {
    font-size: 10px;
  }
  .anagrams {
    gap: 35px;
  }
  .anagram {
    gap: 23px 8px;
    justify-content: center;
    flex-direction: column;
  }
  .anagram-arrow {
    display: none;
  }
  .scramble {
    text-align: center;
    font-size: 16px;
    letter-spacing: 3px;
  }
  .star-label {
    font-size: 12px;
    top: -20px;
  }
  .count-layout {
    flex-direction: column;
    gap: 0;
  }
  .legend {
    max-width: none;
    font-size: 12px;
    width: 100%;
  }
  .legend p {
    display: inline-block;
    margin: 6px 9px 6px 0;
  }
  .legend .helper {
    display: block;
    font-size: 11px;
  }
  .swatch {
    width: 15px;
    height: 15px;
    margin-right: 4px;
  }
  .trays {
    gap: 10px;
  }
  .trays svg {
    width: 100%;
    max-width: 270px;
  }
  .logic-clues {
    columns: 1;
    font-size: 16px;
  }
  .logic-layout {
    gap: 10px;
  }
  .logic th {
    font-size: 10px;
    padding: 5px;
  }
  .logic td {
    padding: 3px;
  }
  .logic-cell {
    min-width: 35px;
    min-height: 42px;
    font-size: 22px;
  }
  .logic th small {
    font-size: 9px;
  }
  .clock-face {
    width: 230px;
  }
  .mirror-frame {
    padding: 8px;
    border-width: 7px;
    border-radius: 28px;
  }
  .challenge-art {
    margin: 24px 0;
  }
  #answer-form {
    margin-top: 25px;
  }
  #answer-form label {
    font-size: 13px;
  }
  #answer-form .button {
    font-size: 14px;
    width: 100%;
  }
  #answer-form input {
    font-size: 19px;
  }
  .hints {
    gap: 5px 10px;
    font-size: 10px;
  }
  .hints p {
    font-size: 14px;
  }
  .hints .text-button {
    font-size: 13px;
  }
  .lock-wheels {
    gap: 8px;
    width: 100%;
    padding: 10px 0;
  }
  .lock-wheels label {
    flex: 1;
    min-width: 0;
  }
  .lock-wheels label > span {
    font-size: 10px;
  }
  .lock-wheels select {
    font-size: 26px;
    padding: 9px 5px;
  }
  .envelope-dialog {
    padding: 28px;
    font-size: 17px;
  }
  .results {
    font-size: 13px;
    gap: 20px;
    padding: 20px;
  }
  .recipe li {
    font-size: 15px;
  }
  .recipe h2 {
    font-size: 25px;
  }
  .diploma-form h2 {
    font-size: 25px;
  }
  .diploma-form .button {
    font-size: 13px;
    width: 100%;
  }
  .legal {
    margin: 25px 5% 45px;
    padding: 30px 24px;
  }
  .legal h1 {
    font-size: 30px;
  }
  .admin-shell {
    padding: 25px 5% 45px;
  }
  .admin-shell h1 {
    font-size: 32px;
  }
  .gift-section {
    padding: 25px;
  }
  .gift-section form {
    display: block;
  }
  .gift-section label {
    margin-bottom: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.symbol-svg {
  width: 1.15em;
  height: 1.15em;
  vertical-align: middle;
  flex: none;
}
.chest-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 3px 10px #15304a10;
}

/* Nivel Experto: los mismos componentes con el color del PDF de referencia. */
.expert-theme {
  --navy: #520f20;
}
.expert-theme .puzzle-paper:before {
  content: none;
}
.level-label {
  display: inline-block;
  border: 1px solid var(--gold);
  padding: 5px 18px;
  color: var(--red);
  font:
    600 15px Lora,
    serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero .level-label {
  color: #efd790;
  margin: 0 0 22px;
}
.seal {
  width: 84px;
  height: 84px;
  flex: none;
  fill: none;
  stroke: var(--red);
  stroke-width: 3;
  color: var(--red);
}
.seal-chucho {
  stroke: var(--green);
  color: var(--green);
}
.seal .seal-fill {
  fill: currentColor;
  stroke: none;
}
.challenge-heading > .seal {
  width: 60px;
  height: 60px;
  order: 3;
  margin-left: auto;
}
.seal-guide {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  font-size: 14px;
}
.seal-guide > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.seal-guide .seal {
  width: 64px;
  height: 64px;
}
.cipher-layout {
  display: grid;
  grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.wheel-tool {
  max-width: 440px;
  margin: auto;
  width: 100%;
}
#cipher-wheel {
  display: block;
  width: 100%;
  font:
    600 18px Lora,
    serif;
}
#wheel-inner {
  cursor: grab;
  touch-action: none;
}
#wheel-inner:active {
  cursor: grabbing;
}
.wheel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
}
.wheel-controls .button {
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  font-size: 22px;
}
.wheel-tool .helper {
  font-size: 12px;
  margin: 12px 0 0;
}
.wheel-clue {
  text-align: left;
  padding: 18px 22px;
  border-left: 3px solid var(--gold);
  background: #eee3cb;
  font-size: 17px;
}
.cipher-notes .cipher-words {
  gap: 18px;
}
.cipher-notes .letter-word {
  flex-wrap: nowrap;
  gap: 3px;
}
.cipher-notes .letter input {
  width: clamp(24px, 2.4vw, 36px);
}
.posada-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.5fr);
  align-items: start;
  gap: 28px;
}
.posada-layout .logic-clues {
  font-size: 16px;
  text-align: left;
  padding-left: 24px;
}
.posada-table {
  width: 100%;
  table-layout: fixed;
  font-size: 14px;
  border-collapse: collapse;
}
.posada-table caption {
  padding: 0 10px 14px;
  font-style: italic;
  color: var(--muted);
}
.posada-table th,
.posada-table td {
  border: 1px solid var(--border);
  padding: 10px 5px;
}
.posada-table thead {
  background: #eee3cb;
}
.posada-table th:first-child {
  width: 20%;
}
.posada-table th:nth-child(2) {
  width: 14%;
}
.posada-table th:nth-child(3) {
  width: 38%;
}
.posada-table select {
  width: 100%;
  min-width: 0;
  padding: 10px 4px;
  font-size: 13px;
}
.posada-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 24px;
}
.posada-answers label {
  display: block;
}
.posada-answers input {
  width: 100%;
}
.lottery-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  max-width: 470px;
  padding: 14px;
  margin: auto;
  border: 2px solid var(--gold);
  border-radius: 5px;
  background: #e7d7b7;
}
.number-card {
  position: relative;
  min-height: 62px;
  border: 1px solid #b7a27c;
  border-radius: 3px;
  background: #fff9ec;
  color: #520f20;
  box-shadow: inset 0 0 0 4px #f2e6ce;
}
.number-card b {
  font:
    600 26px Lora,
    serif;
}
.card-ornament {
  position: absolute;
  top: 1px;
  left: 5px;
  font-size: 11px;
  color: #a6823a;
}
.card-check {
  display: none;
  position: absolute;
  bottom: 0;
  right: 4px;
  font-size: 12px;
}
.number-card[aria-pressed="true"] {
  background: var(--green);
  color: white;
  box-shadow: inset 0 0 0 4px #477857;
  border-color: var(--green);
}
.number-card[aria-pressed="true"] .card-check {
  display: block;
}
.number-card[aria-pressed="true"] .card-ornament {
  color: #e1c989;
}
.balances {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.balances figure {
  margin: 0;
  border: 1px solid var(--border);
  padding: 14px 4px;
  background: #fff9ee;
  border-radius: 6px;
}
.balances figcaption {
  font:
    600 16px Playfair,
    serif;
}
.balances svg {
  display: block;
  width: 100%;
  margin: 8px 0;
}
.balances p {
  font-size: 13px;
  margin: 0;
}
.notes-pair {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  align-items: center;
  gap: 30px;
  text-align: left;
}
.notes-pair article {
  padding: 25px;
  border: 1px solid var(--border);
  background: #fff9ee;
  box-shadow: 3px 6px 0 #dcc8a233;
}
.notes-pair .seal {
  display: block;
  margin: 0 0 20px;
}
.poem-lines {
  font-size: 18px;
  line-height: 1.9;
}
.poem-lines p {
  margin: 0;
  padding-left: 1em;
  text-indent: -1em;
}
.false-note {
  transform: rotate(2deg);
  font-style: italic;
}
.reflected-clock-frame {
  max-width: 350px;
  margin: auto;
  padding: 18px;
  background: linear-gradient(135deg, #ad8137, #e8d09b, #ad8137);
  border: 3px solid #b08b42;
  border-radius: 48% 48% 8px 8px;
  box-shadow: 0 10px 25px #51351420;
}
.reflected-clock {
  display: block;
  width: 100%;
  border-radius: 50%;
  background: #e9f0ed;
}
.order-rules {
  text-align: left;
  font-size: 20px;
  max-width: 800px;
  margin: 0 auto 30px;
}
.order-rules li {
  margin-bottom: 12px;
  padding-left: 6px;
}
.order-pieces {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  max-width: 720px;
  margin: auto;
  padding: 0;
  gap: 14px;
}
.order-pieces li {
  background: #f3e7cf;
  border: 1px solid var(--gold);
  padding: 16px 8px 10px;
  border-radius: 5px;
  cursor: grab;
}
.order-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 14px;
}
.order-pieces strong {
  display: block;
  font:
    600 48px Playfair,
    serif;
  margin: 12px 0;
}
.order-pieces button {
  color: var(--navy);
  background: #fff9ec;
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 44px;
  min-height: 44px;
  font-size: 22px;
}
.prank-dialog > .seal {
  display: block;
  margin: 0 auto 20px;
}
@media (max-width: 1000px) {
  .cipher-layout,
  .posada-layout {
    grid-template-columns: 1fr;
  }
  .cipher-notes .letter input {
    width: 32px;
  }
  .cipher-notes {
    max-width: 600px;
    margin: auto;
  }
  .notes-pair {
    grid-template-columns: 1fr;
  }
  .balances {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: auto;
  }
}
@media (max-width: 650px) {
  .challenge-heading > .seal {
    width: 38px;
    height: 38px;
  }
  .expert-theme .challenge-heading {
    gap: 10px;
  }
  .expert-theme .challenge-badge {
    width: 42px;
    height: 52px;
    font-size: 22px;
  }
  .seal-guide,
  .posada-answers {
    grid-template-columns: 1fr;
  }
  .cipher-layout {
    gap: 24px;
  }
  .cipher-notes .letter input {
    width: 24px;
    font-size: 19px;
  }
  .wheel-clue {
    font-size: 15px;
    padding: 14px;
  }
  .wheel-controls {
    gap: 8px;
    font-size: 12px;
  }
  .posada-table,
  .posada-table tbody,
  .posada-table tr,
  .posada-table td,
  .posada-table th {
    display: block;
    width: 100% !important;
  }
  .posada-table {
    font-size: 15px;
  }
  .posada-table caption {
    display: block;
  }
  .posada-table thead {
    display: none;
  }
  .posada-table tr {
    margin-bottom: 14px;
    border: 1px solid var(--border);
  }
  .posada-table th {
    background: #eee3cb;
    text-align: left;
    padding: 10px 14px;
  }
  .posada-table td {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border: 0;
  }
  .posada-table td::before {
    content: attr(data-label);
    text-align: left;
  }
  .posada-table select {
    font-size: 16px;
  }
  .lottery-board {
    gap: 5px;
    padding: 8px;
  }
  .number-card {
    min-height: 52px;
    padding: 4px;
  }
  .number-card b {
    font-size: 22px;
  }
  .notes-pair article {
    padding: 18px;
  }
  .poem-lines {
    font-size: 16px;
  }
  .order-rules {
    font-size: 17px;
    padding-left: 23px;
  }
  .order-pieces {
    gap: 5px;
  }
  .order-pieces li {
    padding: 10px 3px 5px;
  }
  .order-mark {
    flex-direction: column;
    font-size: 10px;
  }
  .order-pieces strong {
    font-size: 36px;
  }
  .order-pieces button {
    display: block;
    width: 100%;
    margin: 4px 0;
  }
}

/* Expediente de la Estrella de Plata */
.silver-theme {
  --navy: #123f4a;
  --gold: #c9d0d6;
  --red: #245b68;
  --border: #c6d0cf;
}
.silver-theme .hero .level-label {
  color: #dbe4e8;
}
.silver-theme .hero h1 {
  font-size: clamp(2.4rem, 4.1vw, 4.8rem);
  line-height: 1.13;
  letter-spacing: 0;
}
.silver-theme .hero .subtitle {
  font-size: clamp(1.7rem, 2.5vw, 2.8rem);
}
.silver-theme .paper,
.silver-theme .puzzle-paper,
.silver-theme .letter-paper {
  border-color: #c6d0cf;
}
.silver-theme .puzzle-paper:before {
  content: none;
}
.hacienda {
  display: block;
  width: 100%;
}
.case-shell {
  max-width: 1540px;
}
.penalty-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  background: #e4ebea;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 14px;
  margin-bottom: 20px;
}
.case-shell #message:empty {
  display: none;
}
.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 24px;
}
.case-sidebar {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 20px;
  min-width: 0;
}
.case-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
.case-main .letter-paper {
  padding: 35px;
}
.case-main .puzzle-paper {
  padding: 30px;
}
.case-main h1 {
  font-size: clamp(1.7rem, 2.5vw, 2.7rem);
}
.case-main .statement {
  font-size: 20px;
}
.case-dossier,
.case-envelopes {
  padding: 20px;
}
.case-dossier .eyebrow {
  font-size: 10px;
}
.case-dossier [role="tablist"] {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 3px;
}
.case-dossier [role="tab"] {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 12px 3px;
  font-size: 12px;
}
.case-dossier [role="tab"][aria-selected="true"] {
  background: var(--navy);
  color: white;
  border-radius: 5px 5px 0 0;
}
.case-dossier [role="tabpanel"] {
  max-height: 440px;
  overflow: auto;
  padding: 20px 5px 5px;
  font-size: 14px;
}
.case-dossier [role="tabpanel"][hidden] {
  display: none;
}
.case-dossier .signature {
  font-size: 30px !important;
}
.suspects article {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.suspects h3 {
  font-size: 18px;
  margin: 0 0 8px;
}
.suspects p {
  margin: 0 0 10px;
}
#case-notes {
  width: 100%;
  font-size: 16px;
  margin-top: 8px;
}
.case-dossier label {
  display: block;
  margin-top: 18px;
}
.estate-map {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.estate-map article {
  background: #e4ebea;
  border: 2px solid #aebec2;
  text-align: center;
  padding: 18px 8px;
}
.estate-map h3 {
  font-size: 16px;
  margin: 8px 0;
}
.estate-map p {
  font-size: 11px;
  margin: 0;
}
.case-envelopes h2 {
  font-size: 25px;
  margin-bottom: 20px;
}
.envelope-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.case-envelope {
  display: grid;
  justify-items: center;
  gap: 4px;
  background: linear-gradient(155deg, #f5f1e4 50%, #e9e4d5 50%);
  padding: 14px 5px;
  border: 1px solid #b4bfc2;
  border-radius: 4px;
}
.case-envelope > span {
  font-size: 25px;
  line-height: 1;
  color: #8a9ca5;
}
.case-envelope b {
  font-size: 13px;
  letter-spacing: 0.05em;
}
.case-envelope small {
  font-size: 11px;
  color: #6a716e;
}
.case-envelope.open {
  background: #dfece3;
}
#envelope-form {
  margin-top: 22px;
}
#envelope-form input {
  width: 100%;
}
#envelope-form .button {
  width: 100%;
  margin-top: 12px;
  font-size: 14px;
}
.case-rules {
  padding-left: 22px;
}
.case-rules li {
  margin-bottom: 18px;
}
.envelope-awaiting {
  text-align: center;
  padding: 75px 30px !important;
}
.envelope-awaiting > span {
  font-size: 80px;
  color: #859da6;
}
.case-program {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  text-align: left;
}
.case-program li {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  align-items: baseline;
}
.case-program p {
  margin: 0;
}
.line-number {
  display: block;
  background: #dce7e8;
  font-size: 13px;
  width: 24px;
  min-width: 24px;
  text-align: center;
  border-radius: 3px;
}
.program-word {
  border: 0;
  background: transparent;
  padding: 3px 1px;
  color: inherit;
  font: inherit;
  border-radius: 3px;
}
.program-word:hover,
.program-word.selected {
  background: #b9d4d7;
  color: #123f4a;
}
.word-position {
  min-height: 24px;
  color: #395d67;
  font-size: 13px;
  margin: 15px 0;
}
.book-code {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 25px 0;
}
.book-code span {
  background: #dce7e8;
  border: 1px solid #9cb3b9;
  border-radius: 4px;
  padding: 8px 14px;
  font:
    600 21px Lora,
    serif;
}
.case-challenge {
  margin: 25px 0;
}
.testimonies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.testimonies blockquote {
  margin: 0;
  padding: 18px;
  background: #edf0e9;
  border-left: 3px solid #9ab1b8;
  font-size: 16px;
}
.testimonies cite {
  font-style: normal;
  font-weight: 600;
  font-size: 14px;
}
.testimonies p {
  margin-bottom: 12px;
}
.case-table-scroll {
  overflow-x: auto;
  margin-top: 25px;
}
.deductions {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.deductions td,
.deductions th {
  border: 1px solid var(--border);
  padding: 7px;
  text-align: center;
}
.deductions th {
  background: #e4ebea;
}
.deductions button {
  min-width: 40px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 24px;
}
.deductions caption {
  padding-bottom: 12px;
  text-align: left;
  font-size: 13px;
}
#case-answer {
  text-align: center;
  margin-top: 30px;
}
#case-answer > label {
  display: block;
  font-weight: 600;
}
#case-response {
  display: block;
  max-width: 400px;
  margin: 8px auto 15px;
  width: 100%;
  text-align: center;
  text-transform: uppercase;
}
#cipher-key {
  display: block;
  max-width: 350px;
  text-transform: uppercase;
}
#key-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 0 24px;
}
#key-letters button {
  min-width: 36px;
  min-height: 40px;
  border: 1px solid var(--border);
  background: #e4ebea;
  color: var(--navy);
}
.case-challenge .cipher-words {
  margin-bottom: 18px;
}
.case-challenge .letter input {
  width: 36px;
  padding: 0;
  font-size: 25px;
}
.vigenere-scroll {
  max-width: 100%;
  max-height: 650px;
  overflow: auto;
  border: 1px solid #9ab1b8;
  margin: 20px 0;
}
.vigenere-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  font:
    14px Lora,
    serif;
  text-align: center;
}
.vigenere-table th,
.vigenere-table td {
  min-width: 26px;
  height: 26px;
  padding: 2px;
  border-right: 1px solid #d0dbdb;
  border-bottom: 1px solid #d0dbdb;
}
.vigenere-table th {
  background: #d3e0e1;
  font-weight: 600;
  position: sticky;
  left: 0;
}
.vigenere-table thead th {
  top: 0;
  z-index: 1;
}
.vigenere-table tr.selected td,
.vigenere-table tr.selected th {
  background: #a9cdd0;
  color: #0b3039;
  font-weight: 600;
}
.case-photos {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.case-photos li {
  background: #fffaf0;
  padding: 10px;
  border: 1px solid #b4bfc2;
  box-shadow: 3px 4px 0 #c9d0d633;
  border-radius: 4px;
  cursor: grab;
}
.case-photos figure {
  margin: 0;
}
.case-photos svg {
  display: block;
  width: 100%;
}
.case-photos figcaption {
  position: relative;
  padding: 18px 6px 0;
}
.case-photos figcaption strong {
  position: absolute;
  top: -22px;
  right: 8px;
  background: #123f4a;
  border: 3px solid #c9d0d6;
  border-radius: 50%;
  color: white;
  padding: 2px 12px;
  font:
    600 26px Playfair,
    serif;
}
.case-photos p {
  font-size: 15px;
  margin: 10px 0;
}
.move-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.move-buttons button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #b4bfc2;
  border-radius: 4px;
  background: #edf0e9;
  color: var(--navy);
  font-size: 24px;
}
.photo-word {
  font:
    600 25px Lora,
    serif;
  text-align: center;
  letter-spacing: 0.1em;
}
.sudoku-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  max-width: 450px;
  margin: 25px auto 15px;
  border: 3px solid #123f4a;
  background: #fffcf4;
}
.sudoku-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b4bfc2;
}
.sudoku-cell.block-bottom {
  border-bottom: 3px solid #123f4a;
}
.sudoku-cell.block-right {
  border-right: 3px solid #123f4a;
}
.sudoku-cell:nth-child(6n) {
  border-right: 0;
}
.sudoku-cell:nth-last-child(-n + 6) {
  border-bottom: 0;
}
.sudoku-cell.given {
  background: #e1e8e7;
}
.sudoku-cell b {
  font:
    600 28px Lora,
    serif;
}
.sudoku-cell select {
  appearance: none;
  background: transparent;
  color: var(--navy);
  border: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 14px 0 0;
  text-align: center;
  font:
    600 27px Lora,
    serif;
  border-radius: 0;
  cursor: pointer;
}
.cell-mark {
  position: absolute;
  top: 1px;
  left: 4px;
  font-size: 13px;
  pointer-events: none;
}
.sudoku-key {
  text-align: center;
  font-size: 25px;
}
.sudoku-key small {
  font-size: 13px;
}
#accusation-form label {
  display: block;
  margin: 20px 0 8px;
}
#accusation-form select {
  width: 100%;
}
#accusation-form .button {
  margin-top: 25px;
}
.saved-accusation {
  background: #e8eeea;
  padding: 20px;
  margin: 20px 0;
  border: 1px solid #b4bfc2;
}
.saved-accusation h2 {
  font-size: 23px;
}
.saved-accusation p {
  margin: 8px 0;
}
.torn-letter {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.torn-letter li {
  padding: 22px 18px 12px;
  background: #efe7d4;
  border: 1px dashed #a6a89d;
  clip-path: polygon(
    0 1%,
    8% 0,
    17% 2%,
    30% 0,
    46% 1%,
    62% 0,
    81% 2%,
    100% 0,
    99% 98%,
    86% 100%,
    62% 98%,
    36% 100%,
    16% 98%,
    0 100%
  );
  cursor: grab;
}
.torn-letter p {
  font-size: 17px;
  line-height: 1.9;
}
.letter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.case-final h2 {
  font-size: 28px;
  margin-top: 25px;
}
.accusation-results {
  list-style: none;
  padding: 0;
}
.accusation-results li {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.accusation-results li > span {
  font-size: 32px;
}
.accusation-results p {
  font-size: 17px;
  margin: 0;
}
.correct {
  color: #28714d;
}
.incorrect {
  color: #a53742;
}
.case-results {
  background: #e4ebea;
  padding: 18px;
  margin: 25px 0;
}
.case-results p {
  font-size: 16px;
  margin: 4px 0;
}
#certificate-form textarea {
  display: block;
  width: 100%;
  margin: 8px 0 15px;
}
@media (max-width: 1100px) {
  .case-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 16px;
  }
  .case-main .puzzle-paper,
  .case-main .letter-paper {
    padding: 22px;
  }
  .testimonies,
  .case-photos {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 850px) {
  .case-layout {
    display: flex;
    flex-direction: column;
  }
  .case-sidebar,
  .case-main {
    width: 100%;
  }
  .case-sidebar {
    grid-template-columns: 1fr 1fr;
  }
  .case-dossier [role="tabpanel"] {
    max-height: 350px;
  }
  .case-photos,
  .testimonies {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 650px) {
  .case-sidebar {
    grid-template-columns: 1fr;
  }
  .case-main .puzzle-paper,
  .case-main .letter-paper {
    padding: 20px 16px;
  }
  .case-dossier [role="tabpanel"] {
    max-height: 300px;
  }
  .case-dossier [role="tab"] {
    font-size: 12px;
  }
  .case-main .statement {
    font-size: 18px;
  }
  .case-main .challenge-badge {
    width: 45px;
    height: 55px;
  }
  .case-main .challenge-heading {
    gap: 12px;
  }
  .penalty-bar {
    font-size: 12px;
    padding: 12px;
  }
  .case-photos,
  .testimonies,
  .torn-letter {
    grid-template-columns: 1fr;
  }
  .envelope-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .case-envelope b {
    font-size: 10px;
  }
  .case-envelope small {
    font-size: 10px;
  }
  .case-program {
    font-size: 16px;
  }
  .case-challenge .letter input {
    width: 29px;
    font-size: 20px;
  }
  .case-challenge .letter-word {
    gap: 3px;
  }
  .case-main .letter-paper p {
    font-size: 18px;
  }
  .deductions td,
  .deductions th {
    padding: 3px;
    font-size: 12px;
  }
  .deductions button {
    min-width: 34px;
  }
  .sudoku-cell select {
    font-size: 23px;
  }
  .case-results p {
    font-size: 15px;
  }
  .letter-actions .button {
    width: 100%;
  }
}

.silver-theme .hero .subtitle,
.silver-theme .hero .eyebrow,
.silver-theme .timer-box span {
  color: #c9d0d6;
}
.silver-theme .buy {
  background: #c9d0d6;
  color: #123f4a;
}
.case-jumps {
  display: none;
}
@media (max-width: 850px) {
  .case-jumps {
    display: flex;
    gap: 15px;
    justify-content: space-around;
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 12px;
    background: #f7f2e4;
    border: 1px solid #c6d0cf;
    border-radius: 5px;
    margin-bottom: 16px;
    font-size: 14px;
  }
  #case-file,
  #case-main {
    scroll-margin-top: 60px;
  }
}

.case-jumps button {
  border: 0;
  background: transparent;
  color: var(--navy);
  font: inherit;
  padding: 5px;
}

/* Antes de la Medianoche: mantiene el estilo de InvitaYa con azul y champaña. */
.midnight-theme {
  --navy: #101a3c;
  --green: #25335b;
  --red: #866223;
  --gold: #c9a24a;
  --cream: #f7f0df;
  --border: #d8c9a5;
  background: #f7f0df;
}
.midnight-theme .hero {
  background: linear-gradient(155deg, #101a3c, #070d22);
  color: #fff3d8;
}
.midnight-theme .hero .story,
.midnight-theme .hero .facts,
.midnight-theme .hero .purchase-note,
.midnight-theme .illustration-note {
  color: #e9dfc8;
}
.midnight-theme .hero .eyebrow,
.midnight-theme .hero .subtitle,
.midnight-theme .hero .level-label {
  color: #e9cf8a;
}
.midnight-theme .hero .buy {
  background: #e9cf8a;
  color: #101a3c;
  border-color: #e9cf8a;
}
.midnight-theme .hero-picture svg {
  width: 100%;
  max-height: 620px;
}
.year-shell {
  max-width: 1540px;
}
.year-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
}
.year-sidebar {
  position: sticky;
  top: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  background: #efe6d0;
  border-radius: 4px;
}
.year-sidebar h2 {
  font-size: 23px;
  margin-top: 22px;
}
.year-letter summary {
  cursor: pointer;
  font-weight: 600;
}
.year-letter p {
  font-size: 14px;
  margin-top: 12px;
}
.year-envelopes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 20px;
}
.year-envelope {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  padding: 9px 4px;
  border: 1px solid #cbb98c;
  background: #faf4e5;
}
.year-envelope span {
  color: #a18a59;
  font-size: 24px;
  line-height: 1;
}
.year-envelope b {
  font-size: 11px;
  letter-spacing: 1px;
}
.year-envelope small {
  font-size: 10px;
}
.year-envelope.ready {
  box-shadow: inset 0 0 0 2px #c9a24a;
}
.year-envelope.open {
  background: #dce5df;
}
.year-sidebar input {
  min-width: 0;
}
.year-tabs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 23px;
}
.year-tabs button {
  display: flex;
  gap: 10px;
  text-align: left;
  padding: 10px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid transparent;
  background: transparent;
  color: var(--navy);
}
.year-tabs button > b {
  font-size: 20px;
  opacity: 0.7;
}
.year-tabs small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}
.year-tabs button.active {
  background: #101a3c;
  color: #fff3d8;
  border-color: #c9a24a;
}
.year-main {
  min-width: 0;
  scroll-margin-top: 20px;
}
.year-main #message:empty {
  display: none;
}
.year-main .puzzle-paper,
.year-main .letter-paper {
  max-width: none;
  margin: 0;
  padding: clamp(20px, 3vw, 52px);
}
.year-main h1 {
  font-size: clamp(28px, 2.6vw, 44px);
}
.year-main .statement {
  font-size: clamp(16px, 1.25vw, 21px);
  max-width: none;
}
.year-main form {
  margin-top: 28px;
}
.year-main .letter-paper p {
  max-width: 900px;
}
.year-main .year-letter {
  margin-bottom: 20px;
}
.wordsearch-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1.25fr) minmax(230px, 1fr);
  gap: 26px;
  align-items: start;
}
.wordsearch {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  aspect-ratio: 1;
  border: 2px solid #a99058;
  touch-action: none;
  user-select: none;
}
.wordsearch button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: clamp(12px, 1.15vw, 20px);
  line-height: 1;
  color: #101a3c;
  border: 0;
  border-right: 1px solid #d4c7a9;
  border-bottom: 1px solid #d4c7a9;
  background: #fffdf5;
  touch-action: none;
}
.wordsearch button.found {
  background: #d7e5dc;
  color: #486a55;
}
.wordsearch button.selecting {
  background: #e9cf8a;
}
.wordsearch button.remaining {
  color: #101a3c;
  background: #e9cf8a;
  font-weight: 600;
}
.found-count {
  font-size: 14px;
  font-weight: 600;
}
.riddles {
  padding-left: 22px;
  margin: 0;
  max-height: 690px;
  overflow: auto;
  font-size: 14px;
}
.riddles li {
  padding: 0 5px 9px;
}
.riddles li.done {
  text-decoration: line-through;
  color: #58745b;
}
.riddles small {
  white-space: nowrap;
}
.secret-postcards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.postcard {
  min-height: 185px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  color: #101a3c;
  background: #f6edda;
  border: 1px solid #c3a25a;
  box-shadow:
    inset 0 0 0 6px #fffcf3,
    inset 0 0 0 7px #d8c9a5;
}
.postcard small {
  font-size: 9px;
  letter-spacing: 1px;
}
.postcard strong {
  font: 40px Vibes;
  margin: 12px 0;
}
.postcard span:last-child {
  font-size: 11px;
}
.year-dialog {
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  overflow: auto;
  padding: 38px;
  color: #101a3c;
  border: 2px solid #c9a24a;
  background: #faf4e6;
}
.year-dialog::backdrop {
  background: #070d22dd;
}
.year-dialog h2 {
  font-size: 32px;
}
.year-dialog .postcard-text {
  font-size: 24px;
}
.year-dialog button {
  margin-top: 16px;
}
.light-garland {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  margin: 20px 0;
  border-radius: 6px;
  background: #101a3c;
}
.light-letter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 16px 2px;
  border-top: 2px solid #e9cf8a;
}
.bulb {
  display: inline-block;
  width: 16px;
  height: 23px;
  border-radius: 50%;
  background: #a26944;
  border: 1px solid #e9cf8a;
  position: relative;
}
.bulb:before {
  content: "";
  height: 18px;
  width: 1px;
  background: #e9cf8a;
  position: absolute;
  bottom: 100%;
  left: 50%;
}
.bulb.long {
  width: 13px;
  height: 39px;
  background: #406452;
}
.bulb.lit {
  background: #fffbd4;
  box-shadow: 0 0 18px 6px #e9cf8a88;
}
.light-separator {
  color: #e9cf8a;
  font-size: 28px;
}
.light-leaf {
  color: #81a575;
  font-size: 24px;
}
.morse-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
#lights-status {
  font-size: 13px;
}
.morse-table {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  background: #f1e6ce;
  padding: 20px;
}
.morse-table span {
  font-size: 16px;
  white-space: nowrap;
}
.morse-table b {
  margin-right: 8px;
}
.match-board {
  width: 100%;
  max-height: 310px;
  user-select: none;
  touch-action: none;
}
.match-board g {
  cursor: pointer;
}
.stick-touch {
  fill: transparent;
}
.stick {
  fill: #bc884c;
  stroke: #73512e;
  stroke-width: 1.5;
}
.stick-slot {
  fill: #fff6e8;
  stroke: #d2c4a6;
  stroke-dasharray: 3 4;
}
.match-board .selected .stick {
  fill: #e9cf8a;
  stroke: #101a3c;
  stroke-width: 4;
}
.nonogram {
  display: grid;
  grid-template-columns: 40px repeat(10, minmax(0, 1fr));
  max-width: 550px;
  margin: 32px auto;
}
.nono-clue {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.nono-clue.column {
  flex-direction: column;
  padding: 8px 0;
  line-height: 1.3;
  justify-content: flex-end;
}
.nonogram button {
  padding: 0;
  aspect-ratio: 1;
  font-size: 26px;
  line-height: 1;
  color: #6c6b6b;
  background: #fffef7;
  border: 1px solid #a9a08a;
  border-radius: 0;
}
.nonogram button.painted {
  background: #101a3c;
}
.spot-scenes {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 680px;
  margin: 0 auto;
  gap: 20px;
}
.spot-scenes figure {
  margin: 0;
}
.spot-scenes img {
  width: 100%;
  display: block;
  border-radius: 5px;
}
.spot-scenes figcaption {
  font-size: 13px;
  padding: 7px 0;
}
.spot-image {
  position: relative;
  cursor: crosshair;
  user-select: none;
}
.spot-ring {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px solid #ffdf63;
  border-radius: 50%;
  pointer-events: none;
}
.spot-ring b {
  position: absolute;
  bottom: -18px;
  right: -4px;
  min-width: 23px;
  text-align: center;
  border-radius: 50%;
  background: #ffdf63;
  color: #101a3c;
  font-size: 16px;
  line-height: 23px;
}
.spot-letters {
  text-align: center;
  font-size: 32px;
  letter-spacing: 8px;
  margin-top: 20px;
}
.crossword-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(200px, 1fr);
  gap: 28px;
  align-items: start;
}
.crossword {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.cross-cell {
  margin: 0;
  display: block;
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #8a826b;
  background: #fffdf6;
}
.cross-cell.marked {
  background: #f0d58b;
}
.cross-cell small {
  position: absolute;
  top: 0;
  left: 2px;
  font: 9px Lora;
  z-index: 1;
}
.cross-cell b {
  position: absolute;
  bottom: 0;
  right: 2px;
  color: #9a352d;
  font: 9px Lora;
  z-index: 1;
}
.cross-cell input {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 7px 0 0;
  margin: 0;
  text-align: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #101a3c;
  font-size: 20px;
  text-transform: uppercase;
}
.cross-clues {
  font-size: 14px;
  line-height: 1.6;
}
.cross-clues p {
  margin-bottom: 10px;
}
.cross-clues h3 {
  font-size: 20px;
}
.cross-extract {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.cross-extract span {
  display: flex;
  flex-direction: column;
  min-width: 30px;
  text-align: center;
}
.cross-extract small {
  font-size: 11px;
}
.cross-extract b {
  font-size: 27px;
  border-bottom: 1px solid #b59b61;
}
.year-sudoku {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  max-width: 590px;
  border: 2px solid #101a3c;
  margin: 28px auto;
}
.year-sudoku .sudoku-cell {
  border-color: #b8ab8e;
  aspect-ratio: 1;
  margin: 0;
}
.year-sudoku .block-right {
  border-right: 2px solid #101a3c;
}
.year-sudoku .block-bottom {
  border-bottom: 2px solid #101a3c;
}
.year-sudoku select {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 10px 0 0;
  text-align: center;
  text-align-last: center;
  appearance: none;
  background: transparent;
  font-size: 24px;
  color: #101a3c;
}
.year-sudoku .given {
  background: #e5e3d8;
}
.year-sudoku .given b {
  font-size: 24px;
}
.symbol-entry,
.year-lock {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin: 20px 0;
}
.symbol-entry label {
  text-align: center;
  font-size: 25px;
}
.symbol-entry select,
.year-lock select {
  font-size: 24px;
  min-width: 58px;
  width: 70px;
  text-align: center;
  padding: 10px;
}
.town-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin: 30px auto;
  max-width: 690px;
  padding: 12px;
  border: 1px solid #b5a06c;
  background: #dfceab;
}
.map-piece {
  min-width: 0;
  background: #f5e9cb;
  border: 2px dashed #c49b58;
  cursor: grab;
}
.map-piece.picked {
  border: 3px solid #183b77;
}
.piece-cells {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.map-square {
  background: #f2e3bd;
  border: 1px solid #b19b70;
  border-radius: 0;
  position: relative;
  padding: 8px 2px 2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
  aspect-ratio: 0.82;
  color: #4e4638;
}
.map-square svg {
  width: 90%;
  height: auto;
  max-height: 90px;
}
.map-square small {
  font-size: clamp(10px, 1.1vw, 16px);
  letter-spacing: 1px;
  line-height: 1.3;
  white-space: nowrap;
}
.edge-row {
  position: absolute;
  left: 2px;
  top: 35%;
  font-size: 10px;
  font-weight: 600;
  color: #a44333;
}
.edge-col {
  position: absolute;
  top: 0;
  left: 48%;
  font-size: 10px;
  font-weight: 600;
  color: #a44333;
}
.town-square {
  background: #bbd2dd;
  color: #345061;
  font-size: 30px;
}
.piece-select {
  width: 100%;
  background: #faf6e9;
  border: 0;
  border-top: 1px solid #b7a075;
  padding: 7px 1px;
  font-size: 11px;
  color: #101a3c;
}
.town-map.assembled {
  gap: 0;
  padding: 0;
}
.assembled .map-piece {
  border: 0;
  cursor: default;
}
.map-actions,
.bells-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.saved-clues,
.year-results {
  margin: 22px 0;
  padding: 18px;
  background: #e9e1d0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
}
.door-symbols {
  font-size: 52px;
  letter-spacing: 12px;
  text-align: center;
}
.year-results p {
  margin: 0;
}
.wish-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin-bottom: 20px;
}
.wish-grid label {
  display: flex;
  align-items: start;
  gap: 12px;
  color: #89703c;
}
.wish-grid textarea {
  width: 100%;
  margin: 0;
  min-height: 80px;
  font-size: 16px;
  padding: 10px;
  background: #fffdf6;
  border: 1px solid #cab989;
  color: #101a3c;
  resize: vertical;
}
#year-restart {
  margin-top: 25px;
}
#year-time {
  max-width: 220px;
}
#year-start .button {
  display: block;
}
@media (min-width: 1600px) {
  .year-main .statement {
    font-size: 21px;
  }
  .wordsearch button {
    font-size: 21px;
  }
}
@media (max-width: 1100px) {
  .year-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
  }
  .year-sidebar {
    padding: 15px;
  }
  .wordsearch-layout,
  .crossword-layout {
    grid-template-columns: 1fr;
  }
  .riddles {
    max-height: 350px;
    columns: 2;
  }
  .secret-postcards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wordsearch button {
    font-size: 20px;
  }
  .cross-clues {
    columns: 2;
  }
  .morse-table {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .year-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .year-sidebar {
    position: static;
    width: 100%;
    padding: 15px;
  }
  .year-main {
    width: 100%;
  }
  .year-main .puzzle-paper,
  .year-main .letter-paper {
    padding: 18px 14px;
  }
  .year-sidebar h2 {
    font-size: 19px;
    margin: 14px 0 10px;
  }
  .year-envelopes {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 8px;
  }
  .year-envelope {
    min-height: 70px;
    padding: 6px 2px;
  }
  .year-envelope b {
    font-size: 8px;
    letter-spacing: 0;
  }
  .year-envelope small {
    font-size: 8px;
  }
  .year-tabs {
    flex-direction: row;
    overflow: auto;
    max-height: 96px;
    margin-top: 14px;
    padding-bottom: 5px;
  }
  .year-tabs button {
    min-width: 140px;
    max-width: 150px;
    font-size: 10px;
    flex-shrink: 0;
  }
  .year-tabs small {
    font-size: 9px;
  }
  .year-sidebar .helper {
    display: none;
  }
  .year-sidebar form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    margin-top: 12px;
  }
  .year-sidebar form label {
    grid-column: 1/-1;
    font-size: 12px;
    margin: 0;
  }
  .year-sidebar input {
    height: 40px;
    margin: 0;
    font-size: 16px;
    padding: 8px;
  }
  .year-sidebar .button {
    padding: 7px;
    font-size: 12px;
  }
  .year-shell .game-top {
    gap: 8px;
  }
  .year-shell .game-top small {
    font-size: 10px;
    display: block;
  }
  .year-shell .game-top .quiet-link {
    font-size: 12px;
  }
  .year-shell .timer-box {
    padding: 8px 12px;
  }
  .year-shell .timer-box strong {
    font-size: 27px;
  }
  .year-shell .timer-box span {
    font-size: 8px;
  }
  .year-shell .penalty-bar {
    font-size: 10px;
    gap: 8px;
  }
  .year-main .statement {
    font-size: 16px;
  }
  .wordsearch-layout {
    gap: 18px;
  }
  .wordsearch button {
    font-size: 15px;
  }
  .riddles {
    font-size: 13px;
    max-height: 330px;
    columns: 1;
  }
  .secret-postcards {
    gap: 10px;
  }
  .postcard {
    min-height: 155px;
    padding: 15px;
  }
  .postcard strong {
    font-size: 33px;
  }
  .postcard span:last-child {
    font-size: 10px;
  }
  .morse-table {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 12px;
    gap: 10px;
  }
  .morse-table span {
    font-size: 12px;
  }
  .light-garland {
    padding: 20px 8px;
    gap: 5px;
  }
  .light-letter {
    gap: 5px;
  }
  .bulb {
    width: 12px;
    height: 19px;
  }
  .bulb.long {
    width: 10px;
    height: 33px;
  }
  .nonogram {
    grid-template-columns: 25px repeat(10, minmax(0, 1fr));
  }
  .nono-clue {
    font-size: 12px;
  }
  .nonogram button {
    font-size: 19px;
  }
  .crossword-layout {
    gap: 20px;
  }
  .cross-cell input {
    font-size: 16px;
    padding-top: 6px;
  }
  .cross-cell small,
  .cross-cell b {
    font-size: 7px;
  }
  .cross-clues {
    font-size: 12px;
    columns: 1;
  }
  .cross-extract {
    gap: 6px;
  }
  .cross-extract span {
    min-width: 24px;
  }
  .year-sudoku select,
  .year-sudoku .given b {
    font-size: 19px;
  }
  .year-sudoku .cell-mark {
    font-size: 10px;
  }
  .symbol-entry,
  .year-lock {
    gap: 10px;
  }
  .symbol-entry select,
  .year-lock select {
    min-width: 0;
    width: 57px;
  }
  .town-map {
    gap: 7px;
    padding: 5px;
  }
  .map-square {
    padding: 10px 0 2px;
  }
  .map-square small {
    font-size: 8px;
    letter-spacing: 0;
  }
  .map-square svg {
    width: 95%;
  }
  .piece-select {
    font-size: 8px;
    min-height: 30px;
  }
  .edge-row,
  .edge-col {
    font-size: 8px;
  }
  .town-square {
    font-size: 20px;
  }
  .door-symbols {
    font-size: 40px;
    letter-spacing: 6px;
  }
  .wish-grid {
    grid-template-columns: 1fr;
  }
  .saved-clues {
    font-size: 13px;
  }
  .year-dialog {
    padding: 24px;
  }
  .year-dialog .postcard-text {
    font-size: 22px;
  }
}

.midnight-theme .riddles {
  list-style-position: inside;
  padding-left: 0;
}
