/* =============================================
   체내시계 테스트 게임 스타일
   테마: 미니멀/다크 + 골드/앰버
   ============================================= */

html { background: #000; }

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

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

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

.tt-best {
    background: rgba(245, 158, 11, 0.1);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.tt-challenge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 16px;
    color: #F59E0B;
    text-align: center;
}
.tt-challenge strong { font-size: 22px; }

.tt-rounds-preview {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.tt-round-chip {
    padding: 8px 18px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: #F59E0B;
}

.tt-btn-start {
    display: inline-block;
    padding: 16px 48px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #1a1a2e;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.tt-btn-start:active { transform: scale(0.95); }

/* Ready */
.state-ready { background: #0f0f1a; }

.tt-ready-target {
    font-size: 80px;
    font-weight: 900;
    color: #F59E0B;
    text-shadow: 0 0 40px rgba(245, 158, 11, 0.4);
    margin-bottom: 8px;
}
.tt-ready-text {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}
.tt-ready-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 24px;
}
.tt-btn-go {
    padding: 16px 48px;
    background: rgba(245, 158, 11, 0.15);
    border: 2px solid rgba(245, 158, 11, 0.4);
    border-radius: 14px;
    color: #F59E0B;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.tt-btn-go:active { transform: scale(0.95); }

/* Counting */
.state-counting { background: #0a0a14; }

.tt-counting-target {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 12px;
}
.tt-counting-clock {
    font-size: 80px;
    animation: ttPulse 0.65s ease infinite;
    margin-bottom: 12px;
}

@keyframes ttPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.tt-counting-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 32px;
}

.tt-btn-stop {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    border: 4px solid rgba(239, 68, 68, 0.4);
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
    letter-spacing: 2px;
}
.tt-btn-stop:active {
    transform: scale(0.92);
}

/* Round Result */
.state-roundresult { background: #0f0f1a; }

.tt-round-result-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}
.tt-round-result-time {
    font-size: 56px;
    font-weight: 900;
    margin-bottom: 4px;
}
.tt-round-result-target {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
}
.tt-round-result-diff {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.tt-round-dots {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.tt-round-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}
.tt-round-dot-pending {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
}

.tt-btn-next {
    padding: 16px 48px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #1a1a2e;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.tt-btn-next:active { transform: scale(0.95); }

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

/* Round details (게임 고유) */
.tt-round-details {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 360px;
}
.tt-round-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 10px 8px;
}
.tt-rd-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}
.tt-rd-result {
    font-size: 16px;
    font-weight: 700;
}
.tt-rd-error {
    font-size: 11px;
    font-weight: 600;
}

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