/**
 * v5 design - homepage (big type, wheel stage, mobile-first ad slots) and, at the end, the tool pages
 * Loaded on the homepage and tool pages, after homepage.css / spinner-wheel.css / tool-guide.css.
 * Scoped to body.wod-v5 (homepage + tool pages); tool-page layout rules use body.wod-tool-v5.
 *
 * @package WOD_v4
 */

/* ==========================================================================
   TOKENS
   ========================================================================== */
body.wod-v5 {
    --h-font: 'Bricolage Grotesque', 'Segoe UI', Roboto, -apple-system, sans-serif;

    --h-yellow: #ffbe4d;
    --h-coral: #ff7a59;
    --h-violet: #8b6cff;
    --h-ink: #121019;

    /* Light */
    --h-bg: #fbf7ef;
    --h-surface: #ffffff;
    --h-surface-2: #f3eee3;
    --h-text: #15131c;
    --h-muted: #5d5868;
    --h-line: rgba(21, 19, 28, 0.1);
    --h-shadow: 0 18px 50px rgba(40, 30, 10, 0.1);

    /* Wheel stage */
    /* Never taller than the space left on screen under the nav + top ad, so it's fully visible on arrival */
    --wheel: clamp(360px, calc(100svh - 240px), min(560px, 44vw));
    --ring: clamp(12px, 2.6vw, 20px);

    /* Feed the shared component variables (spinner-wheel.css / tool-guide.css) */
    --bg-main: var(--h-bg);
    --bg-card: var(--h-surface);
    --bg-input: var(--h-surface-2);
    --text-primary: var(--h-text);
    --text-secondary: var(--h-text);
    --text-muted: var(--h-muted);
    --border-color: var(--h-line);
    --guide-bg-main: var(--h-bg);
    --guide-bg-card: var(--h-surface);
    --guide-text-primary: var(--h-text);
    --guide-text-secondary: var(--h-text);
    --guide-text-muted: var(--h-muted);
    --guide-border-color: var(--h-line);

    font-family: var(--h-font);
    background: var(--h-bg) !important;
    color: var(--h-text);
}

body.wod-v5.dark-mode {
    --h-bg: #0b0a10;
    --h-surface: #16141f;
    --h-surface-2: #1f1c2b;
    --h-text: #f7f5ff;
    --h-muted: rgba(247, 245, 255, 0.68);
    --h-line: rgba(255, 255, 255, 0.09);
    --h-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

    background: var(--h-bg) !important;
    color: var(--h-text) !important;
}

body.wod-v5 h1,
body.wod-v5 h2,
body.wod-v5 h3,
body.wod-v5 h4,
body.wod-v5 button,
body.wod-v5 textarea {
    font-family: var(--h-font);
}

body.wod-v5 .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ==========================================================================
   PAGE SHELL
   ========================================================================== */
body.wod-v5 .wod-home {
    display: block;
    min-height: 0;
    position: relative;
    overflow: hidden;
    padding: 96px 24px 24px;
    background:
        radial-gradient(48rem 32rem at 82% 18%, rgba(139, 108, 255, 0.16), transparent 70%),
        radial-gradient(40rem 28rem at 6% 0%, rgba(255, 190, 77, 0.2), transparent 70%),
        radial-gradient(30rem 22rem at 50% 100%, rgba(255, 122, 89, 0.1), transparent 70%),
        var(--h-bg);
}

/* Faint dot grid behind the hero */
body.wod-v5 .wod-home::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 900px;
    background-image: radial-gradient(var(--h-line) 1.2px, transparent 1.2px);
    background-size: 26px 26px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
    pointer-events: none;
}

body.wod-v5 .wod-home > * {
    position: relative;
}

/* ==========================================================================
   HERO STAGE (intro + wheel + choices)
   ========================================================================== */
body.wod-v5 .home-stage {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "intro   wheel"
        "entries wheel";
    grid-template-rows: auto 1fr;
    column-gap: clamp(32px, 5vw, 80px);
    row-gap: 32px;
    align-items: start;
}

body.wod-v5 .home-intro {
    grid-area: intro;
    text-align: left;
    margin: 0;
    padding-top: 12px;
}

body.wod-v5 .home-wheel {
    grid-area: wheel;
    align-self: start;
}

body.wod-v5 .home-entries {
    grid-area: entries;
}

/* Intro ------------------------------------------------------------------ */
body.wod-v5 .home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--h-surface);
    border: 1px solid var(--h-line);
    color: var(--h-text) !important;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

body.wod-v5 .home-eyebrow__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2fd28a;
    box-shadow: 0 0 0 0 rgba(47, 210, 138, 0.6);
    animation: wodPing 2s ease-out infinite;
}

body.wod-v5 .home-title {
    margin: 0 0 22px;
    font-size: clamp(2.9rem, 1.4rem + 4.6vw, 6rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.035em;
    color: var(--h-text);
}

body.wod-v5 .home-title__accent {
    display: inline-block;
    background: linear-gradient(100deg, var(--h-yellow) 10%, var(--h-coral) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-bottom: 0.06em;
}

body.wod-v5 .home-lead {
    max-width: 34ch;
    margin: 0 0 28px;
    font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
    line-height: 1.5;
    color: var(--h-muted) !important;
}

/* Quick-start chips -------------------------------------------------------- */
body.wod-v5 .quick-picks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

body.wod-v5 .quick-picks__label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--h-muted);
    margin-right: 2px;
}

body.wod-v5 .quick-pick {
    padding: 11px 18px;
    border-radius: 999px;
    border: 1px solid var(--h-line);
    background: var(--h-surface);
    color: var(--h-text);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.wod-v5 .quick-pick:hover {
    transform: translateY(-2px);
    border-color: var(--h-yellow);
    box-shadow: 0 8px 20px rgba(255, 190, 77, 0.22);
}

body.wod-v5 .quick-pick.is-active {
    background: var(--h-yellow);
    border-color: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .quick-pick:focus-visible,
body.wod-v5 .spin-button:focus-visible,
body.wod-v5 .control-btn:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 3px;
}

/* ==========================================================================
   WHEEL
   ========================================================================== */
body.wod-v5 .home-wheel {
    padding: 0;
    flex: none;
}

body.wod-v5 .home-wheel .wheel-wrapper {
    position: relative;
    width: var(--wheel);
    height: var(--wheel);
    margin: 0 auto;
}

/* The canvas leaves a 20px margin around the wheel; the ring and lights sit in it */
body.wod-v5 .home-wheel .canvas-container {
    position: absolute;
    inset: 0;
    z-index: 2;
}

body.wod-v5 .wheel-glow {
    position: absolute;
    inset: -14%;
    z-index: 0;
    border-radius: 50%;
    background:
        radial-gradient(closest-side, rgba(255, 190, 77, 0.35), transparent 70%),
        radial-gradient(closest-side at 70% 70%, rgba(139, 108, 255, 0.35), transparent 75%);
    filter: blur(30px);
    animation: wodBreathe 5s ease-in-out infinite;
    pointer-events: none;
}

body.wod-v5 .wheel-ring {
    position: absolute;
    inset: calc(20px - var(--ring));
    z-index: 1;
    border-radius: 50%;
    background: var(--h-ink);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.35),
        inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

/* Marquee lights around the rim */
body.wod-v5 .wheel-lights {
    position: absolute;
    inset: calc(20px - var(--ring) / 2);
    z-index: 3;
    container-type: size;
    pointer-events: none;
}

body.wod-v5 .wheel-lights span {
    --bulb: calc(var(--ring) * 0.42);
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--bulb);
    height: var(--bulb);
    margin: calc(var(--bulb) / -2);
    border-radius: 50%;
    background: #fff4d6;
    transform: rotate(calc(var(--i) * 15deg)) translateY(-50cqh);
    box-shadow: 0 0 6px 2px rgba(255, 190, 77, 0.75);
    animation: wodBlink 1.6s ease-in-out infinite;
}

body.wod-v5 .wheel-lights span:nth-child(even) {
    animation-delay: -0.8s;
}

/* Lights chase while the wheel spins */
body.wod-v5 .wod-home.is-spinning .wheel-lights span {
    animation-duration: 0.6s;
    animation-delay: calc(var(--i) * -0.025s);
}

/* Pointer (stays on the right: the winner is read at 3 o'clock) */
body.wod-v5 .home-wheel .wheel-pointer {
    top: 50%;
    right: -18px;
    width: 46px;
    height: 38px;
    border: 0;
    z-index: 5;
    /* --tilt is set by wheel-motion.js: tip down as a slice divider pushes past */
    transform: translateY(-50%) rotate(var(--tilt, 0deg));
    transform-origin: 100% 50%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

body.wod-v5 .home-wheel .wheel-pointer::after {
    content: '';
    position: absolute;
    inset: 0;
    top: 0;
    right: 0;
    width: auto;
    height: auto;
    border: 0;
    transform: none;
    background: linear-gradient(90deg, var(--h-yellow), var(--h-coral));
    clip-path: polygon(0 50%, 100% 0, 82% 50%, 100% 100%);
}

/* SPIN button */
body.wod-v5 .home-wheel .spin-button {
    width: clamp(68px, 19%, 112px);
    height: clamp(68px, 19%, 112px);
    background: radial-gradient(circle at 35% 30%, #ffe2a6, var(--h-yellow) 55%, #f59e2b);
    color: var(--h-ink);
    border: 5px solid var(--h-ink);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(255, 190, 77, 0.35);
    z-index: 6;
}

body.wod-v5 .home-wheel .spin-button::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 3px solid var(--h-yellow);
    animation: wodPulse 2.2s ease-out infinite;
    pointer-events: none;
}

body.wod-v5 .home-wheel .spin-button:disabled::before {
    animation: none;
    opacity: 0;
}

body.wod-v5 .home-wheel .spin-text {
    font-size: clamp(1rem, 0.85rem + 0.6vw, 1.35rem);
    font-weight: 800;
    letter-spacing: 0.08em;
}

/* Little "pop" when a quick-start wheel is loaded */
body.wod-v5 .wheel-wrapper.is-bumped .canvas-container {
    animation: wodBump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Controls under the wheel */
body.wod-v5 .home-wheel .wheel-controls {
    margin-top: 28px;
    gap: 14px;
}

body.wod-v5 .home-wheel .control-btn {
    width: 52px;
    height: 52px;
    background: var(--h-surface);
    border: 1px solid var(--h-line);
    color: var(--h-text);
    box-shadow: none;
}

body.wod-v5 .home-wheel .control-btn:hover {
    background: var(--h-yellow);
    border-color: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .home-wheel .control-btn::after {
    font-size: 13px;
    background: var(--h-surface);
    color: var(--h-text);
    border-color: var(--h-line);
}

/* Fullscreen keeps working with the new sizes */
body.wod-v5 .wheel-center.fullscreen-mode {
    background: var(--h-bg);
}

body.wod-v5 .wheel-center.fullscreen-mode .wheel-wrapper {
    --wheel: min(80vw, 78vh, 820px);
    max-width: none;
    max-height: none;
}

/* ==========================================================================
   CARDS (choices, results, statistics, settings)
   ========================================================================== */
body.wod-v5 .home-card,
body.wod-v5 .home-card.sidebar-left,
body.wod-v5 .home-card.sidebar-right {
    --card-accent: var(--h-yellow);
    position: relative;
    left: auto;
    width: auto;
    display: block;
    transform: none;
    padding: 26px;
    max-height: none;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--card-accent) 7%, transparent), transparent 120px),
        var(--h-surface);
    border: 1px solid var(--h-line);
    border-radius: 28px;
    box-shadow: var(--h-shadow);
    overflow: hidden;
}

/* Thin accent line along the top of each card */
body.wod-v5 .home-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent), transparent 80%);
}

body.wod-v5 .home-card--results { --card-accent: #ff9f43; }
body.wod-v5 .home-card--stats { --card-accent: #8b6cff; }
body.wod-v5 .home-card--settings { --card-accent: #3fd8b0; }

body.wod-v5 .home-card .section-header {
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 0;
    border-bottom: 0;
    color: var(--h-text);
}

body.wod-v5 .home-card .section-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 13px;
    background: color-mix(in srgb, var(--card-accent) 18%, transparent);
    color: var(--card-accent);
    opacity: 1;
}

body.wod-v5 .home-card .section-title {
    text-align: left;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--h-text);
}

body.wod-v5 .home-card .entry-count {
    font-size: 1rem;
    font-weight: 800;
    padding: 5px 14px;
}

/* Your choices: rows like the Results list - number badge, divider, bold name.
   The badges sit in a gutter (home-v5.js) that scrolls with the textarea. */
body.wod-v5 .choices-editor {
    --row: 3.1rem;
    --pad: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--h-line);
    border-radius: 18px;
    background: var(--h-surface-2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.wod-v5 .choices-editor:focus-within {
    border-color: var(--h-yellow);
    box-shadow: 0 0 0 4px rgba(255, 190, 77, 0.18);
}

body.wod-v5 .choices-editor__gutter {
    position: absolute;
    top: var(--pad);
    left: 0;
    z-index: 1;
    width: 58px;
    pointer-events: none;
}

body.wod-v5 .choices-editor__row {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--row);
}

body.wod-v5 .choices-editor__row b {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--h-surface);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--h-text);
}

/* The first choice gets the accent badge, like the newest result */
body.wod-v5 .choices-editor__row:first-child b {
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .home-entries textarea {
    display: block;
    width: 100%;
    height: auto;
    min-height: calc(var(--row) * 6 + var(--pad) * 2);
    margin: 0;
    padding: var(--pad) 16px var(--pad) 58px;
    border: 0;
    border-radius: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: var(--row);
    white-space: pre;
    overflow: auto;
    color: var(--h-text);
    background-color: transparent;
    background-image: linear-gradient(to bottom, transparent calc(var(--row) - 1px), var(--h-line) calc(var(--row) - 1px));
    background-size: 100% var(--row);
    background-position: 0 var(--pad);
    background-attachment: local;
    resize: vertical;
}

body.wod-v5 .home-entries textarea:focus {
    border: 0;
    outline: none;
    box-shadow: none;
}

/* Thicker scrollbars in the choices box and the results list */
body.wod-v5 .home-entries textarea,
body.wod-v5 .home-panels .results-list {
    scrollbar-width: auto;
    scrollbar-color: var(--h-yellow) transparent;
}

body.wod-v5 .home-entries textarea::-webkit-scrollbar,
body.wod-v5 .home-panels .results-list::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

body.wod-v5 .home-entries textarea::-webkit-scrollbar-track,
body.wod-v5 .home-panels .results-list::-webkit-scrollbar-track {
    background: transparent;
}

body.wod-v5 .home-entries textarea::-webkit-scrollbar-thumb,
body.wod-v5 .home-panels .results-list::-webkit-scrollbar-thumb {
    background: var(--h-yellow);
    border: 4px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

body.wod-v5 .home-entries textarea::-webkit-scrollbar-corner {
    background: transparent;
}

body.wod-v5 .home-entries__hint {
    margin: 12px 2px 0;
    font-size: 1rem;
    color: var(--h-muted);
}

/* Results, statistics, settings */
body.wod-v5 .home-panels {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

/* Results ------------------------------------------------------------------ */
body.wod-v5 .home-panels .btn-clear {
    width: auto;
    padding: 7px 14px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--h-muted);
}

body.wod-v5 .home-panels .btn-clear:hover {
    border-color: var(--card-accent);
    color: var(--h-text);
    background: transparent;
}

/* Nothing to clear yet */
body.wod-v5 .results-section:has(.no-results) .btn-clear {
    visibility: hidden;
}

body.wod-v5 .home-panels .results-list {
    max-height: 300px;
    margin: 0;
}

body.wod-v5 .home-panels .no-results {
    padding: 34px 16px;
    border: 2px dashed var(--h-line);
    border-radius: 18px;
    font-size: 1.1rem;
    font-style: normal;
    color: var(--h-muted);
}

body.wod-v5 .home-panels .result-item {
    gap: 14px;
    margin: 0;
    padding: 12px 6px;
    border-radius: 0;
    background: none;
    border-bottom: 1px solid var(--h-line);
}

body.wod-v5 .home-panels .result-item:last-child {
    border-bottom: 0;
}

/* Newest result stands out */
body.wod-v5 .home-panels .result-item:first-child {
    padding: 14px 14px;
    margin-bottom: 6px;
    border: 0;
    border-radius: 16px;
    background: color-mix(in srgb, var(--card-accent) 14%, transparent);
}

body.wod-v5 .home-panels .result-item .result-number {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    background: var(--h-surface-2);
    color: var(--h-text);
}

body.wod-v5 .home-panels .result-item:first-child .result-number {
    background: var(--card-accent);
    color: var(--h-ink);
}

body.wod-v5 .home-panels .result-item .result-name {
    font-size: 1.15rem;
    font-weight: 700;
}

body.wod-v5 .home-panels .result-item .result-time {
    font-size: 0.9rem;
    color: var(--h-muted);
}

/* Statistics ------------------------------------------------------------- */
body.wod-v5 .home-panels .stats-grid {
    grid-template-columns: 3fr 7fr;
    gap: 0;
}

body.wod-v5 .home-panels .stat-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
    padding: 8px 0 8px 20px;
    text-align: left;
    background: none;
    border: 0;
    border-left: 1px solid var(--h-line);
    border-radius: 0;
}

body.wod-v5 .home-panels .stat-item:first-child {
    padding-left: 0;
    border-left: 0;
}

body.wod-v5 .home-panels .stat-item:hover {
    background: none;
}

body.wod-v5 .home-panels .stat-value {
    margin-bottom: 8px;
    font-size: clamp(2.8rem, 2rem + 2vw, 4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--h-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.wod-v5 .home-panels #totalSpins {
    color: var(--card-accent);
}

/* Last winner: the whole name (data-full), wrapping onto more lines when needed */
body.wod-v5 .home-panels #lastWinner {
    overflow: visible;
    white-space: normal;
}

/* spinner-wheel.js writes the last winner as a small inline-styled pill */
body.wod-v5 .home-panels #lastWinner span {
    max-width: 100%;
    line-height: 1.25;
    overflow-wrap: anywhere;
    border-radius: 18px !important;
    padding: 8px 16px !important;
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em;
    color: #121019 !important;
    text-shadow: none !important;
    vertical-align: middle;
}

body.wod-v5 .home-panels .stat-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--h-muted);
}

/* Settings: rows with a stepper and two switches ------------------------- */
body.wod-v5 .home-settings {
    display: flex;
    flex-direction: column;
}

body.wod-v5 .home-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 16px 0;
    border: 0;
    border-top: 1px solid var(--h-line);
    background: none;
    color: var(--h-text);
    font: inherit;
    text-align: left;
}

body.wod-v5 .home-setting:first-child {
    padding-top: 4px;
    border-top: 0;
}

body.wod-v5 .home-setting__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

body.wod-v5 .home-setting__label {
    font-size: 1.15rem;
    font-weight: 700;
}

body.wod-v5 .home-setting__hint {
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--h-muted);
}

body.wod-v5 .home-stepper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 4px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: var(--h-surface-2);
}

body.wod-v5 .home-stepper__btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--h-surface);
    color: var(--h-text);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

body.wod-v5 .home-stepper__btn:hover {
    background: var(--card-accent);
    color: var(--h-ink);
}

body.wod-v5 .home-stepper__value {
    min-width: 4.6ch;
    padding: 0 8px;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

body.wod-v5 .home-switch {
    cursor: pointer;
}

body.wod-v5 .home-switch__track {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 32px;
    border-radius: 999px;
    background: var(--h-surface-2);
    border: 1px solid var(--h-line);
    transition: background 0.25s ease, border-color 0.25s ease;
}

body.wod-v5 .home-switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--h-muted);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease;
}

body.wod-v5 .home-switch.active .home-switch__track {
    background: var(--card-accent);
    border-color: var(--card-accent);
}

body.wod-v5 .home-switch.active .home-switch__track::after {
    transform: translateX(24px);
    background: #ffffff;
}

body.wod-v5 .home-switch:focus-visible,
body.wod-v5 .home-stepper__btn:focus-visible,
body.wod-v5 .home-panels .btn-clear:focus-visible {
    outline: 3px solid var(--card-accent);
    outline-offset: 3px;
    border-radius: 12px;
}

/* ==========================================================================
   ADS - space is reserved before the ad loads (no layout jump)
   Breakpoint matches DESKTOP_QUERY in home-v5.js: 728x90 at >= 760px, 300x250 below.
   ========================================================================== */
body.wod-v5 .wod-ad {
    display: none;
    max-width: 100%;
    margin: 40px auto;
    text-align: center;
    overflow: hidden;
}

@media (min-width: 760px) {
    body.wod-v5 .wod-ad[data-wod-ad="both"],
    body.wod-v5 .wod-ad[data-wod-ad="desktop"] {
        display: block;
        min-height: 90px;
    }
}

@media (max-width: 759.98px) {
    body.wod-v5 .wod-ad[data-wod-ad="both"],
    body.wod-v5 .wod-ad[data-wod-ad="mobile"] {
        display: block;
        min-height: 250px;
    }
}

body.wod-v5 .wod-ad--top {
    margin: 0 auto 20px;
}

/* Localhost preview of an ad slot (home-v5.js) */
/* Empty slot placeholder (admins / local copy): a solid block a shade darker than the page */
body.wod-v5 .wod-ad__preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    border-radius: 8px;
    background: #e3dccf;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #6b6577;
}

body.wod-v5.dark-mode .wod-ad__preview {
    background: #1d1a27;
    color: rgba(247, 245, 255, 0.5);
}

/* Keep a gap above the cards when the ad above them is collapsed */
body.wod-v5 .home-panels {
    margin-top: 40px;
}

body.wod-v5 .wod-ad--mid {
    margin-bottom: 0;
}

/* No ad available: collapse the space (kept for admins / local copy so the spot stays visible) */
/* An ad Google couldn't fill: the top and middle slots keep their space (collapsing them
   pushed the page up = layout shift); only the slot far down the guide folds away */
body.wod-v5 .wod-ad:not(.is-preview-mode):has(ins.adsbygoogle[data-ad-status="unfilled"]) {
    visibility: hidden;
}

body.wod-v5 .wod-ad--guide:not(.is-preview-mode):has(ins.adsbygoogle[data-ad-status="unfilled"]) {
    display: none;
}

/* The ad unit is inline-block: without this it sits on the text baseline and adds a few px */
body.wod-v5 .wod-ad {
    line-height: 0;
}

body.wod-v5 .wod-ad ins.adsbygoogle {
    vertical-align: top;
}

/* ==========================================================================
   WINNER POPUP (template-parts/wheel-home.php #resultModal)
   Label, the winner (picture in picture mode), subtitle, "Spin #3 · picked from 8
   entries" (home-v5.js), Close + Spin again. Turning rays and confetti behind it.
   ========================================================================== */
body.wod-v5 .result-modal {
    padding: 16px;
    background: rgba(8, 6, 14, 0.62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

body.wod-v5 .result-modal .result-content {
    position: relative;
    width: min(500px, 100%);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 52px 40px 32px;
    border: 1px solid var(--h-line);
    border-radius: 32px;
    background:
        radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--h-yellow) 22%, transparent), transparent 70%),
        var(--h-surface);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
    color: var(--h-text);
    font-family: var(--h-font);
    text-align: center;
    animation: wodModalIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* Slowly turning sun-rays behind the winner */
body.wod-v5 .result-modal .result-content::before {
    content: '';
    position: absolute;
    inset: -60%;
    z-index: 0;
    background: repeating-conic-gradient(from 0deg, rgba(255, 190, 77, 0.1) 0deg 10deg, transparent 10deg 20deg);
    -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 75%);
    mask-image: radial-gradient(closest-side, #000 30%, transparent 75%);
    animation: wodRays 18s linear infinite;
    pointer-events: none;
}

/* Accent line along the top, like the cards */
body.wod-v5 .result-modal .result-content::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--h-yellow), var(--h-coral));
}

body.wod-v5 .result-modal .result-content > * {
    position: relative;
    z-index: 1;
}

body.wod-v5 .result-modal .result-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--h-line);
    border-radius: 50%;
    background: var(--h-surface-2);
    color: var(--h-text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

body.wod-v5 .result-modal .result-close:hover {
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .result-modal .result-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
    padding: 7px 16px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--h-yellow) 20%, transparent);
    color: var(--h-text) !important;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.wod-v5 .result-modal .result-eyebrow svg {
    color: var(--h-coral);
}

/* Picture mode: the winning image, big, with a glowing ring */
body.wod-v5 .result-modal .result-image-wrapper {
    width: 200px;
    height: 200px;
    margin: 4px auto 24px;
    overflow: hidden;
    border: 0;
    border-radius: 34px;
    box-shadow:
        0 0 0 6px var(--h-surface),
        0 0 0 9px var(--h-yellow),
        0 24px 60px rgba(255, 190, 77, 0.35);
    animation: wodWinner 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

body.wod-v5 .result-modal .result-image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.wod-v5 .result-modal .result-content h2 {
    margin: 0 0 8px;
    font-size: clamp(2.8rem, 2rem + 4vw, 5rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
    background: linear-gradient(100deg, var(--h-yellow), var(--h-coral));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: wodWinner 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Light mode: a deeper orange so the name reads well on the cream card */
body.wod-v5:not(.dark-mode) .result-modal .result-content h2 {
    background-image: linear-gradient(100deg, #f08a1c, #e04a2f);
}

body.wod-v5 .result-modal .result-content:focus {
    outline: none;
}

body.wod-v5 .result-modal.is-long .result-content h2 {
    font-size: clamp(2.1rem, 1.6rem + 2.6vw, 3.4rem);
}

body.wod-v5 .result-modal.is-very-long .result-content h2 {
    font-size: clamp(1.7rem, 1.4rem + 1.6vw, 2.5rem);
}

body.wod-v5 .result-modal .result-subtitle {
    margin: 0 0 6px;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--h-text) !important;
}

body.wod-v5 .result-modal .result-meta {
    margin: 0 0 28px;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--h-muted) !important;
}

body.wod-v5 .result-modal .result-meta:empty {
    margin-bottom: 22px;
}

body.wod-v5 .result-modal .result-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 10px;
}

body.wod-v5 .result-modal .result-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    margin: 0;
    padding: 16px 20px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: var(--h-surface-2);
    color: var(--h-text);
    font-family: var(--h-font);
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.wod-v5 .result-modal .result-btn:hover {
    transform: translateY(-2px);
    border-color: var(--h-yellow);
}

body.wod-v5 .result-modal .result-btn--spin {
    border-color: var(--h-yellow);
    background: var(--h-yellow);
    color: var(--h-ink);
    box-shadow: 0 12px 30px rgba(255, 190, 77, 0.35);
}

body.wod-v5 .result-modal .result-btn--spin:hover {
    box-shadow: 0 16px 36px rgba(255, 190, 77, 0.45);
}

body.wod-v5 .result-modal .result-btn:focus-visible,
body.wod-v5 .result-modal .result-close:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 3px;
}

/* Phones */
@media (max-width: 759.98px) {
    body.wod-v5 .result-modal .result-content {
        padding: 46px 20px 20px;
        border-radius: 26px;
    }

    body.wod-v5 .result-modal .result-image-wrapper {
        width: 150px;
        height: 150px;
        border-radius: 28px;
    }

    body.wod-v5 .result-modal .result-eyebrow {
        margin-bottom: 16px;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   GUIDE (below the tool) - template-parts/guides/guide-home.php
   ========================================================================== */
body.wod-v5 .home-guide {
    padding: 110px 24px 120px;
    background: var(--h-bg);
}

body.wod-v5 .home-guide__inner {
    max-width: 1280px;
    margin: 0 auto;
}

body.wod-v5 .hg-section {
    margin-bottom: 120px;
}

body.wod-v5 .hg-section:last-child {
    margin-bottom: 0;
}

body.wod-v5 .hg-eyebrow {
    margin: 0 0 14px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #f0a12e;
}

body.wod-v5 .hg-title {
    margin: 0 0 40px;
    font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4.4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--h-text);
}

body.wod-v5 .hg-title span {
    background: linear-gradient(100deg, var(--h-yellow) 10%, var(--h-coral) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.wod-v5 .home-guide h3 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--h-text);
}

body.wod-v5 .home-guide p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--h-muted);
}

/* About: text left, features right ---------------------------------------- */
body.wod-v5 .hg-about {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}

body.wod-v5 .hg-about .hg-title {
    margin-bottom: 24px;
}

body.wod-v5 .home-guide .hg-lead {
    max-width: 38ch;
    font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem);
    line-height: 1.55;
}

body.wod-v5 .hg-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body.wod-v5 .hg-feature {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border: 1px solid var(--h-line);
    border-radius: 24px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
        var(--h-surface);
    transition: transform 0.25s ease;
}

body.wod-v5 .hg-feature:hover {
    transform: translateX(6px);
}

body.wod-v5 .hg-feature__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--accent);
}

body.wod-v5 .hg-feature h3 {
    margin-bottom: 4px;
}

/* How to use: numbered step cards ------------------------------------------ */
body.wod-v5 .hg-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

body.wod-v5 .hg-step {
    position: relative;
    padding: 28px 26px 30px;
    border: 1px solid var(--h-line);
    border-radius: 26px;
    background: var(--h-surface);
    overflow: hidden;
}

/* A short line joins each step to the next on wide screens */
body.wod-v5 .hg-step::after {
    content: '';
    position: absolute;
    top: 58px;
    right: 0;
    width: 26px;
    height: 3px;
    border-radius: 3px;
    background: var(--h-yellow);
    opacity: 0.5;
}

body.wod-v5 .hg-step:last-child::after {
    display: none;
}

body.wod-v5 .hg-step__num {
    display: block;
    margin-bottom: 26px;
    font-size: 3.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 2px var(--h-yellow);
}

body.wod-v5 .hg-step p strong {
    font-weight: 700;
    color: var(--h-text);
}

/* Use cases: emoji tiles --------------------------------------------------- */
body.wod-v5 .hg-cases {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.wod-v5 .hg-case {
    padding: 28px;
    border: 1px solid var(--h-line);
    border-radius: 26px;
    background: var(--h-surface);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

body.wod-v5 .hg-case:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--h-yellow) 60%, transparent);
}

body.wod-v5 .hg-case__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    border-radius: 20px;
    background: var(--h-surface-2);
    font-size: 2rem;
    line-height: 1;
}

/* FAQ: intro left, questions right ----------------------------------------- */
body.wod-v5 .hg-faq {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    gap: 64px;
    align-items: start;
}

body.wod-v5 .hg-faq__intro {
    position: sticky;
    top: 110px;
}

body.wod-v5 .hg-faq .hg-title {
    margin-bottom: 20px;
}

body.wod-v5 .home-guide .hg-faq__more a {
    font-weight: 700;
    color: var(--h-text);
    text-decoration: underline;
    text-decoration-color: var(--h-yellow);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

body.wod-v5 .hg-faq__list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

body.wod-v5 .hg-faq__item {
    border: 1px solid var(--h-line);
    border-radius: 22px;
    background: var(--h-surface);
    transition: border-color 0.2s ease;
}

body.wod-v5 .hg-faq__item[open] {
    border-color: color-mix(in srgb, var(--h-yellow) 55%, transparent);
}

body.wod-v5 .hg-faq__item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--h-text);
    cursor: pointer;
    list-style: none;
}

body.wod-v5 .hg-faq__item summary::-webkit-details-marker {
    display: none;
}

body.wod-v5 .hg-faq__item summary:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 3px;
    border-radius: 22px;
}

/* Plus that turns into a minus */
body.wod-v5 .hg-faq__icon {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--h-surface-2);
}

body.wod-v5 .hg-faq__icon::before,
body.wod-v5 .hg-faq__icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2.5px;
    margin: -1.25px 0 0 -7px;
    border-radius: 2px;
    background: currentColor;
    color: var(--h-text);
    transition: transform 0.25s ease;
}

body.wod-v5 .hg-faq__icon::after {
    transform: rotate(90deg);
}

body.wod-v5 .hg-faq__item[open] .hg-faq__icon {
    background: var(--h-yellow);
}

body.wod-v5 .hg-faq__item[open] .hg-faq__icon::before,
body.wod-v5 .hg-faq__item[open] .hg-faq__icon::after {
    background: var(--h-ink);
}

body.wod-v5 .hg-faq__item[open] .hg-faq__icon::after {
    transform: rotate(0deg);
}

body.wod-v5 .home-guide .hg-faq__item p {
    padding: 0 26px 24px;
    font-size: 1.15rem;
}

/* The guide ad sits between sections */
body.wod-v5 .home-guide .wod-ad {
    margin: -40px auto 120px;
}

/* Guide on smaller screens */
@media (max-width: 1099.98px) {
    body.wod-v5 .hg-about,
    body.wod-v5 .hg-faq {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    body.wod-v5 .hg-faq__intro {
        position: static;
    }

    body.wod-v5 .hg-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.wod-v5 .hg-step::after {
        display: none;
    }

    body.wod-v5 .hg-cases {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639.98px) {
    body.wod-v5 .home-guide {
        padding: 72px 16px 80px;
    }

    body.wod-v5 .hg-section {
        margin-bottom: 80px;
    }

    body.wod-v5 .hg-title {
        margin-bottom: 28px;
    }

    body.wod-v5 .hg-steps,
    body.wod-v5 .hg-cases {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    body.wod-v5 .hg-step__num {
        margin-bottom: 16px;
        font-size: 3rem;
    }

    body.wod-v5 .hg-case {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 18px;
        align-items: center;
        padding: 20px;
    }

    body.wod-v5 .hg-case__icon {
        grid-row: span 2;
        margin-bottom: 0;
    }

    body.wod-v5 .hg-case h3 {
        margin-bottom: 2px;
    }

    body.wod-v5 .hg-faq__item summary {
        padding: 18px 20px;
        font-size: 1.15rem;
    }

    body.wod-v5 .home-guide .hg-faq__item p {
        padding: 0 20px 20px;
        font-size: 1.05rem;
    }

    body.wod-v5 .home-guide .wod-ad {
        margin: -24px auto 80px;
    }
}

/* ==========================================================================
   SHARED WHEELS (?wheel=...) - the visitor uses someone else's wheel
   ========================================================================== */
body.wod-v5 .shared-wheel-view .quick-picks,
body.wod-v5 .shared-wheel-view .home-eyebrow,
body.wod-v5 .shared-wheel-view .home-lead {
    display: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* nav-menu.css pads the body for the fixed nav below 1024px; the hero already leaves room */
@media (max-width: 1023px) {
    body.wod-v5.has-nav-menu {
        padding-top: 0;
    }
}

/* Tablet: one column, centred */
@media (max-width: 1099.98px) {
    body.wod-v5 {
        --wheel: clamp(320px, calc(100svh - 500px), min(540px, 82vw));
    }

    /* Title + quick picks, then the wheel straight away; the lead text moves below it */
    body.wod-v5 .home-stage {
        display: flex;
        flex-direction: column;
        gap: 0;
        max-width: 720px;
    }

    body.wod-v5 .home-intro {
        display: contents;
    }

    body.wod-v5 .home-eyebrow {
        display: none;
    }

    body.wod-v5 .home-title {
        order: 1;
        text-align: center;
        margin-bottom: 20px;
    }

    body.wod-v5 .quick-picks {
        order: 2;
        margin-bottom: 32px;
    }

    body.wod-v5 .home-wheel {
        order: 3;
        align-self: center;
    }

    body.wod-v5 .home-lead {
        order: 4;
        text-align: center;
        margin: 28px auto 32px;
    }

    body.wod-v5 .home-entries {
        order: 5;
    }

    body.wod-v5 .quick-picks {
        justify-content: center;
    }

    body.wod-v5 .home-panels {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 720px;
    }

    body.wod-v5 .home-panels .home-card.sidebar-left {
        grid-column: 1 / -1;
    }
}

/* Phones */
@media (max-width: 759.98px) {
    body.wod-v5 {
        --wheel: clamp(240px, calc(100svh - 340px), min(92vw, 440px));
        --ring: 12px;
    }

    body.wod-v5 .wod-home {
        padding: 96px 16px 16px;
    }

    body.wod-v5 .home-stage {
        row-gap: 24px;
    }

    body.wod-v5 .home-eyebrow {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    body.wod-v5 .home-title {
        margin-bottom: 14px;
    }

    body.wod-v5 .home-lead {
        margin: 22px auto 24px;
    }

    /* Chips scroll sideways instead of stacking up above the wheel */
    body.wod-v5 .quick-picks {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        margin: 0 -16px 20px;
        padding: 4px 16px 8px;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent);
        mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent);
    }

    body.wod-v5 .quick-picks::-webkit-scrollbar {
        display: none;
    }

    body.wod-v5 .quick-picks__label {
        display: none;
    }

    body.wod-v5 .quick-pick {
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    body.wod-v5 .home-wheel .wheel-pointer {
        right: -10px;
        width: 34px;
        height: 28px;
    }

    body.wod-v5 .home-wheel .spin-button {
        border-width: 4px;
    }

    /* Keep the controls clear of a bottom anchor ad if one is ever turned on */
    body.wod-v5 .home-wheel .wheel-controls {
        margin-top: 22px;
    }

    body.wod-v5 .home-wheel .control-btn::after {
        display: none;
    }

    body.wod-v5 .home-card,
    body.wod-v5 .home-card.sidebar-left,
    body.wod-v5 .home-card.sidebar-right {
        padding: 20px;
        border-radius: 20px;
    }

    body.wod-v5 .home-entries textarea {
        min-height: calc(var(--row) * 5 + var(--pad) * 2);
    }

    body.wod-v5 .home-panels {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes wodPing {
    0% { box-shadow: 0 0 0 0 rgba(47, 210, 138, 0.6); }
    80%, 100% { box-shadow: 0 0 0 10px rgba(47, 210, 138, 0); }
}

@keyframes wodBreathe {
    0%, 100% { opacity: 0.7; transform: scale(0.97); }
    50% { opacity: 1; transform: scale(1.03); }
}

@keyframes wodBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

@keyframes wodPulse {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.45); opacity: 0; }
}

@keyframes wodTick {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(-10deg); }
}

@keyframes wodBump {
    0% { transform: scale(1); }
    40% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@keyframes wodRays {
    to { transform: rotate(360deg); }
}

@keyframes wodWinner {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    body.wod-v5 .home-eyebrow__dot,
    body.wod-v5 .wheel-glow,
    body.wod-v5 .wheel-lights span,
    body.wod-v5 .home-wheel .spin-button::before,
    body.wod-v5 .result-modal .result-content,
    body.wod-v5 .result-modal .result-content::before,
    body.wod-v5 .result-modal .result-image-wrapper,
    body.wod-v5 .result-modal .result-content h2 {
        animation: none;
    }
}

/* ==========================================================================
   TOOL PAGES (body.wod-tool-v5) - Yes or No, A to Z, Team Generator, Emoji,
   Image Wheel, Match Up, Math Quiz, Wheel Choose You.
   Same look as the homepage on the shared tool markup:
   .main > .sidebar-left + .content (.wheel-center) + .sidebar-right, guide below.
   Each tool keeps its own script; only layout and styling change here.
   ========================================================================== */

/* Page shell --------------------------------------------------------------- */
body.wod-tool-v5 .site-main {
    background:
        radial-gradient(44rem 30rem at 85% 0%, rgba(139, 108, 255, 0.13), transparent 70%),
        radial-gradient(40rem 26rem at 5% 0%, rgba(255, 190, 77, 0.16), transparent 70%),
        var(--h-bg);
}

body.wod-tool-v5 .main:not(.wod-home) {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 340px;
    grid-template-areas: "left content right";
    gap: 28px;
    align-items: start;
    max-width: 1440px;
    min-height: 0;
    margin: 0 auto;
    padding: 104px 24px 24px;
}

body.wod-tool-v5 :not(.wod-home) > .wod-ad--top {
    margin: 0 auto;
}

@media (min-width: 760px) {
    /* The top ad sits under the nav; the tool area follows it */
    body.wod-tool-v5 :not(.wod-home) > .wod-ad--top {
        margin-top: 96px;
    }

    body.wod-tool-v5 :not(.wod-home) > .wod-ad--top + .main {
        padding-top: 24px;
    }
}

body.wod-tool-v5 .main:not(.wod-home) .sidebar-left { grid-area: left; }
body.wod-tool-v5 .main:not(.wod-home) .content { grid-area: content; }
body.wod-tool-v5 .main:not(.wod-home) .sidebar-right { grid-area: right; }

/* Side panels: each section becomes its own card */
body.wod-tool-v5 .main:not(.wod-home) .sidebar {
    position: static;
    left: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    overflow: visible;
    transform: none;
    box-shadow: none;
    background: none;
}

body.wod-tool-v5 .main:not(.wod-home) .sidebar-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: auto;
    overflow: visible;
    background: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
}

body.wod-tool-v5 .main:not(.wod-home) .sidebar-card__section {
    --card-accent: var(--h-yellow);
    position: relative;
    flex: none;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--h-line);
    border-radius: 26px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--card-accent) 7%, transparent), transparent 110px),
        var(--h-surface);
    box-shadow: var(--h-shadow);
    color: var(--h-text);
}

body.wod-tool-v5 .main:not(.wod-home) .sidebar-card__section::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent), transparent 80%);
}

body.wod-tool-v5 .main:not(.wod-home) .results-section { --card-accent: #ff9f43; }
body.wod-tool-v5 .main:not(.wod-home) .stats-section { --card-accent: #8b6cff; }
body.wod-tool-v5 .main:not(.wod-home) .settings-section { --card-accent: #3fd8b0; }

/* Hidden helper fields some tools keep in a section */
body.wod-tool-v5 .main:not(.wod-home) .sidebar-card__section:has(> textarea[style*="-9999px"]:only-child) {
    display: none;
}

body.wod-tool-v5 .main:not(.wod-home) .section-header {
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 0;
    border-bottom: 0;
    color: var(--h-text);
}

body.wod-tool-v5 .main:not(.wod-home) .section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: color-mix(in srgb, var(--card-accent) 18%, transparent);
    color: var(--card-accent);
    opacity: 1;
}

body.wod-tool-v5 .main:not(.wod-home) .section-title,
body.wod-tool-v5 .main:not(.wod-home) .section-header h3 {
    flex: 1;
    text-align: left;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--h-text);
}

body.wod-tool-v5 .main:not(.wod-home) .entry-count {
    font-size: 1rem;
    font-weight: 800;
    padding: 5px 14px;
}

/* Inputs and lists inside the cards */
body.wod-tool-v5 .main:not(.wod-home) .sidebar textarea:not([style*="-9999px"]) {
    min-height: 200px;
    padding: 14px 16px;
    border: 1px solid var(--h-line);
    border-radius: 16px;
    background: var(--h-surface-2);
    color: var(--h-text);
    font-family: var(--h-font);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.8;
}

body.wod-tool-v5 .main:not(.wod-home) .sidebar textarea:focus {
    border-color: var(--h-yellow);
    box-shadow: 0 0 0 4px rgba(255, 190, 77, 0.18);
    outline: none;
}

body.wod-tool-v5 .main:not(.wod-home) .no-results {
    padding: 28px 14px;
    border: 2px dashed var(--h-line);
    border-radius: 18px;
    font-size: 1.05rem;
    font-style: normal;
    color: var(--h-muted);
}

body.wod-tool-v5 .main:not(.wod-home) .result-item {
    gap: 12px;
    margin: 0 0 8px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--h-surface-2);
}

body.wod-tool-v5 .main:not(.wod-home) .result-item:first-child {
    background: color-mix(in srgb, var(--card-accent) 14%, transparent);
}

body.wod-tool-v5 .main:not(.wod-home) .result-item .result-number {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 800;
}

body.wod-tool-v5 .main:not(.wod-home) .result-item .result-name {
    font-size: 1.1rem;
    font-weight: 700;
}

body.wod-tool-v5 .main:not(.wod-home) .result-item .result-time {
    font-size: 0.85rem;
    color: var(--h-muted);
}

body.wod-tool-v5 .main:not(.wod-home) .btn-clear {
    padding: 12px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--h-muted);
}

body.wod-tool-v5 .main:not(.wod-home) .btn-clear:hover {
    border-color: var(--card-accent);
    color: var(--h-text);
}

body.wod-tool-v5 .main:not(.wod-home) .stat-item {
    padding: 20px 12px;
    border: 1px solid var(--h-line);
    border-radius: 18px;
    background: var(--h-surface-2);
}

body.wod-tool-v5 .main:not(.wod-home) .stat-value {
    font-size: clamp(2rem, 1.6rem + 1vw, 2.6rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--card-accent);
}

body.wod-tool-v5 .main:not(.wod-home) .stat-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--h-muted);
}

/* Settings blocks (duration, toggles, option buttons) */
body.wod-tool-v5 .main:not(.wod-home) .duration-display,
body.wod-tool-v5 .main:not(.wod-home) .duration-btn,
body.wod-tool-v5 .main:not(.wod-home) .setting-toggle-item {
    border-color: var(--h-line);
    border-radius: 18px;
    background: var(--h-surface-2);
    color: var(--h-text);
}

body.wod-tool-v5 .main:not(.wod-home) .duration-btn:hover {
    border-color: var(--h-yellow);
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-tool-v5 .main:not(.wod-home) .duration-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--h-text);
}

body.wod-tool-v5 .main:not(.wod-home) .duration-unit {
    font-size: 1rem;
    color: var(--h-muted);
}

body.wod-tool-v5 .main:not(.wod-home) .setting-toggle-item.active {
    border-color: var(--card-accent);
    background: color-mix(in srgb, var(--card-accent) 14%, transparent);
}

body.wod-tool-v5 .main:not(.wod-home) .setting-toggle-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--h-text);
}

/* Center column ----------------------------------------------------------- */
body.wod-tool-v5 .main:not(.wod-home) .content {
    min-height: 0;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
}

body.wod-tool-v5 .main:not(.wod-home) .wheel {
    display: block;
}

/* Empty side boxes left over from old vertical ads */
body.wod-tool-v5 .main:not(.wod-home) .ad-ver {
    display: none;
}

body.wod-tool-v5 .main:not(.wod-home) .wheel-center {
    padding: 0;
}

body.wod-tool-v5 .main:not(.wod-home) .wheel-title {
    margin-bottom: 32px;
    text-align: center;
}

body.wod-tool-v5 .main:not(.wod-home) .wheel-title h1 {
    margin: 0 0 12px;
    font-size: clamp(2.4rem, 1.4rem + 3vw, 4.2rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--h-text);
}

body.wod-tool-v5 .main:not(.wod-home) .wheel-title p {
    margin: 0;
    font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem);
    color: var(--h-muted) !important;
}

/* Wheels: bigger, round with a dark rim and a soft shadow (canvas drawn by each tool) */
body.wod-tool-v5 .main:not(.wod-home) .wheel-wrapper {
    width: min(520px, 100%);
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto;
}

body.wod-tool-v5 .main:not(.wod-home) .wheel-wrapper canvas {
    border-radius: 50%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 6px var(--h-ink);
}

body.wod-tool-v5 .main:not(.wod-home) .wheel-wrapper .wheel-pointer {
    top: 50%;
    right: -14px;
    width: 46px;
    height: 38px;
    border: 0;
    z-index: 5;
    transform: translateY(-50%) rotate(var(--tilt, 0deg));
    transform-origin: 100% 50%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

body.wod-tool-v5 .main:not(.wod-home) .wheel-wrapper .wheel-pointer::after {
    content: '';
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    transform: none;
    background: linear-gradient(90deg, var(--h-yellow), var(--h-coral));
    clip-path: polygon(0 50%, 100% 0, 82% 50%, 100% 100%);
}

body.wod-tool-v5 .main:not(.wod-home) .spin-button {
    background: radial-gradient(circle at 35% 30%, #ffe2a6, var(--h-yellow) 55%, #f59e2b);
    color: var(--h-ink);
    border: 5px solid var(--h-ink);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(255, 190, 77, 0.35);
}

body.wod-tool-v5 .main:not(.wod-home) .wheel-wrapper .spin-button {
    width: clamp(68px, 19%, 108px);
    height: clamp(68px, 19%, 108px);
}

body.wod-tool-v5 .main:not(.wod-home) .spin-button .spin-text {
    font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.25rem);
    font-weight: 800;
    letter-spacing: 0.08em;
}

body.wod-tool-v5 .main:not(.wod-home) .wheel-controls {
    margin-top: 28px;
    gap: 14px;
}

body.wod-tool-v5 .main:not(.wod-home) .control-btn {
    width: 52px;
    height: 52px;
    border: 1px solid var(--h-line);
    background: var(--h-surface);
    color: var(--h-text);
    box-shadow: none;
}

body.wod-tool-v5 .main:not(.wod-home) .control-btn:hover {
    border-color: var(--h-yellow);
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-tool-v5 .main:not(.wod-home) .control-btn::after {
    font-size: 13px;
    background: var(--h-surface);
    color: var(--h-text);
    border-color: var(--h-line);
}

/* The settings button in the nav opened these panels on phones; they're on the page now */
body.wod-tool-v5 .panel-toggles,
body.wod-tool-v5 .mobile-toggles,
body.wod-tool-v5 .sidebar-overlay {
    display: none !important;
}

/* Below the tool */
body.wod-tool-v5 :not(.wod-home) > .wod-ad--mid {
    margin: 48px auto 0;
}

/* Guide (shared .guide-* markup) - same look as the homepage guide -------- */
body.wod-tool-v5 .tool-guide {
    padding: 110px 24px 120px;
    background: var(--h-bg);
}

body.wod-tool-v5 .guide-container {
    max-width: 1280px;
    padding: 0;
}

body.wod-tool-v5 .guide-section {
    margin-bottom: 110px;
}

body.wod-tool-v5 .guide-section:last-child {
    margin-bottom: 0;
}

body.wod-tool-v5 .guide-section h2 {
    margin: 0 0 32px;
    font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4.2rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.035em;
    text-align: left;
    color: var(--h-text);
}

body.wod-tool-v5 .guide-section > p {
    max-width: 52ch;
    margin: 0 0 36px;
    font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem);
    line-height: 1.55;
    text-align: left;
    color: var(--h-muted);
}

body.wod-tool-v5 .guide-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

body.wod-tool-v5 .guide-feature {
    --accent: #ffbe4d;
    padding: 28px;
    text-align: left;
    border: 1px solid var(--h-line);
    border-radius: 26px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
        var(--h-surface);
}

body.wod-tool-v5 .guide-feature:nth-child(2) { --accent: #8b6cff; }
body.wod-tool-v5 .guide-feature:nth-child(3) { --accent: #3fd8b0; }

body.wod-tool-v5 .feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 0 20px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--accent);
}

body.wod-tool-v5 .guide-feature h4,
body.wod-tool-v5 .step-content h4 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--h-text);
}

body.wod-tool-v5 .guide-feature p,
body.wod-tool-v5 .step-content p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--h-muted);
}

body.wod-tool-v5 .step-content strong {
    color: var(--h-text);
}

body.wod-tool-v5 .guide-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    max-width: none;
    margin: 0;
}

body.wod-tool-v5 .guide-step {
    display: block;
    padding: 28px 26px 30px;
    border: 1px solid var(--h-line);
    border-radius: 26px;
    background: var(--h-surface);
}

body.wod-tool-v5 .step-number {
    display: block;
    width: auto;
    height: auto;
    margin: 0 0 24px;
    padding: 0;
    border-radius: 0;
    background: none;
    font-size: 3.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 2px var(--h-yellow);
    box-shadow: none;
}

/* 01, 02 ... like the homepage */
body.wod-tool-v5 .step-number::before {
    content: '0';
}

body.wod-tool-v5 .usecase-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

body.wod-tool-v5 .usecase-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    border: 1px solid var(--h-line);
    border-radius: 24px;
    background: var(--h-surface);
}

body.wod-tool-v5 .usecase-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--h-surface-2);
    font-size: 1.9rem;
}

body.wod-tool-v5 .usecase-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--h-text);
}

body.wod-tool-v5 .faq-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 900px;
    margin: 0;
}

body.wod-tool-v5 .faq-item {
    border: 1px solid var(--h-line);
    border-radius: 22px;
    background: var(--h-surface);
}

body.wod-tool-v5 .faq-item.active {
    border-color: color-mix(in srgb, var(--h-yellow) 55%, transparent);
}

body.wod-tool-v5 .faq-question {
    padding: 22px 26px;
    font-family: var(--h-font);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--h-text);
}

body.wod-tool-v5 .faq-answer p {
    padding: 0 26px 24px;
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--h-muted);
}

body.wod-tool-v5 .tool-guide .wod-ad {
    margin: -30px auto 110px;
}

/* Tool pages: tablets and phones ------------------------------------------ */
@media (max-width: 1199.98px) {
    /* One column: the tool first, then its inputs/settings, then results */
    body.wod-tool-v5 .main:not(.wod-home) {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "content"
            "right"
            "left";
        max-width: 760px;
    }

    body.wod-tool-v5 .main:not(.wod-home) .sidebar,
    body.wod-tool-v5 .main:not(.wod-home) .sidebar-left,
    body.wod-tool-v5 .main:not(.wod-home) .sidebar-right {
        display: flex;
        position: static;
        width: auto;
        padding: 0;
        transform: none;
    }

    body.wod-tool-v5 .guide-features,
    body.wod-tool-v5 .usecase-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.wod-tool-v5 .guide-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    body.wod-tool-v5.has-nav-menu {
        padding-top: 0;
    }
}

@media (max-width: 759.98px) {
    body.wod-tool-v5 .main:not(.wod-home) {
        gap: 20px;
        padding: 96px 16px 16px;
    }

    body.wod-tool-v5 .main:not(.wod-home) .wheel-wrapper {
        width: min(92vw, 440px);
    }

    body.wod-tool-v5 .main:not(.wod-home) .wheel-wrapper .wheel-pointer {
        right: -8px;
        width: 34px;
        height: 28px;
    }

    body.wod-tool-v5 .main:not(.wod-home) .control-btn::after {
        display: none;
    }

    body.wod-tool-v5 .main:not(.wod-home) .sidebar-card__section {
        padding: 20px;
        border-radius: 22px;
    }

    body.wod-tool-v5 .tool-guide {
        padding: 72px 16px 80px;
    }

    body.wod-tool-v5 .guide-section {
        margin-bottom: 80px;
    }

    body.wod-tool-v5 .guide-features,
    body.wod-tool-v5 .guide-steps,
    body.wod-tool-v5 .usecase-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    body.wod-tool-v5 .step-number {
        margin-bottom: 16px;
        font-size: 3rem;
    }

    body.wod-tool-v5 .faq-question {
        padding: 18px 20px;
        font-size: 1.15rem;
    }

    body.wod-tool-v5 .faq-answer p {
        padding: 0 20px 20px;
        font-size: 1.05rem;
    }

    body.wod-tool-v5 .tool-guide .wod-ad {
        margin: -24px auto 80px;
    }
}

/* ==========================================================================
   WHEEL TOOLS (body.wod-tool-wheel) - Yes or No, A to Z, Image Wheel,
   Wheel Choose You. Homepage layout: title + inputs left, wheel right,
   results + statistics in a row below. Same ring, glow and lights
   (wod_wheel_decor()); tools-v5.js adds .is-spinning so the lights chase.
   ========================================================================== */

/* The wheel column's wrappers step aside so the title and the wheel can sit in
   different grid cells (not while the wheel is in fullscreen) */
body.wod-tool-wheel .main .content,
body.wod-tool-wheel .main .wheel,
body.wod-tool-wheel .main .wheel-center:not(.fullscreen-mode) {
    display: contents;
}

body.wod-tool-wheel .main {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title wheel"
        "right wheel"
        "left  left";
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(32px, 5vw, 80px);
    row-gap: 32px;
    max-width: 1280px;
}

body.wod-tool-wheel .main .wheel-title {
    grid-area: title;
    margin: 0;
    padding-top: 12px;
    text-align: left;
}

body.wod-tool-wheel .main .wheel-title h1 {
    margin: 0 0 18px;
    font-size: clamp(2.9rem, 1.4rem + 4.6vw, 5.4rem);
    line-height: 0.95;
}

body.wod-tool-wheel .main .wheel-title p {
    max-width: 34ch;
    font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
    line-height: 1.5;
}

/* Wheel + its buttons share the right-hand cell; the buttons sit under the wheel */
body.wod-tool-wheel .main .wheel-center:not(.fullscreen-mode) .wheel-wrapper,
body.wod-tool-wheel .main .wheel-center:not(.fullscreen-mode) .wheel-controls {
    grid-area: wheel;
    align-self: start;
    justify-self: center;
}

body.wod-tool-wheel .main .wheel-center:not(.fullscreen-mode) .wheel-controls {
    margin-top: calc(var(--wheel) + 28px);
}

body.wod-tool-wheel .main .wheel-wrapper {
    position: relative;
    width: var(--wheel);
    height: var(--wheel);
    aspect-ratio: auto;
    margin: 0;
}

/* The canvas leaves a 20px margin around the wheel; the ring and lights sit in it */
body.wod-tool-wheel .main .wheel-wrapper .canvas-container {
    position: absolute;
    inset: 0;
    z-index: 2;
}

body.wod-tool-wheel .main .wheel-wrapper canvas {
    border-radius: 0;
    box-shadow: none;
}

body.wod-tool-wheel .main .wheel-wrapper .wheel-pointer {
    right: -18px;
    transform-origin: 100% 50%;
}

body.wod-tool-wheel .main .wheel-wrapper .spin-button {
    width: clamp(68px, 19%, 112px);
    height: clamp(68px, 19%, 112px);
    z-index: 6;
}

body.wod-tool-wheel .main .wheel-wrapper .spin-button::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 3px solid var(--h-yellow);
    animation: wodPulse 2.2s ease-out infinite;
    pointer-events: none;
}

body.wod-tool-wheel .main .wheel-wrapper .spin-button:disabled::before,
body.wod-tool-wheel .main.is-spinning .wheel-wrapper .spin-button::before {
    animation: none;
    opacity: 0;
}

/* Lights chase while the wheel spins (the pointer flicks per slice: wheel-motion.js) */
body.wod-tool-wheel .main.is-spinning .wheel-lights span {
    animation-duration: 0.6s;
    animation-delay: calc(var(--i) * -0.025s);
}

/* Results + statistics: side by side under the tool */
body.wod-tool-wheel .main .sidebar-left .sidebar-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
}

/* Tablets and phones: title, wheel, buttons, inputs, results */
@media (max-width: 1099.98px) {
    body.wod-tool-wheel .main {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "title"
            "wheel"
            "controls"
            "right"
            "left";
        grid-template-rows: none;
        row-gap: 24px;
        max-width: 720px;
    }

    body.wod-tool-wheel .main .wheel-title {
        padding-top: 0;
        text-align: center;
    }

    body.wod-tool-wheel .main .wheel-title p {
        margin: 0 auto;
    }

    body.wod-tool-wheel .main .wheel-center:not(.fullscreen-mode) .wheel-controls {
        grid-area: controls;
        margin-top: 0;
    }
}

@media (max-width: 759.98px) {
    body.wod-tool-wheel .main .wheel-title h1 {
        margin-bottom: 12px;
    }

    body.wod-tool-wheel .main .wheel-wrapper {
        width: var(--wheel);
    }

    body.wod-tool-wheel .main .wheel-wrapper .wheel-pointer {
        right: -10px;
    }

    body.wod-tool-wheel .main .sidebar-left .sidebar-card {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.wod-tool-wheel .main .wheel-wrapper .spin-button::before {
        animation: none;
    }
}

/* Wheel Choose You: "Eligible to win" list in the page colours */
body.wod-tool-v5 .main:not(.wod-home) .wcy-eligibility-header {
    margin: 18px 0 10px;
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-eligibility-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--h-muted);
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-bulk-actions {
    gap: 6px;
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-bulk-actions button {
    padding: 5px 14px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    font-family: var(--h-font);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--h-text);
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-bulk-actions button:hover {
    border-color: var(--h-yellow);
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-eligibility-list {
    gap: 6px;
    max-height: 260px;
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-entry-item {
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--h-line);
    border-radius: 14px;
    background: var(--h-surface-2);
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-entry-item:hover {
    border-color: var(--h-yellow);
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-entry-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--h-yellow);
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-entry-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--h-text);
}

body.wod-tool-v5 .main:not(.wod-home) .wcy-eligibility-empty {
    font-size: 1rem;
    color: var(--h-muted);
}

/* ==========================================================================
   HOMEPAGE: CUSTOM ENTRIES - "or" divider, button, entries dialog
   (#optionsInput sits in the dialog; spinner-wheel.js reads it as before)
   ========================================================================== */
body.wod-v5 .home-entries,
body.wod-v5 .home-entries.sidebar-right {
    position: static;
    left: auto;
    width: auto;
    max-width: 580px;
    max-height: none;
    padding: 0;
    overflow: visible;
    transform: none;
    box-shadow: none;
}

body.wod-v5 .home-or {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 22px;
}

body.wod-v5 .home-or::before,
body.wod-v5 .home-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--h-line);
}

body.wod-v5 .home-or span {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--h-muted);
}

body.wod-v5 .custom-entries {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 18px 20px;
    border: 1px solid var(--h-line);
    border-radius: 24px;
    background:
        linear-gradient(100deg, color-mix(in srgb, var(--h-yellow) 12%, transparent), transparent 70%),
        var(--h-surface);
    box-shadow: var(--h-shadow);
    color: var(--h-text);
    font-family: var(--h-font);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.wod-v5 .custom-entries:hover {
    transform: translateY(-2px);
    border-color: var(--h-yellow);
    box-shadow: 0 14px 34px rgba(255, 190, 77, 0.2);
}

body.wod-v5 .custom-entries:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 3px;
}

body.wod-v5 .custom-entries__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: 17px;
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .custom-entries__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

body.wod-v5 .custom-entries__title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

body.wod-v5 .custom-entries__preview {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 500;
    color: var(--h-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.wod-v5 .custom-entries__count {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--h-surface-2);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--h-muted);
    white-space: nowrap;
}

body.wod-v5 .custom-entries__count b {
    font-weight: 800;
    color: var(--h-text);
}

/* Dialog ------------------------------------------------------------------- */
body.wod-v5 .entries-modal {
    width: min(640px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100svh - 32px);
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: var(--h-text);
}

body.wod-v5 .entries-modal::backdrop {
    background: rgba(8, 6, 14, 0.62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* No page scrolling behind the dialog */
body.wod-v5:has(.entries-modal[open]) {
    overflow: hidden;
}

body.wod-v5 .entries-modal[open] .entries-modal__box {
    animation: wodModalIn 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

body.wod-v5 .entries-modal__box {
    position: relative;
    padding: 28px;
    overflow: hidden;
    border: 1px solid var(--h-line);
    border-radius: 28px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--h-yellow) 8%, transparent), transparent 140px),
        var(--h-surface);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

body.wod-v5 .entries-modal__box::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--h-yellow), transparent 80%);
}

body.wod-v5 .entries-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

body.wod-v5 .entries-modal__title {
    margin: 0 0 4px;
    font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--h-text);
}

body.wod-v5 .entries-modal__hint {
    margin: 0;
    font-size: 1rem;
    color: var(--h-muted) !important;
}

body.wod-v5 .entries-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border: 1px solid var(--h-line);
    border-radius: 50%;
    background: var(--h-surface-2);
    color: var(--h-text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

body.wod-v5 .entries-modal__close:hover {
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .entries-modal .choices-editor textarea {
    min-height: calc(var(--row) * 4 + var(--pad) * 2);
    height: min(calc(var(--row) * 8 + var(--pad) * 2), calc(100svh - 300px));
}

body.wod-v5 .entries-modal__foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

body.wod-v5 .entries-modal__spacer {
    flex: 1;
}

body.wod-v5 .entries-modal__btn {
    padding: 13px 22px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: var(--h-surface-2);
    color: var(--h-text);
    font-family: var(--h-font);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

body.wod-v5 .entries-modal__btn:hover {
    border-color: var(--h-yellow);
}

body.wod-v5 .entries-modal__btn--ghost {
    background: transparent;
    color: var(--h-muted);
}

body.wod-v5 .entries-modal__btn--spin {
    border-color: var(--h-yellow);
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .entries-modal__btn--spin:hover {
    transform: translateY(-1px);
}

body.wod-v5 .entries-modal__btn:focus-visible,
body.wod-v5 .entries-modal__close:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 3px;
}

@keyframes wodModalIn {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

/* Tablet: the "or" + button follow the quick picks, above the wheel */
@media (max-width: 1099.98px) {
    body.wod-v5 .home-entries,
    body.wod-v5 .home-entries.sidebar-right {
        order: 2;
        width: 100%;
        margin: 0 auto 32px;
    }

    body.wod-v5 .quick-picks {
        margin-bottom: 22px;
    }
}

/* Phones: the dialog becomes a bottom sheet */
@media (max-width: 759.98px) {
    /* The stage already puts 24px between blocks on phones */
    body.wod-v5 .home-entries,
    body.wod-v5 .home-entries.sidebar-right {
        margin-bottom: 8px;
    }

    body.wod-v5 .quick-picks {
        margin-bottom: 0;
    }

    body.wod-v5 .custom-entries__count-label {
        display: none;
    }

    body.wod-v5 .home-or {
        margin-bottom: 16px;
    }

    body.wod-v5 .custom-entries {
        gap: 14px;
        padding: 14px 16px;
        border-radius: 20px;
    }

    body.wod-v5 .custom-entries__icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    body.wod-v5 .custom-entries__title {
        font-size: 1.2rem;
    }

    body.wod-v5 .custom-entries__count {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    body.wod-v5 .entries-modal {
        width: 100vw;
        max-height: 94svh;
        margin: auto 0 0;
    }

    body.wod-v5 .entries-modal__box {
        padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
        border-radius: 26px 26px 0 0;
        border-bottom: 0;
    }

    body.wod-v5 .entries-modal[open] .entries-modal__box {
        animation: wodSheetIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
    }

    body.wod-v5 .entries-modal .choices-editor textarea {
        height: min(calc(var(--row) * 7 + var(--pad) * 2), calc(100svh - 280px));
    }

    body.wod-v5 .entries-modal__foot {
        flex-wrap: wrap;
    }

    body.wod-v5 .entries-modal__btn--spin {
        flex: 1 1 100%;
        order: -1;
        padding: 15px 22px;
    }

    body.wod-v5 .entries-modal__spacer {
        display: none;
    }

    body.wod-v5 .entries-modal__btn:not(.entries-modal__btn--spin) {
        flex: 1;
    }
}

@keyframes wodSheetIn {
    from { transform: translateY(100%); }
    to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    body.wod-v5 .entries-modal[open] .entries-modal__box {
        animation: none;
    }
}

/* ==========================================================================
   IMAGE WHEEL (html[data-wheel-mode="images"] body.wod-v5) - "Custom images" button + dialog,
   settings, results with thumbnails, statistics with the winning image.
   image-wheel.js renders the tiles and results; tools-v5.js runs the dialog.
   ========================================================================== */

/* Button: a small card - icon, title, count; a row of square thumbnails below */
html[data-wheel-mode="images"] body.wod-v5 .custom-entries {
    flex-wrap: wrap;
    row-gap: 16px;
    padding: 20px;
}

html[data-wheel-mode="images"] body.wod-v5 .iw-thumbs {
    display: grid;
    flex: 0 0 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

html[data-wheel-mode="images"] body.wod-v5 .iw-thumbs:empty {
    display: none;
}

html[data-wheel-mode="images"] body.wod-v5 .iw-thumbs img,
html[data-wheel-mode="images"] body.wod-v5 .iw-thumbs__more {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    aspect-ratio: 1;
    border-radius: 14px;
}

html[data-wheel-mode="images"] body.wod-v5 .iw-thumbs img {
    object-fit: cover;
    box-shadow: inset 0 0 0 1px var(--h-line);
}

html[data-wheel-mode="images"] body.wod-v5 .iw-thumbs__more {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed color-mix(in srgb, var(--h-yellow) 55%, transparent);
    color: var(--h-text);
    font-size: 1.2rem;
    font-weight: 800;
    transition: background 0.2s ease, border-color 0.2s ease;
}

html[data-wheel-mode="images"] body.wod-v5 .custom-entries:hover .iw-thumbs__more {
    border-color: var(--h-yellow);
    background: color-mix(in srgb, var(--h-yellow) 14%, transparent);
}

/* Dialog: a grid of image tiles */
html[data-wheel-mode="images"] body.wod-v5 .entries-modal {
    width: min(720px, calc(100vw - 32px));
}

body.wod-v5 .iw-panel .image-entries-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    gap: 12px;
    max-height: min(44svh, 400px);
    margin: 0;
    padding: 2px;
    overflow-y: auto;
    border: 0;
    background: none;
    scrollbar-width: thin;
    scrollbar-color: var(--h-yellow) transparent;
}

body.wod-v5 .iw-panel:not(.has-images) .image-entries-list,
body.wod-v5 .iw-panel .entries-empty {
    display: none !important;
}

body.wod-v5 .iw-panel .image-entry-item {
    position: relative;
    display: block;
    aspect-ratio: 1;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--h-line);
    border-radius: 18px;
    background: var(--h-surface-2);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.wod-v5 .iw-panel .image-entry-item:hover {
    transform: translateY(-3px);
    border-color: var(--h-yellow);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

body.wod-v5 .iw-panel .image-entry-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
}

body.wod-v5 .iw-panel .image-entry-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

body.wod-v5 .iw-panel .image-entry-name {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 22px 10px 8px;
    overflow: hidden;
    background: linear-gradient(180deg, transparent, rgba(8, 6, 14, 0.78));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.wod-v5 .iw-panel .image-entry-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(8, 6, 14, 0.72);
    color: #fff;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
}

body.wod-v5 .iw-panel .image-entry-item:hover .image-entry-remove,
body.wod-v5 .iw-panel .image-entry-remove:focus-visible {
    opacity: 1;
}

body.wod-v5 .iw-panel .image-entry-remove:hover {
    background: var(--h-coral);
}

/* Touch screens have no hover: always show the remove button */
@media (hover: none) {
    body.wod-v5 .iw-panel .image-entry-remove {
        opacity: 1;
    }
}

body.wod-v5 .iw-panel .image-entry-item.is-sample::before {
    content: 'Sample';
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(8, 6, 14, 0.62);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Drop zone: big while the wheel is empty, a slim "add more" bar once it has images */
body.wod-v5 .iw-panel .add-image-zone {
    margin: 16px 0 0;
    padding: 0;
    border: 0;
    background: none;
}

body.wod-v5 .iw-panel .add-image-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 16px 20px;
    border: 2px dashed color-mix(in srgb, var(--h-yellow) 55%, transparent);
    border-radius: 20px;
    background: color-mix(in srgb, var(--h-yellow) 6%, transparent);
    color: var(--h-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

body.wod-v5 .iw-panel .add-image-btn:hover,
body.wod-v5 .iw-panel .add-image-zone.dragover .add-image-btn {
    border-color: var(--h-yellow);
    background: color-mix(in srgb, var(--h-yellow) 14%, transparent);
}

body.wod-v5 .iw-panel .add-image-zone.dragover .add-image-btn {
    border-style: solid;
    transform: scale(1.01);
}

body.wod-v5 .iw-panel .add-image-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .iw-panel .add-image-btn__icon svg {
    color: var(--h-ink);
}

/* The dialog box takes focus on open (no ring on the close button) */
body.wod-v5 .entries-modal__box:focus {
    outline: none;
}

body.wod-v5 .iw-panel .add-image-btn__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.wod-v5 .iw-panel .add-image-btn__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--h-text);
}

body.wod-v5 .iw-panel .add-image-btn__sub {
    font-size: 0.98rem;
    color: var(--h-muted);
}

body.wod-v5 .iw-panel .add-image-btn__sub u {
    font-weight: 700;
    color: var(--h-text);
    text-decoration-color: var(--h-yellow);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

body.wod-v5 .iw-panel .add-image-btn__title--more,
body.wod-v5 .iw-panel.has-images .add-image-btn__title--empty {
    display: none;
}

body.wod-v5 .iw-panel.has-images .add-image-btn__title--more {
    display: block;
}

body.wod-v5 .iw-panel:not(.has-images) .add-image-btn {
    flex-direction: column;
    justify-content: center;
    min-height: 260px;
    padding: 36px 24px;
    text-align: center;
}

body.wod-v5 .iw-panel:not(.has-images) .add-image-btn__icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
}

body.wod-v5 .iw-panel:not(.has-images) .add-image-btn__title {
    font-size: 1.4rem;
}

body.wod-v5 .iw-panel .add-image-hint {
    margin: 10px 2px 0;
    font-size: 0.9rem;
    color: var(--h-muted);
}

body.wod-v5 .iw-panel:not(.has-images) .add-image-hint {
    text-align: center;
}

/* Rename box opened from a tile shows above the dialog */
html[data-wheel-mode="images"] body.wod-v5 .entries-modal .edit-label-overlay {
    z-index: 5;
}

/* Settings: the winner message field */
body.wod-v5 .home-setting--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

html[data-wheel-mode="images"] body.wod-v5 .main .winning-label-input {
    width: 100%;
    margin: 0;
    padding: 13px 16px;
    border: 1px solid var(--h-line);
    border-radius: 14px;
    background: var(--h-surface-2);
    color: var(--h-text);
    font-family: var(--h-font);
    font-size: 1.05rem;
    font-weight: 600;
}

html[data-wheel-mode="images"] body.wod-v5 .main .winning-label-input:focus {
    border-color: var(--h-yellow);
    box-shadow: 0 0 0 4px rgba(255, 190, 77, 0.18);
    outline: none;
}

/* Results: thumbnail rows, newest first */
html[data-wheel-mode="images"] body.wod-v5 .main .results-section .section-header .btn-clear {
    width: auto;
    margin: 0 0 0 auto;
    padding: 7px 16px;
    font-size: 0.95rem;
}

html[data-wheel-mode="images"] body.wod-v5 .main .results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    margin: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--h-yellow) transparent;
}

html[data-wheel-mode="images"] body.wod-v5 .main .results-list .result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 10px 14px 10px 10px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: var(--h-surface-2);
}

html[data-wheel-mode="images"] body.wod-v5 .main .results-list .result-item:first-child {
    border-color: color-mix(in srgb, var(--h-yellow) 45%, transparent);
    background: color-mix(in srgb, var(--h-yellow) 13%, transparent);
}

html[data-wheel-mode="images"] body.wod-v5 .main .results-list .result-item:first-child::after {
    content: 'Latest';
    flex-shrink: 0;
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--h-yellow);
    color: var(--h-ink);
    font-size: 0.8rem;
    font-weight: 800;
}

html[data-wheel-mode="images"] body.wod-v5 .main .result-thumb {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    overflow: hidden;
    border-radius: 14px;
}

html[data-wheel-mode="images"] body.wod-v5 .main .result-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

html[data-wheel-mode="images"] body.wod-v5 .main .result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

html[data-wheel-mode="images"] body.wod-v5 .main .result-info .result-name {
    overflow: hidden;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--h-text);
    white-space: nowrap;
    text-overflow: ellipsis;
}

html[data-wheel-mode="images"] body.wod-v5 .main .result-info .result-time {
    font-size: 0.85rem;
    color: var(--h-muted);
}

/* Statistics: big count + the winning image */
/* Last winner: the winning picture beside its name (fits the homepage stats card) */
html[data-wheel-mode="images"] body.wod-v5 .main .stat-item--winner .stat-value {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    max-width: 100%;
    font-size: 1.4rem;
    line-height: 1.2;
}

html[data-wheel-mode="images"] body.wod-v5 .main .stat-winner-img {
    flex-shrink: 0;
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 0 0 3px var(--h-surface), 0 0 0 5px var(--card-accent);
}

html[data-wheel-mode="images"] body.wod-v5 .home-panels #lastWinner .stat-winner-name {
    min-width: 0;
    padding: 0 !important;
    overflow: hidden;
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    color: var(--h-text) !important;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Phones */
@media (max-width: 759.98px) {
    html[data-wheel-mode="images"] body.wod-v5 .iw-thumbs {
        gap: 6px;
    }

    html[data-wheel-mode="images"] body.wod-v5 .iw-thumbs img,
    html[data-wheel-mode="images"] body.wod-v5 .iw-thumbs__more {
        border-radius: 10px;
    }

    html[data-wheel-mode="images"] body.wod-v5 .entries-modal {
        width: 100vw;
    }

    body.wod-v5 .iw-panel .image-entries-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        max-height: 40svh;
    }

    body.wod-v5 .iw-panel:not(.has-images) .add-image-btn {
        min-height: 200px;
    }

}

/* ==========================================================================
   ENTRIES DIALOG: Text / Images tabs (homepage + Image Wheel).
   Text wheels spin on the homepage, image wheels on the Image Wheel page;
   the tabs hand over between the two (home-v5.js / tools-v5.js).
   ========================================================================== */
body.wod-v5 .entries-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 18px;
    padding: 4px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: var(--h-surface-2);
}

body.wod-v5 .entries-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--h-muted);
    font-family: var(--h-font);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

body.wod-v5 .entries-tab:hover {
    color: var(--h-text);
}

body.wod-v5 .entries-tab.is-active {
    background: var(--h-yellow);
    color: var(--h-ink);
    cursor: default;
}

body.wod-v5 .entries-tab:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 2px;
}

body.wod-v5 .entries-panel[hidden],
body.wod-v5 .entries-modal__foot[hidden] {
    display: none;
}

/* Text or picture wheel (<html data-wheel-mode>, template-parts/wheel-home.php):
   parts marked for one mode are hidden in the other */
html[data-wheel-mode="images"] body.wod-v5 .wheel-mode-text,
html:not([data-wheel-mode="images"]) body.wod-v5 .wheel-mode-images {
    display: none !important;
}

/* Picture mode keeps the custom entries button as a card with a row of thumbnails;
   text mode has no winning image in the result pop-up */
body.wod-v5 .result-image-wrapper:empty {
    display: none;
}

/* Fullscreen wheel: .site-main has `contain: layout` (functions.php critical CSS), which
   pins position:fixed children to it instead of the screen - so the fullscreen wheel
   landed where the page was scrolled. Drop it while fullscreen is on, and hide the header. */
body.wheel-fullscreen-active .site-main {
    contain: none;
}

body.wheel-fullscreen-active .nav-v5,
body.wheel-fullscreen-active .nav-v5__burger {
    display: none !important;
}

/* ==========================================================================
   MATCH UP (templates/match-up.php, .wod-matchup) - homepage layout around a
   slot machine: lit sign, bulbs, two reels behind glass, SPIN button, lever.
   match-up-wheel.js spins (.spinning / .landed / .winner on the slots);
   match-up-v5.js adds .is-spinning / .is-matched on .wod-matchup and pulls the lever.
   ========================================================================== */
body.wod-v5 .wod-matchup {
    --mu-ink: #120d22;
    --mu-gold: #ffbe4d;
}

/* Machine ------------------------------------------------------------------ */
body.wod-v5 .wod-matchup .home-wheel {
    align-self: start;
}

body.wod-v5 .wod-matchup .mu-machine {
    position: relative;
    width: min(620px, 48vw);
    margin: 0 auto;
    padding-right: 54px;
}

/* Lit sign on top */
body.wod-v5 .wod-matchup .mu-sign {
    position: relative;
    z-index: 2;
    margin: 0 56px -18px;
    padding: 14px 18px 16px;
    border: 3px solid var(--mu-gold);
    border-radius: 24px 24px 14px 14px;
    background: radial-gradient(120% 140% at 50% 0%, #4a2f86, #1c1236 70%);
    box-shadow:
        0 0 0 5px var(--mu-ink),
        0 0 34px rgba(255, 190, 77, 0.45),
        inset 0 0 20px rgba(255, 190, 77, 0.25);
    text-align: center;
}

body.wod-v5 .wod-matchup .mu-sign__text {
    display: block;
    font-size: clamp(1.4rem, 0.9rem + 1.6vw, 2.3rem);
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1.1;
    color: #ffe9b8;
    text-shadow: 0 0 8px rgba(255, 190, 77, 0.95), 0 0 24px rgba(255, 140, 60, 0.7);
    white-space: nowrap;
}

body.wod-v5 .wod-matchup.is-spinning .mu-sign__text {
    animation: muFlicker 0.9s steps(2) infinite;
}

body.wod-v5 .wod-matchup.is-matched .mu-sign {
    border-color: #fff4d6;
    box-shadow:
        0 0 0 5px var(--mu-ink),
        0 0 60px rgba(255, 190, 77, 0.85),
        inset 0 0 26px rgba(255, 190, 77, 0.45);
}

body.wod-v5 .wod-matchup.is-matched .mu-sign__text {
    animation: muPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #fff;
}

/* Cabinet */
body.wod-v5 .wod-matchup .mu-cabinet {
    position: relative;
    padding: 34px 26px 24px;
    border-radius: 38px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 40%),
        linear-gradient(165deg, #5b3aa8, #2c1c5c 55%, #1c1238);
    box-shadow:
        0 0 0 4px var(--mu-gold),
        0 0 0 9px var(--mu-ink),
        0 34px 70px rgba(0, 0, 0, 0.45),
        inset 0 -10px 0 rgba(0, 0, 0, 0.25);
}

/* Bulbs above and below the reels */
body.wod-v5 .wod-matchup .mu-bulbs {
    display: flex;
    justify-content: space-between;
    margin: 0 8px 18px;
}

body.wod-v5 .wod-matchup .mu-bulbs--bottom {
    margin: 18px 8px 0;
}

body.wod-v5 .wod-matchup .mu-bulbs span {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff4d6;
    box-shadow: 0 0 6px 2px rgba(255, 190, 77, 0.8);
    animation: wodBlink 1.6s ease-in-out infinite;
}

body.wod-v5 .wod-matchup .mu-bulbs span:nth-child(even) {
    animation-delay: -0.8s;
}

body.wod-v5 .wod-matchup.is-spinning .mu-bulbs span {
    animation-duration: 0.5s;
    animation-delay: calc(var(--i) * -0.045s);
}

body.wod-v5 .wod-matchup.is-matched .mu-bulbs span {
    animation: muFlash 0.22s steps(2) 8;
}

/* Reels window */
body.wod-v5 .wod-matchup .match-up-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 14px;
    border-radius: 26px;
    background: #0c0817;
    box-shadow: inset 0 8px 20px rgba(0, 0, 0, 0.7), 0 0 0 3px rgba(255, 190, 77, 0.35);
}

body.wod-v5 .wod-matchup .match-up-slot {
    width: auto;
    min-width: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transition: none;
}

body.wod-v5 .wod-matchup .match-up-slot.winner {
    animation: none;
}

body.wod-v5 .wod-matchup .slot-header {
    margin: 0 0 10px;
    padding: 0;
    background: none;
    color: rgba(255, 233, 184, 0.75);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-align: center;
}

/* The drum: white in the middle, shaded top and bottom like a curved reel */
body.wod-v5 .wod-matchup .slot-display {
    position: relative;
    height: clamp(150px, 14vw, 196px);
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(180deg, #b9b2cf 0%, #fff 26%, #fff 74%, #b9b2cf 100%);
    box-shadow: 0 0 0 4px var(--mu-ink), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

body.wod-v5 .wod-matchup .slot-display::before,
body.wod-v5 .wod-matchup .slot-display::after {
    content: '';
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 14px;
    height: 22px;
    margin-top: -11px;
    background: var(--h-coral);
    filter: drop-shadow(0 0 4px rgba(255, 107, 90, 0.7));
    pointer-events: none;
}

/* Payline markers on both edges */
body.wod-v5 .wod-matchup .slot-display::before {
    left: 0;
    right: auto;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

body.wod-v5 .wod-matchup .slot-display::after {
    left: auto;
    right: 0;
    bottom: auto;
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

/* Glass shine over the reel */
body.wod-v5 .wod-matchup .slot-reel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 100%;
    transform: none !important;
}

body.wod-v5 .wod-matchup .slot-reel::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.55), transparent 32%);
    pointer-events: none;
}

body.wod-v5 .wod-matchup .slot-item {
    display: block;
    flex: none;
    width: 100%;
    height: auto;          /* spinner-wheel.css gives it a fixed height with the text at the top */
    min-height: 0;
    max-height: 100%;
    margin: 0;
    padding: 0 18px;
    overflow: hidden;
    color: #15131c !important;
    font-family: var(--h-font);
    font-size: clamp(1.4rem, 0.9rem + 1.5vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

body.wod-v5 .wod-matchup .slot-item.slot-item-image {
    padding: 0;
}

body.wod-v5 .wod-matchup .slot-item.slot-item-image img {
    display: block;
    width: 72%;
    max-width: 150px;
    max-height: none;
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Rolling: each new item drops in from above, blurred */
body.wod-v5 .wod-matchup .match-up-slot.spinning .slot-item {
    animation: muRoll 0.11s linear;
    filter: blur(1.4px);
}

/* Landing: a little overshoot, like a reel clicking into place */
body.wod-v5 .wod-matchup .match-up-slot.landed .slot-item,
body.wod-v5 .wod-matchup .match-up-slot.winner .slot-item {
    animation: muLand 0.5s cubic-bezier(0.34, 1.7, 0.64, 1);
}

body.wod-v5 .wod-matchup .match-up-slot.winner .slot-display {
    box-shadow: 0 0 0 4px var(--mu-ink), 0 0 0 7px var(--mu-gold), 0 0 34px 8px rgba(255, 190, 77, 0.75);
}

/* VS badge */
body.wod-v5 .wod-matchup .match-up-vs {
    /* match-up.css floats it over the reels on small screens; keep it in its column */
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 54px;
    height: 54px;
    margin-top: 26px;
    border: 4px solid var(--mu-ink);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffe2a6, var(--mu-gold) 55%, #f59e2b);
    color: var(--mu-ink);
    font-family: var(--h-font);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

body.wod-v5 .wod-matchup.is-spinning .match-up-vs {
    animation: muWobble 0.3s ease-in-out infinite alternate;
}

/* Big SPIN button on the front of the cabinet */
body.wod-v5 .wod-matchup .mu-cabinet .spin-button {
    position: relative;
    top: auto;
    left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(320px, 76%);
    height: 68px;
    margin: 22px auto 0;
    border: 4px solid var(--mu-ink);
    border-radius: 999px;
    background: radial-gradient(120% 160% at 50% 0%, #ffe2a6, var(--mu-gold) 55%, #f59e2b);
    color: var(--mu-ink);
    box-shadow: 0 8px 0 #9a5a10, 0 14px 28px rgba(0, 0, 0, 0.4);
    transform: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
}

/* No pulsing ring from the round homepage button */
body.wod-v5 .wod-matchup .mu-cabinet .spin-button::before {
    display: none;
}

body.wod-v5 .wod-matchup .mu-cabinet .spin-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #9a5a10, 0 18px 32px rgba(0, 0, 0, 0.45);
}

body.wod-v5 .wod-matchup .mu-cabinet .spin-button:active:not(:disabled) {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #9a5a10, 0 6px 14px rgba(0, 0, 0, 0.4);
}

body.wod-v5 .wod-matchup .mu-cabinet .spin-button:disabled {
    opacity: 1;
    filter: saturate(0.6) brightness(0.9);
    transform: translateY(6px);
    box-shadow: 0 2px 0 #9a5a10, 0 6px 14px rgba(0, 0, 0, 0.4);
    cursor: default;
}

body.wod-v5 .wod-matchup .mu-cabinet .spin-text {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

body.wod-v5 .wod-matchup .mu-cabinet .spin-button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

/* Lever on the right side */
body.wod-v5 .wod-matchup .mu-lever {
    position: absolute;
    top: 30%;
    right: 0;
    width: 52px;
    height: 200px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    perspective: 400px;
}

body.wod-v5 .wod-matchup .mu-lever__base {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 70px;
    border: 4px solid var(--mu-ink);
    border-left: 0;
    border-radius: 0 14px 14px 0;
    background: linear-gradient(90deg, #2c1c5c, #5b3aa8);
}

body.wod-v5 .wod-matchup .mu-lever__arm {
    position: absolute;
    left: 14px;
    bottom: 44px;
    width: 12px;
    height: 136px;
    border: 3px solid var(--mu-ink);
    border-radius: 8px;
    background: linear-gradient(90deg, #f3f4f6, #9ca3af);
    transform-origin: 50% 100%;
}

body.wod-v5 .wod-matchup .mu-lever__knob {
    position: absolute;
    top: -30px;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    border: 4px solid var(--mu-ink);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffb4a8, #ff5a4a 45%, #c0262d);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
}

body.wod-v5 .wod-matchup .mu-lever:hover .mu-lever__knob {
    transform: scale(1.08);
}

body.wod-v5 .wod-matchup .mu-lever.is-pulled .mu-lever__arm {
    animation: muPull 0.7s cubic-bezier(0.3, 0.7, 0.4, 1);
}

body.wod-v5 .wod-matchup .mu-lever:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 4px;
    border-radius: 12px;
}

body.wod-v5 .wod-matchup .wheel-controls {
    margin-top: 30px;
    padding-right: 54px;
}

/* Fullscreen: the machine fills the screen */
body.wod-v5 .wod-matchup .match-up-center.fullscreen-mode {
    background: var(--h-bg);
}

body.wod-v5 .wod-matchup .match-up-center.fullscreen-mode .mu-machine {
    width: min(92vw, 900px, calc((100vh - 200px) * 1.25));
}

/* Entries dialog: the two lists side by side ------------------------------- */
body.wod-v5 .mu-entries-modal {
    width: min(860px, calc(100vw - 32px));
}

body.wod-v5 .mu-lists {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

body.wod-v5 .mu-list__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 2px 10px;
}

body.wod-v5 .mu-list__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--h-text);
}

body.wod-v5 .mu-list__title::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--h-yellow);
}

body.wod-v5 .mu-list--2 .mu-list__title::before {
    background: var(--h-coral);
}

body.wod-v5 .mu-list__count {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--h-surface-2);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--h-text);
}

body.wod-v5 .mu-entries-modal .choices-editor textarea {
    height: min(calc(var(--row) * 7 + var(--pad) * 2), calc(100svh - 340px));
    min-height: calc(var(--row) * 4 + var(--pad) * 2);
}

body.wod-v5 .mu-entries-modal .entries-tab.active {
    background: var(--h-yellow);
    color: var(--h-ink);
    cursor: default;
}

/* Image lists */
body.wod-v5 .mu-entries-modal .image-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 300px;
    margin: 0 0 10px;
    overflow-y: auto;
}

body.wod-v5 .mu-entries-modal .image-preview-grid:empty {
    display: none;
}

body.wod-v5 .mu-entries-modal .image-preview-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--h-line);
    border-radius: 14px;
    background: var(--h-surface-2);
}

body.wod-v5 .mu-entries-modal .image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.wod-v5 .mu-entries-modal .image-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(8, 6, 14, 0.72);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    opacity: 1;
    cursor: pointer;
}

body.wod-v5 .mu-entries-modal .image-remove-btn:hover {
    background: var(--h-coral);
}

body.wod-v5 .mu-drop {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px dashed color-mix(in srgb, var(--h-yellow) 55%, transparent);
    border-radius: 18px;
    background: color-mix(in srgb, var(--h-yellow) 6%, transparent);
    color: var(--h-text);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

body.wod-v5 .mu-drop:hover,
body.wod-v5 .mu-drop.dragover {
    border-color: var(--h-yellow);
    background: color-mix(in srgb, var(--h-yellow) 14%, transparent);
}

body.wod-v5 .mu-drop:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 3px;
}

body.wod-v5 .mu-drop__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .mu-drop__text u {
    font-weight: 700;
    text-decoration-color: var(--h-yellow);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Results and last match ---------------------------------------------------- */
body.wod-v5 .wod-matchup .home-panels .result-images {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

body.wod-v5 .wod-matchup .home-panels .result-images .result-thumb {
    width: 44px;
    height: 44px;
    margin: 0;
    border-radius: 12px;
    object-fit: cover;
}

body.wod-v5 .wod-matchup .home-panels .result-plus,
body.wod-v5 .wod-matchup .last-match-plus {
    font-weight: 800;
    color: var(--h-coral);
}

body.wod-v5 .wod-matchup .home-panels #lastMatch {
    font-size: 1.35rem;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

body.wod-v5 .wod-matchup .last-match-images {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.wod-v5 .wod-matchup .last-match-img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
}

/* Winner pop-up: the pair ----------------------------------------------------- */
body.wod-v5 .match-up-result .result-content {
    width: min(580px, 100%);
}

body.wod-v5 .match-up-result .mu-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 12px;
}

body.wod-v5 .match-up-result .match-item {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: linear-gradient(100deg, var(--h-yellow), var(--h-coral));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: var(--h-font);
    font-size: clamp(2rem, 1.5rem + 2.4vw, 3.3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    overflow-wrap: anywhere;
    box-shadow: none;
    animation: wodWinner 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

body.wod-v5:not(.dark-mode) .match-up-result .match-item {
    background-image: linear-gradient(100deg, #f08a1c, #e04a2f);
}

body.wod-v5 .match-up-result .match-item + .mu-pair__link + .match-item {
    animation-delay: 0.12s;
}

/* Picture mode: two framed pictures with their names */
body.wod-v5 .match-up-result .match-item:has(img) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: none;
}

body.wod-v5 .match-up-result .match-item img {
    display: block;
    width: 140px;
    height: 140px;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: 0 0 0 5px var(--h-surface), 0 0 0 8px var(--h-yellow), 0 18px 40px rgba(255, 190, 77, 0.3);
}

body.wod-v5 .match-up-result .match-item__name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--h-text);
}

body.wod-v5 .match-up-result .mu-pair__link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--h-surface-2);
    color: var(--h-coral);
    font-size: 1.6rem;
    font-weight: 800;
}

/* Animations ----------------------------------------------------------------- */
/* Distances in px: the item is short now and sits on the payline in the middle of the window */
@keyframes muRoll {
    from { transform: translateY(-90px); opacity: 0.3; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes muLand {
    0% { transform: translateY(-48px); }
    100% { transform: translateY(0); }
}

@keyframes muPull {
    0% { transform: rotateX(0deg); }
    40% { transform: rotateX(155deg); }
    100% { transform: rotateX(0deg); }
}

@keyframes muFlash {
    0% { background: #fff4d6; box-shadow: 0 0 10px 4px rgba(255, 190, 77, 0.95); }
    100% { background: #6b4fb0; box-shadow: none; }
}

@keyframes muFlicker {
    0% { opacity: 1; }
    100% { opacity: 0.75; }
}

@keyframes muPop {
    0% { transform: scale(0.8); }
    100% { transform: scale(1); }
}

@keyframes muWobble {
    from { transform: rotate(-8deg) scale(1.03); }
    to { transform: rotate(8deg) scale(1.03); }
}

/* Tablets and phones */
@media (max-width: 1099.98px) {
    body.wod-v5 .wod-matchup .home-wheel {
        align-self: stretch;
    }

    body.wod-v5 .wod-matchup .mu-machine {
        width: min(600px, 100%);
    }
}

@media (max-width: 759.98px) {
    body.wod-v5 .wod-matchup .mu-machine {
        padding-right: 40px;
    }

    body.wod-v5 .wod-matchup .mu-sign {
        margin: 0 30px -14px;
        padding: 10px 12px 12px;
    }

    body.wod-v5 .wod-matchup .mu-cabinet {
        padding: 26px 14px 18px;
        border-radius: 28px;
    }

    body.wod-v5 .wod-matchup .mu-bulbs span {
        width: 9px;
        height: 9px;
    }

    body.wod-v5 .wod-matchup .match-up-container {
        gap: 8px;
        padding: 10px;
        border-radius: 20px;
    }

    body.wod-v5 .wod-matchup .slot-display {
        height: 130px;
        border-radius: 14px;
    }

    body.wod-v5 .wod-matchup .slot-item {
        padding: 0 12px;
        font-size: 1.25rem;
    }

    body.wod-v5 .wod-matchup .match-up-vs {
        width: 40px;
        height: 40px;
        margin-top: 22px;
        font-size: 0.85rem;
        border-width: 3px;
    }

    body.wod-v5 .wod-matchup .mu-cabinet .spin-button {
        height: 58px;
        margin-top: 16px;
    }

    body.wod-v5 .wod-matchup .mu-lever {
        width: 40px;
        height: 160px;
    }

    body.wod-v5 .wod-matchup .mu-lever__base {
        width: 24px;
        height: 56px;
    }

    body.wod-v5 .wod-matchup .mu-lever__arm {
        left: 10px;
        width: 10px;
        height: 104px;
    }

    body.wod-v5 .wod-matchup .mu-lever__knob {
        top: -26px;
        width: 34px;
        height: 34px;
        margin-left: -17px;
    }

    body.wod-v5 .wod-matchup .wheel-controls {
        padding-right: 40px;
    }

    body.wod-v5 .mu-lists {
        grid-template-columns: minmax(0, 1fr);
    }

    body.wod-v5 .mu-entries-modal .choices-editor textarea {
        height: calc(var(--row) * 4 + var(--pad) * 2);
    }

    body.wod-v5 .match-up-result .match-item img {
        width: 110px;
        height: 110px;
        border-radius: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.wod-v5 .wod-matchup .match-up-slot.spinning .slot-item,
    body.wod-v5 .wod-matchup .match-up-slot.landed .slot-item,
    body.wod-v5 .wod-matchup .match-up-slot.winner .slot-item,
    body.wod-v5 .wod-matchup .mu-bulbs span,
    body.wod-v5 .wod-matchup .mu-sign__text,
    body.wod-v5 .wod-matchup .match-up-vs,
    body.wod-v5 .wod-matchup .mu-lever.is-pulled .mu-lever__arm,
    body.wod-v5 .match-up-result .match-item {
        animation: none;
    }
}

/* ==========================================================================
   TEAM GENERATOR (templates/team-generator.php, .wod-teams) - homepage vibe:
   a "Your teams" card with the wheel's soft glow behind it.
   team-generator.js fills #teamsDisplay; team-generator-v5.js adds name chips
   and .is-spinning / .is-matched.
   ========================================================================== */
body.wod-v5 .wod-teams .home-wheel {
    align-self: start;
}

body.wod-v5 .wod-teams .tg-board {
    position: relative;
    width: min(620px, 48vw);
    margin: 0 auto;
}

body.wod-v5 .wod-teams .tg-board .wheel-glow {
    inset: -10%;
}

body.wod-v5 .wod-teams.is-spinning .tg-board .wheel-glow {
    animation-duration: 0.8s;
}

body.wod-v5 .wod-teams .tg-panel {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--h-line);
    border-radius: 32px;
    background:
        radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--h-yellow) 14%, transparent), transparent 70%),
        var(--h-surface);
    box-shadow: var(--h-shadow), 0 30px 70px rgba(0, 0, 0, 0.25);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

body.wod-v5 .wod-teams .tg-panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--h-yellow), var(--h-coral), #8b6cff);
}

body.wod-v5 .wod-teams.is-matched .tg-panel {
    border-color: var(--h-yellow);
    box-shadow: var(--h-shadow), 0 0 0 4px color-mix(in srgb, var(--h-yellow) 35%, transparent), 0 30px 70px rgba(0, 0, 0, 0.25);
}

body.wod-v5 .wod-teams .tg-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
}

body.wod-v5 .wod-teams .tg-head__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .wod-teams .tg-head__title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--h-text);
}

body.wod-v5 .wod-teams.is-matched .tg-head__title {
    animation: tgPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* The area that shows the names, then the teams */
body.wod-v5 .wod-teams .teams-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 280px;
    max-height: 460px;
    margin: 0;
    padding: 16px;
    overflow-y: auto;
    border: 1px solid var(--h-line);
    border-radius: 24px;
    background: var(--h-surface-2);
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: var(--h-yellow) transparent;
}

body.wod-v5 .wod-teams .teams-placeholder,
body.wod-v5 .wod-teams .teams-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 10px;
    border: 0;
    background: none;
    text-align: center;
}

body.wod-v5 .wod-teams .teams-placeholder svg,
body.wod-v5 .wod-teams .teams-loading .loading-spinner {
    display: none;
}

body.wod-v5 .wod-teams .teams-placeholder p,
body.wod-v5 .wod-teams .teams-loading p {
    margin: 0;
    color: var(--h-muted) !important;
    font-size: 1.05rem;
    font-weight: 700;
}

/* Name chips waiting to be picked */
body.wod-v5 .wod-teams .tg-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

body.wod-v5 .wod-teams .tg-chip {
    padding: 9px 16px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: var(--h-surface);
    color: var(--h-text);
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    animation: tgChipIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: calc(var(--i) * 0.03s);
}

body.wod-v5 .wod-teams .tg-chip:nth-child(4n+1) { box-shadow: inset 0 -3px 0 var(--h-yellow); }
body.wod-v5 .wod-teams .tg-chip:nth-child(4n+2) { box-shadow: inset 0 -3px 0 var(--h-coral); }
body.wod-v5 .wod-teams .tg-chip:nth-child(4n+3) { box-shadow: inset 0 -3px 0 #8b6cff; }
body.wod-v5 .wod-teams .tg-chip:nth-child(4n+4) { box-shadow: inset 0 -3px 0 #3fd8b0; }

body.wod-v5 .wod-teams .tg-chip--more {
    border-style: dashed;
    color: var(--h-muted);
}

/* Shuffling: the chips jump around */
body.wod-v5 .wod-teams .tg-shuffling .tg-chip {
    animation: tgJiggle 0.22s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * -0.05s);
}

/* Teams */
body.wod-v5 .wod-teams .teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    width: 100%;
    margin: 0;
}

body.wod-v5 .wod-teams .team-card {
    overflow: hidden;
    border: 1px solid var(--h-line);
    border-radius: 20px;
    background: var(--h-surface);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    transform: none;
}

body.wod-v5 .wod-teams .team-card-animate {
    animation: tgCardIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

body.wod-v5 .wod-teams .team-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 10px;
    border-top: 5px solid var(--team-color);
    background: color-mix(in srgb, var(--team-color) 14%, transparent);
}

body.wod-v5 .wod-teams .team-number {
    font-family: var(--h-font);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--h-text);
}

body.wod-v5 .wod-teams .team-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--h-muted);
}

body.wod-v5 .wod-teams .team-members {
    margin: 0;
    padding: 10px;
    list-style: none;
}

/* Names are dealt into the teams one after another */
body.wod-v5 .wod-teams .team-member {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    padding: 7px 10px;
    border: 0;
    border-radius: 12px;
    background: var(--h-surface-2);
    color: var(--h-text);
    font-family: var(--h-font);
    font-size: 1rem;
    font-weight: 700;
    animation: tgDeal 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

body.wod-v5 .wod-teams .team-member::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--team-color);
}

body.wod-v5 .wod-teams .team-member:last-child {
    margin-bottom: 0;
}

body.wod-v5 .wod-teams .team-member:nth-child(2) { animation-delay: 0.12s; }
body.wod-v5 .wod-teams .team-member:nth-child(3) { animation-delay: 0.24s; }
body.wod-v5 .wod-teams .team-member:nth-child(4) { animation-delay: 0.36s; }
body.wod-v5 .wod-teams .team-member:nth-child(5) { animation-delay: 0.48s; }
body.wod-v5 .wod-teams .team-member:nth-child(n+6) { animation-delay: 0.6s; }

/* Team count + generate button */
body.wod-v5 .wod-teams .tg-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
}

body.wod-v5 .wod-teams .tg-count {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
}

body.wod-v5 .wod-teams .tg-count__label {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--h-text);
}

body.wod-v5 .wod-teams .tg-count .home-stepper__value {
    min-width: 44px;
    font-size: 1.3rem;
}

body.wod-v5 .wod-teams .team-count-hint {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--h-muted);
    font-size: 0.9rem;
    text-align: left;
}

/* Generate button: the Emoji Generator's arcade button (raised, presses down; stays pressed
   while team-generator.js has it disabled during the shuffle) */
body.wod-v5 .wod-teams .tg-generate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
    width: auto;
    min-width: 170px;
    height: 60px;
    margin: 0 0 7px;
    padding: 0 26px;
    border: 4px solid var(--h-ink);
    border-radius: 999px;
    background: radial-gradient(120% 160% at 50% 0%, #ffe2a6, var(--h-yellow) 55%, #f59e2b);
    color: var(--h-ink);
    font-family: var(--h-font);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 7px 0 #9a5a10, 0 12px 24px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
}

body.wod-v5 .wod-teams .tg-generate:hover:not(:disabled) {
    transform: translateY(-2px);
}

body.wod-v5 .wod-teams .tg-generate:active:not(:disabled),
body.wod-v5 .wod-teams .tg-generate:disabled {
    transform: translateY(5px);
    box-shadow: 0 2px 0 #9a5a10, 0 6px 14px rgba(0, 0, 0, 0.3);
}

body.wod-v5 .wod-teams .tg-generate:disabled {
    opacity: 1;
    filter: saturate(0.6) brightness(0.92);
    cursor: default;
}

body.wod-v5 .wod-teams.is-spinning .tg-generate svg {
    animation: tgSpin 0.6s linear infinite;
}

body.wod-v5 .wod-teams .tg-generate:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 3px;
}

body.wod-v5 .wod-teams .wheel-controls {
    margin-top: 30px;
}

/* Fullscreen: the board fills the screen */
body.wod-v5 .wod-teams .team-generator-center.fullscreen-mode {
    background: var(--h-bg);
}

body.wod-v5 .wod-teams .team-generator-center.fullscreen-mode .tg-board {
    width: min(92vw, 1000px);
}

body.wod-v5 .wod-teams .team-generator-center.fullscreen-mode .teams-display {
    max-height: calc(100vh - 300px);
}

@keyframes tgChipIn {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: none; }
}

@keyframes tgJiggle {
    from { transform: translate(-3px, 2px) rotate(-4deg); }
    to { transform: translate(3px, -2px) rotate(4deg); }
}

@keyframes tgCardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.92); }
    to { opacity: 1; transform: none; }
}

@keyframes tgDeal {
    from { opacity: 0; transform: translateX(-18px) scale(0.9); }
    to { opacity: 1; transform: none; }
}

@keyframes tgPop {
    0% { transform: scale(0.85); }
    100% { transform: scale(1); }
}

@keyframes tgSpin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   EMOJI GENERATOR (templates/emoji-generator.php, .wod-emoji) - the wheel's
   ring and lights around one big glossy emoji button.
   emoji-generator.js adds .spinning on #emojiDisplay; emoji-generator-v5.js adds
   .is-spinning / .is-landed on .wod-emoji.
   ========================================================================== */

/* Desktop: a slightly smaller machine so the name and buttons fit on screen too */
@media (min-width: 1100px) {
    body.wod-v5 .wod-emoji {
        --wheel: clamp(320px, calc(100svh - 400px), min(500px, 40vw));
    }
}

/* spinner-wheel.css makes .emoji-generator-app a flex row */
body.wod-v5 .wod-emoji.emoji-generator-app {
    display: block;
}

body.wod-v5 .wod-emoji .home-wheel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Sets: the homepage "Try one" chips with an emoji */
body.wod-v5 .wod-emoji .quick-pick.category-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    min-height: 0;
    gap: 8px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 9px 16px 9px 12px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: var(--h-surface);
    color: var(--h-text);
}

body.wod-v5 .wod-emoji .quick-pick.category-btn.active {
    border-color: var(--h-yellow);
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .wod-emoji .category-emoji {
    font-size: 1.3rem;
    line-height: 1;
}

body.wod-v5 .wod-emoji .category-label {
    font-size: 1rem;
    font-weight: 700;
}

/* The machine face */
body.wod-v5 .wod-emoji .em-face {
    position: absolute;
    inset: 20px;
    z-index: 2;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #fff8e6, #ffd98a 42%, #f7a33a 78%, #e8792a);
    box-shadow:
        inset 0 -16px 40px rgba(180, 80, 20, 0.35),
        inset 0 12px 30px rgba(255, 255, 255, 0.55);
}

body.wod-v5 .wod-emoji .emoji-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    box-shadow: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

body.wod-v5 .wod-emoji .emoji-display::before {
    display: none;
}

body.wod-v5 .wod-emoji .emoji-display:hover {
    transform: scale(1.03);
}

body.wod-v5 .wod-emoji .emoji-display:active {
    transform: scale(0.97);
}

body.wod-v5 .wod-emoji .emoji-display:focus-visible {
    outline: 4px solid var(--h-yellow);
    outline-offset: 6px;
}

body.wod-v5 .wod-emoji .emoji-display.spinning,
body.wod-v5 .wod-emoji .emoji-display.result-shown {
    animation: none;
}

body.wod-v5 .wod-emoji .emoji-result {
    display: block;
    font-size: calc(var(--wheel) * 0.42);
    line-height: 1;
    filter: drop-shadow(0 10px 18px rgba(120, 50, 10, 0.3));
}

/* Rolling: the emoji flickers up and down, blurred */
body.wod-v5 .wod-emoji.is-spinning .emoji-result {
    animation: emRoll 0.16s ease-in-out infinite alternate;
    filter: blur(1.2px) drop-shadow(0 10px 18px rgba(120, 50, 10, 0.3));
}

/* Landing: a big pop and a glow */
body.wod-v5 .wod-emoji.is-landed .emoji-result {
    animation: emPop 0.6s cubic-bezier(0.34, 1.7, 0.64, 1);
}

body.wod-v5 .wod-emoji.is-landed .em-face {
    animation: emGlow 0.9s ease-out;
}

body.wod-v5 .wod-emoji .emoji-name {
    min-height: 1.3em;
    margin: 24px 0 16px;
    color: var(--h-text) !important;
    font-family: var(--h-font);
    font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: center;
}

/* SPIN + Copy */
body.wod-v5 .wod-emoji .em-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

body.wod-v5 .wod-emoji .em-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 60px;
    padding: 0 28px;
    border-radius: 999px;
    font-family: var(--h-font);
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease, filter 0.2s ease;
}

body.wod-v5 .wod-emoji .em-btn--spin {
    min-width: 170px;
    border: 4px solid var(--h-ink);
    background: radial-gradient(120% 160% at 50% 0%, #ffe2a6, var(--h-yellow) 55%, #f59e2b);
    color: var(--h-ink);
    font-size: 1.3rem;
    letter-spacing: 0.16em;
    box-shadow: 0 7px 0 #9a5a10, 0 12px 24px rgba(0, 0, 0, 0.3);
}

body.wod-v5 .wod-emoji .em-btn--spin:hover:not(:disabled) {
    transform: translateY(-2px);
}

body.wod-v5 .wod-emoji .em-btn--spin:active:not(:disabled),
body.wod-v5 .wod-emoji .em-btn--spin:disabled {
    transform: translateY(5px);
    box-shadow: 0 2px 0 #9a5a10, 0 6px 14px rgba(0, 0, 0, 0.3);
}

body.wod-v5 .wod-emoji .em-btn--spin:disabled {
    filter: saturate(0.6) brightness(0.92);
    cursor: default;
}

body.wod-v5 .wod-emoji .em-btn--copy {
    border: 1px solid var(--h-line);
    background: var(--h-surface);
    color: var(--h-text);
    box-shadow: var(--h-shadow);
}

body.wod-v5 .wod-emoji .em-btn--copy:hover {
    border-color: var(--h-yellow);
}

body.wod-v5 .wod-emoji .em-btn__copied {
    display: none;
}

/* emoji-generator.js adds .copied for a moment */
body.wod-v5 .wod-emoji .em-btn--copy.copied {
    border-color: #2fd28a;
    background: #2fd28a;
    color: #08130d;
}

body.wod-v5 .wod-emoji .em-btn--copy.copied .em-btn__copy {
    display: none;
}

body.wod-v5 .wod-emoji .em-btn--copy.copied .em-btn__copied {
    display: inline;
}

body.wod-v5 .wod-emoji .em-btn:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 3px;
}

body.wod-v5 .wod-emoji .wheel-controls {
    margin-top: 22px;
}

/* History: tap to copy */
body.wod-v5 .wod-emoji .em-history-hint {
    margin: -8px 0 12px;
    font-size: 0.95rem;
    color: var(--h-muted) !important;
}

body.wod-v5 .wod-emoji .home-panels .emoji-history-item {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

body.wod-v5 .wod-emoji .home-panels .emoji-history-item:hover {
    background: color-mix(in srgb, var(--h-yellow) 14%, transparent);
}

body.wod-v5 .wod-emoji .home-panels .emoji-history-item.copied {
    background: color-mix(in srgb, #2fd28a 30%, transparent);
}

body.wod-v5 .wod-emoji .history-emoji {
    font-size: 1.8rem;
    line-height: 1;
}

body.wod-v5 .wod-emoji .history-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--h-text);
}

@keyframes emRoll {
    from { transform: translateY(-6%) scale(0.94) rotate(-6deg); }
    to { transform: translateY(6%) scale(1.04) rotate(6deg); }
}

@keyframes emPop {
    0% { transform: scale(0.5); }
    100% { transform: scale(1); }
}

@keyframes emGlow {
    0% { box-shadow: inset 0 -16px 40px rgba(180, 80, 20, 0.35), inset 0 12px 30px rgba(255, 255, 255, 0.55), 0 0 0 0 rgba(255, 190, 77, 0.8); }
    100% { box-shadow: inset 0 -16px 40px rgba(180, 80, 20, 0.35), inset 0 12px 30px rgba(255, 255, 255, 0.55), 0 0 0 30px rgba(255, 190, 77, 0); }
}

/* Tablets and phones (both pages) */
@media (max-width: 1099.98px) {
    body.wod-v5 .wod-teams .home-wheel {
        align-self: stretch;
    }

    body.wod-v5 .wod-teams .tg-board {
        width: min(620px, 100%);
    }
}

@media (max-width: 759.98px) {
    body.wod-v5 .wod-teams .teams-display {
        min-height: 220px;
        padding: 12px;
    }

    body.wod-v5 .wod-teams .teams-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.wod-v5 .wod-teams .tg-controls {
        flex-direction: column;
        align-items: stretch;
    }

    body.wod-v5 .wod-teams .tg-count {
        justify-content: center;
    }

    body.wod-v5 .wod-teams .team-count-hint {
        text-align: center;
    }

    body.wod-v5 .wod-teams .tg-generate {
        height: 56px;
    }

    body.wod-v5 .wod-teams .tg-panel {
        padding: 16px;
        border-radius: 26px;
    }

    body.wod-v5 .wod-emoji .em-btn {
        height: 54px;
        padding: 0 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.wod-v5 .wod-teams .tg-chip,
    body.wod-v5 .wod-teams .tg-shuffling .tg-chip,
    body.wod-v5 .wod-teams .team-card-animate,
    body.wod-v5 .wod-teams .team-member,
    body.wod-v5 .wod-emoji.is-spinning .emoji-result,
    body.wod-v5 .wod-emoji.is-landed .emoji-result,
    body.wod-v5 .wod-emoji.is-landed .em-face {
        animation: none;
    }
}

/* ==========================================================================
   TOOL GUIDE FAQ - same design as the homepage FAQ (hg-faq above);
   template-parts/guides/guide-*.php use the hg-faq markup inside .tool-guide.
   ========================================================================== */
body.wod-tool-v5 .tool-guide .hg-faq .hg-title {
    margin: 0 0 20px;
}

body.wod-tool-v5 .tool-guide .hg-faq__more {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--h-muted);
}

body.wod-tool-v5 .tool-guide .hg-faq__more a {
    font-weight: 700;
    color: var(--h-text);
    text-decoration: underline;
    text-decoration-color: var(--h-yellow);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

body.wod-tool-v5 .tool-guide .hg-faq__item p {
    margin: 0;
    padding: 0 26px 24px;
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--h-muted);
}

@media (max-width: 639.98px) {
    body.wod-tool-v5 .tool-guide .hg-faq__item p {
        padding: 0 20px 20px;
        font-size: 1.05rem;
    }
}

/* ==========================================================================
   SHARE DIALOG (template-parts/wheel-share-modal.php, wheel-choose-you.php) - homepage look.
   Markup and IDs unchanged (spinner-wheel.js / image-wheel.js); overrides spinner-wheel.css.
   ========================================================================== */
body.wod-v5 .share-modal {
    align-items: center;
    padding: 24px 16px;
    background: rgba(8, 7, 12, 0.7);
    backdrop-filter: blur(10px);
}

body.wod-v5 .share-modal .share-modal-content {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    padding: 40px 36px 34px;
    border: 1px solid var(--h-line);
    border-radius: 32px;
    background:
        radial-gradient(90% 50% at 50% 0%, color-mix(in srgb, var(--h-yellow) 16%, transparent), transparent 70%),
        var(--h-surface);
    color: var(--h-text);
    font-family: var(--h-font);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.wod-v5 .share-modal.show .share-modal-content {
    transform: none;
}

/* Colour strip along the top, like the other v5 cards */
body.wod-v5 .share-modal .share-modal-content::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    border-radius: 32px 32px 0 0;
    background: linear-gradient(90deg, var(--h-yellow), var(--h-coral), var(--h-violet));
}

body.wod-v5 .share-modal .share-modal-close {
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--h-line);
    border-radius: 50%;
    background: var(--h-surface-2);
    color: var(--h-text);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

body.wod-v5 .share-modal .share-modal-close:hover {
    border-color: var(--h-coral);
    background: var(--h-surface-2);
    color: var(--h-text);
    transform: rotate(90deg);
}

body.wod-v5 .share-modal .share-content {
    text-align: left;
}

/* Icon tile + title + intro */
body.wod-v5 .share-modal .share-icon {
    width: 64px;
    height: 64px;
    margin: 0 0 18px;
    border-radius: 20px;
    background: var(--h-yellow);
    color: var(--h-ink);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15), 0 12px 26px rgba(255, 190, 77, 0.4);
    transform: rotate(-6deg);
}

body.wod-v5 .share-modal .share-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

body.wod-v5 .share-modal .share-icon.login-required {
    background: var(--h-coral);
    color: #fff;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15), 0 12px 26px rgba(255, 122, 89, 0.35);
}

body.wod-v5 .share-modal .share-content h3 {
    margin: 0 0 8px;
    font-family: var(--h-font);
    font-size: clamp(2rem, 1.6rem + 1.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--h-text);
}

body.wod-v5 .share-modal .share-content > p {
    margin: 0 0 26px;
    color: var(--h-muted);
    font-size: 1.12rem;
    line-height: 1.5;
}

/* Form */
body.wod-v5 .share-modal .share-options-form {
    margin-bottom: 22px;
}

body.wod-v5 .share-modal .share-form-group {
    margin-bottom: 20px;
}

body.wod-v5 .share-modal .share-form-group > label {
    display: block;
    margin-bottom: 10px;
    color: var(--h-muted);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.wod-v5 .share-modal .share-form-input {
    height: 56px;
    padding: 0 18px;
    border: 1px solid var(--h-line);
    border-radius: 16px;
    background: var(--h-surface-2);
    color: var(--h-text);
    font-family: var(--h-font);
    font-size: 1.1rem;
    font-weight: 600;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body.wod-v5 .share-modal .share-form-input::placeholder {
    color: color-mix(in srgb, var(--h-muted) 75%, transparent);
}

body.wod-v5 .share-modal .share-form-input:focus {
    outline: none;
    border-color: var(--h-yellow);
    background: var(--h-surface);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--h-yellow) 25%, transparent);
}

/* Choice cards (Public / Members only, Total / Per user) */
body.wod-v5 .share-modal .share-access-options {
    gap: 12px;
}

body.wod-v5 .share-modal .share-radio-option {
    position: relative;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--h-line);
    border-radius: 20px;
    background: var(--h-surface);
    text-align: left;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body.wod-v5 .share-modal .share-radio-option:hover {
    border-color: color-mix(in srgb, var(--h-yellow) 60%, transparent);
    background: var(--h-surface);
    transform: translateY(-2px);
}

body.wod-v5 .share-modal .share-radio-option.active {
    border-color: var(--h-yellow);
    background: color-mix(in srgb, var(--h-yellow) 12%, var(--h-surface));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--h-yellow) 22%, transparent);
}

/* Tick in the corner of the chosen card */
body.wod-v5 .share-modal .share-radio-option::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121019' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 13px no-repeat,
        var(--h-yellow);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.wod-v5 .share-modal .share-radio-option.active::after {
    opacity: 1;
    transform: none;
}

body.wod-v5 .share-modal .radio-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--h-surface-2);
    color: var(--h-text);
}

body.wod-v5 .share-modal .share-radio-option.active .radio-icon,
body.wod-v5 .share-modal .share-toggle-option.active .radio-icon {
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .share-modal .share-radio-option .radio-text {
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

body.wod-v5 .share-modal .radio-text strong {
    color: var(--h-text);
    font-size: 1.08rem;
    font-weight: 800;
}

body.wod-v5 .share-modal .radio-text small {
    color: var(--h-muted);
    font-size: 0.95rem;
    line-height: 1.35;
}

/* Spin limit: number + hint pill */
body.wod-v5 .share-modal .share-spin-limit-wrapper {
    gap: 12px;
}

body.wod-v5 .share-modal .share-spin-limit-wrapper .share-form-input {
    width: 130px;
    font-size: 1.2rem;
    font-weight: 800;
}

body.wod-v5 .share-modal .spin-limit-hint {
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--h-surface-2);
    color: var(--h-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

/* Unique results: a card with a switch on the right */
body.wod-v5 .share-modal .share-toggle-option {
    position: relative;
    align-items: center;
    gap: 14px;
    padding: 16px 84px 16px 16px;
    border: 1px solid var(--h-line);
    border-radius: 20px;
    background: var(--h-surface);
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease;
}

body.wod-v5 .share-modal .share-toggle-option:hover {
    border-color: color-mix(in srgb, var(--h-yellow) 60%, transparent);
}

body.wod-v5 .share-modal .share-toggle-option.active {
    border-color: var(--h-yellow);
    background: color-mix(in srgb, var(--h-yellow) 12%, var(--h-surface));
}

body.wod-v5 .share-modal .share-toggle-option .radio-text {
    align-items: flex-start;
}

body.wod-v5 .share-modal .share-toggle-option::before,
body.wod-v5 .share-modal .share-toggle-option::after {
    content: '';
    position: absolute;
    top: 50%;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
}

body.wod-v5 .share-modal .share-toggle-option::before {
    right: 16px;
    width: 54px;
    height: 32px;
    margin-top: -16px;
    border-radius: 999px;
    background: var(--h-surface-2);
    box-shadow: inset 0 0 0 1px var(--h-line);
}

body.wod-v5 .share-modal .share-toggle-option::after {
    right: 42px;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

body.wod-v5 .share-modal .share-toggle-option.active::before {
    background: #2fd28a;
    box-shadow: none;
}

body.wod-v5 .share-modal .share-toggle-option.active::after {
    transform: translateX(22px);
}

/* The made link: input + copy button */
body.wod-v5 .share-modal .share-link-container {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px dashed color-mix(in srgb, var(--h-yellow) 70%, transparent);
    border-radius: 22px;
    background: color-mix(in srgb, var(--h-yellow) 8%, var(--h-surface));
}

body.wod-v5 .share-modal .share-link-input-wrapper {
    gap: 10px;
}

body.wod-v5 .share-modal .share-link-input {
    height: 54px;
    padding: 0 16px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: var(--h-surface);
    color: var(--h-text);
    font-family: var(--h-font);
    font-size: 1rem;
    font-weight: 600;
}

body.wod-v5 .share-modal .copy-link-btn {
    height: 54px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--h-yellow);
    color: var(--h-ink);
    font-family: var(--h-font);
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(255, 190, 77, 0.4);
    transition: transform 0.2s ease;
}

body.wod-v5 .share-modal .copy-link-btn:hover {
    transform: translateY(-2px);
    background: var(--h-yellow);
    color: var(--h-ink);
}

body.wod-v5 .share-modal .share-link-hint {
    margin: 10px 4px 0;
    color: var(--h-muted);
    font-size: 0.98rem;
    text-align: left;
}

/* Main buttons: the arcade button (Generate link, Sign in) + a light one (Create account) */
body.wod-v5 .share-modal .btn-share-generate,
body.wod-v5 .share-modal .btn-share-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 62px;
    margin: 0 0 7px;
    border: 4px solid var(--h-ink);
    border-radius: 999px;
    background: radial-gradient(120% 160% at 50% 0%, #ffe2a6, var(--h-yellow) 55%, #f59e2b);
    color: var(--h-ink);
    font-family: var(--h-font);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 7px 0 #9a5a10, 0 12px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
}

body.wod-v5 .share-modal .btn-share-generate:hover:not(:disabled),
body.wod-v5 .share-modal .btn-share-login:hover {
    transform: translateY(-2px);
    background: radial-gradient(120% 160% at 50% 0%, #ffe2a6, var(--h-yellow) 55%, #f59e2b);
    color: var(--h-ink);
    box-shadow: 0 7px 0 #9a5a10, 0 12px 24px rgba(0, 0, 0, 0.3);
}

body.wod-v5 .share-modal .btn-share-generate:active:not(:disabled),
body.wod-v5 .share-modal .btn-share-generate:disabled,
body.wod-v5 .share-modal .btn-share-login:active {
    transform: translateY(5px);
    box-shadow: 0 2px 0 #9a5a10, 0 6px 14px rgba(0, 0, 0, 0.3);
}

body.wod-v5 .share-modal .btn-share-generate:disabled {
    filter: saturate(0.6) brightness(0.92);
    opacity: 1;
}

body.wod-v5 .share-modal .share-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.wod-v5 .share-modal .btn-share-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 58px;
    border: 1px solid var(--h-line);
    border-radius: 999px;
    background: var(--h-surface-2);
    color: var(--h-text);
    font-family: var(--h-font);
    font-size: 1.08rem;
    font-weight: 800;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

body.wod-v5 .share-modal .btn-share-register:hover {
    border-color: var(--h-yellow);
    background: var(--h-surface-2);
    color: var(--h-text);
    transform: translateY(-2px);
}

body.wod-v5 .share-modal .btn-share-generate:focus-visible,
body.wod-v5 .share-modal .btn-share-login:focus-visible,
body.wod-v5 .share-modal .btn-share-register:focus-visible,
body.wod-v5 .share-modal .copy-link-btn:focus-visible,
body.wod-v5 .share-modal .share-modal-close:focus-visible {
    outline: 3px solid var(--h-yellow);
    outline-offset: 3px;
}

body.wod-v5 .share-modal .share-scroll-indicator {
    border-radius: 999px;
    background: var(--h-ink);
    color: #fff;
    font-family: var(--h-font);
    font-weight: 700;
}

@media (max-width: 559.98px) {
    body.wod-v5 .share-modal .share-modal-content {
        padding: 34px 20px 26px;
        border-radius: 28px;
    }

    body.wod-v5 .share-modal .share-access-options {
        flex-direction: column;
    }

    body.wod-v5 .share-modal .share-spin-limit-wrapper {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.wod-v5 .share-modal .share-modal-content,
    body.wod-v5 .share-modal .share-radio-option,
    body.wod-v5 .share-modal .share-toggle-option::after {
        transition: none;
    }
}
