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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

header h1 {
    font-size: clamp(1.5em, 4vw, 2em);
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 45px;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.menu-toggle:active {
    transform: translateY(0);
}

.menu-toggle.active {
    background: rgba(255, 255, 255, 0.3);
}

nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

#navMenu {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95em;
    backdrop-filter: blur(10px);
}

nav a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

nav a:active {
    transform: translateY(0);
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    #navMenu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        padding: 15px;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        margin-top: 10px;
        gap: 8px;
    }
    
    #navMenu.active {
        display: flex;
    }
    
    #navMenu a,
    #navMenu .dark-mode-toggle-menu {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
    
    nav {
        justify-content: flex-end;
    }
}

main {
    padding: 25px 20px;
}

.message {
    padding: 15px 20px;
    margin: 20px 15px;
    border-radius: 8px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.dashboard-section, .admin-section {
    margin-bottom: 35px;
}

.dashboard-section h2, .admin-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: clamp(1.3em, 3vw, 1.5em);
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -5px;
    padding: 0 5px;
    position: relative;
}



@media (max-width: 768px) {
    .table-container {
        overflow-x: visible;
        margin: 0;
        padding: 0;
    }
    
    .table-container::after {
        display: none;
    }
    
    .standings-table {
        min-width: 100%;
    }
}

/* Custom scrollbar for table container */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.standings-table {
    width: 100%;
    table-layout: fixed;
}



/* Column widths for standings table */
.col-pos {
    margin-left:25px;
    width: 8%;
}

.col-player {
    width: 15%;
}

.col-stat {
    width: 8%;
    text-align: center;
}

.col-points {
    width: 10%;
    text-align: center;
}

.col-score {
    width: 12%;
    text-align: center;
}

/* Column widths for player history table */
.col-date {
    width: 13%;
}

.col-result {
    width: 15%;
    text-align: center;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: clamp(0.9em, 2vw, 1.1em);
    white-space: nowrap;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: clamp(0.95em, 2vw, 1.05em);
}

.standings-table th {
    font-size: clamp(0.85em, 2.5vw, 1.1em);
}

.standings-table td {
    font-size: clamp(0.9em, 2.5vw, 1.05em);
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

.points {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.player-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
}

.player-link:hover {
    color: #764ba2;
    background: rgba(102, 126, 234, 0.1);
    text-decoration: none;
}

.player-link:active {
    transform: scale(0.98);
}

.form-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.1em;
    font-weight: 600;
}

.inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form input,
.inline-form select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
}

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

.inline-form input[type="text"],
.inline-form input[type="number"] {
    flex: 1;
    min-width: 150px;
}

button, .btn-primary, .btn-small {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button:hover, .btn-primary:hover, .btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button:active, .btn-primary:active, .btn-small:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-danger:active {
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.score-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.score-form input[type="number"] {
    width: 70px;
    text-align: center;
}

.score-form input[type="date"] {
    width: 160px;
}

.player-stats-section {
    margin-bottom: 35px;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.stat-value {
    font-size: clamp(2em, 5vw, 2.5em);
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 0.85em;
    opacity: 0.95;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-win {
    color: #28a745;
    font-weight: bold;
    padding: 4px 8px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.result-loss {
    color: #dc3545;
    font-weight: bold;
    padding: 4px 8px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.result-draw {
    color: #ffc107;
    font-weight: bold;
    padding: 4px 8px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    display: inline-block;
}

/* Tablet styles */
@media (max-width: 992px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    main {
        padding: 20px 15px;
    }
    
    .form-group {
        padding: 15px;
    }
    
    table {
        font-size: 0.85em;
    }
    
    th, td {
        padding: 10px 8px;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 1.4em;
        margin-bottom: 12px;
    }
    
    nav {
        gap: 8px;
    }
    
    nav a {
        padding: 8px 14px;
        font-size: 0.9em;
    }
    
    main {
        padding: 15px 12px;
    }
    
    .message {
        margin: 15px 10px;
        padding: 12px 15px;
        font-size: 0.9em;
    }
    
    .dashboard-section, .admin-section {
        margin-bottom: 25px;
    }
    
    .dashboard-section h2, .admin-section h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .form-group {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .form-group h3 {
        font-size: 1em;
        margin-bottom: 12px;
    }
    
    .inline-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .inline-form input,
    .inline-form select,
    .inline-form button {
        width: 100%;
        padding: 12px;
    }
    
    .score-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .score-form input[type="number"],
    .score-form input[type="date"] {
        width: 100%;
    }
    
    .table-container {
        margin: 0;
        padding: 0;
        overflow-x: visible;
    }
    
    .standings-table {
        width: 100%;
        min-width: 100%;
        table-layout: fixed;
    }
    
    .standings-table th {
        padding: 10px 6px;
        font-size: clamp(0.8em, 3vw, 1em);
    }
    
    .standings-table td {
        padding: 10px 6px;
        font-size: clamp(0.85em, 3vw, 0.95em);
    }
    
    .col-pos {
        margin-left:25px;
        width: 8%;
    }
    
    .col-player {
        width: 28%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .col-stat {
        width: 9%;
        text-align: center;
    }
    
    .col-points {
        width: 10%;
        text-align: center;
    }
    
    .col-score {
        width: 12%;
        text-align: center;
    }
    
    .col-date {
        width: 20%;
        font-size: clamp(0.75em, 2.5vw, 0.9em);
    }
    
    .col-result {
        width: 12%;
        text-align: center;
    }
    
    table {
        font-size: clamp(0.85em, 2.5vw, 1em);
    }
    
    th {
        padding: 10px 6px;
        font-size: clamp(0.9em, 2.5vw, 1.05em);
    }
    
    td {
        padding: 10px 6px;
        font-size: clamp(0.85em, 2.5vw, 1em);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px 10px;
    }
    
    .stat-value {
        font-size: 1.8em;
    }
    
    .stat-label {
        font-size: 0.75em;
    }
    
    button, .btn-primary {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .btn-small {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 1.2em;
    }
    
    nav {
        flex-direction: column;
        gap: 8px;
    }
    
    nav a {
        width: 100%;
        text-align: center;
    }
    
    main {
        padding: 12px 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .standings-table th {
        padding: 8px 4px;
        font-size: clamp(0.75em, 4vw, 0.9em);
    }
    
.standings-table td {
    padding: 8px 4px;
    font-size: clamp(0.8em, 4vw, 0.9em);
}

.standings-table td:first-child {
    padding-left: 14px;
}
    
    .col-player {
        width: 18%;
    }
    
    .col-date {
        width: 16%;
        font-size: clamp(0.7em, 3.5vw, 0.85em);
    }
    
    .col-result {
        width: 16%;
    }
    
    th, td {
        padding: 8px 4px;
        font-size: clamp(0.8em, 3vw, 0.95em);
    }
}

/* Results list styles */
.results-list {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2vw, 12px);
}

.result-item {
    background: white;
    padding: clamp(10px, 2.5vw, 15px);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.result-item.upcoming {
    border-left: 4px solid #667eea;
}

.result-players {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(6px, 2vw, 10px);
    margin-bottom: clamp(4px, 1.5vw, 8px);
    flex-wrap: wrap;
}

.result-player {
    flex: 1;
    font-weight: 500;
    color: #333;
    min-width: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    font-size: clamp(0.85em, 2.5vw, 1em);
}

.result-player-left {
    text-align: left;
}

.result-player-right {
    text-align: right;
}

.result-score {
    font-weight: bold;
    color: #667eea;
    font-size: clamp(0.95em, 2.5vw, 1.1em);
    padding: 0 clamp(5px, 1.5vw, 10px);
    white-space: nowrap;
}

.result-meta {
    display: flex;
    gap: clamp(6px, 1.5vw, 10px);
    font-size: clamp(0.75em, 2vw, 0.85em);
    color: #666;
    flex-wrap: wrap;
}

/* Table legend */
.table-legend {
    margin-top: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: clamp(0.8em, 2vw, 0.9em);
    color: #666;
    border-left: 4px solid #667eea;
}

.table-legend p {
    margin: 0;
    line-height: 1.6;
}

.table-legend strong {
    color: #667eea;
    font-weight: 600;
}

/* Week and round sections for schedule */
.week-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.round-section {
    margin-bottom: 20px;
}

.round-section h4 {
    color: #764ba2;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

@media (max-width: 768px) {
    .week-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .week-section h3 {
        font-size: 1.1em;
    }
    
    .round-section h4 {
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    .results-list {
        gap: 8px;
    }
    
    .result-item {
        padding: 10px 12px;
    }
    
    .result-players {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .result-player {
        flex: 1;
        font-size: clamp(0.8em, 3vw, 0.95em);
        min-width: 0;
    }
    
    .result-player-left {
        text-align: left;
    }
    
    .result-player-right {
        text-align: right;
    }
    
    .result-score {
        font-size: clamp(0.9em, 3vw, 1em);
        padding: 0 6px;
        flex-shrink: 0;
    }
    
    .result-meta {
        justify-content: flex-start;
        font-size: clamp(0.7em, 2.5vw, 0.8em);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .results-list {
        gap: 6px;
    }
    
    .result-item {
        padding: 8px 10px;
    }
    
    .result-players {
        gap: 4px;
        margin-bottom: 4px;
    }
    
    .result-player {
        font-size: clamp(0.75em, 3.5vw, 0.9em);
    }
    
    .result-player-left {
        text-align: left;
    }
    
    .result-player-right {
        text-align: right;
    }
    
    .result-score {
        font-size: clamp(0.85em, 3.5vw, 0.95em);
        padding: 0 4px;
    }
    
    .result-meta {
        font-size: clamp(0.65em, 3vw, 0.75em);
        gap: 6px;
    }
}

/* Dark Mode Toggle Button - Menu Item Style */
.dark-mode-toggle-menu {
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95em;
    backdrop-filter: blur(10px);
    display: inline-block;
    cursor: pointer;
    border: none;
}

.dark-mode-toggle-menu:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.dark-mode-toggle-menu:active {
    transform: translateY(0);
}

/* Dark Mode Styles */
.dark-mode body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

.dark-mode .container {
    background: #2d2d44;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dark-mode header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.dark-mode main {
    background: #2d2d44;
}

.dark-mode .dashboard-section h2,
.dark-mode .admin-section h2 {
    color: #a0aec0;
    border-bottom-color: #4a5568;
}

.dark-mode table {
    background: #1a1a2e;
    color: #e0e0e0;
}

.dark-mode thead {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.dark-mode tbody tr {
    border-bottom-color: #3a3a4e;
}

.dark-mode tbody tr:hover {
    background: #3a3a4e;
}

.dark-mode td {
    border-bottom-color: #3a3a4e;
    color: #e0e0e0;
}

.dark-mode th {
    color: white;
}

.dark-mode .points {
    color: #a0aec0;
}

.dark-mode .player-link {
    color: #90cdf4;
}

.dark-mode .player-link:hover {
    color: #63b3ed;
    background: rgba(144, 205, 244, 0.1);
}

.dark-mode .form-group {
    background: #1a1a2e;
    border: 1px solid #3a3a4e;
}

.dark-mode .form-group h3 {
    color: #a0aec0;
}

.dark-mode .inline-form input,
.dark-mode .inline-form select {
    background: #2d2d44;
    border-color: #4a5568;
    color: #e0e0e0;
}

.dark-mode .inline-form input:focus,
.dark-mode .inline-form select:focus {
    border-color: #667eea;
    background: #3a3a4e;
}

.dark-mode .message.success {
    background: #2d5016;
    color: #9ae6b4;
    border-color: #38a169;
}

.dark-mode .message.error {
    background: #742a2a;
    color: #feb2b2;
    border-color: #e53e3e;
}

.dark-mode .result-item {
    background: #1a1a2e;
    border: 1px solid #3a3a4e;
}

.dark-mode .result-item:hover {
    background: #2d2d44;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.dark-mode .result-item.upcoming {
    border-left-color: #667eea;
}

.dark-mode .result-player {
    color: #e0e0e0;
}

.dark-mode .result-score {
    color: #90cdf4;
}

.dark-mode .result-meta {
    color: #a0aec0;
}

.dark-mode .stat-card {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.dark-mode .table-legend {
    background: #1a1a2e;
    border-left-color: #667eea;
    color: #a0aec0;
}

.dark-mode .week-section {
    background: #1a1a2e;
    border: 1px solid #3a3a4e;
}

.dark-mode .week-section h3 {
    color: #a0aec0;
    border-bottom-color: #4a5568;
}

.dark-mode .round-section h4 {
    color: #90cdf4;
}

.dark-mode .result-win {
    background: rgba(40, 167, 69, 0.2);
    color: #9ae6b4;
}

.dark-mode .result-loss {
    background: rgba(220, 53, 69, 0.2);
    color: #feb2b2;
}

.dark-mode .result-draw {
    background: rgba(255, 193, 7, 0.2);
    color: #fbd38d;
}

.dark-mode .menu-toggle {
    background: rgba(255, 255, 255, 0.2);
}

.dark-mode .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dark-mode .menu-toggle.active {
    background: rgba(255, 255, 255, 0.3);
}

.dark-mode #navMenu {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.dark-mode .dark-mode-toggle-menu {
    background: rgba(255, 255, 255, 0.2);
}

.dark-mode .dark-mode-toggle-menu:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dark-mode input[type="text"],
.dark-mode input[type="number"],
.dark-mode input[type="date"],
.dark-mode input[type="password"],
.dark-mode select,
.dark-mode textarea {
    background: #1a1a2e;
    border-color: #4a5568;
    color: #e0e0e0;
}

.dark-mode input[type="text"]:focus,
.dark-mode input[type="number"]:focus,
.dark-mode input[type="date"]:focus,
.dark-mode input[type="password"]:focus,
.dark-mode select:focus,
.dark-mode textarea:focus {
    border-color: #667eea;
    background: #2d2d44;
}

.dark-mode .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark-mode .btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

.dark-mode .btn-small {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark-mode .btn-small:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

.dark-mode .btn-danger {
    background: #e53e3e;
}

.dark-mode .btn-danger:hover {
    background: #c53030;
}

.dark-mode p {
    color: #a0aec0;
}

/* Footer */
footer {
    text-align: center;
    padding: 25px 20px;
    color: #666;
    border-top: 1px solid #e2e8f0;
    margin-top: 30px;
    background: #f8f9fa;
    font-size: 0.9em;
}

footer p {
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.dark-mode footer {
    border-top-color: #3a3a4e;
    background: #1a1a2e;
    color: #a0aec0;
}

.dark-mode footer p {
    color: #a0aec0;
}

/* Instruction box */
.instruction-box {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    color: #333;
    line-height: 1.6;
}

.dark-mode .instruction-box {
    background: #1a202c;
    border-left-color: #667eea;
    color: #e2e8f0;
}

.dark-mode a {
    color: #90cdf4;
}

.dark-mode a:hover {
    color: #63b3ed;
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
    }
    
    header {
        background: #667eea;
    }
    
    nav {
        display: none;
    }
    
    button, .btn-primary, .btn-small {
        display: none;
    }
}

/* Admin panel score form styles */
.score-form-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-form {
    width: 100%;
}

.score-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.score-input {
    width: 60px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.score-separator {
    font-weight: 600;
    color: #666;
}

.date-input {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.points-info {
    font-size: 0.85em;
    color: #667eea;
    font-weight: 500;
}

.submitted-info {
    font-size: 0.85em;
    color: #999;
}

.delete-result-form,
.delete-reservation-form {
    margin-top: 5px;
}

.btn-danger {
    background-color: #e53e3e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

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

.reservation-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Admin panel score form styles */
.admin-score-form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-score-form {
    width: 100%;
}

/* First row: Player 1 score - Player 2 score */
.admin-score-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-player-score-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 100px;
}

.admin-player-label {
    font-size: 1.3em;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark-mode .admin-player-label {
    color: #a0aec0;
}

.admin-score-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1em;
}

.admin-score-separator {
    font-weight: 600;
    color: #666;
    font-size: 1.2em;
    padding: 0 5px;
    align-self: flex-end;
    margin-bottom: 4px;
}

/* Second row: Date, buttons, and info */
.admin-score-row-second {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.admin-date-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.admin-date-label {
    font-size: 0.9em;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.dark-mode .admin-date-label {
    color: #a0aec0;
}

.admin-date-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    min-width: 150px;
}

.admin-save-btn {
    padding: 8px 16px;
}

.admin-result-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-result-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-points-info {
    font-size: 0.85em;
    color: #667eea;
    font-weight: 500;
}

.admin-date-display {
    font-size: 0.85em;
    color: #666;
}

.admin-submitted-info {
    font-size: 0.85em;
    color: #999;
}

.admin-delete-form {
    margin-top: 5px;
}

.dark-mode .admin-score-input,
.dark-mode .admin-date-input {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.dark-mode .admin-result-info {
    border-top-color: #4a5568;
}

.dark-mode .admin-points-info {
    color: #90cdf4;
}

.dark-mode .admin-date-display {
    color: #a0aec0;
}

.dark-mode .admin-submitted-info {
    color: #a0aec0;
}

/* Admin results header with search */
.admin-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-results-header h2 {
    margin: 0;
}

/* Admin search input styles */
.admin-search-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 250px;
    max-width: 400px;
    width: 100%;
}

.admin-search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    background-color: #ffffff;
    color: #333333;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.admin-search-input::placeholder {
    color: #999999;
    opacity: 1;
}

.admin-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #ffffff;
}

.admin-clear-search {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #cccccc;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
    line-height: 1;
    z-index: 10;
}

.admin-clear-search:hover {
    background: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.admin-clear-search:active {
    transform: translateY(-50%) scale(0.95);
}

.dark-mode .admin-search-input {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.dark-mode .admin-search-input::placeholder {
    color: #718096;
}

.dark-mode .admin-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.dark-mode .admin-clear-search {
    background: #4a5568;
    color: #e2e8f0;
}

.dark-mode .admin-clear-search:hover {
    background: #667eea;
}

@media (max-width: 768px) {
    .admin-results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-results-header h2 {
        margin-bottom: 10px;
    }
    
    .admin-search-wrapper {
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
    
    .admin-search-input {
        width: 100%;
    }
}

/* Responsive styles for admin score form */
@media (max-width: 768px) {
    .admin-score-row {
        flex-direction: row;
        align-items: flex-end;
        gap: 8px;
    }
    
    .admin-player-score-group {
        flex: 1;
        min-width: 80px;
    }
    
    .admin-score-separator {
        margin-bottom: 4px;
    }
    
    .admin-score-row-second {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .admin-date-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .admin-date-label {
        font-size: 0.85em;
    }
    
    .admin-date-input {
        width: 100%;
        min-width: auto;
    }
    
    .admin-save-btn {
        width: 100%;
        padding: 10px;
    }
    
    .admin-result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .admin-table {
        font-size: 0.9em;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 4px;
    }
}

/* Dark mode for admin score form */
.dark-mode .score-input,
.dark-mode .date-input {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.dark-mode .result-info {
    border-top-color: #4a5568;
}

.dark-mode .points-info {
    color: #90cdf4;
}

.dark-mode .submitted-info {
    color: #a0aec0;
}

/* Custom Alert Modal */
.custom-alert-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.custom-alert-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.custom-alert {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
    overflow: hidden;
}

.custom-alert-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-alert-header.error {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.custom-alert-header.success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.custom-alert-header.warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.custom-alert-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-alert-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.custom-alert-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.custom-alert-body {
    padding: 25px;
    color: #333;
    font-size: 1em;
    line-height: 1.6;
}

.custom-alert-footer {
    padding: 15px 25px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
}

.custom-alert-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 80px;
}

.custom-alert-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.custom-alert-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.custom-alert-btn-primary:active {
    transform: translateY(0);
}

/* Dark mode for custom alert */
.dark-mode .custom-alert {
    background: #2d2d44;
    color: #e0e0e0;
}

.dark-mode .custom-alert-body {
    color: #e0e0e0;
}

.dark-mode .custom-alert-footer {
    background: #1a1a2e;
    border-top-color: #3a3a4e;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================
   MOBILE: ONE-LINE SCORE INPUT
   ========================= */
@media (max-width: 768px) {

    .match-score-cell {
        width: 100%;
    }

    .score-form-container {
        gap: 6px;
    }

    /* ONE LINE: Player1 - Score - Player2 */
    .score-inputs {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .score-input {
        width: 48px;
        min-width: 48px;
        padding: 8px;
        font-size: 1em;
    }

    .score-separator {
        font-weight: bold;
        font-size: 1em;
        padding: 0 4px;
    }

    /* Player names tighter */
    .admin-results-table td:nth-child(3),
    .admin-results-table td:nth-child(5) {
        font-size: 0.9em;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 30vw;
    }

    /* Date + Save below score line */
    .date-input {
        width: 100%;
        margin-top: 6px;
        padding: 8px;
        font-size: 0.9em;
    }

    .score-form button {
        width: 100%;
        margin-top: 6px;
        padding: 10px;
    }

    /* Remove extra padding from table */
    .admin-table td {
        padding: 8px 6px;
        vertical-align: middle;
    }
}
