:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                      radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
}

.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.view {
    display: none;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

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

/* Upload Area */
.upload-area {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 2px dashed var(--primary);
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover, .upload-area.dragover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-area h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--text-muted);
}

/* Quiz UI */
.progress-container {
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #818cf8, #c084fc);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-container {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
}

.question-container h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    background: var(--surface);
    border: 2px solid transparent;
    color: var(--text-main);
    padding: 1.2rem;
    font-size: 1.1rem;
    text-align: left;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) {
    background: var(--surface-hover);
    transform: translateX(5px);
}

.option-btn.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.option-btn.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.option-btn.wrong {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.option-btn:disabled {
    cursor: default;
    opacity: 0.8;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

#question-counter {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.live-score {
    color: var(--success);
    font-weight: 600;
    font-size: 1.1rem;
    margin-left: auto;
    margin-right: 1.5rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn.primary:hover:not(:disabled) {
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

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

/* Results */
.results-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #c084fc);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    font-size: 3rem;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.results-card h2 {
    font-size: 2.5rem;
}

#score-message {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.predefined-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Player Selection */
.players-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.player-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    color: var(--text-main);
}

.player-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: rgba(99, 102, 241, 0.1);
}

.player-card .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #c084fc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 auto 1rem auto;
}

/* Stats */
.table-responsive {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.stats-table th, .stats-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stats-table th {
    color: var(--text-muted);
    font-weight: 600;
}

