/* ── Post-game screen styles ── */

.postgame-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px;
    max-width: 540px;
    margin: 32px auto;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    text-align: center;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ── Score counter ── */
.postgame-score {
    font-size: 3.2em;
    font-weight: 800;
    color: #1F2933;
    margin: 8px 0 4px;
    font-variant-numeric: tabular-nums;
}

.postgame-score-label {
    font-size: .85em;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6B7280;
    margin-bottom: 12px;
}

/* ── Personal best banner ── */
.personal-best-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
    color: #1F2933;
    font-weight: 700;
    font-size: 1em;
    padding: 8px 20px;
    border-radius: 24px;
    margin: 10px auto 14px;
    animation: pb-pop .45s cubic-bezier(.34,1.56,.64,1);
}

@keyframes pb-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Percentile badge ── */
.percentile-badge {
    display: inline-block;
    background: #2563EB;
    color: #fff;
    font-weight: 600;
    font-size: .88em;
    padding: 5px 16px;
    border-radius: 20px;
    margin: 6px 0 10px;
}

/* ── Rank nudge ── */
.rank-nudge {
    font-size: .84em;
    color: #6B7280;
    margin: 4px 0 14px;
}
.rank-nudge strong {
    color: #1F2933;
}

/* ── Breakdown section ── */
.postgame-breakdown {
    text-align: left;
    margin: 16px 0;
    border-top: 1px solid #E5E7EB;
    padding-top: 14px;
}

/* ── Action buttons ── */
.postgame-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.postgame-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1em;
    border: none;
    cursor: pointer;
    transition: background-color .2s ease, transform .05s ease;
    font-family: inherit;
}
.postgame-btn:hover {
    transform: translateY(-1px);
}

.postgame-btn-primary {
    background: #2563EB;
    color: #fff;
    font-size: 1.2em;
    padding: 14px 42px;
}
.postgame-btn-primary:hover {
    background: #1D4ED8;
}

.postgame-btn-secondary {
    background: #E5E7EB;
    color: #1F2933;
}
.postgame-btn-secondary:hover {
    background: #D1D5DB;
}

.postgame-btn-share {
    background: transparent;
    color: #2563EB;
    border: 1.5px solid #2563EB;
}
.postgame-btn-share:hover {
    background: #EFF6FF;
}

/* ── Recommendation chip ── */
.postgame-recommendation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 16px;
    background: #F3F4F6;
    border-radius: 8px;
    font-size: .85em;
    color: #374151;
}
.postgame-recommendation a {
    color: #2563EB;
    text-decoration: none;
    font-weight: 600;
}
.postgame-recommendation a:hover {
    text-decoration: underline;
}

/* ── Confetti canvas ── */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ── Combo counter ── */
.combo-counter {
    position: fixed;
    top: 12px;
    right: 16px;
    font-size: 1.5em;
    font-weight: 800;
    color: #F59E0B;
    z-index: 100;
    pointer-events: none;
    animation: combo-pulse .3s ease-out;
}

@keyframes combo-pulse {
    0%   { transform: scale(1.4); opacity: .7; }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Floating points ── */
.floating-points {
    position: absolute;
    font-weight: 700;
    font-size: 1.3em;
    color: #10B981;
    pointer-events: none;
    animation: float-up 1.1s ease-out forwards;
    z-index: 100;
}

@keyframes float-up {
    0%   { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-60px); }
}

/* ── Screen shake ── */
.screen-shake {
    animation: screen-shake .35s ease;
}

@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    15%      { transform: translateX(-4px); }
    30%      { transform: translateX(4px); }
    45%      { transform: translateX(-3px); }
    60%      { transform: translateX(3px); }
    75%      { transform: translateX(-1px); }
}

/* ── Goal achieved toast (Phase 4 hook) ── */
.postgame-goal-toast {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: #fff;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    margin: 10px auto;
    max-width: 400px;
    animation: pb-pop .45s cubic-bezier(.34,1.56,.64,1);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .postgame-card {
        margin: 16px 10px;
        padding: 20px 14px;
    }
    .postgame-score {
        font-size: 2.4em;
    }
    .postgame-btn-primary {
        width: 100%;
        font-size: 1.1em;
    }
    .postgame-actions {
        flex-direction: column;
    }
}

@media (max-width: 360px) {
    .postgame-card {
        margin: 10px 6px;
        padding: 16px 10px;
    }
    .postgame-score {
        font-size: 2em;
    }
}
