* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.hidden {
    display: none !important;
}

/* Screen Management */
.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
}

.screen.active {
    display: block;
}

/* Lobby Styles */
#lobby-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.lobby-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    position: relative;
}

.lobby-header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 10px;
    z-index: 10;
    width: 100%;
}

.lobby-header h1 {
    font-size: 1.8em;
    color: white;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: bold;
}

.lobby-subtitle {
    font-size: 0.9em;
    color: rgba(255,255,255,0.9);
    margin-top: 5px;
}

.lobby-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    z-index: 10;
    position: relative;
}

@media (max-width: 768px) {
    .lobby-content {
        grid-template-columns: 1fr;
    }
}

.players-lobby-list {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.players-lobby-list h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.lobby-players-container {
    max-height: 500px;
    overflow-y: auto;
}

.lobby-player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 5px 0;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    border-left: 3px solid #667eea;
    transition: all 0.3s;
}

.lobby-player-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.lobby-player-item.host {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.lobby-player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lobby-player-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.lobby-player-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lobby-player-name {
    font-size: 0.95em;
    font-weight: bold;
    color: #333;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lobby-player-role {
    font-size: 0.75em;
    color: #666;
    font-style: italic;
    font-weight: normal;
    margin-left: 4px;
}

.lobby-player-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75em;
    color: #4caf50;
    font-weight: bold;
    flex-shrink: 0;
}

.lobby-player-status.ready::before {
    content: '✓';
    color: #4caf50;
    font-size: 1.2em;
}

.lobby-actions {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lobby-action-section {
    text-align: center;
    width: 100%;
}

.lobby-start-button {
    padding: 20px 50px;
    font-size: 1.8em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.lobby-start-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.lobby-start-button:active {
    transform: translateY(-2px);
}

.lobby-hint {
    margin-top: 15px;
    color: rgba(255,255,255,0.9);
    font-size: 1em;
}

.waiting-message {
    text-align: center;
    color: white;
}

.waiting-message h3 {
    margin: 20px 0 10px;
    font-size: 1.5em;
}

.waiting-message p {
    color: rgba(255,255,255,0.8);
    font-size: 1em;
}

.rejoin-message {
    text-align: center;
    color: white;
}

.rejoin-message h3 {
    margin: 20px 0 10px;
    font-size: 1.5em;
}

.rejoin-message p {
    color: rgba(255,255,255,0.8);
    font-size: 1em;
    margin-bottom: 20px;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lobby-empty-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Host Controller Screen */
#host-controller-screen {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    width: 100%;
}

/* Host Interface */
#host-interface {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.host-header {
    text-align: center;
    margin-bottom: 30px;
}

.host-header h1 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 2.5em;
}

.game-status-indicator {
    text-align: center;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1em;
}

.game-status-not-started {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
}

.game-status-ready {
    background: #e3f2fd;
    color: #1976d2;
    border: 2px solid #2196f3;
}

.game-status-in-progress {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #4caf50;
}

/* Teams & Scores Display */
#teams-scores-container {
    margin-bottom: 30px;
}

#teams-scores-container h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5em;
}

#teams-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 1200px) {
    #teams-display {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #teams-display {
        grid-template-columns: 1fr;
    }
}

.team-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-top: 5px solid #667eea;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.team-card.team-active {
    background: #e3f2fd;
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
    border: 3px solid #2196f3;
    transform: scale(1.02);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.team-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.5em;
}

.team-score {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
}

.team-players {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    transition: all 0.3s;
}

.player-item.active {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.player-item .player-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.player-item .player-score {
    font-weight: bold;
    font-size: 1.1em;
    color: #667eea;
    margin-left: 10px;
}

.player-item .buzzer-order {
    font-size: 0.9em;
    color: #ff9800;
    font-weight: bold;
    margin-left: 10px;
    padding: 2px 8px;
    background: #fff3e0;
    border-radius: 12px;
}

/* Host Controls */
.host-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.control-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.control-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.control-section h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #da190b;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e68900;
}

/* Settings Display */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.setting-item label {
    font-weight: 600;
    color: #666;
}

.setting-item span {
    color: #667eea;
    font-weight: bold;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
    color: #667eea;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 2px solid #e0e0e0;
}

.settings-group {
    margin-bottom: 25px;
}

.settings-group h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.setting-input-group {
    margin-bottom: 15px;
}

.setting-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.styled-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Poppins', 'Rajdhani', sans-serif;
    background: white;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.styled-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Timer Display */
.timer-display {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    border: 3px solid #667eea;
}

.timer-display-large {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    border: 3px solid #667eea;
    margin: 10px 0;
}

.timer-row {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.timer-container {
    text-align: center;
    margin: 10px 0;
    flex: 1;
    min-width: 150px;
}

.timer-container h3 {
    color: #667eea;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.timer-label {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 10px;
}

/* Display Interface */
#display-interface {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.display-header-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 15px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.display-header-right h1 {
    font-size: 0.95em;
    margin: 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.display-header-right .game-display-text {
    font-size: 0.75em;
    margin: 0;
    color: white;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    line-height: 1.2;
}

#display-teams-scores-container {
    margin-bottom: 10px;
    flex-shrink: 0;
}

#display-teams-scores-container h2 {
    color: white;
    margin-bottom: 8px;
    font-size: 1.2em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.display-teams-header .teams-scores-title {
    flex: 0 0 auto;
}

.display-teams-header .display-header-right {
    flex: 0 0 auto;
    text-align: right;
}

#display-teams-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 1200px) {
    #display-teams-display {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #display-teams-display {
        grid-template-columns: 1fr;
    }
}

.team-card-display {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    border-top: 3px solid #667eea;
}

.team-card-display.team-active {
    background: #e3f2fd;
    box-shadow: 0 12px 35px rgba(33, 150, 243, 0.5);
    border: 3px solid #2196f3;
    transform: scale(1.03);
}

.team-header-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid #eee;
}

.team-card-display h2 {
    font-size: 1.3em;
    color: #667eea;
    margin: 0;
}

.team-score-display {
    font-size: 1.5em;
    font-weight: bold;
    color: #4caf50;
    margin: 0;
}

.team-players-display {
    margin-top: 10px;
}

.player-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    margin: 4px 0;
    background: #f5f5f5;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 0.9em;
}

.player-score-item.active {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.player-score-item .player-name {
    font-weight: 500;
    color: #333;
}

.player-score-item .player-score-value {
    font-weight: bold;
    font-size: 1.1em;
    color: #4caf50;
}

.player-score-item .buzzer-order {
    font-size: 0.9em;
    color: #ff9800;
    font-weight: bold;
    margin-left: 10px;
    padding: 2px 8px;
    background: #fff3e0;
    border-radius: 12px;
}

/* Bottom Row Container */
.display-bottom-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-shrink: 0;
    margin-bottom: 10px;
}

.display-device-list-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-sizing: border-box;
}

.display-device-list-section h3 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1em;
}

.display-settings-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    flex: 1;
    height: fit-content;
    align-self: flex-start;
}

.display-settings-section h3 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1em;
}

#display-settings .setting-item {
    background: #f9f9f9;
    padding: 6px 10px;
    margin: 4px 0;
    font-size: 0.9em;
}

#display-timer-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Buzzer Interface */
#buzzer-interface {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    padding: 0;
    position: relative;
}

#player-name-header {
    padding: 15px 20px;
    text-align: center;
    background: rgba(255,255,255,0.15);
    border-bottom: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    z-index: 10;
}

#player-name-header.active {
    background: rgba(76, 175, 80, 0.3);
    border-bottom-color: #4caf50;
}

.player-name {
    font-size: 1.4em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.connection-status {
    font-size: 0.9em;
    color: rgba(255,255,255,0.9);
    padding: 5px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
}

#buzzer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 20px;
    position: relative;
}

#buzzer-order-display {
    font-size: 1.2em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: bold;
    position: absolute;
    top: 20px;
    z-index: 5;
}

#buzzer-button {
    width: 100%;
    max-width: 320px;
    height: 320px;
    background: transparent;
    background-image: url('../images/buzzer_up.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%) translateZ(0);
    transform: translate(-50%, -50%) translateZ(0);
    z-index: 1;
}

#buzzer-button.pressed {
    background-image: url('../images/buzzer_down.png');
}

#buzzer-button.disabled {
    background-image: url('../images/buzzer_down_unavailable.png');
    cursor: not-allowed;
    opacity: 0.7;
}

#player-answer-timer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
    display: none;
}

#player-answer-timer-value {
    font-size: 8em;
    font-weight: bold;
    color: white;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.5);
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

/* Device Status Section */
.device-status-section {
    background: rgba(255, 255, 255, 0.95);
    margin: 20px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.device-status-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

/* Device list in control section */
.control-section .device-list {
    background: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.device-category {
    margin-bottom: 15px;
}

.device-category:last-child {
    margin-bottom: 0;
}

.device-category h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: #f5f5f5;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.device-item .device-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.device-item .device-socket-id {
    font-size: 0.85em;
    color: #666;
    margin: 0 10px;
}

.device-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-connected {
    background: #4caf50;
    color: white;
}

.status-disconnected {
    background: #f44336;
    color: white;
}

/* Start Screen */
/* Sound Permission Modal */
#sound-permission-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

#sound-permission-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.sound-permission-content {
    max-width: 500px;
    width: 90%;
    margin: 20px;
}

.sound-permission-content .modal-body {
    text-align: center;
    padding: 30px;
}

.sound-permission-content .modal-body p {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.6;
}

.sound-permission-content .modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 30px;
}

#start-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.start-screen-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 500px;
    margin: 20px;
}

.start-screen-content h2 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 20px;
}

.start-screen-content p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.start-button {
    font-size: 1.5em;
    padding: 20px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Celebration Screen (Winner Popup) */
#celebration-screen {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#winner-popup {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#winner-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 60px 80px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.5s ease-out;
}

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

#winner-content h1 {
    font-size: 4em;
    color: #FFD700;
    margin: 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    font-weight: bold;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#winner-content h2 {
    font-size: 2.5em;
    color: white;
    margin: 20px 0 0 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Confetti container */
#confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FFD700;
    animation: confettiFall linear infinite;
}

.confetti:nth-child(2n) {
    background: #FF6B6B;
}

.confetti:nth-child(3n) {
    background: #4ECDC4;
}

.confetti:nth-child(4n) {
    background: #95E1D3;
}

.confetti:nth-child(5n) {
    background: #F38181;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    #winner-content {
        padding: 40px 30px;
        margin: 20px;
    }
    
    #winner-content h1 {
        font-size: 2.5em;
    }
    
    #winner-content h2 {
        font-size: 1.8em;
    }
}

/* Edit Scores Modal */
.edit-scores-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px 0;
}

.edit-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: all 0.3s;
}

.edit-score-item:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

.edit-score-player-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.edit-score-player-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.edit-score-team-name {
    color: #666;
    font-size: 0.9em;
    margin-left: 5px;
}

.edit-score-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.score-btn:active {
    transform: scale(0.95);
}

.score-btn.decrease-btn {
    border-color: #f44336;
    color: #f44336;
}

.score-btn.decrease-btn:hover {
    background: #f44336;
    color: white;
}

.score-btn.increase-btn {
    border-color: #4caf50;
    color: #4caf50;
}

.score-btn.increase-btn:hover {
    background: #4caf50;
    color: white;
}

.score-input {
    width: 80px;
    height: 40px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 0 10px;
    color: #333;
}

.score-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Messages */
.messages {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    z-index: 1000;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Responsive */
@media (max-width: 768px) {
    #host-interface {
        padding: 15px;
    }
    
    .host-controls {
        grid-template-columns: 1fr;
    }
    
    .players-grid,
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    #buzzer-button {
        max-width: 250px;
        height: 250px;
    }
}
