/* Every page of the website around the game (client/site/layout.html), in the look of the game's
   HUD and start screen (client/public/index.html): the night-purple backdrop, the UI kit's
   hexagons, purple panels in a thick blue frame with their title on a pink tag, heavy capitals.
   A page's own styles: css/<page>.css. */
:root {
    --night: #1d1538;
    --ink: #ffffff;
    --muted: rgb(255 255 255 / 0.8);
    --kit-ink: #2b1f4a;
    --purple: #6b509d;
    --blue: #3ba5d8;
    --teal: #32e1c3;
    --orange: #fa731e;
    --yellow: #f0cd14;
    --pink: #f596c3;
    --cell: rgb(255 255 255 / 0.1);
    --display: 'Arial Black', 'Arial Rounded MT Bold', 'Helvetica Neue', system-ui, sans-serif;
    --text: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    /* a flat-topped hexagon, as the kit's */
    --hexagon: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
    margin: 0; color: var(--ink); font: 17px/1.6 var(--text); min-height: 100vh;
    /* the start screen's glow, over a faint honeycomb */
    background:
        radial-gradient(ellipse at top, rgb(58 44 104 / 0.92), rgb(14 10 30 / 0.96) 70%) fixed,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='48.5'%3E%3Cpath d='M0 24.25L14 0H42L56 24.25L42 48.5H14ZM56 24.25H84' fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='1.5'/%3E%3C/svg%3E"),
        var(--night);
    background-blend-mode: normal, overlay, normal;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--teal); }
svg { display: block; }
h1, h2 { font-family: var(--display); font-weight: 900; line-height: 1.15; text-wrap: balance; text-transform: uppercase; }
h1 { font-size: clamp(1.9rem, 5.6vw, 3.2rem); margin: 0 0 0.4em; text-shadow: 0 3px 0 var(--kit-ink), 0 6px 14px rgb(0 0 0 / 0.5); }
strong { color: #fff; }

/* hexagon buttons, as the start screen's: an icon in a coloured hexagon, its label under it */
.hex-button { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; }
.hex-art { display: block; width: 84px; height: 84px; line-height: 0; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.45)); transition: transform 0.12s; }
.hex-art svg { width: 100%; height: 100%; }
.hex-button.big .hex-art { width: 116px; height: 116px; }
.hex-label { font-family: var(--display); font-weight: 900; font-size: 15px; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 0.6); }
.hex-button:hover .hex-art, .hex-button:focus-visible .hex-art, .play-button:hover .hex-art, .play-button:focus-visible .hex-art { transform: scale(1.07); }
.hex-button:active .hex-art, .play-button:active .hex-art { transform: scale(0.94); }
:is(.hex-button, .play-button, .brand, .site-nav a, summary):focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; border-radius: 8px; }

/* header: the logo, the pages, and the way into the game */
.site-header {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; gap: 18px;
    padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    background: rgb(29 21 56 / 0.86);
    backdrop-filter: blur(8px);
    border-bottom: 4px solid var(--blue);
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.35);
}
.brand { line-height: 0; }
.brand svg { width: 86px; height: auto; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.4)); }
.site-nav { display: flex; gap: 14px; margin-right: auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-family: var(--display); font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.site-nav a[aria-current="page"] { color: var(--teal); }
.play-button {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    font-family: var(--display); font-weight: 900; font-size: 15px; text-transform: uppercase; color: #fff;
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.6);
}
.play-button .hex-art { width: 46px; height: 46px; }

main { max-width: 1120px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }


/* a page's heading and lead (pages without a hero), text panels, and the way back into the game at the end */
.lead { font-size: 1.15rem; color: var(--muted); max-width: 38ch; margin: 0 0 18px; }
.page-intro { padding: 36px 0 0; }
.prose p { max-width: 70ch; margin: 0 auto; line-height: 1.6; }
.page-end { display: flex; justify-content: center; margin-top: 40px; }

/* pictures in the kit's blue frame */
.framed { margin: 0; }
.framed img { border-radius: 16px; border: 4px solid var(--blue); box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.18), 0 6px 16px rgb(0 0 0 / 0.4); background: var(--purple); }

/* a panel like the kit's: purple, a thick blue frame, its title on a pink tag on the top edge */
.kit-panel {
    position: relative; margin: 46px 0 0; padding: 38px clamp(14px, 3vw, 28px) 24px; border-radius: 22px;
    background: linear-gradient(180deg, #7a5fb0, #5a4189); border: 4px solid var(--blue);
    box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.18), 0 6px 16px rgb(0 0 0 / 0.4);
}
.kit-tag {
    position: absolute; top: 0; left: 50%; transform: translate(-50%, -55%); margin: 0;
    max-width: calc(100% - 32px); width: max-content; text-align: center;
    font-size: clamp(0.95rem, 2.6vw, 1.25rem); letter-spacing: 0.03em; color: var(--purple);
    padding: 6px 20px; border-radius: 12px; background: var(--pink); box-shadow: 0 2px 4px rgb(0 0 0 / 0.35);
}
.panel-note { color: var(--muted); max-width: 72ch; margin: 0 auto 6px; text-align: center; }
.panel-actions { display: flex; justify-content: center; margin-top: 18px; }


.site-footer {
    display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    margin-top: 40px; padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
    color: var(--muted); font-size: 0.9rem; border-top: 4px solid var(--blue); background: rgb(14 10 30 / 0.6);
}
.site-footer p { margin: 0; }
/* a tip through PayPal: a yellow pill, as the kit's selected switch */
.tip-button {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px; text-decoration: none;
    font-family: var(--display); font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--kit-ink); background: var(--yellow); border: 2px solid var(--kit-ink); box-shadow: 0 3px 0 var(--kit-ink), 0 6px 12px rgb(0 0 0 / 0.35);
    transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.2s, background-color 0.2s;
}
.tip-button.big { padding: 14px 34px; font-size: 20px; border-width: 3px; box-shadow: 0 5px 0 var(--kit-ink), 0 10px 18px rgb(0 0 0 / 0.4); }
/* hover: it pops up a little, brighter, its shadow deeper (as the hexagon buttons grow) */
.tip-button:hover, .tip-button:focus-visible { transform: translateY(-3px) scale(1.06); background: #ffe03a; box-shadow: 0 5px 0 var(--kit-ink), 0 10px 16px rgb(0 0 0 / 0.35); }
.tip-button.big:hover, .tip-button.big:focus-visible { box-shadow: 0 8px 0 var(--kit-ink), 0 16px 24px rgb(0 0 0 / 0.4); }
.tip-button:active { transform: translateY(1px) scale(0.97); box-shadow: 0 1px 0 var(--kit-ink), 0 3px 6px rgb(0 0 0 / 0.3); }
.tip-button:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
@media (max-width: 520px) { /* the pages on a row of their own under the logo and the Play button */
    .site-header { flex-wrap: wrap; row-gap: 4px; }
    .site-header .play-button { margin-left: auto; }
    .site-nav { order: 3; width: 100%; overflow-x: auto; margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) { .hex-art, .tip-button { transition: none; } }
