/* ── FOUC / theme boot (html[data-pg-theme] set before first paint) ─ */
html[data-pg-theme="light"] body
{
    background: #e8eef4 !important;
}
html[data-pg-theme="dark"] body
{
    background: #121821 !important;
}
body,
.pg-preview-bar,
.pg-preview-link,
.pg-theme-toggle,
.pg-panel,
.pg-gen-log-entry,
.pg-log-name,
.pg-log-modal-content,
.pg-classic-card,
.pg-classic-modal,
.pg-launch-terminal,
.pg-launch-terminal__frame,
.launch-board,
.launch-header,
.launch-venue,
.launch-live,
.launch-kicker,
.launch-name,
.launch-tagline,
.slot-cabinet,
.slot-cabinet-sign,
.slot-sign-frame,
.slot-sign-lights,
.slot-sign-panel,
.slot-sign-title,
.slot-sign-kicker,
.slot-bezel,
.slot-window,
.slot-reel,
.slot-symbol,
.slot-winner-kicker,
.slot-winner-name,
.slot-marquee,
.slot-marquee-track,
.lever-plaque
{
    transition:
        background 0.4s ease,
        background-color 0.4s ease,
        color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.4s ease,
        outline-color 0.35s ease,
        fill 0.4s ease,
        opacity 0.35s ease,
        text-shadow 0.35s ease;
}

/* ── Body themes ─────────────────────────────────────────── */
.pg-dark-body
{
    background: #121821 !important;
}
body.pg-light
{
    background: #e8eef4 !important;
}

/* ── Preview / mode bar ──────────────────────────────────── */
.pg-preview-bar
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: #1c2430;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
body.pg-light .pg-preview-bar
{
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 60, 94, 0.12);
}
.pg-preview-label
{
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #bfbfbf;
    margin-right: 6px;
}
body.pg-light .pg-preview-label { color: #5a6a7a; }
.pg-preview-link
{
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    background: #262f3f;
    text-decoration: none;
    border: 2px solid transparent;
}
body.pg-light .pg-preview-link
{
    color: #3a5568;
    background: #e8eef4;
    border-color: transparent;
}
.pg-preview-link:hover
{
    color: #fff;
    background: #67BAEA;
}
body.pg-light .pg-preview-link:hover
{
    color: #fff;
    background: #67BAEA;
}
/* Active chip - same green treatment in both themes */
.pg-preview-link.is-active
{
    color: #fff;
    background: #00C070;
    border-color: transparent;
    box-shadow: none;
    font-weight: 700;
}
body.pg-light .pg-preview-link.is-active
{
    color: #fff;
    background: #00C070;
    border-color: transparent;
    box-shadow: none;
    font-weight: 700;
}

/* Theme toggle - moon in dark mode, sun in light mode */
.pg-theme-toggle
{
    margin-left: auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #262f3f;
    color: #c5d0dc;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: none;
}
.pg-theme-toggle:hover,
.pg-theme-toggle:focus
{
    background: #67BAEA;
    color: #fff;
    box-shadow: none;
}
body.pg-light .pg-theme-toggle
{
    background: #e4ecf3;
    color: #003C5E;
}
body.pg-light .pg-theme-toggle:hover,
body.pg-light .pg-theme-toggle:focus
{
    background: #67BAEA;
    color: #fff;
}
.pg-theme-icon-sun { display: none; }
.pg-theme-icon-moon { display: inline; }
body.pg-light .pg-theme-icon-moon { display: none; }
body.pg-light .pg-theme-icon-sun { display: inline; }

#main-content .range { width: 90%; }
input[type=range]::-webkit-slider-thumb { background-color: #67BAEA !important; }
input[type=range]::-moz-range-thumb { background-color: #67BAEA !important; }
input[type=range]::-ms-thumb { background-color: #67BAEA !important; }
.form-check-input:checked
{
    background-color: #67BAEA;
    border-color: #67BAEA;
}
.form-check-input:focus
{
    border-color: #67BAEA;
    box-shadow: 0 0 0 0.25rem rgba(103, 186, 234, 0.25);
}

.pg-copy { min-width: 110px; }

.pg-panel
{
    background: #1c2430;
    color: #fff;
    border-radius: 12px;
}
body.pg-light .pg-panel
{
    background: #fff;
    color: #1a2430;
    box-shadow: 0 2px 12px rgba(0, 60, 94, 0.08);
}
.pg-panel p { color: #c9d0d8; }
body.pg-light .pg-panel p { color: #5a6a7a; }
.pg-panel .form-check-label,
.pg-panel .form-label,
.pg-panel h5,
.pg-panel .fw-bold { color: #fff; }
body.pg-light .pg-panel .form-check-label,
body.pg-light .pg-panel .form-label,
body.pg-light .pg-panel h5,
body.pg-light .pg-panel .fw-bold { color: #1a2430; }
.pg-panel .form-check-input { background-color: #fff; }

/* ── Controls card (static, not expandable) ──────────────── */
.pg-controls-card
{
    height: 100%;
    padding: 18px 20px;
}

/* ── Shared generation log ───────────────────────────────── */
.pg-gen-log
{
    list-style: none;
    padding: 0;
    margin: 0;
}
.pg-gen-log .empty
{
    color: #808080;
    font-weight: 400;
    padding: 8px 0;
    font-style: italic;
}
.pg-gen-log-entry
{
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    background: rgba(255,255,255,0.02);
}
body.pg-light .pg-gen-log-entry
{
    border-color: rgba(0,60,94,0.1);
    background: #f5f8fb;
}
.pg-gen-log-entry:hover,
.pg-gen-log-entry:focus-visible
{
    background: rgba(103,186,234,0.08);
    border-color: rgba(103,186,234,0.35);
    outline: none;
}
.pg-log-meta
{
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 4px;
}
.pg-log-stamp
{
    font-size: 0.65rem;
    color: #49BCB3;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.pg-log-label
{
    font-size: 0.62rem;
    color: #67BAEA;
    letter-spacing: 0.12em;
    opacity: 0.7;
    text-transform: uppercase;
}
.pg-log-name
{
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    color: #fff;
    font-size: 1.05rem;
}
body.pg-light .pg-log-name { color: #1a2430; }
.pg-log-preview
{
    font-size: 0.76rem;
    color: #7a8898;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-log-modal-content
{
    background: #0d1525;
    border: 1px solid #67BAEA;
    color: #fff;
}
body.pg-light .pg-log-modal-content
{
    background: #fff;
    border-color: #67BAEA;
    color: #1a2430;
}
.pg-log-modal-body { text-align: center; padding: 36px 28px 24px; }
.pg-log-modal-header
{
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: #67BAEA;
    margin-bottom: 6px;
    font-weight: 700;
}
.pg-log-modal-stamp
{
    font-size: 0.8rem;
    color: #49BCB3;
    margin-bottom: 18px;
}
.pg-log-modal-name
{
    font-weight: 700;
    font-size: clamp(1.2rem, 4vw, 2rem);
    margin-bottom: 20px;
    word-break: break-word;
}
.pg-log-modal-entry
{
    color: #a0aab8;
    font-style: italic;
    line-height: 1.65;
    margin: 0;
}
body.pg-light .pg-log-modal-entry { color: #5a6a7a; }
.pg-log-modal-footer
{
    border-top: 1px solid rgba(103,186,234,0.18);
    justify-content: center;
    padding: 12px 28px 20px;
}

/*
 * Pizzazz wrap - same checkbox alignment as sibling .form-check rows.
 * FX box extends outward so lights/glow cover the checkbox without shifting it.
 * block + fit-content: own row (like other checks) but FX hugs label width.
 */
.pg-pizzazz-wrap.form-check
{
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    vertical-align: top;
    padding-top: 0;
    padding-bottom: 0;
    padding-right: 12px;
    /* Match Bootstrap .form-check padding-left (do not indent) */
    padding-left: 1.5em;
    margin-left: 0;
    overflow: visible;
    z-index: 0;
}
.pg-pizzazz-wrap .form-check-input,
.pg-pizzazz-wrap .form-check-label
{
    position: relative;
    z-index: 2;
}
.pg-pizzazz-fx
{
    position: absolute;
    top: -6px;
    right: -6px;
    bottom: -6px;
    left: -10px; /* covers checkbox which sits in the -1.5em gutter */
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

/* Jackpot: casino bulbs around checkbox + label */
.pg-pizzazz-bulb
{
    position: absolute;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 50%;
    background: #ffd56a;
    animation: pgCasinoBlink 0.3s linear infinite;
}
.pg-pizzazz-bulb:nth-child(3n)   { background: #00C070; animation-delay: 0.10s; }
.pg-pizzazz-bulb:nth-child(3n+1) { background: #ff5a5a; animation-delay: 0.20s; }
@keyframes pgCasinoBlink
{
    0%, 100% { opacity: 0.18; transform: scale(0.8); }
    50%      { opacity: 1;    transform: scale(1.2); box-shadow: 0 0 9px currentColor; }
}

/* Launch: telemetry orbit + glow when pizzazz is on */
.pg-pizzazz-wrap.is-pz-on.pg-pz-launch
{
    border-radius: 8px;
}
.pg-pizzazz-wrap.is-pz-on.pg-pz-launch::before
{
    content: "";
    position: absolute;
    top: -6px;
    right: -6px;
    bottom: -6px;
    left: -10px;
    border-radius: 8px;
    border: 1px solid rgba(103, 186, 234, 0.55);
    box-shadow:
        0 0 12px rgba(103, 186, 234, 0.35),
        inset 0 0 10px rgba(0, 192, 112, 0.12);
    animation: pzTelemetryPulse 1.6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
.pg-pz-orbit-dot
{
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    border-radius: 50%;
    background: #85C8EE;
    box-shadow: 0 0 6px #67BAEA;
    animation: pzOrbitSpin var(--pz-dur, 2.4s) linear infinite;
}
.pg-pz-orbit-dot:nth-child(2) { background: #00C070; box-shadow: 0 0 6px #00C070; }
.pg-pz-orbit-dot:nth-child(3) { background: #fff; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; }
.pg-pz-orbit-dot:nth-child(4) { background: #49BCB3; box-shadow: 0 0 6px #49BCB3; }
@keyframes pzTelemetryPulse
{
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}
@keyframes pzOrbitSpin
{
    from { transform: rotate(0deg) translateX(var(--pz-radius, 40px)) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(var(--pz-radius, 40px)) rotate(-360deg); }
}
body.pg-light .pg-pizzazz-wrap.is-pz-on.pg-pz-launch::before
{
    border-color: rgba(0, 122, 154, 0.55);
    box-shadow:
        0 0 12px rgba(103, 186, 234, 0.45),
        inset 0 0 10px rgba(0, 192, 112, 0.1);
}

/*
 * Razzle Dazzle wrap — same layout as pizzazz so the checkbox stays aligned.
 * FX only fire on jackpot / launch-control (classic has no effects).
 */
.pg-razzle-wrap.form-check
{
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    vertical-align: top;
    padding-top: 0;
    padding-bottom: 0;
    padding-right: 12px;
    padding-left: 1.5em;
    margin-left: 0;
    overflow: visible;
    z-index: 0;
}
.pg-razzle-wrap .form-check-input,
.pg-razzle-wrap .form-check-label
{
    position: relative;
    z-index: 2;
}
.pg-razzle-fx
{
    position: absolute;
    top: -10px;
    right: -12px;
    bottom: -10px;
    left: -10px;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

/* Jackpot: denser rainbow bulbs + spark bursts (more than pizzazz) */
.pg-razzle-bulb
{
    position: absolute;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: #ffd56a;
    animation: pgRazzleBlink 0.22s linear infinite;
}
.pg-razzle-bulb:nth-child(6n)   { background: #ff5a5a; }
.pg-razzle-bulb:nth-child(6n+1) { background: #ffd56a; }
.pg-razzle-bulb:nth-child(6n+2) { background: #00C070; }
.pg-razzle-bulb:nth-child(6n+3) { background: #67BAEA; }
.pg-razzle-bulb:nth-child(6n+4) { background: #c77dff; }
.pg-razzle-bulb:nth-child(6n+5) { background: #ff8c42; }
@keyframes pgRazzleBlink
{
    0%, 100% { opacity: 0.15; transform: scale(0.7); }
    50%      { opacity: 1;    transform: scale(1.35); box-shadow: 0 0 12px currentColor; }
}
.pg-razzle-spark
{
    position: absolute;
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px #ffd56a;
    animation: pgRazzleSpark 0.9s ease-in-out infinite;
}
@keyframes pgRazzleSpark
{
    0%, 100%
    {
        opacity: 0.2;
        transform: translate(0, 0) scale(0.6);
    }
    50%
    {
        opacity: 1;
        transform: translate(var(--rd-spark-x, 10px), var(--rd-spark-y, -10px)) scale(1.4);
    }
}
.pg-razzle-wrap.is-rd-on
{
    border-radius: 10px;
}
/* Duplicated color stops + 200% size = seamless loop (same trick as slot-cabinet-sign).
 * Each half ends purple→red so the cycle joins cleanly instead of snapping. */
.pg-razzle-wrap.is-rd-on::before
{
    content: "";
    position: absolute;
    top: -8px;
    right: -10px;
    bottom: -8px;
    left: -10px;
    border-radius: 10px;
    border: 2px solid transparent;
    background:
        linear-gradient(transparent, transparent) padding-box,
        linear-gradient(
            90deg,
            #ff5a5a 0%,
            #ffd56a 10%,
            #00C070 20%,
            #67BAEA 30%,
            #c77dff 40%,
            #ff5a5a 50%,
            #ff5a5a 50%,
            #ffd56a 60%,
            #00C070 70%,
            #67BAEA 80%,
            #c77dff 90%,
            #ff5a5a 100%
        ) border-box;
    background-size: 100% 100%, 200% 100%;
    background-position: 0 0, 0% 50%;
    background-repeat: no-repeat, no-repeat;
    animation: pgRazzleBorder 1.4s linear infinite;
    pointer-events: none;
    z-index: 0;
    box-shadow:
        0 0 18px rgba(255, 213, 106, 0.45),
        0 0 28px rgba(199, 125, 255, 0.25);
}
@keyframes pgRazzleBorder
{
    0%   { background-position: 0 0, 0% 50%; }
    100% { background-position: 0 0, 100% 50%; }
}

/* Launch: bigger aura + more orbit dots + glitter (more than pizzazz) */
.pg-razzle-wrap.is-rd-on.pg-rd-launch
{
    border-radius: 10px;
}
.pg-razzle-wrap.is-rd-on.pg-rd-launch::before
{
    border-width: 2px;
    box-shadow:
        0 0 22px rgba(255, 90, 90, 0.4),
        0 0 32px rgba(103, 186, 234, 0.35),
        inset 0 0 14px rgba(199, 125, 255, 0.18);
    animation: pgRazzleBorder 1.1s linear infinite, pgRazzlePulse 1.1s ease-in-out infinite;
}
@keyframes pgRazzlePulse
{
    0%, 100% { opacity: 0.7; filter: brightness(1); }
    50%      { opacity: 1;   filter: brightness(1.35); }
}
.pg-rd-orbit-dot
{
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: #ffd56a;
    box-shadow: 0 0 8px #ffd56a;
    animation: rdOrbitSpin var(--rd-dur, 2s) linear infinite;
}
.pg-rd-orbit-dot:nth-child(odd) { width: 4px; height: 4px; margin: -2px 0 0 -2px; }
@keyframes rdOrbitSpin
{
    from { transform: rotate(0deg) translateX(var(--rd-radius, 40px)) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(var(--rd-radius, 40px)) rotate(-360deg); }
}
.pg-rd-glitter
{
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px #fff;
    animation: rdGlitter 1.1s ease-in-out infinite;
}
@keyframes rdGlitter
{
    0%, 100% { opacity: 0; transform: scale(0.4); }
    40%      { opacity: 1; transform: scale(1.6); }
    70%      { opacity: 0.4; transform: scale(0.8); }
}
/* Keep label readable — soft glow only, no clipped rainbow text */
.pg-razzle-wrap.is-rd-on.pg-rd-launch .form-check-label
{
    color: #fff;
    text-shadow:
        0 0 6px rgba(255, 213, 106, 0.65),
        0 0 14px rgba(103, 186, 234, 0.35);
}
body.pg-light .pg-razzle-wrap.is-rd-on.pg-rd-launch .form-check-label
{
    color: #003C5E;
    text-shadow:
        0 0 4px rgba(255, 213, 106, 0.45),
        0 0 10px rgba(103, 186, 234, 0.25);
}
body.pg-light .pg-razzle-wrap.is-rd-on::before
{
    box-shadow:
        0 0 16px rgba(255, 90, 90, 0.35),
        0 0 24px rgba(103, 186, 234, 0.3);
}
