/*
 * Finger Roulette: the tool's own components, styled in the site's design language (14 Nov 2026, on the UltraCompress Pro
 * template). The first part is the shared block of the template tools (tokens, page, hero, buttons, toolbar, fields,
 * windows, toasts, information sections), copied from the Love Calculator's stylesheet. Base: /libs/site-pages.css
 * (tokens, Inter and Space Grotesk, theme toggle, focus rings) and /libs/shared-nav.css (the site's header and footer).
 * The second part is the tool itself: the stage with its Start button, the settings card and the play area, a window
 * above the whole page (the browser's top layer) with a ring for every finger. Light is the default; dark applies when
 * <html> has no data-theme. Assembled once, then edited by hand: this file is the source.
 */


/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-lg: 16px;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.24);
    --ok: #166534;
    --ok-soft: rgba(22, 101, 52, 0.09);
    --bad: #b91c1c;
    --bad-soft: rgba(185, 28, 28, 0.08);
    --warn: #92400e;
    --warn-soft: rgba(217, 119, 6, 0.1);
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.26);
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.1);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- The site header is the first thing on the page and stays at the top ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Small helpers ----- */
main [hidden], .dialog [hidden] { display: none !important; } /* the script hides fields that carry their own display */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.small { font-size: 0.9rem; }
.block { display: block; }
.hint { color: var(--text-3); font-size: 0.8rem; font-weight: 400; line-height: 1.45; }
.err { color: var(--bad); font-size: 0.85rem; font-weight: 600; }
.err:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--link-hover); }
code { font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--code-text); }
kbd { font-family: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; padding: 12px 24px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm, .btn-danger.btn-sm { padding: 8px 15px; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; padding: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); background: var(--surface); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible, .link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Toolbar ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 220px; max-width: 100%; }
.status-icon { font-size: 1.3rem; line-height: 1; }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.85rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-sub { font-size: 0.72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.view-tab { padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab:hover { color: var(--link); }
.view-tab.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.view[hidden] { display: none; }
.shell-hint { margin-top: 14px; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.input, .select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--placeholder); }
.input[aria-invalid="true"] { border-color: var(--bad); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
input[type="time"].input { color-scheme: light; width: 9em; }
:root:not([data-theme="light"]) input[type="time"].input { color-scheme: dark; }
.select { width: auto; max-width: 100%; appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
.select option { color: #0a0a14; background: #fff; }
.num-input { width: 7.5em; }
.num-input.wide { width: 10em; }
.check-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); padding: 4px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.seg button:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip .ico { width: 15px; height: 15px; color: var(--link); }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Windows ----- */
.dialog { margin: auto; border: 1px solid var(--surface-border); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 16px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.dialog--narrow { width: min(420px, calc(100vw - 16px)); }
.dialog--wide { width: min(680px, calc(100vw - 16px)); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.dialog-head { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-title { margin: 0; font-size: 1.15rem; }
.dialog-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: border-color 0.2s ease, color 0.2s ease; }
.dialog-close:hover { border-color: var(--brand); color: var(--link); }
.dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 210px); display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { padding: 14px 20px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.confirm-message { margin: 0; color: var(--text); }
.help-body h3 { margin: 6px 0 0; font-size: 1rem; }
.help-body p { margin: 0; color: var(--text-2); }

/* ----- Toasts ----- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 420px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast button { background: none; border: 0; padding: 0; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toast.good { border-left-color: #4ade80; }
.toast.bad { border-left-color: #f87171; }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }

/* ===== Finger Roulette components ===== */

/* ----- The site's text rules (p, ul, li, headings) must not reach the tool: same weight as the site's, loaded later ----- */
:where(.app-shell) p, :where(.app-shell) ul, :where(.app-shell) li, :where(.play-dialog) p { margin: 0; line-height: 1.5; }
:where(.app-shell) ul { padding: 0; list-style: none; }
:where(.app-shell) h2, :where(.app-shell) h3, :where(.play-dialog) h2 { margin: 0; line-height: 1.25; }
:root { --head: 81px; }
@media (max-width: 639.98px) { :root { --head: 65px; } }

/* ----- Cards: the site's white cards, one layer ----- */
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ----- The ring colours, in the order fingers arrive (engine.js names them); the first four are the team colours ----- */
:root {
    --c1: #7c3aed; --c2: #ea580c; --c3: #0d9488; --c4: #db2777; --c5: #2563eb; --c6: #65a30d;
    --c7: #dc2626; --c8: #0891b2; --c9: #d97706; --c10: #c026d3; --c11: #16a34a; --c12: #4f46e5;
    --stage: #ffffff;
    --stage-dot: rgba(10, 10, 20, 0.1);
    --tag-bg: #ffffff;
    --tag-ink: #0a0a14;
}
:root:not([data-theme="light"]) {
    --c1: #a78bfa; --c2: #fb923c; --c3: #2dd4bf; --c4: #f472b6; --c5: #60a5fa; --c6: #a3e635;
    --c7: #f87171; --c8: #22d3ee; --c9: #fbbf24; --c10: #e879f9; --c11: #4ade80; --c12: #818cf8;
    --stage: #0a0a14;
    --stage-dot: rgba(255, 255, 255, 0.1);
    --tag-bg: #14141f;
    --tag-ink: #ffffff;
}

/* ----- The page: the stage and the settings ----- */
.app-shell { scroll-margin-top: calc(var(--head) + 16px); }
.fr-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .fr-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; } }
.view-title { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); color: var(--text-strong); }
.lede { color: var(--text-2); font-size: 1.05rem; max-width: 40rem; }
.card-title { font-size: 1.3rem; color: var(--text-strong); }
.form-error { color: var(--bad); font-weight: 600; }

.stage-card { padding: 0; gap: 0; overflow: hidden; }
.stage-art { position: relative; flex: 1 1 auto; min-height: 250px; background-color: var(--stage); background-image: radial-gradient(var(--stage-dot) 1.2px, transparent 1.7px); background-size: 26px 26px; border-bottom: 1px solid var(--surface-border); overflow: hidden; }
.stage-copy { padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.btn-start { font-size: 1.1rem; padding: 16px 34px; }
.btn-start .ico { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.stage-hint { font-size: 0.875rem; max-width: 40rem; }

/* The picture on the stage: five rings, one of them picked. A drawing, not the play area. */
.demo { position: absolute; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; color: var(--c1); transform: scale(0.8); opacity: 0.38; }
.demo i { position: absolute; inset: 0; border-radius: 50%; border: 8px solid currentColor; }
.demo i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: 0.16; }
.demo.d1 { left: 16%; top: 36%; }
.demo.d2 { left: 37%; top: 76%; color: var(--c2); }
.demo.d3 { left: 54%; top: 40%; color: var(--c3); }
.demo.d4 { left: 77%; top: 72%; color: var(--c4); }
.demo.d5 { left: 86%; top: 26%; color: var(--c5); }
.demo.picked { transform: scale(1.22); opacity: 1; }
.demo b { position: absolute; inset: 0; border-radius: 50%; border: 3px solid currentColor; opacity: 0; animation: burst 1.8s ease-out infinite; }
.demo em { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); padding: 3px 12px; border-radius: 9999px; background: var(--tag-bg); color: var(--tag-ink); border: 2px solid var(--c3); font-style: normal; font-weight: 700; font-size: 0.82rem; line-height: 1.3; white-space: nowrap; }

.settings-card { gap: 18px; }
.chips-set { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.chips-set legend { padding: 0; margin-bottom: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chip { position: relative; display: inline-flex; }
.radio-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.radio-chip span { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-size: 0.9rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease; }
.radio-chip span:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.radio-chip input:checked + span { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.radio-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.field-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field-inline .select { width: 6.5em; }
.switch-rows { display: flex; flex-direction: column; gap: 4px; }
.device-line { border-top: 1px solid var(--line); padding-top: 14px; }
.device-line:empty { display: none; }
.reset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }

/* ----- The play area: a window above the whole page, so nothing on the page can lie over the fingers ----- */
html.fr-open { overflow: hidden; }
.play-dialog { margin: 0; padding: 0; border: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; background: var(--stage); color: var(--text); overflow: hidden; overscroll-behavior: contain; }
.play-dialog::backdrop { background: rgba(10, 10, 20, 0.85); }
.play-dialog [hidden] { display: none !important; }
.play { --g: 16px; width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--stage); color: var(--text); }
@media (min-width: 640px) { .play { --g: 24px; } }
.play-bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) calc(var(--g) + env(safe-area-inset-right, 0px)) 10px calc(var(--g) + env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); background: var(--surface); }
.play-mode { flex: 1 1 auto; min-width: 0; font-size: 1.1rem; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play .icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); }
.play .icon-btn:hover { border-color: var(--brand); color: var(--link); }
.play .icon-btn .ico { width: 20px; height: 20px; }
.join-seg { flex-wrap: nowrap; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); flex-shrink: 0; }
.join-seg button { border: 0; background: transparent; min-height: 36px; padding: 6px 16px; }
.join-seg button:hover { transform: none; }
.join-seg button[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; }

.arena { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background-color: var(--stage); background-image: radial-gradient(var(--stage-dot) 1.2px, transparent 1.7px); background-size: 26px 26px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.arena::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at var(--wx, 50%) var(--wy, 50%), var(--wc, transparent) 0%, transparent 60%); opacity: 0; transition: opacity 0.5s ease; pointer-events: none; }
.arena.tinted::before { opacity: 0.17; }
.arena-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; pointer-events: none; transition: opacity 0.2s ease; }
.arena.has-spots .arena-hint { opacity: 0; }
.hint-art { display: flex; gap: 14px; margin-bottom: 4px; }
.hint-art i { width: 36px; height: 36px; border-radius: 50%; border: 5px solid var(--c1); animation: bob 1.8s ease-in-out infinite; }
.hint-art i:nth-child(2) { border-color: var(--c2); animation-delay: 0.2s; }
.hint-art i:nth-child(3) { border-color: var(--c3); animation-delay: 0.4s; }
.hint-main { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: clamp(1.3rem, 1rem + 1.8vw, 2rem); line-height: 1.2; color: var(--text-strong); max-width: 20ch; }
.hint-sub { color: var(--text-2); font-size: 1rem; max-width: 36ch; }
.hint-sub:empty { display: none; }
.spots { position: absolute; inset: 0; pointer-events: none; }

/* One ring. The script moves .spot (transform) and sets --ring; everything that grows, fades or pulses is on .spot-body. */
.spot { --ring: var(--c1); position: absolute; left: 0; top: 0; width: var(--spot, 120px); height: var(--spot, 120px); margin: calc(var(--spot, 120px) / -2) 0 0 calc(var(--spot, 120px) / -2); color: var(--ring); will-change: transform; }
.spot-body { position: absolute; inset: 0; transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.25), opacity 0.32s ease, filter 0.32s ease; animation: spot-in 0.18s ease-out; }
.spot-halo { position: absolute; inset: -16%; border-radius: 50%; background: radial-gradient(circle, currentColor 0%, transparent 68%); opacity: 0.2; animation: halo 1.5s ease-in-out infinite; }
.spot-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spot-ring .disc { fill: currentColor; opacity: 0.14; transition: opacity 0.2s ease; }
.spot-ring .track { fill: none; stroke: currentColor; stroke-width: 10; opacity: 0.3; }
.spot-ring .fill { fill: none; stroke: currentColor; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transform: rotate(-90deg); transform-origin: 60px 60px; }
.arena.counting .spot-ring .fill { animation: ring-fill var(--hold, 3s) linear forwards; }
.arena.locked .spot-ring .fill, .arena.tap .spot-ring .fill { stroke-dashoffset: 0; }
.spot-num { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.5rem; color: var(--text-strong); }
.arena.tap .spot-num { display: flex; }
.spot-burst { position: absolute; inset: 0; border-radius: 50%; border: 4px solid currentColor; opacity: 0; }
.spot-tag { position: absolute; left: 50%; top: 50%; z-index: 2; min-width: 42px; height: 42px; padding: 0 13px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: var(--tag-bg); color: var(--tag-ink); border: 3px solid var(--ring); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.05rem; line-height: 1; white-space: nowrap; opacity: 0; transform: translate(-50%, -50%) translate(var(--tx, 0px), var(--ty, -86px)) scale(0.4); transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.spot.tagged .spot-tag { opacity: 1; transform: translate(-50%, -50%) translate(var(--tx, 0px), var(--ty, -86px)) scale(1); }

/* While the light runs: every ring dimmed but the one that is lit. */
.arena.show .spot-body { opacity: 0.42; }
.arena.show .spot.lit .spot-body { opacity: 1; transform: scale(1.16); transition-duration: 0.08s; }
.arena.show .spot.lit .disc { opacity: 0.5; }
.arena.locked .spot-halo { animation: none; opacity: 0.12; }
/* The result. Size and fading say it as well as colour does. */
.spot.win { z-index: 1; }
.spot.win .spot-body { transform: scale(1.28); }
.spot.win .disc { opacity: 0.36; }
.spot.win .spot-halo { opacity: 0.3; }
.spot.win .spot-burst { animation: burst 1.5s ease-out infinite; }
.spot.win .spot-burst + .spot-burst { animation-delay: 0.5s; }
.spot.lose .spot-body { transform: scale(0.74); opacity: 0.3; filter: grayscale(0.7); }
.spot.team .disc, .spot.placed .disc { opacity: 0.28; }

@keyframes spot-in { from { transform: scale(0.4); opacity: 0; } }
@keyframes halo { 0%, 100% { transform: scale(0.92); } 50% { transform: scale(1.1); } }
@keyframes ring-fill { from { stroke-dashoffset: 314.16; } to { stroke-dashoffset: 0; } }
@keyframes burst { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.play-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; min-height: 68px; padding: 10px calc(var(--g) + env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) calc(var(--g) + env(safe-area-inset-left, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.play-status { flex: 1 1 240px; min-width: 0; font-weight: 600; font-size: 1.05rem; color: var(--text-strong); overflow-wrap: anywhere; }
.play-status:empty::before { content: '\00a0'; }
.tap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .card { padding: 16px; }
    .stage-card { padding: 0; }
    .stage-copy { padding: 16px; }
    .stage-art { min-height: 210px; }
    .demo { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
    .demo i { border-width: 7px; }
    .btn-start { width: 100%; }
    .play-bar { flex-wrap: wrap; row-gap: 6px; }
    .play-mode { order: 9; flex: 1 1 100%; font-size: 1rem; text-align: center; }
    .join-seg { margin-left: auto; }
    .demo.d3 { top: 47%; }
    .join-seg button { padding: 6px 12px; }
    .tap-actions { width: 100%; }
    .tap-actions .btn { flex: 1 1 auto; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .radio-chip span, .seg button, .spot-body, .spot-tag, .arena::before, .arena-hint { transition: none; }
    .spot-body, .spot-halo, .spot-burst, .spot.win .spot-burst, .hint-art i, .demo b { animation: none; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The stage picture and the rings are drawings. */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) { min-height: 44px; }
    main .radio-chip span, main .check-row { min-height: 44px; }
    main .check-row { align-items: center; }
    main :is(p, li, .hint, .label, .select, .radio-chip span, .muted, .check-row, .link) { font-size: 1rem; }
    .play-dialog button { min-height: 44px; }
    .play-dialog :is(.btn, .seg button, .play-status, .hint-sub) { font-size: 1rem; }
}
