/**
 * Campaign Wizard Styles
 * 4-step campaign creation wizard for Casino Promo Portal
 */

/* -----------------------------------------------------------------------
   CSS Custom Properties
   ----------------------------------------------------------------------- */
:root {
    --cw-primary: #4e73df;
    --cw-primary-light: #eef1fb;
    --cw-secondary: #198754;
    --cw-secondary-light: #d1e7dd;
    --cw-danger: #e74a3b;
    --cw-warning: #f6c23e;
    --cw-gray-100: #f8f9fc;
    --cw-gray-200: #eaecf4;
    --cw-gray-500: #b7b9cc;
    --cw-gray-700: #5a5c69;
    --cw-radius: 0.5rem;
    --cw-radius-lg: 0.75rem;
    --cw-shadow: 0 0.15rem 1.75rem rgba(58, 59, 69, 0.1);
    --cw-transition: 0.25s ease;
}

/* -----------------------------------------------------------------------
   Step Indicator Bar

   Each label hangs below its circle (absolutely positioned, so it takes no
   room in the row) at a fixed width, and wraps rather than widening. The
   connectors are never narrower than that width less one circle, so two
   neighbouring labels can't reach each other at any screen size. The bar's
   side padding leaves room for the outer half of the first and last label,
   and its bottom padding for two lines of label plus the "N issues" line.
   ----------------------------------------------------------------------- */
.wizard-steps-bar {
    --cw-step-size: 2.5rem;
    --cw-step-label-width: 7.5rem;
    --cw-step-label-gap: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem calc((var(--cw-step-label-width) - var(--cw-step-size)) / 2) 3.75rem;
    gap: 0;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--cw-step-size);
    height: var(--cw-step-size);
    border-radius: 50%;
    background: var(--cw-gray-200);
    color: var(--cw-gray-500);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid var(--cw-gray-200);
    transition: all var(--cw-transition);
    position: relative;
    cursor: default;
    flex-shrink: 0;
}

.step-indicator.active {
    background: var(--cw-primary);
    border-color: var(--cw-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--cw-primary-light);
}

.step-indicator.completed {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.step-connector {
    flex: 1;
    height: 3px;
    min-width: calc(var(--cw-step-label-width) - var(--cw-step-size) + var(--cw-step-label-gap));
    max-width: 10rem;
    background: var(--cw-gray-200);
    transition: background var(--cw-transition);
}

.step-connector.completed {
    background: #198754;
}

.step-label {
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: var(--cw-step-label-width);
    margin-top: 0.4rem;
    font-size: 0.75rem;
    line-height: 1.25;
    color: var(--cw-gray-700);
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    font-weight: 500;
}

.step-indicator.active .step-label {
    color: var(--cw-primary);
    font-weight: 600;
}

.step-indicator.completed .step-label {
    color: #198754;
}

/* Clickable step indicators in edit mode */
.wizard-steps-bar.is-edit-mode .step-indicator:not(.active) {
    cursor: pointer;
}
.wizard-steps-bar.is-edit-mode .step-indicator:not(.active):hover {
    background: var(--cw-primary-light);
    border-color: var(--cw-primary);
    color: var(--cw-primary);
}
.wizard-steps-bar.is-edit-mode .step-indicator:not(.active):focus {
    outline: 2px solid var(--cw-primary);
    outline-offset: 2px;
}

/* Issue count sub-label below the step name */
.step-issue-count {
    display: block;
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--cw-danger);
    margin-top: 0.1rem;
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.step-issue-count:empty {
    display: none;
}

/* Cross-step attention bar */
.cw-attention-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    padding: 0.45rem 0.85rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--cw-radius);
    font-size: 0.8rem;
    color: #92400e;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 64px;
    z-index: 9;
}

.cw-attention-bar > i {
    color: #d97706;
    font-size: 1rem;
    flex-shrink: 0;
}

.cw-attention-bar #cwAttentionText {
    font-weight: 500;
}

.cw-attention-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.cw-attention-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(0,0,0,0.07);
    color: #92400e;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background var(--cw-transition);
    line-height: 1.5;
}

.cw-attention-pill:hover,
.cw-attention-pill:focus-visible {
    background: rgba(0,0,0,0.14);
    outline: 2px solid #d97706;
    outline-offset: 1px;
    color: #78350f;
}

/* Step status badge — green check (pass) or red count (issues) */
.step-status-badge {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    min-width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.65rem;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.18rem;
    border: 2px solid #fff;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    line-height: 1;
    z-index: 2;
}

.step-status-badge.badge-pass {
    background: #198754;
    color: #fff;
    opacity: 1;
    transform: scale(1);
}

.step-status-badge.badge-fail {
    background: var(--cw-danger);
    color: #fff;
    opacity: 1;
    transform: scale(1);
    min-width: 1.25rem;
}

/* -----------------------------------------------------------------------
   Wizard Steps Content
   ----------------------------------------------------------------------- */
.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: cwFadeIn 0.3s ease;
}

@keyframes cwFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wizard-step-body {
    padding: 1rem 0;
}

/* -----------------------------------------------------------------------
   Campaign Type (dropdown + description panel — see wizard.html.twig and
   App\Campaign\CampaignTypeCatalog)
   ----------------------------------------------------------------------- */
#campaignTypeDescription:empty {
    display: none;
}

/* -----------------------------------------------------------------------
   Theme Thumbnail Cards
   ----------------------------------------------------------------------- */
/* Step 2's theme picker: small cards under Standard / Football / USA
   headings, about 7 to a row on a desktop and 3 on a phone. The sandbox
   draws its own cards and keeps its 58px thumbnails. */
.theme-picker-group + .theme-picker-group {
    margin-top: 0.9rem;
}

.theme-picker-heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cw-gray-700);
    margin: 0 0 0.4rem;
}

.theme-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 0.6rem;
}

.theme-card-cell {
    position: relative;
}

.theme-card {
    position: relative;
    height: 100%;
    padding: 0.3rem 0.3rem 0.4rem;
    border: 2px solid var(--cw-gray-200);
    border-radius: var(--cw-radius);
    cursor: pointer;
    transition: border-color var(--cw-transition), box-shadow var(--cw-transition);
    background: #fff;
    text-align: center;
}

.theme-card:hover {
    border-color: var(--cw-primary);
    box-shadow: 0 2px 8px rgba(78, 115, 223, 0.15);
}

.theme-card:focus-visible {
    outline: 3px solid var(--cw-primary);
    outline-offset: 2px;
}

.theme-card.selected {
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.2);
}

#themeCards .theme-thumbnail {
    height: 44px;
    margin-bottom: 0.3rem;
}

/* A long name wraps to a second line rather than being cut off. */
.theme-card-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.theme-card.selected .theme-card-name {
    color: var(--cw-primary);
}

/* The ✓ says "selected" as well as the border, so colour is not the only
   signal (WCAG 1.4.1). Top left, clear of the Preview button. */
.theme-card-check {
    display: none;
    position: absolute;
    top: 0.1rem;
    left: 0.1rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--cw-primary);
    color: #fff;
    border: 2px solid #fff;
    font-size: 0.75rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
}

.theme-card.selected .theme-card-check {
    display: flex;
}

.btn-theme-preview {
    position: absolute;
    top: calc(0.3rem + 5px);
    right: calc(0.3rem + 5px);
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ac-control-border, #7a8794);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #1d2630;
    font-size: 0.95rem;
    line-height: 1;
}

.btn-theme-preview:hover {
    background: #fff;
    color: var(--cw-primary);
    border-color: var(--cw-primary);
}

.btn-theme-preview:focus-visible {
    outline: 3px solid var(--cw-primary);
    outline-offset: 1px;
}

#btnPreviewComingSoonPage {
    font-weight: 700;
}

#btnPreviewThankYouPage {
    font-weight: 700;
}

/* -----------------------------------------------------------------------
   Theme Preview Modal
   ----------------------------------------------------------------------- */
#themePreviewCanvas {
    border: 1px solid var(--cw-gray-200);
    border-radius: var(--cw-radius-lg);
    /* overflow: hidden; */
    background: #fff;
    overflow-y: auto;
}

#comingSoonPreviewCanvas {
    border: 1px solid var(--cw-gray-200);
    border-radius: var(--cw-radius-lg);
    /* overflow: hidden; */
    background: #fff;
    overflow-y: auto;
}

#thankYouPreviewCanvas {
    border: 1px solid var(--cw-gray-200);
    border-radius: var(--cw-radius-lg);
    /* overflow: hidden; */
    background: #fff;
    overflow-y: auto;
}

/* Under a Custom Template the two previews are the real campaign page in a
   frame (openCustomTemplatePagePreview()). */
.cw-page-preview-frame {
    display: block;
    width: 100%;
    height: 75vh;
    border: 0;
}

.cw-page-preview-status {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--cw-gray-700);
}

.cw-theme-preview {
    min-height: 620px;
    display: flex;
    flex-direction: column;
    background: #f5f7fb;
    color: #1f2a3a;
}

.cw-preview-header {
    padding: 1.4rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cw-preview-header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.cw-preview-header-inner--split {
    min-height: 130px;
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}

.cw-preview-split-left,
.cw-preview-split-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cw-preview-split-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.cw-preview-logo {
    max-height: 135px;
    width: auto;
}

/* Football program logo — never gets the white/dark filters applied to org logos */
.cw-preview-football-logo {
    max-height: 120px;
    width: auto;
    flex-shrink: 0;
}

/* Side-by-side org + football logos */
.cw-preview-dual-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

/* Split-header right panel: football logo fills the panel height */
.cw-preview--split_header .cw-preview-split-right .cw-preview-football-logo {
    max-height: 100px;
}

.cw-preview-logo-placeholder {
    width: 108px;
    height: 46px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--cw-preview-primary), var(--cw-preview-secondary));
}

.cw-preview-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.cw-preview-middle {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.8rem;
}

.cw-preview-page-content {
    width: min(94%, 760px);
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 30px rgba(24, 39, 75, 0.12);
    padding: 1.4rem;
}

.cw-preview-page-content a,
.cw-preview-page-content a:visited,
.cw-preview-page-content a:hover,
.cw-preview-page-content a:active {
    color: var(--cw-preview-secondary);
}

.cw-preview-content-card {
    width: min(92%, 560px);
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 30px rgba(24, 39, 75, 0.12);
    padding: 1.25rem 1.3rem;
}

.cw-preview-kicker {
    margin: 0 0 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: #6f7f97;
    font-weight: 700;
}

.cw-preview-content-card h4 {
    margin: 0 0 0.45rem;
    font-size: 1.12rem;
}

.cw-preview-content-card p {
    margin: 0;
    color: #566277;
}

.cw-preview-sample-lines {
    margin-top: 1rem;
    display: grid;
    gap: 0.5rem;
}

.cw-preview-sample-lines span {
    height: 8px;
    border-radius: 999px;
    background: rgba(69, 89, 120, 0.18);
}

.cw-preview-sample-lines span:nth-child(2) {
    width: 78%;
}

.cw-preview-sample-lines span:nth-child(3) {
    width: 64%;
}

.cw-preview-footer {
    margin-top: auto;
    padding: 0.9rem 1.2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.cw-preview-footer-inner {
    text-align: center;
}

.cw-preview-footer-inner img {
    max-height: 56px;
    width: auto;
}

.cw-preview-footer-inner p {
    margin: 0;
}

.cw-preview--light_classic {
    background: linear-gradient(180deg, #f8fbff 0%, #f5f7fb 44%);
}

.cw-preview--light_classic .cw-preview-header {
    background: linear-gradient(135deg, var(--cw-preview-primary) 0%, var(--cw-preview-secondary) 100%);
    border-bottom: none;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.cw-preview--light_classic .cw-preview-logo,
.cw-preview--light_classic .cw-preview-logo-placeholder {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 18px;
    padding: 10px 18px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.cw-preview--light_classic .cw-preview-content-card {
    border-top: 4px solid var(--cw-preview-primary);
}

.cw-preview--dark_overlay {
    background:
        radial-gradient(circle at top left, var(--cw-preview-primary) 0%, transparent 42%),
        linear-gradient(140deg, #1b2537 0%, #101827 72%);
    color: #eef4ff;
}

.cw-preview--dark_overlay .cw-preview-title,
.cw-preview--dark_overlay .cw-preview-content-card h4 {
    color: #ffffff;
}

.cw-preview--dark_overlay .cw-preview-header {
    background:
        linear-gradient(135deg, rgba(8, 13, 20, 0.68) 0%, rgba(13, 22, 36, 0.88) 100%),
        var(--cw-preview-primary);
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.cw-preview--dark_overlay .cw-preview-content-card {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%),
        rgba(20, 30, 46, 0.82);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 34px rgba(4, 8, 14, 0.3);
    color: #e9f0ff;
}

.cw-preview--dark_overlay .cw-preview-content-card p,
.cw-preview--dark_overlay .cw-preview-kicker {
    color: #dce8fb;
}

.cw-preview--dark_overlay .cw-preview-sample-lines span {
    background: rgba(220, 232, 251, 0.28);
}

.cw-preview--dark_overlay .cw-preview-footer {
    border-top-color: rgba(255, 255, 255, 0.12);
}

/* The footer's own text colour, as .campaign-footer sets it on the page.
   Never on its descendants: content brings its own colours (a preset's
   panel), and the preview shows what players will see. */
.cw-preview--dark_overlay .cw-preview-footer-inner {
    color: #eef4ff;
}

.cw-preview--dark_overlay .cw-preview-footer-inner img {
    filter: brightness(1.04);
}

.cw-preview--dark_overlay a,
.cw-preview--dark_overlay a:visited {
    color: var(--cw-preview-secondary);
}

.cw-preview--dark_overlay a:hover,
.cw-preview--dark_overlay a:active {
    color: var(--cw-preview-secondary);
    opacity: 0.82;
}

.cw-preview--split_header .cw-preview-header {
    padding: 0;
    background: linear-gradient(90deg, var(--cw-preview-primary) 0%, var(--cw-preview-primary) 52%, var(--cw-preview-secondary) 52%, var(--cw-preview-secondary) 100%);
}

.cw-preview--split_header .cw-preview-header-inner {
    min-height: 130px;
}

.cw-preview--split_header .cw-preview-logo {
    /* filter: brightness(0) invert(1); */
}

.cw-preview--hero_banner .cw-preview-header {
    border-bottom: 0;
    background:
        linear-gradient(rgba(13, 28, 52, 0.52), rgba(13, 28, 52, 0.58)),
        linear-gradient(120deg, var(--cw-preview-primary) 0%, var(--cw-preview-secondary) 100%);
    min-height: 178px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-preview--hero_banner .cw-preview-title {
    color: #fff;
    font-size: 1.35rem;
}

.cw-preview--hero_banner .cw-preview-logo {
    /* filter: brightness(0) invert(1); */
}

/* -----------------------------------------------------------------------
   Standard themes 5–10 — the wizard's and sandbox's picture of campaign.css's
   .campaign-theme-{id}. Text on or in the admin's colours uses the
   --cw-preview-on-* / --cw-preview-*-text values football-campaign-preview.js
   works out (the page's ThemePalette). Edges are drawn in forms the
   sandbox's "Take Screenshot" (html2canvas 1.4.1) draws as the browser does,
   checked by exporting each theme: no clip-path or mask-image (not drawn at
   all), no calc() in a gradient's colour stops (the stops are lost and the
   edge goes soft), no repeated radial gradient (drawn once), and circles
   rather than ellipses (an ellipse away from the box's centre is misplaced).
   ----------------------------------------------------------------------- */
.cw-preview--diagonal_edge {
    background: #f4f5f7;
    color: #1d2330;
}

.cw-preview--diagonal_edge .cw-preview-header {
    border-bottom: 0;
    padding-bottom: 3rem;
    background:
        linear-gradient(to bottom right, transparent 48.5%, #f4f5f7 50%) left bottom / 100% 30px no-repeat,
        linear-gradient(115deg, var(--cw-preview-primary) 0 64%, var(--cw-preview-secondary) 64% 100%);
}

.cw-preview--diagonal_edge .cw-preview-header-inner {
    align-items: flex-start;
}

.cw-preview--diagonal_edge .cw-preview-content-card {
    border-radius: 6px;
    border-left: 4px solid var(--cw-preview-secondary);
}

.cw-preview--diagonal_edge a {
    color: var(--cw-preview-primary-text);
}

.cw-preview--wave {
    background: #ffffff;
    color: #1b2230;
}

/* Each hump is the top of a large circle sunk below its strip, so it ends
   where the page's waves do: the secondary crest on the left, the page
   colour's on the right. */
.cw-preview--wave .cw-preview-header {
    border-bottom: 0;
    padding-bottom: 3.5rem;
    background:
        radial-gradient(circle 1800px at 75% 1814px, #ffffff 99.9%, transparent 100%) left bottom / 100% 44px no-repeat,
        radial-gradient(circle 1200px at 0 1224px, #ffffff 99.9%, transparent 100%) left bottom / 100% 44px no-repeat,
        radial-gradient(circle 1400px at 20% 1410px, var(--cw-preview-secondary) 99.9%, transparent 100%) left bottom / 100% 60px no-repeat,
        radial-gradient(circle 1400px at 100% 1416px, var(--cw-preview-secondary) 99.9%, transparent 100%) left bottom / 100% 60px no-repeat,
        var(--cw-preview-primary);
}

/* The page's logo plate (layout.html.twig's campaign-header--logo-plate):
   a white-logo header for an organization that has no white logo. */
.cw-preview--diagonal_edge .cw-preview-header-inner--plate .cw-preview-logo,
.cw-preview--wave .cw-preview-header-inner--plate .cw-preview-logo,
.cw-preview--marquee .cw-preview-header-inner--plate .cw-preview-logo,
.cw-preview--neon_night .cw-preview-header-inner--plate .cw-preview-logo,
.cw-preview--gradient_glass .cw-preview-header-inner--plate .cw-preview-logo {
    padding: 8px 14px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.94);
}

.cw-preview--wave .cw-preview-content-card {
    border-radius: 20px;
}

.cw-preview--wave a {
    color: var(--cw-preview-secondary-text);
}

.cw-preview--marquee {
    background: #fbf7ef;
    color: #2b2118;
}

/* The bulbs are a dotted rule: the page's repeated radial gradient
   would export as a single bulb. */
.cw-preview--marquee .cw-preview-header {
    position: relative;
    border-bottom: 0;
    padding: 2.2rem 1.25rem;
    background: var(--cw-preview-primary);
}

.cw-preview--marquee .cw-preview-header::before,
.cw-preview--marquee .cw-preview-header::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    border-top: 9px dotted var(--cw-preview-secondary);
}

.cw-preview--marquee .cw-preview-header::before {
    top: 7px;
}

.cw-preview--marquee .cw-preview-header::after {
    bottom: 7px;
}

.cw-preview--marquee .cw-preview-logo,
.cw-preview--marquee .cw-preview-logo-placeholder {
    padding: 8px 16px;
    border: 5px double var(--cw-preview-secondary);
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.14);
}

.cw-preview--marquee .cw-preview-content-card {
    border: 4px double var(--cw-preview-secondary);
    border-radius: 10px;
}

.cw-preview--marquee a {
    color: var(--cw-preview-primary-text);
}

.cw-preview--neon_night {
    background: #0a0b12;
    color: #eef0ff;
}

.cw-preview--neon_night .cw-preview-header {
    background: #07080d;
    border-bottom: 2px solid var(--cw-preview-primary);
    box-shadow: 0 2px 22px -4px var(--cw-preview-primary);
}

.cw-preview--neon_night .cw-preview-logo {
    filter: drop-shadow(0 0 10px var(--cw-preview-primary));
}

.cw-preview--neon_night .cw-preview-content-card,
.cw-preview--neon_night .cw-preview-page-content {
    background: #141724;
    border-color: var(--cw-preview-primary);
    box-shadow: 0 0 24px -8px var(--cw-preview-primary);
    color: #eef0ff;
}

.cw-preview--neon_night .cw-preview-content-card h4 {
    color: #ffffff;
}

.cw-preview--neon_night .cw-preview-content-card p,
.cw-preview--neon_night .cw-preview-kicker {
    color: #aeb2cb;
}

.cw-preview--neon_night .cw-preview-sample-lines span {
    background: rgba(238, 240, 255, 0.22);
}

.cw-preview--neon_night .cw-preview-footer {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.cw-preview--neon_night .cw-preview-footer-inner {
    color: #eef0ff;
}

.cw-preview--neon_night a,
.cw-preview--neon_night a:visited {
    color: var(--cw-preview-secondary-text);
}

.cw-preview--top_ribbon {
    background: #ffffff;
    color: #1b1f27;
}

.cw-preview--top_ribbon .cw-preview-header {
    background: #ffffff;
    border-top: 6px solid var(--cw-preview-primary);
    border-bottom: 2px solid var(--cw-preview-secondary);
    padding: 1rem 1.25rem;
}

.cw-preview-header-inner--ribbon {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cw-preview-header-inner--ribbon .cw-preview-logo {
    max-height: 64px;
}

.cw-preview-ribbon-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: right;
    color: var(--cw-preview-primary-text);
}

.cw-preview--top_ribbon .cw-preview-content-card {
    border-radius: 2px;
    box-shadow: none;
    border-color: #d9dde4;
}

.cw-preview--top_ribbon a {
    color: var(--cw-preview-primary-text);
    text-decoration: underline;
}

/* The page's blobs are its colours at 30%; the preview draws them full
   strength under a dark veil, which html2canvas can render. */
.cw-preview--gradient_glass {
    background:
        linear-gradient(rgba(11, 14, 26, 0.7), rgba(11, 14, 26, 0.7)),
        radial-gradient(circle at 12% 8%, var(--cw-preview-primary) 0, transparent 42%),
        radial-gradient(circle at 88% 30%, var(--cw-preview-secondary) 0, transparent 40%),
        #0b0e1a;
    color: #ffffff;
}

.cw-preview--gradient_glass .cw-preview-header {
    background: transparent;
    border-bottom: 0;
    padding-top: 2.4rem;
}

.cw-preview--gradient_glass .cw-preview-logo {
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.cw-preview--gradient_glass .cw-preview-content-card,
.cw-preview--gradient_glass .cw-preview-page-content {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%),
        rgba(16, 19, 34, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
    border-radius: 18px;
    color: #ffffff;
}

.cw-preview--gradient_glass .cw-preview-content-card h4 {
    color: #ffffff;
}

.cw-preview--gradient_glass .cw-preview-content-card p,
.cw-preview--gradient_glass .cw-preview-kicker {
    color: #c9cde0;
}

.cw-preview--gradient_glass .cw-preview-sample-lines span {
    background: rgba(255, 255, 255, 0.22);
}

.cw-preview--gradient_glass .cw-preview-footer {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.cw-preview--gradient_glass .cw-preview-footer-inner {
    color: #ffffff;
}

.cw-preview--gradient_glass a,
.cw-preview--gradient_glass a:visited {
    color: var(--cw-preview-secondary-text);
}

/* -----------------------------------------------------------------------
   Football Theme Previews (modal) — green / grass tailored
   ----------------------------------------------------------------------- */
.cw-preview--gridiron .cw-preview-header {
    /* html2canvas (used by the sandbox's "Take Screenshot" button) doesn't render
       repeating-linear-gradient() — it silently drops it and any layer before it in
       the stack. Same finite pattern, tiled via background-size + repeat-x instead,
       renders identically on-screen and is what html2canvas actually supports. */
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 60px) left top / 60px 100% repeat-x,
        linear-gradient(135deg, var(--cw-preview-primary) 0%, var(--cw-preview-secondary) 100%);
    border-top: 4px solid rgba(255, 255, 255, 0.85);
    border-bottom: 4px solid rgba(255, 255, 255, 0.85);
}
.cw-preview--gridiron {
    background: #eaf3ea;
}
.cw-preview--gridiron .cw-preview-content-card {
    border-top: 5px solid var(--cw-preview-primary);
    border-radius: 14px;
}

.cw-preview--end_zone .cw-preview-header {
    background:
        linear-gradient(115deg, transparent 0%, transparent 64%, rgba(255, 255, 255, 0.20) 64%, rgba(255, 255, 255, 0.20) 71%, transparent 71%),
        linear-gradient(135deg, var(--cw-preview-secondary) 0%, var(--cw-preview-primary) 70%);
    border-bottom: 6px solid var(--cw-preview-secondary);
}
.cw-preview--end_zone {
    background: #f2f6ee;
}
.cw-preview--end_zone .cw-preview-content-card {
    border-left: 6px solid var(--cw-preview-primary);
    border-radius: 12px;
}

.cw-preview--kickoff .cw-preview-header {
    background: linear-gradient(160deg, var(--cw-preview-primary) 0%, var(--cw-preview-secondary) 100%);
    border-radius: 0 0 26px 26px;
}
.cw-preview--kickoff {
    background: #f6faf6;
}
.cw-preview--kickoff .cw-preview-content-card {
    border-radius: 18px;
}

.cw-preview--stadium_lights {
    background: #081210;
    color: #e8f3ea;
}
.cw-preview--stadium_lights .cw-preview-header {
    background:
        /* rgba(), not color-mix(): the sandbox's screenshot can't read color-mix(). */
        radial-gradient(circle at 50% -10%, rgba(var(--cw-preview-secondary-rgb, 0, 0, 0), 0.34) 0%, transparent 55%),
        radial-gradient(circle at top left, var(--cw-preview-primary) 0%, transparent 46%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.96) 60%, rgba(0, 0, 0, 0.97) 100%);
    border-bottom: 1px solid rgba(120, 220, 150, 0.18);
}
.cw-preview--stadium_lights .cw-preview-title,
.cw-preview--stadium_lights .cw-preview-content-card h4 {
    color: #ffffff;
}
.cw-preview--stadium_lights .cw-preview-content-card {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%),
        rgba(12, 28, 20, 0.86);
    border-color: rgba(120, 220, 150, 0.18);
    border-radius: 16px;
    color: #e8f3ea;
}
.cw-preview--stadium_lights .cw-preview-content-card p,
.cw-preview--stadium_lights .cw-preview-kicker {
    color: #b6d4bf;
}
.cw-preview--stadium_lights .cw-preview-logo {
    filter: drop-shadow(0 0 16px rgba(130, 240, 165, 0.45));
}

/* -----------------------------------------------------------------------
   Red / White & Blue (USA) Theme Previews (modal)
   ----------------------------------------------------------------------- */
.cw-preview--star_spangled {
    background: #f5f7fc;
}
.cw-preview--star_spangled .cw-preview-header {
    /* See the .cw-preview--gridiron comment above — repeating-linear-gradient()
       isn't rendered by html2canvas. This stripe block is confined to a sized
       right-hand region (32% width, no-repeat) rather than tiled across the full
       header, so the background-size+repeat-x trick used elsewhere doesn't apply
       here — instead the same 8 stripe pairs are spelled out as percentage stops,
       which scale naturally with the box instead of needing a fixed tile size. */
    background:
        radial-gradient(circle at 12% 28%, rgba(255, 255, 255, 0.88) 0 2px, transparent 3px),
        radial-gradient(circle at 22% 56%, rgba(255, 255, 255, 0.82) 0 2px, transparent 3px),
        radial-gradient(circle at 14% 80%, rgba(255, 255, 255, 0.8) 0 2px, transparent 3px),
        radial-gradient(circle at 30% 38%, rgba(255, 255, 255, 0.75) 0 2px, transparent 3px),
        linear-gradient(to right,
            var(--cw-preview-primary, #b22234) 0 6.25%, #ffffff 6.25% 12.5%,
            var(--cw-preview-primary, #b22234) 12.5% 18.75%, #ffffff 18.75% 25%,
            var(--cw-preview-primary, #b22234) 25% 31.25%, #ffffff 31.25% 37.5%,
            var(--cw-preview-primary, #b22234) 37.5% 43.75%, #ffffff 43.75% 50%,
            var(--cw-preview-primary, #b22234) 50% 56.25%, #ffffff 56.25% 62.5%,
            var(--cw-preview-primary, #b22234) 62.5% 68.75%, #ffffff 68.75% 75%,
            var(--cw-preview-primary, #b22234) 75% 81.25%, #ffffff 81.25% 87.5%,
            var(--cw-preview-primary, #b22234) 87.5% 93.75%, #ffffff 93.75% 100%
        ) right center / 32% 100% no-repeat,
        linear-gradient(135deg, var(--cw-preview-secondary, #0a3161) 0%, #0a1f3d 100%);
    border-top: 5px solid var(--cw-preview-primary, #b22234);
    border-bottom: 5px solid #ffffff;
}
.cw-preview--star_spangled .cw-preview-title {
    color: #ffffff;
}
.cw-preview--star_spangled .cw-preview-content-card {
    border-top: 5px solid var(--cw-preview-primary, #b22234);
    border-radius: 12px;
}
/* Logo readability plate — float logo(s) on a light card over the busy header */
.cw-preview--star_spangled .cw-preview-dual-logo,
.cw-preview--old_glory .cw-preview-dual-logo,
.cw-preview--star_spangled .cw-preview-header-inner > .cw-preview-logo,
.cw-preview--old_glory .cw-preview-header-inner > .cw-preview-logo {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 0 12px 26px rgba(8, 18, 38, 0.4);
}

.cw-preview--red_zone {
    background: #fdf3f4;
}
.cw-preview--red_zone .cw-preview-header {
    /* See the .cw-preview--gridiron comment above — repeating-linear-gradient()
       isn't rendered by html2canvas, so this uses a tiled finite gradient instead. */
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 56px) left top / 56px 100% repeat-x,
        linear-gradient(135deg, var(--cw-preview-primary, var(--cw-preview-secondary)) 0%, var(--cw-preview-secondary) 100%);
    border-top: 4px solid #ffffff;
    border-bottom: 4px solid var(--cw-preview-secondary, #0a3161);
}
.cw-preview--red_zone .cw-preview-title {
    color: #ffffff;
}
.cw-preview--red_zone .cw-preview-content-card {
    border-top: 5px solid var(--cw-preview-secondary, #0a3161);
    border-radius: 12px;
}

.cw-preview--all_american {
    background: #ffffff;
}
.cw-preview--all_american .cw-preview-header {
    background: #ffffff;
    border-top: 6px solid var(--cw-preview-primary, #b22234);
    border-bottom: 6px solid var(--cw-preview-secondary, #0a3161);
}
.cw-preview--all_american .cw-preview-title {
    color: var(--cw-preview-secondary, #0a3161);
}
.cw-preview--all_american .cw-preview-content-card {
    border-left: 6px solid var(--cw-preview-primary, #b22234);
    border-radius: 10px;
}

.cw-preview--old_glory {
    background: #f7f4ec;
}
.cw-preview--old_glory .cw-preview-header {
    /* See the .cw-preview--gridiron comment above — repeating-linear-gradient()
       isn't rendered by html2canvas. Approximating a 125deg diagonal stripe with
       a small rectangular CSS tile (or rasterizing a small SVG snapshot and then
       re-tiling it with background-repeat) both leave visible seams, because the
       stripe angle doesn't divide evenly into an axis-aligned pixel grid. Instead
       this SVG bakes the rotated stripe pattern into ONE large canvas (so
       patternTransform's rotation math runs just once, seamlessly, with no
       external re-tiling) and background-size: cover scales/crops that single
       image to fill the header — always seam-free, at the cost of the stripe
       width scaling slightly with header size instead of staying pixel-exact. */
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cdefs%3E%3Cpattern id='s' width='26' height='26' patternUnits='userSpaceOnUse' patternTransform='rotate(35)'%3E%3Crect width='26' height='26' fill='none'/%3E%3Crect width='10' height='26' fill='%23b22234' fill-opacity='0.55'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='800' height='800' fill='url(%23s)'/%3E%3C/svg%3E") center / cover no-repeat,
        linear-gradient(135deg, var(--cw-preview-primary) 0%, var(--cw-preview-secondary, var(--cw-preview-primary)) 100%);
    border-bottom: 5px solid var(--cw-preview-primary, var(--cw-preview-secondary));
}
.cw-preview--old_glory .cw-preview-title {
    color: #ffffff;
}
.cw-preview--old_glory .cw-preview-content-card {
    border-left: 6px solid var(--cw-preview-primary, var(--cw-preview-secondary));
    border-radius: 10px;
}

/* -----------------------------------------------------------------------
   Standard Theme Card Thumbnails
   ----------------------------------------------------------------------- */
.theme-thumbnail.light-classic-thumb,
.theme-thumbnail.dark-overlay-thumb,
.theme-thumbnail.split-header-thumb,
.theme-thumbnail.hero-banner-thumb {
    height: 58px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.theme-thumbnail.light-classic-thumb {
    background: linear-gradient(135deg, #eef1fb 0%, #ffffff 100%);
}
.theme-thumbnail.dark-overlay-thumb {
    background: linear-gradient(135deg, #1b2537 0%, #101827 100%);
}
.theme-thumbnail.split-header-thumb {
    background: linear-gradient(90deg, #4e73df 0 50%, #fbbc04 50% 100%);
}
.theme-thumbnail.hero-banner-thumb {
    background: linear-gradient(120deg, #4e73df 0%, #fbbc04 100%);
    border-radius: 8px 8px 20px 20px;
}

/* Standard themes 5–10: each swatch is the theme's header in miniature. */
.theme-thumbnail.diagonal-edge-thumb,
.theme-thumbnail.wave-thumb,
.theme-thumbnail.marquee-thumb,
.theme-thumbnail.neon-night-thumb,
.theme-thumbnail.top-ribbon-thumb,
.theme-thumbnail.gradient-glass-thumb {
    height: 58px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.theme-thumbnail.diagonal-edge-thumb {
    background:
        linear-gradient(to bottom right, transparent calc(50% - 1px), #f4f5f7 50%) left bottom / 100% 40% no-repeat,
        linear-gradient(115deg, #4e73df 0 64%, #fbbc04 64% 100%);
}
.theme-thumbnail.wave-thumb {
    background:
        radial-gradient(70% 40% at 30% 100%, #ffffff 98%, transparent 100%) left bottom / 100% 40% no-repeat,
        radial-gradient(70% 55% at 75% 100%, #fbbc04 98%, transparent 100%) left bottom / 100% 55% no-repeat,
        #4e73df;
}
.theme-thumbnail.marquee-thumb {
    background:
        radial-gradient(circle, #fbbc04 0 2.5px, transparent 3px) left 4px / 12px 10px repeat-x,
        radial-gradient(circle, #fbbc04 0 2.5px, transparent 3px) left bottom 4px / 12px 10px repeat-x,
        #8b1e3f;
}
.theme-thumbnail.neon-night-thumb {
    background: linear-gradient(180deg, #07080d 0 64%, #4e73df 64% 68%, #0a0b12 68%);
    box-shadow: inset 0 0 12px rgba(78, 115, 223, 0.35);
}
.theme-thumbnail.top-ribbon-thumb {
    background: linear-gradient(180deg, #4e73df 0 14%, #ffffff 14% 82%, #fbbc04 82% 88%, #ffffff 88%);
}
.theme-thumbnail.gradient-glass-thumb {
    background:
        radial-gradient(circle at 18% 20%, #4e73df 0, transparent 55%),
        radial-gradient(circle at 85% 70%, #fbbc04 0, transparent 50%),
        #0b0e1a;
}

/* -----------------------------------------------------------------------
   Football Theme Card Thumbnails
   ----------------------------------------------------------------------- */
.theme-thumbnail.gridiron-thumb,
.theme-thumbnail.end-zone-thumb,
.theme-thumbnail.kickoff-thumb,
.theme-thumbnail.stadium-lights-thumb,
.theme-thumbnail.star-spangled-thumb,
.theme-thumbnail.red-zone-thumb,
.theme-thumbnail.all-american-thumb,
.theme-thumbnail.old-glory-thumb {
    height: 58px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.theme-thumbnail.gridiron-thumb {
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 2px, transparent 2px 16px),
        linear-gradient(135deg, #2e7d32 0%, #14532d 100%);
}
.theme-thumbnail.end-zone-thumb {
    background:
        linear-gradient(115deg, transparent 60%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0.5) 68%, transparent 68%),
        linear-gradient(135deg, #14532d 0%, #2e7d32 70%);
}
.theme-thumbnail.kickoff-thumb {
    background: linear-gradient(160deg, #43a047 0%, #1b5e20 100%);
    border-radius: 8px 8px 16px 16px;
}
.theme-thumbnail.stadium-lights-thumb {
    background:
        radial-gradient(circle at 50% -20%, rgba(140, 240, 170, 0.5) 0%, transparent 60%),
        linear-gradient(135deg, #0a1a12 0%, #061008 100%);
}

/* Red / White & Blue (USA) theme thumbnails */
.theme-thumbnail.star-spangled-thumb {
    background:
        radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 2px),
        radial-gradient(circle at 34% 60%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 2px),
        radial-gradient(circle at 26% 80%, rgba(255, 255, 255, 0.85) 0 1.5px, transparent 2px),
        linear-gradient(90deg, #0a3161 0 55%, #b22234 55% 67%, #ffffff 67% 79%, #b22234 79% 91%, #ffffff 91% 100%);
}
.theme-thumbnail.red-zone-thumb {
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 2px, transparent 2px 16px),
        linear-gradient(135deg, #c8102e 0%, #8d0d22 100%);
}
.theme-thumbnail.all-american-thumb {
    background:
        linear-gradient(#b22234 0 18%, #ffffff 18% 82%, #0a3161 82% 100%);
}
.theme-thumbnail.old-glory-thumb {
    background:
        repeating-linear-gradient(125deg, rgba(178, 34, 52, 0.85) 0 8px, transparent 8px 18px),
        linear-gradient(135deg, #0a1f3d 0%, #0a3161 100%);
}

/* -----------------------------------------------------------------------
   Background Image Selector
   ----------------------------------------------------------------------- */
.bg-choice-card {
    border: 2px solid var(--cw-gray-200);
    border-radius: var(--cw-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--cw-transition);
    background: #fff;
}
.bg-choice-card:hover {
    border-color: var(--cw-primary);
}
.bg-choice-card.selected {
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.2);
}
.bg-choice-thumb {
    height: 72px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.bg-choice-none {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        repeating-linear-gradient(45deg, #f1f3f5 0 8px, #e9ecef 8px 16px);
    color: #6c757d;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
}

/* -----------------------------------------------------------------------
   Color Pickers
   ----------------------------------------------------------------------- */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker-group input[type="color"] {
    width: 3rem;
    height: 2.25rem;
    padding: 0.15rem;
    border: 1px solid var(--cw-gray-200);
    border-radius: var(--cw-radius);
    cursor: pointer;
    background: none;
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.color-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    vertical-align: middle;
}

/* -----------------------------------------------------------------------
   Field Builder Toggle Rows
   ----------------------------------------------------------------------- */
.field-builder-row {
    background: var(--cw-gray-100);
    border: 1px solid var(--cw-gray-200);
    transition: background var(--cw-transition);
}

.field-builder-row:hover {
    background: #fff;
    border-color: var(--cw-gray-500);
}

.field-builder-row.identity-row {
    border-left: 3px solid var(--cw-primary);
}

.field-builder-row .field-label {
    font-weight: 500;
    font-size: 0.9rem;
}

#identityWarning {
    font-size: 0.85rem;
}

/* Field Builder Toggle Switch Colors */
.field-builder-row .form-check-input {
    /* Unchecked (disabled) - red background */
    background-color: #dc3545;
    border-color: #dc3545;
}

.field-builder-row .form-check-input:checked {
    /* Checked (enabled) - green background */
    background-color: #28a745;
    border-color: #28a745;
}

.field-builder-row .form-check-input:focus {
    /* Focus states */
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

.field-builder-row .form-check-input:not(:checked):focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Require Activation Toggle Switch Colors */
#requireActivationTable .require-activation-toggle {
    background-color: #dc3545;
    border-color: #dc3545;
}

#requireActivationTable .require-activation-toggle:checked {
    background-color: #28a745;
    border-color: #28a745;
}

#requireActivationTable .require-activation-toggle:focus {
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

#requireActivationTable .require-activation-toggle:not(:checked):focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* -----------------------------------------------------------------------
   Game Mapping List
   ----------------------------------------------------------------------- */
#gamesListContainer .game-row {
    border: 1px solid var(--cw-gray-200);
    transition: box-shadow var(--cw-transition);
}

#gamesListContainer .game-row:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

#gamesListContainer .game-row input[type="date"] {
    max-width: 160px;
}

/* -----------------------------------------------------------------------
   Game Entry Cards (Step 3)
   ----------------------------------------------------------------------- */
.game-entry.card {
    border-width: 3px !important;
    border-style: solid !important;
    border-color: var(--cw-gray-300);
    transition: box-shadow 0.2s ease;
}

.game-entry:hover {
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.09);
}

/* Colored header bar — background tint applied inline by JS */
.game-entry-card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
}

/* Numbered circle badge — color applied inline by JS */
.game-entry-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    line-height: 1;
}

/* Collapsed: the header alone, with less space under it, so a campaign with
   fifty games is still a list you can read. */
.game-entry.is-collapsed { margin-bottom: 0.75rem !important; }
.game-entry.is-collapsed .game-entry-body { display: none; }
.game-entry.is-collapsed .game-entry-card-header { border-bottom: 0; }
.game-entry-heading,
.game-entry-heading-text { min-width: 0; }
/* Darker than .text-muted, because it sits on the header's tinted backgrounds. */
.game-entry-summary { color: #495057; font-size: 0.8rem; margin-top: 0.1rem; }

/* Step 2's sections collapse the same way (.ai_docs/campaigns.md,
   Step 2, "Sections collapse"). The summary only says what a closed section is hiding, so an
   open one doesn't repeat itself. */
.cw-collapsible.is-collapsed { margin-bottom: 0.75rem !important; }
.cw-collapsible.is-collapsed > .card-body { display: none; }
.cw-collapsible.is-collapsed > .card-header { border-bottom: 0; }
.cw-card-heading { min-width: 0; }
.cw-card-heading .badge { white-space: normal; text-align: left; }
.cw-card-summary { display: block; color: #495057; font-size: 0.8rem; margin-top: 0.15rem; }
.cw-collapsible:not(.is-collapsed) .cw-card-summary { display: none; }
.cw-card-swatch {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    margin-right: 0.2rem;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 3px;
    vertical-align: -1px;
}
/* Locked open until its problem is fixed: still focusable, so its label can
   say why. */
.cw-card-toggle[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.cw-games-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* -----------------------------------------------------------------------
   Calendar Container
   ----------------------------------------------------------------------- */
.campaign-calendar-wrap {
    margin-top: 1.5rem;
}

#campaignCalendar {
    min-height: 400px;
    background: #fff;
    border-radius: var(--cw-radius);
    padding: 0.75rem;
    border: 1px solid var(--cw-gray-200);
}

#campaignCalendar .fc-daygrid-day.calendar-gap-day {
    background: rgba(231, 74, 59, 0.08);
}

#campaignCalendar .fc-daygrid-day.calendar-gap-day .fc-daygrid-day-number {
    color: var(--cw-danger);
    font-weight: 600;
}

/* Overlap day highlighting (multiple games on same date) */
#campaignCalendar .fc-daygrid-day.calendar-overlap-day {
    background: repeating-linear-gradient(
        45deg,
        #fff3cd,
        #fff3cd 5px,
        #ffe5b3 5px,
        #ffe5b3 10px
    ) !important;
    border: 2px solid #ff9800 !important;
}

#campaignCalendar .fc-daygrid-day.calendar-overlap-day .fc-daygrid-day-number {
    color: #ff6b00;
    font-weight: 700;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* Daily Play markers (simultaneous_games): one per scheduled day */
#campaignCalendar .fc-event.daily-play-marker,
.daily-play-legend {
    background-color: #0f766e;
    color: #fff;
    font-weight: 600;
}

.daily-play-tooltip .tooltip-inner {
    white-space: pre-line;
    text-align: left;
}

/* Campaign milestone events styling */
#campaignCalendar .fc-event.campaign-milestone {
    font-weight: 700;
    font-size: 0.85rem;
}

/* -----------------------------------------------------------------------
   Reward Matrix Upload Area
   ----------------------------------------------------------------------- */
#rewardMatrixZone {
    border: 2px dashed var(--cw-gray-500);
    border-radius: var(--cw-radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--cw-gray-100);
    transition: all var(--cw-transition);
    cursor: pointer;
}

#rewardMatrixZone:hover,
#rewardMatrixZone.drag-over {
    border-color: var(--cw-primary);
    background: var(--cw-primary-light);
}

#rewardMatrixZone .upload-icon {
    font-size: 2rem;
    color: var(--cw-gray-500);
    margin-bottom: 0.5rem;
}

#rewardMatrixZone.drag-over .upload-icon {
    color: var(--cw-primary);
}

#rewardMatrixZone .upload-text {
    font-size: 0.9rem;
    color: var(--cw-gray-700);
}

#rewardMatrixZone .upload-hint {
    font-size: 0.78rem;
    color: var(--cw-gray-500);
    margin-top: 0.25rem;
}

#rewardMatrixPreview {
    margin-top: 1rem;
}

/* -----------------------------------------------------------------------
   Validation Checklist
   ----------------------------------------------------------------------- */
#validationChecklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

#validationChecklist li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--cw-gray-200);
    font-size: 0.9rem;
}

#validationChecklist li:last-child {
    border-bottom: none;
}

#validationChecklist li i {
    font-size: 1.15rem;
    flex-shrink: 0;
}

#validationChecklist .validation-pass span {
    color: #333;
}

#validationChecklist .validation-fail span {
    color: var(--cw-danger);
    font-weight: 500;
}

#validationChecklist .validation-warn span {
    color: #856404;
}

#validationChecklist .validation-info span {
    color: #0c63e4;
}

/* -----------------------------------------------------------------------
   Review Summary Cards
   ----------------------------------------------------------------------- */
.review-card {
    background: var(--cw-gray-100);
    border: 1px solid var(--cw-gray-200);
    border-radius: var(--cw-radius);
    height: 100%;
}

.review-card h6 {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--cw-primary);
}

.review-card p {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.review-card ul {
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

/* -----------------------------------------------------------------------
   Success / Launch Result Area
   ----------------------------------------------------------------------- */
.launch-result {
    animation: cwFadeIn 0.5s ease;
}

.launch-result h4 {
    font-weight: 700;
}

.launch-result .qr-code-img {
    max-width: 200px;
    border: 1px solid var(--cw-gray-200);
    border-radius: var(--cw-radius);
    padding: 0.5rem;
    background: #fff;
}

#launchResultArea {
    margin-top: 1rem;
}

/* -----------------------------------------------------------------------
   Wizard Navigation Buttons
   ----------------------------------------------------------------------- */
.wizard-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid var(--cw-gray-200);
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 10;
}

.wizard-nav-buttons .btn {
    min-width: 120px;
}

.wizard-nav-right {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.wizard-btn-go-live {
    background: var(--cw-secondary);
    border-color: var(--cw-secondary);
    color: #fff;
    font-weight: 600;
}

.wizard-btn-go-live:hover:not(:disabled) {
    background: #17a673;
    border-color: #17a673;
    color: #fff;
}

.wizard-btn-go-live:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* -----------------------------------------------------------------------
   Alerts
   ----------------------------------------------------------------------- */
#wizardStepAlert {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    max-width: 400px;
    box-shadow: var(--cw-shadow);
}

#wizardAlerts {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    max-width: 400px;
}

/* -----------------------------------------------------------------------
   Invite Key Group
   ----------------------------------------------------------------------- */
#inviteKeyGroup .input-group {
    max-width: 320px;
}

/* -----------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------- */
/* Room for every step name on one line ("Prop Card and Game(s)" is the
   longest); narrower screens keep 7.5rem and wrap to two. */
@media (min-width: 1200px) {
    .wizard-steps-bar {
        --cw-step-label-width: 10rem;
    }
}

@media (max-width: 991.98px) {
    #campaignCalendar {
        min-height: 300px;
    }

    .wizard-steps-bar {
        padding-top: 1rem;
        padding-bottom: 3.25rem;
    }

    .step-label {
        font-size: 0.65rem;
    }
}

@media (max-width: 767.98px) {
    .wizard-nav-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .wizard-nav-buttons .btn {
        min-width: 0;
        flex: 1 1 auto;
    }

    .wizard-nav-right {
        width: 100%;
        justify-content: flex-end;
    }

    /* Numbers only: the labels are hidden, so nothing needs the room. */
    .wizard-steps-bar {
        --cw-step-size: 2rem;
        padding: 1rem 0.5rem;
    }

    .step-indicator {
        font-size: 0.8rem;
    }

    .step-label {
        display: none;
    }

    .step-connector {
        min-width: 0.75rem;
        max-width: 2rem;
    }

    #gamesListContainer .game-row {
        flex-wrap: wrap;
    }

    #gamesListContainer .game-row input[type="date"] {
        max-width: 100%;
    }

    #rewardMatrixZone {
        padding: 1.25rem 1rem;
    }
}

/* -----------------------------------------------------------------------
   Next Button Inline Validation Error
   ----------------------------------------------------------------------- */
.next-btn-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: var(--cw-radius);
    border: 1px solid #fcd34d;
    background: #fffbeb;
    font-size: 0.83rem;
    color: #78350f;
}

.next-btn-error .ti-alert-triangle {
    color: #d97706;
    font-size: 1rem;
}

.next-btn-error a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.next-btn-error a:hover {
    color: #78350f;
}

/* -----------------------------------------------------------------------
   Shake animation — applied to Next button on invalid click
   ----------------------------------------------------------------------- */
@keyframes cwShake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-6px); }
    30%       { transform: translateX( 6px); }
    45%       { transform: translateX(-4px); }
    60%       { transform: translateX( 4px); }
    75%       { transform: translateX(-2px); }
    90%       { transform: translateX( 2px); }
}

.cw-shake {
    animation: cwShake 0.45s ease;
}

/* -----------------------------------------------------------------------
   Field highlight — briefly pulses the scroll target
   ----------------------------------------------------------------------- */
@keyframes cwHighlight {
    0%, 100% { box-shadow: none; }
    25%, 75%  { box-shadow: 0 0 0 3px rgba(231, 74, 59, 0.35), 0 0 0 6px rgba(231, 74, 59, 0.08); }
}

.cw-field-highlight {
    animation: cwHighlight 1.4s ease;
    border-radius: 4px;
}

/* -----------------------------------------------------------------------
   Step 3 Progress Checklist
   ----------------------------------------------------------------------- */
#step3ChecklistCard .card-header {
    background: var(--cw-gray-100);
}

.step3-cl-item {
    display: flex;
    flex-direction: column;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--cw-gray-200);
    border-left: 3px solid transparent;
    gap: 0.2rem;
    transition: background var(--cw-transition), border-color var(--cw-transition);
}

.step3-cl-item:last-child {
    border-bottom: none;
}

.step3-cl-item.cl-pass {
    border-left-color: #198754;
    background: var(--cw-secondary-light);
}

.step3-cl-item.cl-fail {
    border-left-color: var(--cw-danger);
    background: #fff5f5;
}

.step3-cl-item.cl-pending {
    border-left-color: var(--cw-gray-200);
}

.step3-cl-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.83rem;
    font-weight: 500;
}

.step3-cl-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.step3-cl-item.cl-pass .step3-cl-icon  { color: #198754; }
.step3-cl-item.cl-fail .step3-cl-icon  { color: var(--cw-danger); }
.step3-cl-item.cl-pending .step3-cl-icon { color: var(--cw-gray-500); }

.step3-cl-detail {
    font-size: 0.77rem;
    color: var(--cw-gray-700);
    padding-left: 1.55rem;
    line-height: 1.45;
}

.step3-cl-game-issue {
    display: block;
    margin-top: 0.1rem;
}

/* -----------------------------------------------------------------------
   Step Required Items Bar
   ----------------------------------------------------------------------- */
.step-req-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.1rem;
    padding: 0.55rem 1rem;
    border-radius: var(--cw-radius);
    border: 1px solid var(--cw-gray-200);
    background: var(--cw-gray-100);
    font-size: 0.78rem;
    transition: background var(--cw-transition), border-color var(--cw-transition);
}

.step-req-bar.all-complete {
    background: #d1e7dd;
    border-color: #a3cfbb;
}

.step-req-bar .srb-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cw-gray-700);
    flex-shrink: 0;
    margin-right: 0.15rem;
}

.step-req-bar .srb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    transition: color var(--cw-transition);
}

.step-req-bar .srb-item.srb-done {
    color: #198754;
}

.step-req-bar .srb-item.srb-pending {
    color: #888;
}

.step-req-bar .srb-all-done {
    display: none;
    align-items: center;
    gap: 0.28rem;
    color: #198754;
    font-weight: 600;
    font-size: 0.75rem;
}

.step-req-bar.all-complete .srb-all-done {
    display: inline-flex;
}

/* -----------------------------------------------------------------------
   Step 2 — Required / Optional / Launch section badges
   ----------------------------------------------------------------------- */
.cw-section-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.45rem;
    border-radius: 2rem;
    vertical-align: middle;
    margin-left: 0.45rem;
    line-height: 1.5;
}

/* Red — required to proceed to next step */
.cw-badge-req {
    background: #fff0f0;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

/* Muted gray — not required. Text at --cw-gray-700 (6.3:1): gray-500 was 1.8. */
.cw-badge-opt {
    background: var(--cw-gray-100);
    color: var(--cw-gray-700);
    border: 1px solid var(--cw-gray-200);
}

/* Blue — required to go live but not to advance the step */
.cw-badge-launch {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Card-level left accent for required cards */
.cw-required-card {
    border-left: 3px solid rgba(185, 28, 28, 0.25);
}

.cw-launch-card {
    border-left: 3px solid rgba(29, 78, 216, 0.2);
}

/* -----------------------------------------------------------------------
   Logo Upload (Organization Logo / Program Logo — Step 2)
   ----------------------------------------------------------------------- */
.cw-logo-preview {
    max-height: 90px;
    max-width: 180px;
    border: 1px solid var(--cw-gray-200);
    border-radius: var(--cw-radius);
    background: #fff;
    padding: 0.35rem;
    object-fit: contain;
}

.cw-logo-upload-area {
    border: 2px dashed var(--cw-gray-500);
    border-radius: var(--cw-radius);
    padding: 1.1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--cw-transition), background-color var(--cw-transition);
}

.cw-logo-upload-area:hover,
.cw-logo-upload-area.cw-dragover {
    border-color: var(--cw-primary);
    background-color: var(--cw-primary-light);
}

.cw-logo-upload-area:focus-visible {
    outline: 3px solid var(--cw-primary);
    outline-offset: 2px;
}

.cw-bg-preview {
    max-height: 140px;
    max-width: 260px;
    border: 1px solid var(--cw-gray-200);
    border-radius: var(--cw-radius);
    background: #fff;
    padding: 0.35rem;
    object-fit: cover;
}

/* Prop Card template preview modal (Step 3, Prop Card Selection) — read-only
   participant-style two-column question/answer layout, same shape as the
   superadmin Prop Card Templates page's own preview but namespaced under
   this file's cw- convention since it doesn't share a stylesheet with that
   admin-only page. */
.cw-pcp-questions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
.cw-pcp-question { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid #e9ecef; }
.cw-pcp-question-text { font-weight: 700; margin-bottom: 0.25rem; }
.cw-pcp-question-note { color: #6c757d; font-size: 0.9rem; margin-bottom: 0.5rem; }
.cw-pcp-answers { display: flex; flex-direction: column; gap: 0.5rem; }
.cw-pcp-answer {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid #ced4da;
    background: #fff;
    font-weight: 600;
}
@media (max-width: 600px) {
    .cw-pcp-questions-grid { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------------------
   Daily Play schedule (simultaneous_games) — daily_slot_mapper_controller.js
   ----------------------------------------------------------------------- */
.dsm-month-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.dsm-month-title {
    font-weight: 600;
    font-size: 1.05rem;
    min-width: 9.5rem;
    text-align: center;
}

.dsm-month-select {
    width: auto;
    margin-left: auto;
}

.dsm-days {
    border: 1px solid var(--cw-gray-200, #e5e7eb);
    border-radius: var(--cw-radius);
    overflow: hidden;
}

.dsm-day {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    align-items: stretch;
    border-bottom: 1px solid var(--cw-gray-200, #e5e7eb);
    background: #fff;
    position: relative;
}

.dsm-day:last-child { border-bottom: 0; }
.dsm-day--weekend { background: #f8fafc; }
.dsm-day--today { box-shadow: inset 4px 0 0 var(--cw-primary); }

.dsm-day-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-right: 1px solid var(--cw-gray-200, #e5e7eb);
    min-height: 3.25rem;
}

.dsm-day-label .dsm-chip { display: none; } /* a chip dropped on the label is re-homed on render */
.dsm-day-name { font-weight: 600; white-space: nowrap; }
.dsm-day-reason { color: #64748b; font-size: 0.72rem; }

.dsm-armed .dsm-day-drop { cursor: copy; }
.dsm-armed .dsm-day-drop:hover { background: #eef2ff; }

.dsm-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.4rem;
}

.dsm-slot {
    min-height: 2.6rem;
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
    transition: border-color 0.12s, background-color 0.12s;
}

.dsm-slot:focus-visible {
    outline: 3px solid var(--cw-primary);
    outline-offset: 1px;
}

.dsm-slot-hint {
    align-self: center;
    font-size: 0.72rem;
    color: #94a3b8;
    pointer-events: none;
    user-select: none;
}

.dsm-slot--filled { border-style: solid; border-color: transparent; }

.dsm-day--locked { background: #f1f5f9; }
.dsm-day--locked .dsm-day-name { color: #64748b; }
.dsm-slot--locked { border-color: #e2e8f0; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(148, 163, 184, 0.12) 6px 12px); cursor: not-allowed; }

/* Click-to-place: say on the slot whether it can take the selected game. */
.dsm-armed .dsm-slot--accept { border-color: #16a34a; background: #f0fdf4; cursor: copy; }
.dsm-armed .dsm-slot--accept .dsm-slot-hint { color: #15803d; }
.dsm-armed .dsm-slot--refuse { border-color: #e2e8f0; opacity: 0.55; cursor: not-allowed; }

/* While dragging: light up every slot that can take the game, dim the days that can't. */
.dsm-dragging .dsm-slot--accept { border-color: #16a34a; background: #f0fdf4; }
.dsm-dragging .dsm-day--refuse .dsm-slots { opacity: 0.4; }
.dsm-dragging .dsm-day--refuse::after {
    content: attr(data-reason);
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: #334155;
    color: #fff;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    pointer-events: none;
}

.dsm-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    padding: 0.25rem 0.4rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.45rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    font-size: 0.8rem;
    cursor: grab;
    user-select: none;
}

.dsm-chip:active { cursor: grabbing; }
.dsm-chip--locked { cursor: default; opacity: 0.85; }

.dsm-chip-letter {
    flex: 0 0 auto;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.3rem;
    border-radius: 0.35rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dsm-chip-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dsm-chip-count { flex: 0 0 auto; font-size: 0.7rem; color: #64748b; }

.dsm-chip-remove,
.dsm-chip-clear,
.dsm-chip-hide,
.dsm-chip-show {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #64748b;
    padding: 0.1rem 0.2rem;
    line-height: 1;
    border-radius: 0.3rem;
    cursor: pointer;
}

.dsm-chip-remove:hover,
.dsm-chip-clear:hover { color: #b91c1c; background: #fef2f2; }
.dsm-chip-hide:hover,
.dsm-chip-show:hover { color: var(--cw-primary); background: var(--cw-primary-light); }

.dsm-chip-remove:focus-visible,
.dsm-chip-clear:focus-visible,
.dsm-chip-hide:focus-visible,
.dsm-chip-show:focus-visible,
.dsm-chip:focus-visible { outline: 3px solid var(--cw-primary); outline-offset: 1px; }

.dsm-chip--palette { padding: 0.45rem 0.55rem; margin-bottom: 0.4rem; }
.dsm-chip--armed { border-color: var(--cw-primary); box-shadow: 0 0 0 3px var(--cw-primary-light); }

.sortable-ghost.dsm-chip { opacity: 0.45; }
.sortable-fallback.dsm-chip { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25); transform: rotate(2deg); }

.dsm-palette {
    border: 1px solid var(--cw-gray-200, #e5e7eb);
    border-radius: var(--cw-radius);
    padding: 0.75rem;
    background: #fff;
}

/* Always in view on a wide screen: below the wizard's sticky attention bar,
   clear of its sticky button row, scrolling on its own when the list is long. */
@media (min-width: 992px) {
    .dsm-palette {
        position: sticky;
        top: 7.5rem;
        max-height: calc(100vh - 7.5rem - 6.5rem);
        overflow-y: auto;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    }
}

.dsm-palette-title { font-weight: 600; margin-bottom: 0.25rem; }

/* Trimming the palette: "Hide finished games", and the games hidden by hand
   (daily_slot_mapper_controller.js renders the list). */
.dsm-hidden { margin-top: 0.25rem; }
.dsm-hidden-panel { margin-top: 0.5rem; }
.dsm-hidden-list { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.dsm-hidden-list li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid #e5e7eb;
}
.dsm-hidden-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dsm-trash {
    margin-top: 0.5rem;
    min-height: 3rem;
    border: 2px dashed #fca5a5;
    border-radius: 0.5rem;
    color: #b91c1c;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: background-color 0.12s;
}

.dsm-trash .dsm-chip { display: none; }
.dsm-trash--active { background: #fef2f2; border-color: #ef4444; }

.dsm-toast {
    position: fixed;
    left: 50%;
    bottom: 6.5rem;
    transform: translateX(-50%) translateY(1rem);
    background: #1e293b;
    color: #fff;
    padding: 0.55rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 1090;
    max-width: min(90vw, 40rem);
}

.dsm-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }
.dsm-toast--error { background: #991b1b; }

@keyframes dsm-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.dsm-shake { animation: dsm-shake 0.35s ease; }

@media (prefers-reduced-motion: reduce) {
    .dsm-shake { animation: none; outline: 2px solid #dc2626; }
    .sortable-fallback.dsm-chip { transform: none; }
}

.dsm-pattern-list .form-check { margin-bottom: 0.15rem; }
.dsm-weekdays { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.dsm-adv-preview { min-height: 2.5rem; padding: 0.5rem 0.75rem; background: #f8fafc; border-radius: 0.5rem; }

@media (max-width: 575.98px) {
    /* Three theme cards across a phone; names wrap to two lines. */
    .theme-cards-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
    .dsm-day { grid-template-columns: 1fr; }
    .dsm-day-label { border-right: 0; min-height: 0; padding-bottom: 0; }
    .dsm-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Daily Play game cards in the games list */
.game-entry--daily .game-entry-number-badge { border-radius: 0.35rem; }
.game-entry-daily-days { font-size: 0.75rem; }
.cw-games-heading { font-size: 0.95rem; font-weight: 600; margin: 0.25rem 0 0.75rem; }
.dsm-day-label .badge { align-self: flex-start; }

/* -----------------------------------------------------------------------
   "Help Me Decide" campaign type helper (Step 1, new campaigns only)
   _campaign_type_helper.html.twig + campaign_type_helper_controller.js
   ----------------------------------------------------------------------- */
.cth-open-btn {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.08);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.35);
    border-radius: 2rem;
    font-weight: 600;
    padding: 0.2rem 0.85rem;
}
.cth-open-btn:hover,
.cth-open-btn:focus-visible {
    color: #fff;
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.cth-header {
    color: #fff;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #1f4fbf 100%);
    padding: 1.1rem 1.5rem;
}
.cth-header .modal-title { color: #fff; }
.cth-header-subtitle { color: rgba(255, 255, 255, 0.9); }

.cth-main { padding: 1.75rem 1.75rem 1.25rem; background: #fff; }
.cth-side {
    padding: 1.5rem 1.25rem;
    background: var(--cw-gray-100);
    border-left: 1px solid var(--cw-gray-200);
}
@media (max-width: 767.98px) {
    .cth-side { border-left: 0; border-top: 1px solid var(--cw-gray-200); }
}

/* Each question, and the result, slides in. */
.cth-panel-enter { animation: cthPanelIn 0.35s ease both; }
@keyframes cthPanelIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.cth-question-number {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-primary);
}
.cth-question-text {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    outline: none;
}
.cth-question-hint { color: var(--cw-gray-700); margin-bottom: 1.5rem; }

.cth-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.cth-answer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--cw-gray-200);
    border-radius: var(--cw-radius-lg);
    background: #fff;
    transition: border-color var(--cw-transition), background-color var(--cw-transition), transform var(--cw-transition), box-shadow var(--cw-transition);
}
.cth-answer i { font-size: 1.35rem; }
.cth-answer--yes { color: #146c43; }
.cth-answer--no { color: #b02a37; }
.cth-answer--yes:hover, .cth-answer--yes:focus-visible { border-color: #198754; background: #eaf6ef; color: #146c43; }
.cth-answer--no:hover, .cth-answer--no:focus-visible { border-color: #dc3545; background: #fdf0f1; color: #b02a37; }
.cth-answer:hover { transform: translateY(-2px); box-shadow: var(--cw-shadow); }

.cth-nav { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }

/* The recommendation */
.cth-result { text-align: center; }
.cth-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: 0.75rem;
    border-radius: 50%;
    font-size: 2rem;
    color: #fff;
    background: linear-gradient(135deg, #198754, #20c997);
    box-shadow: 0 0.5rem 1.25rem rgba(25, 135, 84, 0.3);
    animation: cthPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes cthPop {
    from { transform: scale(0.3); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.cth-result-heading {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #146c43;
    outline: none;
}
.cth-result-choice {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    border: 2px solid #198754;
    border-radius: var(--cw-radius-lg);
    background: #eaf6ef;
    color: #0f5132;
}
/* #198754 rather than the theme's brighter success green: white text on it
   needs 4.5:1. */
.cth-choose-btn,
.cth-choose-btn:focus-visible {
    color: #fff;
    background: #198754;
    border-color: #198754;
    font-weight: 600;
}
.cth-choose-btn:hover { color: #fff; background: #146c43; border-color: #146c43; }
.cth-result-description {
    text-align: left;
    color: var(--cw-gray-700);
    background: var(--cw-gray-100);
    border-radius: var(--cw-radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

/* The campaign type list */
.cth-side-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cw-gray-700);
}
.cth-count { background: var(--bs-primary); color: #fff; font-weight: 600; }
.cth-progress { height: 0.35rem; background: var(--cw-gray-200); }
.cth-progress .progress-bar { background: linear-gradient(90deg, var(--bs-primary), #198754); transition: width 0.45s ease; }

.cth-types { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.cth-type {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: #fff;
    border: 1px solid var(--cw-gray-200);
    border-radius: var(--cw-radius);
    transition: opacity 0.45s ease, background-color 0.45s ease, border-color 0.45s ease, color 0.45s ease, box-shadow 0.45s ease, transform 0.45s ease;
}
.cth-type-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    font-size: 1.1rem;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.1);
    transition: inherit;
}
.cth-type-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cth-type-name {
    font-weight: 600;
    line-height: 1.3;
    text-decoration: line-through;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    transition: text-decoration-color 0.45s ease;
}
.cth-type-status { font-size: 0.75rem; font-weight: 600; }
.cth-type-status:empty { display: none; }
.cth-type-mark { flex: 0 0 auto; font-size: 1.15rem; }
.cth-type-mark i { display: none; }

/* Ruled out: faded, red, crossed out. Faded to 0.8 rather than further so
   the red text keeps a 4.5:1 contrast. */
.cth-type.is-eliminated {
    opacity: 0.8;
    color: #a52834;
    background: #fdf2f3;
    border-color: #f1c2c7;
    border-style: dashed;
}
.cth-type.is-eliminated .cth-type-name { text-decoration-color: currentColor; }
.cth-type.is-eliminated .cth-type-icon { color: #a52834; background: #f8d7da; }
.cth-type.is-eliminated .cth-mark-out { display: inline; }

/* The recommendation */
.cth-type.is-match {
    color: #0f5132;
    background: #eaf6ef;
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.18);
    transform: scale(1.02);
}
.cth-type.is-match .cth-type-icon { color: #fff; background: #198754; }
.cth-type.is-match .cth-mark-match { display: inline; color: #198754; }

/* Not enabled for the organization: out of play from the start, in grey
   rather than red — nothing was ruled out by an answer. */
.cth-type.is-unavailable {
    color: #5c636a;
    background: var(--cw-gray-100);
    border-style: dashed;
}
.cth-type.is-unavailable .cth-type-icon { color: #5c636a; background: var(--cw-gray-200); }
.cth-type.is-unavailable .cth-mark-lock { display: inline; }

@media (prefers-reduced-motion: reduce) {
    .cth-panel-enter, .cth-result-badge { animation: none; }
    .cth-type, .cth-type-name, .cth-answer, .cth-progress .progress-bar { transition: none; }
    .cth-type.is-match, .cth-answer:hover { transform: none; }
}

/* -----------------------------------------------------------------------
   Custom Template editor (.ai_docs/campaign_themes.md, "The Custom Template";
   _custom_theme_editor.html.twig, custom_theme_editor_controller.js).
   Text is at least 4.5:1 and control edges at least 3:1 on the white card,
   so the selected-state colour is a darker blue than --cw-primary.
   ----------------------------------------------------------------------- */
.cw-custom-hidden {
    display: none !important;
}

/* The Custom card's swatch: a palette of colour chips. */
.theme-thumbnail.custom-template-thumb {
    height: 58px;
    border-radius: 8px;
    border: 1px dashed #7a8794;
    background:
        radial-gradient(circle at 22% 50%, #c8102e 0 9px, transparent 10px),
        radial-gradient(circle at 42% 50%, #f4b400 0 9px, transparent 10px),
        radial-gradient(circle at 62% 50%, #0a7c66 0 9px, transparent 10px),
        radial-gradient(circle at 82% 50%, #3949ab 0 9px, transparent 10px),
        #ffffff;
}

.ct-editor {
    --ct-ed-accent: #2f4fb8;
    --ct-ed-edge: #7a8794;
    --ct-ed-line: #ced4da;
    position: relative;
    margin: 0 0 1.5rem;
    padding: 1rem;
    border: 1px solid var(--ct-ed-line);
    border-radius: var(--cw-radius-lg);
    background: #fbfcfe;
}

.ct-editor-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.ct-editor-note,
.ct-hint {
    font-size: 0.8rem;
    color: #495057;
    margin: 0 0 0.5rem;
}

.ct-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.ct-section-title:focus {
    outline: none;
}

.ct-step-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.75rem 0 0.4rem;
}

/* ── Quick Setup ───────────────────────────────────────── */
.ct-quick-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ct-steps {
    display: flex;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: ct-step;
}

.ct-steps li {
    counter-increment: ct-step;
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--ct-ed-edge);
    color: #495057;
}

.ct-steps li::before {
    content: counter(ct-step) '. ';
}

.ct-steps li[aria-current="step"] {
    border-color: var(--ct-ed-accent);
    background: var(--ct-ed-accent);
    color: #fff;
}

.ct-steps li.is-done::after {
    content: ' \2713';
    content: ' \2713' / '';
}

.ct-quick-logo img {
    max-height: 72px;
    max-width: 260px;
    margin: 0.25rem 0 0.5rem;
    padding: 6px;
    border: 1px solid var(--ct-ed-line);
    border-radius: 8px;
    background: repeating-conic-gradient(#eef0f3 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}

.ct-palettes,
.ct-pairings,
.ct-layouts,
.ct-start-themes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.ct-palette,
.ct-pairing,
.ct-layout,
.ct-start-theme {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    border: 2px solid var(--cw-gray-200);
    border-radius: var(--cw-radius);
    background: #fff;
    text-align: left;
    cursor: pointer;
    color: #212529;
}

.ct-palette[aria-checked="true"],
.ct-pairing[aria-checked="true"],
.ct-layout[aria-checked="true"] {
    border-color: var(--ct-ed-accent);
    box-shadow: 0 0 0 3px rgba(47, 79, 184, 0.2);
}

.ct-palette[aria-checked="true"]::after,
.ct-pairing[aria-checked="true"]::after,
.ct-layout[aria-checked="true"]::after {
    content: '\2713';
    content: '\2713' / '';
    position: absolute;
    top: 4px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ct-ed-accent);
    color: #fff;
    font-size: 0.75rem;
    line-height: 20px;
    text-align: center;
}

.ct-palette-art {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 74px;
    padding-bottom: 6px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.ct-palette-header {
    height: 22px;
}

.ct-palette-card {
    flex: 1;
    margin: 0 10px;
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    padding: 6px;
}

.ct-palette-button {
    width: 54%;
    height: 10px;
    border-radius: 999px;
}

.ct-pairing-heading {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.15;
}

.ct-pairing-body {
    font-size: 0.82rem;
    color: #343a40;
}

.ct-pairing-name {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #495057;
}

/* The layout tiles draw a header in the template's own colours. */
.ct-layout-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 10px;
    border-radius: 6px;
    background: var(--cte-header, #4e73df);
}

.ct-la-logo {
    width: 34px;
    height: 18px;
    border-radius: 4px;
    background: var(--cte-header-text, #fff);
    opacity: 0.85;
}

.ct-la-name {
    display: none;
    width: 46px;
    height: 8px;
    border-radius: 4px;
    background: var(--cte-header-text, #fff);
    opacity: 0.65;
}

.ct-layout-art--left {
    justify-content: flex-start;
    clip-path: polygon(0 0, 100% 0, 100% 75%, 0 100%);
}

.ct-layout-art--name {
    justify-content: space-between;
}

.ct-layout-art--name .ct-la-name {
    display: block;
}

.ct-quick-nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ct-quick-links {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
}

.ct-quick-brand {
    margin-top: 0.5rem;
}

/* ── Start from ───────────────────────────────────────── */
.ct-start-themes {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.ct-start-theme {
    align-items: stretch;
    font-size: 0.8rem;
    font-weight: 600;
}

.ct-start-theme .theme-thumbnail {
    height: 40px;
}

.ct-start-theme:hover,
.ct-start-theme:focus-visible,
.ct-palette:hover,
.ct-pairing:hover,
.ct-layout:hover {
    border-color: var(--ct-ed-accent);
}

.ct-start-campaigns {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
}

.ct-start-campaign {
    border: 0;
    background: none;
    padding: 0.25rem 0;
    color: var(--ct-ed-accent);
    text-decoration: underline;
}

/* ── Help me build with a site reference ──────────────── */
.ct-site-sources {
    margin: 0.25rem 0 0.75rem;
}

.ct-site-sources button {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

.ct-site-pane {
    max-width: 40rem;
}

.ct-site-url .form-control {
    min-width: 0;
}

.ct-site-url + .ct-hint {
    margin-top: 0.5rem;
}

.ct-site-shots {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    padding: 0;
    margin: 0.75rem 0;
}

.ct-site-shot {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.ct-site-shot img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: top;
    border: 1px solid var(--ct-ed-edge);
    border-radius: 4px;
    background: #fff;
}

.ct-site-shot-note {
    color: #8a5300;
}

.ct-site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ct-site-status:not(:empty) {
    margin: 0.75rem 0 0.25rem;
    font-weight: 600;
}

.ct-site[aria-busy="true"] .ct-site-status::before {
    content: "";
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.5em;
    vertical-align: -0.1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ct-site-spin 0.8s linear infinite;
}

@keyframes ct-site-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ct-site[aria-busy="true"] .ct-site-status::before {
        animation: none;
    }
}

.ct-site-result ul {
    padding-left: 1.2rem;
}

/* ── Write my footer with Claude AI (footer_writer_controller.js) ── */
.cw-footer-writer-panel {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--ac-surface-border, #bec8d0);
    border-radius: 0.5rem;
    background: #f8f9fa;
}

.cw-footer-writer-title {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.cw-footer-writer-title:focus {
    outline: none;
}

.cw-footer-writer-title:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.cw-footer-writer-shot {
    margin: 0.25rem 0 0.5rem;
}

.cw-footer-writer-shot img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    object-position: left top;
    border: 1px solid var(--ac-surface-border, #bec8d0);
    border-radius: 0.25rem;
    background: #ffffff;
}

.cw-footer-writer-status:not(:empty) {
    margin-top: 0.5rem;
    font-weight: 600;
}

/* The same spinner as the site reference, still under reduced motion. */
.cw-footer-writer-panel[aria-busy="true"] .cw-footer-writer-status::before {
    content: "";
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.5em;
    vertical-align: -0.1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ct-site-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .cw-footer-writer-panel[aria-busy="true"] .cw-footer-writer-status::before {
        animation: none;
    }
}

.cw-footer-writer-result ul {
    padding-left: 1.2rem;
}

/* ── Fine-tune ────────────────────────────────────────── */
.ct-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.ct-toolbar-spacer {
    flex: 1;
}

.ct-toolbar [aria-pressed="true"] {
    background: var(--ct-ed-accent);
    border-color: var(--ct-ed-accent);
    color: #fff;
}

.ct-columns {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 1rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .ct-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ct-preview-col {
    position: sticky;
    top: 80px;
}

@media (max-width: 991.98px) {
    .ct-preview-col {
        position: static;
        order: -1;
    }
}

.ct-brand,
.ct-group {
    border: 1px solid var(--ct-ed-line);
    border-radius: var(--cw-radius);
    background: #fff;
    margin-bottom: 0.5rem;
}

.ct-brand {
    padding: 0.75rem;
}

.ct-brand-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
}

.ct-brand-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.ct-brand-row .form-control-color {
    width: 2.4rem;
    height: 2rem;
    padding: 2px;
    border-color: var(--ct-ed-edge);
}

.ct-hex {
    width: 6.2rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    border-color: var(--ct-ed-edge);
}

.ct-brand-name {
    flex: 1;
    min-width: 7rem;
    border-color: var(--ct-ed-edge);
}

.ct-paste summary {
    font-size: 0.85rem;
    color: var(--ct-ed-accent);
    cursor: pointer;
    margin-top: 0.4rem;
}

.ct-group-heading {
    margin: 0;
}

.ct-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 0;
    background: none;
    font-size: 0.92rem;
    font-weight: 700;
    color: #212529;
    text-align: left;
}

.ct-group-toggle i {
    margin-left: auto;
    transition: transform var(--cw-transition);
}

.ct-group-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.ct-group-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8a5300;
}

.ct-group-body {
    padding: 0 0.75rem 0.75rem;
}

.ct-setting {
    padding: 0.55rem 0;
    border-top: 1px solid #edf0f3;
    border-radius: 4px;
}

.ct-setting.is-flashing {
    animation: ct-flash 1.6s ease-out;
}

@keyframes ct-flash {
    0%, 30% { background: #fff3cd; box-shadow: 0 0 0 6px #fff3cd; }
    100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .ct-setting.is-flashing { animation: none; outline: 3px solid #f0ad4e; }
}

.ct-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ct-setting-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #212529;
}

.ct-setting-row .ct-setting-label {
    margin-bottom: 0;
}

.ct-color-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 60%;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--ct-ed-edge);
    border-radius: 6px;
    background: #fff;
    font-size: 0.8rem;
    color: #212529;
}

.ct-color-trigger[aria-expanded="true"] {
    border-color: var(--ct-ed-accent);
    box-shadow: 0 0 0 2px rgba(47, 79, 184, 0.25);
}

.ct-color-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ct-swatch {
    flex: 0 0 auto;
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.35);
}

.ct-picker {
    margin-top: 0.4rem;
    padding: 0.5rem;
    border: 1px solid var(--ct-ed-edge);
    border-radius: 8px;
    background: #fff;
}

.ct-picker-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.ct-picker-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--ct-ed-edge);
    border-radius: 6px;
    background: #fff;
    font-size: 0.8rem;
}

.ct-picker-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.ct-picker-brand-name {
    flex: 0 0 6.5rem;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ct-picker-swatches {
    display: flex;
    gap: 0.25rem;
}

.ct-picker-swatch {
    width: 30px;
    height: 30px;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: none;
}

.ct-picker-swatch .ct-swatch {
    width: 100%;
    height: 100%;
}

.ct-picker-option[aria-pressed="true"],
.ct-picker-swatch[aria-pressed="true"] {
    border-color: var(--ct-ed-accent);
    box-shadow: 0 0 0 2px rgba(47, 79, 184, 0.25);
}

.ct-picker-custom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding-top: 0.4rem;
    border-top: 1px solid #edf0f3;
}

.ct-picker-custom-label {
    font-size: 0.78rem;
    font-weight: 600;
}

.ct-picker-custom .form-control-color {
    width: 2.4rem;
    height: 2rem;
    padding: 2px;
}

.ct-picker-done {
    margin-top: 0.4rem;
}

/* Choices: buttons in a row, or tiles with a drawing. */
.ct-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ct-choices--tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
}

.ct-choice {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--ct-ed-edge);
    border-radius: 6px;
    background: #fff;
    font-size: 0.8rem;
    color: #212529;
}

.ct-choice[aria-checked="true"] {
    border: 2px solid var(--ct-ed-accent);
    padding: calc(0.3rem - 1px) calc(0.55rem - 1px);
    background: #eef1fb;
    font-weight: 600;
}

.ct-choice-check {
    display: none;
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 0.7rem;
    color: var(--ct-ed-accent);
}

.ct-choices--tiles .ct-choice[aria-checked="true"] .ct-choice-check {
    display: block;
}

.ct-choices--buttons .ct-choice[aria-checked="true"]::before {
    content: '\2713';
    content: '\2713' / '';
    font-size: 0.7rem;
    line-height: 1;
}

.ct-choices--buttons .ct-choice {
    flex-direction: row;
}

/* A tile's drawing: three spans, coloured with the template's own colours
   (--cte-*, set by the editor), arranged per setting and option. */
.ct-art {
    position: relative;
    display: block;
    width: 100%;
    height: 34px;
    border-radius: 4px;
    background: var(--cte-page, #f5f6f8);
    overflow: hidden;
}

.ct-art span {
    position: absolute;
    display: block;
}

.ct-art--header_layout span:nth-child(1),
.ct-art--header_bg_style span:nth-child(1),
.ct-art--header_edge span:nth-child(1),
.ct-art--header_height span:nth-child(1) {
    inset: 0 0 auto 0;
    height: 18px;
    background: var(--cte-header, #4e73df);
}

.ct-art--header_layout span:nth-child(2) {
    top: 5px;
    left: calc(50% - 10px);
    width: 20px;
    height: 8px;
    border-radius: 2px;
    background: var(--cte-header-text, #fff);
}

.ct-art--header_layout-left span:nth-child(2),
.ct-art--header_layout-name span:nth-child(2) {
    left: 6px;
}

.ct-art--header_layout-name span:nth-child(3) {
    top: 7px;
    right: 6px;
    width: 22px;
    height: 4px;
    border-radius: 2px;
    background: var(--cte-header-text, #fff);
}

.ct-art--header_bg_style-gradient span:nth-child(1) {
    background: linear-gradient(135deg, var(--cte-header, #4e73df), #111);
}

.ct-art--header_bg_style-image span:nth-child(1) {
    background:
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.5) 0 5px, transparent 6px),
        linear-gradient(160deg, #8fb3d9 0 45%, #6a8f5e 45% 100%);
}

.ct-art--header_edge-angled span:nth-child(1) {
    height: 22px;
    clip-path: polygon(0 0, 100% 0, 100% 55%, 0 100%);
}

.ct-art--header_edge-curve span:nth-child(1) {
    height: 22px;
    border-radius: 0 0 50% 50% / 0 0 8px 8px;
}

.ct-art--header_edge-wave span:nth-child(1) {
    height: 22px;
    -webkit-mask: linear-gradient(#000 0 0) top / 100% 14px no-repeat, radial-gradient(10px 8px at 50% 0, #000 98%, transparent) 0 14px / 20px 8px repeat-x;
    mask: linear-gradient(#000 0 0) top / 100% 14px no-repeat, radial-gradient(10px 8px at 50% 0, #000 98%, transparent) 0 14px / 20px 8px repeat-x;
}

.ct-art--header_height-compact span:nth-child(1) { height: 9px; }
.ct-art--header_height-tall span:nth-child(1) { height: 26px; }

.ct-art--content_width span:nth-child(1) {
    top: 6px;
    bottom: 0;
    left: 30%;
    right: 30%;
    border-radius: 3px 3px 0 0;
    background: var(--cte-card, #fff);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.ct-art--content_width-narrow span:nth-child(1) { left: 36%; right: 36%; }
.ct-art--content_width-wide span:nth-child(1) { left: 12%; right: 12%; }

.ct-art--card_shadow span:nth-child(1) {
    top: 7px;
    left: 18%;
    right: 18%;
    bottom: 7px;
    border-radius: 4px;
    background: var(--cte-card, #fff);
}

.ct-art--card_shadow-soft span:nth-child(1) { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18); }
.ct-art--card_shadow-strong span:nth-child(1) { box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4); }

.ct-art--button_style span:nth-child(1) {
    top: 9px;
    left: 18%;
    right: 18%;
    height: 16px;
    border-radius: 4px;
    background: var(--cte-button, #4e73df);
}

.ct-art--button_style-pill span:nth-child(1) { border-radius: 999px; }
.ct-art--button_style-square span:nth-child(1) { border-radius: 0; }
.ct-art--button_style-outline span:nth-child(1) { background: transparent; border: 2px solid var(--cte-button, #4e73df); }
.ct-art--button_style-gradient span:nth-child(1) { background: linear-gradient(135deg, var(--cte-button, #4e73df), #111); }
.ct-art--button_style-raised span:nth-child(1) { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45); }

.ct-choice-label {
    line-height: 1.2;
}

.ct-number {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ct-number .form-range {
    flex: 1;
}

.ct-number-value {
    min-width: 3.2rem;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.ct-toggle {
    margin: 0.15rem 0;
}

.ct-toggle .form-check-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.ct-fonts {
    max-height: 196px;
    overflow-y: auto;
    border: 1px solid var(--ct-ed-edge);
    border-radius: 6px;
    background: #fff;
}

.ct-font {
    display: block;
    width: 100%;
    padding: 0.3rem 0.6rem;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    background: none;
    font-size: 1rem;
    text-align: left;
    color: #212529;
}

.ct-font[aria-checked="true"] {
    background: #eef1fb;
    box-shadow: inset 4px 0 0 var(--ct-ed-accent);
}

.ct-font[aria-checked="true"]::after {
    content: ' \2713';
    content: ' \2713' / '';
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
    color: var(--ct-ed-accent);
}

.ct-image {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.ct-image-preview {
    max-width: 120px;
    max-height: 60px;
    border-radius: 4px;
    border: 1px solid var(--ct-ed-line);
}

.ct-image-progress {
    flex-basis: 100%;
    height: 6px;
}

.ct-warn:empty {
    display: none;
}

.ct-warn {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.3rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: #fff8e6;
    border: 1px solid #c98a00;
}

.ct-warn-text {
    flex: 1;
    margin: 0;
    font-size: 0.78rem;
    color: #5c3d00;
}

.ct-fix {
    color: #5c3d00;
    border-color: #a86f00;
}

.ct-error {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #b02a37;
}

/* ── Preview ─────────────────────────────────────────── */
.ct-preview-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.ct-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--ct-ed-edge);
    border-radius: 6px;
    overflow: hidden;
}

.ct-segmented button {
    padding: 0.25rem 0.55rem;
    border: 0;
    border-right: 1px solid var(--ct-ed-line);
    background: #fff;
    font-size: 0.78rem;
    color: #212529;
}

.ct-segmented button:last-child {
    border-right: 0;
}

.ct-segmented button[aria-checked="true"] {
    background: var(--ct-ed-accent);
    color: #fff;
}

.ct-parts {
    margin-bottom: 0.5rem;
}

.ct-parts-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.ct-stage {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.ct-frame {
    flex: 1 1 auto;
    min-width: 0;
}

.ct-stage--both .ct-frame--desktop {
    flex: 7 1 0;
}

.ct-stage--both .ct-frame--phone {
    flex: 3 1 0;
}

.ct-frame-label {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
}

.ct-frame-box {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--ct-ed-edge);
    border-radius: 8px;
    background: #fff;
}

.ct-frame--phone .ct-frame-box,
.ct-frame--tablet .ct-frame-box {
    margin: 0 auto;
}

.ct-frame--phone:not(.ct-stage--both .ct-frame) .ct-frame-box {
    max-width: 375px;
}

.ct-frame--tablet .ct-frame-box {
    max-width: 768px;
}

.ct-frame-box iframe {
    display: block;
    border: 0;
    transform-origin: top left;
}

.ct-meter {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--ct-ed-line);
    border-radius: var(--cw-radius);
    background: #fff;
}

.ct-meter-summary {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.ct-meter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 220px;
    overflow-y: auto;
}

.ct-meter-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0;
    font-size: 0.8rem;
}

.ct-meter-mark {
    width: 1.1rem;
    font-weight: 700;
}

.ct-meter-pass .ct-meter-mark {
    color: #146c43;
}

.ct-meter-fail .ct-meter-mark {
    color: #8a5300;
}

.ct-meter-fail .ct-fix {
    margin-left: auto;
    padding: 0 0.4rem;
    font-size: 0.75rem;
}

/* ── Tour ───────────────────────────────────────────── */
.ct-tip {
    position: fixed;
    z-index: 1060;
    width: 320px;
    max-width: calc(100vw - 24px);
    padding: 0.75rem;
    border-radius: 8px;
    background: #1d2630;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.ct-tip-title {
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.ct-tip-text {
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
}

.ct-tip-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

.ct-tip .btn-link {
    color: #cfe0ff;
}

.ct-editor button:focus-visible,
.ct-editor input:focus-visible,
.ct-editor textarea:focus-visible,
.ct-editor summary:focus-visible {
    outline: 3px solid var(--ct-ed-accent);
    outline-offset: 2px;
}

/* The admin draws its text in capitals (main.css). A font sample is shown
   as a player would see it, and so is the heading style's own choice. */
.ct-pairing-heading,
.ct-pairing-body,
.ct-font,
.ct-art--heading_case,
[data-ct-setting="heading_case"] .ct-choice-label {
    text-transform: none;
}

/* ── Banner picture and custom content (Phase 3b) ──── */
/* Layout tiles: a picture across the whole header, and lines of the
   admin's own content. */
.ct-layout-art--banner {
    background:
        linear-gradient(160deg, transparent 55%, rgba(0, 0, 0, 0.25) 55%),
        linear-gradient(135deg, var(--cte-header, #4e73df), var(--cte-button, #1a73e8));
}

.ct-layout-art--banner .ct-la-logo,
.ct-layout-art--custom .ct-la-logo {
    display: none;
}

.ct-layout-art--custom {
    flex-direction: column;
    gap: 5px;
}

.ct-layout-art--custom .ct-la-name {
    display: block;
}

.ct-layout-art--custom .ct-la-name:first-of-type {
    width: 70px;
    height: 9px;
}

.ct-art--header_layout-banner span:nth-child(1) {
    height: 22px;
    background:
        linear-gradient(160deg, transparent 55%, rgba(0, 0, 0, 0.25) 55%),
        linear-gradient(135deg, var(--cte-header, #4e73df), var(--cte-button, #1a73e8));
}

.ct-art--header_layout-banner span:nth-child(2) {
    display: none;
}

.ct-art--header_layout-custom span:nth-child(2) {
    top: 3px;
    left: 20%;
    width: 60%;
    height: 5px;
}

.ct-art--header_layout-custom span:nth-child(3) {
    top: 11px;
    left: 30%;
    width: 40%;
    height: 3px;
    border-radius: 2px;
    background: var(--cte-header-text, #fff);
}

.ct-text-input {
    max-width: 100%;
}

.ct-need:empty {
    display: none;
}

.ct-need {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8a4b00;
}

.ct-html {
    min-height: 200px;
}

.ct-image-note:empty {
    display: none;
}

.ct-image-note {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.8rem;
    color: #5b4100;
}

/* The Footer section's note on the footer content's own colours
   (custom_theme_editor_controller.js, renderFooterNote). */
.ct-footer-note {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.ct-footer-note--warn {
    border: 1px solid #b26a00;
    background: #fff4e5;
    color: #5b3700;
}

.ct-footer-note--info {
    border: 1px solid #6f8fc4;
    background: #eef4ff;
    color: #1d3b6a;
}

.ct-footer-note .btn-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* A Daily Play game's own icon on its card (wizard.html.twig, .game-entry-icon):
   the campaign page's picture box, 16:5, so the admin sees it as players will. */
.game-entry-icon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 240px;
    max-width: 100%;
    aspect-ratio: 16 / 5;
    border: 1px dashed var(--ac-control-border, #7a8794);
    border-radius: 6px;
    background: #f8fafc;
    overflow: hidden;
}

.game-entry-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Info Box: preset buttons and picture carousel (_info_carousel_editor.html.twig,
   info_carousel_editor_controller.js) ---- */
.cw-info-presets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-info-preset-group-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cw-info-carousel-drop {
    border: 2px dashed var(--ac-control-border, #7a8794);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
}

.cw-info-carousel-drop:hover,
.cw-info-carousel-drop.is-over {
    background: rgba(13, 110, 253, 0.06);
    border-color: var(--bs-primary, #0d6efd);
}

.cw-info-carousel-drop:focus-visible {
    outline: 3px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

.cw-info-carousel-drop[aria-disabled="true"] {
    cursor: progress;
    opacity: 0.7;
}

.cw-info-carousel-table td {
    vertical-align: top;
}

.cw-info-carousel-table td:nth-child(3) {
    min-width: 12rem;
}

.cw-info-carousel-table td:nth-child(4) {
    min-width: 15rem;
}

.cw-info-carousel-thumb {
    display: block;
    width: 120px;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--ac-surface-border, #bec8d0);
}

.cw-info-carousel-handle {
    cursor: grab;
}

.cw-info-carousel-ghost {
    opacity: 0.5;
}

.cw-info-carousel-dates input[type="date"] {
    width: auto;
}

.cw-info-carousel-delete-thumb {
    display: block;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
}

.cw-info-box-preview .cw-page-preview-frame {
    height: 480px;
}
