:root {
  --ink: #29241f;
  --umber: #5e4435;
  --terracotta: #a65e3b;
  --terracotta-dark: #84472c;
  --terracotta-soft: #eed8cb;
  --ochre: #c4913e;
  --sand: #e8dcc8;
  --parchment: #f4efe5;
  --paper: #fffcf6;
  --field: #5e6852;
  --field-soft: #dfe4d9;
  --danger: #8f3f32;
  --line: rgba(94, 68, 53, 0.2);
  --line-strong: rgba(94, 68, 53, 0.34);
  --shadow: 0 24px 70px rgba(62, 47, 37, 0.11);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(94, 68, 53, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 68, 53, 0.026) 1px, transparent 1px),
    radial-gradient(circle at 84% 5%, rgba(196, 145, 62, 0.10), transparent 30rem),
    var(--parchment);
  background-size: 40px 40px, 40px 40px, auto, auto;
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid rgba(166, 94, 59, 0.52); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font: 700 13px/1 var(--sans);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  color: var(--ink);
  font-size: clamp(27px, 3.4vw, 39px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
}
.brand-bracket, .site-footer strong span { color: var(--terracotta); }
.brand small {
  margin-left: 13px;
  color: var(--umber);
  font: 800 9px/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a {
  position: relative;
  padding: 10px 2px;
  border-radius: 0;
  color: var(--umber);
  font: 700 11px/1 var(--sans);
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a::after { position: absolute; right: 0; bottom: 3px; left: 0; height: 2px; background: var(--terracotta); content: ""; opacity: 0; transform: scaleX(0.55); transition: opacity 150ms ease, transform 150ms ease; }
.site-nav a:hover, .site-nav a.active { color: var(--ink); background: transparent; }
.site-nav a:hover::after, .site-nav a.active::after { opacity: 1; transform: none; }
.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  background: var(--paper);
  font: 750 12px/1 var(--sans);
}
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 15px; height: 1px; background: currentColor; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { position: absolute; left: 0; content: ""; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }

main { min-height: calc(100vh - 220px); }
.page { display: none; padding: clamp(38px, 6vw, 76px) 0 36px; animation: page-in 180ms ease both; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.kicker, .eyebrow, .field-label, .field-code, .card-era {
  color: var(--terracotta);
  font: 800 10px/1.25 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.display-title {
  max-width: 840px;
  margin: 10px 0 15px;
  font-size: clamp(45px, 6.4vw, 76px);
  font-weight: 700;
  hyphens: auto;
  letter-spacing: -0.052em;
  line-height: 0.98;
  overflow-wrap: break-word;
}
.lead {
  max-width: 680px;
  margin: 0;
  color: var(--umber);
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.62;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 0.32fr);
  gap: clamp(28px, 6vw, 78px);
  align-items: end;
}
.release-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.72);
}
.release-card::after {
  position: absolute;
  right: -27px;
  bottom: -34px;
  width: 110px;
  height: 88px;
  border: 1px solid rgba(166, 94, 59, 0.2);
  border-radius: 48% 37% 54% 36%;
  content: "";
  transform: rotate(-12deg);
}
.release-card strong { display: block; margin: 12px 0 5px; font: 700 clamp(22px, 3.3vw, 34px)/1 var(--serif); letter-spacing: -0.04em; }
.release-card > span:last-child { color: var(--umber); font: 650 11px/1.4 var(--sans); }

.support-note {
  max-width: 820px;
  margin-top: 25px;
  padding: 13px 16px;
  border-left: 3px solid var(--ochre);
  background: rgba(196, 145, 62, 0.08);
}
.support-note p { margin: 0; color: var(--umber); font: 13px/1.5 var(--sans); }
.support-note a { color: var(--terracotta-dark); font-weight: 800; text-underline-offset: 3px; }

.day-switcher {
  display: inline-grid;
  grid-template-columns: 42px minmax(170px, auto) 42px;
  align-items: center;
  gap: 12px;
  margin-top: 38px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 252, 246, 0.64);
}
.day-switcher > div { text-align: center; }
.day-switcher strong { display: block; margin-top: 4px; font-size: 17px; }
.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: var(--paper);
  cursor: pointer;
  font: 700 18px/1 var(--sans);
}
.icon-button:hover:not(:disabled) { background: var(--terracotta-soft); }
.icon-button:disabled { opacity: 0.28; cursor: not-allowed; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin: 56px 0 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.section-heading h2 { margin: 5px 0 0; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.035em; line-height: 1.08; }
.eyebrow { color: var(--umber); }
.progress-summary { width: min(230px, 36vw); color: var(--umber); font: 750 11px/1 var(--sans); text-align: right; }
.progress-track { display: block; height: 5px; margin-top: 9px; overflow: hidden; border-radius: 10px; background: var(--sand); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--terracotta); transition: width 240ms ease; }

.puzzle-grid { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 720px; gap: 15px; margin-top: 42px; }
.puzzle-card {
  position: relative;
  display: flex;
  min-height: 385px;
  overflow: hidden;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.84);
  box-shadow: 0 7px 30px rgba(62, 47, 37, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.puzzle-card:not(.locked):hover { border-color: rgba(166, 94, 59, 0.46); box-shadow: 0 16px 45px rgba(62, 47, 37, 0.08); transform: translateY(-3px); }
.puzzle-card.complete { border-color: rgba(94, 104, 82, 0.45); }
.puzzle-card.locked { opacity: 0.62; background: rgba(232, 220, 200, 0.36); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-code { color: var(--terracotta); letter-spacing: 0.11em; }
.status-chip {
  position: relative;
  padding: 0 0 0 12px;
  border: 0;
  border-radius: 0;
  color: var(--umber);
  background: transparent;
  font: 750 9px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-chip::before { position: absolute; top: 50%; left: 0; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; content: ""; transform: translateY(-50%); }
.complete .status-chip { color: var(--field); }
.complete .status-chip::before { background: currentColor; }
.card-artifact { position: relative; height: 112px; margin: 24px 0 18px; }
.card-artifact span:first-child {
  position: absolute;
  inset: 6px auto auto 50%;
  width: 120px;
  height: 92px;
  border: 1px solid rgba(166, 94, 59, 0.3);
  border-radius: 49% 37% 56% 32%;
  background: rgba(196, 145, 62, 0.045);
  transform: translateX(-50%) rotate(-8deg);
}
.card-artifact span:last-child {
  position: absolute;
  top: 45px;
  left: 50%;
  width: 76px;
  border-top: 1px dashed rgba(94, 68, 53, 0.3);
  transform: translateX(-50%) rotate(15deg);
}
.complete .card-artifact span:first-child { border-color: rgba(94, 104, 82, 0.52); background: rgba(94, 104, 82, 0.08); }
.card-era { color: var(--umber); letter-spacing: 0.11em; }
.puzzle-card h3 { margin: 9px 0 8px; font-size: 24px; letter-spacing: -0.025em; line-height: 1.08; }
.puzzle-card p { margin: 0; color: var(--umber); font: 14px/1.52 var(--sans); }
.card-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 24px; font: 800 12px/1 var(--sans); }
.card-action span:last-child { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--ink); color: white; }
.puzzle-card > button { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; cursor: pointer; font-size: 0; }
.puzzle-card > button:disabled { cursor: not-allowed; }
.puzzle-card > button:focus-visible { border-radius: 18px; outline-offset: -5px; }

.field-note { display: grid; grid-template-columns: 28px 1fr; gap: 12px; margin-top: 22px; padding: 16px 18px; border-left: 3px solid var(--terracotta); background: rgba(232, 220, 200, 0.38); }
.field-note-mark { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid rgba(166, 94, 59, 0.45); border-radius: 50%; color: var(--terracotta); font: 800 12px/1 var(--sans); }
.field-note p { margin: 1px 0 0; color: var(--umber); font: 13px/1.55 var(--sans); }

.ad-slot {
  display: grid;
  min-height: 112px;
  margin-top: 40px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  color: rgba(94, 68, 53, 0.54);
  background: rgba(255, 252, 246, 0.32);
  font: 750 9px/1 var(--sans);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.ad-slot:not(.is-placeholder) { display: block; min-height: 90px; border: 0; background: transparent; }

.back-button { margin-bottom: 22px; }
.text-button { border: 0; padding: 0; background: none; color: var(--umber); cursor: pointer; font: 800 12px/1 var(--sans); }
.text-button:hover { color: var(--terracotta); }
.play-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 17px; }
.play-heading h1 { margin: 6px 0 0; font-size: clamp(35px, 5vw, 55px); letter-spacing: -0.048em; line-height: 1; }
.play-heading-actions { display: flex; align-items: center; gap: 10px; }
.play-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.play-stats span { padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--umber); background: rgba(255, 252, 246, 0.65); font: 800 9px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }
.help-button { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; padding: 0; background: var(--paper); color: var(--umber); cursor: pointer; font: 800 16px/1 var(--serif); }
.help-button:hover { border-color: var(--terracotta); color: var(--terracotta); }

.excavation { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 252, 246, 0.92); box-shadow: var(--shadow); }
.excavation-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 42px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--umber); background: rgba(232, 220, 200, 0.25); font: 750 10px/1.35 var(--sans); letter-spacing: 0.04em; }
.excavation-stage { position: relative; display: flex; min-height: 345px; align-items: center; padding: 48px clamp(22px, 6vw, 72px); }
.excavation-stage::before {
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(94, 68, 53, 0.055);
  content: "";
  pointer-events: none;
}
.grid-coordinate { position: absolute; right: 15px; bottom: 12px; color: rgba(94, 68, 53, 0.36); font: 800 9px/1 var(--sans); letter-spacing: 0.12em; }
.puzzle-text {
  width: 100%;
  font-size: clamp(17px, 1.45vw, 20px);
  letter-spacing: -0.01em;
  line-height: 1.6;
  text-align: left;
  overflow-wrap: normal;
}
.bracket > span:first-child, .bracket > span:last-child { color: var(--terracotta); font-weight: 700; }
.clue-ready {
  display: inline;
  margin: 0;
  border: 0;
  border-radius: 5px;
  padding: 0 0.035em;
  background: transparent;
  cursor: pointer;
  color: var(--terracotta);
  font-weight: 700;
  text-align: inherit;
  white-space: normal;
  text-decoration: none;
}
.clue-ready:focus-visible { outline-offset: 1px; }
.clue-ready:hover { color: var(--terracotta-dark); }
.locked-layer { color: rgba(41, 36, 31, 0.83); }
.peek-letter { display: inline-block; margin-right: 0.18em; padding: 0 0.34em; border-radius: 999px; background: var(--terracotta-soft); color: var(--terracotta); font: 800 0.62em/1.55 var(--sans); vertical-align: 0.1em; text-decoration: none; }
.solved-fragment { color: var(--field); font-weight: 700; animation: settle 230ms ease both; }
@keyframes settle { from { opacity: 0.3; filter: blur(2px); } to { opacity: 1; filter: none; } }

.answer-panel { padding: 17px; border-top: 1px solid var(--line); background: rgba(244, 239, 229, 0.68); }
.answer-label { display: block; margin-bottom: 9px; color: var(--umber); font: 750 11px/1.3 var(--sans); }
.answer-row { display: flex; gap: 9px; }
.answer-row input { flex: 1; min-width: 0; border: 1px solid rgba(94, 68, 53, 0.28); border-radius: 10px; padding: 13px 14px; outline: 0; background: white; color: var(--ink); font: 700 16px/1 var(--sans); }
.answer-row input:focus { border-color: var(--terracotta); box-shadow: 0 0 0 2px rgba(166, 94, 59, 0.14); }
.answer-row input:disabled { background: var(--sand); cursor: not-allowed; }
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 15px;
  cursor: pointer;
  font: 800 12px/1.15 var(--sans);
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.42; cursor: not-allowed; }
.button-primary { background: var(--ink); color: white; }
.button-primary:hover:not(:disabled) { background: var(--terracotta-dark); }
.button-secondary { border-color: var(--line-strong); background: var(--paper); color: var(--umber); }
.button-secondary:hover { border-color: var(--terracotta); color: var(--ink); }
.button-quiet { min-height: 35px; border-color: var(--line); padding: 8px 10px; background: transparent; color: var(--umber); }
.button-quiet:hover:not(:disabled) { background: var(--paper); }
.button-danger { border-color: rgba(143, 63, 50, 0.38); background: transparent; color: var(--danger); }
.play-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; }
.play-actions > div { display: flex; flex-wrap: wrap; gap: 7px; }
.field-hint { color: var(--umber); font: 750 11px/1.3 var(--sans); }

.fragment-log { margin-top: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 252, 246, 0.63); }
.fragment-log-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 9px; }
.fragment-log h2 { margin: 0; color: var(--umber); font: 800 10px/1 var(--sans); letter-spacing: 0.13em; text-transform: uppercase; }
.fragment-log-head > span { color: rgba(94, 68, 53, 0.7); font: 700 10px/1.2 var(--sans); }
.fragment-row { display: grid; grid-template-columns: minmax(80px, 0.4fr) 1fr auto; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid rgba(94, 68, 53, 0.12); font: 700 12px/1.4 var(--sans); }
.fragment-row span, .fragment-row small, .empty-state { color: var(--umber); }
.fragment-row strong { color: var(--field); font-size: 14px; }
.fragment-row small { text-transform: uppercase; letter-spacing: 0.08em; }
.empty-state { font: 13px/1.5 var(--sans); }

.result-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 18px; align-items: start; }
.result-card, .preservation-card { border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 252, 246, 0.9); }
.result-card { padding: clamp(25px, 5vw, 48px); }
.result-card h1 { margin: 13px 0 20px; font-size: clamp(37px, 5.6vw, 65px); letter-spacing: -0.05em; line-height: 1.03; }
.result-context { max-width: 720px; margin: 0; color: var(--umber); font-size: 17px; line-height: 1.62; }
.source-panel { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font: 700 13px/1.5 var(--sans); }
.source-panel .field-label { display: block; margin-bottom: 7px; }
.source-panel a { color: var(--terracotta); }
.source-placeholder { color: var(--umber); }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 27px; }
.preservation-card { position: sticky; top: 18px; overflow: hidden; padding: 22px; }
.artifact-visual { position: relative; width: 152px; height: 112px; margin: 7px auto 26px; }
.artifact-visual span:first-child { position: absolute; inset: 2px 12px 7px 4px; border: 2px solid rgba(166, 94, 59, 0.38); border-radius: 50% 37% 57% 33%; background: rgba(196, 145, 62, 0.08); transform: rotate(-8deg); }
.artifact-visual span:nth-child(2), .artifact-visual span:last-child { position: absolute; width: 68px; border-top: 1px solid rgba(166, 94, 59, 0.56); }
.artifact-visual span:nth-child(2) { top: 46px; left: 36px; transform: rotate(21deg); }
.artifact-visual span:last-child { top: 70px; left: 65px; transform: rotate(-37deg); }
.artifact-visual[data-grade="V"] span:nth-child(2), .artifact-visual[data-grade="V"] span:last-child { opacity: 0.14; }
.artifact-visual[data-grade="IV"] span:nth-child(2) { opacity: 0.48; }
.artifact-visual[data-grade="IV"] span:last-child { opacity: 0.32; }
.artifact-visual[data-grade="III"] span:nth-child(2) { opacity: 0.75; }
.artifact-visual[data-grade="III"] span:last-child { opacity: 0.58; }
.artifact-visual[data-grade="II"] span:nth-child(2) { opacity: 0.92; }
.artifact-visual[data-grade="II"] span:last-child { opacity: 0.82; }
.artifact-visual[data-grade="I"] span:nth-child(2), .artifact-visual[data-grade="I"] span:last-child { opacity: 1; }
.preservation-roman { color: var(--ochre); font-size: 55px; font-weight: 700; line-height: 1; }
.preservation-card h2 { margin: 7px 0 13px; font-size: 24px; letter-spacing: -0.03em; line-height: 1.08; }
.preservation-card > p { margin: 0; color: var(--umber); font: 13px/1.52 var(--sans); }
.result-stats { display: grid; gap: 7px; margin: 20px 0 0; }
.result-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; font-family: var(--sans); }
.result-stats dt { color: var(--umber); font-size: 12px; }
.result-stats dd { margin: 0; color: var(--ink); font-size: 18px; font-weight: 800; }

.share-section { margin-top: 18px; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 252, 246, 0.78); }
.share-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.share-heading h2 { margin: 8px 0 6px; font-size: clamp(27px, 4vw, 38px); letter-spacing: -0.04em; }
.share-layout { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: 20px; align-items: stretch; margin-top: 24px; }
.share-preview-card { display: flex; min-width: 0; flex-direction: column; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.share-preview-media { display: flex; height: clamp(300px, 34vw, 410px); align-items: center; justify-content: center; overflow: hidden; border-radius: 8px; background: var(--parchment); }
.share-preview-card img { display: block; width: 100%; height: 100%; object-fit: contain; }
.share-card-button { display: flex; width: 100%; min-height: 62px; align-items: center; gap: 12px; margin-top: 10px; border: 1px solid var(--line-strong); border-radius: 11px; padding: 13px 14px; background: var(--paper); color: var(--ink); cursor: pointer; text-align: left; transition: border-color 120ms ease, background 120ms ease, transform 80ms ease; }
.share-card-button:hover { border-color: var(--terracotta); background: rgba(238, 216, 203, 0.28); }
.share-card-button:active { transform: translateY(1px); }
.share-card-button span { display: grid; gap: 4px; }
.share-card-button strong { color: var(--ink); font: 800 14px/1.2 var(--sans); }
.share-card-button small { color: var(--umber); font: 12px/1.3 var(--sans); }
.share-action-icon { flex: 0 0 auto; width: 25px; height: 25px; color: var(--terracotta); }

.archive-heading { display: flex; align-items: end; justify-content: space-between; gap: 35px; }
.archive-period { margin: 8px 0 0; color: var(--umber); font: 800 10px/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }
.archive-key { display: flex; max-width: 280px; flex-wrap: wrap; justify-content: flex-end; gap: 10px 16px; color: var(--umber); font: 700 10px/1.2 var(--sans); }
.archive-key span { display: inline-flex; align-items: center; gap: 6px; }
.key-dot { width: 8px; height: 8px; border-radius: 50%; }
.key-dot.complete { background: var(--field); }
.key-dot.available { border: 1px solid var(--terracotta); }
.key-dot.locked { background: var(--sand); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 32px; }
.calendar-label { padding: 0 4px 6px; color: var(--umber); font: 800 9px/1 var(--sans); text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; display: flex; min-width: 0; aspect-ratio: 1 / 0.82; flex-direction: column; align-items: flex-start; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(255, 252, 246, 0.62); cursor: pointer; text-align: left; }
.calendar-day:hover:not(:disabled) { border-color: var(--terracotta); background: var(--paper); }
.calendar-day > span:first-child { font: 800 15px/1 var(--sans); }
.calendar-day small { color: var(--umber); font: 650 9px/1 var(--sans); }
.calendar-day.today { box-shadow: inset 0 0 0 1px var(--terracotta); border-color: var(--terracotta); }
.calendar-day.today::before { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--terracotta); content: ""; }
.calendar-day.locked { opacity: 0.4; cursor: not-allowed; }
.calendar-day.complete { border-color: rgba(94, 104, 82, 0.42); background: rgba(94, 104, 82, 0.06); }
.calendar-marks { display: flex; gap: 4px; }
.calendar-marks i { width: 7px; height: 7px; border-radius: 50%; background: var(--sand); }
.calendar-marks i.done { background: var(--field); }

.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 32px; }
.rule-card { position: relative; min-height: 190px; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 252, 246, 0.75); }
.rule-card > span { position: absolute; top: 12px; right: 15px; color: rgba(166, 94, 59, 0.16); font-size: 62px; font-weight: 700; line-height: 1; }
.rule-card h2 { position: relative; margin: 22px 0 9px; font-size: 25px; }
.rule-card p { position: relative; max-width: 470px; margin: 0; color: var(--umber); font: 14px/1.58 var(--sans); }
.scoring-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr); gap: 38px; margin-top: 18px; padding: 26px; border-radius: 16px; color: white; background: var(--ink); }
.scoring-card h2 { margin: 8px 0; font-size: 27px; }
.scoring-card p { max-width: 600px; margin: 0; color: rgba(255, 255, 255, 0.7); font: 13px/1.55 var(--sans); }
.scoring-card .field-label { color: #d7aa64; }
.scoring-card ol { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.scoring-card li { display: grid; min-height: 80px; place-items: center; align-content: center; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; }
.scoring-card li strong { color: #d7aa64; font-size: 22px; }
.scoring-card li span { margin-top: 5px; color: rgba(255, 255, 255, 0.6); font: 700 9px/1 var(--sans); }

.legal-page { max-width: 850px; }
.legal-copy { margin-top: 35px; padding: clamp(22px, 5vw, 45px); border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 252, 246, 0.82); }
.legal-copy h2 { margin: 33px 0 9px; font-size: 25px; letter-spacing: -0.03em; }
.legal-copy h2:first-child { margin-top: 0; }
.legal-copy p { margin: 0 0 13px; color: var(--umber); font: 15px/1.68 var(--sans); }
.policy-meta { padding: 15px 17px; border-left: 3px solid var(--terracotta); background: rgba(232, 220, 200, 0.4); }
.policy-meta a, .legal-copy a { color: var(--terracotta); }
.cookie-table { width: 100%; margin: 20px 0 28px; border-collapse: collapse; font: 13px/1.45 var(--sans); }
.cookie-table th, .cookie-table td { padding: 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.cookie-table th { background: rgba(232, 220, 200, 0.52); color: var(--ink); font-size: 11px; }
.cookie-table td { color: var(--umber); }
.cookie-table code { color: var(--ink); font: 700 11px/1.3 var(--sans); word-break: break-word; }
.legal-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 20px 0 34px; }
.draft-warning { padding: 14px 16px; border-left: 3px solid var(--ochre); background: rgba(196, 145, 62, 0.08); }

.site-footer { display: grid; grid-template-columns: 1fr auto auto; gap: 28px; align-items: end; margin-top: 40px; padding: 24px 0 32px; border-top: 1px solid var(--line); }
.site-footer > div { display: flex; flex-direction: column; gap: 6px; }
.site-footer strong { font-size: 24px; letter-spacing: -0.04em; }
.site-footer small, .footer-version { color: rgba(94, 68, 53, 0.68); font: 700 9px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer nav { display: flex; gap: 14px; font: 750 10px/1.3 var(--sans); }
.site-footer a, .footer-button { border: 0; padding: 0; background: none; color: var(--umber); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.cookie-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 1200;
  display: grid;
  width: min(850px, calc(100% - 36px));
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 25px;
  align-items: end;
  margin-inline: auto;
  padding: 21px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(41, 36, 31, 0.23);
  animation: banner-in 220ms ease both;
}
@keyframes banner-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cookie-banner h2 { margin: 7px 0 7px; font-size: 25px; }
.cookie-banner p { max-width: 600px; margin: 0; color: var(--umber); font: 13px/1.55 var(--sans); }
.cookie-banner a { display: inline-block; margin-top: 9px; color: var(--terracotta); font: 750 11px/1 var(--sans); }
.cookie-actions { display: flex; gap: 8px; }
.consent-options { display: grid; gap: 8px; max-width: 600px; margin: 16px 0 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; }
.consent-options legend { padding: 0 5px; color: var(--umber); font: 800 10px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }
.consent-options label { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font: 700 12px/1.4 var(--sans); }
.consent-options input { margin: 2px 0 0; accent-color: var(--terracotta); }
.consent-options small { color: var(--umber); font: 11px/1.45 var(--sans); }

.modal-backdrop { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; overflow-y: auto; padding: 20px; background: rgba(41, 36, 31, 0.42); overscroll-behavior: contain; }
#hintModal { z-index: 1400; }
.modal { width: min(430px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 23px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal h2 { margin: 8px 0; font-size: 26px; }
.modal p { margin: 0; color: var(--umber); font: 14px/1.55 var(--sans); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 21px; }
.tutorial-modal { width: min(500px, 100%); }
.tutorial-example { margin: 21px 0 16px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: rgba(232, 220, 200, 0.3); font-size: 18px; line-height: 1.55; }
.tutorial-example strong { color: var(--field); font-weight: 700; }
.tutorial-clue { color: var(--terracotta); font-weight: 700; cursor: pointer; }
.tutorial-clue:hover { color: var(--terracotta-dark); }
.tutorial-clue:focus-visible { border-radius: 4px; outline-offset: 2px; }
.tutorial-locked { color: var(--ink); }
.tutorial-found { min-height: 21px; margin-bottom: 16px !important; color: var(--field) !important; font: 750 12px/1.45 var(--sans) !important; }
.tutorial-answer-row { display: flex; gap: 8px; margin-top: 7px; }
.tutorial-answer-row input { min-width: 0; flex: 1; min-height: 43px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 11px; background: var(--paper); }
.tutorial-answer-row .button { min-height: 43px; }
.tutorial-feedback { min-height: 22px; margin-top: 9px !important; color: var(--field) !important; font-weight: 700 !important; }
.tutorial-feedback.error { color: var(--danger) !important; }

@supports (height: 100dvh) {
  .modal { max-height: calc(100dvh - 40px); }
}

.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom, 0px)); left: 50%; z-index: 1500; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 999px; background: rgba(41, 36, 31, 0.96); color: white; box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2); font: 800 12px/1.25 var(--sans); text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: 150ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript, .fatal-error { margin: 30px auto; padding: 20px; max-width: 720px; border: 1px solid rgba(143, 63, 50, 0.4); border-radius: 12px; background: var(--paper); color: var(--danger); }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .release-card { max-width: 340px; }
  .puzzle-grid { grid-template-columns: 1fr; }
  .puzzle-card { min-height: 330px; }
  .card-artifact { height: 90px; margin-block: 18px 12px; }
  .card-artifact span:first-child { height: 78px; }
  .result-layout { grid-template-columns: 1fr; }
  .preservation-card { position: static; }
  .share-layout { grid-template-columns: 1fr; }
  .scoring-card { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr auto; }
  .footer-version { display: none; }
}

@media (max-width: 720px) {
  .site-header, main, .site-footer { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 72px; }
  .brand small { display: none; }
  .menu-toggle { display: inline-flex; }
  .site-nav { position: absolute; top: 63px; right: 0; display: none; width: min(230px, calc(100vw - 24px)); flex-direction: column; align-items: stretch; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
  .page { padding-top: 35px; }
  .section-heading, .archive-heading { align-items: flex-start; flex-direction: column; }
  .progress-summary { width: 100%; text-align: left; }
  .archive-key { justify-content: flex-start; }
  .play-heading { align-items: flex-start; flex-direction: column; }
  .play-heading-actions, .play-stats { justify-content: flex-start; }
  .excavation-bar { align-items: flex-start; flex-direction: column; gap: 4px; }
  .excavation-stage { min-height: 280px; padding: 38px 19px; }
  .puzzle-text { font-size: 17px; }
  .answer-row { flex-direction: column; }
  .play-actions { align-items: flex-start; flex-direction: column; }
  .rules-grid { grid-template-columns: 1fr; }
  .cookie-banner { grid-template-columns: 1fr; gap: 17px; }
  .share-heading { align-items: flex-start; flex-direction: column; }
  .share-layout { grid-template-columns: 1fr; }
  .share-preview-media { height: auto; min-height: 0; }
  .share-preview-card img { width: 100%; height: auto; }
  .cookie-actions { flex-wrap: wrap; }
  .tutorial-answer-row { flex-direction: column; }
  .toast {
    --toast-viewport-clearance: max(16px, env(safe-area-inset-bottom, 0px), env(keyboard-inset-height, 0px));
    top: 58vh;
    right: 16px;
    bottom: auto;
    left: 16px;
    max-width: none;
    transform: translateY(12px);
  }
  .toast.show { transform: translateY(0); }
}

@supports (height: 100dvh) {
  @media (max-width: 720px) {
    .toast {
      top: max(16px, min(58dvh, calc(100dvh - 4.5rem - var(--toast-viewport-clearance))));
      max-height: calc(100dvh - var(--toast-viewport-clearance) - 32px);
      overflow-y: auto;
    }
  }
}

@media (max-width: 520px) {
  main { min-height: 0; }
  .page { padding-top: 22px; }
  #page-today { padding-bottom: 0; }
  .display-title { margin: 7px 0 0; font-size: 42px; }
  .lead { margin-top: 13px; font-size: 16px; line-height: 1.5; }
  .release-card { display: none; }
  .day-switcher { margin-top: 28px; }
  .puzzle-grid { margin-top: 28px; }
  .result-stats div { align-items: flex-start; flex-direction: column; gap: 3px; }
  .share-section { padding: 18px; }
  .puzzle-card {
    min-height: 184px;
    padding: 16px;
    border-radius: 15px;
  }
  .card-artifact { display: none; }
  .card-era { margin-top: 24px; }
  .puzzle-card h3 { margin: 7px 0 0; font-size: 22px; }
  .card-action {
    min-height: 46px;
    margin-top: auto;
    padding: 0 14px;
    border-radius: 9px;
    background: var(--ink);
    color: white;
    font-size: 13px;
  }
  .card-action span:last-child {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    font-size: 18px;
  }
  .puzzle-card:not(.locked):active .card-action { background: var(--terracotta-dark); }
  .calendar { gap: 4px; }
  .calendar-label { font-size: 8px; }
  .calendar-day { aspect-ratio: 0.8 / 1; border-radius: 8px; padding: 6px; }
  .calendar-day > span:first-child { font-size: 12px; }
  .calendar-day small { display: none; }
  .calendar-marks { gap: 2px; }
  .calendar-marks i { width: 5px; height: 5px; }
  .fragment-log-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .fragment-row { grid-template-columns: 1fr auto; }
  .fragment-row span { display: none; }
  .scoring-card ol { grid-template-columns: repeat(5, minmax(44px, 1fr)); }
  .site-footer { grid-template-columns: 1fr; margin-top: 20px; }
  .site-footer nav { flex-direction: column; gap: 8px; }
  .cookie-banner { right: 8px; bottom: 8px; left: 8px; width: calc(100% - 16px); padding: 17px; }
  .cookie-actions { flex-direction: column-reverse; }
  .cookie-actions .button { width: 100%; }
  .cookie-table { display: block; overflow-x: auto; }
}
