:root {
    --bg-color: #0f0e17;
    --card-bg: #23232c;
    --text-color: #fffffe;
    --primary-color: #ff8906;
    --secondary-color: #f25f4c;
    --accent-color: #e53170;
    --success-color: #2cb67d;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 137, 6, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(229, 49, 112, 0.1) 0%, transparent 20%);
}

.container {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
}

.screen {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.hidden {
    display: none !important;
}

h1, h2, h3 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-color);
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
}

/* Forms & Inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.form-input {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    background: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 137, 6, 0.3);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(255, 137, 6, 0.1);
}

.btn-block {
    width: 100%;
}

.grid-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Game Elements */
.race-track {
    background: linear-gradient(to bottom, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    height: 400px;
    margin-top: 20px;
    border: 2px solid var(--border-color);
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}

.camel-container {
    position: absolute;
    height: 50px;
    transition: left 0.5s linear;
    width: 60px;
    z-index: 10;
}

.camel-image {
    width: 100%;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3));
}

.player-tag {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.finish-line {
    position: absolute;
    right: 50px;
    top: 0;
    bottom: 0;
    width: 10px;
    background-image: repeating-linear-gradient(0deg, #fff, #fff 10px, #000 10px, #000 20px);
    z-index: 1;
}

/* Balls/Clickables */
#balls-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through if not on ball */
    z-index: 20;
}

.ball {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ff8906, #d96d00);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    pointer-events: auto;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.2);
}

.ball-1 { background: radial-gradient(circle at 30% 30%, #2cb67d, #1a8e5f); }
.ball-2 { background: radial-gradient(circle at 30% 30%, #ff8906, #d96d00); }
.ball-3 { background: radial-gradient(circle at 30% 30%, #f25f4c, #d13a26); }

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

/* User Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--glass-bg);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.coins-display {
    margin-left: auto;
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Lobby */
.player-list {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.lobby-player {
    background: var(--glass-bg);
    padding: 10px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.lobby-player img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.flex-col { display: flex; flexDirection: column; }
.link { color: var(--primary-color); text-decoration: none; cursor: pointer; }

/* Responsive */
@media (max-width: 600px) {
    .screen { padding: 20px; }
    h1 { font-size: 1.8rem; }
    .camel-container { width: 40px; }
}
