:root {
    --bg-color: #131722;
    --text-color: #d1d4dc;
    --accent-color: #2962ff;
    --up-color: #26a69a;
    --down-color: #ef5350;
    --border-color: #2a2e39;
    --legend-bg: rgba(19, 23, 34, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.stock-info {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.hts-legend {
    display: flex;
    gap: 20px;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    background-color: var(--legend-bg);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    gap: 8px;
}

.legend-label {
    color: #787b86;
}

.legend-value {
    font-weight: 600;
}

.legend-value.up {
    color: var(--up-color);
}

.legend-value.down {
    color: var(--down-color);
}

.legend-placeholder {
    color: #787b86;
    font-style: italic;
}

.chart-container {
    flex: 1;
    position: relative;
    width: 100%;
}

/* Phase 2 UI Styles */
.score-pill {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(19, 23, 34, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 24px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 16px;
    align-items: center;
    z-index: 100;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.score-divider { color: #444; }
.combo-text { color: #ff9800; }
.score-text { color: #4caf50; }
.progress-text { color: #9e9e9e; }

.quiz-sidebar {
    flex: 1;
    min-width: 250px;
    max-width: 320px;
    background: rgba(30, 34, 45, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    z-index: 10;
}

@media (max-width: 768px) {
    .main-content-wrapper {
        flex-direction: column !important;
    }
    .chart-container {
        flex: 2 !important;
    }
    .quiz-sidebar {
        flex: 1;
        max-width: none;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 15px;
        justify-content: flex-start;
    }
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: rgba(30, 34, 45, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 18px 20px;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.option-btn:hover:not(:disabled) {
    background: rgba(41, 98, 255, 0.2);
    border-color: rgba(41, 98, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(41, 98, 255, 0.2);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn.correct {
    background: rgba(38, 166, 154, 0.2) !important;
    border-color: var(--up-color) !important;
    box-shadow: 0 0 20px rgba(38, 166, 154, 0.4) !important;
    color: #fff;
    animation: pulseGlow 1.5s infinite;
}

.option-btn.incorrect {
    background: rgba(239, 83, 80, 0.2) !important;
    border-color: var(--down-color) !important;
    box-shadow: 0 0 20px rgba(239, 83, 80, 0.4) !important;
    color: #fff;
    animation: shake 0.4s ease-in-out;
}

/* 추가: 50:50 힌트로 지워진 보기 페이드 효과 */
.option-btn.disabled-hint {
    opacity: 0.2;
    pointer-events: none;
    background: transparent;
    border-color: transparent;
}

/* 힌트 버튼 스타일 */
.hint-btn {
    flex: 1;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #FFD700;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.hint-btn:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.hint-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #555;
    cursor: not-allowed;
    transform: none;
}

.next-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.3);
}

.next-btn:hover {
    background: #1e4bd8;
}

.result-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(19, 23, 34, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-card {
    background: #1e222d;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    min-width: 300px;
}

.result-card h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.result-stats p {
    font-size: 1.2rem;
    margin: 10px 0;
    color: var(--text-color);
}

.restart-btn {
    margin-top: 30px;
    background: var(--up-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.restart-btn:hover {
    background: #1d8278;
}

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

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(38, 166, 154, 0.2); }
    50% { box-shadow: 0 0 25px rgba(38, 166, 154, 0.6); }
    100% { box-shadow: 0 0 10px rgba(38, 166, 154, 0.2); }
}

.floating-score {
    position: absolute;
    color: #4caf50;
    font-weight: bold;
    font-size: 1.5rem;
    pointer-events: none;
    animation: floatUp 1s forwards ease-out;
    z-index: 100;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50px) scale(1.2); }
}

.press-any-key {
    margin-top: 20px;
    color: #787b86;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    animation: blinkText 1.5s infinite;
}

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

/* 리더보드 UI 스타일 */
.leaderboard-section {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
    max-height: none;
}

.leaderboard-section h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: #FFD700;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.leaderboard-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-section li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    font-size: 0.95rem;
}

.leaderboard-section li span.rank-name {
    flex: 1;
    color: #fff;
}

.leaderboard-section li span.rank-score {
    color: #4CAF50;
    font-weight: bold;
}
