:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --danger: #ef4444;
    --success: #22c55e;
    --accent: #f59e0b;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 40px;
    text-align: center;
    transition: transform 0.2s;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--primary);
    color: white;
}

button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.join-group {
    display: flex;
    gap: 10px;
}

.join-group input {
    flex: 1;
}

.status {
    margin-top: 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Game Styles */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.timer-badge {
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

.game-grid {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: 1fr;
    }
}

.camera-section {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--primary);
}

#webcam-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#webcam-container canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.pose-target {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.pose-target span {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

#targetPose {
    font-size: 2.5rem;
    color: var(--primary);
}

.scoreboard {
    text-align: left;
    background: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
}

.scoreboard h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

#playerList {
    list-style: none;
}

#playerList li {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
}

.current-quality {
    margin-top: 20px;
    font-weight: bold;
    color: var(--success);
}

/* History Styles */
.history-container {
    margin-top: 30px;
    max-height: 300px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
}
