/* Weekly Challenge — archive quiz experience */

:root {
    --wc-ink: #141c28;
    --wc-panel: #1e2a3a;
    --wc-sand: #f2eee6;
    --wc-muted: #9aa8b8;
    --wc-accent: #e07a3d;
    --wc-accent-soft: #f0a46a;
    --wc-ok: #3d9a6a;
    --wc-bad: #c45c5c;
    --wc-line: rgba(242, 238, 230, 0.12);
    --wc-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --wc-header-offset: 64px;
}

body.wc-page {
    background: var(--wc-ink) !important;
    overflow-x: hidden;
}

body.wc-page .back-to-top {
    display: none !important;
}

.wc-app,
.wc-app * {
    box-sizing: border-box;
}

.wc-app {
    position: relative;
    clear: both;
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    margin: 0 !important;
    padding: calc(var(--wc-header-offset) + 16px) 0 48px;
    background: var(--wc-ink);
    color: var(--wc-sand);
    font-family: "IBM Plex Sans Arabic", "Cairo", Tahoma, sans-serif;
    overflow: hidden;
}

.wc-app__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(800px 380px at 100% 0%, rgba(224, 122, 61, 0.18), transparent 55%),
        radial-gradient(640px 360px at 0% 40%, rgba(61, 154, 106, 0.12), transparent 50%),
        linear-gradient(180deg, #182233 0%, var(--wc-ink) 45%, #0f1520 100%);
}

.wc-app__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wc-shell {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 0 16px;
}

.wc-top {
    text-align: center;
    margin-bottom: 20px;
    animation: wc-rise 0.55s ease both;
}

.wc-top__kicker {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--wc-accent-soft);
    letter-spacing: 0.04em;
}

.wc-top h1 {
    margin: 0 !important;
    font-family: "Cairo", sans-serif;
    font-size: clamp(26px, 6vw, 36px) !important;
    font-weight: 800;
    line-height: 1.25;
    color: var(--wc-sand) !important;
}

.wc-top__tagline {
    margin: 8px 0 0;
    color: var(--wc-muted);
    font-size: 15px;
}

.wc-invite {
    margin-top: 24px;
    padding: 20px 18px;
    border-radius: 18px;
    text-align: center;
    background: rgba(242, 238, 230, 0.04);
    border: 1px solid var(--wc-line);
    animation: wc-rise 0.55s 0.12s ease both;
}

.wc-invite.is-complete {
    background: rgba(224, 122, 61, 0.1);
    border-color: rgba(224, 122, 61, 0.32);
}

.wc-invite__kicker {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--wc-accent-soft);
}

.wc-invite h2 {
    margin: 0 0 8px !important;
    font-family: "Cairo", sans-serif;
    font-size: 20px !important;
    color: var(--wc-sand) !important;
}

.wc-invite__hint {
    margin: 0 0 16px;
    color: var(--wc-muted);
    font-size: 14px;
    line-height: 1.55;
}

.wc-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: #1877f2;
    color: #fff !important;
    font-family: "Cairo", sans-serif;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 8px 18px rgba(24, 119, 242, 0.28);
    transition: background 0.2s ease, transform 0.15s ease;
}

.wc-share:hover,
.wc-share:focus {
    background: #0d65d9;
    color: #fff !important;
    text-decoration: none !important;
}

.wc-share:active {
    transform: scale(0.98);
}

.wc-share__icon {
    display: block;
    flex-shrink: 0;
}

.wc-empty {
    text-align: center;
    padding: 48px 16px;
    border: 1px dashed var(--wc-line);
    border-radius: 16px;
    color: var(--wc-muted);
    animation: wc-rise 0.5s ease both;
}

.wc-meta {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(242, 238, 230, 0.04);
    border: 1px solid var(--wc-line);
    animation: wc-rise 0.55s 0.05s ease both;
}

.wc-meta strong {
    display: block;
    font-family: "Cairo", sans-serif;
    font-size: 18px;
    margin-bottom: 4px;
}

.wc-meta p {
    margin: 0;
    color: var(--wc-muted);
    font-size: 14px;
}

.wc-scorecard {
    flex: 0 0 auto;
    min-width: 96px;
    text-align: center;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(224, 122, 61, 0.12);
    border: 1px solid rgba(224, 122, 61, 0.35);
}

.wc-scorecard__points {
    display: block;
    font-family: "Cairo", sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--wc-accent-soft);
    line-height: 1;
}

.wc-scorecard small {
    color: var(--wc-muted);
    font-size: 11px;
}

.wc-scorecard__progress {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--wc-sand);
}

.wc-scorecard.is-done {
    background: rgba(61, 154, 106, 0.16);
    border-color: rgba(61, 154, 106, 0.45);
}

.wc-card {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 18px;
    background: var(--wc-panel);
    border: 1px solid var(--wc-line);
    box-shadow: var(--wc-shadow);
    animation: wc-rise 0.55s ease both;
}

.wc-card__badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(242, 238, 230, 0.06);
    color: var(--wc-muted);
    font-size: 12px;
    font-weight: 600;
}

.wc-card__prompt {
    margin: 0 0 14px !important;
    font-family: "Cairo", sans-serif;
    font-size: 22px !important;
    font-weight: 800;
    color: var(--wc-sand) !important;
    line-height: 1.35;
}

.wc-card__media {
    margin: 0 0 16px;
    border-radius: 14px;
    overflow: hidden;
    background: #0c1118;
    max-width: 100%;
}

.wc-card__media img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
    background: #0c1118;
}

.wc-options {
    display: grid;
    gap: 8px;
}

.wc-option {
    appearance: none;
    width: 100%;
    text-align: right;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--wc-line);
    background: rgba(242, 238, 230, 0.04);
    color: var(--wc-sand);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.wc-option:hover:not(:disabled) {
    background: rgba(224, 122, 61, 0.14);
    border-color: rgba(224, 122, 61, 0.45);
}

.wc-option:active:not(:disabled) {
    transform: scale(0.98);
}

.wc-option:focus-visible {
    outline: 2px solid var(--wc-accent);
    outline-offset: 2px;
}

.wc-option:disabled {
    cursor: default;
    opacity: 0.95;
}

.wc-option span {
    display: block;
    line-height: 1.55;
    word-break: break-word;
}

.wc-option.is-correct {
    background: rgba(61, 154, 106, 0.22);
    border-color: rgba(61, 154, 106, 0.7);
}

.wc-option.is-wrong {
    background: rgba(196, 92, 92, 0.2);
    border-color: rgba(196, 92, 92, 0.7);
}

.wc-card__feedback {
    margin: 12px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--wc-muted);
}

.wc-card__feedback.is-ok { color: #7dcea0; }
.wc-card__feedback.is-bad { color: #e8a0a0; }

.wc-card__reveal {
    display: inline-block;
    margin-top: 6px;
    color: var(--wc-accent-soft);
    text-decoration: underline;
}

.wc-board {
    margin-top: 28px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(242, 238, 230, 0.04);
    border: 1px solid var(--wc-line);
    animation: wc-rise 0.55s 0.1s ease both;
}

.wc-board h2 {
    margin: 0 0 14px !important;
    font-family: "Cairo", sans-serif;
    font-size: 20px !important;
    color: var(--wc-sand) !important;
}

.wc-board__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wc-board__list li {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--wc-line);
}

.wc-board__list li:last-child {
    border-bottom: 0;
}

.wc-board__list li.is-me {
    color: var(--wc-accent-soft);
}

.wc-board__rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 238, 230, 0.08);
    font-size: 12px;
    font-weight: 700;
}

.wc-board__pts {
    font-family: "Cairo", sans-serif;
    font-weight: 800;
}

.wc-board__empty {
    color: var(--wc-muted);
    font-size: 14px;
}

.wc-name {
    margin-top: 24px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(224, 122, 61, 0.1);
    border: 1px solid rgba(224, 122, 61, 0.28);
    animation: wc-rise 0.55s 0.08s ease both;
}

.wc-name h2 {
    margin: 0 0 8px !important;
    font-family: "Cairo", sans-serif;
    font-size: 20px !important;
    color: var(--wc-sand) !important;
}

.wc-name__hint {
    margin: 0 0 12px;
    color: var(--wc-muted);
    font-size: 14px;
    line-height: 1.55;
}

.wc-name__lock {
    display: none;
    margin: 0 0 12px;
    color: var(--wc-accent-soft);
    font-size: 13px;
}

.wc-name.is-locked .wc-name__lock {
    display: block;
}

.wc-name.is-locked .wc-name__form {
    opacity: 0.45;
    pointer-events: none;
}

.wc-name__label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wc-sand);
}

.wc-name__row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.wc-name__row input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--wc-line);
    background: rgba(242, 238, 230, 0.06);
    color: var(--wc-sand);
    font: inherit;
    font-size: 15px;
}

.wc-name__row input:focus {
    outline: 2px solid var(--wc-accent);
    outline-offset: 1px;
}

.wc-name__row button {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    background: var(--wc-accent);
    color: #1a120c;
    font-family: "Cairo", sans-serif;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.wc-name__row button:hover {
    background: var(--wc-accent-soft);
}

.wc-name__row button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.wc-name__status {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}

.wc-name__status.is-pending { color: var(--wc-accent-soft); }
.wc-name__status.is-ok { color: #7dcea0; }
.wc-name__status.is-bad { color: #e8a0a0; }

@keyframes wc-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .wc-top,
    .wc-meta,
    .wc-card,
    .wc-board,
    .wc-card__media img {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 640px) {
    .wc-meta {
        flex-direction: column;
    }
    .wc-name__row {
        flex-direction: column;
    }
}

/* Sidebar promo */
.weekly-challenge-promo {
    margin: 0 0 18px;
    padding: 18px 16px;
    border-radius: 14px;
    background:
        radial-gradient(280px 120px at 100% 0%, rgba(224, 122, 61, 0.35), transparent 60%),
        linear-gradient(160deg, #1e2a3a 0%, #141c28 100%);
    color: #f2eee6;
    text-align: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.weekly-challenge-promo h2 {
    margin: 0 0 6px !important;
    font-family: "Cairo", Tahoma, sans-serif;
    font-size: 20px !important;
    font-weight: 800;
    color: #f2eee6 !important;
}

.weekly-challenge-promo p {
    margin: 0 0 12px;
    color: #b8c2cf;
    font-size: 13px;
    line-height: 1.5;
}

.weekly-challenge-promo a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: #e07a3d;
    color: #fff !important;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.15s ease;
}

.weekly-challenge-promo a:hover {
    background: #c8662f;
    transform: translateY(-1px);
}
