/* Global Styles */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131f;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --success: #10b981;
    --error: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-primary);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--accent-secondary);
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Login Screen */
#login-screen {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Arena Header */
.arena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.badge {
    background: rgba(255,255,255,0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Input Section */
.input-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

#message-input {
    flex: 1;
}

/* Responses Grid */
.responses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.response-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s;
}

.response-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.05);
}

.response-card h3 {
    margin-top: 0;
    color: var(--accent-primary);
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
}

.latency-badge {
    font-size: 0.75rem;
    background: rgba(0,0,0,0.4);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Voting Section */
.voting-section {
    text-align: center;
    padding: 2rem;
    background: var(--glass-bg);
    border-radius: 16px;
    margin-top: 2rem;
}

.vote-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.vote-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    cursor: pointer;
}

.vote-btn:hover {
    background: var(--accent-primary);
}

.vote-btn.selected {
    background: var(--success);
    border-color: var(--success);
}

/* Lobby */
#voters-list li {
    padding: 0.5rem;
    background: rgba(255,255,255,0.05);
    margin-bottom: 0.5rem;
    border-radius: 4px;
    list-style: none;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.result-column h3 {
    text-align: center;
    color: var(--accent-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.result-row.winner {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

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