@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    font-weight: 500;
    font-style: normal;
    margin: 0;
    padding: 0;
    background-color: #fff; /*#d6f5df;*/
    overflow-x: hidden; /* Prevent horizontal overflow */
   /* display: flex; /* Use flexbox for layout */
}

header .logo {
   display:none;
}

header .sunflower {
    position: absolute;
    right: 20px;
    width: 100px;
    height: auto;
}
nav.side-menu .logo {
    display: none; /* Hide logo by default */
}

nav.side-menu {
    position: sticky;
    top: 0;
    width: 62px; /* Thin width for the side menu */
    padding-right: 2px;
    padding-left: 2px;
    background: #228B22; /* Forest Green */
    height: 100vh; /* Full viewport height */
    overflow-y: auto;
    transition: width 0.3s; /* Smooth transition for expanding */
    z-index: 999;
}

/* Accessible menu control (replaces text “☰” / “X”) */
.nav-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin: 8px auto 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
}

.nav-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.24);
}

.nav-menu-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.nav-menu-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.28s ease, opacity 0.2s ease;
}

nav.side-menu.expanded .nav-menu-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

nav.side-menu.expanded .nav-menu-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

nav.side-menu.expanded .nav-menu-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

nav.side-menu.expanded .nav-menu-toggle {
    background: rgba(255, 255, 255, 0.22);
}

nav.side-menu .menu-items {
    display: none; /* Hide menu items initially */
    flex-direction: column;
    align-items: center;
    z-index: 999;
}

nav.side-menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    margin: 10px 0;
    padding: 0px;
    background: #006400; /* Dark Green */
    border-radius: 5px;
    text-align: center;
    width: 100%;
    font-size: 1.2rem;
}

nav.side-menu a:hover {
    background: #004d00; /* Darker Green on hover */
}

nav.side-menu.expanded {
    width: 200px; /* Expanded width for the side menu */
}

nav.side-menu.expanded .menu-items {
    display: flex; /* Show menu items when expanded */
}

main {
    padding: 0px;
    background-color: #fff; /*#d6f5df;*/
    flex: 1;
}

#main-logo {
    display: flex;
    justify-content: center; /* Center horizontally */
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%); /* Center the logo */
    width: 30%;
    height: 25%;
}

#main-title {
    display: flex;
    position: absolute;
    font-size: 5rem;
    color: white;
    bottom: 5%;
    right: 5%;
    text-shadow: 
        -1px -1px 0 #006400,  /* Dark Green border */
        1px -1px 0 #006400,
        -1px  1px 0 #006400,
        1px  1px 0 #006400,
        -2px -2px 0 #006400,
        2px -2px 0 #006400,
        -2px  2px 0 #006400,
        2px  2px 0 #006400,
        -3px -3px 0 #006400,
        3px -3px 0 #006400,
        -3px  3px 0 #006400,
        3px  3px 0 #006400,
        -4px -4px 0 #006400,
        4px -4px 0 #006400,
        -4px  4px 0 #006400,
        4px  4px 0 #006400;
}

.video-background {
    position: relative;
    width: 100%;
    height: 100vh; /* Adjust as needed */
    overflow: hidden;
}

#background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: fill;
    transform: translate(-50%, -50%);
    z-index: -1; /* Ensure the video is behind other content */
}

.home-section {
    background: url('../images/sunrise_blurred.jpg') no-repeat center center;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    padding: 0 20px 50px 20px;
    position: fixed; /* Make the section fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Full viewport height */
    min-height: 100vh;
    z-index: 0; /* Hero sits behind in-flow content that scrolls over it */
    pointer-events: none; /* Logo/title still visible; clicks pass through to scroll */
}

/* iOS Safari often mishandles background-attachment: fixed on full-viewport layers. */
@supports (-webkit-touch-callout: none) {
    .home-section {
        background-attachment: scroll;
    }
}

/* First content after fixed hero reserves one viewport of scroll so About/schedule slide over the image */
main > .home-section + * {
    margin-top: 100vh;
    position: relative;
    z-index: 1;
}

/* Everything below stays above the fixed hero */
#about,
#schedule,
.home-opponent-strip,
footer {
    position: relative;
    z-index: 1;
}

#main-logo,
#main-title {
    pointer-events: auto;
}

#games-filter-date-range-container {
    display: flex;
    justify-content: center;
    margin: 20px 0 20px 0;
    gap: 20px;
    font-size: 1.5rem;
}

#manage-stats-big-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 20px 0 20px 0;
}

.modal {
    display: none; /* Hide by default */
    position: fixed; /* Position the modal */
    top: 20%; /* Center vertically */
    left: 30%; /* Center horizontally */
    right: 30%; /* Center horizontally */
    z-index: 899;
    border: 5px solid #228B22; /* Forest Green border */
    background-color: #fff; /* White background */
    box-shadow: 3px 3px 10px rgb(0 0 0 / 50%);
    }

.modal label{
    display: flex;
    justify-content: center;
    margin-top: 15px;
    font-size: 1.5rem;
}

.modal label + * {
    font-size: 1.5rem;
}

.edit-modal-fields {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

.edit-button {
    width: 100%;
    height: 40px;
}

#edit-game-submit-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 20px 0;
    gap: 20px;
    flex-direction: row-reverse;
}

#edit-game-submit, #delete-game-submit {
    margin: 10px 0 10px 0;
    font-size: 20px;
    color: white;
    background-color: #228B22;
    border-radius: 15px;
    padding: 10px 30px;
}

#delete-game-submit {
    background-color:#e92c2c;
}

.close {
    position: absolute;
    top: 0px;
    right: 10px;
    font-size: 50px;
    color: #228B22; /* Forest Green */
    cursor: pointer;
}

#manage-players, #manage-players-form {
    display: flex;
    margin: 20px 0 20px 0;
    align-items: center;
    flex-direction: column;
}

#manage-players-form {
    align-items: flex-start;
}

.manage-players-fields {
    display: flex;
    margin-top: 0;
    gap: 30px;
    flex-direction: row;
    align-items: center;
}

#season-filter-container, #games-filter-container, #chemistry-filter-container, #attendance-filter-container {
    flex-direction: column;
    margin-top: 100px;
    color: #0c630c;
}

#season-filter-container select, #games-filter-container select,
#chemistry-filter-container select, #attendance-filter-container select {
    margin: 15px 0 10px 0;
    font-size: 1.5rem;
}

#player-total-stats {
    display: flex;
    margin: 20px 0 20px 0;
    align-items: center;
    flex-direction: column;
    font-size: 1rem;
    width: 100%;
    border: 0;
    border-spacing: 0;
}

#player-total-stats thead {
    display: block;
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    overflow: visible;
}

#player-total-stats tbody,
#player-total-stats tfoot {
    display: block;
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    overflow: visible;
}

#player-total-stats thead tr {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) repeat(4, minmax(0, 1fr));
    width: 100%;
    box-sizing: border-box;
}

#player-total-stats tbody tr,
#player-total-stats tfoot tr {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) repeat(4, minmax(0, 1fr));
    width: 100%;
    box-sizing: border-box;
}

#player-total-stats th {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 0.35rem;
    text-align: center;
    background-color: #228B22;
    color: white;
    border: 2px solid white;
    min-width: 0;
    width: auto;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: none;
    cursor: pointer;
    box-sizing: border-box;
}

#player-total-stats th:hover{
    background-color: #006400;
}

#player-total-stats th img{
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

#player-total-stats tbody td,
#player-total-stats tfoot td {
    display: flex;
    padding: 0.45rem 0.35rem;
    text-align: center;
    min-width: 0;
    width: auto;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    box-sizing: border-box;
    font-size: 0.95rem;
}

#player-total-stats td:nth-child(1),
#player-total-stats tfoot td:nth-child(1) {
    text-align: center;
    justify-content: center;
}

#player-total-stats tbody td:nth-child(1).player-total-stats__name-cell {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.5rem;
    text-align: left;
}

.player-stats-row__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(34, 139, 34, 0.35);
    box-sizing: border-box;
}

.player-stats-row__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#player-total-stats > tbody > tr:hover .player-stats-row__avatar {
    border-color: rgba(255, 255, 255, 0.85);
}

#player-total-stats tfoot tr {
    background-color: #87de87;
    font-size: 1.15rem;
    font-weight: 700;
}

#player-total-stats tbody tr:nth-child(odd) {
    background-color: #ddffdd /*#d5dcd8;*/
}

#player-total-stats > tbody > tr {
    cursor: pointer;
}

#player-total-stats > tbody > tr:hover {
    background-color: #006400;
    color: white;
}

.big_container {
    display: flex;
}

#player-total-stats-container {
    width: 50%;
}

#goal-chart-container {
    cursor: pointer;
    max-width: 1000px;
}

.modal-player-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 15px 0 30px 0px;
    gap: 100px;
}

.modal-player-stats {
    display: flex;
    flex-direction: column;
    margin: 20px 0 20px 0;
    align-items: flex-start;
    font-size: 1.5rem;
    flex-grow: 1;
}

.modal-player-stats div:nth-child(odd) {
    width: 100%;
   background-color: #ddffdd
}

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#assists-and-yellow-cards-chart, #stats-and-first-chart {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-evenly;
    margin: 75px 0 20px 0;
    align-items: center;
    font-size: 1.5rem;
    flex-grow: 1;
}

#stats-and-first-chart {
    margin: 40px 0 20px 0;
}

#stats-and-first-chart {
    flex-direction: row;
}

#assist-chart-container, #yellow-card-chart-container, #goal-chart-container {
    cursor: pointer;
    width: 40%;
    margin: 0 auto;
    max-width: 800px;
}

#player-assists-chart, #player-yellow-cards-chart, #player-goals-chart {
    width: 100% !important;
    height: auto !important;
}

#games-and-line-graph-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin: 0 0 20px 0;
    align-items: flex-start;
    font-size: 1.5rem;
    flex-grow: 1;
}

#games-and-totals-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40%;
    height: 100%;
}

#games-and-totals-container table {
    width: auto;
    margin: 10px auto 40px auto;
}

#games-container {
    display: flex;
    flex-direction: row;
    margin: 20px 0 0 0;
    align-items: center;
    width: 100%;
}


#games-data-table-container {
    display: flex;
    margin: 20px 0 0 0;
    align-items: center;
    flex-direction: column;
    font-size: 1rem;
    width: 100%;
    border: 0;
    border-spacing: 0;
}

#pagination-controls {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin: 0 0 20px 0;
    font-size: 1rem;
}

#pagination-controls button {
    display: flex;
    margin: 0 10px;
    font-size: 1rem;
    color: white;
    background-color: #228B22;
    border-radius: 5px;
    padding: 5px 15px;
    cursor: pointer;
}

#pagination-controls button:hover {
    background-color: #006400;
}

/* width: 100% matters — #games-and-totals-container centers its children,
   which shrink-wraps this box, and the tiles inside then wrap to one per line. */
#wins-losses-container {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    width: 100%;
    margin: 0 0 20px 0;
    font-size: 1.5rem;
}


#games-data {
    display: flex;
    margin: 20px 0 20px 0;
    align-items: center;
    flex-direction: column;
    font-size: 1rem;
    width: 100%;
    border: 0;
    border-spacing: 0;
}

/* Tiles reuse .stat-spotlight (others.css); this just sizes the row. */
#wins-losses {
    width: 100%;
    max-width: 420px;
    margin: 0 auto 20px;
    flex-wrap: nowrap;
    gap: 0.6rem;
}

#wins-losses .stat-spotlight__item {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.45rem 0.4rem;
}

#wins-losses .stat-spotlight__label,
#wins-losses .stat-spotlight__name {
    white-space: nowrap;
}

#games-data th {
    padding: 5px;
    text-align: center;
    background-color: #228B22;
    color: white;
    border: 2px solid white; /* Simulate cellspacing with border */
    cursor: default;
}

#games-data tr {
    cursor: pointer;
}

#games-data td {
    padding: 5px;
    text-align: center;
}

#games-data td:nth-child(1) {
    text-align: left;
}

.games-data__nowrap {
    white-space: nowrap;
}

@media (max-width: 480px) {
    #games-data th,
    #games-data td {
        padding: 5px 3px;
    }
}

#games-data tr:nth-child(odd) {
    background-color: #ddffdd /*#d5dcd8;*/
}

#games-data tr:hover {
    background-color: #006400;
    color: white;
}

#gamesStatsModal {
    position: fixed;
    top: 55%;
    left: 30%;
    width: 45%;
    height: 40%;
    display: none; /* Hidden by default */
    z-index: 900; /* Ensure it is above other elements */
    overflow-y: auto;
}

#game-stats-table {
    width: 75%;
    margin-bottom: 25px;
}

#game-stats-table th {
    padding: 5px;
    text-align: center;
    background-color: #228B22;
    color: white;
    border: 2px solid white; /* Simulate cellspacing with border */
    cursor: default;
}

#game-stats-table td {
    padding: 5px;
    text-align: center;
}

#game-stats-table tbody tr:nth-child(even) {
    background-color: #ddffdd /*#d5dcd8;*/
}

/* Game modal: full-width table so columns line up on desktop (was 75% off-center) */
#gameStatsModal #game-stats-table {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    table-layout: fixed;
    border-collapse: collapse;
    box-sizing: border-box;
}

#gameStatsModal #game-stats-table th:nth-child(1),
#gameStatsModal #game-stats-table td:nth-child(1) {
    width: 24%;
    word-break: break-word;
}

#gameStatsModal #game-stats-table th:nth-child(2),
#gameStatsModal #game-stats-table td:nth-child(2) {
    width: 38%;
    word-break: break-word;
}

#gameStatsModal #game-stats-table th:nth-child(3),
#gameStatsModal #game-stats-table td:nth-child(3) {
    width: 38%;
    word-break: break-word;
}

#saves-table {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0 20px 0;
    font-size: 1rem;
}

#saves-table td:first-of-type {
    padding: 5px;
    text-align: center;
    background-color: #228B22;
    color: white;
    border: 2px solid white; /* Simulate cellspacing with border */
}

#additional-filters-and-line-chart {
    display: flex;
    flex-direction: column;
    margin: 100px 0 20px 0;
    align-items: center;
    font-size: 1.5rem;
    flex-grow: 1;
}

/* Opponent / time slot / weather filters under "All Seasons": a row of
   label-over-control fields, bottom-aligned so every control sits on one line. */
#additional-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 14px 28px;
    max-width: 1100px;
    margin: 20px auto 30px;
}

.games-filter-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

#additional-filters label {
    font-size: 1rem;
    font-weight: 600;
    color: #0c630c;
}

#additional-filters select {
    font-size: 1.1rem;
    padding: 4px 6px;
    min-width: 11em;
}

.games-filter-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    cursor: pointer;
}

.games-filter-clear {
    font-size: 1rem;
    padding: 5px 14px;
    color: #0c630c;
    background: #fff;
    border: 1px solid #228B22;
    border-radius: 5px;
    cursor: pointer;
}

.games-filter-clear:hover {
    background: #228B22;
    color: #fff;
}

.games-filter-check input {
    width: 18px;
    height: 18px;
    accent-color: #228B22;
}

.temp-filter__inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.temp-filter__inputs input {
    width: 4.5em;
    font-size: 1.1rem;
    padding: 4px 6px;
    text-align: center;
}

#line-chart-container {
    position: relative;
    width: 60%;
    max-width: 1400px;
    right: 32px;
}

.list-filter {
    display: flex;
    margin: 20px 0 0 0;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    font-size: 2rem;
    color: #228B22;
}

.chart-container {
    display: flex;
    justify-content: center;
    margin: 20px 0 20px 0;
    width: 40%;
    align-items: center;
}

#player-yellow-cards-chart {
    height: 100%;
    width: 100%;
}
#graph-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    margin: 1.25rem auto 1.75rem;
    max-width: min(920px, calc(100% - 2rem));
    width: 100%;
    box-sizing: border-box;
    padding: 0 0.5rem;
}

#graph-container svg.chem-graph {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(560px, 70vh);
    border-radius: 16px;
    border: 1px solid rgba(34, 139, 34, 0.22);
    background:
        radial-gradient(ellipse 120% 80% at 50% 0%, rgba(34, 139, 34, 0.09) 0%, transparent 55%),
        linear-gradient(165deg, #fafdfb 0%, #f0f7f1 48%, #e8f2ea 100%);
    box-shadow:
        0 4px 24px rgba(13, 77, 13, 0.07),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    overflow: hidden;
    box-sizing: border-box;
}

.chem-graph__viewport {
    cursor: grab;
}

.chem-graph__viewport:active {
    cursor: grabbing;
}

.chem-graph__link {
    fill: none;
    stroke: #3d8b3d;
    stroke-linecap: round;
    pointer-events: none;
}

.chem-graph__node {
    cursor: pointer;
}

.chem-graph__node-hit {
    cursor: pointer;
}

.chem-graph__avatar-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.chem-graph__avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 50%;
    pointer-events: none;
}

.chem-graph__label {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    fill: #0d4d0d;
    paint-order: stroke fill;
    stroke: rgba(255, 255, 255, 0.92);
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.chem-graph__hint {
    margin: 0.65rem 0 0;
    padding: 0 0.25rem;
    font-size: 0.82rem;
    color: #4b5563;
    text-align: center;
    line-height: 1.4;
}

.chem-graph__empty {
    margin: 1.5rem auto;
    padding: 1rem 1.25rem;
    max-width: 28rem;
    text-align: center;
    font-size: 0.95rem;
    color: #444;
    background: #f4faf4;
    border-radius: 12px;
    border: 1px dashed rgba(34, 139, 34, 0.35);
}

/* Legacy node/link classes (older charts) */
.node {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 1.5px;
    border-radius: 10px;
}

.link {
    fill: none;
    stroke: #999;
    stroke-opacity: 0.6;
}

#about {
    padding: 0;
    background-color: #f9f9f9;
    width: 100%;
}

.about-container {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    gap: 0px;
    justify-content: center;
}

.about-item {
    text-align: center;
    display: flex;
    flex-direction: row; /* Place image and text side by side */
    align-items: center; /* Center items vertically */
    justify-content: center; /* Center items horizontally */
    /*overflow: hidden;*/ /* This makes the transitions not work */
}

.about-item img, .about-item p{
    width: 50%; /* Adjust width as needed */
    height: 700px;
    box-sizing: border-box;
    margin: 0; /* Add margin to separate from text */
}

.about-item img {
    object-fit: cover;
    object-position: top;
    border-radius: 0px;
}

.about-item:first-of-type img {
    object-position: center;
}

.about-item > img {
    animation: zoom-out linear;
    animation-timeline: view();
    animation-range-start: cover;
    animation-range-end: contain;
    z-index: 3;
}

/* iOS / engines without reliable scroll-driven timelines: scripts.js drives these. */
html.about-scroll-fallback #about .about-item > img,
html.about-scroll-fallback #about .about-item p .small-img {
    animation: none;
}

html.about-scroll-fallback #about .about-item p {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    #about .about-item > img,
    #about .about-item p .small-img,
    #about .about-item p {
        animation: none !important;
    }
}

.about-item p + img {
    z-index: 2;
}

@-webkit-keyframes zoom-out {
    from { 
          -webkit-transform: translateY(-10%);
          -webkit-transform: opacity .4;
         }
    to { 
        -webkit-transform: translateY(0%);
        -webkit-transform: opacity 1;
       }
}

@keyframes zoom-out {
    from { 
         
          transform: translateY(-10%);
          opacity: .4; 
         }
    to { 
         
        transform: translate(0%);
        opacity: 1;
       }
}

.about-item p {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #004700;
    font-size: 1.9rem;
    background-color: #9EF0BF; /* Add a background color to the text section */
    border-radius: 0px; /* Round the right corners */
    padding: 20px 50px 40px 75px;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.1); /* Add a subtle shadow for better separation */
    z-index: 3;
}

.about-item p .small-img {
    width: 200px; /* Set a fixed width for the small image */
    height: 200px; /* Set a fixed height for the small image */
    margin-bottom: 50px; /* Add margin below the small image */
    margin-top: -10%;
    animation: fade-in linear;
    animation-timeline: view();
    animation-range-start: cover;
    animation-range-end: contain;
}

@-webkit-keyframes fade-in {
    from {  
          -webkit-transform: scale(.3);
        }
    to { 
        -webkit-transform: scale(1);
       }
}

@keyframes fade-in {
    from { 
          transform: scale(.3); 
        }
    to { 
        transform: scale(1); 
       }
}

@keyframes scroll-slide {
    from {
        opacity: 0.35;
        transform: translateY(1.75rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#about .section-header{
    z-index: 9;
    margin-bottom: 0;
    position: relative;
}

#gallery{
    padding: 40px 0 40px 40px;
    background-color: #fff;
    position: relative;
    z-index: 4;
}

#carousel-gallery {
    display: flex;
    overflow: hidden;
    height: 100%;
    margin-bottom: 100px;
    margin: 0 5px;
}

.carousel {
    position: relative;
    max-width: 900px;
    height: 600px;
    margin: auto;
    overflow: hidden;
    border-radius: 10px;
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-item {
    min-width: 100%;
    transition: opacity 0.5s ease-in-out;
    height: 100%;
}

#carousel-gallery img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.carousel-control-prev, .carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.367);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.carousel-control-prev {
    left: 10px;
}

.carousel-control-next {
    right: 10px;
}

#carousel-previews {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin: 20px auto;
    overflow-x: auto; /* Allow horizontal scrolling */
    max-width: 900px; /* Ensure it fits within the carousel container */
    padding: 0 10px;
    scrollbar-width: none; /* Hide scrollbar */
}

#carousel-previews img {
    width: 100px; /* Adjust the width as needed */
    height: 60px; /* Adjust the height as needed */
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

#carousel-previews img.active {
    opacity: 1;
    border: 2px solid #228B22; /* Highlight the active thumbnail */
}

.photo-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0 0 0;
    padding: 0;
    font-size: 2rem;
    color: #228B22;
}

#switching-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(375px, 1fr)); /* Adjust the minmax value as needed */
    grid-auto-rows: auto; /* Ensure consistent row height */
    grid-auto-flow: dense;
    gap: 50px;
    margin: 0 20px 50px 0;
}

.switching-images {
    position: relative;
    display: flex;
    width: 100%;
    height: auto;
    text-align: center;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.switching-images img {
    width: auto;
    height: 315px;
    display: none; /* Hide all images initially */
    object-fit: cover;
    position: relative;
    left: 0;
    top: 0;
    border-radius: 10px;
}

.switching-images img.active {
    display: block; /* Show the active image */
}

#schedule {
    padding: 50px 0;
    background-color: white;
}

#standings, #roster, #statistics, #contact {
    margin-bottom: 50px; /* Remove any default margin */
    padding: 0; /* Remove any default padding */
    background-color: #FFF; /* Set a background color */
}

#contact h2{
    padding: 0 7px;
    font-size: 2rem;
    margin-bottom: 0;
    margin-top: 50px;
}

#contact h3{
    padding: 0 15px;
    margin-top: 40px;
    margin-bottom: 5px;
}

#contact p{
    padding: 5px 10px 0 10px;
    margin: 0 10px;
}

#contact a{
    text-decoration: none;
    color: #087708;
}

#contact iframe {
    width: 500px;
    height: 380px;
    margin: 10px 0 0 30px;
}

.field-map-images {
    display: flex;
    gap: 75px;
    margin: 10px 0 10px 40px;
}

.field-map-item {
    width: 24%; /* Adjust width to fit two items in a row */
    text-align: center;
}

.field-map-item h4 {
    margin-bottom: 10px; /* Add some space below the title */
}

.field-map-item img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

footer {
    background: url('../images/panoramic.webp') no-repeat center center;
    background-size: cover;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    width: 100%;
    height: 225px;
}

footer p {
    padding: 200px 0 0 0;
}

#social-media {
    display: flex;
    justify-content: center;
}

#social-media a {
    display: flex;
    align-items: center;
    color: #228B22;
    font-size: 1.5rem;
    text-decoration: none;
    gap: 10px;
}

#social-media img {
    width: 50px;
}

#standings{
    padding: 30px 0;
}

.section-header{
    background-color: #228B22;
    height: 100px;
    margin-bottom: 50px;
    top: 0;
}

.section-header h1{
    display: flex;
    font-size: 3rem;
    color: #fff;
    justify-content: center;
    align-items: center;
    padding-top: 25px;
    margin-top: 0;
}

.roster-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center; /* Ensure all items are stretched to the same height */
}

.roster-item {
    flex: 1 1 150px;
    max-width: 150px;
    text-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
}

.roster-item img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.5s cubic-bezier(0.33, 1.35, 0.52, 1);
    will-change: transform;
}

/* No filter/shadow so transparent PNGs stay clean on the page background */
.roster-item img:hover,
.roster-item.is-picked img {
    transform: scale(1.62) rotate(0.75deg);
    z-index: 4;
}

.roster-item p {
    margin-top: 10px;
    font-size: 1.2rem;
    color: #066e06; /* Forest Green */
    z-index: 0;
}

.roster-item .sunflower-name{
    display: flex;  
    align-items: stretch;
    justify-content: space-evenly;
    height: 40px;
}

.roster-item .sunflower-name img{
    width: 30px;
    height: 30px;
    transform: none; /*  */
}

.roster-item .sunflower-name p{
   margin-top: 10px;

}

.roster-item img:hover + p,
.roster-item.is-picked img + p {
    color: #fff;
    background: #228B22;
    border: 2px solid #228B22;
    padding: 5px;
    border-radius: 8px;
    z-index: 5;
    margin-top: 0;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    transform: translateY(-2px);
}

.roster-item img:hover + div,
.roster-item.is-picked img + div {
    color: #fff;
    background: #228B22;
    border: 2px solid #228B22;
    padding: 0 5px;
    border-radius: 8px;
    z-index: 5;
    height: 35px;
    transition: background 0.25s ease, transform 0.25s ease;
    transform: translateY(-2px);
}

.roster-item img:hover + div p,
.roster-item.is-picked img + div p {
    margin-top: 0;
    color: #fff;
    padding: 5px;
    z-index: 5;
}

.roster-item .sunflower-name img:hover + p {
    height: 25px;
    color: #228B22;
    background: #fff;
    padding: 10px;
    border: none;
    transform: none;
}

/* ===== LINEUP PITCH ===== */

.lineup-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px 8px;
}

.lineup-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.lineup-formation-badge {
    background: #145214;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 5px 18px;
    border-radius: 20px;
    letter-spacing: 0.06em;
}

.lineup-note {
    font-size: 0.78rem;
    color: #6b7280;
    text-align: center;
    margin: 0 0 12px;
    font-style: italic;
}

.lineup-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.lineup-controls__formation {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #374151;
    font-weight: 600;
}

.lineup-controls__formation select {
    font-size: 0.85rem;
    padding: 5px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    outline: none;
}

.lineup-controls__formation select:focus {
    border-color: #145214;
}

#lineup-shuffle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    background: #145214;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

#lineup-shuffle-btn:hover {
    background: #1a7a1a;
}

#lineup-shuffle-btn:active {
    background: #0f3d0f;
}

.pitch {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 68 / 105;
    background: repeating-linear-gradient(
        to bottom,
        #2d8f3f 0%,
        #2d8f3f 8.33%,
        #31994a 8.33%,
        #31994a 16.67%,
        #2d8f3f 16.67%,
        #2d8f3f 25%,
        #31994a 25%,
        #31994a 33.33%,
        #2d8f3f 33.33%,
        #2d8f3f 41.67%,
        #31994a 41.67%,
        #31994a 50%,
        #2d8f3f 50%,
        #2d8f3f 58.33%,
        #31994a 58.33%,
        #31994a 66.67%,
        #2d8f3f 66.67%,
        #2d8f3f 75%,
        #31994a 75%,
        #31994a 83.33%,
        #2d8f3f 83.33%,
        #2d8f3f 91.67%,
        #31994a 91.67%,
        #31994a 100%
    );
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    overflow: visible;
}

/* Field markings */
.pitch__center-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: rgba(255,255,255,0.65);
    transform: translateY(-50%);
}

.pitch__center-circle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 27%;
    aspect-ratio: 1;
    border: 2px solid rgba(255,255,255,0.65);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.pitch__center-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255,255,255,0.75);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Penalty areas — based on real pitch proportions (40.32m wide, 16.5m deep out of 68×105) */
.pitch__penalty-area {
    position: absolute;
    left: 20.35%;
    width: 59.3%;
    height: 15.7%;
    border: 2px solid rgba(255,255,255,0.65);
}

.pitch__penalty-area--top {
    top: 0;
    border-top: none;
}

.pitch__penalty-area--bottom {
    bottom: 0;
    border-bottom: none;
}

/* Goal areas — 18.32m wide, 5.5m deep */
.pitch__goal-area {
    position: absolute;
    left: 36.5%;
    width: 27%;
    height: 5.2%;
    border: 2px solid rgba(255,255,255,0.65);
}

.pitch__goal-area--top {
    top: 0;
    border-top: none;
}

.pitch__goal-area--bottom {
    bottom: 0;
    border-bottom: none;
}

/* Player token */
.pitch__player {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    z-index: 2;
    cursor: default;
}

.pitch__player img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    background: #1a6b1a;
    display: block;
}

.pitch__player--empty img {
    opacity: 0.45;
    border: 2px dashed rgba(255,255,255,0.6);
}

.pitch__player-name {
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.85);
    white-space: nowrap;
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    line-height: 1;
}

.pitch__player-pos-badge {
    font-size: 0.48rem;
    font-weight: 800;
    color: #fff;
    background: rgba(14, 58, 14, 0.82);
    padding: 1px 5px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

/* ===== PITCH PLAYER INTERACTION ===== */

.pitch__player:not(.pitch__player--empty) {
    cursor: pointer;
}

.pitch__player--selected img {
    filter: grayscale(1) brightness(0.55);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.pitch__player--selected .pitch__player-name {
    opacity: 0.5;
}

@keyframes pitch-swap-pop {
    0%   { transform: scale(0.7);  opacity: 0.5; }
    60%  { transform: scale(1.22); opacity: 1;   }
    100% { transform: scale(1);    opacity: 1;   }
}

.pitch__player--swap-in img {
    animation: pitch-swap-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes squad-tap-flash {
    0%   { background: #86efac; }
    100% { background: #f8fdf8; }
}

.roster-list-item--tapped {
    animation: squad-tap-flash 0.5s ease-out forwards;
}

/* ===== ROSTER LIST ===== */

.roster-list-container {
    max-width: 560px;
    margin: 28px auto 40px;
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
}

.roster-list-title {
    font-size: 1.8rem;
    color: #066e06;
    text-align: center;
    margin: 0 0 16px;
    letter-spacing: 0.06em;
}

.roster-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.roster-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fdf8;
    border: 1px solid #dcfce7;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.roster-list-item:hover {
    background: #f0fdf4;
}

.roster-list-item:not(.roster-list-item--memorial) {
    cursor: pointer;
}

.roster-list-item--selected {
    background: #dcfce7;
    border-color: #22c55e;
    outline: 2px solid rgba(34, 197, 94, 0.35);
}

.roster-list-item--on-field {
    background: #bbf7d0;
    border-color: #86efac;
}


.roster-list-item__img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #228b22;
    flex-shrink: 0;
}

.roster-list-item__info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.roster-list-item__name {
    font-size: 1rem;
    font-weight: 600;
    color: #145214;
}

.roster-list-item__pos {
    font-size: 0.72rem;
    font-weight: 700;
    color: #145214;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.roster-list-item__sunflower {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.roster-list-memorial-divider {
    height: 1px;
    margin: 12px 0 8px;
    background: linear-gradient(to right, transparent, #f59e0b, transparent);
    opacity: 0.5;
}

.roster-list-item--memorial {
    background: #fffbeb;
    border-color: #fde68a;
}

.roster-list-item--memorial:hover {
    background: #fef3c7;
}

.roster-list-item--memorial .roster-list-item__img {
    border-color: #f59e0b;
}

.roster-list-item--memorial .roster-list-item__name {
    color: #92400e;
}

.roster-list-item--memorial .roster-list-item__sunflower {
    width: 26px;
    height: 26px;
}

@media (max-width: 640px) {
    .pitch__player img {
        width: 48px;
        height: 48px;
    }

    .pitch__player-name {
        font-size: 0.6rem;
        max-width: 58px;
    }

    .pitch__player-pos-badge {
        font-size: 0.46rem;
        padding: 1px 4px;
    }
}

#add-player-stats-form-header, #add-game-stats-form-header {
    color: #228B22;
    text-align: center;
    font-size: 2rem;
    display: flex;
    justify-content: center;
    margin: 0;

}

#add-player-stats-form {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin: 0 0 50px 0;
}

.add-player-stats-form-fields {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 50px;
    margin: 0px 0 25px 0;
    font-size: 1.5rem;
}

#add-player-stats-form div:nth-of-type(4) {
    margin: 0;
}

#goalkeeper-saves-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 60px;
}

#assisted-by-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 94px;
    margin: 0;
}

/************************** ADMIN *************************************/

#games-list-header, #stats-list-header {
    color: #228B22;
    text-align: center;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    margin: 50px 0 0 0;
}

#add-game-form {
    display: flex;
    flex-direction: column;
    margin: 0 0 50px 0;
    align-items: center;
    align-content: center;
    flex-wrap: wrap;
}

#manage-stats-list-header, #manage-players-list-header {
    color: #228B22;
    text-align: center;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    margin: 50px 0 0 0;
}

#add-game-submit, #add-player-stats-submit {
    margin: 10px 0 10px 0;
    font-size: 20px;
    color: white;
    background-color: #228B22;
    border-radius: 15px;
    padding: 10px 30px;
}

#add-player-submit, #delete-player-submit, #resurrect-player-submit {
    margin: 10px 0 10px 0;
    font-size: 14px;
    color: white;
    background-color: #228B22;
    border-radius: 15px;
    padding: 8px 15px;
}

#delete-player-submit {
    background-color: #e92c2c;
}

#resurrect-player-submit {
    background-color: #257de4;
}

#add-game-submit-container, #add-player-stats-submit-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 10px 0;
}

.games_table_container, .players_table_container {
    display: flex;
    justify-content: center;
    margin: 0 0 50px 0;
}

#games_table, #manage-stats-table{
    border: 0;
    border-spacing: 0;
}

#games_table th, #manage-stats-table th {
    padding: 5px;
    text-align: center;
    background-color: #228B22;
    color: white;
    border: 2px solid white; /* Simulate cellspacing with border */
    cursor: default;
}

#games_table tr:nth-child(odd), #manage-stats-table tr:nth-child(odd) {
    background-color: #ddffdd; /*#d5dcd8;*/
    border: 2px solid white; /* Simulate cellspacing with border */
}

#games_table td, #manage-stats-table td {
    text-align: center;
    padding: 10px;
}

#games_table button {
    background-color: #257de4;
    color: white;
    border-radius: 10px;
    border: 2px solid #257de4;
}

#manage-stats-table input {
    background-color: #e92c2c;
    color: white;
    border-radius: 10px;
    border: 2px solid #e92c2c;
}

#sticky-button{
    display:none;
}

/* Media query for mobile devices */
@media (max-width: 1600px) {
    #main-title {
        font-size: 4.5rem;
    }
}

@media (max-width: 1400px) {
    #main-title {
        font-size: 4rem;
    }
}

@media (max-width: 1200px) {
    #main-title {
        font-size: 3.5rem;
    }
}

@media (max-width: 1024px) {
    
    nav.side-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 100vw;
        height: 65px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
        padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
        transition: height 0.4s ease;
    }

    nav.side-menu .logo {
        display: block;
        position: absolute;
        top: 50%;
        left: max(8px, env(safe-area-inset-left, 0px));
        transform: translateY(-50%);
        width: 52px;
        height: auto;
    }

    nav.side-menu .nav-menu-toggle {
        display: flex;
        position: absolute;
        top: 50%;
        right: max(8px, env(safe-area-inset-right, 0px));
        transform: translateY(-50%);
        margin: 0;
        flex-shrink: 0;
    }

    nav.side-menu.expanded .nav-menu-toggle {
        top: 12px;
        transform: none;
    }

    nav.side-menu .menu-items {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        background: #228B22;
        position: absolute;
        top: 65px;
        left: 0;
        max-height: 0;
        overflow: hidden;
        padding: 0.35rem 0 0.85rem;
        gap: 0;
    }
    
    nav.side-menu .menu-items a {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0.9rem 1.35rem;
        font-size: 1.05rem;
        font-weight: 500;
        letter-spacing: 0.01em;
        text-transform: none;
        color: #fff;
        text-decoration: none;
        text-align: left;
        background: transparent;
        border: none;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14);
        box-sizing: border-box;
        box-shadow: none;
        transition: background 0.15s ease;
    }

    nav.side-menu .menu-items a:last-child {
        border-bottom: none;
    }

    nav.side-menu .menu-items a:hover,
    nav.side-menu .menu-items a:focus-visible {
        background: rgba(0, 0, 0, 0.14);
        outline: none;
    }

    @keyframes nav-menu-link-in {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    nav.side-menu.expanded .menu-items a {
        animation: nav-menu-link-in 0.22s ease backwards;
    }

    nav.side-menu.expanded .menu-items a:nth-child(1) { animation-delay: 0.02s; }
    nav.side-menu.expanded .menu-items a:nth-child(2) { animation-delay: 0.04s; }
    nav.side-menu.expanded .menu-items a:nth-child(3) { animation-delay: 0.06s; }
    nav.side-menu.expanded .menu-items a:nth-child(4) { animation-delay: 0.08s; }
    nav.side-menu.expanded .menu-items a:nth-child(5) { animation-delay: 0.1s; }
    nav.side-menu.expanded .menu-items a:nth-child(6) { animation-delay: 0.12s; }
    nav.side-menu.expanded .menu-items a:nth-child(7) { animation-delay: 0.14s; }
    nav.side-menu.expanded .menu-items a:nth-child(8) { animation-delay: 0.16s; }

    nav.side-menu.expanded .menu-items {
        display: flex; /* Show menu items when expanded */
        /* Cap to visible viewport below the bar so landscape phones aren’t cut off */
        max-height: calc(min(600px, 100vh) - 65px - env(safe-area-inset-bottom, 0px));
        max-height: calc(min(600px, 100dvh) - 65px - env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        width: 100%;
    }

    nav.side-menu.expanded {
        /* Don’t extend past the screen in short landscape (was fixed 600px). */
        height: min(600px, 100vh);
        height: min(600px, 100dvh);
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        z-index: 999;
    }
  
    .home-section {
        background: url('../images/sunrise_blurred_mobile.jpg') no-repeat center center;
        background-size: cover;
        height: 100vh;
        width: auto;
        overflow-x: hidden;
        position: relative;
        z-index: 0;
        pointer-events: auto;
    }

    /* Hero is in normal flow on small screens; drop extra spacer */
    main > .home-section + * {
        margin-top: 0;
    }

    #main-logo {
        position: absolute;
        top: 75px;
        height: 15%;
        width: 20%;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    #main-title {
        font-size: 1.5rem;
        bottom: 20%;
        left: auto;
        right: clamp(0.65rem, 3.5vw, 1.25rem);
        width: auto;
        max-width: min(88vw, 16rem);
        justify-content: flex-end;
        text-align: right;
    }

    #main-title h1 {
        margin: 0;
        text-align: right;
        width: 100%;
    }

    .modal {
        top: 10%;
        left: 10%; /* Center the modal horizontally */
        right: 10%;
    }

    #graph-container svg.chem-graph {
        width: 100%;
        max-width: 100%;
    }

    #add-game-error-message {
        display: flex;
        justify-content: center;
        font-size: 1.5rem;
        width: 75%;
    }

    #all-chart-container {
       flex-direction: column;
    }

    .chart-container {
        width:95%;
    }

    #game-stats-table {
        width: 100%;
    }

    .sv-modal-card__body {
        max-height: min(52vh, 380px);
    }

    #games-filter-container {
        margin-top: 25px;
    }

    #additional-filters-and-line-chart {
        width: 100%;
        margin: 10px 0;
    }

    #additional-filters {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .games-filter-field {
        align-items: center;
    }

    .games-filter-check {
        padding-bottom: 0;
    }
   
    #line-chart-container {
        width: 98%;
        right: 0;
    }
   
    #assist-chart-container, #yellow-card-chart-container, #goal-chart-container {
        width: 99%;
    }

    #games-container, #stats-and-first-chart, #assists-and-yellow-cards-chart {
        flex-direction: column;
        width: 100%;
        margin: 0;;
    }

    #games-and-line-graph-container {
        flex-direction: column;
        width: 100%;
    }

    #games-and-totals-container {
        width: 100%;
    }

    #wins-losses-container {
        margin-top: 0;
        margin-bottom: 0;
        flex-direction: column;
        width: 100%;
    }


    #assists-and-yellow-cards-chart {  
        margin: 20px 0 20px 0;
    }

    #player-total-stats th img {
        margin-top: 5px;
    }

    #player-total-stats-container, #games-data-table-container {
        width: 100%;
    }

    .modal-player-info {
        flex-direction: column;
        margin: 10px 15px 30px 15px;
        gap: 20px;
    }

    .modal-content {
        width: 100%;
    }

    .about-container {
        flex-direction: column; /* Stack items vertically on mobile */
    }

    .about-item {
        flex-direction: column; /* Stack image and text vertically on mobile */
        /*overflow: hidden;*/ /* This makes the transitions not work */
    }

    .about-item.reverse {
        flex-direction: column-reverse; /* Reverse the order of image and text for the second about-item */
    }

    .about-item img {
        width: 100%; /* Full width for the image on mobile */
        margin-right: 0; /* Remove right margin */
        margin-bottom: 0; /* Add bottom margin */
    }

    .about-item img:nth-child(1) {
        height: auto;
    }

    .about-item p {
        width: 100%; /* Full width for the text on mobile */
        font-size: 1.5rem; /* Adjust font size for mobile */
        padding: 20px 50px 40px 50px;
        animation: scroll-slide linear;
        animation-timeline: view();
        animation-range-start: cover;
        animation-range-end: contain;
    }

    .about-item p .small-img {
        width: 125px; /* Set a fixed width for the small image */
        height: 125px; /* Set a fixed height for the small image */
        margin-bottom: 30px; /* Add margin below the small image */ 
    }

    .section-header{
        margin-top:65px;
    }

    .section-header h1{
        display: flex;
        font-size: 1.75rem;
    }

    #about .section-header {
        margin-top: 0;
    }

    .photo-header h1 {
        font-size: 1.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #switching-images-container {
      width: 100vw;
      margin: 0;
    }

    .switching-images img {
        width: 95vw;
        height: auto;
    }

    .switching-images h2 {
        font-size: 1rem;
    }

    #gallery{
        padding: 30px 5px;
        background-color: #fff;
    }

    #carousel-gallery {
        width: 97vw; /* Set the width to 100% of the viewport width */
        margin: 0 6px; /* Remove any margin */
        height: 100%;
    }

    .carousel {
        max-width: 97vw; /* Set the max-width to 100% of the viewport width */
        height: auto; /* Adjust the height to auto */
    }

    .carousel-item {
        height: auto; /* Adjust the height to auto */
        max-height: 275px;
    }

    .carousel-item img {
        object-fit: contain; /* Ensure the image covers the container */
    }

    #carousel-previews {
        gap: 5px; /* Adjust gap for smaller screens */
        max-width: 375px;
    }

    #schedule {
        position: relative;
        z-index: 3;
        padding-left: 0;
        height: auto;
    }

    .roster-grid {
        gap: 10px; /* Adjust gap for smaller screens */
    }

    .roster-item {
        flex: 1 1 100px; /* Adjust flex-basis for smaller screens */
    }

    .roster-item p {
        font-size: 1rem; /* Adjust font size for smaller screens */
    }

    .roster-item img {
        border-radius: 8px;
        transition: transform 0.5s cubic-bezier(0.33, 1.35, 0.52, 1);
    }

    .roster-item img:hover,
    .roster-item.is-picked img {
        transform: scale(1.55) rotate(0.6deg);
    }

    #contact iframe {
        width: 100%;
        height: 475px;
        margin: 10px 0 0 0;
    }

    .field-map-images {
        flex-direction: column; /* Stack images vertically on mobile */
        margin: 10px 0 10px 0; /* Adjust margin for smaller screens */
        gap: 10px;
    }

    .field-map-item {
        width: 100%; /* Full width for the items on mobile */
        margin-bottom: 20px; /* Add bottom margin */
    }

    .field-map-item img {
        width: 100%; /* Full width for the images on mobile */
    }

    #add-game { 
        display: flex;
        flex-direction: column;
    }

    #add-game label {
        margin: 10px 0 0 0;
        font-size: 1.5rem;
    }

    #add-game input, #add-game select {
        margin: 0 0 10px 0;
        font-size: 1.5rem;
    }

    #add-game-submit {
        font-size: 2.5rem;
    }
    /*
    #sticky-button{
        display:flex;
        justify-content: center;
        width: 100%;
        position: sticky;
        bottom: 0;
        z-index: 999;
        background-color: white;
        height: 100px;
    }

    #sticky-button button {
        font-size: 2rem;
        width: 100%;
        padding: 1rem;
        color: white;
        background-color: #c8102e;
        margin: 1rem;
    }
    */
    footer{
        display: flex;
        align-items: flex-end;
        justify-content: center;
        height: 90px;
    }
}

@media (max-width: 560px) {
    .carousel-item {
        max-height: 252.2px;
    }
}

/* —— Statistics modals: full overlay (player, game, chemistry) —— */
#individualModal.modal,
#gameStatsModal.modal,
#chemistryModal.modal {
    position: fixed;
    inset: 0;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    padding: 1.25rem;
    box-sizing: border-box;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(13, 77, 13, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: none;
    box-shadow: none;
    z-index: 1200;
    overflow-y: auto;
}

#individualModal .modal-content,
#gameStatsModal .modal-content,
#chemistryModal .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    justify-content: flex-start;
    background: transparent;
}

#individualModal .modal-content {
    max-width: 480px;
}

#gameStatsModal .modal-content {
    max-width: 520px;
}

#chemistryModal .modal-content {
    max-width: min(720px, 100%);
}

/* Chemistry modal: focus player photo in green header; row avatars in table */
.sv-modal-card__header--chemistry {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    text-align: left;
    padding: 1rem 2.75rem 1rem 1rem;
}

.sv-modal-card__header-photo {
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.sv-modal-card__header-text {
    flex: 1;
    min-width: 0;
}

.sv-modal-card__header--chemistry .sv-modal-card__subtitle {
    margin-top: 0.28rem;
}

.connections-table__player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.connections-table__avatar {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    flex-shrink: 0;
    border: 1px solid rgba(34, 139, 34, 0.28);
}

.connections-table__player-name {
    font-weight: 600;
    line-height: 1.25;
    min-width: 0;
}

#connections-table.sv-data-table td.connections-table__player {
    vertical-align: middle;
}

#individualModal .close,
#gameStatsModal .close,
#chemistryModal .close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 5;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 50%;
    border: none;
}

/* Shared card shell (game + chemistry modals) */
.sv-modal-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 24px 56px rgba(0, 60, 0, 0.2),
        0 0 0 1px rgba(34, 139, 34, 0.12);
    width: 100%;
    max-width: 100%;
}

.sv-modal-card__header {
    background: linear-gradient(135deg, #145214 0%, #228B22 42%, #2f9d4f 100%);
    color: #fff;
    padding: 1.1rem 2.6rem 1rem 1.15rem;
}

.sv-modal-card__header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.25;
}

.sv-modal-card__subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.88rem;
    line-height: 1.35;
    opacity: 0.93;
    color: rgba(255, 255, 255, 0.95);
}

.sv-modal-card__body {
    padding: 1rem 1.15rem 1.25rem;
    max-height: min(58vh, 440px);
    overflow-y: auto;
}

.sv-modal-card__empty {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
}

.sv-modal-card__section-label {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2e6b2e;
}

.sv-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.sv-data-table th {
    text-align: left;
    padding: 0.45rem 0.5rem;
    background: #228B22;
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sv-data-table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sv-data-table tbody tr:nth-child(even) {
    background: #f0fdf4;
}

.sv-data-table--compact td {
    padding: 0.35rem 0.5rem;
}

#connections-table.sv-data-table {
    table-layout: fixed;
}

#connections-table.sv-data-table th {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    word-break: normal;
    overflow-wrap: break-word;
    vertical-align: bottom;
}

/* Keep “Total” on one line; mid-word breaks looked like “TOT / AL” */
#connections-table.sv-data-table th:nth-child(2),
#connections-table.sv-data-table td:nth-child(2) {
    width: 4.5rem;
    max-width: 4.5rem;
    white-space: nowrap;
    text-align: center;
}

#connections-table.sv-data-table th:nth-child(3),
#connections-table.sv-data-table th:nth-child(4),
#connections-table.sv-data-table td:nth-child(3),
#connections-table.sv-data-table td:nth-child(4) {
    text-align: center;
}

#connections-table.sv-data-table th:first-child,
#connections-table.sv-data-table td:first-child {
    text-align: left;
}

.player-modal-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 24px 56px rgba(0, 60, 0, 0.2),
        0 0 0 1px rgba(34, 139, 34, 0.12);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Player detail modal uses Atlas layout only (see showIndividualModal in statistics.js) */
#individualModal.individual-modal--atlas .close {
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
}

.player-modal-card--atlas {
    border-radius: 14px;
    overflow: hidden;
    background: #f1f5f9;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.player-modal-atlas__hero--fit {
    position: relative;
    height: auto;
    min-height: 120px;
    max-height: min(68vh, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(165deg, #e2e8f0 0%, #f1f5f9 45%, #e8eef4 100%);
}

.player-modal-atlas__hero-img--contain {
    height: auto;
    max-height: min(68vh, 500px);
    width: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}

.player-modal-atlas__hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.25) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem 1.15rem;
    color: #fff;
}

.player-modal-atlas__hero-overlay h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.player-modal-atlas__season {
    margin: 0.3rem 0 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.92);
}

.player-modal-atlas__stats {
    list-style: none;
    margin: 0;
    padding: 0.85rem 0.65rem 1rem;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.45rem;
    background: #fff;
    border-top: 4px solid #228B22;
}

.player-modal-atlas__stats li {
    min-width: 0;
    text-align: center;
    padding: 0.5rem 0.35rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 4.75rem;
    box-sizing: border-box;
    background: linear-gradient(180deg, #f7fcf7 0%, #edf8ee 100%);
    border: 1px solid rgba(34, 139, 34, 0.22);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(34, 139, 34, 0.06);
}

.player-modal-atlas__stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 600;
    line-height: 1.2;
    min-height: 3em;
    max-width: 100%;
}

.player-modal-atlas__stats strong {
    display: block;
    font-size: 1.28rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: auto;
    padding-top: 0.15rem;
}

@media (max-width: 520px) {
    .player-modal-atlas__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-modal-atlas__stats li:nth-child(5) {
        grid-column: 1 / -1;
        max-width: 12rem;
        margin: 0 auto;
        width: 100%;
    }
}

/* Admin: schedule paste import */
.admin-schedule-import {
    margin: 1rem 1.5rem 2rem;
    padding: 1rem 1.25rem;
    border: 2px solid #228B22;
    border-radius: 10px;
    max-width: 920px;
    background: #f9fdf9;
}

.admin-schedule-import__help {
    font-size: 0.95rem;
    line-height: 1.45;
    color: #333;
    margin: 0 0 1rem;
}

.admin-schedule-import__form label {
    display: block;
    font-weight: 600;
    margin-top: 0.5rem;
}

.admin-schedule-import textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, monospace;
    font-size: 0.88rem;
    margin: 0.35rem 0 0.75rem;
    padding: 0.5rem;
}

.admin-schedule-import__row {
    margin: 0.5rem 0;
    font-size: 0.92rem;
}

.admin-schedule-import__hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: #555;
    max-width: 42rem;
    line-height: 1.35;
}

.admin-schedule-import__submit {
    margin-top: 0.75rem;
    padding: 0.45rem 1.1rem;
    font-size: 1rem;
    background: #228B22;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.admin-schedule-import__submit:hover {
    background: #006400;
}

.admin-schedule-flash {
    margin: 1rem 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    max-width: 920px;
    line-height: 1.4;
}

.admin-schedule-flash--ok {
    color: #0d4d0d;
    background: #e8f8e8;
    border: 1px solid #228B22;
}

.admin-schedule-flash--err {
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #dc2626;
}

/* Busiest pair / most teammates: stack ties vertically */
#statistics #best-connection-summary,
#statistics #most-unique-connections-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* —— Statistics page (mobile): center player table, connections card, chemistry graph —— */
@media (max-width: 1024px) {
    #statistics .list-filter {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    #statistics .list-filter label {
        margin-bottom: 0.25rem;
    }

    #statistics .list-filter select {
        margin-left: auto;
        margin-right: auto;
    }

    #statistics #all-stats-filter-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100%;
    }

    #statistics #stats-and-first-chart {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    #statistics #player-total-stats-container {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #statistics #just-player-total-stats {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    #statistics #player-total-stats thead,
    #statistics #player-total-stats tbody,
    #statistics #player-total-stats tfoot,
    #statistics #player-total-stats thead tr,
    #statistics #player-total-stats tbody tr,
    #statistics #player-total-stats tfoot tr {
        width: 100% !important;
        max-width: min(36rem, calc(100vw - 2rem));
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    #statistics #player-total-stats th {
        justify-content: center;
        text-align: center;
    }

    #statistics #player-total-stats td:nth-child(1) {
        text-align: center;
        align-items: center;
    }

    #statistics #player-total-stats tbody td:nth-child(1).player-total-stats__name-cell {
        justify-content: flex-start;
        text-align: left;
    }

    #statistics .insight-card--chemistry {
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center;
        max-width: min(440px, calc(100% - 2rem));
    }

    #statistics .insight-card--chemistry .insight-card__body,
    #statistics .insight-card--chemistry .insight-card__subtitle {
        text-align: center;
    }

    #statistics .insight-card--chemistry .insight-card__connection-line {
        justify-content: center;
        width: 100%;
    }

    #statistics #chemistry-filter-container {
        margin-top: 0.5rem;
    }

    #statistics #graph-container {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        align-items: center;
        padding: 0 0.75rem;
        box-sizing: border-box;
    }

    #statistics #graph-container svg.chem-graph {
        width: 100% !important;
        max-width: min(100%, 520px);
        height: auto !important;
        min-height: 280px;
        margin: 0 auto;
        display: block;
    }

    #statistics #best-connection-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    #statistics .match-insights {
        justify-content: center;
    }

    #statistics #assists-and-yellow-cards-chart {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    #statistics #goal-chart-container,
    #statistics #assist-chart-container,
    #statistics #yellow-card-chart-container {
        width: 100% !important;
        max-width: min(520px, calc(100vw - 1.5rem));
        margin-left: auto;
        margin-right: auto;
    }
}