/* Every page of the website around the game (client/site/layout.html). A game site's look (full-bleed
   pictures, cut corners, numbered sections, a glitching headline) in the colours of the game's HUD and
   start screen (client/public/index.html): the night-purple backdrop, the UI kit's hexagons, its
   yellow, teal and pink, heavy capitals. A page's own styles: css/<page>.css. */
:root {
    --night: #1d1538;
    --void: #0e0a1e;
    --ink: #ffffff;
    --muted: rgb(255 255 255 / 0.76);
    --faint: rgb(255 255 255 / 0.5);
    --kit-ink: #2b1f4a;
    --purple: #6b509d;
    --blue: #3ba5d8;
    --teal: #32e1c3;
    --orange: #fa731e;
    --yellow: #f0cd14;
    --pink: #f596c3;
    --cell: rgb(255 255 255 / 0.1);
    --line: rgb(240 205 20 / 0.35);
    --display: 'Arial Black', 'Arial Rounded MT Bold', 'Helvetica Neue', system-ui, sans-serif;
    --text: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    /* a flat-topped hexagon, as the kit's */
    --hexagon: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    /* cut corners (top left, bottom right): --cut deep; honeycomb cells (pointed left and right): --tip deep */
    --cut: 18px;
    /* a row of small yellow hexagons: the accents along the header and the footer */
    --hex-row: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3E%3Cpath d='M2.9 0H8.6L11.5 5L8.6 10H2.9L0 5Z' fill='%23f0cd14'/%3E%3C/svg%3E");
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--void); scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    margin: 0; color: var(--ink); font: 17px/1.6 var(--text); min-height: 100vh; overflow-x: clip;
    /* the start screen's glow, over a faint honeycomb */
    background:
        radial-gradient(ellipse at top, rgb(58 44 104 / 0.85), rgb(14 10 30 / 0.97) 65%) 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.06' stroke-width='1.5'/%3E%3C/svg%3E"),
        var(--void);
    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.08; text-wrap: balance; text-transform: uppercase; }
h1 { font-size: clamp(2.1rem, 6.4vw, 4rem); letter-spacing: -0.01em; margin: 0 0 0.35em; text-shadow: 0 3px 0 var(--kit-ink), 0 6px 18px rgb(0 0 0 / 0.55); }
strong { color: #fff; }
::selection { background: var(--yellow); color: var(--kit-ink); }

/* full width, out of main's column */
.bleed { margin-inline: calc(50% - 50vw); padding-inline: max(16px, calc(50vw - 560px)); }

/* a small capital line above a heading: a hexagon, then the words */
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font: 700 0.78rem/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--yellow); }
.eyebrow-hex { flex: none; width: 14px; height: 12px; clip-path: var(--hexagon); background: var(--yellow); }

/* the headline glitches now and then: two offset copies in teal and pink, sliced */
.glitch { position: relative; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0; text-shadow: none; }
.glitch::before { color: var(--teal); animation: glitch 6s steps(1) infinite; }
.glitch::after { color: var(--pink); animation: glitch 6s steps(1) 0.08s infinite reverse; }
@keyframes glitch {
    0%, 90%, 100% { opacity: 0; transform: none; clip-path: none; }
    91% { opacity: 0.9; transform: translate(-4px, 1px); clip-path: inset(10% 0 62% 0); }
    93% { opacity: 0.9; transform: translate(4px, -2px); clip-path: inset(58% 0 14% 0); }
    95% { opacity: 0.8; transform: translate(-2px, 0); clip-path: inset(32% 0 40% 0); }
    97% { opacity: 0; }
}

/* 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, .cell-button, .news-card, .news-ticker, .more, .footer-links a):focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; border-radius: 4px; }

/* honeycomb cells: buttons and labels as the game's message cells, a stretched hexagon (--fill) in a frame
   (--frame, --ring thick); the frame is the element, the fill its ::before */
:where(.cell-button, .more, .read-more, .news-tag, .tip-button, .device-switch label) {
    --tip: 0.62em; --ring: 3px; --frame: var(--blue); --fill: var(--purple);
    position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center;
    clip-path: polygon(var(--tip) 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, var(--tip) 100%, 0 50%); background: var(--frame); border: 0; border-radius: 0; box-shadow: none; text-decoration: none;
}
:where(.cell-button, .more, .read-more, .news-tag, .tip-button, .device-switch label)::before {
    content: ''; position: absolute; inset: var(--ring); z-index: -1; clip-path: polygon(var(--tip) 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, var(--tip) 100%, 0 50%); background: var(--fill); transition: background-color 0.15s;
}
/* a button: white on purple in a blue frame; hover: yellow */
.cell-button {
    gap: 10px; padding: 14px 34px; font-family: var(--display); font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em;
    color: #fff; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.45)); transition: color 0.15s, transform 0.12s;
}
.cell-button:hover, .cell-button:focus-visible { --fill: var(--yellow); --frame: var(--kit-ink); color: var(--kit-ink); transform: scale(1.05); }
.cell-button:active { transform: scale(0.96); }
/* header: the logo, the pages, and the way into the game */
.site-header {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 28px;
    padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    background: rgb(14 10 30 / 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header::after { /* a yellow bar under the logo's end, as a game site's header accent */
    content: ''; position: absolute; left: 6px; bottom: -6px; width: min(280px, 34vw); height: 10px; background: var(--hex-row) repeat-x;
    mask-image: linear-gradient(90deg, #000 55%, transparent);
}
.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: 6px; margin-right: auto; }
.site-nav a {
    position: relative; padding: 8px 12px; color: var(--muted); text-decoration: none;
    font-family: var(--display); font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; transition: color 0.15s;
}
.site-nav a::after { content: ''; position: absolute; left: 50%; bottom: -3px; width: 14px; height: 12px; margin-left: -7px; clip-path: var(--hexagon); background: var(--yellow); transform: scale(0); transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1); }
.site-nav a:hover { color: #fff; }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scale(1); }
.site-nav a[aria-current="page"] { color: var(--yellow); }
.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; letter-spacing: 0.04em; color: #fff;
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.6);
}
.play-button .hex-art { width: 46px; height: 46px; }
.play-label { display: flex; flex-direction: column; line-height: 1.1; }
/* under Play now: how many have been here (a nudge), small, a teal pulse in front */
.play-count {
    display: flex; align-items: center; gap: 6px; margin-top: 4px;
    font: 700 0.66rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-shadow: none; color: var(--teal);
}
.play-count::before { content: ''; flex: none; width: 8px; height: 7px; clip-path: var(--hexagon); background: var(--teal); animation: play-pulse 1.6s ease-in-out infinite; }
.play-count b { font-weight: 700; text-transform: none; } /* (1.15m, 12k: as written) */
@keyframes play-pulse { 50% { opacity: 0.3; transform: scale(0.7); } }

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 sections, and the way back into the game at the end */
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46ch; margin: 0 0 18px; }
.page-intro {
    position: relative; padding-top: clamp(48px, 9vw, 96px); padding-bottom: clamp(28px, 5vw, 48px); margin-bottom: 8px;
    background: linear-gradient(180deg, rgb(107 80 157 / 0.25), transparent);
    border-bottom: 1px solid var(--line);
}
.prose p { max-width: 70ch; margin: 0; line-height: 1.7; color: var(--muted); }
.page-end { display: flex; justify-content: center; margin-top: 56px; }

/* a section: a numbered heading with a line running on, its content under it */
.block { margin: clamp(56px, 8vw, 88px) 0 0; }
.block-head { display: flex; align-items: center; gap: 16px; margin: 0 0 24px; }
.block-index {
    flex: none; display: grid; place-items: center; width: 46px; height: 40px; clip-path: var(--hexagon);
    font: 700 0.85rem/1 var(--mono); color: var(--kit-ink); background: var(--yellow);
}
.block-head h2 { margin: 0; font-size: clamp(1.45rem, 3.6vw, 2.2rem); letter-spacing: 0.01em; }
.block-head::after { content: ''; flex: 1; min-width: 20px; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.block-head .more { order: 3; }
.more { --ring: 2px; flex: none; padding: 9px 22px; font: 700 0.75rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--yellow); transition: color 0.15s; }
.more::after { content: '\00a0\2192'; }
.more:hover, .more:focus-visible { --fill: var(--yellow); --frame: var(--kit-ink); color: var(--kit-ink); }

/* pictures with cut corners and a thin yellow line along the cut */
.framed { margin: 0; }
.framed img, .cut-picture { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); background: var(--purple); }

/* a panel like the kit's: purple, a thick blue frame, its title on a pink tag on the top edge (Play your way) */
.kit-panel {
    position: relative; margin: 72px 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; }
.block .panel-note { margin: 0 0 6px; text-align: left; }
.panel-actions { display: flex; justify-content: center; margin-top: 18px; }

/* footer: the brand, links in columns, a bar at the bottom */
.site-footer {
    margin-top: 88px; padding: 48px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    color: var(--muted); font-size: 0.92rem; background: rgb(8 6 18 / 0.85); border-top: 1px solid var(--line); position: relative;
}
.site-footer::before { content: ''; position: absolute; top: -6px; right: 6px; width: min(280px, 34vw); height: 10px; background: var(--hex-row) repeat-x right; mask-image: linear-gradient(270deg, #000 55%, transparent); }
.site-footer p { margin: 0; }
.footer-grid { max-width: 1120px; margin: 0 auto; display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1.4fr; } }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.footer-brand .brand svg { width: 120px; }
.footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-links h2 { margin: 0 0 4px; font: 700 0.78rem/1 var(--mono); letter-spacing: 0.22em; color: var(--yellow); }
.footer-links a:not(.tip-button) { color: var(--muted); text-decoration: none; }
.footer-links a:not(.tip-button):hover { color: var(--teal); }
.footer-bar {
    max-width: 1120px; margin: 36px auto 0; padding-top: 16px; border-top: 1px solid rgb(255 255 255 / 0.1);
    display: flex; justify-content: space-between; gap: 16px; font: 0.75rem/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.footer-bar a { color: var(--faint); }
/* a tip through PayPal: a yellow cell in the kit's dark ink, as the game's selected switch */
.tip-button {
    --fill: var(--yellow); --frame: var(--kit-ink); --ring: 2px;
    gap: 8px; padding: 9px 26px; font-family: var(--display); font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--kit-ink); filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.45));
    transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.tip-button.big { --ring: 3px; padding: 16px 44px; font-size: 20px; }
/* hover: it pops up a little, brighter (as the hexagon buttons grow) */
.tip-button:hover, .tip-button:focus-visible { --fill: #ffe03a; transform: translateY(-3px) scale(1.06); }
.tip-button:active { transform: translateY(1px) scale(0.97); }
.tip-button:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
@media (max-width: 560px) { /* the pages on a row of their own under the logo and the Play button */
    .site-header { flex-wrap: wrap; row-gap: 0; gap: 12px; }
    .site-header .play-button { margin-left: auto; }
    .site-nav { order: 3; width: 100%; overflow-x: auto; margin: 0 -12px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hex-art, .tip-button, .cell-button, .site-nav a::after { transition: none; }
    .glitch::before, .glitch::after, .play-count::before { animation: none; }
}

/* a news item's date and kind (news.json; the home page's cards and banner, the news page) */
.news-meta { display: flex; align-items: center; gap: 12px; margin: 0; font: 0.78rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.news-tag { --ring: 2px; --fill: var(--teal); --frame: var(--kit-ink); padding: 6px 14px 5px; font: 700 0.7rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--kit-ink); }
