/* Local fonts and assets. Original layout, tools and progressive enhancements. */
:root {
  --page: #F5F0E6;
  --panel: #FFFEFA;
  --text: #19352D;
  --primary: #28665B;
  --secondary: #D96C4F;
  --border: #D8DFD4;
  --primary-dark: #19352D;
  --secondary-dark: #873C29;
  --tint: #EAF0E7;
  --forest: #19352D;
  --emerald: #28665B;
  --orange: #AF702C;
  --coral: #D96C4F;
  --yellow: #E3B341;
  --purple: #76539A;
  --unit: 8px;
  --page-padding: 40px;
  --section-gap: 64px;
}

/* Reset and typography */
* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: auto; }
body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font: 17px/1.65 Arial, Helvetica, sans-serif;
}
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, dl, pre { margin-top: 0; }
h1, h2, h3 { color: var(--text); line-height: 1.18; overflow-wrap: anywhere; }
h1 { margin-bottom: 24px; font-size: 42px; letter-spacing: -1px; }
h2 { margin-bottom: 24px; font-size: 30px; letter-spacing: -.4px; }
h3 { margin-bottom: 16px; font-size: 21px; }
p, ul, ol { margin-bottom: 24px; }
p { max-width: 70ch; }
a {
  color: var(--primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible,
[tabindex]:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 4px; }
button, input, select, textarea { font: inherit; color: var(--text); }
button, input, select, textarea, fieldset { border-radius: 0; }
button, select, summary { cursor: pointer; }
button:disabled, fieldset:disabled select { cursor: not-allowed; }
button:disabled { opacity: .65; }
button {
  min-height: 48px;
  border: 1px solid var(--primary);
  padding: 8px 16px;
  background: var(--panel);
  color: var(--primary-dark);
  font-weight: bold;
}
button:hover:not(:disabled) { background: var(--tint); }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--border);
  border-bottom-color: var(--primary);
  background: var(--panel);
  padding: 8px 12px;
}
textarea { resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"],
textarea[aria-invalid="true"] { border: 2px solid var(--secondary-dark); }
label { display: block; margin-bottom: 8px; font-weight: bold; }
label span { font-weight: normal; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
legend { padding: 0; margin-bottom: 16px; font-weight: bold; }
::selection { background: var(--yellow); color: var(--text); }
[id] { scroll-margin-top: 24px; }

/* Masthead and utility */
.skip {
  position: absolute; left: 16px; top: -160px; z-index: 100;
  padding: 12px 16px; background: var(--panel); border: 2px solid var(--primary);
}
.skip:focus { top: 8px; }
.utility {
  max-width: 1276px; margin: auto; padding: 8px var(--page-padding);
  border-bottom: 1px solid var(--border);
}
.masthead { min-height: 92px; max-width: 1276px; margin: auto; padding: 12px var(--page-padding); }
.brand {
  display: inline-block; color: var(--text); font-size: 25px; line-height: 1.25;
  font-weight: bold; text-decoration: none; overflow-wrap: anywhere;
}
.masthead-result {
  max-width: none; margin: 8px 0 0; padding-top: 4px;
  border-top: 1px solid var(--border); font-size: 15px; line-height: 1.6;
}
.masthead-result time { font-weight: bold; margin: 0 8px; }
.masthead-result span { white-space: normal; }

/* 224px index + 32px gutter + up to 940px content */
.layout {
  display: grid; grid-template-columns: 224px minmax(0, 940px); gap: 32px;
  width: 100%; max-width: 1276px; margin: auto;
  padding: 32px var(--page-padding) var(--section-gap);
}
.content { min-width: 0; }
.date-index { align-self: start; border-left: 2px solid var(--primary); padding-left: 16px; }
.index-label { display: block; margin: 8px 0 16px; font-weight: bold; }
.date-index a { display: block; min-height: 48px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.primary {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  border-bottom: 1px solid var(--border); margin-bottom: 40px;
}
.primary a { display: inline-flex; align-items: center; min-height: 48px; padding: 8px 0; text-decoration: none; }
.primary a[aria-current="page"] {
  border-bottom: 3px solid var(--primary); color: var(--text); font-weight: bold;
}
.primary a:hover { text-decoration: underline; }
main > section, main > article, .reading > section, .reading > article { margin-top: var(--section-gap); }
.intro { font-size: 18px; }
.coverage, .notice {
  max-width: none; padding: 16px 0 16px 16px;
  border-left: 3px solid var(--secondary);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.eyebrow { display: block; color: var(--primary-dark); font-weight: bold; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 24px; }

/* Records and ledger bands */
.latest-ledger {
  display: grid; grid-template-columns: 2fr 1fr;
  border-top: 2px solid var(--primary); border-bottom: 1px solid var(--border);
  background: var(--panel); padding: 24px; gap: 24px; margin-bottom: 24px;
}
.latest-ledger h3 { font-size: 17px; }
.number-line {
  color: var(--text); font: bold 30px/1.6 "Courier New", Courier, monospace;
  margin-bottom: 0; overflow-wrap: anywhere;
}
.numbers { font-family: "Courier New", Courier, monospace; white-space: nowrap; word-spacing: 8px; }
.source-note { margin: 24px 0 16px; }
.record-list { border-left: 2px solid var(--primary); }
.record-list > h2 { padding-left: 24px; }
.draw-record { padding: 24px; border-top: 1px solid var(--border); background: var(--panel); }
.draw-record:nth-of-type(even) { background: var(--tint); }
.draw-record:target { border-left: 4px solid var(--secondary); padding-left: 20px; }
.draw-record h3 { font-size: 24px; }
.record-pools { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 0; }
.record-pools dt { font-weight: bold; margin-bottom: 8px; }
.record-pools dd {
  margin: 0; color: var(--text);
  font: bold 23px/1.65 "Courier New", Courier, monospace; overflow-wrap: anywhere;
}

/* Actual data tables */
.table-scroll {
  max-width: 100%; overflow-x: auto; border: 1px solid var(--border);
  background: var(--panel); margin: 24px 0;
}
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.6; }
caption {
  padding: 16px; text-align: left; font-weight: bold;
  color: var(--text); border-bottom: 2px solid var(--primary);
}
th, td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
thead th { background: var(--tint); }
tbody tr:nth-child(even) { background: var(--page); }
tbody tr:last-child > * { border-bottom: 0; }
.frequency-table { min-width: 720px; }
.frequency-table tbody td { font-family: "Courier New", Courier, monospace; }
.frequency-table td:nth-child(even), .frequency-table th:nth-child(even) { border-right: 1px solid var(--border); }
.euro-table { max-width: 480px; }
.euro-table tbody { font-family: "Courier New", Courier, monospace; }
.scroll-cue { margin-bottom: 8px; }
.table-scroll:focus-visible { outline-offset: 2px; }

/* Enhancement tools */
.tools {
  padding: 24px; border-top: 2px solid var(--primary);
  border-bottom: 1px solid var(--border); background: var(--panel);
}
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0; }
#result-count { font-weight: bold; }
#export-csv, #draft-copy { background: var(--primary); color: var(--panel); }
#export-csv:hover:not(:disabled), #draft-copy:hover:not(:disabled) { background: var(--primary-dark); }
#feedback-form { margin-top: 32px; }
#feedback-form select, #feedback-form textarea { margin-bottom: 24px; }
.field-help { margin: 8px 0 24px; }
.draft-preview {
  white-space: pre-wrap; overflow-wrap: anywhere; font: 16px/1.6 "Courier New", Courier, monospace;
  background: var(--panel); padding: 16px; border: 1px solid var(--border); min-height: 80px;
}
#draft-status:not(:empty), #export-status:not(:empty) {
  padding: 16px; border-left: 3px solid var(--primary); background: var(--panel);
}

/* Guides, legal text and disclosures */
.reading { max-width: 720px; }
.reading-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.reading-columns > div { border-top: 2px solid var(--primary); padding-top: 24px; }
.contents {
  display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 16px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 24px 0;
}
.contents a { display: inline-flex; align-items: center; min-height: 44px; }
.guide { padding-top: 24px; border-top: 2px solid var(--primary); }
.support {
  border-left: 3px solid var(--secondary); padding: 16px 24px;
  margin-top: 32px; background: var(--panel);
}
.support p:last-child { margin-bottom: 0; }
.faq { margin-top: 32px; border-top: 2px solid var(--primary); }
details { border-bottom: 1px solid var(--border); background: var(--panel); }
summary { padding: 16px; min-height: 56px; font-weight: bold; }
details > div { padding: 8px 24px; }
details[open] summary { border-bottom: 1px solid var(--border); }
.link-list, .record-links { padding-left: 24px; }
.link-list a, .record-links a { display: inline-block; padding: 8px 0; min-height: 44px; }

/* Three-column technical colophon */
.colophon {
  max-width: 1276px; margin: auto; border-top: 2px solid var(--primary);
  padding: 24px var(--page-padding) 40px;
}
.footer-snapshot { max-width: none; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font-size: 19px; letter-spacing: 0; margin-bottom: 16px; }
.footer-grid .brand { font-size: 21px; margin-bottom: 16px; }
.footer-grid nav a { display: block; min-height: 44px; padding: 8px 0; }
.footer-grid p:last-child { margin-bottom: 0; }

/* Breakpoints */
@media (min-width: 1280px) {
  .masthead { min-height: 92px; }
}
@media (max-width: 1279px) {
  :root { --page-padding: 24px; --section-gap: 40px; }
  .layout { padding-top: 24px; }
}
@media (max-width: 999px) {
  .filter-grid { grid-template-columns: 1fr; }
  .latest-ledger, .record-pools { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
  .reading-columns { grid-template-columns: 1fr; }
  .number-line { font-size: 27px; }
}
@media (max-width: 767px) {
  :root { --page-padding: 16px; --section-gap: 28px; }
  body { font-size: 16px; line-height: 1.65; }
  h1 { font-size: 30px; letter-spacing: -.5px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
  .brand { font-size: 24px; }
  .utility { padding-top: 8px; padding-bottom: 8px; }
  .masthead { min-height: 92px; height: auto; padding-top: 16px; padding-bottom: 16px; }
  .masthead-result time { margin-left: 0; }
  .masthead-result span { display: block; }
  .layout { display: block; padding: 0 var(--page-padding) var(--section-gap); }
  .date-index {
    display: flex; align-items: stretch; gap: 24px; height: 48px;
    margin: 0 calc(-1 * var(--page-padding)) 24px; padding: 0 var(--page-padding);
    border-left: 0; border-top: 1px solid var(--primary); border-bottom: 1px solid var(--border);
    overflow-x: auto; scrollbar-width: thin;
  }
  .date-index .index-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .date-index a { flex: 0 0 auto; min-height: 44px; padding: 8px 0; border: 0; white-space: nowrap; }
  .date-index a:focus-visible { outline-offset: -3px; }
  .primary { margin-bottom: 28px; gap: 8px 20px; }
  .intro { font-size: 16px; }
  .latest-ledger, .draw-record, .tools { padding: 16px; }
  .draw-record:target { padding-left: 12px; }
  .record-list > h2 { padding-left: 16px; }
  .record-pools dd { font-size: 22px; }
  .number-line { font-size: 26px; }
  th, td { padding: 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div { grid-column: 1 / -1; }
}
@media (max-width: 479px) {
  .primary { gap: 8px 16px; }
  .primary a { max-width: 100%; }
  .actions { flex-direction: column; align-items: stretch; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div { grid-column: auto; }
  .coverage { padding-left: 12px; }
  .record-pools { gap: 16px; }
  .record-pools dd { font-size: 20px; }
  .contents { display: block; }
  .contents a { display: flex; }
}

/* Existing additive visual layer */
body {
  background:
    radial-gradient(ellipse at 95% 5%, #E3B34115, transparent 34rem),
    radial-gradient(ellipse at 0% 28%, #D96C4F0B, transparent 30rem),
    var(--page);
}
.utility { color: var(--emerald); font-size: 14px; letter-spacing: .025em; }
.masthead { border-bottom: 3px solid var(--forest); }
.brand::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px;
  border-radius: 50%; background: var(--coral); vertical-align: middle;
}
.primary a[aria-current="page"] { border-color: var(--orange); }
.eyebrow { font-size: 14px; letter-spacing: .065em; }
.coverage { background: #FFFEFA80; border-left-color: var(--orange); }
.date-index { border-left-color: var(--orange); }
a, summary { transition: color 160ms ease, background-color 160ms ease, text-decoration-color 160ms ease; }
a:hover { color: var(--emerald); text-decoration-color: var(--orange); }
.date-index a, .primary a, .footer-grid nav a {
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.date-index a:hover, .date-index a:focus-visible { background: #E3B34120; box-shadow: inset 3px 0 var(--orange); }
button {
  border-radius: 10px;
  transition: transform 200ms cubic-bezier(.2, .8, .25, 1.3),
    background-color 160ms ease, box-shadow 200ms ease, border-color 160ms ease;
}
button:active:not(:disabled):not([aria-disabled="true"]) { transform: scale(.97); }
input, select, textarea {
  border-radius: 8px;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 4px #28665B10; }
.latest-ledger, .tools, .table-scroll, .support, .draft-preview { border-radius: 14px; }
.latest-ledger { border-top-width: 3px; box-shadow: 0 6px 22px #19352D06; }
.latest-ledger > div:last-child h3 { color: var(--purple); }
.draw-record, .reading-columns > div, .guide, .latest-ledger, .support {
  transition: background-color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.draw-record:focus-within, .draw-record:target { background: #FFF8DF; box-shadow: inset 0 0 0 1px #E3B34180; }
.reading-columns > div:nth-child(2) { border-top-color: var(--purple); }
.guide:nth-of-type(2) { border-top-color: var(--coral); }
.guide:nth-of-type(3) { border-top-color: var(--purple); }
.table-scroll tbody tr { transition: background-color 160ms ease, box-shadow 160ms ease; }
.table-scroll tbody tr:focus-within { background: #F7ECCD; box-shadow: inset 3px 0 var(--orange); }
.frequency-table tbody td:nth-child(even) { font-weight: bold; color: var(--emerald); }
.euro-table thead th { background: #76539A12; }
summary:hover, summary:focus-visible { background: #E3B34118; }
summary::marker { color: var(--orange); }
.filter-grid > div {
  padding: 14px; border-radius: 12px; border-top: 3px solid var(--emerald);
  background: #28665B09; transition: background-color 180ms ease, box-shadow 180ms ease;
}
.filter-grid > div:nth-child(2) { border-color: var(--orange); background: #E3B34112; }
.filter-grid > div:nth-child(3) { border-color: var(--purple); background: #76539A0B; }
.filter-grid > div:focus-within { box-shadow: 0 0 0 2px #19352D25; }
.filter-grid .has-selection { border: 2px solid var(--emerald); background: #E7EFE5; }
.filter-grid > div:nth-child(2).has-selection { border-color: var(--orange); background: #FBF0D3; }
.filter-grid > div:nth-child(3).has-selection { border-color: var(--purple); background: #F0EAF4; }
.filter-grid label { font-size: 15px; }
.filter-feedback { animation: filter-confirm 450ms ease-out; }
#result-count::before {
  content: ""; display: inline-block; height: 9px; width: 9px; margin-right: 10px;
  border-radius: 50%; background: var(--emerald);
}
.colophon { border-top-color: var(--forest); background: #FFFEFA65; }

/* Number wrappers preserve the original text and separators exactly. */
.archive-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.8em; height: 1.8em; margin-block: 3px; border-radius: 50%;
  background: var(--emerald); color: var(--panel); font-weight: bold;
  word-spacing: normal; line-height: 1; vertical-align: middle;
  box-shadow: inset 0 -3px 0 #19352D18, inset 0 2px 0 #FFFFFF30;
  transition: transform 180ms cubic-bezier(.2, .8, .25, 1.3), box-shadow 180ms ease;
}
.archive-number:nth-of-type(5n + 2) { background: var(--yellow); color: var(--forest); }
.archive-number:nth-of-type(5n + 3) { background: var(--purple); color: var(--panel); }
.archive-number:nth-of-type(5n + 4) { background: var(--coral); color: #162D26; }
.archive-number:nth-of-type(5n + 5) { background: var(--forest); color: var(--panel); }
.latest-ledger > div:last-child .archive-number,
.record-pools > div:last-child .archive-number,
td.numbers:last-child .archive-number {
  background: #F3EBD0; border: 1px solid var(--orange); color: var(--forest);
}
td.numbers .archive-number { width: 2.1em; height: 2.1em; }
.latest-ledger .archive-number { animation: archive-arrive 650ms cubic-bezier(.2, .8, .25, 1.1) both; }
.latest-ledger .archive-number:nth-of-type(2) { animation-delay: 70ms; }
.latest-ledger .archive-number:nth-of-type(3) { animation-delay: 140ms; }
.latest-ledger .archive-number:nth-of-type(4) { animation-delay: 210ms; }
.latest-ledger .archive-number:nth-of-type(5) { animation-delay: 280ms; }

/* Decorative hero illustration: one gentle entrance, no endless animation. */
.hero-art {
  position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center;
  gap: clamp(10px, 3vw, 28px); height: 174px; overflow: hidden; margin: -6px 0 28px;
  border: 1px solid #19352D0D; border-radius: 24px 64px 24px 24px;
  background: #FFFEFA80; pointer-events: none;
}
.hero-art::before {
  content: ""; position: absolute; z-index: -1; inset: -45% 12%;
  border: 28px solid #E3B34118; border-radius: 50%;
  transform: rotate(-12deg); animation: gentle-orbit 5s ease-in-out 1;
}
.hero-art::after {
  content: ""; position: absolute; width: 70px; height: 70px; right: -16px; bottom: -28px;
  background: var(--coral); border-radius: 18px; transform: rotate(25deg); opacity: .45;
}
.hero-ball {
  --lift: -9px;
  display: grid; place-items: center; flex: 0 0 auto;
  width: clamp(42px, 7vw, 74px); height: clamp(42px, 7vw, 74px); border-radius: 50%;
  color: var(--panel); background: var(--emerald);
  font: bold clamp(22px, 3.2vw, 34px)/1 "Courier New", monospace;
  box-shadow: inset -6px -7px 0 #19352D18, inset 3px 4px 0 #FFFFFF30, 0 12px 18px #19352D0D;
  transform: translateY(var(--lift)) rotate(-9deg); animation: hero-drift 4.8s ease-in-out 1;
}
.hero-ball:nth-of-type(2) { --lift: 12px; background: var(--yellow); color: var(--forest); animation-delay: 100ms; }
.hero-ball:nth-of-type(3) { --lift: -17px; background: var(--purple); animation-delay: 200ms; }
.hero-ball:nth-of-type(4) { --lift: 8px; background: var(--coral); color: #162D26; animation-delay: 300ms; }
.hero-ball:nth-of-type(5) { --lift: -5px; background: var(--forest); animation-delay: 400ms; }
.hero-doodle { position: absolute; width: 100%; height: 100%; inset: 0; z-index: -1; }
.hero-particle {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange); animation: particle-drift 3.8s ease-out 1;
}
.hero-particle:nth-last-child(1) { left: 17%; top: 24%; background: var(--purple); }
.hero-particle:nth-last-child(2) { right: 18%; bottom: 18%; background: var(--coral); animation-delay: 150ms; }
.hero-particle:nth-last-child(3) { right: 8%; top: 26%; background: var(--emerald); animation-delay: 300ms; }

/* Existing compact archive-number reveal game */
.lucky-reveal {
  position: relative; isolation: isolate; padding: 24px;
  border: 1px solid #D7DCCA; border-top: 3px solid var(--yellow); border-radius: 18px;
  background: radial-gradient(circle at 100% 0%, #E3B34124, transparent 60%), var(--panel);
  box-shadow: 0 8px 28px #19352D06;
}
.lucky-reveal h2 { font-size: 25px; margin-bottom: 10px; }
.lucky-reveal h2::before { content: "✦"; display: inline-block; margin-right: 10px; color: var(--purple); }
.lucky-reveal.is-celebrating h2::before { animation: icon-nod 700ms ease-out; }
.lucky-reveal > p { font-size: 15px; margin-bottom: 16px; }
.reveal-choices {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(10px, 2vw, 20px); margin: 24px 0;
}
.reveal-ball {
  --ball-color: var(--emerald); --ball-ink: var(--panel);
  width: 66px; height: 66px; min-height: 0; padding: 0; flex: 0 0 auto;
  border: 0; border-radius: 50%; background: transparent; perspective: 400px;
}
.reveal-ball:hover:not(:disabled), .reveal-ball:active:not(:disabled) { background: transparent; }
.reveal-ball:nth-child(2) { --ball-color: var(--yellow); --ball-ink: var(--forest); }
.reveal-ball:nth-child(3) { --ball-color: var(--purple); }
.reveal-ball:nth-child(4) { --ball-color: var(--coral); --ball-ink: #162D26; }
.reveal-ball:nth-child(5) { --ball-color: var(--forest); }
.reveal-ball[aria-disabled="true"] { cursor: default; }
.reveal-ball-inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform 430ms cubic-bezier(.2, .65, .3, 1);
}
.reveal-face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%;
  color: var(--ball-ink); background: var(--ball-color);
  box-shadow: inset -4px -5px 0 #19352D18, inset 2px 3px 0 #FFFFFF30, 0 5px 10px #19352D12;
  font: bold 27px/1 "Courier New", monospace;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.reveal-back { transform: rotateY(180deg); }
.reveal-ball.is-bouncing { animation: reveal-bounce 360ms ease-out; }
.reveal-ball.is-flipped .reveal-ball-inner { transform: rotateY(180deg); }
.reveal-ball.is-muted { opacity: .5; }
.reveal-ball { transition: opacity 180ms ease, transform 180ms ease; }
.reveal-result {
  min-height: 30px; padding: 12px 14px; border-radius: 10px;
  background: var(--tint); font-weight: bold;
}
.reveal-again { background: var(--forest); color: var(--panel); }
.reveal-again:hover:not(:disabled) { background: var(--emerald); }
.reveal-evidence { display: inline-block; margin-left: 16px; padding: 10px 0; font-size: 15px; }
.reveal-confetti { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.confetti-piece {
  position: absolute; left: 50%; top: 55%; width: 7px; height: 11px;
  background: var(--confetti-color); border-radius: 2px; opacity: 0;
  animation: tiny-celebration 850ms ease-out forwards;
}

/* Shared preference UI. No optional trackers are loaded by either choice. */
.cookie-banner {
  position: fixed; z-index: 90;
  left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom)); width: auto; max-width: 900px;
  max-height: 70vh; max-height: 70dvh; overflow-y: auto; margin-inline: auto;
  padding: 22px 24px; border: 1px solid var(--emerald); border-top: 4px solid var(--yellow);
  border-radius: 18px; background: var(--panel); box-shadow: 0 12px 65px #19352D35;
}
.cookie-banner h2 { font-size: 21px; margin-bottom: 8px; }
.cookie-banner p { max-width: none; font-size: 15px; margin-bottom: 14px; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cookie-accept, .cookie-decline { min-width: 110px; border-color: var(--emerald); }
.cookie-accept { background: var(--emerald); color: var(--panel); }
.cookie-accept:hover:not(:disabled) { background: var(--forest); }
.cookie-decline { background: var(--panel); color: var(--forest); }
.cookie-learn { display: inline-flex; align-items: center; min-height: 48px; padding: 8px; }
.cookie-close { margin-left: auto; }
.cookie-settings { display: block; margin-top: 28px; background: var(--panel); font-size: 14px; }
.cookie-save-status:not(:empty) {
  margin-top: 16px; margin-bottom: 0; padding: 12px;
  border-left: 3px solid var(--orange); background: var(--panel);
}
.storage-update {
  margin: 0 0 24px; padding: 18px; border: 1px solid var(--orange); border-left: 4px solid var(--orange);
  border-radius: 10px; background: #FFF8E5; font-size: 16px;
}
.storage-update h2 { font-size: 19px; margin-bottom: 8px; }
.storage-update p { margin-bottom: 0; }
body.consent-visible { padding-bottom: var(--consent-space, 300px); }
html.consent-visible { scroll-padding-bottom: var(--consent-space, 300px); }

@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-2px); box-shadow: 0 5px 12px #19352D14; }
  button:active:not(:disabled):not([aria-disabled="true"]) { transform: scale(.97); }
  .archive-number:hover { transform: translateY(-3px) rotate(-5deg); box-shadow: 0 5px 8px #19352D18; }
  .draw-record:hover, .latest-ledger:hover { box-shadow: inset 3px 0 var(--yellow), 0 6px 20px #19352D06; }
  .reading-columns > div:hover, .guide:hover { border-top-color: var(--orange); }
  .table-scroll tbody tr:hover { background: #F7ECCD; box-shadow: inset 3px 0 var(--orange); }
  .reveal-ball:hover:not([aria-disabled="true"]) { transform: translateY(-5px) rotate(-5deg); box-shadow: none; }
}
@media (max-width: 767px) {
  .hero-art { height: 144px; }
  .lucky-reveal { padding: 20px 16px; }
  .cookie-banner { padding: 18px; }
}
@media (max-width: 479px) {
  .hero-art { height: 122px; gap: 11px; }
  .reveal-ball { width: 44px; height: 44px; }
  .reveal-face { font-size: 22px; }
  .reveal-choices { gap: 8px; }
  .reveal-evidence { display: block; margin: 8px 0 0; }
  .cookie-banner { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .cookie-accept, .cookie-decline { flex: 1; }
  .cookie-learn { padding-left: 0; }
  .filter-grid > div { padding: 12px; }
}
@keyframes archive-arrive {
  0% { transform: translateY(7px) scale(.94); }
  65% { transform: translateY(-2px) scale(1.02); }
  100% { transform: none; }
}
@keyframes hero-drift {
  0%, 100% { transform: translateY(var(--lift)) rotate(-9deg); }
  45% { transform: translateY(calc(var(--lift) - 9px)) rotate(5deg); }
}
@keyframes gentle-orbit {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(0deg) translateX(8px); }
}
@keyframes particle-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes reveal-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-14px) scale(1.04); }
  70% { transform: translateY(2px) scale(.96); }
}
@keyframes tiny-celebration {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--confetti-x), var(--confetti-y)) rotate(var(--confetti-turn)); opacity: 0; }
}
@keyframes icon-nod {
  0%, 100% { transform: rotate(0); }
  40% { transform: rotate(35deg) scale(1.12); }
}
@keyframes filter-confirm {
  0% { box-shadow: 0 0 0 0 #28665B22; }
  100% { box-shadow: 0 0 0 6px #28665B00; }
}

/* Colourful reading-room refresh, shared by every page. */
body {
  background:
    radial-gradient(ellipse at 100% 0%, #F3D98475, transparent 42rem),
    radial-gradient(ellipse at 0% 25%, #DCD0EF60, transparent 34rem),
    radial-gradient(ellipse at 100% 70%, #BBDACC55, transparent 36rem),
    #FBF7EF;
}
.utility {
  background: var(--forest);
  color: #FFFEFA;
  border-bottom: 0;
}
.masthead {
  background: #FFFEFABF;
  border-bottom: 6px solid var(--emerald);
  border-image: linear-gradient(90deg, #28665B 0% 30%, #E3B341 30% 55%, #D96C4F 55% 78%, #76539A 78%) 1;
}
.brand::after {
  width: 10px;
  height: 10px;
  box-shadow: 13px -5px 0 -2px var(--yellow), 15px 7px 0 -2px var(--purple);
  margin-right: 18px;
}
h1 { letter-spacing: -.035em; }
.primary {
  padding: 6px;
  gap: 6px;
  border: 1px solid #C8D9CC;
  border-radius: 18px;
  background: #FFFEFABF;
}
.primary a { padding: 8px 16px; border-radius: 12px; }
.primary a[aria-current="page"] {
  border-bottom: 3px solid var(--forest);
  background: var(--emerald);
  color: var(--panel);
}
.primary a:not([aria-current="page"]):hover { background: #F8E8BC; }
.index-label { color: #614383; }
.date-index a { border-radius: 0 10px 10px 0; padding-left: 8px; }
.date-index a:nth-of-type(3n + 1) { border-bottom-color: #D8C4E6; }
.date-index a:nth-of-type(3n + 2) { border-bottom-color: #E9CF86; }
.date-index a:nth-of-type(3n) { border-bottom-color: #C2DCCD; }
.coverage {
  background: #FFF1CA;
  border: 1px solid #E7D39B;
  border-left: 5px solid var(--orange);
  border-radius: 0 14px 14px 0;
  padding-right: 16px;
}
.eyebrow { color: #614383; }
.latest-ledger { background: linear-gradient(110deg, #FFFEFA 45%, #F0E9F7); }
.table-scroll { box-shadow: 0 5px 0 #19352D08; }
caption { background: #E2F0E6; }
.euro-table caption { background: #EDE5F5; border-bottom-color: var(--purple); }
.reading-columns { gap: 20px; margin-bottom: 24px; }
.reading-columns > div {
  padding: 24px;
  border-radius: 16px;
  background: #E8F2E8;
  border-top-width: 4px;
}
.reading-columns > div:nth-child(2) { background: #EEE7F5; }
.contents { border-color: #D4C9E0; }
.contents a { border-radius: 8px; }
.contents a:hover { background: #EEE7F5; }
.faq { border-top-color: var(--purple); }
.faq details:nth-child(even) { background: #F4F0F8; }
.support { background: #FFF0D9; border-left-width: 5px; }
.colophon {
  border-top: 6px solid var(--emerald);
  background: linear-gradient(120deg, #E3EEE4, #F2EBF7);
}
.footer-grid nav h2 { color: #614383; }
.footer-grid nav a:hover { background: #FFFEFA80; border-radius: 8px; }
.hero-art { background: linear-gradient(110deg, #E3EEE4, #F5EBD1 55%, #EAE0F3); }
.lucky-reveal {
  border: 1px solid #D4BF8D;
  border-top: 5px solid var(--yellow);
  background: linear-gradient(120deg, #FFF7DE, #FFFEFA 65%, #F2EAF8);
}
.archive-illustration { margin: 32px 0; }
.archive-illustration img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #D2DCCA;
  border-radius: 24px;
}
.archive-illustration figcaption {
  padding: 14px 4px 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--forest);
}

/* Archive Pairs: fully local, untimed and keyboard-operable. */
.pairs-game {
  padding: clamp(18px, 3vw, 32px);
  border: 2px solid #CABBDB;
  border-top: 6px solid var(--purple);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, #F3D98480, transparent 55%),
    #F1EBF7;
  box-shadow: 0 8px 0 #76539A0D;
}
.pairs-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.pairs-heading h2 { margin-bottom: 0; font-size: clamp(28px, 4vw, 38px); }
.pairs-heading .eyebrow { margin-bottom: 8px; }
.play-sticker {
  display: grid;
  place-content: center;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border: 2px dashed #866324;
  border-radius: 50%;
  background: #F6D876;
  color: var(--forest);
  font-size: 15px;
  font-weight: bold;
  line-height: 1.2;
  text-align: center;
  transform: rotate(9deg);
}
.game-reassurance { color: #614383; font-size: 15px; font-weight: bold; }
.pairs-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 24px 0 18px;
}
#pairs-start { background: #614383; border-color: #614383; color: #FFFEFA; }
#pairs-start:hover { background: #4E326F; }
.pairs-score {
  margin: 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.pairs-score span { padding-inline: 8px; }
.pairs-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.pair-card {
  --card-paper: #E2EEE5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 0;
  min-height: 122px;
  padding: 22px 8px 12px;
  border: 2px solid #546C5E;
  border-radius: 14px;
  color: var(--forest);
  background: var(--card-paper);
  box-shadow: 0 4px 0 #19352D20;
}
.pair-card:nth-child(3n + 2) { --card-paper: #F9E7B5; }
.pair-card:nth-child(3n) { --card-paper: #E8DCF2; }
.pair-card:hover:not([aria-disabled="true"]) { background: var(--card-paper); border-color: #19352D; }
.pair-position {
  position: absolute;
  top: 6px;
  left: 10px;
  font: bold 12px/1.5 "Courier New", monospace;
  color: #465A50;
}
.pair-number { font: bold 36px/1.2 "Courier New", monospace; }
.pair-note { font-size: 12px; line-height: 1.5; margin-top: 6px; }
.pair-card.is-open { background: #FFFEFA; border-color: #76539A; }
.pair-card.is-matched { background: #D3EAD8; border-color: #28665B; box-shadow: none; }
.pair-card.is-matched .pair-note::before { content: "✓ "; }
.pair-card[aria-disabled="true"] { cursor: default; }
.pairs-continue {
  margin-bottom: 16px;
  background: #FFF4D4;
  border-color: #866324;
}
.pairs-status {
  max-width: none;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #D7CBE2;
  border-left: 4px solid var(--purple);
  border-radius: 10px;
  background: #FFFEFA;
  font-size: 15px;
}
.pairs-game.is-complete { border-color: var(--emerald); }
.pairs-game.is-complete .pairs-status { border-left-color: var(--emerald); background: #E2F0E6; }

@media (max-width: 767px) {
  .primary { gap: 4px; }
  .primary a { padding-inline: 12px; }
  .date-index a { padding-left: 0; }
  .reading-columns > div { padding: 20px; }
}
@media (max-width: 479px) {
  .primary a { padding-inline: 10px; font-size: 15px; }
  .archive-illustration img { border-radius: 16px; }
  .pairs-game { padding: 18px 12px; border-radius: 18px; }
  .pairs-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .pair-card { min-height: 106px; }
  .pair-number { font-size: 30px; }
  .play-sticker { flex-basis: 66px; width: 66px; height: 66px; font-size: 12px; }
  .pairs-heading .eyebrow { font-size: 12px; }
}
@media (forced-colors: active) {
  .pair-card.is-matched { border: 4px double ButtonText; }
  .pair-card.is-open { border: 3px solid Highlight; }
  .primary a[aria-current="page"] { outline: 2px solid Highlight; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  button:hover, button:active, .archive-number:hover { transform: none !important; }
  .reveal-confetti { display: none; }
}
@media print {
  .skip, .utility, .date-index, .primary, .tools, .actions,
  .hero-art, .lucky-reveal, .cookie-banner, .cookie-settings, .cookie-save-status,
  .pairs-game, .archive-illustration { display: none !important; }
  body, body.consent-visible { background: white; color: black; padding-bottom: 0; }
  .layout { display: block; padding: 0; }
  .reading { max-width: none; }
  .table-scroll { overflow: visible; }
  .colophon { break-before: auto; }
  a { color: inherit; }
  .archive-number {
    display: inline; background: none !important; color: black !important;
    border: 0 !important; box-shadow: none !important;
  }
}