:root {
    --ink: #171411;
    --ink-soft: #25201c;
    --ink-lift: #312923;
    --paper: #eee7d8;
    --paper-muted: #cfc5b2;
    --paper-faint: #978d7d;
    --line: rgba(238, 231, 216, 0.14);
    --line-strong: rgba(238, 231, 216, 0.28);
    --burgundy: #8f3340;
    --burgundy-light: #b84b59;
    --gold: #c79545;
    --gold-light: #e0bb77;
    --emerald: #2f765e;
    --emerald-light: #55a583;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
    --serif: Georgia, "Times New Roman", serif;
    --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    background:
        radial-gradient(circle at 50% -10%, rgba(143, 51, 64, 0.2), transparent 35rem),
        var(--ink);
    color: var(--paper);
    font-family: var(--sans);
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--gold-light);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.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;
}

.site-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.paper-noise {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.055;
    background-image:
        repeating-linear-gradient(12deg, transparent 0 3px, #fff 3px 4px),
        repeating-linear-gradient(97deg, transparent 0 7px, #fff 7px 8px);
    mix-blend-mode: soft-light;
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 clamp(18px, 5vw, 56px);
    border-bottom: 1px solid var(--line);
    background: rgba(23, 20, 17, 0.86);
    backdrop-filter: blur(18px);
}

.mini-wordmark {
    color: var(--paper);
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-decoration: none;
}

.mini-wordmark__leaf {
    color: var(--gold-light);
}

.header-actions {
    display: flex;
    gap: 4px;
}

.icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.icon-button:hover {
    background: rgba(238, 231, 216, 0.08);
}

.icon-button svg {
    width: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.hero {
    display: flex;
    min-height: 760px;
    padding: 150px 20px 80px;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--gold-light);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
}

.wordmark {
    display: flex;
    align-items: center;
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(4.6rem, 17vw, 9.2rem);
    font-weight: 400;
    letter-spacing: -0.09em;
    line-height: 0.84;
}

.wordmark__book {
    position: relative;
    display: grid;
    width: 0.78em;
    height: 1.02em;
    margin: 0 0.03em 0 0.06em;
    place-items: center;
    border: 1px solid var(--gold);
    background: linear-gradient(100deg, #a93949 0 47%, #7d2b37 48% 100%);
    box-shadow: inset 4px 0 0 rgba(0, 0, 0, 0.18), 0 13px 40px rgba(143, 51, 64, 0.28);
    color: var(--paper);
    font-size: 0.72em;
    font-style: italic;
    letter-spacing: -0.04em;
}

.wordmark__book::after {
    position: absolute;
    right: 12%;
    bottom: -13%;
    width: 17%;
    height: 27%;
    background: var(--gold-light);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
    content: "";
}

.hero__date {
    margin: 38px 0 4px;
    font-family: var(--serif);
    font-size: clamp(1.05rem, 3vw, 1.3rem);
}

.hero__dek {
    margin: 0;
    color: var(--paper-faint);
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 50px;
    padding: 0 24px;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-weight: 750;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    border: 1px solid var(--gold-light);
    background: var(--gold-light);
    box-shadow: 0 10px 28px rgba(199, 149, 69, 0.15);
    color: var(--ink);
}

.primary-button:hover {
    background: #efd08f;
    transform: translateY(-1px);
}

.secondary-button {
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--paper);
}

.secondary-button:hover {
    background: rgba(238, 231, 216, 0.06);
}

.hero__play {
    gap: 12px;
    margin-top: 34px;
    padding-inline: 30px;
}

.hero__play svg {
    width: 18px;
    fill: currentColor;
}

.edition-slip {
    display: grid;
    width: min(100%, 480px);
    margin-top: 68px;
    padding: 17px 22px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border: 1px solid rgba(199, 149, 69, 0.35);
    background:
        linear-gradient(135deg, rgba(199, 149, 69, 0.08), transparent),
        var(--ink-soft);
    box-shadow: var(--shadow);
    text-align: left;
}

.edition-slip > div:last-child {
    text-align: right;
}

.edition-slip__rule {
    width: 1px;
    height: 40px;
    margin: 0 22px;
    background: repeating-linear-gradient(to bottom, var(--gold) 0 3px, transparent 3px 6px);
}

.edition-slip__label {
    display: block;
    margin-bottom: 3px;
    color: var(--paper-faint);
    font-size: 0.58rem;
    letter-spacing: 0.15em;
}

.edition-slip strong {
    font-family: var(--serif);
    font-size: 0.92rem;
}

.archive-selector {
    width: min(100%, 720px);
    margin-top: 32px;
}

.archive-selector > p {
    margin: 0 0 10px;
    color: var(--paper-faint);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.archive-selector__dates {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
}

.archive-date {
    display: grid;
    min-width: 0;
    min-height: 65px;
    padding: 10px 6px;
    align-content: center;
    border-right: 1px solid var(--line);
    color: var(--paper-muted);
    text-align: center;
    text-decoration: none;
}

.archive-date:last-child {
    border-right: 0;
}

.archive-date:hover {
    background: rgba(238, 231, 216, 0.06);
    color: var(--paper);
}

.archive-date span,
.archive-date strong {
    display: block;
}

.archive-date span {
    color: var(--paper-faint);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.archive-date strong {
    margin-top: 2px;
    font-family: var(--serif);
    font-size: 0.86rem;
    font-weight: 400;
}

.archive-date--selected {
    background: rgba(199, 149, 69, 0.14);
    box-shadow: inset 0 -2px 0 var(--gold-light);
    color: var(--gold-light);
}

.archive-date--disabled {
    opacity: 0.38;
}

.archive-date--disabled:hover {
    background: transparent;
    color: var(--paper-muted);
}

.unavailable {
    display: flex;
    width: min(100%, 580px);
    margin-top: 38px;
    padding: 20px;
    gap: 16px;
    border: 1px solid rgba(199, 149, 69, 0.45);
    background: rgba(199, 149, 69, 0.08);
    text-align: left;
}

.unavailable__mark {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold-light);
}

.unavailable p {
    margin: 4px 0 0;
    color: var(--paper-muted);
}

.game-section {
    width: min(100% - 32px, 800px);
    margin: 0 auto 130px;
    scroll-margin-top: 88px;
}

.section-heading {
    display: grid;
    margin-bottom: 30px;
    grid-template-columns: minmax(30px, 1fr) auto minmax(30px, 1fr);
    gap: 22px;
    align-items: center;
    text-align: center;
}

.section-heading__rule {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--line-strong));
}

.section-heading__rule:last-child {
    background: linear-gradient(to left, transparent, var(--line-strong));
}

.section-heading h2,
.section-heading--left h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(2rem, 6vw, 3.3rem);
    font-weight: 400;
}

.attempt-counter {
    margin: -12px 0 24px;
    color: var(--paper-faint);
    font-size: 0.82rem;
    text-align: center;
}

.search-panel {
    position: relative;
    z-index: 5;
    width: min(100%, 660px);
    margin: 0 auto 20px;
}

.search-panel > label {
    display: block;
    margin-bottom: 8px;
    color: var(--paper-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.search-box {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    border: 1px solid var(--line-strong);
    background: var(--ink-soft);
    box-shadow: var(--shadow);
}

.search-box > svg {
    width: 21px;
    margin-left: 17px;
    fill: none;
    stroke: var(--paper-faint);
    stroke-linecap: round;
    stroke-width: 1.7;
}

.search-box input {
    min-width: 0;
    height: 58px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--paper);
}

.search-box input::placeholder {
    color: #756c60;
}

.search-help {
    margin: 9px 2px 0;
    color: var(--paper-faint);
    font-size: 0.72rem;
}

.search-results {
    position: absolute;
    top: calc(100% - 23px);
    right: 0;
    left: 0;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    background: #211d19;
    box-shadow: var(--shadow);
}

.search-result {
    display: grid;
    width: 100%;
    min-height: 72px;
    padding: 9px 13px;
    grid-template-columns: 36px 1fr auto;
    gap: 13px;
    align-items: center;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.search-result:hover,
.search-result[aria-selected="true"] {
    background: rgba(199, 149, 69, 0.12);
}

.search-result img {
    width: 36px;
    height: 54px;
    object-fit: cover;
    background: var(--ink-lift);
}

.search-result__copy {
    min-width: 0;
}

.search-result__copy strong,
.search-result__copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result__copy strong {
    font-family: var(--serif);
    font-size: 0.96rem;
}

.search-result__copy small {
    margin-top: 2px;
    color: var(--paper-faint);
    font-size: 0.7rem;
}

.search-result__add {
    color: var(--gold-light);
    font-size: 1.4rem;
    font-weight: 300;
}

.search-empty {
    margin: 0;
    padding: 22px;
    color: var(--paper-faint);
    text-align: center;
}

.hint-controls {
    display: grid;
    width: min(100%, 660px);
    margin: 22px auto;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.hint-button {
    display: flex;
    min-height: 48px;
    padding: 8px 13px;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--paper-muted);
    font-size: 0.75rem;
    cursor: pointer;
}

.hint-button:not(:disabled):hover {
    border-color: var(--gold);
    background: rgba(199, 149, 69, 0.08);
}

.hint-button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.hint-button__number {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: var(--serif);
}

.hint-list {
    width: min(100%, 660px);
    margin: 0 auto;
}

.revealed-hint {
    display: grid;
    margin: 10px 0;
    padding: 17px 18px;
    grid-template-columns: auto 1fr;
    gap: 16px;
    border-left: 3px solid var(--gold);
    background: rgba(199, 149, 69, 0.08);
}

.revealed-hint span {
    color: var(--gold-light);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.revealed-hint p {
    margin: 0;
    color: var(--paper-muted);
    font-family: var(--serif);
}

.game-message {
    min-height: 24px;
    margin: 8px 0;
    color: var(--gold-light);
    font-size: 0.8rem;
    text-align: center;
}

.guess-list {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.guess-card {
    padding: clamp(16px, 4vw, 24px);
    scroll-margin-top: 88px;
    border: 1px solid var(--line);
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.025), transparent 55%),
        var(--ink-soft);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.guess-card--revealing {
    animation: card-in 380ms ease both;
}

.guess-card--answer {
    border-color: rgba(85, 165, 131, 0.72);
    box-shadow: 0 18px 55px rgba(47, 118, 94, 0.16);
}

.guess-card__header {
    display: grid;
    margin-bottom: 18px;
    grid-template-columns: 76px 1fr;
    gap: 17px;
    align-items: center;
}

.guess-card__header img {
    width: 76px;
    height: 114px;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    box-shadow: 7px 9px 20px rgba(0, 0, 0, 0.3);
}

.guess-card__kicker {
    margin: 0 0 6px !important;
    color: var(--gold-light) !important;
    font-size: 0.62rem !important;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.guess-card__header h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.35rem, 4vw, 2rem);
    font-weight: 400;
    line-height: 1.15;
}

.guess-card__header p {
    margin: 8px 0 0;
    color: var(--paper-faint);
    font-size: 0.82rem;
}

.clue-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    perspective: 900px;
}

.clue {
    position: relative;
    display: flex;
    min-height: 104px;
    padding: 12px;
    flex-direction: column;
    border: 1px solid transparent;
    overflow: hidden;
    transform-style: preserve-3d;
}

.clue--exact {
    border-color: rgba(85, 165, 131, 0.75);
    background: rgba(47, 118, 94, 0.3);
}

.clue--close {
    border-color: rgba(224, 187, 119, 0.72);
    background: rgba(199, 149, 69, 0.24);
}

.clue--miss {
    border-color: rgba(238, 231, 216, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.guess-card--revealing .clue--pending {
    border-color: var(--line);
    background: var(--ink-lift);
    opacity: 0;
    transform: rotateY(-90deg) scale(0.96);
}

.guess-card--revealing .clue--flipping {
    animation: clue-flip-in 520ms cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

.guess-card--revealing .clue--revealed {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.clue__label {
    color: var(--paper-faint);
    font-size: 0.59rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.clue strong {
    display: -webkit-box;
    margin: auto 0;
    overflow: hidden;
    font-family: var(--serif);
    font-size: clamp(0.8rem, 2.4vw, 1.05rem);
    font-weight: 400;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.clue__flag {
    font-family: var(--sans);
    font-size: 1.35em;
    line-height: 1;
}

.clue__arrow {
    margin-left: 6px;
    color: var(--gold-light);
    font-family: var(--sans);
    font-weight: 800;
}

.clue__status {
    color: var(--paper-faint);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
}

.empty-guesses {
    display: flex;
    padding: 28px;
    gap: 15px;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--line-strong);
    color: var(--paper-faint);
    text-align: center;
}

.empty-guesses span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    font-family: var(--serif);
}

.empty-guesses p {
    margin: 0;
}

.result-slot:not(:empty) {
    margin: 30px 0;
}

.result-slot--pending {
    display: none;
}

.game-result {
    padding: clamp(24px, 6vw, 42px);
    border: 1px solid var(--gold);
    background:
        radial-gradient(circle at 100% 0, rgba(199, 149, 69, 0.2), transparent 40%),
        var(--ink-soft);
    box-shadow: var(--shadow);
    text-align: center;
}

.game-result--won {
    border-color: var(--emerald-light);
    background:
        radial-gradient(circle at 100% 0, rgba(47, 118, 94, 0.28), transparent 42%),
        var(--ink-soft);
}

.game-result h2 {
    margin: 0 0 24px;
    font-family: var(--serif);
    font-size: clamp(2rem, 7vw, 3.2rem);
    font-weight: 400;
}

.answer-reveal {
    display: flex;
    max-width: 520px;
    margin: 0 auto;
    gap: 20px;
    align-items: center;
    text-align: left;
}

.answer-reveal img {
    width: 108px;
    height: 162px;
    object-fit: cover;
    box-shadow: 9px 12px 25px rgba(0, 0, 0, 0.35);
}

.answer-reveal strong,
.answer-reveal span,
.answer-reveal small {
    display: block;
}

.answer-reveal strong {
    font-family: var(--serif);
    font-size: 1.35rem;
    line-height: 1.15;
}

.answer-reveal span {
    margin-top: 8px;
    color: var(--paper-muted);
}

.answer-reveal small {
    margin-top: 8px;
    color: var(--paper-faint);
}

.result-return {
    display: grid;
    max-width: 590px;
    margin: 28px auto 0;
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(190px, 1.35fr);
    border: 1px solid var(--line);
    text-align: left;
}

.result-return > div {
    min-width: 0;
    padding: 16px 18px;
    border-right: 1px solid var(--line);
}

.result-return > div:last-child {
    border-right: 0;
}

.result-return span {
    display: block;
    color: var(--paper-faint);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.result-return strong {
    display: block;
    margin-top: 3px;
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 400;
    white-space: nowrap;
}

.result-return__countdown strong {
    color: var(--gold-light);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.2rem;
    letter-spacing: 0.04em;
}

.archive-result-note {
    display: grid;
    max-width: 520px;
    margin: 28px auto 0;
    padding: 18px 20px;
    gap: 4px;
    border: 1px solid var(--line);
}

.archive-result-note strong {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 400;
}

.archive-result-note span {
    color: var(--paper-faint);
    font-size: 0.78rem;
}

.result-actions {
    display: flex;
    margin-top: 28px;
    gap: 10px;
    justify-content: center;
}

.how-it-works {
    width: min(100% - 40px, 1060px);
    margin: 0 auto;
    padding: 90px 0 130px;
    border-top: 1px solid var(--line);
}

.section-heading--left {
    display: block;
    max-width: 620px;
    margin-bottom: 42px;
    text-align: left;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
}

.step-card {
    min-height: 225px;
    padding: 28px;
    border-right: 1px solid var(--line);
}

.step-card:last-child {
    border-right: 0;
}

.step-card__number,
.attribute-grid article > span {
    color: var(--gold);
    font-family: var(--serif);
    font-size: 0.86rem;
}

.step-card h3,
.attribute-grid h3 {
    margin: 42px 0 10px;
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 400;
}

.step-card p,
.attribute-grid p {
    margin: 0;
    color: var(--paper-faint);
    font-size: 0.84rem;
}

.legend {
    display: flex;
    margin: 30px 0;
    gap: 26px;
    justify-content: center;
    color: var(--paper-muted);
    font-size: 0.75rem;
}

.legend span {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.legend__swatch {
    width: 12px;
    height: 12px;
    border: 1px solid;
}

.legend__swatch--exact { border-color: var(--emerald-light); background: var(--emerald); }
.legend__swatch--close { border-color: var(--gold-light); background: #7b5a27; }
.legend__swatch--miss { border-color: var(--line-strong); background: var(--ink-lift); }

.attribute-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.attribute-grid article {
    min-height: 170px;
    padding: 24px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.attribute-grid h3 {
    margin-top: 26px;
}

.site-footer {
    display: grid;
    min-height: 160px;
    padding: 40px clamp(20px, 5vw, 56px);
    grid-template-columns: auto 1fr auto;
    gap: 30px;
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--paper-faint);
}

.site-footer > span {
    color: var(--paper);
    font-family: var(--serif);
    font-weight: 700;
    letter-spacing: 0.15em;
}

.site-footer p {
    margin: 0;
    text-align: center;
}

.site-footer button {
    border: 0;
    background: transparent;
    color: var(--paper-muted);
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

.bookle-dialog {
    width: min(100% - 28px, 620px);
    max-height: calc(100vh - 40px);
    padding: 0;
    border: 1px solid var(--line-strong);
    background: var(--ink-soft);
    box-shadow: var(--shadow);
    color: var(--paper);
}

.bookle-dialog::backdrop {
    background: rgba(8, 7, 6, 0.78);
    backdrop-filter: blur(5px);
}

.dialog-card {
    position: relative;
    padding: clamp(28px, 7vw, 48px);
}

.dialog-card h2 {
    margin: 0 0 28px;
    font-family: var(--serif);
    font-size: clamp(2rem, 7vw, 3rem);
    font-weight: 400;
}

.dialog-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--paper-muted);
    font-size: 1.8rem;
    cursor: pointer;
}

.dialog-list {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 12px;
    list-style: none;
}

.dialog-list li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 14px;
    align-items: start;
}

.dialog-list li > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold-light);
    font-family: var(--serif);
}

.dialog-list p {
    margin: 3px 0;
    color: var(--paper-muted);
}

.hint-choice-dialog__intro {
    margin: -12px 0 22px;
    color: var(--paper-muted);
}

.hint-choice-list {
    display: grid;
    gap: 10px;
}

.hint-choice {
    display: grid;
    width: 100%;
    padding: 16px 18px;
    gap: 5px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--paper);
    text-align: left;
    cursor: pointer;
}

.hint-choice[hidden] {
    display: none;
}

.hint-choice:hover,
.hint-choice:focus-visible {
    border-color: var(--gold);
    background: rgba(199, 149, 69, 0.08);
    outline: none;
}

.hint-choice:disabled {
    opacity: 0.48;
    cursor: wait;
}

.hint-choice strong {
    color: var(--gold-light);
    font-family: var(--serif);
    font-size: 1.08rem;
    font-weight: 400;
}

.hint-choice span {
    color: var(--paper-faint);
    font-size: 0.75rem;
}

.hint-choice-dialog__message {
    min-height: 20px;
    margin: 14px 0 0;
    color: var(--burgundy-light);
    font-size: 0.75rem;
}

.hint-choice-dialog__continue {
    display: block;
    margin: 10px auto 0;
    border: 0;
    background: transparent;
    color: var(--paper-muted);
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stats-overview div {
    padding: 14px 6px;
    border: 1px solid var(--line);
    text-align: center;
}

.stats-overview strong,
.stats-overview span {
    display: block;
}

.stats-overview strong {
    font-family: var(--serif);
    font-size: 1.7rem;
    font-weight: 400;
}

.stats-overview span {
    color: var(--paper-faint);
    font-size: 0.6rem;
    text-transform: uppercase;
}

.distribution-title {
    margin: 30px 0 14px;
    font-family: var(--serif);
    font-weight: 400;
}

.distribution {
    display: grid;
    gap: 5px;
}

.distribution-row {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 8px;
    align-items: center;
    color: var(--paper-faint);
    font-size: 0.7rem;
}

.distribution-bar {
    min-width: 28px;
    padding: 3px 6px;
    background: var(--ink-lift);
    color: var(--paper);
    font-weight: 700;
    text-align: right;
}

.distribution-bar--best {
    background: var(--emerald);
}

.share-dialog__intro {
    margin: -16px 0 24px;
    color: var(--paper-muted);
}

.share-dialog__label {
    display: block;
    margin-bottom: 8px;
    color: var(--paper-faint);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.share-dialog__text {
    display: block;
    width: 100%;
    min-height: 190px;
    padding: 16px;
    resize: vertical;
    border: 1px solid var(--line-strong);
    background: var(--ink);
    color: var(--paper);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
}

.share-dialog__copy {
    width: 100%;
    margin-top: 14px;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    max-width: min(360px, calc(100% - 40px));
    padding: 12px 18px;
    border: 1px solid var(--gold);
    background: var(--ink-soft);
    box-shadow: var(--shadow);
    color: var(--paper);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: 180ms ease;
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes clue-flip-in {
    from {
        opacity: 0;
        transform: rotateY(-90deg) scale(0.96);
    }
    to {
        opacity: 1;
        transform: rotateY(0) scale(1);
    }
}

@media (max-width: 700px) {
    .hero {
        min-height: 710px;
        padding-top: 135px;
    }

    .wordmark {
        font-size: clamp(4rem, 22vw, 6.4rem);
    }

    .archive-selector {
        width: min(100vw - 40px, 560px);
    }

    .archive-selector__dates {
        grid-template-columns: repeat(7, minmax(74px, 1fr));
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: inline proximity;
    }

    .archive-date {
        scroll-snap-align: start;
    }

    .steps,
    .attribute-grid {
        grid-template-columns: 1fr;
    }

    .step-card {
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .step-card:last-child {
        border-bottom: 0;
    }

    .step-card h3 {
        margin-top: 24px;
    }

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

    .site-footer {
        grid-template-columns: 1fr;
        gap: 13px;
        text-align: center;
    }

    .site-footer p {
        order: 3;
    }
}

@media (max-width: 440px) {
    .site-header {
        height: 58px;
    }

    .hero {
        min-height: 660px;
        padding-inline: 16px;
        padding-top: 118px;
    }

    .edition-slip {
        padding-inline: 15px;
    }

    .edition-slip__rule {
        margin-inline: 13px;
    }

    .archive-selector {
        width: calc(100vw - 32px);
    }

    .hint-controls {
        grid-template-columns: 1fr;
    }

    .guess-card__header {
        grid-template-columns: 62px 1fr;
    }

    .guess-card__header img {
        width: 62px;
        height: 93px;
    }

    .clue {
        min-height: 96px;
        padding: 10px;
    }

    .result-actions {
        flex-direction: column;
    }

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

    .result-return__countdown {
        grid-column: 1 / -1;
        border-top: 1px solid var(--line);
    }

    .result-return > div:nth-child(2) {
        border-right: 0;
    }

    .answer-reveal {
        align-items: flex-start;
    }

    .answer-reveal img {
        width: 82px;
        height: 123px;
    }

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

    .legend {
        gap: 12px;
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
