/* The website around the game (client/site/layout.js), 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. */
: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)); }

/* the hero: the logo, what it is, and the big orange hexagon */
.hero { display: grid; gap: 28px; align-items: center; padding: 36px 0 28px; }
@media (min-width: 900px) { .hero { grid-template-columns: 5fr 6fr; } }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; }
.hero-logo { width: min(250px, 60vw); margin-bottom: 14px; }
.hero-logo svg { width: 100%; height: auto; filter: drop-shadow(0 4px 8px rgb(0 0 0 / 0.35)); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 38ch; margin: 0 0 18px; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 10px 0 0; }

/* 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); }
.hero-picture img { transform: rotate(-1deg); }

/* 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; }

/* how to play: numbered hexagons */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.steps p { margin: 0; color: var(--muted); }
.steps strong { display: block; font-family: var(--display); text-transform: uppercase; font-size: 0.95rem; }
.step-hex { width: 74px; height: 74px; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.45)); }
.step-hex svg, .card-hex svg { width: 100%; height: 100%; }

/* the teams: portraits in hexagons, in a blue frame, as the HUD's honeycomb */
.honeycomb { display: grid; gap: 18px 14px; margin: 20px auto 4px; grid-template-columns: repeat(2, minmax(0, 170px)); justify-content: center; }
@media (min-width: 760px) { .honeycomb { grid-template-columns: repeat(4, minmax(0, 190px)); } .honeycomb figure:nth-child(even) { transform: translateY(36px); } .honeycomb { margin-bottom: 40px; } }
.honeycomb figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hex-photo { display: block; width: 100%; aspect-ratio: 1 / 0.866; padding: 6px; clip-path: var(--hexagon); background: var(--blue); filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.4)); }
.hex-photo img { width: 100%; height: 100%; object-fit: cover; clip-path: var(--hexagon); }
.honeycomb figcaption, .gallery figcaption { font-family: var(--display); font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--teal); text-shadow: 0 1px 1px rgb(0 0 0 / 0.4); }

/* cards: the weapons and the ways to play, as the start screen's cells */
.cards { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards li { background: var(--cell); border: 2px solid rgb(59 165 216 / 0.55); border-radius: 14px; padding: 10px 14px; color: var(--muted); }
.cards strong { display: block; font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 0.82rem; letter-spacing: 0.04em; color: var(--yellow); }
.modes li { display: flex; align-items: center; gap: 12px; }
.card-hex { flex: none; width: 76px; height: 76px; margin: -8px -4px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.4)); }

.gallery { display: grid; gap: 16px; margin: 6px 0 18px; }
.gallery.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .gallery.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 760px) { .gallery.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gallery figcaption { margin-top: 8px; }
.gallery.two figcaption { font-family: var(--text); font-weight: 400; font-size: 0.92rem; text-transform: none; letter-spacing: 0; color: var(--muted); text-shadow: none; }
.gallery.two figcaption strong { font-family: var(--display); text-transform: uppercase; color: var(--teal); margin-right: 6px; }

/* questions: cells that fold open, a yellow hexagon turning as they do */
.faq details { background: var(--cell); border: 2px solid rgb(59 165 216 / 0.55); border-radius: 14px; padding: 10px 16px; margin-bottom: 10px; }
.faq details[open] { border-color: var(--blue); background: rgb(255 255 255 / 0.14); }
.faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 900; font-size: 0.95rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: ''; flex: none; width: 18px; height: 16px; clip-path: var(--hexagon); background: var(--yellow); transition: transform 0.15s, background 0.15s; }
.faq details[open] summary::before { transform: rotate(90deg); background: var(--teal); }
.faq details p { margin: 8px 0 2px 28px; color: var(--muted); }

.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; }
@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; }
    .hero { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .hex-art, .faq summary::before { transition: none; } .hero-picture img { transform: none; } }

/* controls: the HUD's buttons per device, picked by the switch (phone and tablet first on a touch screen) */
.device-choice { position: absolute; opacity: 0; pointer-events: none; }
.device-switch { display: flex; justify-content: center; gap: 8px; margin: 14px 0 18px; }
.device-switch label {
    cursor: pointer; font-family: var(--display); font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em;
    padding: 7px 16px; border-radius: 999px; color: #fff; background: rgb(43 31 74 / 0.55); border: 2px solid var(--blue);
}
#device-touch:checked ~ .device-switch label[for="device-touch"], #device-keys:checked ~ .device-switch label[for="device-keys"] { background: var(--yellow); color: var(--kit-ink); border-color: var(--yellow); box-shadow: 0 2px 0 #b8960a; }
#device-touch:focus-visible ~ .device-switch label[for="device-touch"], #device-keys:focus-visible ~ .device-switch label[for="device-keys"] { outline: 3px solid var(--yellow); outline-offset: 3px; }
.device { display: none; }
#device-touch:checked ~ .device.touch, #device-keys:checked ~ .device.keys { display: block; }
.device-screen { max-width: 760px; margin: 0 auto 20px; }

.thumbs { display: grid; gap: 14px 20px; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .thumbs { grid-template-columns: minmax(0, 230px) minmax(0, 1fr); } .keys .thumbs { grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; } }
.thumb { margin: 0 auto; width: min(100%, 260px); }
.thumb img { border-radius: 16px; border: 4px solid var(--blue); box-shadow: 0 6px 16px rgb(0 0 0 / 0.4); }
.thumb figcaption { margin-top: 6px; text-align: center; font-family: var(--display); font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--teal); }

.controls-list { margin: 0; display: grid; gap: 8px; }
.controls-list dt { font-family: var(--display); font-weight: 900; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--yellow); }
.controls-list dd { margin: 0 0 4px; color: var(--muted); }
.gestures, .keymap { margin-top: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.gestures > div, .keymap > div { background: var(--cell); border: 2px solid rgb(59 165 216 / 0.55); border-radius: 14px; padding: 10px 14px; }
.keymap dt { color: var(--muted); }
kbd {
    display: inline-block; min-width: 1.9em; padding: 2px 7px; border-radius: 7px; text-align: center;
    font: 900 12px/1.5 var(--display); color: #fff; background: #2f2a3d; box-shadow: 0 2px 0 #14111c, inset 0 1px 0 rgb(255 255 255 / 0.15);
}

.controls h3 { margin: 30px 0 12px; text-align: center; font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 1rem; letter-spacing: 0.04em; color: var(--pink); }
.hud-parts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.hud-parts figure { margin: 0; display: flex; gap: 14px; align-items: center; background: var(--cell); border: 2px solid rgb(59 165 216 / 0.55); border-radius: 14px; padding: 10px; }
.hud-parts img { flex: none; width: 120px; border-radius: 10px; }
.hud-parts figure:last-child img { width: 170px; }
.hud-parts figcaption { color: var(--muted); font-size: 0.92rem; }
.hud-parts figcaption strong { display: block; font-family: var(--display); text-transform: uppercase; font-size: 0.82rem; letter-spacing: 0.04em; color: var(--yellow); }
@media (max-width: 520px) { .hud-parts figure { flex-direction: column; align-items: flex-start; } .hud-parts img { width: 150px; } .hud-parts figure:last-child img { width: 100%; max-width: 260px; } }
