:root {
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #546E7A;
    --primary: #66BB6A;
    --accent: #81C784;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.06);
    --font-main: 'Fredoka', sans-serif;

    /* Mode Colors */
    --color-kids: #FFB74D;
    --color-classic: #66BB6A;
    --color-cricket: #AB47BC;
    --color-around: #EF5350;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
    --bullseye: #E53935;
    --triple: #43A047;
    --double: #1E88E5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: var(--font-main);
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

body.game-active {
    height: 100vh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

#app {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    max-height: 850px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== HEADER ========== */
.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    z-index: 10;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-left img {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.2s;
}

.header-left img:hover {
    transform: scale(1.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-btn,
.sound-btn {
    border: none;
    background: #F0F2F5;
    border-radius: 12px;
    padding: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.lang-btn:hover,
.sound-btn:hover {
    background: #E0E2E5;
    transform: translateY(-1px);
}

.sound-btn {
    font-size: 1.3rem;
    padding: 4px 8px;
}

/* ========== SCREENS ========== */
.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow-y: auto;
    padding: 15px;
}

.hidden {
    display: none !important;
}

/* ========== HOME SCREEN ========== */
#home-screen {
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFA 100%);
}

.hero {
    text-align: center;
    margin-bottom: 20px;
}

.hero-img {
    width: 140px;
    height: auto;
    display: block;
    margin: 0 auto 10px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ========== MINIMALIST MENU ========== */
.menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 380px;
    padding: 0 20px;
    animation: fadeIn 0.8s ease-out;
}

.menu>button:first-child {
    grid-column: 1 / -1;
    /* Math button spans full width */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 10px;

    background: white;
    border: 1px solid #EDEDED;
    border-radius: 16px;
    color: var(--text-primary);

    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-align: center;

    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

/* Hover Effect: Lift and subtle shadow */
.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

/* Mode Indicators (Top Border Accent) */
.menu-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 4px;
    background: #CCC;
    transition: height 0.2s;
}

.menu-btn:hover::before {
    height: 4px;
}

/* Specific Mode Colors & Gradients */
.menu-btn.kids-btn {
    background: linear-gradient(90deg, #FFF3E0 0%, #FFFFFF 100%);
}

.menu-btn.kids-btn::before {
    background: var(--color-kids);
}

.menu-btn.kids-btn:hover {
    background: linear-gradient(90deg, #FFE0B2 0%, #FFFFFF 100%);
}

.menu-btn.classic-btn {
    background: linear-gradient(90deg, #E8F5E9 0%, #FFFFFF 100%);
}

.menu-btn.classic-btn::before {
    background: var(--color-classic);
}

.menu-btn.classic-btn:hover {
    background: linear-gradient(90deg, #C8E6C9 0%, #FFFFFF 100%);
}

.menu-btn.fun-btn {
    background: linear-gradient(90deg, #F3E5F5 0%, #FFFFFF 100%);
}

.menu-btn.fun-btn::before {
    background: var(--color-cricket);
}

.menu-btn.fun-btn:hover {
    background: linear-gradient(90deg, #E1BEE7 0%, #FFFFFF 100%);
}

.menu-btn.challenge-btn {
    background: linear-gradient(90deg, #FFEBEE 0%, #FFFFFF 100%);
}

.menu-btn.challenge-btn::before {
    background: var(--color-around);
}

.menu-btn.challenge-btn:hover {
    background: linear-gradient(90deg, #FFCDD2 0%, #FFFFFF 100%);
}

.menu-btn.mode-btn {
    background: #E3F2FD;
    color: #1565C0;
    border: none;
    justify-content: center;
}

.menu-btn.mode-btn::before {
    display: none;
}

.menu-btn.mode-btn:hover {
    background: #BBDEFB;
}

.menu-btn.back-btn {
    background: #F5F7FA;
    color: var(--text-secondary);
    justify-content: center;
    border: none;
    margin-top: 10px;
}

.menu-btn.back-btn::before {
    display: none;
}

.menu-btn.back-btn:hover {
    background: #E0E0E0;
}

.mode-emoji {
    font-size: 1.4rem;
    min-width: 30px;
    text-align: center;
}

.mode-desc {
    font-size: 0.75rem;
    opacity: 0.85;
    display: block;
    margin-top: 2px;
    font-weight: 400;
}

/* ========== GAME SCREEN ========== */
#game-screen {
    padding: 0;
    justify-content: flex-start;
    position: relative;
    min-height: 0;
    /* Allow flex children to shrink */
}

.game-hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid var(--accent);
    flex-shrink: 0;
    z-index: 5;
    gap: 4px;
    overflow: hidden;
}

.hud-left,
.hud-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    flex-shrink: 0;
}

.hud-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
    white-space: nowrap;
}

.hud-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.hud-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.hud-mode {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--highlight);
}

.hud-round {
    font-size: 0.7rem;
    opacity: 0.6;
}

.hud-round-large {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    opacity: 1;
    margin-top: 5px;
}

.hud-btn {
    font-size: 1.4rem;
    background: transparent;
    border: none;
    cursor: pointer;
    margin-right: -10px;
    padding: 0 5px;
}

#single-player-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-mode {
    color: var(--text-primary);
}


/* ========== DARTBOARD ========== */
.dartboard-area {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    min-height: 0;
    /* Allow flex shrink */

    /* Dark wood-like background with subtle pattern */
    background-color: #1a1d23;
    background-image:
        /* Radial glow behind the board */
        radial-gradient(ellipse at center 45%, rgba(102, 187, 106, 0.12) 0%, transparent 55%),
        /* Subtle diamond pattern on the sides */
        linear-gradient(45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.02) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.02) 75%);
    background-size: 100% 100%, 30px 30px, 30px 30px, 30px 30px, 30px 30px;
    background-position: center, 0 0, 0 15px, 15px -15px, -15px 0;
}

.dartboard-container {
    position: relative;
    width: 85vw;
    height: 85vw;
    max-width: 360px;
    max-height: 360px;
    flex-shrink: 1;
}

canvas#dartboard {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15));
}

/* Swipe zone */
.swipe-zone {
    width: 85%;
    max-width: 350px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    flex-shrink: 0;
    opacity: 0.5;
}

.swipe-arrow {
    font-size: 1.8rem;
    animation: swipePulse 1.5s ease-in-out infinite;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes swipePulse {

    0%,
    100% {
        transform: translateY(8px);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Flying dart animation */
.dart-flying {
    position: absolute;
    pointer-events: none;
    z-index: 20;
}

.throw-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    opacity: 0.8;
    margin-top: 4px;
    text-align: center;
    flex-shrink: 0;
    padding-bottom: 10px;
}

/* ========== DART ANIMATIONS ========== */
.dart-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    animation: dartLand 0.4s ease-out;
}

.dart-marker::before {
    content: '🎯';
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes dartLand {
    0% {
        transform: translate(-50%, -150%) scale(2.5) rotate(-20deg);
        opacity: 0;
    }

    60% {
        transform: translate(-50%, -40%) scale(0.9) rotate(5deg);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, -55%) scale(1.05);
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Score popup */
.score-popup {
    position: absolute;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--highlight);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(255, 112, 67, 0.3);
    pointer-events: none;
    z-index: 20;
    animation: scoreFloat 1.2s ease-out forwards;
}

.score-popup.bullseye {
    color: var(--bullseye);
    font-size: 2rem;
    text-shadow: 0 0 15px rgba(229, 57, 53, 0.5);
}

.score-popup.triple {
    color: var(--triple);
}

.score-popup.double {
    color: var(--double);
}

@keyframes scoreFloat {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translateY(-10px) scale(1.3);
        opacity: 1;
    }

    100% {
        transform: translateY(-80px) scale(0.8);
        opacity: 0;
    }
}

/* ========== ELECTRONIC SCOREBOARD ========== */
.electronic-scoreboard {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #222;
    padding: 4px 8px;
    border-radius: 10px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    border: 2px solid #444;
    max-width: 100%;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 45px;
    padding: 2px 4px;
    border-radius: 4px;
    background: #111;
    border: 1px solid #333;
    opacity: 0.5;
    transition: all 0.3s;
}

.score-box.active {
    opacity: 1;
    border-color: #555;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.score-box .label {
    font-size: 0.6rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 700;
}

.score-box .value {
    font-family: 'Courier New', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Player Colors */
.score-box.p1 .label {
    color: #42A5F5;
}

.score-box.p1 .value {
    color: #42A5F5;
    text-shadow: 0 0 5px rgba(33, 150, 243, 0.5);
}

.score-box.p2 .label {
    color: #EF5350;
}

.score-box.p2 .value {
    color: #EF5350;
    text-shadow: 0 0 5px rgba(244, 67, 54, 0.5);
}

.board-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.board-info .mode {
    color: #FFF;
    font-size: 0.7rem;
    font-weight: bold;
    opacity: 0.8;
}

.board-info .round {
    color: #FFD700;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Hit flash on board */
@keyframes boardHit {
    0% {
        filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15)) brightness(1);
    }

    30% {
        filter: drop-shadow(0 8px 30px rgba(255, 200, 0, 0.5)) brightness(1.15);
    }

    100% {
        filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15)) brightness(1);
    }
}

.board-hit {
    animation: boardHit 0.4s ease-out;
}

/* ========== MATH MODE QUESTION ========== */
.math-question-bar {
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border-bottom: 2px solid #FFB74D;
    text-align: center;
    flex-shrink: 0;
}

.math-question-bar .question {
    font-size: 1.3rem;
    font-weight: 700;
    color: #E65100;
}

.math-question-bar .hint {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* ========== RESULT SCREEN ========== */
#result-screen {
    gap: 15px;
    padding: 20px;
}

.result-content {
    text-align: center;
    width: 100%;
}

.result-emoji {
    font-size: 4rem;
    animation: celebrate 1s infinite;
    display: block;
    margin-bottom: 10px;
}

@keyframes celebrate {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.1) rotate(-5deg);
    }

    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

.result-title {
    font-size: 2rem;
    color: var(--primary-dark);
    text-shadow: 2px 2px 0 white;
    margin-bottom: 15px;
}

.result-stats {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row .label {
    opacity: 0.7;
}

.stat-row .value {
    font-weight: 700;
    color: var(--primary-dark);
}

.stat-row.highlight .value {
    color: var(--highlight);
    font-size: 1.2rem;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.result-actions .menu-btn {
    width: 100%;
}

/* ========== PARTICLES ========== */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 100;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========== MISSED TOAST ========== */
.miss-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(229, 57, 53, 0.9);
    color: white;
    padding: 8px 25px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 30;
    animation: toastPop 1s ease-out forwards;
    pointer-events: none;
}

@keyframes toastPop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* ========== COUNTDOWN OVERLAY ========== */
.countdown-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.countdown-number {
    font-size: 6rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: countPulse 0.8s ease-out;
}

@keyframes countPulse {
    0% {
        transform: scale(2);
        opacity: 0;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

/* ========== KOFI ========== */
.kofi-container {
    margin: 5px 0;
    transform: scale(0.85);
}

/* ========== RESPONSIVE ========== */
@media (max-height: 650px) {
    .hero-img {
        width: 100px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .menu-btn {
        padding: 10px 15px;
        font-size: 1rem;
    }

    .dartboard-container {
        width: 300px;
        height: 300px;
    }

    .mode-desc {
        display: none;
    }
}

@media (max-height: 550px) {
    .hero-img {
        width: 80px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        display: none;
    }

    .dartboard-container {
        width: 250px;
        height: 250px;
    }
}

@media (min-width: 501px) {
    #app {
        border-radius: 30px;
        margin: 10px auto;
        border: 6px solid white;
        max-height: 850px;
    }
}

/* ========== SEO OVERRIDES ========== */
html,
body {
    height: auto !important;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

#app {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    max-height: 900px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.seo-content-wrapper {
    background: linear-gradient(180deg, #E8F5E9 0%, #FFF 100%);
    padding: 20px;
}

.game-info-section {
    max-width: 800px;
    margin: 0 auto 40px auto;
    padding: 30px;
    line-height: 1.8;
    color: #5D5D5D;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(102, 187, 106, 0.15);
}

.game-info-section h1 {
    color: var(--primary-dark);
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 20px;
    font-size: 2rem;
}

.game-info-section h2 {
    font-family: 'Fredoka', sans-serif;
    color: var(--primary-dark);
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.game-info-section p,
.game-info-section li {
    margin-bottom: 15px;
}

.game-info-section ul {
    list-style: none;
    padding-left: 0;
}

.site-footer {
    background: white;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid #E8F5E9;
}

/* ========== DART TRAIL ========== */
.dart-trail {
    position: absolute;
    pointer-events: none;
    z-index: 15;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.9) 0%, rgba(129, 199, 132, 0.5) 40%, rgba(76, 175, 80, 0) 70%);
    box-shadow: 0 0 14px 4px rgba(76, 175, 80, 0.6), 0 0 6px 2px rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    opacity: 0.9;
    transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.site-footer .footer-links {
    margin-bottom: 15px;
}

.site-footer .footer-links a {
    margin: 0 15px;
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
}

.site-footer .footer-links a:hover {
    color: var(--primary-dark);
}

.site-footer p {
    color: #aaa;
    font-size: 0.85rem;
}

/* ========== MOBILE: SHORT SCREENS ========== */
@media (max-height: 650px) {
    .game-header {
        padding: 8px 15px;
    }

    .game-hud {
        padding: 5px 10px;
    }

    .hud-value {
        font-size: 1.1rem;
    }

    .hud-round-large {
        font-size: 0.95rem;
        margin-top: 2px;
    }

    .dartboard-container {
        max-width: 290px;
        max-height: 290px;
    }

    .swipe-zone {
        height: 30px;
        margin-top: 4px;
    }

    .throw-hint {
        font-size: 0.75rem;
        padding-bottom: 5px;
    }
}

@media (max-height: 550px) {
    .dartboard-container {
        max-width: 240px;
        max-height: 240px;
    }

    .swipe-zone {
        height: 24px;
    }

    .throw-hint {
        font-size: 0.7rem;
        padding-bottom: 3px;
    }
}

/* ========== MOBILE: NARROW SCREENS ========== */
@media (max-width: 400px) {
    .game-hud {
        padding: 6px 8px;
        gap: 2px;
    }

    .hud-label {
        font-size: 0.55rem;
        letter-spacing: 0;
    }

    .hud-value {
        font-size: 1.15rem;
    }

    .hud-mode {
        font-size: 0.7rem;
    }

    .hud-round-large {
        font-size: 0.9rem;
        margin-top: 2px;
    }

    .hud-btn {
        font-size: 1.2rem;
        margin-right: -5px;
    }

    .electronic-scoreboard {
        gap: 4px;
        padding: 3px 6px;
    }

    .score-box {
        min-width: 38px;
        padding: 1px 3px;
    }

    .score-box .value {
        font-size: 1rem;
    }

    .score-box .label {
        font-size: 0.5rem;
    }

    .board-info .mode {
        font-size: 0.6rem;
    }

    .board-info .round {
        font-size: 0.75rem;
    }
}

/* ========== MOBILE: COMPACT HOME SCREEN ========== */
@media (max-height: 750px) {
    #home-screen {
        gap: 8px;
        padding: 10px 15px;
        justify-content: flex-start;
    }

    .hero {
        margin-bottom: 5px;
    }

    .hero-img {
        width: 80px;
    }

    .hero h1 {
        font-size: 1.6rem;
        margin-bottom: 2px;
    }

    .hero p {
        font-size: 0.85rem;
    }

    .kofi-container {
        display: none;
    }

    .menu {
        gap: 6px;
        padding: 0 10px;
    }

    .menu-btn {
        padding: 8px 6px;
        gap: 3px;
        border-radius: 12px;
        font-size: 0.85rem;
    }

    .mode-emoji {
        font-size: 1rem;
    }

    .mode-desc {
        font-size: 0.6rem;
        margin-top: 0;
    }

    .player-select .menu-btn {
        padding: 8px !important;
        font-size: 0.85rem !important;
    }
}

@media (max-height: 600px) {
    .hero-img {
        width: 50px;
    }

    .hero h1 {
        font-size: 1.3rem;
    }

    .hero p {
        display: none;
    }

    .menu {
        gap: 4px;
    }

    .menu-btn {
        padding: 6px 4px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .mode-desc {
        display: none;
    }
}