/* Contest module — admin portal + team page (no app header on team view) */

.contest-hide-site-header header,
.contest-hide-site-header .nav-drawer-backdrop {
    display: none !important;
}

.contest-hide-site-header main.container {
    max-width: none;
    padding: 0;
    margin: 0;
}

.contest-admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 0;
    min-height: calc(100vh - 80px);
    background: #f3f4f6;
    font-family: 'Inter', system-ui, sans-serif;
}

@media (max-width: 1100px) {
    .contest-admin-shell {
        grid-template-columns: 1fr;
    }
    .contest-admin-preview {
        display: none;
    }
}

.contest-admin-sidebar {
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 24px 16px;
}

.contest-admin-sidebar h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin: 0 0 16px 8px;
}

.contest-admin-nav button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    margin-bottom: 4px;
}

.contest-admin-nav button:hover {
    background: #f3f4f6;
}

.contest-admin-nav button.is-active {
    background: #fef3c7;
    color: #92400e;
}

.contest-admin-main {
    padding: 28px 32px;
    overflow: auto;
}

.contest-admin-preview {
    background: #eef2ff;
    border-left: 1px solid #e5e7eb;
    padding: 24px 20px;
}

.contest-admin-preview h3 {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: #6b7280;
    margin: 0 0 16px;
}

.contest-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 20px;
}

.contest-card h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
    color: #111827;
}

.contest-field {
    margin-bottom: 14px;
}

.contest-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.contest-field input,
.contest-field select,
.contest-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.contest-prompt-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 700px) {
    .contest-prompt-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.contest-prompt-slot {
    aspect-ratio: 1;
    border: 2px dashed #c7d2fe;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.contest-prompt-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contest-prompt-slot .slot-label {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 999px;
    color: #4f46e5;
}

.contest-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

.contest-btn-primary {
    background: #4f46e5;
    color: #fff;
}

.contest-btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.contest-btn-success {
    background: #059669;
    color: #fff;
}

.contest-live-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
    max-width: 260px;
    margin: 0 auto;
}

.contest-live-card__head {
    background: #fcd34d;
    padding: 16px;
    min-height: 72px;
    position: relative;
}

.contest-live-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.6rem;
    font-weight: 800;
    background: #fff;
    padding: 3px 8px;
    border-radius: 6px;
}

.contest-live-card__body {
    padding: 14px;
    font-size: 0.8rem;
    color: #4b5563;
}

.contest-live-card__prompts {
    display: flex;
    gap: 6px;
    margin: 10px 0;
}

.contest-live-card__prompts span {
    flex: 1;
    height: 40px;
    background: #e5e7eb;
    border-radius: 6px;
}

.contest-stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.contest-stat-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 140px;
}

.contest-stat-box strong {
    display: block;
    font-size: 1.75rem;
    color: #4f46e5;
}

.contest-stat-box span {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Team contest page — reference design (ctp-*) */
.contest-team-page {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    color: #191c1d;
    background: #fff;
    overflow-x: hidden;
    overflow-y: visible;
}

/* Preserve line breaks from contest admin textareas */
.ctp-preserve-format,
.contest-welcome-lead.ctp-preserve-format {
    white-space: pre-line;
}

/* Hero */
.ctp-hero {
    background: #f3f4f5;
    padding: 64px clamp(20px, 4vw, 56px) 72px clamp(24px, 5vw, 72px);
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
}

.ctp-hero__inner {
    max-width: 1280px;
    width: 100%;
    margin: 0;
    margin-right: auto;
    display: grid;
    grid-template-columns: minmax(280px, 500px) 1fr;
    gap: 32px clamp(32px, 8vw, 120px);
    align-items: center;
}

.ctp-hero__copy {
    max-width: 500px;
    justify-self: start;
}

.ctp-badge {
    margin-bottom: 20px;
}

.ctp-badge__icon {
    font-size: 0.85rem;
}

.ctp-hero__title {
    font-size: clamp(2.25rem, 4.5vw, 3rem);
    line-height: 1.12;
    font-weight: 800;
    margin: 0 0 18px;
    letter-spacing: -0.02em;
}

.ctp-hero__title-accent {
    color: #4f46e5;
    display: block;
}

.ctp-hero__title-rest {
    color: #191c1d;
    font-weight: 800;
}

.ctp-hero__desc {
    color: #4a4a4a;
    font-size: 1.125rem;
    line-height: 1.65;
    max-width: 520px;
    margin: 0 0 28px;
}

.ctp-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}

.ctp-btn-challenge {
    padding: 16px 32px !important;
    font-size: 1.125rem !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 0 0 #3323cc;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ctp-btn-challenge:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 0 #3323cc;
}

.ctp-timer {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ctp-hero__stats {
    display: flex;
    gap: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(119, 117, 135, 0.15);
}

.ctp-hero__stats strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #191c1d;
}

.ctp-hero__stats span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #777587;
}

.ctp-hero__visual {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 320px;
    justify-self: end;
}

.ctp-hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.ctp-hero__glow--yellow {
    width: 96px;
    height: 96px;
    top: -12px;
    left: 8%;
    background: rgba(255, 210, 63, 0.35);
    animation: ctp-pulse 3s ease-in-out infinite;
}

.ctp-hero__glow--mint {
    width: 128px;
    height: 128px;
    bottom: -16px;
    right: 5%;
    background: rgba(5, 199, 147, 0.22);
    animation: ctp-pulse 3s ease-in-out infinite 0.7s;
}

@keyframes ctp-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.ctp-hero__frame {
    position: relative;
    z-index: 1;
    width: min(100%, 380px);
    background: #fff;
    padding: 16px;
    border: 2px solid rgba(79, 70, 229, 0.18);
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.15);
    transform: rotate(3deg);
    transition: transform 0.5s ease;
}

.ctp-hero__frame:hover {
    transform: rotate(0deg);
}

.ctp-hero__logo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    background: #fff;
    padding: 12px;
}

/* Challenge */
.ctp-challenge {
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px clamp(20px, 4vw, 40px) 72px;
    background: linear-gradient(180deg, #fafbff 0%, #fff 40%);
}

.ctp-challenge__head {
    text-align: center;
    margin-bottom: 40px;
}

.ctp-challenge__head h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    margin: 0 0 12px;
    color: #191c1d;
    letter-spacing: -0.02em;
}

.ctp-challenge__line {
    width: 96px;
    height: 4px;
    background: #ffd23f;
    margin: 0 auto 20px;
    border-radius: 999px;
}

.ctp-challenge__lead {
    color: #4a4a4a;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 680px;
    margin: 0 auto;
}

.ctp-challenge__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 28px;
    align-items: start;
}

.ctp-panel {
    background: #fff;
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 20px;
    padding: 28px 28px 32px;
    box-shadow: 0 4px 24px rgba(79, 70, 229, 0.06);
}

.ctp-panel__head {
    margin-bottom: 24px;
}

.ctp-panel__head--compact {
    margin-bottom: 20px;
}

.ctp-panel__label {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #777587;
    margin-bottom: 6px;
}

.ctp-section-title {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #4f46e5;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.ctp-challenge__side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ctp-prompts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.ctp-prompt-item {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border: 1px solid rgba(119, 117, 135, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.ctp-prompt-item:hover {
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.1);
}

.ctp-prompt-item__img-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #edeeef;
}

.ctp-prompt-item__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.ctp-prompt-item:hover .ctp-prompt-item__img-wrap img {
    transform: scale(1.06);
}

.ctp-prompt-item__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #eef2ff 0%, #e2dfff 100%);
}

.ctp-prompt-item__tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    color: #4f46e5;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 5px 11px;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.ctp-prompt-item__body {
    padding: 14px 16px 18px;
    flex: 1;
}

.ctp-prompt-item__body h4 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #191c1d;
    line-height: 1.35;
}

.ctp-prompt-item__body p {
    margin: 0;
    font-size: 0.85rem;
    color: #777587;
    line-height: 1.5;
}

.ctp-prompts-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    padding: 40px 20px;
    font-size: 0.95rem;
}

.ctp-imagine {
    margin-bottom: 0;
}

.ctp-imagine__lead {
    color: #464555;
    font-size: 0.98rem;
    line-height: 1.65;
    margin: 0 0 22px;
}

.ctp-imagine__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ctp-imagine__list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 0.92rem;
    color: #464555;
    line-height: 1.55;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid rgba(119, 117, 135, 0.06);
}

.ctp-imagine__list li span:last-child {
    flex: 1;
    min-width: 0;
}

.ctp-check-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 199, 147, 0.18);
    color: #059669;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
    margin-top: 1px;
}

.ctp-rules-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.ctp-rules-card__title {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: #191c1d;
    letter-spacing: -0.02em;
}

.ctp-rules-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ctp-rules-list li {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 16px 18px;
    background: #f8f9fa;
    border-radius: 14px;
    border: 1px solid rgba(119, 117, 135, 0.08);
}

.ctp-rule-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.ctp-rule-icon--mint {
    background: rgba(5, 199, 147, 0.18);
}

.ctp-rule-icon--yellow {
    background: rgba(255, 210, 63, 0.3);
}

.ctp-rule-icon--indigo {
    background: #e2dfff;
    color: #4f46e5;
    font-weight: 700;
}

.ctp-rules-list li > div {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.ctp-rules-list strong {
    display: block;
    font-size: 0.98rem;
    margin-bottom: 6px;
    color: #191c1d;
    line-height: 1.3;
}

.ctp-rules-list p {
    margin: 0;
    font-size: 0.88rem;
    color: #777587;
    line-height: 1.55;
}

/* Join CTA */
.ctp-join {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 24px 80px;
    text-align: center;
}

.ctp-join__head h3 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    color: #4f46e5;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.ctp-join__deadline {
    color: #4a4a4a;
    font-size: 1.1rem;
    margin: 0 0 32px;
}

.ctp-join__cta {
    max-width: 640px;
    margin: 0 auto;
}

.ctp-join__btn {
    width: 100%;
    padding: 22px 32px !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 0 0 #3323cc, 0 16px 40px rgba(79, 70, 229, 0.25);
    transition: transform 0.2s ease;
}

.ctp-join__btn:hover:not(:disabled) {
    transform: scale(1.02);
}

.ctp-social {
    margin-top: 28px;
}

.ctp-social__avatars {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 12px;
}

.ctp-social__av {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: linear-gradient(135deg, #c3c0ff, #4f46e5);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -10px;
}

.ctp-social__av:first-child {
    margin-left: 0;
}

.ctp-social__av--count {
    background: #4f46e5;
}

.ctp-social p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a4a4a;
}

.ctp-join__note {
    margin: 20px 0 0;
    font-size: 0.75rem;
    font-style: italic;
    color: #777587;
}

.ctp-join__enrolled {
    margin-top: 16px;
    color: #059669;
    font-weight: 600;
}

.ctp-completed-banner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-bottom: 1px solid #6ee7b7;
    color: #065f46;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.ctp-completed-banner strong {
    font-size: 1rem;
}

.ctp-completed-banner span {
    font-size: 0.9rem;
    opacity: 0.9;
}

.ctp-join__completed {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
}

.ctp-join__completed-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    background: #059669;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.ctp-join__completed h4 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: #065f46;
}

.ctp-join__completed p {
    margin: 0;
    color: #047857;
    font-size: 0.95rem;
}

@media (max-width: 960px) {
    .ctp-hero__inner,
    .ctp-challenge__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ctp-challenge__side {
        gap: 20px;
    }

    .ctp-panel {
        padding: 22px 20px 26px;
    }

    .ctp-hero__visual {
        order: -1;
        min-height: 260px;
    }

    .ctp-hero__frame {
        width: min(100%, 300px);
    }

    .ctp-prompts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
        margin: 0;
    }
}

.contest-welcome-hero--logo {
    height: auto;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 32px;
    background: linear-gradient(135deg, #f3f4f5 0%, #eef2ff 100%);
}

.contest-welcome-hero--logo img {
    max-width: 220px;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
}

.contest-completed-box .contest-completed-icon {
    width: 64px;
    height: 64px;
    margin: 24px auto 0;
    background: #059669;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.contest-completed-sub {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 8px;
}

/* Legacy team page classes (shared utilities) */
.contest-hero {
    background: #f3f4f5;
    padding: 48px 24px 56px;
}

.contest-hero__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

@media (max-width: 900px) {
    .contest-hero__inner {
        grid-template-columns: 1fr;
    }
}

.contest-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 210, 63, 0.25);
    color: #705900;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.contest-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    margin: 0 0 16px;
}

.contest-hero h1 em {
    font-style: normal;
    color: #4f46e5;
}

.contest-hero__desc {
    color: #4a4a4a;
    font-size: 1.1rem;
    max-width: 520px;
    margin-bottom: 24px;
}

.contest-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}

.contest-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.contest-timer div {
    text-align: center;
}

.contest-timer strong {
    display: block;
    font-size: 1.25rem;
    color: #4f46e5;
}

.contest-timer small {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #6b7280;
}

.contest-timer-colon {
    color: #4f46e5;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
    padding-bottom: 14px;
}

.contest-timer-ended {
    opacity: 0.75;
}

.contest-hero__stats {
    display: flex;
    gap: 32px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.contest-hero__stats strong {
    display: block;
    font-size: 1.5rem;
}

.contest-hero__stats span {
    font-size: 0.85rem;
    color: #6b7280;
}

.contest-hero__art {
    position: relative;
    display: flex;
    justify-content: center;
}

.contest-hero__art img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(79, 70, 229, 0.15);
    transform: rotate(2deg);
}

.contest-hero__logo-wrap {
    align-items: center;
}

.contest-hero__logo {
    max-width: min(100%, 420px);
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.18);
    transform: none;
    animation: contest-logo-float 4s ease-in-out infinite;
    background: #fff;
    padding: 20px;
}

@keyframes contest-logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.contest-challenge-section {
    text-align: center;
    padding-top: 56px;
    padding-bottom: 56px;
}

.contest-challenge-head {
    max-width: 720px;
    margin: 0 auto 8px;
}

.contest-challenge-lead {
    color: #4a4a4a;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 20px auto 0;
}

.contest-prompts-grid--center {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    justify-items: center;
}

.contest-prompts-grid--center .contest-prompt-card {
    width: 100%;
    max-width: 240px;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.contest-prompts-grid--center .contest-prompt-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(79, 70, 229, 0.12);
}

.contest-animate-in {
    opacity: 0;
    transform: translateY(24px);
    animation: contest-fade-up 0.7s ease forwards;
}

.contest-animate-in--delay {
    animation-delay: 0.15s;
}

.contest-animate-in--delay2 {
    animation-delay: 0.3s;
}

@keyframes contest-fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contest-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px;
}

.contest-section h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.contest-section .underline {
    width: 96px;
    height: 4px;
    background: #ffd23f;
    margin: 0 auto 24px;
    border-radius: 999px;
}

.contest-prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.contest-prompt-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
}

.contest-rules {
    background: #f3f4f5;
    border-radius: 14px;
    padding: 24px;
    margin-top: 32px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.contest-cta-bar {
    text-align: center;
    padding: 40px 24px 56px;
}

.contest-cta-bar .contest-btn-primary {
    padding: 16px 40px;
    font-size: 1.1rem;
    border-radius: 12px;
}

/* Welcome modal — scrollable when description is long (mobile) */
.contest-welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
    backdrop-filter: blur(4px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.contest-welcome-box {
    background: #fff;
    border-radius: 24px;
    max-width: 640px;
    width: 100%;
    overflow: visible;
    text-align: center;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.25);
    margin: auto 0;
    flex-shrink: 0;
}

.contest-welcome-hero {
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.contest-welcome-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contest-welcome-body {
    padding: 32px 36px 40px;
}

.contest-welcome-box h2 {
    font-size: 2rem;
    color: #1f2937;
    margin: 12px 0 10px;
    line-height: 1.2;
}

.contest-welcome-lead {
    color: #4b5563;
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 1.05rem;
}

.contest-welcome-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
}

.contest-welcome-stats div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contest-welcome-stats strong {
    font-size: 1.5rem;
    color: #4f46e5;
}

.contest-welcome-stats span {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.contest-welcome-enter {
    width: 100%;
    max-width: 320px;
    padding: 16px 32px !important;
    font-size: 1.1rem !important;
    border-radius: 12px !important;
}

/* Contest link mode — login only, no site chrome */
body.contest-link-mode header,
body.contest-hide-site-header header {
    display: none !important;
}

body.contest-link-mode,
body.contest-hide-site-header {
    overflow-y: scroll !important;
    overflow-x: hidden;
    height: auto !important;
    min-height: 100dvh;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    touch-action: pan-y;
}

html.contest-scroll-root,
html:has(body.contest-link-mode),
html:has(body.contest-hide-site-header) {
    overflow-y: scroll !important;
    height: auto !important;
}

body.contest-link-mode main#app.container,
body.contest-hide-site-header main#app.container,
body.contest-link-mode main.container,
body.contest-hide-site-header main.container {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
}

body.contest-link-mode main.container:has(.contest-team-page),
body.contest-hide-site-header main.container:has(.contest-team-page) {
    overflow: visible !important;
}

/* Storybook compose + PDF capture — restore normal book width during contest sessions */
body.composition-mode main.container {
    max-width: 1200px !important;
    width: 100%;
    padding: 20px !important;
    margin: 0 auto !important;
    box-sizing: border-box;
}

body.contest-link-mode #nav-toggle,
body.contest-link-mode #nav-backdrop {
    display: none !important;
}

.contest-login-only {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: linear-gradient(160deg, #f0f4ff 0%, #f8f9fa 45%, #eef2ff 100%);
}

.contest-login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px 32px;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.12);
    border: 1px solid rgba(79, 70, 229, 0.08);
}

.contest-login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.contest-login-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #4f46e5;
    letter-spacing: -0.02em;
}

.contest-login-card h2 {
    text-align: center;
    font-size: 1.5rem;
    color: #1f2937;
    margin: 0 0 8px;
}

.contest-login-sub {
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.contest-login-form .form-group {
    margin-bottom: 16px;
}

.contest-login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.contest-login-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
}

.contest-login-form input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.contest-login-submit {
    width: 100%;
    margin-top: 8px;
    padding: 14px !important;
    font-size: 1rem !important;
}

.contest-login-register {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
}

.contest-login-register a {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}

.contest-login-register a:hover {
    text-decoration: underline;
}

.contest-pm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.contest-pm-box {
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.contest-pm-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.contest-pm-box h3 {
    margin: 0 0 12px;
    color: #4f46e5;
    font-size: 1.25rem;
}

.contest-pm-box p {
    color: #4b5563;
    margin-bottom: 24px;
    line-height: 1.55;
    font-size: 0.95rem;
}

.contest-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.contest-table th,
.contest-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
}

.contest-table th {
    background: #f9fafb;
    font-weight: 700;
}

.contest-copy-link {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.contest-copy-link input {
    flex: 1;
    font-size: 0.8rem;
}

/* ── Global Contest Portal (contest_portal.php) ── */
.contest-portal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f3f4f5;
    font-family: 'Inter', system-ui, sans-serif;
}

.contest-portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: #fff;
    border-bottom: 1px solid #e7e8e9;
    flex-wrap: wrap;
}

.contest-portal-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contest-portal-header__logo {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

.contest-portal-header__title {
    font-family: 'Plus Jakarta Sans', Inter, sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #191c1d;
}

.contest-portal-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contest-portal-logout-form {
    margin: 0;
}

.contest-btn-yellow {
    background: #fcd34d;
    color: #78350f;
    font-weight: 700;
    border: none;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

.contest-btn-yellow:hover {
    background: #fbbf24;
}

.contest-btn-ghost {
    background: transparent;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    font-weight: 600;
}

.contest-btn-danger {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-weight: 600;
}

.contest-btn-danger:hover {
    background: #fef2f2;
}

.contest-portal-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.contest-portal-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e7e8e9;
    padding: 24px 16px;
}

.contest-portal-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 24px;
    background: #f8f9fa;
    border-radius: 14px;
    border: 1px solid #edeeef;
}

.contest-portal-profile__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contest-portal-profile__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.contest-portal-profile__info strong {
    font-size: 0.9rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contest-portal-profile__badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: #4f46e5;
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 999px;
    width: fit-content;
}

.contest-portal-profile__role {
    font-size: 0.72rem;
    color: #9ca3af;
}

.contest-portal-nav-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    margin: 0 0 10px 12px;
}

.contest-portal-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contest-portal-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: transparent;
    font-size: 0.92rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: left;
}

.contest-portal-nav__item:hover {
    background: #f3f4f6;
}

.contest-portal-nav__item.is-active {
    background: #fef3c7;
    color: #92400e;
}

.contest-portal-nav__item svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.contest-portal-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    min-width: 0;
    min-height: calc(100vh - 69px);
}

.contest-portal-main {
    padding: 28px 32px 40px;
    overflow: auto;
}

.contest-portal-preview {
    background: #eef2ff;
    border-left: 1px solid #e7e8e9;
    padding: 28px 20px;
    overflow: auto;
}

.contest-portal-page-title {
    font-family: 'Plus Jakarta Sans', Inter, sans-serif;
    font-size: 1.65rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 24px;
}

.contest-card__heading {
    margin: 0 0 18px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.contest-card__heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.contest-card__heading-row .contest-card__heading {
    margin: 0;
}

.contest-slots-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: #d1fae5;
    color: #065f46;
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.contest-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .contest-field-row {
        grid-template-columns: 1fr;
    }
}

.contest-prompt-slot__plus {
    font-size: 2rem;
    color: #a5b4fc;
    font-weight: 300;
    line-height: 1;
}

.contest-prompt-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 12px 0 0;
}

.contest-share-card {
    border-color: #c7d2fe !important;
    margin-top: 8px;
}

.contest-share-desc {
    font-size: 0.9rem;
    color: #4b5563;
    margin: 0 0 10px;
}

.contest-share-hint {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 16px;
}

.contest-field-note {
    font-size: 0.78rem;
    color: #6b7280;
    margin: 8px 0 0;
    line-height: 1.45;
}

.contest-access-denied {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: #f3f4f5;
}

.contest-access-denied__box {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid #fecaca;
}

.contest-access-denied__box h2 {
    margin: 0 0 12px;
    color: #b91c1c;
    font-size: 1.25rem;
}

.contest-access-denied__box p {
    color: #374151;
    line-height: 1.55;
    margin: 0 0 16px;
}

.contest-portal-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0 8px;
    margin-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.contest-preview-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #6b7280;
    margin: 0 0 16px;
    text-align: center;
}

.contest-live-card--portal {
    max-width: 280px;
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.15);
}

.contest-live-card--portal .contest-live-card__head {
    background: #fcd34d;
    min-height: 88px;
    padding: 18px 14px 14px;
    position: relative;
}

.contest-live-card__live-pill {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: #059669;
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
}

.contest-live-card__title {
    display: block;
    font-family: 'Plus Jakarta Sans', Inter, sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.25;
    padding-right: 48px;
    margin-top: 8px;
}

.contest-live-card__deadline {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 8px;
}

.contest-live-card__timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.contest-live-card__timer div {
    text-align: center;
}

.contest-live-card__timer strong {
    display: block;
    font-size: 1.1rem;
    color: #4f46e5;
    font-weight: 800;
}

.contest-live-card__timer small {
    font-size: 0.55rem;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.04em;
}

.contest-live-card__timer > span {
    color: #4f46e5;
    font-weight: 800;
    padding-bottom: 12px;
}

.contest-live-card__prompts--images {
    display: flex;
    gap: 8px;
    margin: 0 0 10px;
}

.contest-preview-prompt-img {
    flex: 1;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.contest-preview-prompt-placeholder {
    flex: 1;
    height: 52px;
    background: #e5e7eb;
    border-radius: 8px;
}

.contest-live-card__hint {
    margin: 0 0 12px;
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.45;
}

.contest-live-card__join {
    width: 100%;
    padding: 12px !important;
    border-radius: 10px !important;
    opacity: 0.85;
}

@media (max-width: 1100px) {
    .contest-portal-workspace {
        grid-template-columns: 1fr;
    }
    .contest-portal-preview {
        display: none;
    }
    .contest-portal-sidebar {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .contest-portal-layout {
        flex-direction: column;
    }
    .contest-portal-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e7e8e9;
    }
    .contest-portal-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .contest-portal-nav__item {
        width: auto;
        flex: 1;
        min-width: 140px;
        justify-content: center;
        font-size: 0.82rem;
    }
    .contest-portal-main {
        padding: 20px 16px;
    }
}

/* ── Admin Portal v2 (screenshot layout) ── */
.contest-portal--v2 {
    min-height: 100vh;
    background: #f3f4f5;
}

.ca-layout {
    display: flex;
    min-height: 100vh;
}

.ca-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e7e8e9;
    padding: 28px 18px;
}

.ca-sidebar__brand h2 {
    margin: 0;
    font-family: 'Plus Jakarta Sans', Inter, sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #3525cd;
    line-height: 1.2;
}

.ca-sidebar__brand p {
    margin: 4px 0 28px;
    font-size: 0.82rem;
    color: #9ca3af;
}

.ca-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ca-sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: transparent;
    font-size: 0.92rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: left;
}

.ca-sidebar__item:hover {
    background: #f3f4f6;
}

.ca-sidebar__item.is-active {
    background: #fef3c7;
    color: #92400e;
}

.ca-main {
    flex: 1;
    overflow: auto;
    padding: 32px 40px 100px;
    max-width: 960px;
}

.ca-page-header {
    margin-bottom: 28px;
}

.ca-page-header h1 {
    margin: 0 0 8px;
    font-family: 'Plus Jakarta Sans', Inter, sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: #3525cd;
}

.ca-page-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ca-section {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #edeeef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    overflow: hidden;
}

.ca-section--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.ca-split-col {
    padding: 0;
}

.ca-split-col + .ca-split-col {
    border-left: 1px solid #edeeef;
}

.ca-section__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 22px 0;
}

.ca-section__head h3 {
    margin: 0;
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.ca-section__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ca-section__icon--purple { background: #eef2ff; color: #4f46e5; }
.ca-section__icon--green { background: #ecfdf5; color: #059669; }
.ca-section__icon--yellow { background: #fef9c3; color: #ca8a04; }

.ca-slots-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: #d1fae5;
    color: #065f46;
    padding: 5px 12px;
    border-radius: 999px;
}

.ca-section__body {
    padding: 16px 22px 22px;
}

.ca-field {
    margin-bottom: 16px;
}

.ca-field:last-child {
    margin-bottom: 0;
}

.ca-field label,
.ca-inline-label,
.ca-caption-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}

.ca-caption-label {
    margin-top: 8px;
    margin-bottom: 4px;
}

.ca-field input,
.ca-field select,
.ca-field textarea,
.ca-caption-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.92rem;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
}

.ca-field textarea {
    resize: vertical;
    min-height: 88px;
}

.ca-field input:focus,
.ca-field select:focus,
.ca-field textarea:focus,
.ca-caption-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ca-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ca-prompt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ca-prompt-slot {
    aspect-ratio: 1.15;
    border: 2px dashed #c7d2fe;
    border-radius: 14px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ca-prompt-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ca-prompt-slot__plus {
    font-size: 2.5rem;
    color: #a5b4fc;
    font-weight: 300;
}

.ca-prompt-slot__badge {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.92);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
}

.ca-page-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-page-range input {
    width: 64px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

.ca-page-range span {
    color: #9ca3af;
    font-size: 0.85rem;
}

.ca-format-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ca-format-chip {
    cursor: pointer;
}

.ca-format-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ca-format-chip span {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    background: #fff;
}

.ca-format-chip input:checked + span {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.ca-dist-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: left;
}

.ca-dist-btn:hover {
    background: #f9fafb;
    border-color: #c7d2fe;
}

.ca-dist-arrow {
    color: #9ca3af;
    font-size: 1.2rem;
}

.ca-org-panel {
    display: none;
    margin-top: 12px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.ca-org-panel.is-open {
    display: block;
}

.ca-org-panel label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}

.ca-org-panel select,
.ca-org-panel input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.ca-field-note,
.ca-org-panel .ca-field-note {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 8px 0 0;
    line-height: 1.4;
}

.ca-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
}

.ca-footer__actions {
    display: flex;
    gap: 12px;
}

.ca-btn-draft {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    color: #374151;
    cursor: pointer;
}

.ca-btn-launch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 12px;
    border: none;
    background: #05c793;
    font-weight: 700;
    font-size: 0.92rem;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(5, 199, 147, 0.35);
}

.ca-btn-launch:hover {
    background: #04b585;
}

.ca-link-danger {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: auto;
}

@media (max-width: 900px) {
    .ca-layout {
        flex-direction: column;
    }
    .ca-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e7e8e9;
    }
    .ca-sidebar__nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .ca-main {
        padding: 24px 16px 80px;
    }
    .ca-section--split {
        grid-template-columns: 1fr;
    }
    .ca-split-col + .ca-split-col {
        border-left: none;
        border-top: 1px solid #edeeef;
    }
    .ca-field-row {
        grid-template-columns: 1fr;
    }
    .ca-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .ca-footer__actions {
        flex-direction: column;
    }
    .ca-btn-draft,
    .ca-btn-launch {
        justify-content: center;
        width: 100%;
    }
}

/* Contest story wizard — prompt sidebar */
.story-wizard.story-wizard--contest {
    max-width: 1280px;
    width: 100%;
    margin: 20px auto 48px;
    padding: 0 clamp(12px, 2vw, 20px);
    background: transparent;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
}

.story-contest-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 320px);
    gap: 24px;
    align-items: start;
}

.story-contest-main {
    background: #fff;
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 18px;
    padding: 24px 28px 28px;
    box-shadow: 0 6px 28px rgba(79, 70, 229, 0.06);
    min-width: 0;
}

.story-contest-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edeeef;
}

.story-contest-eyebrow {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #777587;
}

.story-contest-heading {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #4f46e5;
    margin: 0;
    letter-spacing: -0.02em;
}

.story-contest-step {
    min-width: 0;
}

.story-contest-step--input .story-step-title {
    margin-top: 0;
}

.story-step-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #191c1d;
    margin: 0 0 6px;
}

.story-step-lead {
    margin: 0 0 18px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #464555;
}

.story-wizard--contest .story-textarea--contest {
    min-height: 160px;
    max-height: 240px;
    resize: vertical;
    font-size: 0.95rem;
    line-height: 1.55;
}

.story-wizard--contest .story-media-box {
    margin-bottom: 14px;
    padding: 14px 16px;
}

.story-wizard--contest .story-media-actions {
    gap: 10px;
}

.story-wizard--contest .story-wizard-step-nav {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edeeef;
}

.story-contest-aside {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c7c4d8 transparent;
}

.csp-panel {
    background: #fff;
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(79, 70, 229, 0.04),
        0 20px 48px rgba(79, 70, 229, 0.1);
}

.csp-panel__head {
    padding: 22px 22px 18px;
    background: linear-gradient(145deg, #4f46e5 0%, #6366f1 55%, #7c3aed 100%);
    color: #fff;
    position: relative;
}

.csp-panel__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 210, 63, 0.95);
    color: #705900;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.csp-panel__title {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #fff;
}

.csp-panel__theme {
    margin: 8px 0 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
}

.csp-panel__accent {
    position: absolute;
    bottom: 0;
    left: 22px;
    right: 22px;
    height: 3px;
    background: #ffd23f;
    border-radius: 999px 999px 0 0;
}

.csp-panel__intro {
    margin: 0;
    padding: 18px 22px 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #464555;
}

.csp-panel__section {
    padding: 18px 22px 8px;
}

.csp-panel__section-label {
    margin: 0 0 14px;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #4f46e5;
    letter-spacing: -0.01em;
}

.csp-prompt-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.csp-prompt-grid--two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.csp-prompt {
    background: #f8f9fa;
    border: 1px solid rgba(119, 117, 135, 0.1);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.csp-prompt:hover {
    transform: translateY(-3px);
    border-color: rgba(79, 70, 229, 0.22);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
}

.csp-prompt__media {
    position: relative;
    aspect-ratio: 1;
    background: #edeeef;
    overflow: hidden;
}

.csp-prompt__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.csp-prompt:hover .csp-prompt__media img {
    transform: scale(1.06);
}

.csp-prompt__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eef2ff 0%, #e2dfff 100%);
}

.csp-prompt__tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    color: #4f46e5;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.csp-prompt__body {
    padding: 10px 12px 12px;
}

.csp-prompt__body h4 {
    margin: 0 0 4px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #191c1d;
    line-height: 1.3;
}

.csp-prompt__body p {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #777587;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.csp-prompt-grid--two .csp-prompt__body h4 {
    font-size: 0.76rem;
}

.csp-prompt-grid--two .csp-prompt__body p {
    font-size: 0.68rem;
    -webkit-line-clamp: 3;
}

.csp-panel__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 22px 20px;
    border-top: 1px solid #edeeef;
    background: #fafbff;
}

.csp-rule-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 12px;
    padding: 10px 12px;
}

.csp-rule-pill__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.csp-rule-pill__icon--pages {
    background: rgba(5, 199, 147, 0.15);
}

.csp-rule-pill__icon--format {
    background: rgba(255, 210, 63, 0.28);
}

.csp-rule-pill small {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #777587;
    margin-bottom: 2px;
}

.csp-rule-pill strong {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #191c1d;
    line-height: 1.25;
}

.csp-panel--loading {
    padding: 22px;
}

.csp-skeleton {
    border-radius: 10px;
    background: linear-gradient(90deg, #eef2ff 25%, #f8f9fa 50%, #eef2ff 75%);
    background-size: 200% 100%;
    animation: csp-shimmer 1.2s ease-in-out infinite;
}

.csp-skeleton--title {
    height: 28px;
    width: 70%;
    margin-bottom: 12px;
}

.csp-skeleton--line {
    height: 14px;
    width: 100%;
    margin-bottom: 16px;
}

.csp-skeleton--grid {
    height: 160px;
    width: 100%;
    margin-bottom: 12px;
}

@keyframes csp-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.csp-loading-text,
.csp-empty {
    margin: 0;
    color: #777587;
    font-size: 0.85rem;
    text-align: center;
    padding: 8px 0 4px;
}

@media (max-width: 960px) {
    .story-contest-layout {
        grid-template-columns: 1fr;
    }
    .story-contest-aside {
        position: static;
        max-height: none;
        order: -1;
    }

    .csp-prompt-grid--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
