
/* Google Material Symbols, self-hosted (only the icons the app uses) so they
   work offline. To add an icon, re-download the font with its name added to
   icon_names: https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,500,0,0&icon_names=... */
@font-face {
    font-family: 'Material Symbols Rounded';
    font-style: normal;
    font-weight: 500;
    font-display: block;
    src: url(../fonts/material-symbols-rounded.woff2) format('woff2');
}

/* Clue colours for the guess boxes, number keys, share grid and colour
   guide. Brown: right. Tan: close (same area, or a digit in the wrong
   place). Black: wrong. Match Theme::ClueColour in bibirble's Theme.h. */
:root {
    --clue-right: #7a4b26;
    --clue-right-text: #ffffff;
    --clue-close: #d2b48c;
    --clue-close-text: #2b1d0e;
    --clue-wrong: #1c1c1c;
    --clue-wrong-text: #ffffff;
}

/* Global Reset and Base Styles */
* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    /* The screen you can actually see, measured in index.html. Some Android
       browsers count the space under the system bars in 100dvh, which cut
       off the bottom of the keypad. */
    height: var(--app-height, 100dvh);
    width: 100%;
    margin: 0;
    background-color: #eae59f; /* Desktop background */
    overflow: hidden; /* Prevent body scroll, handle inside frame */
}

/* 
   Frame Mapping:
   Main container for the app.
*/
.frame {
    position: relative; /* for the version tag in the top right */
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Modern mobile support */
    height: var(--app-height, 100dvh);
    max-width: 600px; /* Constrain width on tablets/desktop */
    padding-top: env(safe-area-inset-top); /* phone notch */
    background-color: rgb(235, 230, 157);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* 
   Header Mapping:
*/
.header-text {
    font-size: clamp(1.5rem, calc(var(--vh, 1vh) * 4), 2rem);
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    color: #333;
    user-select: none;
    flex-shrink: 0;
}
/* Bible version short name (like WEB) in the top right corner. Its full
   name is in the tooltip and in Settings. */
.version-tag {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 12px);
    right: 12px;
    z-index: 1;
    padding: 4px 10px;
    border-radius: 999px;
    background: #7a5830;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    user-select: none;
}
.christmas .version-tag {
    background: #1d5a3a;
}
/* Small phones: a smaller tag, so long names (WEBCATH) miss the title */
@media (max-width: 360px) {
    .version-tag {
        right: 8px;
        padding: 3px 7px;
        font-size: 0.7rem;
        letter-spacing: 0;
    }
}

/* GitHub Pages copy only: it will be deprecated, play at bibirble.app */
.deprecated-banner {
    width: 92%;
    background: #fff4d6;
    border: 2px solid #c86432;
    border-radius: 16px;
    padding: 12px 14px;
    color: #333;
    text-align: center;
    line-height: 1.4;
}
.deprecated-banner a {
    color: #a3471c;
    font-weight: 700;
}
/*
   Reveal Panel Mapping:
*/
#reveal-panel {
    background-color: white;
    width: 90%;
    margin: 0 auto 10px auto;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    flex-shrink: 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.4;
    flex-direction: column;
}

/*
   Scrollable Game Area:
   Wraps rows and submit button to allow scrolling on small screens
   while keeping header/keyboard fixed.
*/
.game-scroll-area {
    flex-grow: 1;
    min-height: 0; /* shrink and scroll instead of pushing the keypad off screen */
    overflow-y: auto;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/*
   Row Container Logic
*/
.game-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
    padding: 0 5px;
}

.game-row.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/*
   Row Controls Mapping:
*/
/* Book dropdown: wide enough for tidy names like "1 Thessalonians" */
.choice {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 160px;
    height: 40px;
    margin-right: 4px;
    padding: 0 4px;
    font-size: 16px; /* Prevent iOS zoom */
    text-overflow: ellipsis;
}

.text-ctrl {
    width: 40px;
    height: 40px;
    text-align: center;
    margin-right: 4px;
    font-size: 18px;
    border: 1px solid #888;
    border-radius: 4px;
    background: white;
    padding: 0;
}

/* Remove right margin from last input */
.text-ctrl:last-child {
    margin-right: 0;
}

.static-text-sep {
    font-weight: bold;
    margin-right: 4px;
    user-select: none;
}


/*
   Keyboard Panel Mapping:
   Fixed at bottom
*/
.keyboard-panel {
    background-color: rgb(200, 100, 50);
    padding: 10px;
    width: 100%;
    height: calc(var(--vh, 1vh) * 25); /* Responsive height */
    min-height: 160px;
    max-height: 250px;
    flex-shrink: 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom)); /* Handle iPhone Home Bar */
}

/* 3x4 phone keypad: 1 2 3 / 4 5 6 / 7 8 9 / Del 0 Enter */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    height: 100%;
    gap: 6px;
}

.keypad .button {
    background-color: rgba(0, 0, 0, 0.15); /* stands out from the panel */
    font-size: 20px;
}


/*
   Key Button Mapping:
*/
.button {
    color: rgb(235, 230, 157);
    background-color: rgb(200, 100, 50);
    font-weight: bold;
    border: none;
    font-size: 16px;
    cursor: pointer;
    flex: 1;
    border-radius: 14px; /* soft, rounded keys */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.1s;
    box-shadow: 0 2px 0 rgba(0,0,0,0.1);
}

/* Clue colours: set by submit.js as data-clue on the book list and digit
   boxes, and used by the colour guide's sample squares. */
[data-clue="right"] {
    background-color: var(--clue-right);
    color: var(--clue-right-text);
    border-color: var(--clue-right);
}
[data-clue="close"] {
    background-color: var(--clue-close);
    color: var(--clue-close-text);
    border-color: var(--clue-close);
}
[data-clue="wrong"] {
    background-color: var(--clue-wrong);
    color: var(--clue-wrong-text);
    border-color: var(--clue-wrong);
}
/* Played rows stay at full colour; only rows still to come are faded.
   Browsers also dim a disabled book list, which turned black into grey. */
.game-row.disabled:has([data-clue]),
.choice[data-clue]:disabled {
    opacity: 1;
}

/* Number keys show each digit's best clue so far (game.js updateKeypadColours) */
.keypad .button.key-right,
.christmas .keypad .button.key-right {
    background-color: var(--clue-right);
    color: var(--clue-right-text);
}
.keypad .button.key-close,
.christmas .keypad .button.key-close {
    background-color: var(--clue-close);
    color: var(--clue-close-text);
}
.keypad .button.key-wrong,
.christmas .keypad .button.key-wrong {
    background-color: var(--clue-wrong);
    color: var(--clue-wrong-text);
}

/* Enter (submit) key: lighter so it stands out from the digit keys */
.keypad #submit.button {
    background-color: rgb(235, 230, 157);
    color: rgb(200, 100, 50);
    font-size: 18px;
}

.button:active {
    filter: brightness(0.9);
    transform: translateY(1px);
}
#view {
    background-color: white;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Start screen and mode buttons */
.start-screen,
.settings-screen {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px 20px;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.start-headline,
.settings-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0 10px;
}
.start-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}
.menu-info-card,
.settings-card {
    width: 92%;
    background: white;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    color: #333;
    min-height: 220px;
}
.menu-info-card h2 {
    margin: 0 0 8px;
    font-size: 1rem;
}
.menu-info-card p {
    margin: 6px 0;
    line-height: 1.4;
}
.setting-row .switch {
    flex-shrink: 0;
}
#r18-verify {
    flex-wrap: wrap;
}
#r18-verify .seed-input {
    flex: 1;
    min-width: 140px;
}
.setting-help {
    font-size: 0.8rem;
    opacity: 0.7;
}
.setting-disabled {
    opacity: 0.45;
}
.whats-new-card {
    margin-bottom: 12px;
    min-height: 0;
}
.whats-new-card summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    list-style-position: inside;
}
.whats-new-hint {
    font-weight: normal;
    font-size: 0.8rem;
    opacity: 0.6;
    margin-left: 6px;
}
.whats-new-card[open] .whats-new-hint {
    display: none;
}
.whats-new-list {
    margin: 6px 0;
    padding-left: 20px;
    line-height: 1.4;
}
.whats-new-list li {
    margin: 4px 0;
}
.info-row {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    gap: 10px;
}
.info-label {
    font-weight: 700;
}
.settings-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.small-button,
.secondary-button {
    background: #7a5830;
    color: white;
    border: none;
    border-radius: 999px; /* pill shape */
    padding: 10px 16px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
.settings-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.settings-row-action {
    justify-content: center;
}
.settings-note {
    font-size: 0.9rem;
    color: #555;
    margin-top: 8px;
}
.seed-input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ccc;
    width: 100%;
    max-width: 250px;
}
.mode-button {
    background: rgb(200, 100, 50);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 999px; /* pill shape */
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.mode-button:active,
.secondary-button:active,
.small-button:active { transform: translateY(1px); filter: brightness(0.95); }
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 34px;
    transition: 0.2s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}
.switch input:checked + .slider {
    background-color: #2b6cb0;
}
.switch input:checked + .slider:before {
    transform: translateX(22px);
}
/* Game toolbar: book areas reference and the colour guide button */
.game-toolbar {
    width: 92%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.areas-ref {
    flex: 1;
    min-width: 0;
    background: white;
    border-radius: 8px;
    padding: 8px 12px;
    color: #333;
}
.areas-ref summary {
    cursor: pointer;
    font-weight: bold;
}
.areas-help {
    margin: 6px 0;
    font-size: 0.85rem;
    opacity: 0.7;
}
.areas-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Pop-up guides: the colour guide (first game) and hard mode guide (first
   hard mode game) */
.intro-dialog {
    width: min(92vw, 420px);
    border: none;
    border-radius: 16px;
    padding: 18px;
    background: white;
    color: #333;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.intro-dialog::backdrop {
    background: rgba(0,0,0,0.4);
}
.intro-dialog h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    text-align: center;
}
.intro-dialog ul {
    margin: 0 0 14px;
    padding-left: 20px;
    line-height: 1.4;
}
.intro-dialog li {
    margin: 6px 0;
}
.intro-dialog p {
    margin: 8px 0;
    line-height: 1.4;
}
.intro-dialog .mode-button {
    display: block;
    margin: 0 auto;
}

/* Colour key: a sample square beside each colour's meaning */
.intro-dialog ul.colour-key,
.colour-key {
    list-style: none;
    margin: 8px 0;
    padding: 0;
    line-height: 1.4;
}
.colour-key li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
}
.clue-swatch {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #888;
}

/* Colour guide's example guess, drawn like a game row */
.colour-example {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 8px 0;
}
.colour-example span[data-clue] {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.colour-example .example-book {
    width: auto;
    min-width: 80px;
    padding: 0 10px;
    font-size: 16px;
}
.colour-example .static-text-sep {
    margin: 0;
}

/* Icons inside buttons and headings */
.icon {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 1.25em;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    vertical-align: middle;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    user-select: none;
}
button .icon,
summary .icon,
h2 .icon {
    margin-top: -0.15em;
}
.keypad .button .icon {
    font-size: 26px;
    margin-top: 0;
}

/* Game top bar: Main Menu button above the title */
.game-top-bar {
    width: 92%;
    margin: 10px auto 0;
    display: flex;
    flex-shrink: 0;
}
.game-top-bar + .header-text {
    margin-top: 4px;
}

/* Settings help cards: How to Play, Hard Mode, What's New */
.help-card {
    min-height: 0;
}
.help-card summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}
.help-card p {
    margin: 8px 0;
    line-height: 1.4;
}
.help-list {
    margin: 6px 0;
    padding-left: 20px;
    line-height: 1.4;
}
.help-list li {
    margin: 4px 0;
}
.next-daily {
    text-align: center;
}
/* What Bibirble is, in one line, for new players (and search engines) */
.menu-intro {
    margin: 0;
    max-width: 440px;
    padding: 0 10px;
    text-align: center;
    line-height: 1.4;
    color: #4a3a22;
}
.menu-hint {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.7;
    text-align: center;
}

/* Game over: digit keys go away, Enter becomes one big Share key */
.keyboard-panel.game-over {
    height: auto;
    min-height: 0;
}
.keyboard-panel.game-over .keypad {
    display: flex;
}
.keyboard-panel.game-over .keypad .button:not(#submit) {
    display: none;
}
.keyboard-panel.game-over #submit {
    padding: 14px;
    gap: 6px;
}

/* Small message, e.g. when the back button can't leave a Daily game */
.toast {
    position: fixed;
    left: 50%;
    bottom: 30vh;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    width: max-content;
    max-width: 90vw;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}
.toast.show {
    opacity: 1;
}

/* Utility hidden class */
.hidden { display: none !important; }

/* Small Screen Adjustments */
@media (max-width: 360px) {
    .text-ctrl {
        width: 34px;
        font-size: 16px;
    }
    .header-text {
        font-size: 1.5rem;
    }
}
/* Keep cards full size; the screen scrolls instead */
.start-screen > *,
.settings-screen > * {
    flex-shrink: 0;
}

/* No empty verse box on the menu and settings screens */
#reveal-panel:empty {
    display: none;
}

/* Navigation buttons (Back, Main Menu, Play Random, View / Set Seed): just
   an icon, no shape or label. aria-label and title name them. */
.icon-button {
    background: none;
    border: none;
    box-shadow: none;
    padding: 6px;
    color: #7a5830;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.icon-button .icon {
    font-size: 32px;
    margin-top: 0;
}
.icon-button:active {
    transform: translateY(1px);
    opacity: 0.7;
}

/* ── Phone fit ──────────────────────────────────────────────────────────
   Guess boxes grow and shrink with the screen height so all 7 rows fit
   on small phones, and a long verse scrolls instead of pushing the rows
   off screen. */
.choice,
.text-ctrl {
    height: clamp(32px, calc(var(--vh, 1dvh) * 4.8), 44px);
}
.game-row {
    margin-bottom: clamp(4px, calc(var(--vh, 1dvh) * 1), 8px);
}
#reveal-panel {
    max-height: calc(var(--vh, 1dvh) * 28);
    overflow-y: auto;
    justify-content: flex-start;
}
/* Touch: no grey flash or double-tap zoom on buttons and keys */
button,
summary,
select {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Short phones (iPhone SE and similar): slimmer header and keypad */
@media (max-height: 700px) {
    .header-text {
        font-size: 1.4rem;
        margin: 4px 0 2px;
    }
    .game-top-bar {
        margin-top: 4px;
    }
    .game-top-bar .icon-button {
        padding: 2px 6px;
    }
    .game-top-bar .icon-button .icon {
        font-size: 28px;
    }
    #reveal-panel {
        padding: 8px 10px;
        margin-bottom: 6px;
        max-height: calc(var(--vh, 1dvh) * 20);
        line-height: 1.3;
    }
    .game-toolbar {
        margin-bottom: 6px;
    }
    .areas-ref {
        padding: 6px 12px;
    }
    .keyboard-panel {
        min-height: 140px;
        height: calc(var(--vh, 1dvh) * 24);
        padding: 8px;
    }
    .keypad {
        gap: 5px;
    }
}

/* Wide, short screens (sideways phones, short laptop windows): the keypad
   moves to the right of the game so it no longer squashes or covers the
   guess rows. Only while playing, so the menu stays centered. */
@media (min-aspect-ratio: 3/2) and (max-height: 700px) {
    .frame {
        position: relative;
        padding-left: env(safe-area-inset-left);
    }
    .frame:has(.keyboard-panel:not(.hidden)) {
        max-width: 920px;
        padding-right: min(40%, 320px);
    }
    /* The version tag moves left of the keypad */
    .frame:has(.keyboard-panel:not(.hidden)) .version-tag {
        right: calc(min(40%, 320px) + 12px);
    }
    .keyboard-panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(40%, 320px);
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 10px;
        padding-right: max(10px, env(safe-area-inset-right));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    /* Keys stay a comfy size on big windows, centered top to bottom */
    .keyboard-panel:not(.hidden) {
        display: flex;
        align-items: center;
    }
    .keyboard-panel .keypad {
        width: 100%;
        height: min(100%, 360px);
    }
    .keyboard-panel.game-over .keypad {
        height: auto;
    }
    .keyboard-panel.game-over #submit {
        min-height: 64px;
    }
    .header-text {
        font-size: 1.3rem;
        margin: 2px 0;
    }
    #reveal-panel {
        max-height: calc(var(--vh, 1dvh) * 34);
    }
    .choice,
    .text-ctrl {
        height: 34px;
    }
}

/* ── Christmas ──────────────────────────────────────────────────────────
   All through December (index.html adds .christmas to <html>): snowy
   ivory, Christmas red keys and buttons, evergreen accents, and snow
   falling behind the menus. The clue colors on the guess boxes never
   change. */
.christmas body {
    background-color: #1d5a3a; /* evergreen around the app on big screens */
}
.christmas .frame {
    position: relative;
    isolation: isolate; /* keeps the snow behind everything in the frame */
    background-color: #f7f2e4;
}
.christmas .header-text {
    color: #b3262c;
}
.christmas .header-text::before,
.christmas .header-text::after {
    content: "🎄";
    font-size: 0.75em;
    margin: 0 0.3em;
    vertical-align: 0.1em;
}
.christmas .keyboard-panel {
    background-color: #b3262c;
}
.christmas .button {
    color: #f7f2e4;
}
.christmas .keypad .button {
    background-color: rgba(0, 0, 0, 0.18);
}
.christmas .keypad #submit.button {
    background-color: #f7f2e4;
    color: #b3262c;
}
.christmas .mode-button {
    background: #b3262c;
}
.christmas .small-button,
.christmas .secondary-button {
    background: #1d5a3a;
}
.christmas .icon-button {
    color: #1d5a3a;
}
.christmas .switch input:checked + .slider {
    background-color: #1d5a3a;
}

/* Menu banner with a candy cane stripe along the top */
.christmas-banner {
    width: 92%;
    background-color: white;
    background-image: repeating-linear-gradient(-45deg, #b3262c 0 8px, white 8px 16px);
    background-size: 100% 6px;
    background-repeat: no-repeat;
    border-radius: 16px;
    padding: 16px 14px 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    color: #333;
    text-align: center;
    line-height: 1.4;
}

/* Snow: drifts down behind the menus, never over the game */
.snow {
    display: none;
}
.christmas .snow {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.christmas .frame:has(.keyboard-panel:not(.hidden)) .snow {
    display: none;
}
.snow span {
    position: absolute;
    top: -40px;
    color: #9fbedb;
    opacity: 0.8;
    animation: snowfall linear infinite;
}
.snow span:nth-child(1)  { left: 4%;  font-size: 14px; animation-duration: 11s; animation-delay: -2s;  --drift: 20px; }
.snow span:nth-child(2)  { left: 13%; font-size: 20px; animation-duration: 15s; animation-delay: -9s;  --drift: -25px; }
.snow span:nth-child(3)  { left: 22%; font-size: 11px; animation-duration: 9s;  animation-delay: -5s;  --drift: 15px; }
.snow span:nth-child(4)  { left: 31%; font-size: 17px; animation-duration: 13s; animation-delay: -1s;  --drift: -15px; }
.snow span:nth-child(5)  { left: 40%; font-size: 12px; animation-duration: 10s; animation-delay: -7s;  --drift: 25px; }
.snow span:nth-child(6)  { left: 49%; font-size: 22px; animation-duration: 16s; animation-delay: -12s; --drift: -20px; }
.snow span:nth-child(7)  { left: 58%; font-size: 13px; animation-duration: 12s; animation-delay: -4s;  --drift: 18px; }
.snow span:nth-child(8)  { left: 67%; font-size: 18px; animation-duration: 14s; animation-delay: -10s; --drift: -22px; }
.snow span:nth-child(9)  { left: 76%; font-size: 10px; animation-duration: 9s;  animation-delay: -3s;  --drift: 12px; }
.snow span:nth-child(10) { left: 84%; font-size: 16px; animation-duration: 12s; animation-delay: -8s;  --drift: -18px; }
.snow span:nth-child(11) { left: 91%; font-size: 12px; animation-duration: 10s; animation-delay: -6s;  --drift: 22px; }
.snow span:nth-child(12) { left: 96%; font-size: 19px; animation-duration: 15s; animation-delay: -13s; --drift: -28px; }
@keyframes snowfall {
    from { transform: translate3d(0, 0, 0) rotate(0deg); }
    to { transform: translate3d(var(--drift, 20px), calc(100vh + 80px), 0) rotate(180deg); }
}
/* Players who turn off motion get no falling snow */
@media (prefers-reduced-motion: reduce) {
    .christmas .snow {
        display: none;
    }
}

/* Colour guide button: on the right of the game toolbar, as tall as the
   book areas bar */
.game-toolbar .colour-help {
    margin-left: auto;
    padding: 3px;
}
.game-toolbar .colour-help .icon {
    font-size: 30px;
}
