* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: black;
    color: white;
    height: 100vh;
    overflow: auto;
    margin: 0;
    padding: 0;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    display: none;
    overflow-y: auto;
}

.screen.active {
    display: flex;
}

#audienceScreen.active {
    display: flex;
}

/* Main Screen Styles */
.main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.title-text {
    font-family: 'Playfair Display', serif;
    font-size: 72px;
    color: white;
    margin-bottom: 20px;
    line-height: 1.2;
}

.title-bold {
    font-weight: 900;
}

.title-italic {
    font-style: italic;
    font-weight: 400;
}

.subtitle-text {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    color: white;
    margin-bottom: 60px;
    line-height: 1.4;
    font-weight: 400;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
    max-width: 300px;
}

.role-button {
    background-color: white;
    color: black;
    border: none;
    padding: 20px 60px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    width: 100%;
}

.role-button:hover {
    background-color: #333;
    color: white;
    transform: scale(1.05);
}

.role-button:active {
    transform: scale(0.95);
}

/* Screen Content Styles */
.screen-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Specific styles for judge and admin screens */
#judgeScreen .screen-content,
#adminScreen .screen-content {
    background-color: black;
    padding: 20px;
    overflow-y: auto;
}

.screen-content h1 {
    font-size: 48px;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.screen-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: white;
}

/* Audience Screen Styles */
.audience-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.audience-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: white;
    color: black;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
}

.audience-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: black;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.audience-top:hover {
    background-color: #f0f0f0;
}

.audience-bottom:hover {
    background-color: #222;
}

.group-text {
    font-size: 24px;
    font-weight: bold;
    color: black;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.big-text {
    font-size: 72px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 4px;
    padding: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.white-bg {
    background-color: white;
    color: black;
}

.black-bg {
    background-color: black;
    color: white;
}

.big-text:hover {
    transform: scale(1.05);
}

.big-text:active {
    transform: scale(0.95);
}

.tap-count {
    margin-top: 20px;
    font-size: 18px;
    color: white;
    font-weight: bold;
}

.audience-back {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
}

/* Judge Screen Styles */
.group-display {
    font-size: 28px;
    font-weight: bold;
    color: white;
    margin-bottom: 30px;
    padding: 15px 30px;
    border: 2px solid white;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Admin Screen Styles */
.admin-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
}

.group-dropdown {
    background-color: white;
    color: black;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    min-width: 200px;
    text-align: center;
}

.group-dropdown:focus {
    outline: 3px solid #666;
    outline-offset: 2px;
}

.submit-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

.submit-button:active {
    transform: scale(0.95);
}

.pause-button {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pause-button:hover {
    background-color: #e68900;
    transform: scale(1.05);
}

.pause-button:active {
    transform: scale(0.95);
}

.pause-button.resume {
    background-color: #4CAF50;
}

.pause-button.resume:hover {
    background-color: #45a049;
}

.reset-button {
    background-color: #ff4444;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    margin: 10px 0;
}

.reset-button:hover {
    background-color: #cc0000;
    transform: scale(1.05);
}

.reset-button:active {
    transform: scale(0.95);
}

/* Judge Screen Styles */
.judge-section {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid white;
}

.judge-section h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 20px;
}

.judge-input-group {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

.judge-input-group input {
    background-color: white;
    color: black;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 5px;
    min-width: 200px;
}

.scoring-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.scoring-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.score-summary {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid white;
}

.score-summary h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.summary-table table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.summary-table th,
.summary-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.summary-table th {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    font-size: 14px;
}

.summary-table td {
    background-color: rgba(0, 0, 0, 0.3);
    font-size: 14px;
}

.summary-table tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.05);
}

.edit-icon {
    color: #4CAF50;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.edit-icon:hover {
    color: #45a049;
    transform: scale(1.2);
}

.no-score {
    color: #888;
    font-style: italic;
}

.score-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-item label {
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.score-item input {
    background-color: white;
    color: black;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 5px;
    text-align: center;
}

.score-item input:focus {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

/* Admin Table Container Styles */
.admin-table-container {
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-table-container h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

/* Judge Status Table Styles */
.judge-status-table {
    max-height: 300px;
    overflow-y: auto;
}

.judge-status-table table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.judge-status-table th,
.judge-status-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.judge-status-table th {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    position: sticky;
    top: 0;
}

.judge-status-table td {
    background-color: rgba(0, 0, 0, 0.3);
}

.status-submitted {
    color: #4CAF50;
    font-weight: bold;
}

.status-not-submitted {
    color: #ff4444;
    font-weight: bold;
}

/* Scores Table Styles */
.scores-table table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.scores-table th,
.scores-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.scores-table th {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    font-size: 14px;
}

.scores-table td {
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.3);
}

.scores-table tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Stats Table Styles */
.stats-table {
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid white;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.stats-table th,
.stats-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stats-table th {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
}

.stats-table td {
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.3);
}

.stats-table tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.05);
}

.back-button {
    background-color: white;
    color: black;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #333;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #222;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    min-width: 300px;
    border: 2px solid white;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: white;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #555;
    background-color: #333;
    color: white;
    font-size: 16px;
    border-radius: 5px;
}

.modal-content input:focus {
    outline: none;
    border-color: white;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.modal-buttons button:first-child {
    background-color: white;
    color: black;
}

.modal-buttons button:first-child:hover {
    background-color: #ccc;
}

.modal-buttons button:last-child {
    background-color: #666;
    color: white;
}

.modal-buttons button:last-child:hover {
    background-color: #888;
}

.error-message {
    color: #ff4444;
    margin-top: 10px;
    font-size: 14px;
    min-height: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile Styles */
    .screen-content {
        padding: 10px;
    }
    
    .screen-content h1 {
        font-size: 32px;
        margin-bottom: 20px;
    }
    
    .screen-content h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .title-text {
        font-size: 48px;
        margin-bottom: 15px;
    }
    
    .subtitle-text {
        font-size: 18px;
        margin-bottom: 40px;
    }
    
    .button-container {
        max-width: 250px;
    }
    
    .role-button {
        padding: 15px 40px;
        font-size: 16px;
        width: 100%;
    }
    
    .group-display {
        font-size: 20px;
        padding: 10px 20px;
        margin-bottom: 20px;
    }
    
    .admin-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .group-dropdown {
        min-width: 150px;
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .submit-button, .reset-button, .pause-button {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .scoring-container {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .judge-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .judge-input-group input {
        min-width: 150px;
        width: 100%;
    }
    
    .big-text {
        font-size: 48px;
        padding: 20px;
    }
    
    .group-text {
        font-size: 18px;
    }
    
    .tap-count {
        font-size: 16px;
    }
    
    /* Table responsiveness */
    .scores-table th,
    .scores-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .judge-status-table th,
    .judge-status-table td {
        padding: 8px;
        font-size: 12px;
    }
    
    .summary-table th,
    .summary-table td {
        padding: 8px;
        font-size: 12px;
    }
    
    .admin-table-container {
        padding: 10px;
        margin: 10px 0;
    }
    
    .judge-section {
        padding: 15px;
        margin: 10px 0;
    }
    
    .score-summary {
        padding: 15px;
    }
    
    /* Modal responsiveness */
    .modal-content {
        padding: 20px;
        min-width: 250px;
        margin: 20px;
    }
    
    .modal-content h2 {
        font-size: 18px;
    }
    
    .modal-content input {
        padding: 10px;
        font-size: 14px;
    }
    
    .modal-buttons button {
        padding: 8px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Small Mobile Styles */
    .screen-content h1 {
        font-size: 24px;
    }
    
    .screen-content h2 {
        font-size: 18px;
    }
    
    .title-text {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    .subtitle-text {
        font-size: 16px;
        margin-bottom: 30px;
    }
    
    .button-container {
        max-width: 200px;
    }
    
    .role-button {
        padding: 12px 30px;
        font-size: 14px;
        width: 100%;
    }
    
    .big-text {
        font-size: 36px;
        padding: 15px;
    }
    
    .group-text {
        font-size: 16px;
    }
    
    .tap-count {
        font-size: 14px;
    }
    
    .group-display {
        font-size: 18px;
        padding: 8px 15px;
    }
    
    /* Very small table adjustments */
    .scores-table th,
    .scores-table td {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .judge-status-table th,
    .judge-status-table td {
        padding: 6px;
        font-size: 10px;
    }
    
    .summary-table th,
    .summary-table td {
        padding: 6px;
        font-size: 10px;
    }
    
    /* Hide some table columns on very small screens if needed */
    .scores-table th:nth-child(4),
    .scores-table td:nth-child(4) {
        display: none; /* Hide Presentation column on very small screens */
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet Styles */
    .screen-content h1 {
        font-size: 40px;
    }
    
    .big-text {
        font-size: 60px;
        padding: 30px;
    }
    
    .scoring-container {
        gap: 20px;
        align-items: center;
    }
    
    .admin-table-container {
        padding: 12px;
    }
    
    .judge-section {
        padding: 18px;
    }
}

@media (min-width: 1025px) {
    /* Desktop Styles - ensure proper layout */
    .screen-content {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .admin-table-container {
        max-width: 100%;
        overflow-x: auto;
    }
    
    .scores-table {
        overflow-x: auto;
    }
    
    .stats-table {
        overflow-x: auto;
    }
}
