/* =============================================
   숫자 찾기 1-25 게임 스타일
   ============================================= */

html { background: #000; }

.nf-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 */
.nf-game {
    width: 100%;
    height: 100dvh;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Top Bar */
.nf-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.nf-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);
}
.nf-back:hover { color: #fff; }
.nf-info-badge {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
}

/* Content */
.nf-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    overflow-y: auto;
}

/* ===== States ===== */

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

/* Intro */
.state-intro { background: #0f1729; }
.state-intro .nf-content {
    justify-content: flex-start;
    padding-top: 40px;
}

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

.nf-best {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.nf-btn-start {
    display: inline-block;
    padding: 16px 48px;
    background: #f97316;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.nf-btn-start:active { transform: scale(0.95); }

/* Playing */
.state-playing { background: #0f1729; }
.state-playing .nf-content {
    justify-content: center;
}

.nf-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 360px;
    margin-bottom: 16px;
}
.nf-next-num {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
}
.nf-next-num strong {
    font-size: 24px;
    color: #f97316;
    font-weight: 900;
}
.nf-timer {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Grid */
.nf-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1 / 1;
}
.nf-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
    aspect-ratio: 1 / 1;
}
.nf-cell:active {
    transform: scale(0.93);
}
.nf-cell-done {
    background: rgba(34, 197, 94, 0.2);
    color: rgba(255, 255, 255, 0.2);
    cursor: default;
    pointer-events: none;
}
.nf-cell-wrong {
    animation: nfShake 0.3s ease;
    background: rgba(239, 68, 68, 0.3) !important;
}

@keyframes nfShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Result — 공통 game-result.css 사용 */
.state-result { background: #0f1729; }
.state-result .nf-content {
    justify-content: flex-start;
    padding-top: 32px;
}

/* Toast */
.nf-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;
    white-space: nowrap;
}
.nf-toast-show {
    opacity: 1;
    pointer-events: auto;
}
