/* =========================================================
   PSW LEAGUE — feuille de style rationalisée
   ========================================================= */

/* Page et en-têtes */
.psw-weekly-page {
    max-width: 1120px;
    padding-top: 34px;
    padding-bottom: 70px;
    color: var(--text, #172033);
}

.psw-weekly-hero {
    padding: 30px 0 34px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-color, #e4e9f1);
}

.psw-weekly-kicker,
.psw-weekly-label {
    display: block;
    color: var(--cp-blue);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.psw-weekly-hero h1 {
    margin: 9px 0;
    font-size: clamp(34px, 5vw, 54px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -1.8px;
}

.psw-weekly-hero h1 span {
    color: #f28a24;
}

.psw-weekly-hero p {
    max-width: 720px;
    margin: 12px 0 0;
    color: #68758a;
    font-size: 16px;
    line-height: 1.7;
}

/* Cartes principales et titres de section */
.psw-weekly-game-card,
.psw-weekly-leaderboard,
.psw-weekly-empty,
.psw-weekly-annual {
    margin: 30px 0 22px;
    padding: 24px;
    border: 1px solid #e3e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(19, 39, 71, .045);
}

.psw-weekly-game-top,
.psw-weekly-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.psw-weekly-game-top h2,
.psw-weekly-section-heading h2,
.psw-weekly-annual h2 {
    margin: 5px 0 0;
    font-size: 25px;
    font-weight: 850;
    letter-spacing: -.6px;
}

.psw-weekly-section-heading > span {
    color: #778398;
    font-size: 12px;
}

/* Statut de la manche */
.psw-weekly-status {
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--paper-blue);
    color: var(--cp-blue-dark);
    font-size: 11px;
    font-weight: 800;
}

.psw-weekly-status.is-closed {
    background: #f1f3f6;
    color: #596579;
}

/* Image et manche verrouillée */
.psw-weekly-image-wrap {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    min-height: 180px;
    border-radius: 12px;
    background: linear-gradient(145deg, #0070d1 0%, #003791 100%);
}

.psw-weekly-image-wrap img {
    display: block;
    width: 100%;
    max-height: 480px;
    object-fit: contain;
}

.psw-weekly-image-caption {
    position: absolute;
    bottom: 14px;
    left: 14px;
    padding: 8px 12px;
    border-radius: 7px;
    background: rgba(5, 12, 27, .82);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.psw-weekly-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 210px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cp-violet), #142b52);
    color: #fff;
    text-align: center;
}

.psw-weekly-locked i {
    color: #f28a24;
    font-size: 30px;
}

.psw-weekly-locked strong {
    font-size: 19px;
}

.psw-weekly-locked span {
    color: #c6d3e6;
    font-size: 13px;
}

/* Indices */
.psw-weekly-clues {
    margin: 24px 0;
}

.psw-weekly-clues h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.psw-weekly-clue {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 14px;
    margin: 8px 0;
    padding: 13px 15px;
    border: 1px solid #e8edf4;
    border-radius: 9px;
    background: #f9fbfd;
}

.psw-weekly-clue > span {
    color: var(--cp-blue);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .8px;
}

.psw-weekly-clue p {
    margin: 0;
    color: #344258;
    line-height: 1.55;
}

.psw-weekly-no-clue {
    padding: 14px 16px;
    border-left: 3px solid #f28a24;
    background: #fff8ef;
    color: #67451f;
    font-size: 13px;
}

/* Barème des points */
.psw-weekly-score-rules {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin: 22px 0;
}

.psw-weekly-score-rules > div {
    padding: 13px 9px;
    border: 1px solid #e5eaf1;
    border-radius: 9px;
    background: #fbfcfe;
    text-align: center;
}

.psw-weekly-score-rules strong {
    display: block;
    color: var(--cp-blue);
    font-size: 22px;
    font-weight: 900;
}

.psw-weekly-score-rules span {
    display: block;
    margin-top: 3px;
    color: #68758a;
    font-size: 10px;
    font-weight: 700;
}

.psw-weekly-score-rules > div.is-disabled {
    opacity: .35;
    filter: grayscale(1);
}

/* Formulaire, boutons et retours */
.psw-weekly-answer-form {
    padding: 18px;
    border: 1px solid #e0eaf6;
    border-radius: 10px;
    background: #f4f8fd;
}

.psw-weekly-answer-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 850;
}

.psw-weekly-answer-row {
    display: flex;
    gap: 9px;
}

.psw-weekly-answer-row input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #d5deea;
    border-radius: 7px;
    background: #fff;
    font: inherit;
}

.psw-weekly-answer-form small {
    display: block;
    margin-top: 9px;
    color: #69778c;
    font-size: 11px;
}

.psw-weekly-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 10px 17px;
    border: 0;
    border-radius: 7px;
    background: var(--cp-blue);
    color: #fff;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.psw-weekly-button:hover {
    background: #0059a6;
    color: #fff;
}

.psw-weekly-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid #d7e0eb;
    border-radius: 7px;
    color: #31435d;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.psw-weekly-login {
    padding: 16px;
    border: 1px solid #e4eaf2;
    border-radius: 9px;
}

.psw-weekly-login p {
    margin: 0 0 12px;
    color: #58667b;
    font-size: 13px;
}

.psw-weekly-feedback {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px 17px;
    border: 1px solid #e0e8f1;
    border-radius: 9px;
    background: #f2f6fb;
}

.psw-weekly-feedback.is-correct {
    border-color: #ccebd7;
    background: #eef9f2;
    color: #17653a;
}

.psw-weekly-feedback span {
    font-size: 12px;
}

.psw-weekly-alert {
    padding: 12px 15px;
    margin: 0 0 18px;
    border-radius: 8px;
    font-size: 13px;
}

.psw-weekly-alert.is-error {
    border: 1px solid #f0cece;
    background: #fff1f1;
    color: #942f36;
}

.psw-weekly-alert.is-success {
    border: 1px solid #ccebd6;
    background: #effaf3;
    color: #17633a;
}

/* Révélation de la réponse */
.psw-weekly-reveal {
    margin-top: 20px;
    padding: 19px;
    border-radius: 10px;
    background: #0d1a32;
    color: #fff;
    text-align: center;
}

.psw-weekly-reveal span {
    display: block;
    color: #aebed5;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.4px;
}

.psw-weekly-reveal strong {
    display: block;
    margin-top: 6px;
    color: #ff9a32;
    font-size: 25px;
}

/* Classements hebdomadaire et général */
.psw-weekly-ranking {
    margin: 0;
    padding: 0;
    list-style: none;
}

.psw-weekly-ranking li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 9px 2px;
    border-bottom: 1px solid #edf0f4;
}

.psw-weekly-ranking li:last-child {
    border-bottom: 0;
}

.psw-weekly-rank-number {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #edf3fa;
    color: var(--cp-navy);
    font-size: 12px;
    font-weight: 900;
}

.psw-weekly-rank-number.is-medal {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 0;
    background: transparent;
    font-size: 23px;
}

.psw-weekly-player {
    flex: 1;
    font-size: 13px;
    font-weight: 800;
}

.psw-weekly-ranking li > strong {
    color: var(--cp-blue);
    font-size: 14px;
}

.psw-weekly-winner {
    padding: 5px 8px;
    border-radius: 5px;
    background: #fff3e5;
    color: #9b5713;
    font-size: 9px;
    font-weight: 900;
}

.psw-weekly-ranking-detail {
    color: #78869a;
    font-size: 10px;
}

.psw-weekly-ranking-note,
.psw-weekly-empty-line {
    margin: 14px 0 0;
    color: #7a8799;
    font-size: 11px;
}

/* Bloc classement général */
.psw-weekly-annual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    background: linear-gradient(120deg, #0b1730, #123c70);
    color: #fff;
}

.psw-weekly-annual .psw-weekly-label {
    color: #8dc7ff;
}

.psw-weekly-annual h2 {
    color: #fff;
}

.psw-weekly-annual p {
    max-width: 620px;
    margin: 7px 0 0;
    color: #c8d7e9;
    font-size: 13px;
    line-height: 1.6;
}

.psw-weekly-annual .psw-weekly-secondary {
    border-color: #55749a;
    color: #fff;
}

/* Archives */
.psw-weekly-archive-answer {
    display: block;
    margin-top: 4px;
    color: #7b8798;
    font-size: 10px;
    font-weight: 500;
}

.psw-weekly-past-games {
    margin-top: 25px;
    padding-top: 21px;
    border-top: 1px solid #e9edf3;
}

.psw-weekly-past-games-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}

.psw-weekly-past-games-heading h3 {
    margin: 4px 0 0;
    color: #172033;
    font-size: 18px;
    font-weight: 850;
}

.psw-weekly-past-games-heading > span {
    color: #778398;
    font-size: 11px;
    font-weight: 700;
}

.psw-weekly-past-games-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.psw-weekly-past-game-button {
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 100%;
    padding: 9px 12px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #f8fafc;
    color: #263b56;
    text-decoration: none;
    transition: border-color .15s, background .15s, transform .15s;
}

.psw-weekly-past-game-button:hover {
    border-color: var(--cp-blue);
    background: #eef6ff;
    color: var(--cp-blue-dark);
    transform: translateY(-1px);
}

.psw-weekly-past-game-button span {
    flex: none;
    color: var(--cp-blue);
    font-size: 10px;
    font-weight: 900;
}

.psw-weekly-past-game-button strong {
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psw-weekly-past-game-button i {
    flex: none;
    color: #8b98aa;
    font-size: 10px;
}

/* Hall of Fame */
.psw-weekly-hall-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin: 18px 0 4px;
}

.psw-weekly-hall-card {
    display: flex;
    align-items: stretch;
    gap: 13px;
    min-width: 0;
    padding: 17px 16px;
    border: 1px solid #e2e9f2;
    border-radius: 11px;
    background: linear-gradient(145deg, #fff 0%, #f8fbff 100%);
    box-shadow: 0 5px 16px rgba(19, 39, 71, .045);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.psw-weekly-hall-card:hover {
    border-color: #c9dced;
    box-shadow: 0 9px 22px rgba(19, 39, 71, .08);
    transform: translateY(-2px);
}

.psw-weekly-hall-card > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.psw-weekly-hall-card-content {
    width: 100%;
    min-width: 0;
}

.psw-weekly-hall-card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.psw-weekly-hall-card-heading > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    gap: 4px;
}

.psw-weekly-hall-icon {
    display: grid;
    place-items: center;
    flex: 0 0 43px;
    width: 43px;
    height: 43px;
    border-radius: 10px;
    background: #eaf4ff;
    color: var(--cp-blue);
    font-size: 17px;
}

.psw-weekly-hall-card:nth-child(2) .psw-weekly-hall-icon {
    background: #fff3e5;
    color: #e17b19;
}

.psw-weekly-hall-card:nth-child(3) .psw-weekly-hall-icon {
    background: #eef8f2;
    color: #258653;
}

.psw-weekly-hall-caption {
    color: #718097;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1.35;
}

.psw-weekly-hall-card strong {
    overflow: hidden;
    color: #172033;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.3;
    text-overflow: ellipsis;
}

.psw-weekly-hall-card-heading strong {
    display: block;
}

.psw-weekly-hall-card small {
    color: #68778d;
    font-size: 10px;
    line-height: 1.45;
}

.psw-weekly-hall .psw-weekly-rank-number {
    background: #fff3df;
    color: #a66b19;
}

.psw-weekly-hall-ranking {
    margin: 0;
    padding: 0;
    list-style: none;
}

.psw-weekly-hall-ranking li {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 9px 0;
    border-top: 1px solid #edf0f4;
}

.psw-weekly-hall-ranking .psw-weekly-rank-number {
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    font-size: 12px;
}

.psw-weekly-hall-ranking .psw-weekly-rank-number.is-medal {
    background: transparent;
    font-size: 21px;
}

.psw-weekly-hall-ranking .psw-weekly-player {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psw-weekly-hall-ranking li > strong {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 10px;
    white-space: nowrap;
}

.psw-weekly-hall-empty {
    color: #8793a4;
    font-size: 11px;
}

/* Règles officielles */
.psw-weekly-rules {
    margin-top: 24px;
    padding: 22px 24px;
    border: 1px solid #e5e9ef;
    border-radius: 12px;
    background: linear-gradient(120deg, #0b1730, #123c70);
    color: #fff;
}

.psw-weekly-rules-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 17px;
}

.psw-weekly-rules-heading i {
    color: #8b98aa;
    font-size: 17px;
}

.psw-weekly-rules-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 850;
}

.psw-weekly-rules-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 28px;
}

.psw-weekly-rules-content strong {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 850;
}

.psw-weekly-rules-content p,
.psw-weekly-rules-content li {
    font-size: 11px;
    line-height: 1.65;
}

.psw-weekly-rules-content p {
    margin: 0;
}

.psw-weekly-rules-content ul {
    margin: 0;
    padding-left: 17px;
}

.psw-weekly-rules-content b {
    color: orange;
}

.psw-weekly-rules-footer {
    margin: 18px 0 0;
    padding-top: 13px;
    border-top: 1px solid var(--paper);
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}

/* Adaptations responsive */
@media (max-width: 850px) {
    .psw-weekly-hall-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .psw-weekly-page {
        padding-top: 20px;
    }

    .psw-weekly-game-card,
    .psw-weekly-leaderboard,
    .psw-weekly-empty,
    .psw-weekly-annual {
        padding: 17px;
    }

    .psw-weekly-score-rules {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .psw-weekly-answer-row {
        flex-direction: column;
    }

    .psw-weekly-clue {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .psw-weekly-ranking li {
        gap: 8px;
    }

    .psw-weekly-ranking-detail {
        display: none;
    }

    .psw-weekly-rules {
        padding: 17px;
    }

    .psw-weekly-rules-content {
        grid-template-columns: 1fr;
        gap: 13px;
    }
}

@media (max-width: 600px) {
    .psw-weekly-past-game-button {
        flex: 1 1 100%;
    }

    .psw-weekly-past-game-button strong {
        white-space: normal;
    }
}

@media (max-width: 560px) {
    .psw-weekly-hall-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .psw-weekly-hall-card {
        padding: 14px;
    }

    .psw-weekly-hall-icon {
        flex-basis: 39px;
        width: 39px;
        height: 39px;
    }
}
