/* =============================================
   순간기억력 테스트 게임 스타일
   테마: 사이버/두뇌과학 (보라+시안)
   ============================================= */

html { background: #000; }

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

/* Top Bar */
.mt-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.mt-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);
}
.mt-back:hover { color: #fff; }
.mt-level-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);
}

/* Timer */
.mt-timer-wrap {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.mt-timer-bar {
    height: 100%;
    width: 100%;
    border-radius: 0 3px 3px 0;
    transition: width 0.05s linear, background 0.3s;
}

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

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

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

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

.mt-best {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.mt-challenge {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 16px;
    color: #06B6D4;
    text-align: center;
}
.mt-challenge strong { font-size: 22px; }

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

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

/* Flash — 숫자 표시 */
.state-flash { background: #0a0a1a; }

.mt-score-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 360px;
    margin-bottom: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}
.mt-score-bar strong {
    color: #fff;
    font-weight: 700;
}

.mt-flash-number {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: 8px;
    color: #8B5CF6;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
    animation: mtFlashPulse 0.5s ease;
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
}

@keyframes mtFlashPulse {
    0% { transform: scale(0.6); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.mt-flash-hint {
    font-size: 16px;
    color: rgba(139, 92, 246, 0.7);
    animation: mtBlink 0.8s ease infinite;
}

@keyframes mtBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Input — 입력 */
.state-input { background: #0a0a1a; }

.mt-input-display {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 6px;
    margin-bottom: 8px;
    min-height: 56px;
    font-variant-numeric: tabular-nums;
}

.mt-digit-filled { color: #06B6D4; }
.mt-digit-cursor {
    color: #8B5CF6;
    animation: mtCursor 0.6s ease infinite;
}
.mt-digit-empty { color: rgba(255, 255, 255, 0.15); }

@keyframes mtCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.mt-digit-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
}

/* Keypad */
.mt-keypad {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    gap: 8px;
    margin: 0 auto;
}
.mt-key {
    width: 80px;
    height: 56px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.1);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.mt-key:active {
    transform: scale(0.92);
    background: rgba(139, 92, 246, 0.3);
}
.mt-key-del {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    font-size: 20px;
}
.mt-key-del:active { background: rgba(239, 68, 68, 0.3); }
.mt-key-ok {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.4);
    color: #06B6D4;
    font-size: 16px;
}
.mt-key-ok:active { background: rgba(6, 182, 212, 0.3); }

/* Correct flash */
.state-correct { background: #0a0a1a; }
.mt-correct-effect {
    font-size: 64px;
    animation: mtPop 0.3s ease;
}
.mt-correct-text {
    font-size: 24px;
    font-weight: 700;
    color: #34D399;
    margin-top: 8px;
}

@keyframes mtPop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Game Over */
.state-gameover { background: #0a0a1a; }
.mt-gameover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.2);
    animation: mtFadeIn 0.3s ease;
    text-align: center;
}
.mt-gameover-msg {
    font-size: 32px;
    font-weight: 800;
    color: #EF4444;
    margin-bottom: 12px;
}
.mt-gameover-answer {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}
.mt-gameover-answer strong { color: #34D399; font-size: 22px; letter-spacing: 4px; }
.mt-gameover-yours {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
}
.mt-gameover-yours strong { color: #EF4444; letter-spacing: 4px; }

@keyframes mtFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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