* {
    touch-action: manipulation;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-bottom: 60px;
    touch-action: manipulation;
}

@media screen and (max-height: 600px) {
    /* Disabled button styles */
    .button-container button:disabled {
        background-color: #6c757d;
        cursor: not-allowed;
        opacity: 0.65;
    }
    
    body {
        padding-bottom: 40px;
    }
}
.container {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    width: 100%;
    margin: 10px;
    touch-action: manipulation;
    box-sizing: border-box;
}
h1, h2, h3 {
    text-align: center;
    color: #333;
}

/* Team list styles */
.team-list {
    margin: 1rem 0;
    overflow-y: auto;
    padding: 0.3rem;
}

.team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px; 
    margin: 0.3rem 0;
    background: #f8f9fa;
    border: 1px solid #eff0f1;
    border-radius: 4px;
    transition: all 0.2s ease;
    max-height: 30px;
}

.team-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.team-item.inactive {
    border-style: dashed;
    background: #f8f9fa;
    opacity: 0.8;
}

.team-item.inactive:hover {
    opacity: 1;
    background: #e9ecef;
}

/* Section headers - removed since they're now defined together with toggle-btn h3 later */

/* Team buttons */
.team-item button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-weight: 500;
}

.team-item button.join-btn {
    background-color: #28a745;
    color: white;
}

.team-item button.reactivate-btn {
    background-color: #6c757d;
    color: white;
}

.team-item button:hover {
    filter: brightness(90%);
    transform: scale(1.05);
}

.team-item button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    touch-action: manipulation;
}

#teamSection, #createTeamSection, #joinTeamSection {
    width: 100%;
    touch-action: manipulation;
}
.status-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
    touch-action: manipulation;
}
.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}
.error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}
.warning {
    background-color: #fff8e1;
    color: #f57f17;
    border-left: 4px solid #f57f17;
}
.info {
    background-color: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1565c0;
}
.form-group {
    margin-bottom: 15px;
}
input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    touch-action: manipulation;
}
button {
    background-color: #1976d2;
    color: white;
    border: 2px solid transparent; /* Default border for visual feedback */
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    touch-action: manipulation;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
button:hover {
    background-color: #1565c0;
    border-color: #4CAF50; /* Add hover border color for feedback */
}
button:disabled {
    background-color: #b0bec5;
    cursor: not-allowed;
    border-color: #F44336; /* Add disabled border color for feedback */
    transition: opacity 0.3s ease, border-color 0.3s ease;
}
.team-list {
    margin-top: 20px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.team-item {
    padding: 3px; 
    border-bottom: 1px solid #eee;
    cursor: pointer;
    touch-action: manipulation;
}
.team-item:hover {
    background-color: #f5f5f5;
}
.team-item:last-child {
    border-bottom: none;
}
.question-container {
    text-align: center;
    padding: 10px 0;
    touch-action: manipulation;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}
.question {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
    padding: 20px;
    background-color: #e3f2fd;
    border-radius: 8px;
    text-transform: uppercase;
    color: #1565c0;
    text-align: center;
    touch-action: manipulation;
}
.answer-buttons {
    display: grid;
    gap: 10px;
    padding: 0;
    touch-action: manipulation;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

@media (min-aspect-ratio: 1/1) {
    .answer-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

@media (max-aspect-ratio: 1/1) {
    .answer-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.answer-button {
    padding: 10px;
    font-size: 24px;
    width: 100%;
    touch-action: manipulation;
    border-radius: 4px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.answer-button:disabled {
    opacity: 0.65;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}
.true-button {
    background-color: #4caf50;
    transition: opacity 0.3s ease;
}
.true-button:hover {
    background-color: #388e3c;
    transition: opacity 0.3s ease;
}
.false-button {
    background-color: #f44336;
    transition: opacity 0.3s ease;
}
.false-button:hover {
    background-color: #d32f2f;
    transition: opacity 0.3s ease;
}
.true-button.paused {
    background-color: #6c757d;
    transition: opacity 0.3s ease;
}
.false-button.paused {
    background-color: #6c757d;
    transition: opacity 0.3s ease;
}
#questionSection {
    touch-action: manipulation;
}

#waitingMessage {
    touch-action: manipulation;
}

#waitingMessage {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#waitingMessage.visible {
    opacity: 1;
}

.hidden {
    display: none;
}
.session-info {
    font-size: 12px;
    color: #757575;
    text-align: center;
    margin-top: 20px;
}

.session-id {
    font-family: monospace;
}
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    touch-action: manipulation;
}
.connected {
    background-color: #e8f5e9;
    color: #2e7d32;
}
.disconnected {
    background-color: #ffebee;
    color: #c62828;
}
.reconnecting {
    background-color: #fff8e1;
    color: #f57f17;
}

/* Collapsible section styles */
.collapsible-section {
    margin-bottom: 1rem;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.toggle-btn:hover,
.toggle-btn:focus,
.toggle-btn:active {
    background-color: transparent;
}

/* Match the h3 styles to be consistent */
#joinTeamSection h3 {
    margin-top: 1.5rem;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 2px solid #eff0f1;
    padding-bottom: 0.5rem;
    text-align: center;
}

/* Style the collapsible section header */
.collapsible-section {
    position: relative;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.collapsible-section h3 {
    margin-top: 1.5rem;
    margin-bottom: 0;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 2px solid #eff0f1;
    padding-bottom: 0.5rem;
    text-align: center;
    flex-grow: 1;
}

.toggle-indicator {
    position: absolute;
    right: 0;
    /* Adjust position to align with text */
    top: 1.1rem; /* Aligned with the text rather than the entire block */
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 25px;
    font-weight: bold;
    display: inline-block;
    padding-right: 7px;
    color: #000000;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transform: rotate(0deg); /* Start with no rotation */
    transform-origin: center center; /* Make rotations happen around the center */
}

.toggle-indicator.collapsed {
    transform: rotate(-90deg);
}

#inactiveTeams {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Player Responsibility Message Styles */
.player-responsibility-message {
    padding: 10px 15px;
    margin-bottom: 15px;
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    font-weight: 500;
    color: #2e7d32;
    text-align: center;
}
