body {
    background: linear-gradient(180deg, #1a1a1a 0%, #333 100%);
    background-image: url('data:image/svg+xml,%3Csvg width="100" height="100" xmlns="http://www.w3.org/2000/svg"%3E%3Cline x1="50" y1="0" x2="50" y2="100" stroke="rgba(255,255,255,0.05)" stroke-width="2"/%3E%3C/svg%3E');
    background-size: 100px 100px;
    color: #fff;
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h1 {
    font-size: 3em;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin-bottom: 30px;
}

#tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.light {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle, #666 0%, #333 70%);
    border: 2px solid #444;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.1s ease;
}

.light.on {
    box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.7), 0 0 40px 20px rgba(255, 255, 255, 0.3);
}

.pre-stage.on { background: radial-gradient(circle, yellow 0%, #ffcc00 70%); }
.stage.on { background: radial-gradient(circle, yellow 0%, #ffcc00 70%); }
.amber.on { background: radial-gradient(circle, orange 0%, #ff6600 70%); }
.green.on { background: radial-gradient(circle, limegreen 0%, #00cc00 70%); }
.red.on { background: radial-gradient(circle, red 0%, #cc0000 70%); }
.light.white { 
    background: radial-gradient(circle, white 0%, #ddd 70%);
    box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.7), 0 0 40px 20px rgba(255, 255, 255, 0.3);
}

.result {
    font-size: 1.5em;
    margin: 20px 0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.sidebar {
    position: fixed;
    top: 100px;
    left: 20px;
    width: 300px; /* Wider for readability */
    height: calc(100vh - 120px); /* Full height minus top padding */
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leaderboard-container {
    flex: 1; /* Grow to fill space */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-scroll {
    max-height: 300px; /* Fixed height for scrolling */
    overflow-y: auto; /* Vertical scrollbar */
    overflow-x: hidden;
}

#leaderboard {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.8);
}

th, td {
    border: 1px solid #555;
    padding: 8px;
    text-align: center;
    font-size: 0.85em; /* Slightly smaller text */
}

th {
    background: #444;
    text-transform: uppercase;
}

.controls {
    background: linear-gradient(45deg, #2a2a2a, #444);
    border: 2px solid #666;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.controls label {
    font-size: 1em; /* Smaller label */
    margin-bottom: 5px;
}

select, button, input[type="text"] {
    padding: 8px;
    font-size: 0.9em; /* Smaller text */
    border-radius: 5px;
    border: 1px solid #555;
    background: #333;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
}

button {
    background: linear-gradient(45deg, #007bff, #0056b3);
    cursor: pointer;
    transition: transform 0.2s;
}

button:hover:not(:disabled) {
    transform: scale(1.05);
}

button:disabled {
    background: #666;
    cursor: not-allowed;
}

.method {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.method label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em; /* Smaller text */
}

.score-submit {
    display: flex;
    gap: 10px;
}

.instructions {
    margin-top: 15px;
    font-size: 0.85em; /* Smaller text */
    color: #ccc;
    text-align: left;
    border-top: 1px solid #555;
    padding-top: 10px;
}