/* The game landing pages: /games/ and /games/<slug>/.
 *
 * These pages are the site's front door for anything that arrives from a
 * search engine or a shared link, so they use the homepage's palette, type and
 * radii rather than a look of their own. The homepage keeps its CSS inline
 * because it is one page; this is a stylesheet because two pages share it and a
 * third (whatever the catalogue grows into) will too.
 *
 * Loaded after game-chrome.css, which owns the header and footer bars and makes
 * the body a column so the footer sits at the bottom of a short page.
 */

:root {
    --bg: #f5f4ef;
    --surface: #ffffff;
    --ink: #102c2b;
    --muted: #6a7773;
    --line: rgba(16, 44, 43, .14);
    --coral: #ff6046;
    --coral-deep: #e94b33;
    --aqua: #26b8ae;
    --blue: #3d65e6;
    --yellow: #ffd457;
    --dark: #102725;
    --lp-max: 1120px;
}

* { box-sizing: border-box; }

.lp-body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* The homepage's dotted ground, so arriving here from it feels continuous. */
.lp-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: .42;
    pointer-events: none;
    background-image: radial-gradient(rgba(16, 44, 43, .09) .7px, transparent .7px);
    background-size: 8px 8px;
    mask-image: linear-gradient(#000, transparent 72%);
}

.lp-body img { display: block; max-width: 100%; }

/* No blanket link reset here on purpose. `.lp a { color: inherit }` reads as
   harmless and is not: it is one component class plus an element, so it beats
   a plain `.lp-btn-primary` on specificity and quietly repaints every button
   label in the body colour — white text on a dark pill became dark text on a
   dark pill, i.e. an empty-looking button. Each component below states its own
   colour instead, and the few prose links keep the browser's underline. */

.lp {
    width: min(calc(100% - 36px), var(--lp-max));
    margin-inline: auto;
    padding-bottom: 24px;
}

.lp h1, .lp h2, .lp h3, .lp p { margin-top: 0; }

/* --- breadcrumb --------------------------------------------------------- */

/* Genuinely useful here rather than decoration: most visitors to these pages
   arrive from outside and have no idea what the rest of the site holds. */
.lp-crumbs { padding: 22px 0 0; }
.lp-crumbs ol {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}
.lp-crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.lp-crumbs a { color: var(--muted); text-decoration: none; }
.lp-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.lp-crumbs [aria-current] { color: var(--ink); }

/* --- hero --------------------------------------------------------------- */

.lp-hero {
    margin: 26px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: clamp(28px, 4vw, 56px);
    padding: clamp(30px, 4vw, 54px);
    border-radius: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 24px 64px rgba(16, 44, 43, .1);
}

.lp-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--coral);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.lp-kicker::before { content: ""; width: 26px; height: 3px; border-radius: 10px; background: var(--yellow); }

.lp-hero h1 {
    margin-bottom: 16px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(40px, 5.2vw, 68px);
    font-weight: 700;
    line-height: .95;
    letter-spacing: -.055em;
}

.lp-lede { max-width: 46ch; margin-bottom: 16px; color: #4c5b58; font-size: 19px; line-height: 1.55; }

/* The introduction lives in the first block, not in a later About section
   and not behind a play button that has already picked a mode. */
.lp-intro { max-width: 48ch; margin: 0 0 12px; color: #45534f; font-size: 17px; line-height: 1.6; }
.lp-intro:last-of-type { margin-bottom: 22px; }

.lp-facts {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}
.lp-facts li {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    font-size: 14px;
    font-weight: 800;
}

.lp-btn {
    min-height: 48px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.lp-btn-primary { color: #fff; background: var(--coral); box-shadow: 0 10px 28px rgba(255, 96, 70, .3); }
.lp-btn-primary:hover { background: var(--coral-deep); }
.lp-btn-ghost { border: 1px solid var(--line); background: rgba(255, 255, 255, .6); color: var(--ink); }
.lp-btn-ghost:hover { border-color: var(--ink); }
.lp-btn-dark { color: #fff; background: var(--ink); }

.lp-soon-note {
    max-width: 48ch;
    margin: 22px 0 0;
    padding: 18px 20px;
    border: 1px dashed rgba(16, 44, 43, .28);
    border-radius: 18px;
    background: var(--bg);
    color: #4c5b58;
    font-size: 16px;
}
.lp-soon-note strong { display: block; color: var(--ink); }
.lp-soon-note a { color: var(--coral); font-weight: 800; }

.lp-hero-art {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #d9d7ce;
    aspect-ratio: 16 / 10;
}
.lp-hero-art img { width: 100%; height: 100%; object-fit: cover; }

.lp-flag {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--coral);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.lp-flag-soon { background: rgba(9, 29, 27, .86); backdrop-filter: blur(8px); }

/* --- the start-panel hero (playable games) ------------------------------ */

/* The pitch and the game's scene on the left, one white panel on the right
   holding every way to begin — like the booking panel beside a flight. The
   hero card chrome comes off so the panel is the only card in view: a white
   panel inside a white card would disappear. */
.lp-hero-start {
    grid-template-columns: 1.18fr minmax(340px, .82fr);
    grid-template-areas:
        "copy panel"
        "art  panel";
    align-items: start;
    row-gap: 30px;
    padding: clamp(14px, 2vw, 26px) 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.lp-hero-start .lp-hero-copy { grid-area: copy; }
.lp-hero-start .lp-hero-art {
    grid-area: art;
    aspect-ratio: auto;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(16, 44, 43, .18);
}

.lp-start {
    grid-area: panel;
    align-self: start;
    position: sticky;
    top: 18px;
    padding: clamp(22px, 2.4vw, 30px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 24px 64px rgba(16, 44, 43, .12);
}

.lp-start-title {
    margin-bottom: 16px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.035em;
}

.lp-start-play { width: 100%; min-height: 58px; font-size: 19px; }
.lp-start-tri { font-size: 14px; translate: 0 -1px; }
.lp-start-note { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; text-align: center; }
.lp-start-note a { color: var(--ink); }

/* Thin labelled rules divide the panel into its three registers: play now,
   with friends, joining someone. */
.lp-start-rule {
    margin: 24px 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.lp-start-rule::before,
.lp-start-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.lp-start-row {
    margin-bottom: 10px;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: #eef4f0;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.lp-start-row:hover {
    transform: translateY(-1px);
    border-color: rgba(38, 184, 174, .55);
    background: #e8f2ec;
}
.lp-start-row:last-of-type { margin-bottom: 0; }

.lp-start-ico { flex: 0 0 68px; display: grid; place-items: center; }
.lp-start-ico .lp-dg { max-width: 68px; }

.lp-start-row-copy { display: grid; gap: 1px; }
.lp-start-row-copy strong { font: 700 17px "Space Grotesk", sans-serif; letter-spacing: -.025em; }
.lp-start-row-copy small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }

.lp-start-arrow { margin-left: auto; font-weight: 800; opacity: .55; }
.lp-start-row:hover .lp-start-arrow { opacity: 1; }

/* The code entry: four boxes and a go button. The shape is the caption. */
.lp-code { display: flex; justify-content: center; gap: 9px; }
.lp-code input {
    width: 52px;
    height: 56px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--bg);
    color: var(--ink);
    font: 700 23px "Space Grotesk", sans-serif;
    text-align: center;
    text-transform: uppercase;
}
.lp-code input:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(255, 96, 70, .18);
    background: var(--surface);
}
.lp-code button {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 13px;
    background: var(--ink);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}
.lp-code button:hover { background: var(--coral); }

/* The settings, for whoever wants them: a footnote, not a fourth option. */
.lp-start-more {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.5;
    text-align: center;
}
.lp-start-more a {
    color: var(--ink);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(16, 44, 43, .32);
    text-underline-offset: 3px;
}
.lp-start-more a:hover { text-decoration-color: currentColor; }

/* --- sections ----------------------------------------------------------- */

.lp-section { padding: clamp(46px, 5vw, 74px) 0 0; }

.lp-section-top { margin-bottom: 28px; }
.lp-section-top p { margin: 12px 0 0; max-width: 60ch; color: var(--muted); font-size: 18px; }
.lp-section-top a { color: var(--coral); font-weight: 800; text-decoration: none; }

.lp h2 {
    margin-bottom: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(32px, 3.8vw, 50px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.055em;
}

/* --- the drawings ------------------------------------------------------- */

/* Styled here rather than in the SVG so the pictures follow the palette. See
   lib/game-diagrams.php for what each shape is. */
.lp-dg { width: 100%; max-width: 430px; height: auto; color: var(--ink); }
.lp-dg .dg-ink {
    fill: none;
    stroke: currentColor;
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.lp-dg .dg-hair { stroke-width: 1.8; opacity: .45; }
.lp-dg .dg-paper { fill: var(--surface); }            /* after dg-ink, which sets fill:none */
.lp-dg .dg-tint { fill: rgba(38, 184, 174, .18); stroke: none; }
.lp-dg .dg-halo { fill: rgba(38, 184, 174, .09); stroke: none; }
.lp-dg .dg-solid { fill: var(--coral); stroke: none; }
.lp-dg .dg-link {
    fill: none;
    stroke: var(--aqua);
    stroke-width: 2.6;
    stroke-dasharray: 5 7;
    stroke-linecap: round;
}

/* --- how to play -------------------------------------------------------- */

.lp-steps {
    margin: 26px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
    list-style: none;
    counter-reset: step;
}
.lp-steps li {
    position: relative;
    padding: 18px 22px 18px 62px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    font-size: 17px;
    line-height: 1.55;
    counter-increment: step;
}
.lp-steps li::before {
    content: counter(step);
    position: absolute;
    left: 20px;
    top: 17px;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--ink);
    font: 800 14px "Space Grotesk", sans-serif;
}

/* --- prose -------------------------------------------------------------- */

.lp-prose h2 { margin-bottom: 22px; }
.lp-prose p {
    max-width: 70ch;
    margin-bottom: 18px;
    color: #45534f;
    font-size: 18.5px;
    line-height: 1.68;
}

/* --- questions ---------------------------------------------------------- */

.lp-faq { margin-top: 26px; display: grid; gap: 10px; }
.lp-faq details {
    padding: 4px 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}
.lp-faq summary {
    padding: 18px 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -.02em;
    cursor: pointer;
}
.lp-faq summary::marker { color: var(--coral); }
.lp-faq details p { margin: 0 0 18px; max-width: 74ch; color: #4c5b58; }

/* --- more games --------------------------------------------------------- */

.lp-more-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.lp-more-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease;
}
.lp-more-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(16, 44, 43, .12); }
.lp-more-card.is-playable { border-color: rgba(255, 96, 70, .4); }
.lp-more-art { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #d9d7ce; }
.lp-more-art img { width: 100%; height: 100%; object-fit: cover; }
.lp-more-body { padding: 16px 18px 18px; display: grid; gap: 5px; }
.lp-more-body strong { font: 700 19px "Space Grotesk", sans-serif; letter-spacing: -.035em; }
.lp-more-tag { color: var(--muted); font-size: 14px; }
.lp-more-flag { color: var(--muted); font-size: 12.5px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.lp-more-card.is-playable .lp-more-flag { color: var(--coral); }

/* --- final call --------------------------------------------------------- */

.lp-final { margin: clamp(52px, 6vw, 84px) 0 12px; }
.lp-final-inner {
    position: relative;
    overflow: hidden;
    padding: clamp(42px, 5vw, 66px) 28px;
    border-radius: 28px;
    background: var(--blue);
    color: #fff;
    text-align: center;
    isolation: isolate;
}
.lp-final-inner::before,
.lp-final-inner::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(2px);   /* as on the homepage: shapes, not hard-edged discs */
}
.lp-final-inner::before { left: -80px; top: -120px; background: var(--aqua); }
.lp-final-inner::after { right: -80px; bottom: -140px; background: var(--coral); }
.lp-final-inner h2 { margin-bottom: 14px; }
.lp-final-inner p { max-width: 52ch; margin: 0 auto 24px; color: rgba(255, 255, 255, .82); }

/* --- catalogue page ----------------------------------------------------- */

.lp-cat-head { padding: 30px 0 0; }
.lp-cat-head h1 {
    margin-bottom: 14px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(44px, 6vw, 84px);
    font-weight: 700;
    line-height: .92;
    letter-spacing: -.065em;
}
.lp-cat-head p { max-width: 62ch; color: var(--muted); font-size: 19px; }

.lp-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.lp-cat-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(16, 44, 43, .05);
    transition: transform .18s ease, box-shadow .18s ease;
}
.lp-cat-card:hover { transform: translateY(-3px); box-shadow: 0 22px 50px rgba(16, 44, 43, .13); }
.lp-cat-card.is-playable { border-color: rgba(255, 96, 70, .45); }

.lp-cat-art { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #d9d7ce; }
.lp-cat-art img { width: 100%; height: 100%; object-fit: cover; }
.lp-cat-flag {
    position: absolute;
    top: 13px;
    left: 13px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(9, 29, 27, .86);
    color: #fff;
    font-size: 11.5px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}
.lp-cat-card.is-playable .lp-cat-flag { background: var(--coral); }

.lp-cat-body { flex: 1; padding: 21px; display: flex; flex-direction: column; gap: 9px; }
.lp-cat-body strong { font: 700 24px "Space Grotesk", sans-serif; letter-spacing: -.045em; }
.lp-cat-tagline { color: #566662; font-size: 16px; line-height: 1.5; }
.lp-cat-foot {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    border-top: 1px solid var(--line);
}
.lp-cat-tag {
    padding: 7px 10px;
    border-radius: 999px;
    background: #e8efea;
    color: #22433e;
    font-size: 12.5px;
    line-height: 1;
    font-weight: 900;
}
.lp-cat-meta { color: #5c6b67; font-size: 13.5px; font-weight: 800; }

/* --- narrow ------------------------------------------------------------- */

@media (max-width: 980px) {
    .lp-hero { grid-template-columns: 1fr; }
    .lp-hero-art { order: -1; }
    .lp-more-grid, .lp-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* Stacked: the pitch, then the panel (the thing to do), then the scene.
       Sticky comes off so the panel scrolls with the page. */
    .lp-hero-start {
        grid-template-areas:
            "copy"
            "panel"
            "art";
    }
    .lp-start { position: static; }
}

@media (max-width: 680px) {
    .lp { width: min(calc(100% - 26px), var(--lp-max)); }
    .lp-hero { padding: 22px; border-radius: 22px; }
    .lp-hero-start { padding: 8px 0 0; }
    .lp-more-grid, .lp-cat-grid { grid-template-columns: 1fr; }
    .lp-lede { font-size: 18px; }
    .lp-prose p { font-size: 17.5px; }
    .lp-btn { width: 100%; }
    .lp-code input { width: 46px; height: 52px; }
    .lp-code button { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
