/* The Christmas Card Creator: the festive introduction, the menu of choices and the theatre the show plays in.
   Markup: Components/Pages/Workshops/Christmas.razor (introduction) and wwwroot/js/xmas (menu and theatre). */

.xm-page {
    --xm-red: #c8102e;
    --xm-red-dark: #8f0d22;
    --xm-green: #0f5c3a;
    --xm-green-dark: #072e1d;
    --xm-gold: #ffd76a;
    --xm-cream: #fffaf0;
    --xm-ink: #24303c;
    --xm-festive: "Mountains of Christmas", "Segoe Script", "Comic Sans MS", cursive;
    margin: -1rem -1.25rem;                 /* bleed to the edges of the site's main column */
    padding: 0 0 2.5rem;
    min-height: calc(100dvh - 3.25rem);
    color: var(--xm-ink);
    background:
        radial-gradient(circle at 12% 0, rgba(200, 16, 46, .10), transparent 40%),
        radial-gradient(circle at 90% 30%, rgba(15, 92, 58, .12), transparent 45%),
        var(--xm-cream);
}

.xm-page h1,
.xm-page h2,
.xm-page h3 {
    margin: 0 0 .5rem;
}

.xm-theatre { display: none; }
.xm-page.is-show .xm-theatre { display: grid; }
.xm-page.is-show .xm-intro,
.xm-page.is-show .xm-menu { display: none; }

/* ---------- the hero: snowy night, a string of lights, the title ---------- */
.xm-hero {
    position: relative;
    overflow: hidden;
    padding: 3.4rem clamp(1.25rem, 5vw, 4rem) 2.6rem;
    color: #fff;
    background:
        radial-gradient(ellipse at 78% 110%, rgba(255, 215, 106, .28), transparent 55%),
        radial-gradient(ellipse at 15% -10%, #175f8f, transparent 60%),
        linear-gradient(180deg, #0b1b4a 0%, #0f3a5c 55%, #0f5c3a 100%);
    border-bottom: 10px solid transparent;
    border-image: repeating-linear-gradient(-45deg, #fff 0 12px, #d62839 12px 24px) 10;
}

.xm-hero::before {                          /* falling snow: two layers of dots that slide down for ever */
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, #fff 0 1.6px, transparent 2.2px),
        radial-gradient(circle, rgba(255, 255, 255, .75) 0 1px, transparent 1.6px);
    background-size: 90px 90px, 50px 50px;
    animation: xm-snowfall 16s linear infinite;
}

@keyframes xm-snowfall {
    to { background-position: 90px 360px, -50px 300px; }
}

.xm-lights {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    justify-content: space-around;
    padding: 0 1rem;
    border-top: 3px solid #0a2a18;
    pointer-events: none;
}

.xm-lights span {
    width: 11px;
    height: 16px;
    margin-top: 3px;
    border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
    background: currentColor;
    box-shadow: 0 0 12px 3px currentColor;
    animation: xm-twinkle 1.8s ease-in-out infinite alternate;
}

.xm-lights span:nth-child(5n + 1) { color: #ff4d4d; }
.xm-lights span:nth-child(5n + 2) { color: #ffd23f; animation-delay: -.4s; }
.xm-lights span:nth-child(5n + 3) { color: #5ee27a; animation-delay: -.9s; }
.xm-lights span:nth-child(5n + 4) { color: #58b6ff; animation-delay: -1.3s; }
.xm-lights span:nth-child(5n + 5) { color: #ff7ad9; animation-delay: -.6s; }
.xm-lights span:nth-child(even) { margin-top: 9px; }

@keyframes xm-twinkle {
    from { opacity: .45; }
    to { opacity: 1; }
}

.xm-hero-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(1rem, 4vw, 3rem);
    max-width: 72rem;
    margin: 0 auto;
}

.xm-hero-text { flex: 1 1 24rem; min-width: 0; }

.xm-kicker {
    margin: 0 0 .3rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--xm-gold);
}

.xm-hero h1 {
    font-family: var(--xm-festive);
    font-size: clamp(2.6rem, 7vw, 5.2rem);
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-shadow: 0 3px 0 var(--xm-red), 0 6px 18px rgba(0, 0, 0, .45);
}

.xm-hero h1 span { color: var(--xm-gold); }

.xm-lead {
    max-width: 40rem;
    margin: 1rem 0 1.4rem;
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    font-weight: 600;
}

.xm-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .8rem 1.2rem;
    font-weight: 600;
}

.xm-cta,
.xm-start {
    display: inline-block;
    padding: .75rem 1.8rem;
    border: 3px solid #fff;
    border-radius: 999px;
    background: linear-gradient(180deg, #e5283f, var(--xm-red));
    color: #fff;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--xm-red-dark), 0 10px 22px rgba(0, 0, 0, .3);
    transition: transform .12s, box-shadow .12s;
}

.xm-cta:hover,
.xm-cta:focus-visible,
.xm-start:hover,
.xm-start:focus-visible {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--xm-red-dark), 0 6px 14px rgba(0, 0, 0, .3);
}

.xm-hero-art {
    flex: 0 1 17rem;
    min-width: 9rem;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .4));
}

.xm-hero-art svg { display: block; width: 100%; height: auto; }
.xm-hero-art .xm-art-bulb { animation: xm-twinkle 1.4s ease-in-out infinite alternate; }
.xm-hero-art .xm-art-bulb:nth-of-type(2n) { animation-delay: -.7s; }
.xm-hero-art .xm-art-bulb:nth-of-type(3n) { animation-delay: -1.1s; }

/* ---------- the rest of the introduction ---------- */
.xm-body {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.6rem clamp(1rem, 4vw, 2rem) 0;
}

.xm-section { margin-bottom: 2rem; }

.xm-section > h2,
.xm-menu-head h2 {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--xm-festive);
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 700;
    color: var(--xm-green);
}

.xm-section > h2::after,
.xm-menu-head h2::after {                   /* a candy-cane rule running off to the right */
    content: "";
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: repeating-linear-gradient(-45deg, #fff 0 8px, #d62839 8px 16px);
    box-shadow: inset 0 0 0 1px rgba(200, 16, 46, .25);
}

.xm-section > p { max-width: 52rem; font-size: 1.05rem; }

.xm-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
    gap: 1rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.xm-steps li {
    position: relative;
    padding: 2.4rem 1.1rem 1rem;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 3px 14px rgba(20, 40, 30, .12);
    counter-increment: step;
}

.xm-steps li::before {                      /* the step number, as a bauble hanging on its hook */
    content: counter(step);
    position: absolute;
    left: 1rem;
    top: -.9rem;
    display: grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ff8a98, var(--xm-red) 62%);
    color: #fff;
    font-family: var(--xm-festive);
    font-size: 1.6rem;
    font-weight: 700;
    box-shadow: 0 3px 6px rgba(0, 0, 0, .25), 0 -7px 0 -5px #c99a1a;
}

.xm-steps li:nth-child(2)::before { background: radial-gradient(circle at 32% 28%, #7fe0a0, #17803f 62%); }
.xm-steps li:nth-child(3)::before { background: radial-gradient(circle at 32% 28%, #ffe9a0, #d99a12 62%); }
.xm-steps li:nth-child(4)::before { background: radial-gradient(circle at 32% 28%, #9fd0ff, #2a63c4 62%); }

.xm-steps h3 { font-size: 1.15rem; font-weight: 800; color: var(--xm-red-dark); }
.xm-steps p { margin: 0; color: #4a5560; }

.xm-crew-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: .8rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.xm-crew-cards li {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .7rem .8rem;
    border-radius: 14px;
    background: #fff;
    border-left: 6px solid var(--xm-green);
    box-shadow: 0 2px 10px rgba(20, 40, 30, .1);
}

.xm-crew-cards li:nth-child(odd) { border-left-color: var(--xm-red); }
.xm-crew-cards li.xm-santa { border-left-color: #d99a12; background: linear-gradient(120deg, #fff, #fff3c9); }

.xm-avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 50%;
    font-size: 1.6rem;
    background: #eaf5ee;
    box-shadow: inset 0 0 0 2px rgba(15, 92, 58, .18);
}

.xm-crew-cards b { display: block; font-size: 1.05rem; }
.xm-crew-cards em { display: block; font-style: normal; font-weight: 700; font-size: .85rem; color: var(--xm-red-dark); }
.xm-crew-cards small { display: block; margin-top: .15rem; color: #56616d; line-height: 1.3; }

.xm-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: .5rem 1.5rem;
    margin: .8rem 0 0;
    padding: 0;
    list-style: none;
}

.xm-choices li {
    padding-left: 1.8rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1l2.4 6h6.2l-5 3.9 1.9 6.3L10 13.4 4.5 17.2l1.9-6.3-5-3.9h6.2z' fill='%23e0a514'/%3E%3C/svg%3E") 0 .15em / 1.2rem no-repeat;
}

.xm-notes {
    padding: 1rem 1.2rem;
    border-radius: 16px;
    background: #f1f7f3;
    border: 2px dashed rgba(15, 92, 58, .35);
}

.xm-notes ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.xm-notes li { margin-bottom: .3rem; }

/* ---------- the menu of choices ---------- */
.xm-menu {
    max-width: 72rem;
    margin: 0 auto;
    padding: .5rem clamp(1rem, 4vw, 2rem) 0;
    scroll-margin-top: 1rem;
}

.xm-menu-wait { font-weight: 700; color: var(--xm-green); }

/* the design came from a card's own page ("Make one like this") */
.xm-from {
    margin: .7rem 0 0;
    padding: .55rem .85rem;
    border-left: 5px solid var(--xm-gold);
    border-radius: 10px;
    background: #fff8e1;
    font-weight: 600;
}

.xm-from.failed { border-left-color: var(--xm-red); background: #fff1f1; }
.xm-menu-head p { max-width: 52rem; }

.xm-menu-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
    gap: 1.25rem;
    align-items: start;
}

.xm-menu-side { position: sticky; top: 1rem; }

.xm-card {
    margin: 0 0 1rem;
    padding: .9rem 1.1rem 1rem;
    border: 0;
    border-top: 5px solid var(--xm-red);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 3px 14px rgba(20, 40, 30, .12);
    min-width: 0;
}

.xm-card:nth-of-type(even) { border-top-color: var(--xm-green); }

.xm-card legend {
    float: left;                            /* inside the box, not notched into its border */
    width: 100%;
    margin: 0 0 .7rem;
    padding: 0;
    font-family: var(--xm-festive);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--xm-green);
}

.xm-card legend + * { clear: both; }
.xm-card-icon { margin-right: .45rem; }

.xm-field { margin-bottom: .85rem; }
.xm-field:last-child { margin-bottom: 0; }
.xm-field[hidden] { display: none; }

.xm-label {
    display: block;
    margin-bottom: .3rem;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #56616d;
}

.xm-hint { display: block; margin-top: .2rem; font-size: .85rem; font-weight: 400; color: #6a7480; }

.xm-menu input[type="text"],
.xm-menu select {
    width: 100%;
    padding: .5rem .75rem;
    border: 2px solid #c9d6cf;
    border-radius: 10px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-weight: 600;
}

.xm-menu input[type="text"]:focus,
.xm-menu select:focus { border-color: var(--xm-green); outline: none; box-shadow: 0 0 0 3px rgba(15, 92, 58, .2); }

.xm-range { display: flex; align-items: center; gap: .8rem; }
.xm-range input { flex: 1; min-width: 0; accent-color: var(--xm-red); }
.xm-range output { flex: none; min-width: 6.2em; font-weight: 800; color: var(--xm-red-dark); }

.xm-menu input[type="color"] { width: 4rem; height: 2.3rem; padding: 2px; border: 2px solid #c9d6cf; border-radius: 10px; background: #fff; cursor: pointer; }
.xm-field-colour { display: inline-block; margin-right: 1.2rem; }

.xm-pills,
.xm-swatches,
.xm-cards { display: flex; flex-wrap: wrap; gap: .45rem; }

.xm-pills button,
.xm-swatches button {
    padding: .32rem .85rem;
    border: 2px solid #c9d6cf;
    border-radius: 999px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-weight: 700;
    font-size: .92rem;
    cursor: pointer;
}

.xm-swatches button { display: inline-flex; align-items: center; gap: .45rem; padding-left: .35rem; }
.xm-chip { width: 1.5rem; height: 1.5rem; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18); }

.xm-pills button:hover,
.xm-swatches button:hover,
.xm-cards button:hover { border-color: var(--xm-green); }

.xm-pills button.on,
.xm-swatches button.on {
    border-color: var(--xm-green);
    background: var(--xm-green);
    color: #fff;
}

.xm-cards button {
    flex: 1 1 9rem;
    display: grid;
    justify-items: center;
    gap: .2rem;
    padding: .8rem .6rem;
    border: 3px solid #c9d6cf;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.xm-cards button.on { border-color: var(--xm-red); background: #fff3f1; box-shadow: 0 0 0 3px rgba(200, 16, 46, .15); }
.xm-cards small { color: #6a7480; line-height: 1.25; }

.xm-shape {
    display: block;
    height: 2.6rem;
    margin-bottom: .2rem;
    border: 3px solid var(--xm-green);
    border-radius: 5px;
    background: linear-gradient(180deg, #cfe9ff 0 62%, #fff 62%);
    aspect-ratio: 16 / 9;
}

.xm-shape-portrait { aspect-ratio: 9 / 16; }
.xm-shape-square { aspect-ratio: 1; }

.xm-check,
.xm-tick {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-weight: 600;
    cursor: pointer;
}

.xm-check input,
.xm-tick input { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .18rem; accent-color: var(--xm-green); }

.xm-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .35rem .8rem; }

.xm-advanced {
    margin-bottom: 1rem;
    border-radius: 16px;
    background: rgba(15, 92, 58, .08);
    border: 2px dashed rgba(15, 92, 58, .4);
}

.xm-advanced summary {
    padding: .8rem 1.1rem;
    font-family: var(--xm-festive);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--xm-green);
    cursor: pointer;
}

.xm-advanced summary small { display: block; font-family: "Segoe UI", system-ui, sans-serif; font-size: .85rem; font-weight: 600; color: #56616d; }
.xm-advanced-body { padding: 0 .8rem .1rem; }

.xm-preview-card {
    padding: .9rem 1rem 1.1rem;
    border-radius: 16px;
    background: #fff;
    border: 3px solid var(--xm-gold);
    box-shadow: 0 4px 18px rgba(20, 40, 30, .16);
}

.xm-preview-card h3 { font-family: var(--xm-festive); font-size: 1.4rem; color: var(--xm-red-dark); }
.xm-sketch svg { display: block; width: auto; max-width: 100%; max-height: 17rem; margin: 0 auto; border-radius: 8px; box-shadow: 0 0 0 2px #24303c; }
.xm-sketch[data-format="landscape"] svg { width: 100%; }
.xm-summary { margin: .5rem 0 .8rem; text-align: center; font-weight: 700; color: #56616d; }
.xm-go { display: grid; gap: .7rem; }
.xm-go .xm-start { width: 100%; }

.xm-reset {
    justify-self: center;
    padding: .2rem .6rem;
    border: 0;
    background: none;
    color: #56616d;
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- the theatre: the picture, its control bar, the plan and the crew ---------- */
.xm-theatre {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    max-width: 100rem;
    margin: 0 auto;
    padding: 1rem clamp(.75rem, 3vw, 1.5rem) 0;
    scroll-margin-top: .5rem;
}

.xm-theatre[data-format="portrait"] .xm-stage { --ar: .5625; }
.xm-theatre[data-format="square"] .xm-stage { --ar: 1; }

.xm-stage {
    position: relative;
    /* as big as fits with the control bar still in view under it */
    width: min(100%, calc((100dvh - 14rem) * var(--ar, 1.7778)));
    min-width: min(100%, 15rem);
    aspect-ratio: var(--ar, 1.7778);
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    background: #0b1b4a;
    box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--xm-red), 0 10px 30px rgba(20, 30, 60, .35);
}

.xm-canvas,
.xm-canvas canvas { display: block; width: 100%; height: 100%; }

.xm-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    text-align: center;
    color: #fff;
    font-family: var(--xm-festive);
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 700;
}

.xm-loading[hidden] { display: none; }

.xm-rec-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(20, 20, 30, .7);
    color: #fff;
    font-size: .85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.xm-rec-badge[hidden] { display: none; }

.xm-rec-dot { width: .7em; height: .7em; border-radius: 50%; background: #ff3b4f; }
.xm-rec-badge .xm-rec-dot,
.xm-record.recording .xm-rec-dot { animation: xm-rec 1s ease-in-out infinite; }

@keyframes xm-rec {
    50% { opacity: .3; }
}

.xm-note {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    max-width: calc(100% - 24px);
    padding: 6px 14px;
    border-radius: 10px;
    background: rgba(20, 30, 50, .88);
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    text-align: center;
}

.xm-note[hidden] { display: none; }

.xm-bar,
.xm-result,
.xm-plan,
.xm-crew {
    padding: .7rem .9rem;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 14px rgba(20, 40, 30, .12);
}

.xm-bar { display: grid; gap: .5rem; max-width: 64rem; margin: .9rem auto 0; }
.xm-now { display: flex; justify-content: space-between; gap: 1rem; font-weight: 700; }
.xm-now-name { font-family: var(--xm-festive); font-size: 1.3rem; color: var(--xm-green); }
.xm-pct { font-variant-numeric: tabular-nums; color: #56616d; }

.xm-progress { height: 12px; border-radius: 6px; background: #e6ece8; overflow: hidden; }

.xm-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 6px;
    background: repeating-linear-gradient(-45deg, #e5283f 0 10px, #fff 10px 20px);
    box-shadow: inset 0 0 0 1px rgba(200, 16, 46, .4);
    transition: width .25s;
}

.xm-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }

.xm-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .9rem;
    border: 2px solid var(--xm-green);
    border-radius: 999px;
    background: #fff;
    color: var(--xm-green);
    font: inherit;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.xm-btn[hidden] { display: none; }
.xm-btn:hover,
.xm-btn:focus-visible,
.xm-btn.on { background: var(--xm-green); color: #fff; }

.xm-record { border-color: var(--xm-red); color: var(--xm-red-dark); }
.xm-record:hover,
.xm-record:focus-visible,
.xm-record.recording { background: var(--xm-red); color: #fff; }
.xm-record:hover .xm-rec-dot,
.xm-record.recording .xm-rec-dot { background: #fff; }
.xm-record.recording .xm-rec-dot { border-radius: 2px; }

/* the card's own link (a page that plays it full screen), with a copy button inside the box */
.xm-link { display: grid; gap: .3rem; padding-top: .55rem; border-top: 1px dashed #d5ddd8; }
.xm-link[hidden] { display: none; }
.xm-link-label { font-weight: 800; color: var(--xm-green); }
.xm-link-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

.xm-link-box {
    position: relative;
    flex: 1 1 18rem;
    min-width: 0;
}

.xm-link-url {
    width: 100%;
    padding: .45rem 2.8rem .45rem .7rem;
    border: 2px solid #c9d6ce;
    border-radius: 10px;
    background: #f6faf7;
    color: var(--xm-ink);
    font: inherit;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: .92rem;
}

.xm-link-url:focus { border-color: var(--xm-green); outline: none; box-shadow: 0 0 0 3px rgba(15, 92, 58, .2); }
.xm-link-url:disabled { color: #6b7782; font-family: inherit; font-style: italic; }

.xm-link-copy {
    position: absolute;
    top: 50%;
    right: .3rem;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--xm-green);
    cursor: pointer;
}

.xm-link-copy svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xm-link-copy:hover,
.xm-link-copy:focus-visible { background: var(--xm-green); color: #fff; }
.xm-link-copy.copied { background: var(--xm-green); color: #fff; }
.xm-link-copy:disabled { opacity: .35; cursor: default; background: transparent; color: var(--xm-green); }
.xm-link-open { text-decoration: none; }
.xm-link-note { color: #56616d; }
.xm-link.failed .xm-link-note { color: var(--xm-red-dark); font-weight: 600; }

/* the QR code button beside the link, and the dialog with the big code */
.xm-link-qr { display: inline-flex; align-items: center; gap: .3rem; }
.xm-link-qr[hidden] { display: none; }
.xm-link-qr svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.xm-qr {
    width: min(28rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 1.2rem 1.3rem 1.3rem;
    border: 4px solid var(--xm-gold);
    border-radius: 22px;
    background:
        radial-gradient(circle at 10% 0, rgba(200, 16, 46, .12), transparent 45%),
        radial-gradient(circle at 95% 100%, rgba(15, 92, 58, .14), transparent 50%),
        var(--xm-cream);
    color: var(--xm-ink);
    text-align: center;
    box-shadow: 0 18px 50px rgba(7, 46, 29, .45);
}

.xm-qr[open] { animation: xm-qr-pop .2s ease-out; }
.xm-qr::backdrop { background: rgba(7, 46, 29, .55); backdrop-filter: blur(2px); }
.xm-qr h2 { margin: 0 2rem .8rem; color: var(--xm-red); font-family: var(--xm-festive); font-size: 1.7rem; }

.xm-qr-close {
    position: absolute;
    top: .6rem;
    right: .6rem;
    width: 2.2rem;
    height: 2.2rem;
    border: 2px solid var(--xm-green);
    border-radius: 50%;
    background: transparent;
    color: var(--xm-green);
    font: inherit;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.xm-qr-close:hover,
.xm-qr-close:focus-visible { background: var(--xm-green); color: #fff; }

.xm-qr-code {
    width: min(18rem, 100%);
    margin: 0 auto;
    padding: .5rem;
    border: 3px solid var(--xm-green);
    border-radius: 16px;
    background: #fff;
}

.xm-qr-code svg { display: block; width: 100%; height: auto; }
.xm-qr-url { margin: .7rem 0 .3rem; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; overflow-wrap: anywhere; }
.xm-qr-note { margin: 0 0 .9rem; color: #56616d; font-size: .9rem; }
.xm-qr .xm-buttons { justify-content: center; }

@keyframes xm-qr-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { .xm-qr[open] { animation: none; } }

.xm-result { max-width: 64rem; margin: .9rem auto 0; border: 3px solid var(--xm-gold); }
.xm-result[hidden] { display: none; }
.xm-result h2 { font-family: var(--xm-festive); font-size: 1.6rem; color: var(--xm-red-dark); }
.xm-result video { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto .6rem; border-radius: 10px; background: #000; }

.xm-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; max-width: 64rem; width: 100%; margin: 0 auto; align-items: start; }

.xm-plan h2,
.xm-crew h2 { font-family: var(--xm-festive); font-size: 1.3rem; color: var(--xm-green); }

.xm-plan ol,
.xm-crew ul { margin: 0; padding: 0; list-style: none; }

.xm-plan li { display: flex; align-items: center; gap: .5rem; padding: 2px 0; opacity: .6; }
.xm-plan li.active { opacity: 1; font-weight: 800; }
.xm-plan li.done { opacity: .9; }

.xm-tick-box { flex: none; width: 15px; height: 15px; border: 2px solid var(--xm-green); border-radius: 4px; }
.xm-plan li.active .xm-tick-box { border-color: var(--xm-red); background: var(--xm-red); }

.xm-plan li.done .xm-tick-box {
    background: var(--xm-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.6 2.6L10 3.6' fill='none' stroke='%23fff' stroke-width='2.2'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.xm-plan-name { flex: 1; }
.xm-plan-count { font-size: .8rem; font-variant-numeric: tabular-nums; color: #56616d; }

.xm-crew li { display: flex; align-items: center; gap: .55rem; padding: 3px 0; }
.xm-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .3); }
.xm-who { display: grid; min-width: 0; line-height: 1.2; }
.xm-who em { font-style: normal; font-size: .78rem; font-weight: 700; color: var(--xm-red-dark); }
.xm-who small { font-size: .76rem; color: #56616d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* a tall or square picture leaves room beside it for the plan and the crew */
@media (min-width: 1000px) {
    .xm-theatre[data-format="portrait"],
    .xm-theatre[data-format="square"] { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; }
    .xm-theatre[data-format="portrait"] .xm-panels,
    .xm-theatre[data-format="square"] .xm-panels { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .xm-menu-cols { grid-template-columns: minmax(0, 1fr); }
    .xm-menu-side { position: static; }
    .xm-hero-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .xm-hero::before,
    .xm-lights span,
    .xm-hero-art .xm-art-bulb,
    .xm-rec-badge .xm-rec-dot,
    .xm-record.recording .xm-rec-dot { animation: none; }
    .xm-cta, .xm-start, .xm-progress-fill { transition: none; }
}
