/* =============================================
   방향감각 테스트 게임 스타일
   ============================================= */

html { background: #000; }
* { box-sizing: border-box; margin: 0; padding: 0; }

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

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

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

/* Intro */
.state-intro { background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); }
.state-intro .dt-content {
    justify-content: flex-start;
    padding-top: 40px;
}

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

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

.dt-stages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 24px;
}
.dt-stage-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}
.dt-stage-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 8px;
    flex-shrink: 0;
}

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

/* Playing */
.state-playing { background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); }
.state-playing .dt-content { justify-content: center; }

.dt-progress {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.dt-mode-label {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}
.dt-mode-normal {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}
.dt-mode-rotated {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}
.dt-mode-reverse {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    animation: dtReversePulse 0.8s ease-in-out infinite;
}
@keyframes dtReversePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.dt-timer-bar {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}
.dt-timer-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 2px;
    transition: width 0.1s linear;
}
.dt-timer-fill.dt-timer-warn { background: #ef4444; }

.dt-arrow-area {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
}

.dt-arrow {
    font-size: 80px;
    font-weight: 900;
    line-height: 1;
    transition: transform 0.15s;
}

.dt-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    width: 200px;
    height: 200px;
}

.dt-btn-dir {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.1s, background 0.1s;
}
.dt-btn-dir:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.2);
}
.dt-btn-dir-empty {
    background: none;
    border: none;
    cursor: default;
}

/* Feedback flash */
.dt-flash-correct {
    animation: dtFlashCorrect 0.3s ease-out;
}
@keyframes dtFlashCorrect {
    0% { background: rgba(34, 197, 94, 0.3); }
    100% { background: transparent; }
}
.dt-flash-wrong {
    animation: dtFlashWrong 0.3s ease-out;
}
@keyframes dtFlashWrong {
    0% { background: rgba(239, 68, 68, 0.3); }
    100% { background: transparent; }
}

/* Reverse mode BG */
.dt-game.dt-reverse-bg {
    background: linear-gradient(180deg, #2d0a0a 0%, #1e293b 100%) !important;
}

/* Result */
.state-result { background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); }
.state-result .dt-content {
    justify-content: flex-start;
    padding-top: 32px;
}

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