/* Import JetBrains Mono font */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Include padding and borders in the element's total width and height */
    font-family: 'Poppins', sans-serif;
}

html {
    font-size: 16px; /* Base font size */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f4f4;
    text-align: center;
    margin: 0;
    padding: 5px;
    margin: 0;
    padding: 5px;
}

header, footer {
    background-color: #c0c0c0;
    color: #fff;
    padding: 10px 0;
    text-align: center;
}

h2, h3, h4 {
    color: #333;
    margin: 10px 0;
    padding: 10px 0;
    text-align: center;
    font-weight: 500;
}

.roster-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 20px;
    gap: 20px;
}

.roster-header-row h2 {
    flex: 1;
    text-align: left;
    margin: 0;
    padding: 0;
}

.roster-header-row button {
    flex-shrink: 0;
    margin: 0;
}

button {
    padding: 10px 15px;
    margin: 10px;
    background-color: #444;
    color: #fff;
    border: none;
    border-radius: 5px; /* Rounded corners */
    cursor: pointer;
    font-size: 1rem; /* Larger font size for readability */
    font-weight: 500;
    transition: all 0.2s ease;
}

button.warning {
    background-color: #d9534f; /* Bootstrap's button color for warning */
}

/* Selected button style */
button.selected {
    background-color: #007bff; /* A blue color to indicate selection, adjust as needed */
    color: #ffffff;
}

/* Inactive button style */
button.inactive {
    background-color: #cccccc; /* A gray color to indicate inactivity */
    color: #666666;
    cursor: not-allowed; /* Change cursor to indicate the button is inactive */
    pointer-events: none; /* Prevent clicking on the button */
}

.warning-box {
    border: 1px solid #d9534f; /* Bootstrap's warning color */
    background-color: #f2dede;
    color: #a94442;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
    border-radius: 5px;
}

.player-buttons {
    display: flex;
    flex-direction: column;
}

.player-button {
    display: block; /* Each button takes up the full width */
    width: 100%; /* Ensures the button stretches to the full width of its container */
    margin-bottom: 2vw; /* Adds a small margin between buttons */
}


table {
    border: 1px solid grey;
    margin-left: auto; 
    margin-right: auto;
    border-collapse: collapse;
    width: auto; /* Only as wide as needed */
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

/* Styling for header rows */
th {
    background-color: #f2f2f2;
}

/* Styling for team aggregate row in game summary */
.team-aggregate-row {
    border-top: 2px solid #333;
    font-weight: 600;
}

.team-total-cell {
    background-color: #e8e8e8;
    font-weight: 600;
}

/* Make sure the play container fits within the viewport width */
.play-container {
    display: flex;
    width: 100%; /* Ensures it doesn't overflow the screen */
    flex-wrap: wrap; /* Allows items to wrap onto the next line if needed */
}

/* If you have issues with the play container size, you can remove the justify-content property or set it to 'flex-start' */
.play-container {
    justify-content: flex-start; 
}

.sub-action-btn.inactive {
    background-color: #888888; /* Or any other style to indicate selection */
}

.action-buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Ensure that the player buttons and action buttons are not too wide */
.player-buttons, .action-buttons {
    flex-basis: 45%; /* Adjust this percentage so that both columns together don't exceed 100% */
    margin-right: 5%; /* Adds space between the two columns */
}

/* Adjust the width of the main action buttons to prevent overflow */
.main-action-btn {
    width: auto; /* Or specify a fixed width if preferred */
    margin-bottom: 5px;
}

.action-panel {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Creates two columns */
    grid-gap: 2px; /* Smaller gap between grid items */
    padding: 5px; /* Smaller padding for the panel */
    border: 1px solid #ccc;
    margin-bottom: 5px;
    background-color: #f8f8f8;
}

.sub-action-btn.selected {
    background-color: #2669b5; /* Or any other style to indicate selection */
}

/* Optional: You might want to adjust the font-size for smaller buttons */
.sub-action-btn {
    padding: 2px 5px; /* Smaller padding */
    margin: 2px; /* Smaller margin between buttons */
    font-size: 0.8rem; /* You can adjust the font size as needed */
    background-color: #626262;
    /* Other styles as needed */
}

/* Additional media query for very small screens, if necessary */
@media (max-width: 320px) {
    .sub-action-btn {
        font-size: 0.7rem; /* Even smaller font size for very small screens */
    }

    /* You can also adjust padding and margins for small screens */
}

/* In-game screens have a play-by-play textarea at the bottom, and need to leave space for it */
.in-game-content {
    padding-bottom: 150px; /* Adjust this value to match the height of the bottomPanel */
  }

#bottomPanel {
    position: fixed; 
    bottom: 0;
    left: 0;
    width: 100%;
    background: #f0f0f0;
    border-top: 1px solid #ccc;
    padding: 5px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    white-space: nowrap;
    gap: 10px;
}

#undoBtn {
    padding: 10px 15px;
    margin-right: 10px;
}

#audioControls {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
}

#startNarrationBtn {
    background-color: #28a745;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    white-space: nowrap;
}

#startNarrationBtn i {
    font-size: 20px;
    margin: 0;
}

#startNarrationBtn.inactive {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

#startNarrationBtn.recording {
    background-color: #dc3545;
    animation: pulse 2s infinite;
}

#audioStatus {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    color: #666;
}

#toggleEventLogBtn {
    padding: 5px 15px;
    white-space: nowrap;
    flex: 0 0 auto;
    margin-left: auto;
}

#toggleEventLogBtn.selected {
    background-color: #007bff;
    color: #ffffff;
}

#eventLog {
    display: none;
    width: 100%;
    height: 100px;
    position: absolute;
    bottom: 100%;
    left: 0;
    padding: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    background-color: white;
    resize: none;
    overflow-y: auto;
}

/* Input field styling */
input[type="text"], input[type="number"], select {
    padding: 8px;
    margin: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Fixed width for gender ratio dropdown to prevent layout shifts */
#enforceGenderRatioSelect {
    width: 280px; /* Width to accommodate "Alternating (4:3 / 3:4)" plus padding */
    min-width: 280px;
    max-width: 50%; /* Max width 50% of container for iPhone */
    border-radius: 4px;
}

ul {
    list-style-type: none;
    padding: 0;
}

/* Scrollable container for table */
#tableContainer {
    overflow-x: auto;
}

#activePlayersTable {
    border-collapse: collapse;
    width: max-content;
}

/* Roster table scrollable container */
.roster-table-container {
    overflow-x: auto;
    width: 100%;
    margin: 0 20px;
    box-sizing: border-box;
}

#rosterTable {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
}

#rosterTable th, #rosterTable td {
    border: 1px solid grey;
    padding: 5px;
    white-space: nowrap;
}

#activePlayersTable th, #activePlayersTable td {
    border: 1px solid grey;
    padding: 1vw 1vw;
}

/* Sticky column styles - positioning is handled dynamically in makeColumnsSticky() */
/* Base styles for sticky columns */
.active-checkbox-column {
    text-align: center;
    padding: 5px !important;  /* Override default td padding */
    box-sizing: border-box;  /* Include padding in width calculation */
}

/* Header cell for merged sticky columns */
.active-header-teams {
    background-color: #fafafa;
    box-sizing: border-box;
}

/* Gender-based color coding for player names */
.player-fmp,
td.player-fmp,
.active-name-column.player-fmp,
.roster-name-column.player-fmp {
    color: #7d3c98 !important; /* Darker purple for better contrast */
    font-weight: bold;
}

.player-mmp,
td.player-mmp,
.active-name-column.player-mmp,
.roster-name-column.player-mmp {
    color: #2d8659 !important; /* Darker green */
    font-weight: bold;
}

/* Gender ratio warning styling - matches player colors */
#genderRatioText.gender-ratio-fmp-warning {
    color: #7d3c98; /* Darker purple - matches FMP player color */
    font-weight: bold;
}

#genderRatioText.gender-ratio-mmp-warning {
    color: #2d8659; /* Darker green - matches MMP player color */
    font-weight: bold;
}

/* Make gender ratio text look clickable when editable */
#genderRatioText.gender-ratio-editable {
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
}

/* Score cell coloring for alternating gender ratio games */
.score-cell-fmp {
    background-color: rgba(125, 60, 152, 0.2); /* Light darker purple background */
    color: #000; /* Black text for better contrast */
    font-weight: bold;
}

.score-cell-mmp {
    background-color: rgba(45, 134, 89, 0.2); /* Light darker green background */
    color: #000; /* Black text for better contrast */
    font-weight: bold;
}

/* Starting Gender Ratio Selection - Prominent styling for first point */
#startingGenderRatioSelection {
    font-size: 1.2rem;
    font-weight: bold;
    color: #dc3545; /* Bright warning red */
    text-align: center;
}

#startingGenderRatioSelection > label:first-of-type {
    font-weight: bold;
    color: #dc3545; /* Bright warning red */
    font-size: 1.2rem;
    margin-right: 0.75rem;
}

#startingGenderRatioSelection label[for="startingRatioFMP"],
#startingGenderRatioSelection label[for="startingRatioMMP"] {
    font-weight: bold;
    color: #dc3545; /* Bright warning red */
    font-size: 1.2rem;
    margin: 0 0.5rem;
    cursor: pointer;
}

#startingGenderRatioSelection input[type="radio"] {
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: #dc3545; /* Bright warning red for radio button */
}

.active-time-column {
    left: 140px; /* this will be overwritten dynamically to width of left 2 columns */
    font-style: italic;
}

/* fix width of point columns */
.active-points-columns {
    width: 3vw;        /* Or you can adjust this value as per your needs */
    overflow: hidden;
    text-align: left;
    background-color: #fafafa;

    border: 1px solid grey;
}

/* styles for the names, time, and points-played columns */
.roster-name-column {
    text-align: left;
    /* border: 1px solid grey; */
    border-right: none;
}

.roster-points-column,
.roster-time-column,
.roster-goals-column,
.roster-assists-column,
.roster-plusminus-column,
.roster-plusminus-per-point-column {
    text-align: center;
    padding: 5px;
}

.roster-time-column {
    font-style: italic;
}

.roster-plusminus-column,
.roster-plusminus-per-point-column {
    font-family: monospace;
    text-align: right;
}

/* Responsive button sizes */
@media (max-width: 600px) {
    button {
        padding: 12px 18px;
        font-size: 1.2rem;
    }

    input[type="text"], input[type="number"] {
        padding: 10px;
        font-size: 1rem;
    }
}

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top of everything */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}


.team-selection-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

.team-row {
    border-bottom: 1px solid #ddd;
}

.team-name {
    font-weight: bold;
    padding: 1em;
    cursor: pointer;
}


.games-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.games-list li {
    padding: 0.5em 1em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2em 0.4em;
    font-size: 1em;
}

.audio-level-indicator {
    width: 50px;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.level-bar {
    width: 0%;
    height: 100%;
    background: #28a745;
    transition: width 0.1s ease;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.unknown-player {
    background-color: #d0d0d0;
    border: 2px dashed #999;
    font-style: italic;
}

.countdown-timer {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: monospace;
}

.timer-label {
    font-size: 0.8em;
    color: white;
    margin-bottom: 2px;
}

#timerDisplay {
    font-size: 1.2em;
    font-weight: bold;
}

.timer-normal { color: #007bff; }  /* Bootstrap blue */
.timer-warning { color: #ffc107; } /* Bootstrap yellow */
.timer-danger { color: #dc3545; }  /* Bootstrap red */

/* Delete Line Dialog Styles */
.delete-line-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.delete-line-dialog {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
}

.delete-line-dialog h3 {
    margin-top: 0;
}

.delete-line-radio-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.delete-line-radio-option {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.delete-line-radio-option input {
    margin-right: 10px;
    margin-top: 3px;
}

.delete-line-radio-option label {
    text-align: left;
    flex: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
}

.line-name {
    font-weight: bold;
    white-space: nowrap;
}

.line-players {
    color: #666;
}

.delete-line-button.delete:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.delete-line-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.delete-line-button {
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.delete-line-button.delete {
    background-color: #dc3545;
}

.delete-line-button.cancel {
    background-color: #6c757d;
}

/* Line Selection Dialog Styles */
.select-line-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.select-line-dialog {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
}

.select-line-dialog h3 {
    margin-top: 0;
}

.clear-selections-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.clear-selections-checkbox-container input[type="checkbox"] {
    margin: 0;
}

.clear-selections-checkbox-container label {
    margin: 0;
    font-size: 0.9em;
    color: #495057;
    cursor: pointer;
}

.select-line-radio-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.select-line-radio-option {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.select-line-radio-option input {
    margin-right: 10px;
    margin-top: 3px;
}

.select-line-radio-option label {
    text-align: left;
    flex: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
}

.select-line-radio-option.last-used {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding-left: 6px;
}

.select-line-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.select-line-button {
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.select-line-button.select {
    background-color: #28a745;
}

.select-line-button.cancel {
    background-color: #6c757d;
}

.select-line-button.select:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Management Container Styles */
.management-row {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    padding: 0 4px;
    max-width: 100%;
}

.management-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f8f8f8;
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    min-width: 0;
}

.management-container.full-width {
    flex: 1 1 100%;
    width: 100%;
}

.management-label {
    font-weight: bold;
    margin-bottom: 4px;
    text-align: left;
    font-size: 0.9em;
}

.management-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

.management-controls input[type="text"] {
    flex: 1;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9em;
    min-width: 0;
}

.management-controls input[type="number"].player-number-input {
    width: 50px;
    flex: 0 0 50px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9em;
    text-align: center;
}

.management-icons {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* Management icon button styles */
.management-icons .icon-button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.management-icons .icon-button i {
    font-size: 12px;
}

/* Gender button styles - bigger with gender colors */
.management-icons .gender-button {
    width: 60px;
    height: 36px;
    padding: 4px 8px;
    font-size: 0.95em;
    font-weight: bold;
    border: 2px solid;
    transition: all 0.2s;
}

.management-icons .gender-button.fmp-button {
    background-color: #e8d5f2; /* Light purple background */
    color: #7d3c98; /* Darker purple text - matches FMP player color */
    border-color: #7d3c98;
}

.management-icons .gender-button.fmp-button:hover {
    background-color: #d4b5e5;
}

.management-icons .gender-button.mmp-button {
    background-color: #d4e8dd; /* Light green background */
    color: #2d8659; /* Darker green text - matches MMP player color */
    border-color: #2d8659;
}

.management-icons .gender-button.mmp-button:hover {
    background-color: #b8dcc8;
}

/* Specific management icon button styles - gender buttons use .gender-button classes above */

.management-icons .add-line-button {
    color: #28a745;
}

/* Delete Line Dialog Button Styles */
.delete-line-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: white;
}

.delete-line-button.delete {
    background-color: #dc3545;
}

.delete-line-button.delete:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.delete-line-button.cancel {
    background-color: #6c757d;
}

/* Games list icon button styles */
.games-list .icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2em 0.4em;
    font-size: 1em;
}

.top-buttons {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 20px;
}

.top-buttons button {
    padding: 10px 20px;
}

/* Simple Mode Styles */
.simple-mode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
}

.large-action-btn {
    width: 80%;
    max-width: 400px;
    padding: 2rem;
    font-size: 2rem;
    border-radius: 1rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}


#theyScoreBtn {
    background-color: #f44336;
}


/* Score Attribution Dialog Styles */
.dialog-header {
    position: relative;
    margin-bottom: 0.5rem;
    padding: 0;
}

.dialog-header .close {
    position: absolute;
    right: 0;
    top: 0;
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

/* Prominent Dialog Header Style - Applied to all dialogs */
.prominent-dialog-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #E19049;
}

.prominent-dialog-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #E19049;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.prominent-dialog-header .close {
    top: 0;
    right: 0;
}


.score-attribution-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.score-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0; /* Allow columns to shrink below content size */
}

.score-column-header {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-align: center;
    width: 100%;
}

.player-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.player-button {
    padding: 0.7rem 0.3rem;
    margin: 0.3rem 0;
    border-radius: 5px;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 2.5rem;
}

/* Modal Styles for Score Attribution */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 1rem 1rem;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 0.5rem;
    position: relative;
}

.callahan-separator {
    width: 100%;
    margin: 0.5rem 0;
    border: 1px solid #ccc;
}

.score-attribution-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.special-action-btn, .secondary-action-btn {
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
    min-width: 80px;
}

/* Throw flags checkboxes */
.throw-flags-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin: 1rem 0;
    padding: 0.5rem;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.throw-flag-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.throw-flag-checkbox input[type="checkbox"] {
    margin-right: 0.4rem;
    cursor: pointer;
}

/* Responsive break after sky on smaller screens */
@media (max-width: 480px) {
    .throw-flags-container {
        gap: 0.6rem;
    }
    
    .throw-flag-checkbox {
        font-size: 0.8rem;
    }
    
    /* Break to two rows after sky */
    .throw-flag-checkbox:nth-child(n+4) {
        flex-basis: 100%;
        justify-content: center;
        margin-top: 0.2rem;
    }
}

/* Responsive adjustments for very small screens */
@media (max-width: 360px) {
    .modal-content {
        padding: 0.5rem;
        width: 95%;
    }
    
    .player-button {
        padding: 0.5rem 0.2rem;
        font-size: 0.8rem;
        min-height: 2rem;
    }
    
    .special-action-btn, .secondary-action-btn {
        padding: 0.5rem;
        font-size: 0.9rem;
        min-width: 70px;
    }
    
    .score-attribution-container {
        gap: 0.5rem;
    }
    
    .score-column-header {
        font-size: 1rem;
    }
}

/* Key Play Dialog Styles */
.key-play-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.key-play-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0; /* Allow columns to shrink below content size */
}

.key-play-header {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-align: center;
    width: 100%;
    cursor: pointer;
    transition: color 0.3s;
}


.key-play-panels {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1rem;
}

.key-play-panel {
    border: 3px solid #000;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    overflow: visible;
    position: relative;
    margin-top: 1rem;
}

.key-play-panel-header {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 0 0.75rem;
    font-weight: bold;
    font-size: 1.1rem;
    color: #000;
    z-index: 1;
}

.key-play-sub-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.1rem 0.2rem;
    padding: 0.6rem 0.3rem 0.3rem 0.3rem;
    transition: height 0.15s ease-out, opacity 0.1s ease-out;
    overflow: hidden;
}

.key-play-sub-btn {
    padding: 0.2rem 0.4rem;
    border: 1px solid #000;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    color: #000;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px !important;
    position: relative;
    z-index: 2;
}

.key-play-sub-btn.full-width {
    grid-column: 1 / -1;
}


.key-play-sub-btn.selected {
    background-color: #0066cc;
    color: white;
    border-color: #0066cc;
}

/* Responsive adjustments for Key Play dialog */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .key-play-container {
        gap: 0.5rem;
    }
    
    .key-play-header {
        font-size: 1rem;
    }
    
    .key-play-panels {
        gap: 0.5rem;
    }
    
    .key-play-panel-header {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
    
    .key-play-sub-buttons {
        padding: 0.5rem 0.3rem 0.3rem 0.3rem;
        gap: 0.1rem 0.15rem;
    }
    
    .key-play-sub-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
        min-height: 1.6rem;
        margin: 1px !important;
    }
}

@media (max-width: 360px) {
    .key-play-sub-buttons {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
    
    .key-play-sub-btn {
        padding: 0.15rem 0.3rem;
        font-size: 0.75rem;
        min-height: 1.4rem;
        margin: 1px !important;
    }
}

/* Pull Dialog Styles - Uses prominent-dialog-header class */

.pull-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
    margin: 1rem 0;
}

.pull-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.pull-quality-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
}

.pull-quality-btn {
    padding: 0.7rem;
    border: 2px solid #000;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    color: #000;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.pull-quality-btn:hover {
    background-color: #e9ecef;
}

.pull-quality-btn.selected {
    background-color: #0066cc;
    color: white;
    border-color: #0066cc;
}

.pull-checkboxes {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.pull-checkboxes label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.pull-checkboxes input[type="checkbox"] {
    margin-right: 0.4rem;
    cursor: pointer;
}

.pull-dialog-buttons {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.pull-proceed-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 0.5rem;
    background-color: #28a745;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pull-proceed-btn:hover:not(:disabled) {
    background-color: #218838;
}

.pull-proceed-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.pull-proceed-btn.warning {
    background-color: #ff8800;
}

.pull-proceed-btn.warning:hover {
    background-color: #ff7700;
}

#pullGenderSelection {
    margin: 1rem 0;
    text-align: center;
}

#pullGenderSelection label {
    margin: 0 0.5rem;
    cursor: pointer;
}

#pullGenderSelection input[type="radio"] {
    margin-right: 0.3rem;
    cursor: pointer;
}

.player-button.ineligible-puller {
    background-color: #a0a0a0; /* Medium grey - different from eligible players but not as light as disabled */
    opacity: 1;
}

/* Selected ineligible player button - show selected style with warning orange */
.player-button.selected.ineligible-puller {
    background-color: #ff8800 !important; /* Full warning orange - matches Proceed button warning style */
    opacity: 1 !important; /* Full opacity for selected style */
    border: 2px solid #007bff !important; /* Add blue border to show selected state */
    color: #fff !important; /* White text for contrast on orange background */
}

/* Edit Player Dialog Styles */
.edit-player-modal-content {
    max-width: 400px;
    width: 90%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.edit-player-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.edit-player-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.edit-player-field label {
    font-weight: bold;
    font-size: 1rem;
}

.edit-player-gender-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.edit-player-gender-field label {
    margin: 0;
    min-width: fit-content;
}

.edit-player-input {
    padding: 0.7rem;
    border: 2px solid #ccc;
    border-radius: 0.5rem;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.edit-player-input:focus {
    outline: none;
    border-color: #E19049;
}

.edit-player-gender-field .gender-button {
    width: 80px;
    height: 40px;
    padding: 4px 8px;
    font-size: 1em;
    font-weight: bold;
    border: 2px solid;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    flex-shrink: 0;
}

.edit-player-gender-field .gender-button.fmp-button {
    background-color: #e8d5f2;
    color: #7d3c98;
    border-color: #7d3c98;
}

.edit-player-gender-field .gender-button.fmp-button.selected {
    background-color: #7d3c98;
    color: white;
    border-color: #7d3c98;
}

.edit-player-gender-field .gender-button.mmp-button {
    background-color: #d4e8dd;
    color: #2d8659;
    border-color: #2d8659;
}

.edit-player-gender-field .gender-button.mmp-button.selected {
    background-color: #2d8659;
    color: white;
    border-color: #2d8659;
}

.edit-player-dialog-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.edit-player-dialog-buttons-right {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.edit-player-cancel-btn,
.edit-player-confirm-btn,
.edit-player-delete-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    flex: 0 0 auto;
    min-width: 0;
    box-sizing: border-box;
}

.edit-player-delete-btn {
    width: 100%;
}

.edit-player-dialog-buttons-right .edit-player-cancel-btn,
.edit-player-dialog-buttons-right .edit-player-confirm-btn {
    flex: 1 1 auto;
    min-width: 100px;
    max-width: calc(50% - 0.5rem);
}

.edit-player-cancel-btn {
    background-color: #6c757d;
    color: white;
}

.edit-player-confirm-btn {
    background-color: #28a745;
    color: white;
}

.edit-player-confirm-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.edit-player-delete-btn {
    background-color: #dc3545;
    color: white;
}

/* Make roster name cells clickable */
.roster-name-column {
    cursor: pointer;
    user-select: none;
}

@media (max-width: 480px) {
    .pull-container {
        gap: 0.5rem;
    }
    
    .prominent-dialog-header h2 {
        font-size: 1.5rem;
    }
    
    .pull-quality-btn {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .pull-checkboxes {
        gap: 0.5rem;
    }
}

/* Header styles */
header {
    background-color: #E19049;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    position: relative;
    min-height: 70px; /* Ensure consistent height in both modes */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent elements from overflowing */
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    width: 100%; /* Ensure content spans full width */
    height: auto; /* Allow height to adjust for feedback text */
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    flex-shrink: 0;
    transition: transform 0.5s ease, position 0.5s ease;
    flex-direction: column;
}

.logo-container a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.feedback-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    transition: color 0.2s ease;
}


/* Remove hover transition */
.logo-container img {
    transition: none;
    border-radius: 4px; /* Add slight rounded corners for better appearance */
    height: 40px;
    width: auto; /* Allow width to adjust to maintain aspect ratio */
    max-width: none; /* Ensure the logo can expand to its natural ratio */
}


/* Title styling with transition */
header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    transition: opacity 0.4s ease, transform 0.4s ease;
    margin-left: 1rem;
    line-height: 50px; /* Match the new header height */
    white-space: nowrap; /* Prevent wrapping */
}

/* Header states */
.header-full .logo-container {
    position: relative;
    left: 0;
    margin-right: 0; /* Remove any margin that might affect centering */
}

.header-compact .logo-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.header-compact h1 {
    opacity: 0;
    transform: translateY(-10px);
    position: absolute;
    pointer-events: none;
}

/* Simple Mode Toggle Styles */
.simple-mode-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.3s ease;
}

.simple-mode-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

.toggle-label {
    font-size: 0.7rem;
    color: #fff;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Make sure the timer text itself uses JetBrains Mono */
#pointTimer {
    font-family: 'JetBrains Mono', monospace !important;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Add back specific button styles */
.special-action-btn {
    background-color: #ff9800;
    color: white;
}


.special-action-btn.inactive,
.special-action-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

.secondary-action-btn {
    background-color: #0066cc;
    color: white;
}


/* Point clock container styles */
.point-clock-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 80%;
    max-width: 400px;
    background-color: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 1rem;
    padding: 1rem;
    margin: 2rem auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.point-clock {
    flex: 1;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    margin-right: 1rem;
    min-width: 100px;
    width: 100px;
    display: inline-block;
    letter-spacing: -0.5px;
}

.pause-resume-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #0066cc;
    border: none;
    cursor: pointer;
    padding: 1rem;
    color: white;
    border-radius: 0.5rem;
    min-width: 100px;
    transition: background-color 0.2s;
}


.pause-resume-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.pause-resume-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Update simple mode container spacing */
.simple-mode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
}

/* When in full mode, make sure we have enough space for both title and logo */
.header-full .header-content {
    justify-content: center;
    min-width: 180px; /* Ensure enough space for title and logo */
}

/* Next Line Selection Mode Styles */
.next-line-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #E19049;
    color: white;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.next-line-controls {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 5px;
    gap: 10px;
}

.mini-action-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 4px;
    background-color: #444;
    color: white;
    border: none;
    margin: 0;
}

#weScoreBtnMini {
    background-color: #4CAF50;
}

#theyScoreBtnMini {
    background-color: #f44336;
}

.mini-point-clock {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #333;
    min-width: 70px;
    text-align: center;
}

.swipe-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 5px;
}

.swipe-line {
    width: 40px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    margin: 2px 0;
}

/* Choose next line button styling */
#chooseNextLineBtn {
    width: 80%;
    max-width: 400px;
    margin-top: 10px;
    background-color: #0066cc;
    color: white;
}

/* Styles for next line selection mode */
body.next-line-mode .simple-mode-content {
    display: none;
}

body.next-line-mode #beforePointScreen {
    padding-top: 70px; /* Make room for the fixed header */
    display: block !important;
}

body.next-line-mode .beforepoint-controls,
body.next-line-mode #gameEvents {
    display: none;
}

body.next-line-mode #startPointBtn {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

body.next-line-mode #simpleModeScreen {
    display: block !important;
}

body.next-line-mode header {
    display: none;
}

body.next-line-mode #bottomPanel {
    display: none !important;
}

/* Ensure the table containers are visible and responsive in next line mode */
body.next-line-mode #selectCurrentPlayers {
    height: calc(100vh - 75px); /* Give it almost the full viewport height */
    overflow-y: auto;
}

body.next-line-mode h3,
body.next-line-mode .top-buttons {
    margin-top: 10px;
    padding-top: 0;
}

body.next-line-mode #tableContainer {
    height: calc(100vh - 150px);
    overflow-y: auto;
}

/* Make sure the simple-mode-content is visible by default */
.simple-mode-content {
    display: block;
}

/* Ensure good spacing of simple mode elements */
.simple-mode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

/* Styling for active player times in next line mode */
.active-player-time {
    color: #007bff;
}

/* Make the mini point clock stand out a bit more */
.mini-point-clock {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background-color: white;
    min-width: 80px;
    padding: 6px 10px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Select Next Line button styling */
#selectNextLineBtn {
    background-color: #444;
    color: #fff;
}

#selectNextLineBtn.warning {
    background-color: #d9534f;
}

/* Show/hide buttons in next-line-mode */
body.next-line-mode #startPointBtn {
    display: none !important;
}

body.next-line-mode #selectNextLineBtn {
    display: block !important;
}

/* =============================================================================
   Sync Status Bar (Phase 4)
   ============================================================================= */

.sync-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.sync-status-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sync-status-icon {
    font-size: 1.2rem;
}

.sync-status-text {
    font-weight: 500;
    color: #495057;
}

.pending-badge {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pendingPulse 2s infinite;
}

@keyframes pendingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.synced-badge {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sync-status-actions {
    display: flex;
    gap: 8px;
}

.sync-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    margin: 0;
}

.sync-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
}

.sync-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.sync-btn i {
    font-size: 0.9rem;
}

.fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Local-only entity indicator */
.local-only-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.local-only-indicator::before {
    content: '⏳';
}

/* Player ID display in edit dialog */
.edit-player-id-field {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 10px;
}

.player-id-code {
    font-family: 'JetBrains Mono', monospace;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
    color: #495057;
    user-select: all;
}