/* ========================================
   Gaming Performance Test - Styles
   ======================================== */

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #1e1b4b;
    --light-bg: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #cbd5e1;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:  linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform:  translateY(20px);
    }
    to {
        opacity: 1;
        transform:  translateY(0);
    }
}

/* ========================================
   HEADER
   ======================================== */

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom:  2px solid #e2e8f0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

header p {
    color: #64748b;
    font-size: 1.1rem;
}

/* ========================================
   PROGRESS BAR
   ======================================== */

.progress-container {
    margin-bottom: 40px;
}

.progress-bar {
    width: 100%;
    height:  8px;
    background:  #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 25%;
    transition: width 0.5s ease;
}

#progress-text {
    text-align: center;
    color: #64748b;
    font-weight: 600;
}

/* ========================================
   STEPS
   ======================================== */

.step {
    display: none;
    animation: slideIn 0.4s ease;
}

.step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform:  translateX(-20px);
    }
    to {
        opacity: 1;
        transform:  translateX(0);
    }
}

.step h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.step > p {
    color: #64748b;
    margin-bottom: 30px;
    font-size:  1.05rem;
}

/* ========================================
   GAME SELECT
   ======================================== */

.game-select {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.game-select:hover {
    border-color: var(--primary-color);
}

.game-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform:  translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background:  #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-large {
    padding: 20px 50px;
    font-size:  1.3rem;
}

.btn:active {
    transform: translateY(0);
}

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

/* ========================================
   TEST CONTAINERS
   ======================================== */

.test-container {
    margin:  30px 0;
    padding:  40px;
    background: #f8fafc;
    border-radius: var(--border-radius);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   REACTION TEST
   ======================================== */

.reaction-box {
    width: 100%;
    height:  300px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight:  700;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.reaction-box.waiting {
    background: #ef4444;
    color: white;
}

.reaction-box.ready {
    background: #10b981;
    color:  white;
    animation: pulse 0.5s infinite;
}

.reaction-box.early {
    background: #f59e0b;
    color:  white;
}

.reaction-box.completed {
    background: var(--success-color);
    color: white;
    cursor: default;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

#reaction-text {
    text-align: center;
    padding: 20px;
    line-height: 1.6;
    white-space: pre-line;
}

/* ========================================
   AIM TEST
   ======================================== */

.aim-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: crosshair;
}

.aim-container.active {
    border: 3px solid var(--primary-color);
}

.aim-target {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #ef4444 0%, #dc2626 100%);
    border:  3px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
    animation: targetAppear 0.3s ease;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

@keyframes targetAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.aim-target:hover {
    transform: scale(1.1);
}

.aim-target.hit {
    animation: targetHit 0.2s ease;
}

@keyframes targetHit {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.5);
        background: #10b981;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.miss-indicator {
    position: absolute;
    color: #ef4444;
    font-size: 2rem;
    font-weight: bold;
    pointer-events: none;
    animation: missAnimation 0.5s ease;
}

@keyframes missAnimation {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(2);
    }
}

.completed-message {
    color: white;
    font-size: 1.5rem;
    font-weight:  600;
    text-align: center;
}

/* ========================================
   CLICK TEST
   ======================================== */

.click-box {
    width: 100%;
    height: 300px;
    border-radius:  var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-bg);
    transition: var(--transition);
}

.click-box.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
}

.click-box.clicked {
    transform: scale(0.98);
    filter: brightness(1.2);
}

.click-box.completed {
    background: var(--success-color);
}

.click-prompt {
    color: white;
    font-size: 2rem;
    font-weight:  800;
    user-select: none;
}

/* ========================================
   STATS
   ======================================== */

.stats {
    background: white;
    border:  2px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 20px;
    margin:  20px 0;
    display:  flex;
    justify-content:  space-around;
    flex-wrap: wrap;
    gap:  20px;
}

.stats p {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.stats span {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
}

/* ========================================
   LOADING
   ======================================== */

.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    font-size: 1.2rem;
    color: #64748b;
    font-weight: 600;
}

/* ========================================
   RESULTS PAGE
   ======================================== */

.results-container {
    max-width: 800px;
    margin: 0 auto;
}

.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.tier-badge {
    display: inline-block;
    font-size: 3rem;
    font-weight:  900;
    margin:  20px 0;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.tier-badge.low {
    background: rgba(239, 68, 68, 0.3);
}

.tier-badge.medium {
    background: rgba(245, 158, 11, 0.3);
}

.tier-badge.high {
    background: rgba(16, 185, 129, 0.3);
}

.performance-score {
    font-size: 4rem;
    font-weight:  900;
    margin: 20px 0;
}

.score-label {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: -10px;
}

.game-equivalent {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    font-size: 1.1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin:  30px 0;
}

.metric-card {
    background:  white;
    padding: 25px;
    border-radius:  var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.metric-label {
    font-size: 0.9rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom:  10px;
}

.metric-value {
    font-size:  2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.metric-unit {
    font-size: 1rem;
    color: #94a3b8;
    margin-left: 5px;
}

.probabilities {
    background: #f8fafc;
    padding: 30px;
    border-radius:  var(--border-radius);
    margin:  30px 0;
}

.probabilities h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.probability-bar {
    margin: 15px 0;
}

.probability-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.probability-fill-container {
    height: 30px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
}

.probability-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 600;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hidden {
    display: none ! important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top:  20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .btn {
        width: 100%;
    }

    .stats {
        flex-direction: column;
    }

    .aim-container {
        height: 300px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}