/* ==========================================================================
   Football Game with Brovko & Murchyk - Main Styles
   ========================================================================== */

/* Game Container & Stadium Background */
.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background: #1b4332;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    user-select: none;
}

.stadium-bg {
    position: absolute;
    inset: 0;
    background-image: url('background.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Header & Scoreboard Customizations (Matching math-puzzle style) */
.header {
    z-index: 10;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scoreboard-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-card,
.misses-card,
.timer-card {
    background: #FFFFFF;
    border: 4px solid #4A4A8C;
    border-radius: 20px;
    height: 64px;
    padding: 0 20px;
    color: #4A4A8C;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 22px;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(74, 74, 140, 0.15);
    box-sizing: border-box;
}

.timer-icon {
    font-size: 22px;
}

.timer-value {
    color: #4A4A8C;
    font-size: 24px;
    font-weight: 900;
    font-family: monospace, sans-serif;
    letter-spacing: 1px;
}

.timer-value.low-time {
    color: #EE5253;
    animation: timerPulse 0.8s ease infinite alternate;
}

@keyframes timerPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.score-label,
.misses-label {
    color: #4A4A8C;
    font-weight: 800;
}

.score-value {
    color: #FF6B6B;
    font-size: 26px;
    font-weight: 900;
    text-shadow: none;
}

.score-avatar-img {
    height: 38px;
    width: 38px;
    object-fit: contain;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #4A4A8C;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.turn-avatar-img {
    height: 32px;
    width: 32px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #FFFFFF;
}

.chip-avatar-img {
    height: 22px;
    width: 22px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
    border-radius: 50%;
}

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

.player-score {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.player-score.active-turn {
    background: #FFF3C4;
    border: 2px solid #FF8C00;
    transform: scale(1.05);
}

.player-name {
    font-size: 1.05rem;
    color: #4A4A8C;
    font-weight: 800;
}

.miss-balls-container {
    display: flex;
    gap: 4px;
    align-items: center;
}

.miss-ball {
    font-size: 22px;
    transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.miss-ball.lost {
    opacity: 0.25;
    filter: grayscale(1) contrast(0.5);
    transform: scale(0.85);
}

.miss-ball.lost-shake {
    animation: missPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes missPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5) rotate(15deg);
    }

    100% {
        transform: scale(0.85);
    }
}

/* Turn Banner for VS Mode */
.turn-banner {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff9f43, #ee5253);
    color: #ffffff;
    padding: 8px 24px;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    border: 2px solid #ffffff;
    z-index: 12;
    animation: bounceIn 0.5s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Game Area Layout */
.game-area {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px 10px 10px 10px;
    box-sizing: border-box;
}

.field-center-stage {
    position: relative;
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin: auto 0;
}

/* Goal Container & Equation */
.goal-container {
    position: relative;
    width: 90%;
    max-width: 620px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.goal-image {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

.equation-board {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #1e3799, #0c2461);
    color: #ffffff;
    padding: 12px 32px;
    border-radius: 16px;
    border: 3.5px solid #f6b93b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.3);
    z-index: 8;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.equation-text {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.6), 0 0 12px rgba(246, 185, 59, 0.5);
    white-space: nowrap;
}

/* Result Banners (Gol & Miss) */
.result-banner {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    max-width: 320px;
    width: 75%;
    z-index: 25;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
}

.result-banner.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: bannerPulse 0.8s ease infinite alternate;
}

@keyframes bannerPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.08);
    }
}

/* Mascot Characters on Pitch */
.character-wrapper {
    position: absolute;
    bottom: -195px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 9;
    transition: all 0.4s ease;
}

.brovko-wrapper {
    left: -20%;
}

.murchyk-wrapper {
    right: -3%;
}

.character-img {
    height: 250px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
    transition: transform 0.3s ease;
}

.character-badge {
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    padding: 4px 14px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1rem;
    margin-top: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.character-wrapper.active-turn .character-img {
    transform: scale(1.15);
    filter: drop-shadow(0 0 15px #ffd93d);
}

.character-wrapper.active-turn .character-badge {
    background: #ffd93d;
    color: #000;
    border-color: #ffffff;
}

/* Balls Row Container */
.balls-row-container {
    width: 100%;
    max-width: 750px;
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    z-index: 10;
}

.balls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.ball-item {
    cursor: pointer;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .ball-item:hover {
        transform: translateY(-12px) scale(1.1);
    }
}

.ball-item:active {
    transform: scale(0.95);
}

.ball-img-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ball-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.ball-number {
    position: absolute;
    font-size: 2rem;
    font-weight: 900;
    color: #0d1b2a;
    background: rgba(255, 255, 255, 0.92);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #1b4332;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-shadow: none;
    line-height: 1;
    letter-spacing: -0.5px;
    padding: 0 2px;
    box-sizing: border-box;
    transition: font-size 0.2s ease;
}

.ball-number.small-num {
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.ball-number.xsmall-num {
    font-size: 1.05rem;
    letter-spacing: -0.8px;
}

/* Ball Kick Animations */
.ball-item.animating-kick-goal {
    z-index: 30;
    animation: kickToGoal 0.75s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.ball-item.animating-kick-miss-left {
    z-index: 30;
    animation: kickMissLeft 0.85s forwards cubic-bezier(0.15, 0.5, 0.4, 1.0);
    pointer-events: none;
}

.ball-item.animating-kick-miss-right {
    z-index: 30;
    animation: kickMissRight 0.85s forwards cubic-bezier(0.15, 0.5, 0.4, 1.0);
    pointer-events: none;
}

.ball-item.animating-kick-miss-high {
    z-index: 30;
    animation: kickMissHigh 0.85s forwards cubic-bezier(0.15, 0.5, 0.4, 1.0);
    pointer-events: none;
}

@keyframes kickToGoal {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: translate(var(--dx), -140px) scale(0.65) rotate(360deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--dx), -240px) scale(0.35) rotate(720deg);
        opacity: 0;
    }
}

@keyframes kickMissLeft {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    40% {
        transform: translate(-300px, -240px) scale(0.7) rotate(-360deg);
        opacity: 1;
    }

    100% {
        transform: translate(-950px, -550px) scale(0.15) rotate(-1080deg);
        opacity: 0;
    }
}

@keyframes kickMissRight {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    40% {
        transform: translate(300px, -240px) scale(0.7) rotate(360deg);
        opacity: 1;
    }

    100% {
        transform: translate(950px, -550px) scale(0.15) rotate(1080deg);
        opacity: 0;
    }
}

@keyframes kickMissHigh {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    40% {
        transform: translate(var(--dx), -380px) scale(0.55) rotate(360deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--dx), -850px) scale(0.1) rotate(720deg);
        opacity: 0;
    }
}

/* Shaking field animation on miss */
.shake-field {
    animation: fieldShake 0.4s ease;
}

@keyframes fieldShake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-8px, 4px);
    }

    40% {
        transform: translate(8px, -4px);
    }

    60% {
        transform: translate(-5px, 2px);
    }

    80% {
        transform: translate(5px, -2px);
    }
}

/* Footer Controls & Instructions (Matching math-puzzle style) */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    padding: 0 15px;
    border-radius: 20px;
    border: 4px solid #4A4A8C;
    margin-bottom: 10px;
    position: relative;
    width: calc(100% - 40px);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 6px 16px rgba(74, 74, 140, 0.15);
    z-index: 10;
    box-sizing: border-box;
}

.logo-container {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.game-instructions {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #4A4A8C;
    text-align: center;
    margin: 0 auto;
}

/* Mode Selection Cards in Modal */
.mode-select-content {
    max-width: 560px !important;
}

.mode-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.mode-card {
    background: #FFFFFF;
    border: 3.5px solid #4A4A8C;
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 6px 14px rgba(74, 74, 140, 0.1);
    text-align: left;
}

.mode-card:hover {
    border-color: #FF8C00;
    background: #FFFDE7;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.2);
}

.mode-card.active {
    border: 4px solid #FF8C00;
    background: #FFF8E1;
    box-shadow: 0 8px 24px rgba(255, 140, 0, 0.25);
}

.mode-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
    color: #4A4A8C;
}

.mode-icon {
    font-size: 1.6rem;
}

.mode-card p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #5C6BC0;
    line-height: 1.35;
}

.hero-selection {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.hero-radio {
    cursor: pointer;
    flex: 1;
}

.hero-radio input {
    display: none;
}

.hero-chip {
    display: block;
    padding: 8px 10px;
    background: #E8EAF6;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    text-anchor: center;
    text-align: center;
    color: #4A4A8C;
    border: 2px solid #C5CAE9;
    transition: all 0.2s ease;
}

.hero-radio input:checked+.hero-chip {
    background: linear-gradient(135deg, #FF9F43 0%, #EE5253 100%);
    border-color: #D63031;
    color: #FFFFFF;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(238, 82, 83, 0.35);
}

/* Difficulty Selector Cards */
.settings-content {
    max-width: 620px !important;
}

.difficulty-select-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.diff-row {
    display: grid;
    gap: 8px;
}

.diff-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

.diff-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.diff-card {
    background: #FFFFFF;
    border: 3px solid #4A4A8C;
    border-radius: 14px;
    padding: 8px 4px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(74, 74, 140, 0.08);
}

.diff-card input {
    display: none;
}

.diff-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.diff-title {
    font-size: 0.9rem;
    font-weight: 900;
    color: #4A4A8C;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
    word-break: normal;
}

.diff-sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: #5C6BC0;
    white-space: normal;
    text-align: center;
    line-height: 1.1;
}

.diff-card:hover {
    border-color: #FF8C00;
    background: #FFFDE7;
    transform: translateY(-2px);
}

.diff-card:has(input:checked) {
    background: #FFF8E1;
    border: 3.5px solid #FF8C00;
    box-shadow: 0 5px 14px rgba(255, 140, 0, 0.25);
    transform: scale(1.03);
}

.diff-card:has(input:checked) .diff-title {
    color: #D63031;
}

.diff-card:has(input:checked) .diff-sub {
    color: #E67E22;
}

/* Timer Selector Cards in Settings */
.timer-select-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.timer-card-option {
    background: #FFFFFF;
    border: 3.5px solid #4A4A8C;
    border-radius: 14px;
    padding: 10px 4px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(74, 74, 140, 0.08);
}

.timer-card-option input {
    display: none;
}

.timer-option-title {
    font-size: 1rem;
    font-weight: 800;
    color: #4A4A8C;
    white-space: nowrap;
}

.timer-card-option:hover {
    border-color: #FF8C00;
    background: #FFFDE7;
    transform: translateY(-2px);
}

.timer-card-option:has(input:checked) {
    background: #FFF8E1;
    border: 3.5px solid #FF8C00;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.25);
    transform: scale(1.03);
}

.timer-card-option:has(input:checked) .timer-option-title {
    color: #D63031;
}

/* Hide victory and gameover banner images as requested */
.victory-characters {
    display: none !important;
}

/* Modal Dynamic Result Card Styling */
.modal-result-card {
    background: #FFFFFF;
    border: 3.5px solid #4A4A8C;
    border-radius: 20px;
    padding: 16px 20px;
    margin: 15px 0;
    box-shadow: 0 8px 24px rgba(74, 74, 140, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.winner-crown-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #4A4A8C;
    font-size: 1.1rem;
    font-weight: 900;
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid #FFFFFF;
    box-shadow: 0 4px 10px rgba(255, 165, 0, 0.35);
    text-align: center;
}

.winner-crown-badge.tie {
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.vs-result-players-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.vs-player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #F4F5FB;
    border: 2.5px solid #C5CAE9;
    border-radius: 16px;
    padding: 10px 16px;
    min-width: 110px;
    transition: all 0.3s ease;
}

.vs-player-card.is-winner {
    background: #FFF8E1;
    border: 3.5px solid #FF8C00;
    box-shadow: 0 6px 18px rgba(255, 140, 0, 0.25);
    transform: scale(1.06);
}

.vs-player-avatar {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 50%;
    border: 2.5px solid #4A4A8C;
    background: #FFFFFF;
}

.vs-player-name {
    font-size: 1rem;
    font-weight: 800;
    color: #4A4A8C;
    margin-top: 4px;
}

.vs-player-score {
    font-size: 1.8rem;
    font-weight: 900;
    color: #D63031;
    line-height: 1;
    margin-top: 2px;
}

.vs-vs-divider {
    font-size: 2rem;
    font-weight: 900;
    color: #4A4A8C;
}

/* Single Mode Result Card */
.single-result-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.single-hero-avatar-frame {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3.5px solid #4A4A8C;
    overflow: hidden;
    background: #FFFFFF;
    box-shadow: 0 4px 12px rgba(74, 74, 140, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-result-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-hero-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.single-hero-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #4A4A8C;
}

.single-hero-title b {
    font-weight: 900;
    color: #D63031;
}

.single-goals-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FFF8E1;
    border: 2px solid #FF8C00;
    padding: 4px 14px;
    border-radius: 14px;
}

.single-goals-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: #4A4A8C;
}

.single-goals-count {
    font-size: 1.5rem;
    font-weight: 900;
    color: #D63031;
}

.result-reason-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #5C6BC0;
    text-align: center;
}

.chip-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 4px;
    border: 1.5px solid #4A4A8C;
    background: #FFFFFF;
}

/* Responsiveness / Mobile Scaling */
@media (max-width: 768px) {
    .header {
        padding: 6px 10px;
        gap: 6px;
        align-items: flex-start;
    }

    .header-left {
        gap: 6px;
        align-items: center;
    }

    .menu-btn {
        width: 38px;
        height: 38px;
        padding: 6px;
    }

    .new-game-btn {
        padding: 0 10px;
        height: 38px;
        font-size: 13px;
    }

    .scoreboard-container {
        display: grid;
        grid-template-areas:
            "timer misses"
            "score score";
        gap: 4px;
        justify-items: end;
        align-items: center;
    }

    .timer-card {
        grid-area: timer;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
        border-width: 2px;
        border-radius: 12px;
        gap: 4px;
    }

    .misses-card {
        grid-area: misses;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
        border-width: 2px;
        border-radius: 12px;
        gap: 4px;
    }

    .score-card {
        grid-area: score;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
        border-width: 2px;
        border-radius: 12px;
        justify-self: end;
        gap: 4px;
    }

    .timer-icon {
        font-size: 14px;
    }

    .timer-value {
        font-size: 15px;
    }

    .score-label,
    .misses-label {
        display: none !important; /* Hide text labels on mobile to save space */
    }

    .score-value {
        font-size: 16px;
    }

    .player-name {
        font-size: 12px;
    }

    .score-avatar-img {
        height: 24px;
        width: 24px;
        margin-right: 2px;
    }

    .turn-avatar-img {
        height: 22px;
        width: 22px;
    }

    .miss-ball {
        font-size: 14px;
    }

    /* Turn Banner on Mobile */
    .turn-banner {
        top: 86px;
        font-size: 0.9rem;
        padding: 4px 14px;
        border-radius: 16px;
    }

    /* Stage & Goal on Mobile */
    .game-area {
        padding: 8px 6px;
    }

    .field-center-stage {
        margin: auto 0;
        max-width: 100%;
    }

    .goal-container {
        width: 96%;
    }

    .equation-board {
        top: 20%;
        padding: 6px 14px;
        border-width: 2.5px;
        border-radius: 12px;
    }

    .equation-text {
        font-size: 1.6rem;
        letter-spacing: 1px;
    }

    /* Mascot Characters Positioned inside Screen Boundaries */
    .character-wrapper {
        bottom: -95px;
    }

    .brovko-wrapper {
        left: -1%;
    }

    .murchyk-wrapper {
        right: -1%;
    }

    .character-img {
        height: 140px;
    }

    .character-badge {
        font-size: 0.75rem;
        padding: 2px 8px;
        border-radius: 10px;
    }

    /* Balls Row on Mobile */
    .balls-row-container {
        margin-bottom: 8px;
    }

    .balls-row {
        gap: 16px;
    }

    .ball-img-wrapper {
        width: 78px;
        height: 78px;
    }

    .ball-number {
        font-size: 1.45rem;
        width: 44px;
        height: 44px;
    }

    .ball-number.small-num {
        font-size: 1rem;
        letter-spacing: -0.5px;
    }

    .ball-number.xsmall-num {
        font-size: 0.85rem;
        letter-spacing: -0.8px;
    }

    /* Footer on Mobile */
    .logo-container {
        display: none;
    }

    .game-instructions {
        font-size: 13px;
        height: auto;
        padding: 6px 8px;
    }

    /* Modals on Mobile */
    .settings-content,
    .mode-select-content,
    .results-content {
        max-width: 94% !important;
        max-height: 90vh;
        overflow-y: auto;
        padding: 16px 12px;
        border-radius: 20px;
    }

    .mode-options-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .diff-row-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .diff-row-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .diff-card {
        padding: 6px 2px;
    }

    .diff-title {
        font-size: 0.78rem;
        line-height: 1.15;
        white-space: normal;
    }

    .diff-sub {
        font-size: 0.68rem;
        line-height: 1.1;
        white-space: normal;
    }

    .timer-select-group {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}