:root {
    --primary: #6366F1;
    --secondary: #94A3B8;
    --accent: #22D3EE;
    --bg: #0F172A;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(99, 102, 241, 0.3);
}

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

body {
    background-color: var(--bg);
    color: #f8fafc;
    font-family: 'Inter', system-ui, sans-serif;
    overflow: hidden;
    touch-action: none;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 800px) {
    #game-container {
        height: 90vh;
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid var(--glass-border);
        box-shadow: 0 0 40px rgba(0,0,0,0.5);
    }
}

#target-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.1s;
    padding: 20px;
    text-align: center;
}

/* States */
.state-idle { background-color: var(--primary); }
.state-wait { background-color: var(--danger); }
.state-go { background-color: var(--success); }
.state-result { background-color: var(--bg); }

#target-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

#main-message {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

#sub-message {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
}

#dashboard {
    height: 45%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

@media (min-height: 800px) {
    #dashboard { height: 40%; }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 500px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--secondary);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-val {
    font-size: 20px;
    font-weight: 800;
}

.stat-val.accent { color: var(--accent); }

.chart-container {
    flex: 1;
    position: relative;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 15px;
    overflow: hidden;
}

canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.glass-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.glass-btn:hover { background: rgba(255,255,255,0.2); }
.glass-btn:active { transform: scale(0.95); }
.glass-btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.glass-btn.danger:hover { background: rgba(239, 68, 68, 0.2); }

/* Tooltip */
.tooltip { position: relative; }
.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #000;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 10px;
}
.tooltip:hover .tooltiptext { visibility: visible; opacity: 1; }
