/* =============================================================================
   LAST MAN STANDING - MAIN STYLESHEET
   ============================================================================= */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

#deadline-container {
    margin: 1rem 0;
    font-size: 1.1rem;
}

#deadline-countdown {
    font-weight: bold;
    color: #ffd700;
    margin-top: 0.5rem;
}

.nav-links {
    margin-top: 1.5rem;
}

.nav-links a, .btn {
    display: inline-block;
    margin: 0 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.3);
}

.nav-links a:hover, .btn:hover {
    background-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Section Styles */
section {
    background: white;
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

section h3 {
    color: #555;
    margin: 1rem 0 0.5rem 0;
    font-size: 1.3rem;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Fixtures Styles */
.fixtures-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

/* Fixture Results Table */
.fixtures-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fixtures-table th,
.fixtures-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.fixtures-table th {
    background-color: #667eea;
    color: white;
    font-weight: 600;
}

.fixtures-table tr:hover {
    background-color: #f5f5f5;
}

.score-input {
    width: 60px;
    padding: 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
}

.score-input:focus {
    outline: none;
    border-color: #667eea;
}

.fixture-status {
    font-weight: 500;
}

.status-pending {
    color: #ffc107;
    font-weight: bold;
}

.status-completed {
    color: #28a745;
    font-weight: bold;
}

.fixture-controls {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-save-score {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.btn-save-score:hover {
    background-color: #218838;
}

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

.btn-save-score.saved {
    background-color: #17a2b8;
}

.btn-save-score.saved:hover {
    background-color: #138496;
}

.fixture {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: grid;
    grid-template-columns: 80px 1fr 60px 1fr;
    align-items: center;
    gap: 1rem;
    min-height: 60px;
}

.fixture .time {
    font-weight: bold;
    color: #667eea;
    font-size: 1rem;
    text-align: center;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem;
    border-radius: 6px;
}

.fixture .team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 40px;
}

.fixture .home-team {
    justify-content: flex-end;
    text-align: right;
}

.fixture .away-team {
    justify-content: flex-start;
    text-align: left;
}

.fixture .team span {
    font-weight: 500;
    color: #333;
    font-size: 1rem;
    line-height: 1.2;
    min-width: 0; /* Allow text to wrap if needed */
}

.fixture .vs {
    font-weight: bold;
    color: #999;
    text-align: center;
    font-size: 0.9rem;
    background: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.team-logo-small {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Fixture hover effect */
.fixture:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

/* Day headers for fixtures */
.fixtures-day-header {
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Standings Table */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.standings-table th,
.standings-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.standings-table th {
    background-color: #667eea;
    color: white;
    font-weight: 600;
}

.standings-table tr:hover {
    background-color: #f5f5f5;
}

.standings-table tr.shaded {
    background-color: #f9f9f9;
}

.team-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-initials {
    font-weight: bold;
}

.form {
    display: flex;
    gap: 2px;
}

.form-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    margin: 0 1px;
    font-weight: bold;
    color: white;
    border-radius: 3px;
    font-size: 0.8rem;
}

.form-box.W { background-color: #28a745; }
.form-box.D { background-color: #6c757d; }
.form-box.L { background-color: #dc3545; }
.form-box.F { background-color: #e9ecef; color: #6c757d; }

/* Selection Interface */
#selection-container {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
}

.selection-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.gameweek-indicator {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.gameweek-indicator strong {
    color: #667eea;
}

#selection-container select, #selection-container button {
    padding: 0.75rem;
    margin: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

#selection-container select {
    min-width: 200px;
}

#confirmSelection {
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#confirmSelection:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

#confirmSelection:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Entry advancement status styles */
#entry-select option[disabled] {
    color: #dc3545 !important;
    font-style: italic !important;
}

#team-select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.entry-not-advanced {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 4px;
}

.entry-not-advanced p {
    margin: 0;
    color: #856404;
    font-weight: 500;
}

/* Current Selections Table */
#selections-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#selections-table th,
#selections-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#selections-table th {
    background-color: #495057;
    color: white;
}

#selections-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Group Picks Table */
#group-picks-container {
    max-width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#group-picks-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

#group-picks-table th,
#group-picks-table td {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid #ddd;
    white-space: nowrap;
}

#group-picks-table th {
    background-color: #667eea;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

#group-picks-table th:first-child,
#group-picks-table td:first-child {
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 5;
    border-right: 2px solid #667eea;
}

#group-picks-table th:first-child {
    background-color: #667eea;
    z-index: 15;
}

.pick-cell {
    font-weight: 500;
}

.temporary-selection {
    background-color: #fff3cd !important;
    font-style: italic;
}

/* Team Result Indicators */
.pick-cell.result-win {
    background-color: #d4edda !important;
    color: #155724;
    font-weight: bold;
}

.pick-cell.result-loss {
    background-color: #f8d7da !important;
    color: #721c24;
    font-weight: bold;
}

.pick-cell.result-draw {
    background-color: #f8d7da !important;
    color: #721c24;
    font-weight: bold;
}

.pick-cell.result-pending {
    background-color: #e2e3e5 !important;
    color: #383d41;
}

/* User's own entries highlighting */
.user-entry {
    background-color: #e8f4fd !important;
    border-left: 4px solid #667eea;
}

.user-indicator {
    color: #667eea;
    font-weight: bold;
    font-size: 0.9em;
}

/* Disabled team options */
select option:disabled {
    color: #999;
    background-color: #f5f5f5;
}

/* Scrollable Containers */
.scrollable-table {
    overflow-x: auto;
    max-width: 100%;
    border-radius: 8px;
}

#fixtures-container,
#standings-container,
#score-predictions-container {
    max-height: 400px;
    overflow-y: auto;
}

.score-predictions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.score-prediction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.prediction-inputs input {
    width: 3rem;
    text-align: center;
    padding: 0.25rem;
}

#saveScorePredictions {
    margin-top: 0.75rem;
}

#prediction-points-section {
    margin-top: 1.5rem;
}

.prize-breakdown-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.prize-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.prize-breakdown-grid .label {
    display: block;
    font-size: 0.85rem;
    color: #666;
}

.setting-item-wide {
    grid-column: 1 / -1;
}

.website-fee-input {
    width: 5rem;
    padding: 0.25rem 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 0 0.5rem;
    }
    
    section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .fixtures-grid {
        grid-template-columns: 1fr;
    }
    
    .fixture {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .fixture .home-team,
    .fixture .away-team {
        justify-content: center;
        text-align: center;
    }
    
    .fixture .time {
        order: -1;
        margin-bottom: 0.5rem;
    }
    
    #selection-container select,
    #selection-container button {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    .standings-table,
    #selections-table,
    #group-picks-table {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 0;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    section h2 {
        font-size: 1.4rem;
    }
    
    .nav-links a, .btn {
        display: block;
        margin: 0.25rem 0;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Global Admin Styles */
.global-admin-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.test-environment-notice {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
    margin-bottom: 1.5rem;
}

.testing-stats {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.testing-buttons {
    margin: 1.5rem 0;
}

.help-text {
    font-size: 0.9rem;
    color: #666;
    margin: 0.5rem 0;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.season-controls {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.deadline-options {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.deadline-options h4 {
    margin: 1rem 0 0.5rem 0;
    color: #495057;
}

.deadline-options select {
    padding: 0.5rem;
    margin: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    min-width: 200px;
}

/* Instance Management Styles */
.instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.instance-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.instance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.instance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.instance-header h4 {
    margin: 0;
    color: #495057;
    font-size: 1.3rem;
}

.instance-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.instance-status.active {
    background-color: #d4edda;
    color: #155724;
}

.instance-status.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.instance-stats {
    margin: 1rem 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0;
    padding: 0.25rem 0;
}

.stat-label {
    font-weight: 500;
    color: #6c757d;
}

.stat-value {
    font-weight: 600;
    color: #495057;
}

.remaining-count {
    color: #28a745;
}

.eliminated-count {
    color: #dc3545;
}

.instance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 4px;
}

.btn-success {
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Modal Styles */
.modal-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;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #495057;
}

.modal-body {
    padding: 1.5rem;
}

.instance-summary {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.instance-summary p {
    margin: 0.5rem 0;
}

.entries-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.entries-table th,
.entries-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.entries-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.entries-table tr.eliminated {
    background-color: #f8d7da;
}

.entries-table tr.active {
    background-color: #d4edda;
}

.selections-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.groups-list {
    list-style: none;
    padding: 0;
}

.group-item {
    background: white;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 5px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-stats {
    color: #666;
    font-size: 0.9rem;
}

/* Instance Admin Dashboard Styles */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    text-align: center;
}

.admin-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.admin-info p {
    margin: 0;
    opacity: 0.9;
}

.instance-stats-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #667eea;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-number.approved {
    color: #28a745;
}

.stat-number.pending {
    color: #ffc107;
}

.stat-number.active {
    color: #17a2b8;
}

.competition-settings {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.setting-item input,
.setting-item select {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: #667eea;
}

.setting-item input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

#pending-entries-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pending-entry-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
}

.entry-details h4 {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.entry-details p {
    margin: 0.25rem 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.entry-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-approve {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-approve:hover {
    background-color: #218838;
}

.btn-reject {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-reject:hover {
    background-color: #c82333;
}

#nominate-admin-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-nomination .form-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0;
}

.admin-nomination input[type="email"] {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
}

.help-text {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
    margin: 1rem 0;
    font-size: 0.9rem;
}

#current-admins {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admins-list {
    margin-top: 1rem;
}

.admin-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-item.primary {
    border-left: 4px solid #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.admin-role {
    font-weight: bold;
    color: #667eea;
}

.admin-details {
    color: #495057;
}

.btn-primary {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #5a6fd8;
}

.btn-success {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.btn-success:hover {
    background-color: #218838;
}

#admin-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
    display: none;
}

#admin-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#admin-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.no-pending-entries {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* =============================================================================
   HOME PAGE — minimalist refresh (scoped to .home-page)
   ============================================================================= */

.home-page {
    background-color: #f5f6f8;
    color: #1e293b;
}

.home-page header.home-header {
    background: #0f172a;
    color: #f8fafc;
    padding: 0;
    text-align: left;
    box-shadow: none;
    border-bottom: 1px solid #1e293b;
}

.home-header__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 1rem 1rem;
}

.home-header__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.home-header__eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin: 0 0 0.25rem;
}

.home-header__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.home-header__user {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0.25rem 0 0;
}

.home-header__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.home-deadline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.home-deadline__text {
    margin: 0;
    font-size: 0.9375rem;
    color: #cbd5e1;
}

.home-deadline__countdown {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    width: 100%;
}

.home-prize-banner {
    margin-top: 1rem;
    padding: 0.625rem 0.875rem;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 6px;
    font-size: 0.875rem;
    color: #e2e8f0;
}

.home-prize-banner p {
    margin: 0;
}

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pill--open {
    background: #dcfce7;
    color: #166534;
}

.status-pill--locked {
    background: #fee2e2;
    color: #991b1b;
}

.home-header .status-pill--open {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.home-header .status-pill--locked {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.home-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}

.home-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.home-alert--warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.home-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.home-panel__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-weight: 500;
}

.home-panel__summary::-webkit-details-marker {
    display: none;
}

.home-panel__summary::after {
    content: '';
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-left: auto;
}

.home-panel[open] > .home-panel__summary::after {
    transform: rotate(-135deg);
    margin-top: 0.25rem;
}

.home-panel__summary:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.home-panel__title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.home-panel__hint {
    font-size: 0.8125rem;
    color: #64748b;
    margin-right: 0.5rem;
}

.home-panel__body {
    padding: 0 1rem 1rem;
    border-top: 1px solid #f1f5f9;
}

.home-panel__body--scroll {
    max-height: 420px;
    overflow-y: auto;
}

.home-panel__intro {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0.75rem 0 1rem;
    line-height: 1.5;
}

.home-subsection {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
}

.home-subsection__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.home-empty {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0.75rem 0;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.home-btn--ghost {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid #334155;
}

.home-btn--ghost:hover {
    background: #1e293b;
    transform: none;
}

.home-btn--primary {
    background: #2563eb;
    color: #fff;
    margin-top: 0.75rem;
}

.home-btn--primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: none;
}

.home-btn--primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.8;
}

.home-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.selection-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

.selection-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #475569;
}

.selection-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
}

.field-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
}

.field-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field-select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.home-feedback {
    min-height: 1.25rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.home-feedback--success {
    color: #166534;
}

.home-feedback--error {
    color: #991b1b;
}

.prediction-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.prediction-toolbar .field-select {
    min-width: 180px;
}

.prediction-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.home-page .score-input:disabled {
    background: #f8fafc;
    color: #334155;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.home-page .score-predictions-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0.5rem;
}

.home-page .score-prediction-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.home-page .prediction-side {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.home-page .prediction-side--home {
    justify-content: flex-end;
}

.home-page .prediction-side--away {
    justify-content: flex-start;
}

.home-page .prediction-club-logo {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

.home-page .prediction-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 4rem;
}

.home-page .prediction-vs {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.home-page .prediction-team-names {
    font-size: 0.6875rem;
    color: #94a3b8;
    text-align: center;
    max-width: 9rem;
    line-height: 1.2;
}

.home-page .prediction-purpose {
    line-height: 1.55;
}

.home-page .score-input {
    width: 2.75rem;
    padding: 0.5rem 0.25rem;
    font-size: 1rem;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.home-page .score-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.home-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.home-table th,
.home-table td {
    padding: 0.5rem 0.625rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.home-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.home-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.home-page .fixture--compact {
    background: #f8fafc;
    border-left: 3px solid #2563eb;
    box-shadow: none;
    transform: none;
}

.home-page .fixture--compact:hover {
    transform: none;
    box-shadow: none;
}

.home-page .form-box {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    line-height: 1.25rem;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 3px;
    margin: 0 1px;
    color: #fff;
}

.home-page .form-box.W { background-color: #16a34a; }
.home-page .form-box.D { background-color: #64748b; }
.home-page .form-box.L { background-color: #dc2626; }

.home-page .temporary-selection {
    background-color: #fef9c3;
}

.home-page .user-entry {
    background-color: #eff6ff !important;
    border-left: 3px solid #2563eb;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .selection-fields {
        grid-template-columns: 1fr;
    }

    .home-header__top {
        flex-direction: column;
    }

    .home-page .score-prediction-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }

    .home-page .prediction-side--home,
    .home-page .prediction-side--away {
        justify-content: center;
    }
}

/* =============================================================================
   APP SHELL, FOOTER, RESPONSIVE POLISH, ADMIN THEME
   ============================================================================= */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-main {
    flex: 1;
}

.site-footer {
    background: #0f172a;
    color: #94a3b8;
    border-top: 1px solid #1e293b;
    margin-top: auto;
}

.site-footer__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
    font-size: 0.875rem;
}

.site-footer__contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
}

.site-footer__label {
    font-weight: 600;
    color: #cbd5e1;
}

.site-footer a {
    color: #93c5fd;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.site-footer__sep {
    color: #475569;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    justify-content: center;
}

.site-footer__copy {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.landing-page .site-footer {
    width: 100%;
}

@media (min-width: 768px) {
    .site-footer__inner {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        text-align: left;
    }

    .site-footer__copy {
        width: 100%;
        text-align: center;
    }
}

/* Home page — extended responsive */
@media (max-width: 768px) {
    .home-page .home-header__nav {
        width: 100%;
    }

    .home-page .home-header__nav .home-btn {
        flex: 1;
        min-width: 0;
        text-align: center;
        padding: 0.625rem 0.75rem;
    }

    .home-page .home-deadline {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-page .prediction-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .home-page .prediction-toolbar .field-select,
    .home-page .prediction-toolbar .home-btn {
        width: 100%;
    }

    .home-page .prediction-form-actions {
        flex-direction: column;
    }

    .home-page .prediction-form-actions .home-btn {
        width: 100%;
    }

    .home-page .selection-card .home-btn--primary {
        width: 100%;
    }

    .home-page .home-panel__body--scroll {
        max-height: 320px;
    }

    .home-page .fixture.fixture--compact {
        display: grid;
        grid-template-columns: 3.5rem 1fr auto 1fr;
        align-items: center;
        gap: 0.5rem;
        text-align: left;
        padding: 0.625rem 0;
    }

    .home-page .fixture.fixture--compact .time {
        order: unset;
        font-size: 0.8125rem;
        color: #64748b;
    }

    .home-page .fixture.fixture--compact .vs {
        font-size: 0.75rem;
        color: #94a3b8;
    }

    .home-page .fixture.fixture--compact .team {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.8125rem;
    }

    .home-page .home-table th,
    .home-page .home-table td {
        padding: 0.45rem 0.5rem;
        font-size: 0.8125rem;
    }

    .home-page .home-table-scroll {
        margin: 0 -0.25rem;
        padding-bottom: 0.25rem;
    }

    .home-page #group-picks-table th:first-child,
    .home-page #group-picks-table td:first-child,
    .home-page #selections-table th:first-child,
    .home-page #selections-table td:first-child {
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 1;
    }

    .home-page #group-picks-table th:first-child,
    .home-page #selections-table th:first-child {
        background: #f8fafc;
    }
}

@media (max-width: 480px) {
    .home-page .home-header__title {
        font-size: 1.25rem;
    }

    .home-page .home-btn {
        min-height: 2.75rem;
        font-size: 0.9375rem;
    }

    .home-page .score-input {
        width: 3.25rem;
        min-height: 2.5rem;
    }

    .home-page .field-select {
        min-height: 2.75rem;
        font-size: 1rem;
    }

    .home-page .prediction-team-names {
        max-width: 100%;
        font-size: 0.75rem;
    }

    .home-page .home-panel__summary {
        padding: 0.75rem;
    }

    .home-page .home-panel__body {
        padding: 0.75rem;
    }
}

/* Override legacy purple table headers on home */
.home-page .standings-table th,
.home-page #group-picks-table th {
    background: #f8fafc !important;
    color: #475569 !important;
}

/* App page + admin theme */
.app-page {
    background: #f5f6f8;
    color: #1e293b;
}

.admin-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}

.registration-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.registration-link-row input {
    flex: 1 1 280px;
    min-width: 0;
}

.app-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.app-card__title {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
}

.app-page .admin-header {
    display: none;
}

.app-page .stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #2563eb;
    border-radius: 8px;
    box-shadow: none;
}

.app-page .stat-number {
    color: #2563eb;
}

.app-page .stat-number.approved { color: #16a34a; }
.app-page .stat-number.pending { color: #ca8a04; }
.app-page .stat-number.active { color: #0891b2; }

.app-page .setting-item input:focus,
.app-page .setting-item select:focus {
    border-color: #2563eb;
}

.app-page .pending-entry-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.app-page .pending-entry-card .entry-phone {
    font-weight: 600;
    color: #0f172a;
}

.app-page .global-admin-notice {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.app-page .global-admin-dashboard {
    max-width: none;
    padding: 0;
}

.app-page .admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.app-page .tab-button {
    flex: 1;
    min-width: 140px;
    padding: 0.625rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
}

.app-page .tab-button.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.app-page .tab-content {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.app-page .instance-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: none;
}

.app-page .test-environment-notice {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.fixture-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-width: 12rem;
}

.fixture-admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.app-page .fixture-actions .home-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
}


@media (max-width: 768px) {
    .app-page .home-header__nav {
        width: 100%;
    }

    .app-page .home-header__nav .home-btn {
        flex: 1;
        text-align: center;
    }

    .app-page .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-page .pending-entry-card {
        grid-template-columns: 1fr;
    }

    .app-page .entry-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .app-page .entry-actions button {
        width: 100%;
    }

    .app-page .form-group {
        flex-direction: column;
    }

    .app-page .form-group .home-btn,
    .app-page .form-group input {
        width: 100%;
    }

    .app-page .instances-grid {
        grid-template-columns: 1fr;
    }

    .app-page .tab-button {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .app-page .stats-grid {
        grid-template-columns: 1fr;
    }

    .landing-page .container {
        flex-direction: column;
    }

    .landing-page .info-section {
        order: -1;
    }
}

