/* === KEEBLE FLAPPY === */
#kf-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: center;
    align-items: flex-start;
    font-family: 'Segoe UI', Arial, sans-serif;
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

/* ---- CANVAS ZONE ---- */
#kf-game-area {
    position: relative;
    flex: 1 1 500px;
    max-width: 680px;
    height: 680px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(232, 57, 26, 0.35), 0 2px 12px rgba(0,0,0,0.4);
}

#kf-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---- SCREENS ---- */
.kf-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(15, 15, 35, 0.88);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 30px 24px;
    text-align: center;
    z-index: 10;
}

.kf-screen h2 {
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    color: #fff;
}

.kf-screen p {
    font-size: 0.95rem;
    color: #bbb;
    margin: 0;
}

.kf-logo {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: #E8391A;
    text-transform: uppercase;
    border: 2px solid #E8391A;
    padding: 4px 14px;
    border-radius: 4px;
}

.kf-bird-icon {
    font-size: 3rem;
    animation: kf-bounce 0.9s ease-in-out infinite alternate;
}
@keyframes kf-bounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-10px); }
}

/* ---- SCORE DISPLAY (game over) ---- */
.kf-score-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px 20px;
    width: 220px;
    font-size: 0.9rem;
    color: #aaa;
}

.kf-score-display strong {
    font-size: 1.6rem;
    font-weight: 800;
    color: #E8391A;
}

/* ---- INPUT ---- */
#kf-save-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

#kf-player-name {
    width: 220px;
    padding: 11px 14px;
    border-radius: 8px;
    border: 2px solid rgba(232,57,26,0.5);
    background: rgba(255,255,255,0.07);
    color: #fff;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
#kf-player-name::placeholder { color: #666; }
#kf-player-name:focus { border-color: #E8391A; }

/* ---- SAVE ERROR ---- */
#kf-save-error {
    color: #ff6b6b;
    font-size: 0.82rem;
    min-height: 16px;
}

/* ---- PROFILE BADGE ---- */
#kf-profile-badge,
#kf-profile-badge-start {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(232, 57, 26, 0.12);
    border: 1.5px solid rgba(232, 57, 26, 0.4);
    border-radius: 30px;
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.kf-profile-avatar {
    font-size: 1.3rem;
}

.kf-profile-name,
.kf-profile-name-start {
    color: #E8391A;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ---- BUTTONS ---- */
.kf-btn {
    background: #E8391A;
    color: #fff;
    border: none;
    padding: 13px 36px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 220px;
}
.kf-btn:hover  { background: #c42e14; }
.kf-btn:active { transform: scale(0.97); }
.kf-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.kf-btn-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.25);
    color: #ccc;
}
.kf-btn-outline:hover { background: rgba(255,255,255,0.06); color: #fff; border-color: #fff; }

/* ---- TAP HINT ---- */
#kf-tap-hint {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    padding: 5px 14px;
    border-radius: 20px;
    pointer-events: none;
    display: none;
}

/* ---- LEADERBOARD ---- */
#kf-leaderboard {
    flex: 0 0 300px;
    width: 300px;
    background: #111827;
    border-radius: 14px;
    padding: 20px 18px 22px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

#kf-leaderboard h3 {
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #E8391A;
    padding-bottom: 10px;
}

#kf-leaderboard table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    color: #ccc;
}

#kf-leaderboard thead th {
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 6px 8px;
    text-align: left;
}
#kf-leaderboard thead th:last-child { text-align: right; }

#kf-leaderboard tbody tr {
    border-top: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}
#kf-leaderboard tbody tr:hover { background: rgba(255,255,255,0.04); }

#kf-leaderboard tbody td {
    padding: 9px 6px;
    vertical-align: middle;
}
#kf-leaderboard tbody td:first-child { width: 32px; font-size: 1rem; }
#kf-leaderboard tbody td:last-child  { text-align: right; font-weight: 700; color: #E8391A; }

/* ---- RESPONSIVE ---- */
@media (max-width: 700px) {
    #kf-game-area {
        flex: 1 1 100%;
        max-width: 100%;
        height: 520px;
    }
    #kf-canvas { height: 520px; }

    #kf-leaderboard { flex: 1 1 100%; width: 100%; }
}
