:root {
    --ink: #1b1b17;
    --muted: #6b6a60;
    --paper: #f1eee5;
    --paper-deep: #e5e0d4;
    --body-copy: #45443d;
    --acid: #d8ff61;
    --line: rgba(27, 27, 23, 0.18);
    --glow: rgba(216, 255, 97, 0.18);
    --focus: #335c00;
    --card-shadow: rgba(26, 25, 20, 0.18);
    --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --ink: #f0ede4;
    --muted: #aaa89f;
    --paper: #11120f;
    --paper-deep: #1a1b17;
    --body-copy: #d2cfc5;
    --line: rgba(240, 237, 228, 0.2);
    --glow: rgba(174, 221, 54, 0.1);
    --focus: #d8ff61;
    --card-shadow: rgba(0, 0, 0, 0.42);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 85% 4%, var(--glow), transparent 22rem),
        var(--paper);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

a:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.7rem 1rem;
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header,
main,
footer {
    width: min(100% - 3rem, 1380px);
    margin-inline: auto;
}

.site-header {
    height: 7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.header-actions,
.footer-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-link,
.footer-links a {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25rem;
    text-transform: uppercase;
}

.theme-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.theme-control select {
    min-height: 2.25rem;
    padding: 0.35rem 1.8rem 0.35rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    background: var(--paper);
    font: inherit;
    letter-spacing: 0.05em;
    text-transform: none;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-decoration: none;
    text-transform: uppercase;
}

.wordmark svg {
    width: 2.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.15;
}

.collection-label,
.section-number,
.game-count,
.eyebrow {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.hero {
    min-height: min(760px, calc(100vh - 7rem));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 0 4.5rem;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 2.5rem;
}

.eyebrow span {
    width: 2.5rem;
    height: 1px;
    background: currentColor;
}

.hero h1 {
    max-width: 1100px;
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(4rem, 9.8vw, 9rem);
    font-weight: 400;
    letter-spacing: -0.065em;
    line-height: 0.82;
}

.hero h1 em {
    padding-left: 0.6em;
    color: var(--muted);
    font-weight: 400;
}

.hero-bottom {
    display: grid;
    grid-template-columns: minmax(280px, 520px) auto;
    gap: 3rem;
    align-items: end;
    justify-content: space-between;
    margin-top: 5rem;
}

.intro {
    margin: 0;
    color: var(--body-copy);
    font-size: clamp(1.05rem, 1.5vw, 1.35rem);
    line-height: 1.55;
}

.scroll-cue {
    display: inline-flex;
    align-items: center;
    gap: 1.2rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid currentColor;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-decoration: none;
    text-transform: uppercase;
}

.scroll-cue span {
    font-size: 1.1rem;
    transition: transform 160ms ease;
}

.scroll-cue:hover span {
    transform: translateY(4px);
}

.collection {
    padding: 8rem 0 9rem;
    border-top: 1px solid var(--line);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 3.25rem;
}

.section-number {
    margin: 0 0 0.75rem;
}

.section-heading h2,
.more h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 0.95;
}

.game-count {
    margin: 0 0 0.5rem;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.game-card {
    position: relative;
    overflow: hidden;
    min-height: 660px;
    display: flex;
    flex-direction: column;
    padding: clamp(1.4rem, 3vw, 2.4rem);
    border-radius: 2px;
    color: var(--card-ink);
    background: var(--card-bg);
    text-decoration: none;
    isolation: isolate;
    transition: transform 280ms cubic-bezier(.2,.8,.2,1), box-shadow 280ms ease;
}

.game-card:hover {
    z-index: 2;
    transform: translateY(-7px);
    box-shadow: 0 26px 60px var(--card-shadow);
}

.game-card:focus-visible {
    outline: 4px solid var(--focus);
    outline-offset: 4px;
}

.plain-game-list {
    grid-column: 1 / -1;
    margin: 0;
    padding: 1.5rem 1.5rem 1.5rem 3rem;
    border: 1px solid var(--line);
    font-size: 1.1rem;
}

.plain-game-list li + li {
    margin-top: 0.75rem;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
    font-size: 0.67rem;
    font-weight: 750;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.card-top span:last-child {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.9rem;
    transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.game-card:hover .card-top span:last-child {
    color: var(--card-bg);
    background: var(--card-ink);
    transform: rotate(-35deg);
}

.card-art {
    flex: 1;
    position: relative;
    min-height: 330px;
    margin: 2rem 0;
}

.card-copy {
    position: relative;
    z-index: 2;
    max-width: 35rem;
}

.card-kicker {
    margin: 0 0 0.65rem;
    font-size: 0.69rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.67;
}

.game-card h3 {
    margin: 0 0 0.8rem;
    font-family: var(--serif);
    font-size: clamp(2.55rem, 5vw, 5rem);
    font-weight: 400;
    letter-spacing: -0.055em;
    line-height: 0.9;
}

.card-description {
    max-width: 31rem;
    margin: 0;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    opacity: 0.76;
}

.game-card.rivers {
    --card-bg: #c8c4a1;
    --card-ink: #29392f;
}

.river-contours {
    position: absolute;
    inset: 6% 3%;
    border: 1px solid rgba(41, 57, 47, 0.25);
    border-radius: 52% 48% 62% 38% / 42% 55% 45% 58%;
    transform: rotate(-7deg);
}

.river-contours::before,
.river-contours::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(41, 57, 47, 0.24);
    border-radius: inherit;
}

.river-contours::before {
    inset: 10%;
}

.river-contours::after {
    inset: 21%;
}

.river-line {
    position: absolute;
    inset: -10% 35% -10% 31%;
    border-left: clamp(24px, 4vw, 58px) solid #7d9c90;
    border-radius: 50%;
    transform: rotate(24deg) skewY(-15deg);
    filter: drop-shadow(8px 3px 0 rgba(56, 84, 72, 0.18));
}

.river-dot {
    position: absolute;
    width: clamp(42px, 6vw, 72px);
    aspect-ratio: 1;
    right: 12%;
    top: 22%;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.river-dot::after {
    content: "";
    position: absolute;
    inset: 35%;
    border-radius: 50%;
    background: currentColor;
}

.game-card.nonoir {
    --card-bg: #111315;
    --card-ink: #f2f1eb;
}

.nonoir-board {
    position: absolute;
    width: min(75%, 360px);
    aspect-ratio: 1;
    top: 50%;
    left: 50%;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: clamp(5px, 1vw, 10px);
    padding: clamp(13px, 2vw, 22px);
    border: 1px solid #3a3c3d;
    transform: translate(-50%, -50%) rotate(4deg);
    transition: transform 500ms cubic-bezier(.2,.8,.2,1);
}

.game-card:hover .nonoir-board {
    transform: translate(-50%, -50%) rotate(0);
}

.nonoir-cell {
    aspect-ratio: 1;
    border: 1px solid #35383a;
    background: #191b1d;
}

.nonoir-cell.on {
    border-color: #e9ff9e;
    background: #e9ff9e;
}

.nonoir-cell.soft {
    border-color: #6e755b;
    background: #6e755b;
}

.game-card.junction-sum {
    --card-bg: #c8a676;
    --card-ink: #20231f;
}

.junction-sum-board {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(92%, 460px);
    overflow: visible;
    transform: translate(-50%, -50%) rotate(-2deg);
    transition: transform 500ms cubic-bezier(.2,.8,.2,1);
}

.game-card:hover .junction-sum-board {
    transform: translate(-50%, -50%) rotate(0);
}

.junction-sum-wires {
    fill: none;
    stroke: #704421;
    stroke-linecap: round;
    stroke-width: 7;
}

.junction-sum-nodes circle {
    fill: #ead7b8;
    stroke: currentColor;
    stroke-width: 2;
}

.junction-sum-nodes text {
    fill: currentColor;
    font-family: var(--sans);
    font-size: 18px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
}

.game-card.torch-tally {
    --card-bg: #171a1f;
    --card-ink: #f0e7d7;
    grid-column: 1 / -1;
    min-height: 600px;
}

.game-card.miswritten-keep {
    --card-bg: #21182a;
    --card-ink: #f3eadc;
    grid-column: 1 / -1;
    min-height: 600px;
}

.keep-window {
    position: absolute;
    top: 6%;
    left: 8%;
    width: clamp(60px, 9vw, 105px);
    height: clamp(105px, 15vw, 170px);
    display: flex;
    border: 2px solid #7d688c;
    border-radius: 70px 70px 0 0;
    background: #121526;
}

.keep-window span {
    flex: 1;
    border-right: 1px solid #7d688c;
}

.keep-window span:last-child {
    border: 0;
}

.keep-spell-ring {
    position: absolute;
    left: 50%;
    top: 49%;
    width: min(78%, 520px);
    aspect-ratio: 2.5 / 1;
    border: 2px solid #e6c86e;
    border-radius: 50%;
    box-shadow: 0 0 32px rgba(230, 200, 110, 0.45), inset 0 0 28px rgba(107, 63, 131, 0.3);
    transform: translate(-50%, -50%) rotate(-4deg);
    transition: transform 500ms cubic-bezier(.2,.8,.2,1), box-shadow 500ms ease;
}

.game-card:hover .keep-spell-ring {
    box-shadow: 0 0 48px rgba(143, 218, 200, 0.6), inset 0 0 28px rgba(107, 63, 131, 0.3);
    transform: translate(-50%, -50%) rotate(0);
}

.keep-sentence {
    position: absolute;
    z-index: 2;
    inset: 41% 5% auto;
    display: flex;
    justify-content: center;
    gap: clamp(5px, 1vw, 12px);
}

.keep-word {
    min-width: clamp(47px, 8vw, 78px);
    padding: clamp(7px, 1.2vw, 12px);
    border: 1px solid rgba(243, 234, 220, 0.3);
    border-bottom: 3px solid #e6c86e;
    background: #f3eadc;
    color: #21182a;
    text-align: center;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.35);
}

.keep-word.noun { border-bottom-color: #4f8db7; }
.keep-word.verb { border-bottom-color: #bf5b68; }
.keep-word strong,
.keep-word small { display: block; }
.keep-word strong { font-family: var(--serif); font-size: clamp(0.8rem, 2vw, 1.35rem); }
.keep-word small { margin-top: 0.2rem; color: #6e6274; font-size: clamp(0.42rem, 0.8vw, 0.6rem); text-transform: uppercase; }

.keep-rune {
    position: absolute;
    color: #8fdac8;
    font-family: var(--serif);
    text-shadow: 0 0 10px currentColor;
}

.rune-a { top: 18%; left: 55%; }
.rune-v { top: 68%; left: 21%; }
.rune-n { top: 23%; right: 17%; }

.feedback-invitation {
    padding: 8rem 0 9rem;
    border-top: 1px solid var(--line);
}

.feedback-heading {
    align-items: start;
    gap: 4rem;
}

.feedback-heading h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(2.8rem, 6vw, 5.6rem);
    font-weight: 400;
    letter-spacing: -0.055em;
    line-height: 0.9;
}

.feedback-intro {
    max-width: 29rem;
    margin: 2.25rem 0 0;
    color: var(--body-copy);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.feedback-prompts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.feedback-prompt {
    min-height: 430px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(1.75rem, 4vw, 3.5rem);
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper-deep) 72%, transparent);
}

.feedback-prompt:nth-child(2) {
    background: transparent;
}

.feedback-prompt h3 {
    margin: 0 0 1.5rem;
    font-family: var(--serif);
    font-size: clamp(2.5rem, 5vw, 4.7rem);
    font-weight: 400;
    letter-spacing: -0.055em;
    line-height: 0.9;
}

.feedback-prompt > p:not(.card-kicker) {
    max-width: 34rem;
    margin: 0 0 2.5rem;
    color: var(--body-copy);
    font-size: clamp(1rem, 1.3vw, 1.12rem);
}

.feedback-action {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 2.75rem;
    margin-top: auto;
    padding: 0.6rem 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    border-radius: 0;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    cursor: pointer;
}

.feedback-action span {
    font-size: 1.1rem;
    transition: transform 160ms ease;
}

.feedback-action:hover span {
    transform: translateX(4px);
}

.torch-tally-board {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(78%, 420px);
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(5px, 0.8vw, 9px);
    padding: clamp(12px, 2vw, 22px);
    border: 1px solid #4d5159;
    background: #111318;
    transform: translate(-50%, -50%) rotate(2deg);
    transition: transform 500ms cubic-bezier(.2,.8,.2,1);
}

.game-card:hover .torch-tally-board {
    transform: translate(-50%, -50%) rotate(0);
}

.torch-tally-cell {
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid #3c4149;
    background: #1b1f25;
    color: #f0bd58;
    font-family: var(--serif);
    font-size: clamp(0.9rem, 2vw, 1.45rem);
    font-weight: 700;
}

.torch-tally-cell.unknown {
    background: repeating-linear-gradient(135deg, #191c22 0 10px, #23272e 10px 11px);
}

.torch-tally-cell.danger {
    border: 1px dashed #dc8177;
    color: #dc8177;
}

.torch-tally-cell.relic {
    color: #7cc6d2;
}

.torch-tally-cell.entrance,
.torch-tally-cell.stairs {
    color: #9dcbb5;
}

.more {
    min-height: 520px;
    display: grid;
    grid-template-columns: 0.65fr 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
    padding: 6rem 0;
    border-top: 1px solid var(--line);
}

.more-mark {
    width: min(220px, 80%);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
}

.more-mark span {
    grid-area: 1 / 1;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink);
}

.more-mark span:nth-child(2) {
    transform: translateX(-30px);
}

.more-mark span:nth-child(3) {
    transform: translateX(30px);
}

.more > p {
    max-width: 24rem;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

footer {
    min-height: 8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-links p {
    margin: 0;
}

.privacy-page {
    width: min(100% - 3rem, 860px);
    padding: clamp(4rem, 9vw, 8rem) 0;
}

.privacy-page h1 {
    max-width: 760px;
    margin: 0 0 2rem;
    font-family: var(--serif);
    font-size: clamp(3.5rem, 9vw, 7rem);
    font-weight: 400;
    letter-spacing: -0.06em;
    line-height: 0.9;
}

.privacy-lede {
    max-width: 690px;
    margin: 0 0 4.5rem;
    color: var(--body-copy);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.6;
}

.privacy-section {
    padding: 2.75rem 0;
    border-top: 1px solid var(--line);
}

.privacy-section h2 {
    margin: 0 0 1rem;
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    font-weight: 400;
    letter-spacing: -0.035em;
}

.privacy-section p,
.privacy-section li {
    color: var(--body-copy);
}

.privacy-section p {
    margin: 0;
}

.privacy-section p + p,
.privacy-section ul + p {
    margin-top: 1rem;
}

.privacy-section ul {
    margin: 1rem 0 0;
    padding-left: 1.25rem;
}

.privacy-section li + li {
    margin-top: 0.55rem;
}

.privacy-updated {
    margin: 3rem 0 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@media (max-width: 820px) {
    .site-header,
    main,
    footer {
        width: min(100% - 2rem, 1380px);
    }

    .site-header {
        height: 5.25rem;
    }

    .collection-label {
        display: none;
    }

    .header-actions {
        gap: 0.75rem;
    }

    .theme-control > span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .hero {
        min-height: calc(100svh - 5.25rem);
        padding: 4rem 0 3rem;
    }

    .hero h1 {
        font-size: clamp(3.7rem, 18vw, 6.2rem);
        line-height: 0.87;
    }

    .hero h1 em {
        display: block;
        padding-left: 0.2em;
    }

    .hero-bottom {
        grid-template-columns: 1fr;
        align-items: start;
        margin-top: 3.5rem;
    }

    .scroll-cue {
        justify-self: start;
    }

    .collection {
        padding: 6rem 0;
    }

    .feedback-invitation {
        padding: 6rem 0;
    }

    .feedback-heading {
        display: grid;
        gap: 1rem;
    }

    .feedback-intro {
        margin-top: 1rem;
    }

    .feedback-prompts {
        grid-template-columns: 1fr;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .game-card {
        min-height: min(680px, 82vh);
    }

    .more {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 6rem 0;
    }

    .more-mark {
        width: 130px;
    }
}

@media (min-width: 821px) and (max-width: 1180px) {
    .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-card.junction-sum {
        grid-column: 1 / -1;
        min-height: 600px;
    }

    .game-card.miswritten-keep {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 17vw;
    }

    .section-heading {
        display: block;
    }

    .game-count {
        margin-top: 1.25rem;
    }

    .game-card {
        min-height: 590px;
    }

    footer {
        min-height: 7rem;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 0.35rem;
    }

    .footer-links {
        gap: 0.8rem;
    }

    footer p {
        margin: 0;
    }
}

@media (forced-colors: active) {
    .game-card,
    .theme-control select,
    .feedback-prompt,
    .feedback-action {
        border: 1px solid CanvasText;
    }
}

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

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
