/* =============================================
   플래피버드 게임 스타일
   테마: 다크 + 스카이 블루/그린
   ============================================= */

html { background: #0f0f23; }

.fb-body {
    overflow: hidden;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #f0f0f0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* Game Area */
.fb-game {
    width: 100%;
    height: 100dvh;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #0f0f23;
}

/* Top Bar */
.fb-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.fb-back {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.fb-back:hover { color: #fff; }
.fb-score-badge {
    font-size: 16px;
    font-weight: 700;
    color: #60A5FA;
    padding: 4px 16px;
    border-radius: 20px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

/* Content area */
.fb-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px;
    overflow-y: auto;
    position: relative;
}

/* Canvas Wrapper */
.fb-canvas-wrap {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    flex-shrink: 0;
}
.fb-canvas-wrap canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid #2d2d44;
}

/* ===== INTRO ===== */
.state-intro .fb-score-badge { display: none !important; }
.state-intro .fb-content {
    justify-content: center;
    padding-top: 0;
}

.fb-intro-emoji { font-size: 72px; margin-bottom: 16px; }
.fb-intro-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}
.fb-intro-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}
.fb-intro-desc strong { color: #60A5FA; }

.fb-best {
    background: rgba(96, 165, 250, 0.1);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.fb-challenge {
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 16px;
    color: #60A5FA;
    text-align: center;
}
.fb-challenge strong { font-size: 22px; }

.fb-rules {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.fb-rule-chip {
    padding: 8px 16px;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.fb-btn-start {
    display: inline-block;
    padding: 16px 48px;
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.fb-btn-start:active { transform: scale(0.95); }

/* ===== READY ===== */
.fb-ready-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
}
.fb-ready-text {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    animation: fbBounce 1s ease infinite;
}
@keyframes fbBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== COUNTDOWN ===== */
.state-countdown { background: #0f0f1a; }
.state-countdown .fb-score-badge { display: none !important; }
.state-countdown .fb-content {
    justify-content: center;
    padding: 0;
}
.fb-countdown-wrap { text-align: center; }
.fb-countdown-num {
    font-size: 120px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    animation: fbCountPop 0.5s ease-out;
}
.fb-countdown-num.fb-countdown-pop {
    animation: fbCountPop 0.5s ease-out;
}
.fb-countdown-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 16px;
}
@keyframes fbCountPop {
    0% { transform: scale(1.6); opacity: 0.3; }
    50% { transform: scale(0.95); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== PLAYING ===== */
.state-playing .fb-content {
    padding: 0;
    overflow: hidden;
}

/* ===== GAMEOVER overlay ===== */
.fb-gameover-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 15, 35, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    animation: fbFadeIn 0.3s ease;
}
@keyframes fbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fb-gameover-text {
    font-size: 32px;
    font-weight: 900;
    color: #EF4444;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.fb-gameover-score {
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
}

.fb-gameover-grade {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
}

.fb-btn-result {
    padding: 16px 48px;
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.fb-btn-result:active { transform: scale(0.95); }

/* ===== RESULT ===== */
.state-result .fb-content {
    justify-content: flex-start;
    padding-top: 24px;
}

/* Result — 공통 game-result.css 사용 */

/* Toast */
.fb-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.fb-toast-show {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .fb-canvas-wrap {
        max-width: calc(100vw - 32px);
    }
    .fb-intro-title { font-size: 24px; }
    .fb-intro-emoji { font-size: 56px; }
    .fb-gameover-score { font-size: 40px; }
}

@media (max-width: 360px) {
    .fb-canvas-wrap {
        max-width: calc(100vw - 24px);
    }
    .fb-top-bar { padding: 10px 12px; }
    .fb-content { padding: 12px 16px; }
}
