/* =============================================================================
   SOKKOPINGIS-CUP STYLESHEET
   Sports League Website CSS - Organized and Optimized
   ============================================================================= */

/* -----------------------------------------------------------------------------
   BASE STYLES
   ----------------------------------------------------------------------------- */

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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* -----------------------------------------------------------------------------
   LAYOUT CONTAINERS
   ----------------------------------------------------------------------------- */

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.athlete-stats-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.stats-page-container {
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.standings-container {
    background: white;
    overflow: hidden;
    margin: 0 auto;
    max-width: 1000px;
    padding: 0;
}

/* -----------------------------------------------------------------------------
   HEADER STYLING
   ----------------------------------------------------------------------------- */

.header {
    text-align: center;
    margin-bottom: 25px;
    padding: 25px 20px;
    background-color: #f5f5f5;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

.standings-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.standings-header h1,
.standings-header h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.standings-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
    margin-top: 5px;
}

/* -----------------------------------------------------------------------------
   NAVIGATION AND CONTROLS
   ----------------------------------------------------------------------------- */

.controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    padding: 0 20px;
}

.view-toggle {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.view-toggle button {
    background: #2980b9;
    color: white;
    border: 1px solid #2980b9;
    padding: 8px 16px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
    min-width: 140px;
    text-align: center;
    border-radius: 4px;
}

.view-toggle button:focus {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

.view-toggle button.active {
    background: #1a5490;
    border-color: #1a5490;
}

.view-toggle button:hover {
    background: #1a5490;
    border-color: #1a5490;
}

/* Season Selector */
.season-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.season-selector label {
    font-weight: bold;
    font-size: 1.1em;
}

.season-selector select {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 1em;
    min-width: 120px;
    border-radius: 4px;
}

.season-selector select:focus {
    outline: 2px solid #3498db;
    outline-offset: 0px;
}

.drop-lowest-toggle {
    border: none;
}

.drop-lowest-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1em;
}

.drop-lowest-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* -----------------------------------------------------------------------------
   INDEX PAGE NAVIGATION
   ----------------------------------------------------------------------------- */

.index-navigation {
    display: grid;
    gap: 8px;
    margin-top: 0;
    padding: 30px 60px;
    max-width: 800px;
    margin: 0 auto;
}

.index-link-container {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #4a6174;
    height: 70px;
}

.index-link-container:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #3d566e, #34495e);
    transform: translateY(-1px);
}

.index-link {
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    text-align: center;
}

.index-link:hover, 
.index-link:focus {
    border-left-color: #f39c12;
    outline: 2px solid #f39c12;
    outline-offset: 2px;
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.index-link h2,
.index-link h3 {
    color: white;
    font-size: 1.3em;
    font-weight: bold;
    margin: 0 0 4px 0;
    transition: color 0.3s ease;
    line-height: 1.2;
}

.index-link p {
    color: #bdc3c7;
    font-size: 0.9em;
    margin: 0;
    line-height: 1.3;
    transition: color 0.3s ease;
    font-weight: normal;
}

.index-link:hover h2,
.index-link:focus h2,
.index-link:hover h3,
.index-link:focus h3 {
    color: #f39c12;
}

.index-link:hover p,
.index-link:focus p {
    color: #ecf0f1;
}

.index-link::after {
    content: '→';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3em;
    color: #3498db;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.index-link:hover::after,
.index-link:focus::after {
    color: #f39c12;
    transform: translateY(-50%) translateX(3px);
    opacity: 1;
}

/* Index Sections */
.index-section {
    margin: 30px 0;
    padding: 0 20px;
}

.section-title {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3498db;
    text-align: center;
}

/* Coming Soon Links */
.index-link-container.coming-soon {
    opacity: 0.6;
    position: relative;
}

.index-link-container.coming-soon::before {
    content: 'Tulossa pian';
    position: absolute;
    top: 10px;
    right: 20px;
    background: #f39c12;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    z-index: 10;
}

.index-link-container.coming-soon .index-link {
    cursor: not-allowed;
    pointer-events: none;
}

.index-link-container.coming-soon:hover {
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Index Footer */
.index-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 2px solid #ecf0f1;
    color: #7f8c8d;
}

.index-footer p {
    margin: 5px 0;
    font-size: 0.95em;
}

/* -----------------------------------------------------------------------------
   SIMPLE VIEW STYLING
   ----------------------------------------------------------------------------- */

.simple-list {
    padding: 20px 30px;
    max-width: 900px;
    margin: 0 auto;
}

.simple-sarja {
    margin-bottom: 25px;
    background: white;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.simple-sarja h3 {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 18px 25px;
    font-size: 1.3em;
    font-weight: bold;
    margin: 0;
    border-bottom: 2px solid #2c3e50;
    text-align: center;
}

.simple-sarja ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.simple-athlete {
    padding: 12px 20px;
    margin: 0;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-bottom: 1px solid #e9ecef;
    font-size: 1em;
    line-height: 1.4;
    color: #333;
    transition: background-color 0.2s ease;
}

.simple-athlete:hover {
    background: #e8f4fd;
}

.simple-athlete:focus {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

.simple-athlete.top-3 {
    font-weight: bold;
    background: #e3f2fd;
    border-left-color: #f39c12;
}

.simple-athlete:last-child {
    border-bottom: none;
}

/* -----------------------------------------------------------------------------
   TABLE STYLING
   ----------------------------------------------------------------------------- */

#standings-tables,
#standings-simple {
    margin: 0 auto;
    max-width: 950px;
    padding: 20px;
}

#standings-tables table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #bdc3c7;
    background: white;
}

#standings-tables th {
    background-color: #34495e;
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #2c3e50;
    border-right: 1px solid #4a6174;
    font-size: 0.95em;
}

#standings-tables th:last-child {
    border-right: none;
}

#standings-tables th:first-child {
    width: 50px;
    text-align: center;
}

#standings-tables th:nth-child(2) {
    width: 45%;
}

#standings-tables th:nth-child(3) {
    width: 15%;
    text-align: center;
}

#standings-tables th:nth-child(4) {
    width: 15%;
    text-align: center;
}

#standings-tables th:nth-child(5) {
    width: 15%;
    text-align: center;
}

#standings-tables th:nth-child(6) {
    width: 10%;
    text-align: center;
}

#standings-tables td {
    padding: 10px;
    border-bottom: 1px solid #bdc3c7;
    border-right: 1px solid #bdc3c7;
}

#standings-tables td:last-child {
    border-right: none;
}

#standings-tables tbody tr {
    background-color: #f8f9fa;
}

#standings-tables tbody tr:nth-child(even) {
    background-color: #ffffff;
}

#standings-tables tr:hover {
    background-color: #e8f4fd;
}

#standings-tables table:focus-within {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

#standings-tables section {
    margin-bottom: 25px;
    background: white;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

#standings-tables section:last-child {
    margin-bottom: 0;
}

#standings-tables h3 {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 18px 25px;
    font-size: 1.3em;
    font-weight: bold;
    margin: 0;
    border-bottom: 2px solid #2c3e50;
    text-align: center;
}

/* Table Content Styling */
#standings-tables .position {
    text-align: center;
    font-weight: bold;
    color: #333;
}

#standings-tables .name {
    font-weight: 600;
    color: #2c3e50;
}

#standings-tables .club {
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: normal;
}

#standings-tables .points {
    text-align: center;
    font-weight: bold;
    color: #333;
    font-size: 1em;
}

#standings-tables .first-places {
    text-align: center;
    color: #333;
    font-weight: normal;
}

#standings-tables .best-placement {
    text-align: center;
    color: #333;
    font-weight: normal;
}

#standings-tables .tournaments-count {
    text-align: center;
    color: #333;
    font-weight: normal;
}

#standings-tables .lowest-points {
    text-align: center;
    color: #333;
    font-weight: normal;
}

/* Top 3 highlighting */
#standings-tables tbody tr:nth-child(-n+3) {
    background-color: #e3f2fd;
}

#standings-tables tbody tr:nth-child(-n+3):nth-child(even) {
    background-color: #e3f2fd;
}

#standings-tables tbody tr:nth-child(-n+3):hover {
    background-color: #bbdefb;
}

#standings-tables tbody tr:nth-child(-n+3) .position {
    font-weight: bold;
    color: #2c3e50;
}

#standings-tables tbody tr:nth-child(-n+3) .name {
    font-weight: bold;
}

/* -----------------------------------------------------------------------------
   FILTERS AND FORMS
   ----------------------------------------------------------------------------- */

.filters {
    background: #f8fafc;
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 950px;
    margin: 0 auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
    border: none;
}

.filter-group-tickbox {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    border: none;
}

.filter-group label {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1em;
}

.filter-group input,
.filter-group select {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px;
    font-size: 1em;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: 2px solid #3498db;
    outline-offset: 0px;
}

.quick-filters {
    grid-column: 1/-1;
    margin-top: 15px;
}

.quick-filters-label {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1em;
}

.quick-filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.quick-filter-btn {
    background: #2980b9;
    color: white;
    border: 1px solid #2980b9;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
    min-width: 140px;
    text-align: center;
    border-radius: 4px;
}

.quick-filter-btn:focus {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

.quick-filter-btn.active {
    background: #1a5490;
    border-color: #1a5490;
}

.quick-filter-btn:hover {
    background: #1a5490;
    border-color: #1a5490;
}

.clear-filters {
    background: #e67e22;
    color: white;
    border: 1px solid #e67e22;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.clear-filters:hover {
    background: #d35400;
    border-color: #d35400;
}

.clear-filters:focus {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

/* -----------------------------------------------------------------------------
   STATISTICS TABLES
   ----------------------------------------------------------------------------- */

.stats-table-container {
    background: white;
    overflow: hidden;
    max-width: 950px;
    margin: 20px auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.stats-table-container table,
.stats-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
    background: white;
}

.stats-table-container th,
.stats-table th {
    background-color: #34495e;
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #2c3e50;
    border-right: 1px solid #4a6174;
    font-size: 0.95em;
}

.stats-table-container th:last-child,
.stats-table th:last-child {
    border-right: none;
}

.stats-table-container td,
.stats-table td {
    padding: 10px;
    border-bottom: 1px solid #bdc3c7;
    border-right: 1px solid #bdc3c7;
}

.stats-table-container td:last-child,
.stats-table td:last-child {
    border-right: none;
}

.stats-table-container tbody tr,
.stats-table tbody tr {
    background-color: #f8f9fa;
}

.stats-table-container tbody tr:nth-child(even),
.stats-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.stats-table-container tr:hover,
.stats-table tr:hover {
    background-color: #e8f4fd;
}

.stats-table-container table:focus-within,
.stats-table:focus-within {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

/* -----------------------------------------------------------------------------
   STATISTICS CONTENT STYLING
   ----------------------------------------------------------------------------- */

.sarja-badge {
    padding: 3px 8px;
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
    border-radius: 3px;
}

.era-voitot {
    text-align: center;
    font-weight: bold;
    color: #27ae60;
}

.era-prosentti {
    text-align: center;
    font-weight: bold;
    color: #8e44ad;
}

.percentage {
    font-weight: 600;
    text-align: center;
}

.percentage.high,
.percentage-high {
    color: #27ae60;
    background-color: #d5f4e6;
    padding: 2px 6px;
    border-radius: 3px;
}

.percentage.low,
.percentage-low {
    color: #e74c3c;
    background-color: #fadbd8;
    padding: 2px 6px;
    border-radius: 3px;
}

.ottelut-tot {
    text-align: center;
    color: #333;
}

.current-result {
    font-weight: bold;
}

.current-result-table {
    font-weight: bold;
}

.previous-result {
    font-style: italic;
    font-weight: normal;
}

.previous-result-table {
    font-style: italic;
    font-weight: normal;
}

/* -----------------------------------------------------------------------------
   TEXT CARDS
   ----------------------------------------------------------------------------- */

.text-card {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.text-card:hover {
    background-color: #f8f9fa;
}

.player-name-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.player-details {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.detail-item {
    font-size: 0.9em;
    color: #666;
}

.detail-value {
    font-weight: 600;
    color: #333;
}

/* -----------------------------------------------------------------------------
   UTILITY CLASSES
   ----------------------------------------------------------------------------- */

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #7f8c8d;
}

.error {
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    margin: 20px;
    text-align: center;
    border-radius: 4px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
}

.last-updated {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 25px;
    padding: 15px;
    border-top: 1px solid #ecf0f1;
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
}

.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;
}

/* -----------------------------------------------------------------------------
   MOBILE RESPONSIVE DESIGN
   ----------------------------------------------------------------------------- */

/* Tablets */
@media (max-width: 768px) {
    .container,
    .athlete-stats-container,
    .standings-container {
        padding: 10px;
        margin: 0;
    }
    
    .header {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }

    .standings-header {
        padding: 15px 10px;
    }

    .standings-header h1,
    .standings-header h2 {
        font-size: 1.5em;
    }

    .controls {
        flex-direction: column;
        gap: 10px;
        padding: 0 5px;
    }

    .season-selector {
        flex-direction: column;
        gap: 5px;
        text-align: center;
        padding: 5px 10px;
    }

    .view-toggle {
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 10px;
    }

    .view-toggle button {
        min-width: 120px;
        padding: 8px 12px;
        font-size: 0.95em;
    }

    .filters {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px 10px;
    }

    .quick-filter-buttons {
        justify-content: center;
        gap: 5px;
    }

    .quick-filter-btn {
        min-width: 110px;
        padding: 8px 12px;
        font-size: 0.95em;
    }

    #standings-tables,
    #standings-simple {
        padding: 10px;
    }

    .simple-list {
        padding: 10px;
    }

    .simple-sarja {
        margin-bottom: 15px;
    }

    .simple-sarja h3,
    #standings-tables h3 {
        padding: 12px 15px;
        font-size: 1.2em;
    }

    .simple-athlete {
        padding: 8px 12px;
        font-size: 0.95em;
    }

    #standings-tables section {
        margin-bottom: 15px;
    }
    
    #standings-tables th,
    #standings-tables td,
    .stats-table-container th,
    .stats-table-container td,
    .stats-table th,
    .stats-table td {
        padding: 5px 3px;
        font-size: 0.85em;
    }
    
    /* Hide some columns on mobile for better readability */
    #standings-tables th:nth-child(3),
    #standings-tables td:nth-child(3),
    .stats-table-container th:nth-child(3),
    .stats-table-container td:nth-child(3),
    .stats-table th:nth-child(3),
    .stats-table td:nth-child(3) {
        display: none;
    }

    .player-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .text-card {
        padding: 10px;
        margin-bottom: 8px;
    }

    .last-updated {
        margin-top: 15px;
        padding: 10px;
    }

    /* Index page responsive */
    .index-navigation {
        padding: 15px 10px;
        gap: 5px;
    }
    
    .index-link-container {
        height: 60px;
    }
    
    .index-link {
        padding: 8px 12px;
    }
    
    .index-link h2,
    .index-link h3 {
        font-size: 1.1em;
        margin-bottom: 2px;
    }
    
    .index-link p {
        font-size: 0.8em;
    }
    
    .index-link::after {
        right: 12px;
        font-size: 1.1em;
    }

    .section-title {
        font-size: 1.5em;
    }

    .index-section {
        margin: 20px 0;
        padding: 0 10px;
    }

    .index-footer {
        padding: 20px 15px;
        margin-top: 30px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container,
    .athlete-stats-container,
    .standings-container {
        padding: 5px;
    }

    .header {
        padding: 8px;
        margin-bottom: 10px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .standings-header {
        padding: 12px 8px;
    }

    .standings-header h1,
    .standings-header h2 {
        font-size: 1.3em;
    }
    
    .controls {
        gap: 8px;
        padding: 0;
    }

    .season-selector {
        padding: 4px 8px;
    }

    .view-toggle button {
        min-width: 100px;
        padding: 6px 10px;
        font-size: 0.9em;
        margin: 0 2px;
    }
    
    #standings-tables,
    #standings-simple,
    .simple-list {
        padding: 8px;
    }

    .simple-sarja {
        margin-bottom: 10px;
    }
    
    .simple-sarja h3,
    #standings-tables h3 {
        padding: 10px 12px;
        font-size: 1.1em;
    }

    .simple-athlete {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    #standings-tables section {
        margin-bottom: 10px;
    }
    
    .filters {
        padding: 10px 8px;
        gap: 12px;
    }

    .quick-filter-buttons {
        gap: 3px;
    }

    .quick-filter-btn {
        min-width: 90px;
        padding: 6px 10px;
        font-size: 0.85em;
    }

    /* Hide additional columns on very small screens */
    #standings-tables th:nth-child(6),
    #standings-tables td:nth-child(6),
    #standings-tables th:nth-child(7),
    #standings-tables td:nth-child(7),
    .stats-table-container th:nth-child(6),
    .stats-table-container td:nth-child(6),
    .stats-table-container th:nth-child(7),
    .stats-table-container td:nth-child(7),
    .stats-table th:nth-child(6),
    .stats-table td:nth-child(6),
    .stats-table th:nth-child(7),
    .stats-table td:nth-child(7) {
        display: none;
    }

    #standings-tables th,
    #standings-tables td,
    .stats-table-container th,
    .stats-table-container td,
    .stats-table th,
    .stats-table td {
        padding: 4px 2px;
        font-size: 0.8em;
    }

    .text-card {
        padding: 8px;
        margin-bottom: 6px;
    }

    .player-name-text {
        font-size: 1.1em;
    }

    .last-updated {
        margin-top: 10px;
        padding: 8px;
        font-size: 0.8em;
    }

    /* Index page mobile */
    .index-navigation {
        padding: 10px 8px;
        gap: 4px;
    }
    
    .index-link-container {
        height: 55px;
    }
    
    .index-link {
        padding: 6px 10px;
    }
    
    .index-link h2,
    .index-link h3 {
        font-size: 1em;
        margin-bottom: 1px;
    }
    
    .index-link p {
        font-size: 0.75em;
    }
    
    .index-link::after {
        right: 10px;
        font-size: 1em;
    }

    .section-title {
        font-size: 1.3em;
    }

    .index-link-container.coming-soon::before {
        font-size: 0.7em;
        padding: 3px 8px;
        top: 8px;
        right: 15px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .container,
    .athlete-stats-container,
    .standings-container {
        padding: 3px;
    }

    .header h1 {
        font-size: 1.6em;
    }

    .standings-header {
        padding: 10px 5px;
    }

    .standings-header h1,
    .standings-header h2 {
        font-size: 1.2em;
    }

    #standings-tables,
    #standings-simple,
    .simple-list {
        padding: 5px;
    }

    .simple-sarja h3,
    #standings-tables h3 {
        padding: 8px 10px;
        font-size: 1em;
    }

    .simple-athlete {
        padding: 5px 8px;
        font-size: 0.85em;
    }

    .filters {
        padding: 8px 5px;
    }

    .view-toggle button,
    .quick-filter-btn {
        min-width: 85px;
        padding: 5px 8px;
        font-size: 0.8em;
    }

    .index-navigation {
        padding: 8px 5px;
        gap: 3px;
    }

    .index-link-container {
        height: 50px;
    }

    .index-link {
        padding: 5px 8px;
    }

    .index-link h2,
    .index-link h3 {
        font-size: 0.95em;
    }

    .index-link p {
        font-size: 0.7em;
    }

    .section-title {
        font-size: 1.2em;
    }
}

/* -----------------------------------------------------------------------------
   PAGE-SPECIFIC OVERRIDES
   ----------------------------------------------------------------------------- */

/* For voitetut_erat.html - Show Era % column on mobile */
.voitetut-erat-page @media (max-width: 768px) {
    .stats-table-container th:nth-child(4),
    .stats-table-container td:nth-child(4),
    .stats-table th:nth-child(4),
    .stats-table td:nth-child(4) {
        display: table-cell !important;
    }
    
    .stats-table-container th:nth-child(5),
    .stats-table-container td:nth-child(5),
    .stats-table th:nth-child(5),
    .stats-table td:nth-child(5) {
        display: none !important;
    }
}
