body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    user-select: none;
}
.container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}
.hidden {
    display: none !important;
}
.setup-hint {
    font-size: 0.65em;
    font-weight: normal;
    color: #777;
}
.player-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 10px;
    padding: 12px 15px;
    border: 2px solid #ccc;
    border-radius: 10px;
    margin-bottom: 12px;
    background-color: #fdfdfd;
    cursor: pointer;
}
.player-row:hover {
    border-color: #3498db;
}
.player-row.locked {
    cursor: default;
}
.player-row.active-turn {
    border-color: #2ecc71;
    background-color: #ebfaf0;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
}
.player-name-block {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}
.player-name {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.turn-count {
    font-size: 11px;
    font-weight: normal;
    color: #999;
    white-space: nowrap;
}
.player-score {
    font-size: 24px;
    color: #27ae60;
    font-weight: bold;
    justify-self: center;
}
.undo-btn {
    background-color: #7f8c8d;
    color: white;
    border: none;
    border-radius: 6px;
    width: auto;
    margin: 0;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    justify-self: end;
}
.undo-btn:disabled {
    opacity: 0.3;
    cursor: default;
}
.turn-controls {
    margin-top: 20px;
    background: #fdfdfd;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
input, button {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 16px;
    box-sizing: border-box;
}
#pointsScored::-webkit-outer-spin-button,
#pointsScored::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#pointsScored {
    -moz-appearance: textfield;
}
button {
    background-color: #3498db;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
}
button:disabled, input:disabled {
    opacity: 0.5;
    cursor: default;
}
.btn-qwirkle {
    background-color: #e74c3c;
}
.btn-end {
    background-color: #9b59b6;
    margin-top: 15px;
}
.btn-reset {
    background-color: #e67e22;
    margin-top: 5px;
}
.guard-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    font-weight: bold;
    margin-top: 5px;
}
.turn-timer {
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    color: #e67e22;
    margin: -6px 0 4px;
    user-select: none;
}
.scores-btn {
    display: block;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background-color: #3498db;
    border-radius: 10px;
    padding: 10px 14px;
    margin: 0 0 14px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 0 #2379b0;
}
.scores-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}
.icon-toggle-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 15px 0 5px;
}
.icon-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    white-space: nowrap;
    color: #333;
    background-color: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 20px;
    padding: 6px 9px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}
.icon-toggle.toggle-off {
    opacity: 0.55;
    background-color: #f5f5f5;
    border-color: #ddd;
}
.voice-picker {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #555;
    margin: 4px 0 8px;
}
.voice-picker label {
    width: 74px;
    flex: none;
}
.voice-picker input {
    width: 56px;
    padding: 4px 6px;
    margin: 0;
    font-size: 13px;
    text-align: center;
    border-radius: 6px;
}
.voice-picker select {
    width: auto;
    max-width: 220px;
    padding: 4px 8px;
    margin: 0;
    font-size: 13px;
    border-radius: 6px;
}
.winner-text {
    text-align: center;
    color: #8e44ad;
    margin-top: 15px;
}
.home-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 14px 0 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    background-color: #7f8c8d;
    color: white;
    cursor: pointer;
    user-select: none;
}
.legal {
    max-width: 400px;
    margin: 16px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #999;
    text-align: center;
}
