/* SynchroQuant - Mobile Blind Chart Quant Challenge CSS */

:root {
    --bg-primary: #07090e;
    --bg-card: rgba(18, 24, 38, 0.85);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.4);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.4);
    --accent-orange: #f59e0b;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden;
    position: fixed;
}

/* Background Ambient Glow */
.bg-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.1) 0%, rgba(79, 172, 254, 0.02) 70%, transparent 100%);
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

/* Game App Container */
.game-container {
    width: 100%;
    max-width: 480px;
    height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background: radial-gradient(circle at 50% 0%, #111827 0%, #07090e 100%);
}

/* HEADER HUD */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bg-card-border);
    backdrop-filter: blur(12px);
    background: rgba(10, 15, 26, 0.7);
    flex-shrink: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: var(--font-display);
    font-size: 14px;
    color: #000;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.brand-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fbbf24;
    font-family: var(--font-display);
}

.header-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--bg-card-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* TOP STATUS BAR */
.status-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(18, 24, 38, 0.4);
    border-bottom: 1px solid var(--bg-card-border);
    flex-shrink: 0;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.status-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-val {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.status-val.positive { color: var(--accent-green); }
.status-val.negative { color: var(--accent-red); }

/* CHART STAGE */
.chart-stage {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chart-header-info {
    position: absolute;
    top: 10px;
    left: 14px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.mystery-tag {
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid rgba(0, 242, 254, 0.4);
    color: var(--accent-cyan);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-display);
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.timeframe-tag {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

#gameChartContainer {
    width: 100%;
    height: 100%;
    flex: 1;
}

/* SHARP VERTICAL DECISION LINE (길게 그려진 기준시점 라인) */
.decision-vertical-line {
    position: absolute;
    top: 0;
    bottom: 44px;
    width: 2px;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.8), 0 0 20px rgba(0, 242, 254, 0.4);
    z-index: 20;
    pointer-events: none;
    display: none;
}

.decision-line-badge {
    position: absolute;
    top: 36px;
    left: 50%;
    transform: translateX(-50%);
    background: #00f2fe;
    color: #050b14;
    font-size: 10px;
    font-weight: 800;
    font-family: var(--font-display);
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 242, 254, 0.6);
    letter-spacing: -0.2px;
}

/* SHARP MASK CURTAIN (블러 없이 딱 나뉜 선명한 가림막) */
.sharp-mask-curtain {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 44px;
    background: #07090e;
    border-left: 2px solid var(--accent-cyan);
    z-index: 18;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.8);
}

.sharp-mask-curtain.revealed {
    transform: translateX(100%);
    opacity: 0;
}

.mask-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding: 0 12px;
}

.mask-question-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 242, 254, 0.1);
    border: 2px dashed rgba(0, 242, 254, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font-display);
    animation: pulseIcon 1.8s infinite ease-in-out;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; border-color: #00f2fe; }
}

.mask-prompt {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* FLOATING TOUCH BUTTONS OVER RIGHT SIDE OF CHART */
.chart-action-layer {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: calc(100% - 44px);
    pointer-events: none;
    z-index: 25;
}

.floating-btn {
    position: absolute;
    right: 14px;
    width: 116px;
    padding: 12px 10px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    cursor: pointer;
    pointer-events: auto;
    font-family: var(--font-display);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    transition: transform 0.1s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.15s ease, opacity 0.2s ease;
}

.floating-btn:active {
    transform: scale(0.92);
}

.floating-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* TOP-RIGHT BUY BUTTON */
.btn-buy {
    top: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.98) 100%);
    color: #ffffff;
    box-shadow: 0 6px 24px var(--accent-green-glow);
    border-color: rgba(16, 185, 129, 0.7);
}

.btn-buy:hover {
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.7);
}

/* BOTTOM-RIGHT SELL BUTTON */
.btn-sell {
    bottom: 20px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.98) 100%);
    color: #ffffff;
    box-shadow: 0 6px 24px var(--accent-red-glow);
    border-color: rgba(239, 68, 68, 0.7);
}

.btn-sell:hover {
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.7);
}

.f-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.f-btn-icon i {
    width: 18px;
    height: 18px;
}

.f-btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.f-title {
    font-size: 16px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.f-sub {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.85;
}

/* 5-SECOND DECISION TIMER GAUGE BAR */
.timer-gauge-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 44px;
    background: rgba(10, 15, 26, 0.95);
    border-top: 1px solid var(--bg-card-border);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 16px;
    gap: 4px;
    z-index: 25;
}

.timer-gauge-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-gauge-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.timer-gauge-num {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-cyan);
}

.timer-gauge-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.timer-gauge-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
    transition: width 0.05s linear;
}

/* RESULT & QUANT INSIGHT BOTTOM SHEET */
.result-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px 24px 0 0;
    padding: 20px;
    backdrop-filter: blur(24px);
    z-index: 35;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-sheet.active {
    transform: translateY(0);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-title-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
}

.result-title-badge.win {
    color: var(--accent-green);
}

.result-title-badge.loss {
    color: var(--accent-red);
}

.result-title-badge.pass {
    color: var(--text-secondary);
}

.result-pnl {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
}

.result-pnl.positive { color: var(--accent-green); }
.result-pnl.negative { color: var(--accent-red); }
.result-pnl.neutral { color: var(--text-secondary); }

/* AI VS HUMAN DUEL BOX */
.ai-duel-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--bg-card-border);
    border-radius: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.duel-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.duel-col:last-child {
    border-left: 1px solid var(--bg-card-border);
    padding-left: 10px;
}

.duel-role {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.duel-choice {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* QUANT LESSON BOX */
.quant-lesson-card {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.08) 0%, rgba(79, 172, 254, 0.04) 100%);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lesson-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: var(--font-display);
}

.lesson-desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: #e2e8f0;
}

.lesson-desc strong {
    color: #38bdf8;
}

/* NEXT ROUND / SHARE BUTTON */
.result-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-top: 4px;
}

.btn-share {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--bg-card-border);
    color: var(--text-primary);
    border-radius: 14px;
    padding: 14px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.btn-next-round {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    color: #050b14;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-weight: 800;
    font-family: var(--font-display);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 242, 254, 0.35);
}

.btn-next-round:active {
    transform: scale(0.97);
}

/* SHARE BRAG MODAL */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-card {
    background: #0f172a;
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: 24px;
    width: 100%;
    max-width: 360px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 242, 254, 0.2);
    position: relative;
}

.share-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.share-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.share-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.share-stat-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.share-stat-label { font-size: 11px; color: var(--text-muted); }
.share-stat-val { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: #fff; }

.btn-copy-share {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

/* SCREEN SHAKE & FLASH EFFECTS */
@keyframes flashGreen {
    0% { background: rgba(16, 185, 129, 0.4); }
    100% { background: transparent; }
}

@keyframes flashRed {
    0% { background: rgba(239, 68, 68, 0.4); }
    100% { background: transparent; }
}

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

.flash-win {
    animation: flashGreen 0.6s ease-out;
}

.flash-loss {
    animation: flashRed 0.6s ease-out, screenShake 0.4s ease-in-out;
}
