/* flappy.css — celikezor flappy bird oyunu stilleri */

/* ── Layout wrapper ── */
.flappy-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
    position: relative;
    gap: 1.25rem;
}

/* ── Card ── */
.flappy-card {
    background: rgba(10, 15, 25, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Score row ── */
.flappy-score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.flappy-brand {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: 2px;
    user-select: none;
}

.flappy-scores {
    display: flex;
    gap: 0.75rem;
}

.flappy-score-box {
    background: rgba(19, 34, 56, 0.35);
    border: 1px solid var(--surface-border);
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
    text-align: center;
    min-width: 85px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.flappy-score-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.12rem;
}

.flappy-score-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

/* ── Canvas wrapper — 9:16 aspect ratio ── */
.flappy-game-wrapper {
    position: relative;
    width: 100%;
    max-width: calc(70vh * 9 / 16);
    aspect-ratio: 9 / 16;
    max-height: 70vh;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
    margin: 0 auto;
}

.flappy-game-wrapper canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Bottom section ── */
.flappy-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.flappy-instructions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    width: 100%;
}

.flappy-inst-text {
    font-weight: 500;
}

.flappy-keybinds {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.flappy-keybind-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.flappy-keys {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.flappy-key-or {
    font-size: 0.75rem;
}

.flappy-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(19, 34, 56, 0.6);
    border: 1px solid rgba(0, 210, 255, 0.4);
    box-shadow: 0 2px 0 0 rgba(0, 210, 255, 0.2), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    min-width: 26px;
    height: 26px;
    box-sizing: border-box;
    text-transform: uppercase;
}

.flappy-key.space {
    min-width: 70px;
    font-size: 0.75rem;
}

.flappy-key i {
    font-size: 0.75rem;
}

.flappy-controls {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.flappy-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    user-select: none;
    min-height: 44px;
}

.flappy-btn:hover {
    background: rgba(0, 210, 255, 0.10);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.flappy-btn:active {
    transform: scale(0.97);
}

.flappy-btn i {
    font-size: 0.88rem;
}

/* ── Mobile Touch Controls ── */
.flappy-touch-controls {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.5rem;
}

@media (pointer: coarse), (max-width: 768px) {
    .flappy-touch-controls {
        display: flex;
    }
}

.flappy-touch-btn {
    pointer-events: auto;
    width: 100%;
    height: 52px;
    border-radius: 8px;
    background: rgba(19, 34, 56, 0.65);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    box-shadow: 0 3px 0 0 rgba(0, 210, 255, 0.3), 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: background 0.1s, transform 0.1s, box-shadow 0.1s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.flappy-touch-btn:active {
    background: rgba(0, 210, 255, 0.3);
    transform: translateY(2px);
    box-shadow: 0 1px 0 0 rgba(0, 210, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Fullscreen ── */
.flappy-layout:fullscreen,
.flappy-layout:-webkit-full-screen {
    background: radial-gradient(ellipse at center, #0d1928 0%, #050810 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.flappy-layout.fullscreen-active {
    background: radial-gradient(ellipse at center, #0d1928 0%, #050810 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}

/* Card in fullscreen: maintain 9:16 aspect ratio constraint */
.flappy-layout:fullscreen .flappy-card,
.flappy-layout:-webkit-full-screen .flappy-card,
.flappy-layout.fullscreen-active .flappy-card {
    /* height subtraction accommodates score-row + controls + touch-controls + margins */
    width: min(94vw, calc((100vh - 230px) * 9 / 16)) !important;
    max-width: none !important;
    background: rgba(8, 14, 24, 0.90) !important;
    border: 1px solid var(--surface-border) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7) !important;
    padding: 1.25rem !important;
}

/* Fullscreen mode optimizations: hide instructions and reset button, show touch jump button */
.fullscreen-active .flappy-instructions,
.flappy-layout:fullscreen .flappy-instructions,
.fullscreen-active #restartBtn,
.flappy-layout:fullscreen #restartBtn {
    display: none !important;
}

@media (pointer: coarse), (max-width: 768px) {
    .fullscreen-active .flappy-touch-controls,
    .flappy-layout:fullscreen .flappy-touch-controls {
        display: flex !important;
    }
}

/* Mobile Scale Adjustments */
@media (max-width: 480px) {
    .flappy-layout {
        padding: 1rem 0.5rem;
    }

    .flappy-card {
        padding: 1rem;
    }

    .flappy-touch-btn {
        height: 48px;
        font-size: 0.95rem;
    }
}

/* Mobile Touch Standardizations */
canvas, .flappy-layout, .flappy-card {
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .flappy-layout {
        padding: 1.25rem 0.5rem;
    }

    .flappy-card {
        padding: 1.1rem;
        gap: 0.9rem;
    }

    .flappy-brand {
        font-size: 1.5rem;
    }

    .flappy-score-box {
        padding: 0.35rem 0.65rem;
        min-width: 70px;
    }

    .flappy-score-val {
        font-size: 1.05rem;
    }

    .flappy-btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.82rem;
    }

    .flappy-touch-btn {
        height: 44px;
        font-size: 0.95rem;
    }
}