/*
 * EPISSTLE's website. Colours taken from the title painting: candlelit amber, night purple,
 * the magenta of the logo, and the gold of the PISS.
 */

:root {
    --ink:        #0b0510;
    --night:      #120819;
    --plum:       #1d0d2a;
    --plum-2:     #2a1440;
    --line:       rgba(255, 220, 255, 0.09);
    --magenta:    #ff2fb3;
    --magenta-2:  #c4128a;
    --gold:       #ffd21f;
    --gold-2:     #f2a50c;
    --gold-light: #fff3a6;
    --amber:      #ff9b3d;
    --cream:      #f6ead2;
    --paper:      #f3e6c8;
    --text:       #f3ecf8;
    --muted:      #b6a5c9;
    --red:        #d4283a;

    --radius:     20px;
    --gutter:     clamp(16px, 4vw, 48px);
    --max:        1240px;
    --nav-h:      68px;

    --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Bungee", "Inter", sans-serif;
    --font-pixel:   "Silkscreen", ui-monospace, monospace;
    --font-letter:  "Special Elite", "Courier New", monospace;

    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 12px);
    -webkit-text-size-adjust: 100%;
}

html, body { overflow-x: clip; }

body {
    margin: 0;
    background: var(--night);
    color: var(--text);
    font: 400 17px/1.6 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

/* All the game art is pixel art: keep it crisp at any size. */
.stage-poster, .tile-shot img, .book-art img, .book-cover {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

button { font: inherit; color: inherit; }

em { font-style: normal; color: var(--gold); }

kbd {
    display: inline-block;
    padding: 1px 7px 2px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    font: 600 0.78em/1.4 var(--font-body);
    color: var(--text);
    white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ------------------------------------------------------------------ */
/* Bits and pieces                                                     */
/* ------------------------------------------------------------------ */

.brand {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 0.02em;
    color: var(--magenta);
    text-shadow: 0 2px 0 #3a0629, 0 0 18px rgba(255, 47, 179, 0.35);
    line-height: 1;
}
.brand span { color: var(--gold); text-shadow: 0 2px 0 #5a3700, 0 0 18px rgba(255, 210, 31, 0.4); }
.brand:hover { color: var(--magenta); }
.brand-small { font-size: 18px; }

.eyebrow {
    margin: 0 0 14px;
    font: 400 13px/1 var(--font-pixel);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: transform 0.18s cubic-bezier(.2, .9, .3, 1.4), box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn svg { width: 1.15em; height: 1.15em; fill: currentColor; }
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-gold {
    color: #2b1600;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 38%, var(--gold-2) 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 -3px 0 rgba(150, 80, 0, 0.35) inset,
                0 10px 30px -8px rgba(255, 190, 20, 0.6);
}
.btn-gold:hover {
    color: #2b1600;
    transform: translateY(-2px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 -3px 0 rgba(150, 80, 0, 0.35) inset,
                0 16px 40px -8px rgba(255, 190, 20, 0.75);
}

.btn-ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
    backdrop-filter: blur(6px);
}
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }

.btn-big   { padding: 17px 30px; font-size: 17px; }
.btn-small { padding: 10px 20px; font-size: 14px; }

/* Things fade and rise in as you scroll to them (site.js adds .in). */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ */
/* Nav                                                                 */
/* ------------------------------------------------------------------ */

.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 var(--gutter);
    padding-top: env(safe-area-inset-top);
    transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled {
    background: rgba(14, 6, 20, 0.72);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 1px 0 var(--line);
}
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

@media (max-width: 860px) {
    .nav-links { display: none; }
    .nav .btn { margin-left: auto; }
}

/* ------------------------------------------------------------------ */
/* Hero, and the stage the game plays on                               */
/* ------------------------------------------------------------------ */

.hero {
    position: relative;
    isolation: isolate;
    min-height: 100svh;
    padding: calc(var(--nav-h) + clamp(16px, 4vh, 48px)) var(--gutter) clamp(48px, 8vh, 96px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(28px, 5vh, 56px);
    overflow: hidden;
}

/* The painting again, blown up and blurred, as candlelight spilling round the screen. */
.hero-ambient {
    position: absolute;
    inset: -10%;
    z-index: -2;
    background: url("play/assets/title_tavern.png") center 30% / cover no-repeat;
    filter: blur(60px) saturate(1.5) brightness(0.55);
    transform: scale(1.1);
}
.hero-ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 35%, transparent 0%, rgba(18, 8, 25, 0.5) 70%),
        linear-gradient(180deg, rgba(18, 8, 25, 0.2) 0%, transparent 40%, var(--night) 96%);
}

.hero-drips { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

.stage-wrap {
    width: min(100%, 1344px, calc((100svh - var(--nav-h) - 120px) * 2.24));
    min-width: min(100%, 640px);
    perspective: 1600px;
}

.stage {
    position: relative;
    aspect-ratio: 448 / 200;
    border-radius: clamp(10px, 1.6vw, 22px);
    overflow: hidden;
    background: #000;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 0 6px rgba(10, 4, 14, 0.6),
        0 40px 100px -30px rgba(0, 0, 0, 0.9),
        0 0 120px -20px rgba(255, 140, 40, 0.35);
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(.2, .8, .2, 1), box-shadow 0.4s;
    will-change: transform;
}
.stage-poster { width: 100%; height: 100%; object-fit: cover; transition: transform 6s ease-out, filter 0.5s; }
.stage:hover .stage-poster { transform: scale(1.015); }

/* A soft glare that follows the mouse across the glass. */
.stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.12), transparent 45%);
    opacity: 0;
    transition: opacity 0.4s;
}
.stage:hover::after { opacity: 1; }

.stage-play {
    position: absolute;
    left: 50%;
    top: 84%;
    width: clamp(56px, 7.5vw, 96px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: #2b1600;
    background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 45%, var(--gold-2));
    box-shadow: 0 0 0 6px rgba(255, 210, 31, 0.25), 0 18px 50px -10px rgba(0, 0, 0, 0.8), 0 0 60px rgba(255, 200, 30, 0.6);
    transition: transform 0.25s cubic-bezier(.2, .9, .3, 1.5), opacity 0.3s;
}
.stage-play svg { width: 44%; height: 44%; fill: currentColor; margin-left: 8%; }
.stage-play:hover { transform: translate(-50%, -50%) scale(1.08); }
.stage-play-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    animation: ring 2.2s ease-out infinite;
}
@keyframes ring {
    from { transform: scale(1); opacity: 0.9; }
    to   { transform: scale(1.7); opacity: 0; }
}

.stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    transition: opacity 0.5s;
}

.stage-loading, .stage-error {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(8, 3, 12, 0.72);
    backdrop-filter: blur(6px);
    font: 400 14px/1.4 var(--font-pixel);
    color: var(--gold);
    text-align: center;
    padding: 24px;
}
.stage-error { color: var(--cream); font: 500 15px/1.6 var(--font-body); }
.stage-error strong { display: block; font-family: var(--font-display); font-weight: 400; color: var(--magenta); font-size: 20px; margin-bottom: 6px; }

/* The loading bar is a bladder filling up. */
.bladder {
    width: min(260px, 60%);
    height: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(255, 210, 31, 0.35) inset;
    overflow: hidden;
}
.bladder-fill {
    width: 40%;
    height: 100%;
    border-radius: inherit;
    background: repeating-linear-gradient(-45deg, var(--gold) 0 10px, var(--gold-2) 10px 20px);
    background-size: 28px 28px;
    animation: fill 1.6s ease-in-out infinite alternate, stripes 0.6s linear infinite;
}
@keyframes fill    { from { width: 12%; } to { width: 92%; } }
@keyframes stripes { to { background-position: 28px 0; } }

.stage.loading .stage-loading { display: flex; }
.stage.loading .stage-play,
.stage.playing .stage-play { opacity: 0; pointer-events: none; }
.stage.loading .stage-poster { filter: brightness(0.6) saturate(0.8); }
.stage.playing iframe { opacity: 1; }
.stage.playing { box-shadow: 0 0 0 1px rgba(255, 210, 31, 0.3), 0 0 0 6px rgba(10, 4, 14, 0.6), 0 40px 100px -30px rgba(0, 0, 0, 0.9), 0 0 140px -10px rgba(255, 180, 40, 0.45); }
.stage.failed .stage-error { display: flex; }
.stage.failed .stage-play { opacity: 0; pointer-events: none; }

.stage-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 0 4px;
    color: var(--muted);
    font-size: 13px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.4s, transform 0.4s;
}
.stage-wrap.started .stage-bar { opacity: 1; transform: none; }

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 1px var(--line) inset;
    transition: background 0.2s, transform 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hero-copy { max-width: 820px; text-align: center; }
.hero-copy h1 {
    margin: 0 0 18px;
    font: 400 clamp(30px, 5.2vw, 64px)/1.04 var(--font-display);
    letter-spacing: -0.01em;
    text-wrap: balance;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}
.lede { margin: 0 auto 30px; max-width: 640px; color: #d7c9e6; font-size: clamp(16px, 1.6vw, 19px); text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.small-print { margin: 18px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
    .stage-hint { display: none; }
    .stage-bar { justify-content: flex-end; }
    .cta-row .btn { width: 100%; }
}

/* ------------------------------------------------------------------ */
/* Marquee                                                             */
/* ------------------------------------------------------------------ */

.marquee {
    position: relative;
    overflow: hidden;
    padding: 16px 0;
    background: linear-gradient(90deg, var(--magenta-2), var(--magenta) 50%, var(--magenta-2));
    transform: rotate(-1.2deg) scale(1.02);
    box-shadow: 0 12px 40px -12px rgba(255, 47, 179, 0.6);
}
.marquee-track {
    display: flex;
    align-items: center;
    gap: 28px;
    width: max-content;
    animation: marquee 38s linear infinite;
}
.marquee span {
    font: 400 clamp(16px, 2vw, 22px)/1 var(--font-display);
    color: #fff;
    text-shadow: 0 2px 0 rgba(80, 0, 50, 0.6);
    white-space: nowrap;
}
.marquee i {
    width: 12px;
    height: 16px;
    flex: none;
    background: var(--gold);
    clip-path: polygon(50% 0, 85% 50%, 100% 75%, 80% 100%, 20% 100%, 0 75%, 15% 50%);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ------------------------------------------------------------------ */
/* Sections                                                            */
/* ------------------------------------------------------------------ */

.section {
    position: relative;
    padding: clamp(80px, 12vw, 150px) var(--gutter);
}
.section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section-dark { background: linear-gradient(180deg, var(--ink), #0e0614 60%, var(--ink)); }

.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); text-align: center; }
.section-head h2 {
    margin: 0 0 18px;
    font: 400 clamp(28px, 4.4vw, 52px)/1.06 var(--font-display);
    text-wrap: balance;
}
.section-head p:not(.eyebrow) { margin: 0 auto; color: var(--muted); font-size: clamp(16px, 1.5vw, 18px); text-wrap: pretty; }

/* ------------------------------------------------------------------ */
/* Bento of features                                                   */
/* ------------------------------------------------------------------ */

.bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    box-shadow: 0 0 0 1px var(--line) inset;
    transition: transform 0.4s cubic-bezier(.2, .8, .2, 1), box-shadow 0.4s;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(255, 210, 31, 0.25) inset, 0 30px 60px -30px rgba(0, 0, 0, 0.8); }
.tile-wide { grid-column: span 2; grid-row: span 2; }
.tile-shot { overflow: hidden; aspect-ratio: 16 / 10; background: #000; }
.tile-shot img { width: 100%; height: 100%; object-fit: cover; object-position: left center; transition: transform 0.8s cubic-bezier(.2, .8, .2, 1); }
.tile:hover .tile-shot img { transform: scale(1.05); }
.tile-wide .tile-shot { aspect-ratio: auto; flex: 1; min-height: 260px; }
.tile-copy { padding: 22px 24px 26px; }
.tile h3 { margin: 0 0 8px; font: 400 20px/1.15 var(--font-display); color: var(--cream); }
.tile-wide h3 { font-size: 28px; }
.tile p { margin: 0; color: var(--muted); font-size: 15px; }

@media (max-width: 1080px) {
    .bento { grid-template-columns: repeat(2, 1fr); }
    .tile-wide { grid-column: span 2; grid-row: auto; }
    .tile-wide .tile-shot { aspect-ratio: 16 / 10; flex: none; }
}
@media (max-width: 600px) {
    .bento { grid-template-columns: 1fr; }
    .tile-wide { grid-column: auto; }
}

/* ------------------------------------------------------------------ */
/* The panorama between the features and the shelf                     */
/* ------------------------------------------------------------------ */

.panorama {
    position: relative;
    height: clamp(300px, 52vw, 760px);
    overflow: hidden;
    background: var(--ink);
}
.panorama img {
    position: absolute;
    inset: -4% 0;
    width: 100%;
    height: 108%;
    object-fit: cover;
    object-position: center 60%;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 78%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 18%, #000 78%, transparent);
    animation: drift 30s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1.04) translateX(-1.5%); } to { transform: scale(1.1) translateX(1.5%); } }
.panorama-caption {
    position: absolute;
    left: 50%;
    bottom: clamp(18px, 4vw, 48px);
    transform: translateX(-50%);
    margin: 0;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(10, 4, 14, 0.7);
    backdrop-filter: blur(6px);
    font: 400 clamp(10px, 1.1vw, 12px)/1.2 var(--font-pixel);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* The shelf                                                           */
/* ------------------------------------------------------------------ */

.shelf {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 20px;
    max-width: 760px;
    margin: 0 auto;
}

.book {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--plum);
    box-shadow: 0 0 0 1px var(--line) inset;
    transition: transform 0.4s cubic-bezier(.2, .8, .2, 1), box-shadow 0.4s;
}
.book:hover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: 0 0 0 1px rgba(255, 47, 179, 0.4) inset, 0 30px 60px -24px rgba(255, 47, 179, 0.35); }

.book-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #000; }
.book-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; transition: opacity 0.5s, transform 0.8s cubic-bezier(.2, .8, .2, 1); }
.book:hover .book-art img { transform: scale(1.04); }
.book-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(29, 13, 42, 0.95));
}

.book-cover {
    position: absolute;
    z-index: 2;
    left: 18px;
    top: -38px;
    width: 64px;
    height: auto;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.6));
    transform: rotate(-5deg);
    transition: transform 0.4s cubic-bezier(.2, .9, .3, 1.5);
}
.book:hover .book-cover { transform: rotate(4deg) translateY(-6px) scale(1.06); }

.book-number {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(10, 4, 14, 0.7);
    backdrop-filter: blur(4px);
    font: 400 11px/1.2 var(--font-pixel);
    color: var(--gold);
}

.book-body { position: relative; padding: 26px 20px 22px 100px; min-height: 120px; }
.book-body h3 { margin: 0; font: 700 18px/1.2 var(--font-body); color: var(--cream); }
.book-meta { margin: 3px 0 12px; font-size: 13px; color: var(--muted); }
.book-verdict {
    margin: 0;
    margin-left: -80px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font: 400 14px/1.45 var(--font-letter);
    color: #e8d9bd;
}
.book-verdict span { display: block; margin-top: 3px; font: 400 12px/1.3 var(--font-body); color: var(--muted); }

/* The one you don't know about yet. */
.book-secret { cursor: default; background: repeating-linear-gradient(-45deg, #150a1d 0 12px, #1a0d24 12px 24px); }
.book-secret:hover { transform: none; box-shadow: 0 0 0 1px var(--line) inset; }
.book-secret .book-art { display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, #2a1440, #0b0510); }
.book-secret .book-art::after { display: none; }
.book-secret .secret-mark {
    font: 400 clamp(54px, 7vw, 80px)/1 var(--font-display);
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 210, 31, 0.5);
    animation: flicker 4s infinite;
}
@keyframes flicker { 0%, 100% { opacity: 0.9; } 45% { opacity: 0.5; } 50% { opacity: 1; } 52% { opacity: 0.4; } }
.book-secret .book-body { padding-left: 20px; }
.book-secret .book-verdict { margin-left: 0; }

/* ------------------------------------------------------------------ */
/* Gideon                                                              */
/* ------------------------------------------------------------------ */

.gideon {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
    gap: clamp(20px, 3vw, 40px);
    align-items: center;
}

.gideon-portrait {
    position: relative;
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
    box-shadow: 0 0 0 1px var(--line), 0 50px 100px -40px rgba(0, 0, 0, 0.9), 0 0 120px -40px rgba(255, 140, 40, 0.4);
}
.gideon-portrait img { width: 100%; height: 100%; object-fit: cover; }
.gideon-portrait figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 36px 24px 18px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82) 45%);
    font: 400 clamp(13px, 1.4vw, 16px)/1.45 var(--font-pixel);
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 0 #000;
    min-height: 3.2em;
}

.letter {
    position: relative;
    padding: 34px 28px 30px;
    background:
        linear-gradient(180deg, transparent 32.6%, rgba(120, 90, 50, 0.18) 33%, transparent 33.6%, transparent 65.6%, rgba(120, 90, 50, 0.18) 66%, transparent 66.6%),
        var(--paper);
    color: #2a2015;
    font: 400 16px/1.55 var(--font-letter);
    border-radius: 3px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 2px 0 rgba(0, 0, 0, 0.2);
    transform: rotate(1.6deg);
    transition: transform 0.4s cubic-bezier(.2, .9, .3, 1.4);
}
.letter p { margin: 0 0 12px; }
.letter-no { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #7a6a52; }
.letter-from { margin-top: 18px !important; font-style: italic; }
.letter-pin {
    position: absolute;
    top: -8px;
    left: 50%;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ff7b85, var(--red) 50%, #6e0f19);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}
.letter-stamp {
    position: absolute;
    right: 18px;
    bottom: 22px;
    padding: 4px 12px;
    border: 3px double var(--red);
    border-radius: 4px;
    font: 400 18px/1 var(--font-display);
    letter-spacing: 0.08em;
    color: var(--red);
    text-transform: uppercase;
    transform: rotate(-12deg);
    opacity: 0.85;
    mix-blend-mode: multiply;
}

@media (max-width: 860px) {
    .gideon { grid-template-columns: 1fr; }
    .letter { max-width: 520px; margin: 0 auto; width: 100%; }
}

/* ------------------------------------------------------------------ */
/* How to play                                                         */
/* ------------------------------------------------------------------ */

.howto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 18px;
}
.how {
    padding: 28px 26px;
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(255, 47, 179, 0.06), rgba(255, 255, 255, 0.02) 50%);
    box-shadow: 0 0 0 1px var(--line) inset;
}
.how-key {
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(255, 210, 31, 0.18), rgba(255, 210, 31, 0.06));
    box-shadow: 0 0 0 1px rgba(255, 210, 31, 0.3) inset;
    color: var(--gold);
}
.how-key svg { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; }
.how-key .pixel { font: 400 13px/1 var(--font-pixel); }
.how h3 { margin: 0 0 6px; font: 700 18px/1.3 var(--font-body); color: var(--cream); }
.how p { margin: 0; color: var(--muted); font-size: 15px; }

/* ------------------------------------------------------------------ */
/* FAQ                                                                 */
/* ------------------------------------------------------------------ */

.faq-section { padding-top: 0; padding-bottom: clamp(60px, 8vw, 100px); }
.faq { max-width: 820px !important; display: grid; gap: 12px; }
.faq details {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 0 0 1px var(--line) inset;
    overflow: hidden;
}
.faq summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 56px 20px 24px;
    position: relative;
    font-weight: 600;
    color: var(--cream);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font: 400 22px/1 var(--font-display);
    color: var(--gold);
    transition: transform 0.3s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0; padding: 0 24px 22px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Finale and footer                                                   */
/* ------------------------------------------------------------------ */

.finale {
    position: relative;
    padding: clamp(90px, 14vw, 180px) var(--gutter);
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}
.finale::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 42% 55% at 50% 58%, rgba(18, 8, 25, 0.95), transparent 80%),
        url("img/illustrations/a-toast-to-bad-reviews.jpg") center 30% / cover no-repeat;  /* Gideon's toast, with the dark wall behind the words. */
    opacity: 0.55;
    filter: saturate(1.2);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.finale h2 {
    margin: 0 0 34px;
    font: 400 clamp(32px, 6vw, 76px)/1.02 var(--font-display);
    text-shadow: 0 6px 0 rgba(0, 0, 0, 0.4);
}
.finale h2 em { display: block; }

/* Ko-fi. */
.tip-jar { margin-top: 44px; color: var(--muted); font-size: 15px; }
.tip-jar p { margin: 0 0 14px; }
.tip-jar p span { display: block; margin-top: 4px; font: 400 14px/1.4 var(--font-letter); color: var(--gold); opacity: 0.8; }
.tip-jar a { display: inline-block; transition: transform 0.25s cubic-bezier(.2, .9, .3, 1.5); }
.tip-jar a:hover { transform: rotate(-3deg) scale(1.05); }
.tip-jar img { display: block; }

.footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
    padding: 30px var(--gutter) calc(30px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

/* A pill to get back to the game, when you've scrolled away from it mid-game. */
.back-to-game {
    position: fixed;
    z-index: 60;
    left: 50%;
    bottom: calc(20px + env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #2b1600;
    background: var(--gold);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 200, 30, 0.4);
    transform: translateX(-50%);
    animation: pop-in 0.4s cubic-bezier(.2, .9, .3, 1.5);
}
.back-to-game[hidden] { display: none; }
@keyframes pop-in { from { transform: translate(-50%, 30px); opacity: 0; } }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(212, 40, 58, 0.7); animation: live 1.4s infinite; }
@keyframes live { to { box-shadow: 0 0 0 10px rgba(212, 40, 58, 0); } }

/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
    .marquee-track { animation: none; }
}
