/* ---------- Global base ---------- */
html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #e6e2d4;
    color: #3563a6;
    min-height: 100%;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ---------- Landing page ---------- */
h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

#startButton {
    background-color: #1ab3cb;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 15px 40px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#startButton:hover {
    background-color: #148ca3;
    transform: translateY(-2px);
    box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.4);
}

.footer {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #555555;
    text-align: center;
    padding: 0 10px;
}

.tagline {
    position: absolute;
    bottom: 20px;
    text-align: center;
    font-size: 1rem;
    color: #555555;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Game page structure ---------- */
.game-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    padding: 20px;
}

.field-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.side-column {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    width: 250px;
}

#outerCanvas {
    position: relative;
    background: #2f854b;
    width: 90vw;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #ffffff;
    border-radius: 14px;
    box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

#strikeZone {
    position: absolute;
    background: #2daec6;
    width: 50%;
    height: 50%;
    border: 2px solid #7aef2d;
}

#ball {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fcf6e0;
    border-radius: 50%;
    display: none;
    box-shadow: 0px 0px 15px rgba(214, 2, 2, 0.8);
}

#nextPitchButton {
    display: none;
    width: 100%;
    border: none;
    border-radius: 12px;
    background: #D1495B;
    color: #fcf6e0;
    font-family: Arial, sans-serif;
    font-weight: 700;
    font-size: 1.45rem;
    padding: 28px 20px;
    cursor: pointer;
    box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.10);
}

#nextPitchButton:active {
    transform: translateY(1px);
}

#statsBar {
    background: rgba(183, 174, 157, 0.92);
    color: #ffffff;
    padding: 18px 20px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.28;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0px 0px 14px rgba(0, 0, 0, 0.12);
    width: 100%;
}

#statsBar p {
    margin: 0;
}

#statsBar strong {
    color: #eeeb39;
}

.game-menu-return {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 18px 0 8px;
}

#mainMenuLink {
    color: #6f7883;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
}

#mainMenuLink:hover {
    text-decoration: underline;
}

/* ---------- Landing page mobile ---------- */
@media (max-width: 700px) and (orientation: portrait) {
    .game-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px 16px 18px;
    }

    .field-column,
    .side-column {
        width: 100%;
        max-width: 760px;
        align-items: center;
    }

    #outerCanvas {
        width: min(92vw, 760px);
        max-width: none;
    }

    .side-column {
        gap: 18px;
    }

    #nextPitchButton {
        display: block;
        width: min(64vw, 360px);
        min-height: 86px;
        font-size: clamp(1.6rem, 5vw, 2.1rem);
    }

    #statsBar {
        width: min(86vw, 680px);
        font-size: clamp(0.95rem, 2.8vw, 1.18rem);
        border-radius: 18px;
    }

    .game-menu-return {
        margin: 12px 0 18px;
    }

    #mainMenuLink {
        font-size: 0.95rem;
    }
}

/* ---------- Landscape mobile game ---------- */
@media (max-width: 950px) and (orientation: landscape) {
    body {
        justify-content: center;
        padding: 12px;
        min-height: 100vh;
        overflow: hidden;
    }

    .game-wrapper {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 0;
        width: 100%;
        max-width: 1200px;
        height: calc(100vh - 56px);
    }

    .field-column {
        flex: 0 1 auto;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .side-column {
        width: min(34vw, 360px);
        gap: 14px;
        justify-content: center;
    }

    #outerCanvas {
        width: auto;
        height: min(78vh, 78vw);
        aspect-ratio: 1 / 1;
        max-width: min(56vw, 760px);
        max-height: calc(100vh - 56px);
    }

    #nextPitchButton {
        display: block;
        width: 100%;
        min-height: 90px;
        font-size: clamp(1.5rem, 3vw, 2rem);
        padding: 24px 18px;
    }

    #statsBar {
        width: 100%;
        font-size: clamp(0.9rem, 1.6vw, 1.1rem);
    }

    .game-menu-return {
        margin: 8px 0 0;
    }

    #mainMenuLink {
        font-size: 0.9rem;
    }
}

/* ---------- Desktop-ish portrait fallback ---------- */
@media (min-width: 701px) and (orientation: portrait) {
    .side-column {
        width: 250px;
    }
}