* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #121212;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    text-align: center;
}
.hidden { display: none !important; }

h1 { font-size: 28px; margin-bottom: 24px; color: #bb86fc; }
h2 { font-size: 22px; margin-bottom: 16px; color: #bb86fc; }

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: #9e9e9e; }
.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #333;
    border-radius: 12px;
    background: #1e1e1e;
    color: #e0e0e0;
    font-size: 18px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus { border-color: #bb86fc; }
.code-input {
    letter-spacing: 12px;
    font-size: 32px !important;
    font-weight: bold;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: #bb86fc;
    color: #121212;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: #333;
    color: #e0e0e0;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 12px;
}

.error { color: #cf6679; margin-top: 12px; font-size: 14px; min-height: 20px; }

#status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #9e9e9e;
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.green { background: #43a047; }
.gray { background: #757575; }
.orange { background: #fb8c00; }

#player-score-area { margin-bottom: 24px; }
#my-name { display: block; font-size: 16px; color: #9e9e9e; margin-bottom: 4px; }
.score-large { font-size: 56px; font-weight: 700; color: #bb86fc; }

.btn-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}
.score-btn {
    padding: 18px 8px;
    background: #2d2d2d;
    color: #e0e0e0;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
}
.score-btn:active { transform: scale(0.95); background: #3d3d3d; }
.score-btn.negative { color: #cf6679; }
.score-btn.undo { background: #4a3728; color: #ffab40; }

.player-list { text-align: left; margin-bottom: 16px; }
.player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #1e1e1e;
    border-radius: 10px;
}
.player-row .color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    margin-right: 10px;
}
.player-row .name { flex: 1; font-size: 16px; }
.player-row .total { font-size: 18px; font-weight: 600; color: #bb86fc; }
.player-row .status { font-size: 12px; color: #757575; margin-left: 8px; }

.room-code-display { font-size: 18px; margin-bottom: 16px; }
.room-code-display strong { color: #bb86fc; letter-spacing: 4px; font-size: 24px; }

#lobby-status { color: #9e9e9e; font-size: 14px; margin-top: 16px; margin-bottom: 8px; }
