/* ==========================
   Global Layout
========================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background-image: url('https://s3.amazonaws.com/scoremonster/images/league/dce4e55a-8c3e-44ae-a4d7-cf21382f8a69.jpg?build=04.11.16');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

.page-shell {
    width: 88%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0;
    background-color: rgba(158, 183, 211, 0.96);
}

.site-main {
    width: 100%;
}

.site-header {
    text-align: center;
    padding: 18px 10px 10px;
}

.site-header h1,
.site-header h3 {
    margin: 0 0 8px;
}

.site-header-light {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

.site-nav {
    width: 100%;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

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

/* ==========================
   Links
========================== */

a:link {
    color: blue;
    text-decoration: none;
}

a:visited {
    color: purple;
    text-decoration: none;
}

a:hover {
    color: red;
    text-decoration: underline;
}

/* ==========================
   Cards
========================== */

.card,
.day-card,
.week-card {
    background-color: #f1f1f1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
}

.card header,
.day-card header,
.week-title {
    background-color: #d0d0d0;
    text-align: center;
    font-weight: bold;
    padding: 6px;
    border-bottom: 1px solid rgba(0,0,0,.1);
}

/* ==========================
   Standings Tables
========================== */

/* Latest Standings */
.latest-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.latest-table th,
.latest-table td {
    box-sizing: border-box;
    padding: 8px 4px;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

/* Team = Seed + Team from class table: 12% + 28% = 40% */
.latest-table th:nth-child(1),
.latest-table td:nth-child(1) {
    width: 40%;
    text-align: left;
    padding-left: 8px;
    text-overflow: ellipsis;
}

/* Win, Loss, GB, Pct = same as Class B/C */
.latest-table th:nth-child(2),
.latest-table td:nth-child(2),
.latest-table th:nth-child(3),
.latest-table td:nth-child(3),
.latest-table th:nth-child(4),
.latest-table td:nth-child(4),
.latest-table th:nth-child(5),
.latest-table td:nth-child(5) {
    width: 15%;
    text-align: center;
}


/* Class B / Class C Standings */
.class-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.class-table th,
.class-table td {
    box-sizing: border-box;
    padding: 8px 4px;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

/* Seed = 12% */
.class-table th:nth-child(1),
.class-table td:nth-child(1) {
    width: 12%;
    min-width: 50px;
}

/* Team = 28% */
.class-table th:nth-child(2),
.class-table td:nth-child(2) {
    width: 28%;
    text-align: left;
    padding-left: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Win, Loss, GB, Pct = 15% each */
.class-table th:nth-child(3),
.class-table td:nth-child(3),
.class-table th:nth-child(4),
.class-table td:nth-child(4),
.class-table th:nth-child(5),
.class-table td:nth-child(5),
.class-table th:nth-child(6),
.class-table td:nth-child(6) {
    width: 15%;
    text-align: center;
}

/* ==========================
   Home Page Columns
========================== */

.main-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    min-height: calc(100vh - 230px);
    align-items: stretch;
    gap: 0;
}

.main-columns > .col {
    background: white;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    padding: 12px;
    min-width: 0;
}

.main-columns h4,
.main-columns h5 {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 16px;
}

#upcoming-games .card li,
#recent-results .card li {
    text-align: center;
}

#upcoming-games .card ul,
#recent-results .card ul {
    padding-left: 0;
}

#upcoming-games .card header,
#recent-results .card header {
    text-align: center;
}

/* Medium screens: 2 columns */
@media only screen and (max-width: 1100px) {
    .page-shell {
        width: 94%;
    }

    .main-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-columns > .col:first-child {
        grid-column: 1 / -1;
    }
}

/* Phones: 1 column */
@media only screen and (max-width: 700px) {
    
    .page-shell {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .main-columns {
        display: grid;
        grid-template-columns: 1fr;
    }

    .main-columns > .col:first-child {
        grid-column: auto;
    }

    .main-columns > .col {
        padding: 4px;
        width: 100%;
        max-width: 100%;
    }

    .table-scroll {
        width: 100%;
        overflow: hidden;
    }

    .standings-table,
    .latest-table,
    .class-table {
        width: 100%;
        table-layout: fixed;
        font-size: 14px;
        border-collapse: collapse;
    }

    .standings-table th,
    .standings-table td,
    .latest-table th,
    .latest-table td,
    .class-table th,
    .class-table td {
        padding: 4px 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Latest Standings */
.latest-table th:nth-child(1),
.latest-table td:nth-child(1) {
    width: 44%;
    text-align: left;
}

.latest-table th:nth-child(2),
.latest-table td:nth-child(2),
.latest-table th:nth-child(3),
.latest-table td:nth-child(3),
.latest-table th:nth-child(4),
.latest-table td:nth-child(4),
.latest-table th:nth-child(5),
.latest-table td:nth-child(5) {
    width: 14%;
}

/* Class B/C Standings */
.class-table th:nth-child(1),
.class-table td:nth-child(1) {
    width: 16%;
}

.class-table th:nth-child(2),
.class-table td:nth-child(2) {
    width: 28%;
    text-align: left;
}

.class-table th:nth-child(3),
.class-table td:nth-child(3),
.class-table th:nth-child(4),
.class-table td:nth-child(4),
.class-table th:nth-child(5),
.class-table td:nth-child(5),
.class-table th:nth-child(6),
.class-table td:nth-child(6) {
    width: 14%;
}
}


/* ==========================
   Schedule Page
========================== */

.city {
    display: none;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 20px;
    padding: 16px;
    align-items: start;
}

.schedule-week {
    min-width: 0;
}

.schedule-week-title {
    text-align: center;
    margin: 8px 0 14px;
    font-weight: normal;
}

.day-card {
    margin: 0 0 18px 0;
    background: #f8f8f8;
}

.day-card ul {
    margin: 0;
}

/* Center games inside schedule cards */
.day-card .w3-ul li {
    padding: 4px 6px !important;
    text-align: center;
}

.region-note {
    background-color: #DAE9F8;
    text-align: center;
    font-weight: bold;
}

.district-note {
    background-color: #DAF2D0;
    text-align: center;
    font-weight: bold;
}

@media only screen and (max-width: 1200px) {
    .schedule-grid {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }
}

@media only screen and (max-width: 900px) {
    .schedule-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media only screen and (max-width: 600px) {
    .schedule-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 10px;
    }
}

.schedule-filter {
    padding: 10px 15px;
    background: #f5f5f5;
}

.schedule-filter label {
    font-weight: bold;
    margin-right: 8px;
}

.schedule-filter select {
    padding: 4px 8px;
    min-width: 180px;
}

/* ==========================
   Banners
========================== */

.banner {
    padding-left: 15px;
    background: rgba(255,255,255,.96);
}

.note-banner {
    padding-left: 15px;
    background: rgba(241,241,241,.96);
}

/* ==========================
   Teams Page
========================== */

.teams-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
}

.team-card {
    height: 100%;
}

.team-card iframe {
    width: 100%;
    height: 250px;
}

@media only screen and (max-width: 1100px) {
    .teams-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width: 700px) {
    .teams-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }
}

/* ==========================
   Footer
========================== */

.site-footer {
    text-align: center;
    padding: 6px 0;
    margin: 0;
    background: transparent;
    border: none;
    font-size: 14px;
    line-height: 1.2;
}
