/* =========================================
   COMPETITIONS PRO (Neo-Brutalist / SaaS Theme)
   ========================================= */

:root {
    --pro-bg: #fafafa;
    --pro-surface: #ffffff;
    --pro-border: #e2e8f0;
    --pro-border-hover: #94a3b8;
    --pro-text: #0f172a;
    --pro-text-muted: #64748b;
    --pro-accent: #000000;
    --pro-accent-light: #f1f5f9;
    --pro-accent-blue: #2563eb;
    --pro-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --pro-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --qzr-safe-top: env(safe-area-inset-top, 0px);
    --qzr-safe-right: env(safe-area-inset-right, 0px);
    --qzr-safe-bottom: env(safe-area-inset-bottom, 0px);
    --qzr-safe-left: env(safe-area-inset-left, 0px);
}

.competitions-pro-container {
    /* padding: 32px 24px; */
    /* background-color: var(--pro-bg); */
    color: var(--pro-text);
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- HEADER BAR --- */
.competitions-pro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 20px;
    /* background: var(--pro-surface); */
    padding: 16px 24px;
    /* border: 1px solid var(--pro-border); */
    border-radius: 12px;
    box-shadow: var(--pro-shadow-sm);
    flex-wrap: wrap;
}

.competitions-pro-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--pro-accent);
}

/* --- GLOBAL SEARCH INPUT --- */
.competition-pro-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    position: relative;
}

.competition-pro-search input {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--pro-border);
    border-radius: 8px;
    font-size: 14px;
    background-color: var(--pro-bg);
    color: var(--pro-text);
    transition: all 0.2s ease;
}

.competition-pro-search input:focus {
    outline: none;
    border-color: var(--pro-accent);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
    background-color: var(--pro-surface);
}

.competition-pro-search svg {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--pro-text-muted);
}

/* --- HEADER ACTIONS --- */
.competitions-pro-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.competition-pro-btn {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid var(--pro-border);
    background: var(--pro-surface);
    color: var(--pro-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.competition-pro-btn:hover {
    border-color: var(--pro-border-hover);
    background: var(--pro-accent-light);
}

.competition-pro-btn--primary {
    background: #4fd1c5;
    color: #0a1337;
    border-color: var(--pro-accent);
}

.competition-pro-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--pro-shadow-md);
    background: #1e293b;
    border-color: #1e293b;
    color: #f4f8fc;
}

/* --- STRUCTURAL LAYOUT --- */
.competition-pro-row {
    margin-bottom: 40px;
    display: grid;
    gap: 16px;
}

.competition-pro-row-head {
    display: grid;
    gap: 6px;
}

.competition-pro-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--pro-text);
    letter-spacing: 0;
    padding-bottom: 0;
    border-bottom: none;
    display: block;
}

.competition-pro-section-subtitle {
    display: block;
    font-size: 13px;
    color: var(--pro-text-muted);
    margin: 0;
}

/* --- FLUID COMPETITION FLOWS --- */
.competition-pro-flow,
.competition-pro-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    align-items: start;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
}

.competition-pro-carousel::-webkit-scrollbar {
    display: none;
}

/* --- "ALL COMPETITIONS" (GRID) --- */
.competitions-pro-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    align-items: start;
}

/* --- THE NEW PRO CARD --- */
.competition-pro-card {
    background-color: var(--pro-surface);
    border: 1px solid var(--pro-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: grid;
    grid-template-rows: auto 1fr;
    align-content: start;
    min-width: 0;
    height: 100%;
    text-decoration: none;
}

.competition-pro-card:hover {
    border-color: var(--pro-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--pro-shadow-md);
}

.competition-pro-card-banner {
    min-height: clamp(148px, 24vw, 220px);
    /* aspect-ratio: 16 / 10; */
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--pro-border);
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 14px;
}

.competition-pro-card-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.14) 0%, rgba(15, 23, 42, 0.62) 100%);
}

.competition-pro-card-banner-head {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

/* Badge over banner */
.competition-pro-badge {
    position: relative;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.competition-pro-banner-date {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--pro-text);
    font-size: 12px;
    font-weight: 700;
}

.competition-pro-card-content {
    padding: 18px;
    display: grid;
    gap: 12px;
    align-content: start;
}

.competition-pro-card-heading {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.competition-pro-card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--pro-text);
    overflow-wrap: anywhere;
}

.competition-pro-card-meta,
.competition-pro-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    align-items: flex-start;
}

.competition-pro-chip,
.competition-pro-tag {
    background: var(--pro-accent-light);
    color: var(--pro-text-muted);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.competition-pro-chip--code {
    background: var(--pro-accent);
    color: #fff;
}

.competition-pro-card-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.competition-pro-fact {
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--pro-border);
    background: linear-gradient(180deg, rgb(255 0 34 / 0%), rgba(255, 255, 255, 0.98));
}

.competition-pro-fact span {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pro-text-muted);
}

.competition-pro-fact strong {
    display: block;
    font-size: 14px;
    line-height: 1.35;
    color: var(--pro-text);
    word-break: break-word;
}

.competition-pro-inline-empty {
    padding: 18px;
    border: 1px dashed var(--pro-border-hover);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--pro-text-muted);
}

/* --- NEW TAB TOGGLES / READABILITY FIX --- */
.competitions-pro-title-area {
    display: flex;
    align-items: center;
    gap: 32px;
}

.competitions-pro-tabs-segmented {
    display: inline-flex;
    background: var(--pro-bg);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--pro-border);
}

.competition-pro-tab {
    min-height: 44px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pro-text-muted);
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.competition-pro-tab:hover {
    color: var(--pro-text);
}

.competition-pro-tab.active {
    background: var(--pro-text);
    color: #f8fbff;
    box-shadow: var(--pro-shadow-sm);
}

/* --- BANNER DATE COMPONENT --- */
.competition-pro-date-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* background: linear-gradient(to top, rgb(236 214 214 / 85%) 0%, transparent 100%); */
    padding: 24px 16px 12px;
    color: #193354;
    font-size: 13px;
    font-weight: 700;
    /* text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); */
}

@media (max-width: 960px) {
    .competitions-pro-container {
        padding-top: max(10px, var(--qzr-safe-top));
        padding-right: max(0px, var(--qzr-safe-right));
        padding-bottom: calc(10px + var(--qzr-safe-bottom));
        padding-left: max(0px, var(--qzr-safe-left));
        min-height: auto;
    }

    .competitions-pro-header {
        align-items: stretch;
    }

    .competitions-pro-title-area {
        width: 100%;
        gap: 20px;
        flex-wrap: wrap;
    }

    .competition-pro-search {
        order: 3;
        max-width: none;
        width: 100%;
    }

    .competition-pro-flow,
    .competition-pro-carousel,
    .competitions-pro-list {
        gap: 16px;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    }
}

@media (max-width: 640px) {
    .competitions-pro-container {
        padding-top: max(10px, var(--qzr-safe-top));
        padding-right: max(0px, var(--qzr-safe-right));
        padding-bottom: calc(12px + var(--qzr-safe-bottom));
        padding-left: max(0px, var(--qzr-safe-left));
        min-height: auto
    }

    .competitions-pro-header {
        top: calc(0.45rem + var(--qzr-safe-top));
        padding: 14px;
        gap: 14px;
    }

    .competitions-pro-title-area {
        gap: 12px;
    }

    .competitions-pro-tabs-segmented {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
        width: 100%;
        overflow: hidden;
    }

    .competition-pro-tab {
        width: auto;
    }

    .competitions-pro-actions {
        width: 100%;
    }

    .competitions-pro-actions .competition-pro-btn {
        flex: 1 1 160px;
        width: auto;
    }

    .competitions-pro-list {
        grid-template-columns: 1fr;
    }

    .competition-pro-flow,
    .competition-pro-carousel {
        grid-template-columns: 1fr;
    }

    .competition-pro-card {
        min-width: 0;
    }

    .competition-pro-card-banner {
        aspect-ratio: auto;
        min-height: 120px;
    }

    .competition-pro-card-content {
        padding: 14px;
        gap: 10px;
    }

    .competition-pro-card-facts {
        grid-template-columns: 1fr;
    }

    .competition-pro-chip,
    .competition-pro-tag,
    .competition-pro-banner-date {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}

/* ==========================================================================
   Creation wizard (3 steps) + bracket preview
   ========================================================================== */
.competition-wizard-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 22px;
}

.competition-wizard-dot {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    border: 1px solid #cad8e7;
    border-radius: 999px;
    background: #ffffff;
    color: #5b6f87;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.competition-wizard-dot:hover {
    border-color: #ff8a3d;
    color: #19324b;
}

.competition-wizard-dot-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #eef4fa;
    color: #5b6f87;
    font-size: 0.82rem;
    font-weight: 700;
    transition: background 0.18s ease, color 0.18s ease;
}

.competition-wizard-dot.is-active {
    border-color: transparent;
    color: #ffffff;
    background: linear-gradient(135deg, #ff8a3d 0%, #ff5d3d 100%);
    box-shadow: 0 8px 20px rgba(255, 93, 61, 0.28);
}

.competition-wizard-dot.is-active .competition-wizard-dot-index {
    background: rgba(255, 255, 255, 0.26);
    color: #ffffff;
}

.competition-wizard-dot.is-complete {
    border-color: rgba(16, 185, 129, 0.4);
    color: #0f9f6e;
    background: rgba(16, 185, 129, 0.14);
}

.competition-wizard-dot.is-complete .competition-wizard-dot-index {
    background: rgba(16, 185, 129, 0.2);
    color: #0f9f6e;
}

.competition-wizard-step {
    display: none;
    animation: competitionWizardFade 0.22s ease;
}

.competition-wizard-step.is-active {
    display: block;
}

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

.competition-wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e4edf6;
}

.competition-wizard-nav .is-hidden {
    display: none !important;
}

.competition-bracket-preview {
    margin-top: 18px;
    padding: 16px;
    border: 1px dashed #cad8e7;
    border-radius: 14px;
    background: #f7fbff;
}

.competition-bracket-preview-title {
    margin: 0 0 14px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6f87;
}

.competition-bracket-flow {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.competition-bracket-node {
    flex: 1 1 120px;
    min-width: 110px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.22);
    text-align: center;
}

.competition-bracket-node strong {
    display: block;
    font-size: 1.18rem;
    color: #173a64;
    line-height: 1.1;
}

.competition-bracket-node span {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: #4f647c;
}

.competition-bracket-node--final {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.32);
}

.competition-bracket-node--final strong {
    color: #0f9f6e;
}

.competition-bracket-arrow {
    flex: 0 0 auto;
    color: #9bb0c6;
    font-size: 1.2rem;
    font-weight: 700;
}

/* ==========================================================================
   Organizer lifecycle stepper
   ========================================================================== */
.competition-card--lifecycle {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.competition-lifecycle-track {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.competition-lifecycle-step {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #5b6f87;
    font-weight: 600;
    font-size: 0.88rem;
}

.competition-lifecycle-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eef4fa;
    color: #5b6f87;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid #cad8e7;
}

.competition-lifecycle-step.is-complete .competition-lifecycle-dot {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.34);
    color: #0f9f6e;
}

.competition-lifecycle-step.is-active {
    color: #102033;
}

.competition-lifecycle-step.is-active .competition-lifecycle-dot {
    background: linear-gradient(135deg, #ff8a3d 0%, #ff5d3d 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(255, 93, 61, 0.26);
}

.competition-lifecycle-sep {
    flex: 0 0 18px;
    height: 2px;
    border-radius: 2px;
    background: #d8e3ef;
}

.competition-lifecycle-next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: 14px;
    background: #eef4fa;
}

.competition-lifecycle-next-copy span {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6f87;
}

.competition-lifecycle-next-copy strong {
    display: block;
    margin-top: 2px;
    font-size: 1rem;
    color: #102033;
}

/* ==========================================================================
   Compact player panel (single CTA)
   ========================================================================== */
.competition-player-headline {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid #cad8e7;
    background: #ffffff;
}

.competition-player-headline-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.competition-player-headline-label {
    font-size: 1rem;
    font-weight: 700;
    color: #102033;
}

.competition-player-headline--is-open {
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(59, 130, 246, 0.08);
}

.competition-player-headline--is-joined {
    border-color: rgba(16, 185, 129, 0.34);
    background: rgba(16, 185, 129, 0.1);
}

.competition-player-headline--is-closed {
    border-color: #d8e3ef;
    background: #f4f7fb;
}

.competition-player-helper {
    margin: 12px 2px 0;
    font-size: 0.9rem;
    color: #4f647c;
    line-height: 1.5;
}

/* ==========================================================================
   Per-room save action (rooms tab)
   ========================================================================== */
.competition-room-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #d8e3ef;
}

.competition-room-save {
    min-height: 40px;
}

/* ==========================================================================
   Chrome visibility — banner + pro header only on the main browse page
   The competitions main page (mine or public) is the only view that shows
   the hero banner and the sticky pro header. Detail and create views hide
   both to keep the focused workflow chrome-free.
   ========================================================================== */
.competition-shell--view-detail .competition-banner,
.competition-shell--view-detail .competitions-pro-header,
.competition-shell--view-create .competition-banner,
.competition-shell--view-create .competitions-pro-header {
    display: none !important;
}

