/* Bad Art Auction — the page wears the game's own clothes.
   Palette and type are lifted from the game's public/style.css: paper,
   espresso, curtain red, gold; Fraunces for headings, Nunito for text,
   Caveat wherever the game writes by hand. */

:root {
    --paper: #F5EBD8;
    --paper-deep: #EFE0C6;
    --espresso: #4A342A;
    --curtain: #B8302F;
    --gold: #D4A437;
    --blue: #2E5E9E;
    --green: #2E7D4F;
    --ink-soft: rgba(74, 52, 42, 0.66);
    --hard-shadow: 0 6px 0 rgba(74, 52, 42, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--paper);
    background-image: radial-gradient(rgba(74, 52, 42, 0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    color: var(--espresso);
    font-family: Nunito, system-ui, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body.lightbox-open { overflow: hidden; }

h1, h2, h3 { font-family: Fraunces, Georgia, serif; }

/* `height: auto` is load-bearing: the <img> tags carry width/height
   attributes for layout stability, and without it the intrinsic height
   wins over the constrained width and every screenshot comes out squeezed. */
img { max-width: 100%; height: auto; display: block; }

.container {
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.75rem;
}

/* ── The curtain across the top ──────────────── */

.curtain {
    height: 14px;
    background:
        repeating-linear-gradient(90deg,
            var(--curtain) 0 22px,
            #a02827 22px 30px,
            var(--curtain) 30px 52px);
    border-bottom: 3px solid var(--espresso);
}

/* ── Back link ───────────────────────────────── */

.page-nav { padding: 1.5rem 0 0; }

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 900;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    text-decoration: none;
}

.back-home:hover { color: var(--espresso); }

/* ── Poster ──────────────────────────────────── */

.poster {
    position: relative;
    margin: 2.5rem 0 3.5rem;
    padding: 3rem 2.5rem 2.75rem;
    background: #fff;
    border: 3px solid var(--espresso);
    border-radius: 18px;
    box-shadow: var(--hard-shadow);
    text-align: center;
}

.ribbon {
    display: inline-block;
    padding: 0.35rem 1.1rem;
    background: var(--gold);
    border: 3px solid var(--espresso);
    border-radius: 999px;
    box-shadow: 0 3px 0 rgba(74, 52, 42, 0.22);
    font-weight: 900;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transform: rotate(-2deg);
}

.poster h1 {
    font-size: clamp(2.4rem, 7vw, 4rem);
    font-weight: 900;
    line-height: 1.05;
    margin: 1.25rem 0 0.35rem;
}

.poster__tagline {
    font-family: Caveat, cursive;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    color: var(--curtain);
    line-height: 1.1;
}

.poster__lead {
    max-width: 40rem;
    margin: 1.5rem auto 0;
    font-size: 1.02rem;
}

/* ── Buttons ─────────────────────────────────── */

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: 3px solid var(--espresso);
    border-radius: 999px;
    background: #fff;
    color: var(--espresso);
    font-family: Nunito, sans-serif;
    font-weight: 900;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 4px 0 rgba(74, 52, 42, 0.22);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn--play { background: var(--gold); }

.btn:not(.btn--off):hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(74, 52, 42, 0.22);
}

/* Nothing to click: the button stays visible so you can see what does not
   exist yet, but it is flat, grey and not focusable. */
.btn--off {
    background: var(--paper-deep);
    border-color: rgba(74, 52, 42, 0.3);
    color: rgba(74, 52, 42, 0.45);
    box-shadow: none;
    cursor: not-allowed;
}

.btn__note {
    font-weight: 700;
    font-size: 0.78rem;
    opacity: 0.7;
}

/* ── Section heads ───────────────────────────── */

.section-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-head h2 {
    font-size: 1.6rem;
    font-weight: 900;
}

.section-head p {
    font-family: Caveat, cursive;
    font-size: 1.3rem;
    color: var(--curtain);
}

/* ── Gallery: the lots on the wall ───────────── */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.75rem;
    padding-bottom: 3.5rem;
}

.lot {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: center;
    cursor: pointer;
}

.lot__frame {
    display: block;
    padding: 10px;
    background: linear-gradient(150deg, #e5bb56 0%, var(--gold) 45%, #b8862a 100%);
    border: 3px solid var(--espresso);
    border-radius: 6px;
    box-shadow: var(--hard-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lot__frame img {
    border: 2px solid rgba(74, 52, 42, 0.55);
    border-radius: 2px;
    background: #fff;
}

.lot:hover .lot__frame,
.lot:focus-visible .lot__frame {
    transform: translateY(-4px) rotate(-0.6deg);
    box-shadow: 0 12px 0 rgba(74, 52, 42, 0.16);
}

.lot__caption {
    display: block;
    margin-top: 0.75rem;
    font-family: Caveat, cursive;
    font-size: 1.25rem;
    line-height: 1.25;
    color: var(--espresso);
}

/* ── Index cards ─────────────────────────────── */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding-bottom: 4rem;
}

.card {
    position: relative;
    padding: 1.75rem 1.5rem 1.5rem;
    background: #fff;
    border: 3px solid var(--espresso);
    border-radius: 10px;
    box-shadow: var(--hard-shadow);
}

.card:nth-child(2) { transform: rotate(0.7deg); }
.card:nth-child(3) { transform: rotate(-0.5deg); }

.card h3 {
    font-size: 1.15rem;
    font-weight: 900;
    margin-bottom: 0.4rem;
}

.card p { font-size: 0.93rem; }

/* ── Closing bid ─────────────────────────────── */

.closing {
    padding: 0 0 4.5rem;
    text-align: center;
}

.closing p {
    font-family: Caveat, cursive;
    font-size: 1.6rem;
    color: var(--curtain);
    margin-bottom: 1.25rem;
}

/* ── Footer ──────────────────────────────────── */

footer {
    border-top: 3px solid var(--espresso);
    background: var(--paper-deep);
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* The wordmark is white with transparency — inverted it becomes ink, which is
   what a paper background needs. */
.footer-content img {
    height: 1.6rem;
    filter: invert(1);
    opacity: 0.7;
}

.footer-content a:hover img { opacity: 1; }

.footer-content a {
    color: var(--ink-soft);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
}

.footer-content a:hover { color: var(--espresso); }

.footer-copy { font-size: 0.8rem; color: var(--ink-soft); }

/* ── Lightbox ────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: rgba(74, 52, 42, 0.88);
}

.lightbox[hidden] { display: none; }

.lightbox__figure {
    max-width: min(1100px, 92vw);
    padding: 12px;
    background: linear-gradient(150deg, #e5bb56 0%, var(--gold) 45%, #b8862a 100%);
    border: 3px solid var(--espresso);
    border-radius: 6px;
}

.lightbox__img {
    max-height: 76vh;
    width: auto;
    border: 2px solid rgba(74, 52, 42, 0.55);
    background: #fff;
}

.lightbox__caption {
    margin-top: 0.6rem;
    font-family: Caveat, cursive;
    font-size: 1.3rem;
    color: var(--espresso);
    text-align: center;
}

.lightbox__close,
.lightbox__nav {
    flex: none;
    width: 46px;
    height: 46px;
    border: 3px solid var(--espresso);
    border-radius: 999px;
    background: var(--paper);
    color: var(--espresso);
    font-family: Nunito, sans-serif;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
}

.lightbox__close:hover,
.lightbox__nav:hover { background: var(--gold); }

@media (max-width: 640px) {
    .poster { padding: 2rem 1.25rem; }
    .lightbox { padding: 0.75rem; }
    .lightbox__nav { width: 38px; height: 38px; }
    .btn { width: 100%; justify-content: center; }
}
