:root {
    --bg-color: #f0f4f8;
    --app-bg: white;
    --text-color: #333;
    --text-secondary: #666;
    --input-border: #ddd;
    --modal-bg: rgba(0,0,0,0.5);
    --card-bg: #eee;
    --card-active-bg: #fff8e1;
    --card-eliminated-bg: #ffcfcf;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --app-bg: #2d2d2d;
    --text-color: #f0f0f0;
    --text-secondary: #aaa;
    --input-border: #444;
    --modal-bg: rgba(0,0,0,0.7);
    --card-bg: #404040;
    --card-active-bg: #5a5020;
    --card-eliminated-bg: #5a2020;
    --shadow: 0 4px 15px rgba(0,0,0,0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    transition: background-color 0.3s;
}

#app {
    background: var(--app-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 400px;
    text-align: center;
    position: relative;
    transition: background-color 0.3s;
}

.hidden {
    display: none !important;
}

input[type="text"] {
    padding: 10px;
    border: 2px solid var(--input-border);
    border-radius: 6px;
    width: 70%;
    font-size: 16px;
    margin-bottom: 10px;
    background: var(--app-bg);
    color: var(--text-color);
}

button {
    padding: 10px 20px;
    background-color: #ffc107; /* Bee yellow */
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    width: 80%; /* Consistent button width */
    margin: 0 auto; /* Center button */
    display: block; /* Ensure margin auto works */
}

button:hover {
    background-color: #ffca2c;
}

.lobby-controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.divider {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 5px 0;
}

#room-code-display {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    background: var(--card-bg);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px dashed #aaa;
}

#player-list {
    list-style: none;
    padding: 0;
    text-align: left;
}

#player-list li {
    padding: 8px;
    border-bottom: 1px solid var(--input-border);
}

.player-card {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--card-bg);
    margin: 5px 0;
    border-radius: 4px;
}

.player-card.active {
    border: 2px solid #ffc107;
    background: var(--card-active-bg);
}

.player-card.eliminated {
    opacity: 0.5;
    text-decoration: line-through;
    background: var(--card-eliminated-bg);
}

#timer {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
}

#game-status {
    margin: 15px 0;
    font-size: 18px;
    font-weight: 500;
    min-height: 27px;
}

/* Modal Styles */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    z-index: 100;
}

.modal-content {
    background: var(--app-bg);
    padding: 20px;
    border-radius: 8px;
    width: 85%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group select, .form-group input[type="range"] {
    width: 100%;
    background: var(--app-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.game-list-item {
    border: 1px solid var(--input-border);
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.game-list-item button {
    width: auto;
    padding: 5px 10px;
    font-size: 14px;
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.game-actions button {
    flex: 1;
    max-width: 120px;
}
