.secofi-jeu {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto;
    font-family: Arial, Helvetica, sans-serif;
    color: #333;
}

.secofi-jeu * { box-sizing: border-box; }

.secofi-jeu__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.secofi-jeu__eyebrow {
    color: #e61922;
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 13px;
}

.secofi-jeu h2,
.secofi-jeu h3,
.secofi-jeu p { margin-top: 0; }

.secofi-jeu__header h2 {
    margin-bottom: 5px;
    font-size: 30px;
    line-height: 1.1;
}

.secofi-jeu__header p {
    margin-bottom: 0;
    color: #666;
}

.secofi-jeu__controls-help {
    font-size: 13px;
    color: #777;
    white-space: nowrap;
}

.secofi-jeu__controls-help span {
    display: inline-block;
    padding: 4px 7px;
    border: 1px solid #ddd;
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #fff;
    color: #333;
    font-weight: 700;
}

.secofi-jeu__canvas-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: #f4f8fb;
    box-shadow: 0 10px 35px rgba(0,0,0,.12);
    touch-action: manipulation;
}

#secofi-jeu-canvas {
    display: block;
    width: 100%;
    height: 520px;
    cursor: pointer;
    touch-action: manipulation;
}

.secofi-jeu__hud {
    position: absolute;
    z-index: 5;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.secofi-jeu__hud > div {
    min-width: 125px;
    padding: 8px 13px;
    border-radius: 10px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 3px 12px rgba(0,0,0,.08);
}

.secofi-jeu__hud small {
    display: block;
    margin-bottom: 2px;
    color: #777;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .8px;
}

.secofi-jeu__hud strong {
    display: block;
    font-size: 19px;
    line-height: 1.1;
}

.secofi-jeu__start,
.secofi-jeu__gameover {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: rgba(12, 30, 44, .35);
}

.secofi-jeu__gameover[hidden] { display: none; }

.secofi-jeu__panel {
    width: min(520px, 100%);
    padding: 30px;
    text-align: center;
    border-radius: 18px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 15px 45px rgba(0,0,0,.2);
}

.secofi-jeu__panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #e61922;
    color: #fff;
    font-size: 25px;
    font-weight: 800;
}

.secofi-jeu__panel h3 {
    margin-bottom: 8px;
    font-size: 25px;
}

.secofi-jeu__panel p {
    color: #666;
    line-height: 1.5;
}

.secofi-jeu__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 0 24px;
    border: 0;
    border-radius: 8px;
    background: #e61922;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.secofi-jeu__button:hover {
    background: #c9141c;
    transform: translateY(-1px);
}

.secofi-jeu__button--small {
    min-height: 42px;
    padding: 0 15px;
    white-space: nowrap;
}

.secofi-jeu__final-label {
    margin-bottom: 0 !important;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.secofi-jeu__final-score {
    margin: 3px 0 5px;
    color: #e61922;
    font-size: clamp(38px, 7vw, 58px);
    line-height: 1;
    font-weight: 900;
}

.secofi-jeu__score-form {
    margin: 20px auto 12px;
    text-align: left;
}

.secofi-jeu__score-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}

.secofi-jeu__score-line {
    display: flex;
    gap: 8px;
}

.secofi-jeu__score-line input {
    min-width: 0;
    flex: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d7dce0;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
}

.secofi-jeu__form-message {
    min-height: 20px;
    margin-top: 5px;
    font-size: 12px;
    color: #4d6b58;
}

.secofi-jeu__restart {
    padding: 0;
    border: 0;
    background: transparent;
    color: #666;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.secofi-jeu__restart:hover { color: #e61922; }

.secofi-jeu__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    padding: 13px 10px;
    color: #666;
    font-size: 12px;
}

.legend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    margin-right: 4px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 900;
}

.legend--money { background: #ffd34d; color: #8a6100; }
.legend--client { background: #4d9de0; color: #fff; }
.legend--advice { background: #4caf78; color: #fff; }
.legend--invoice { background: #e94b55; color: #fff; }
.legend--unexpected { background: #8d5b3c; color: #fff; }
.legend--unpaid { background: #7b2430; color: #fff; }

.secofi-jeu__leaderboard {
    margin-top: 8px;
    padding: 22px;
    border: 1px solid #e5e8eb;
    border-radius: 14px;
    background: #fff;
}

.secofi-jeu__leaderboard h3 {
    margin-bottom: 14px;
    font-size: 20px;
}

.secofi-jeu__loading,
.secofi-jeu__empty {
    color: #888;
    font-size: 14px;
}

.secofi-jeu__ranking {
    display: grid;
    gap: 6px;
}

.secofi-jeu__rank {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    background: #f7f8f9;
}

.secofi-jeu__rank:nth-child(1) { background: #fff6d9; }
.secofi-jeu__rank:nth-child(2) { background: #f3f5f7; }

.secofi-jeu__rank-number {
    font-weight: 900;
    text-align: center;
}

.secofi-jeu__rank-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.secofi-jeu__rank-score {
    font-weight: 900;
    color: #e61922;
}

@media (max-width: 700px) {
    .secofi-jeu { margin: 20px auto; }

    .secofi-jeu__header {
        display: block;
    }

    .secofi-jeu__header h2 { font-size: 25px; }

    .secofi-jeu__controls-help {
        margin-top: 10px;
        white-space: normal;
    }

    #secofi-jeu-canvas { height: 430px; }

    .secofi-jeu__hud {
        top: 9px;
        left: 9px;
        right: 9px;
        gap: 6px;
    }

    .secofi-jeu__hud > div {
        min-width: 0;
        flex: 1;
        padding: 7px 6px;
    }

    .secofi-jeu__hud strong { font-size: 15px; }

    .secofi-jeu__panel { padding: 22px 18px; }

    .secofi-jeu__score-line { display: grid; }

    .secofi-jeu__score-line input,
    .secofi-jeu__button--small { width: 100%; }

    .secofi-jeu__legend { gap: 8px 12px; }
}
