/* =============================================
   색감 테스트 게임 스타일
   ============================================= */

html { background: #000; }

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

/* Top Bar */
.ct-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.ct-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);
}
.ct-back:hover { color: #fff; }
.ct-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 */
.ct-timer-wrap {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.ct-timer-bar {
    height: 100%;
    width: 100%;
    border-radius: 0 3px 3px 0;
    transition: width 0.1s linear, background 0.3s;
}

/* Content */
.ct-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: #0f0f23; }
.state-intro .ct-content {
    justify-content: flex-start;
    padding-top: 40px;
}

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

.ct-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);
}

.ct-challenge {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 16px;
    color: #ffd700;
    text-align: center;
}
.ct-challenge strong { font-size: 22px; }

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

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

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

.ct-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);
}
.ct-score-bar strong {
    color: #fff;
    font-weight: 700;
}

.ct-grid {
    display: grid;
    gap: 4px;
    margin: 0 auto;
    width: 100%;
}
.ct-tile {
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.08s;
    width: 100%;
    aspect-ratio: 1 / 1;
}
.ct-tile:active {
    transform: scale(0.93);
}
.ct-tile-answer {
    box-shadow: 0 0 0 3px #fff, 0 0 12px rgba(255, 255, 255, 0.5);
    opacity: 1 !important;
    z-index: 1;
    position: relative;
}

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

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

/* Game Over */
.state-gameover { background: #0f0f23; }
.ct-gameover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.25);
    animation: ctFadeIn 0.3s ease;
}
.ct-gameover-msg {
    font-size: 32px;
    font-weight: 800;
    color: #EF4444;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

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

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

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