/* Bloonsdle Styles - Authentic BTD6 Design */

/* Import BTD6-style fonts */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&family=Nunito:wght@300;400;500;600;700;800;900&family=Comfortaa:wght@300;400;500;600;700&display=swap');

/* CSS Variables for authentic BTD6 theme */
:root {
    /* Official BTD6 Colors */
    --btd6-blue: #4A90E2;
    --btd6-green: #7ED321;
    --btd6-red: #D0021B;
    --btd6-yellow: #F5A623;
    --btd6-purple: #9013FE;
    --btd6-pink: #FF69B4;
    --btd6-black: #1A1A1A;
    --btd6-white: #FFFFFF;
    --btd6-gray: #9B9B9B;
    --btd6-dark-blue: #2C5282;

    /* BTD6 UI Colors */
    --btd6-sky: #87CEEB;
    --btd6-grass: #90EE90;
    --btd6-dirt: #D2B48C;
    --btd6-water: #4682B4;
    --btd6-orange: #FF8C00;

    /* UI Elements */
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --text-primary: #2C3E50;
    --text-secondary: #5A6C7D;
    --text-white: #FFFFFF;
}

/* BTD6 Original Background with Movement Effects */
body {
    font-family: 'Nunito', sans-serif;
    background-image: url('images/fondo.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    animation: backgroundPulse 20s ease-in-out infinite;
    padding-bottom: 140px; /* Space for expanded bottom bar */
}

/* Subtle background animation */
@keyframes backgroundPulse {
    0%, 100% {
        filter: brightness(1) saturate(1);
        transform: scale(1);
    }
    50% {
        filter: brightness(1.05) saturate(1.1);
        transform: scale(1.01);
    }
}

/* Enhanced overlay with movement */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
        rgba(30, 58, 138, 0.7) 0%,
        rgba(74, 144, 226, 0.6) 50%,
        rgba(30, 58, 138, 0.7) 100%);
    background-size: 400% 400%;
    animation: overlayShift 15s ease-in-out infinite;
    backdrop-filter: blur(1px);
    z-index: -1;
}

@keyframes overlayShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating particles effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle 3px at 10% 20%, rgba(255, 255, 255, 0.6) 0%, transparent 50%),
        radial-gradient(circle 2px at 90% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        radial-gradient(circle 4px at 70% 70%, rgba(255, 255, 255, 0.5) 0%, transparent 50%),
        radial-gradient(circle 2px at 30% 80%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle 3px at 85% 80%, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
    animation: particleFloat 25s ease-in-out infinite;
    z-index: -1;
    opacity: 0.7;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    33% { transform: translateY(-10px) translateX(5px); }
    66% { transform: translateY(-5px) translateX(-3px); }
}

/* BTD6 Hero Section with Original Elements */
.btd6-container {
    /* Animation removed to prevent footer jumping */
}

.btd6-hero {
    /* Animation removed to prevent footer jumping */
}

.btd6-title-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

/* Original Title with New Animation */
.btd6-original-title {
    height: 100px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))
            drop-shadow(0 0 15px rgba(74, 144, 226, 0.2));
    animation: titleGlow 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))
                drop-shadow(0 0 15px rgba(74, 144, 226, 0.2));
    }
    50% {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))
                drop-shadow(0 0 25px rgba(74, 144, 226, 0.4))
                drop-shadow(0 0 35px rgba(126, 211, 33, 0.3));
    }
}

.btd6-original-title:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4))
            drop-shadow(0 0 30px rgba(74, 144, 226, 0.5))
            drop-shadow(0 0 40px rgba(126, 211, 33, 0.4));
}



/* BTD6 Bottom Bar */
.btd6-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--card-bg);
    border-top: 4px solid var(--btd6-blue);
    backdrop-filter: blur(15px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transform: translateZ(0); /* Force hardware acceleration for stability */
}

.btd6-bottom-bar::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--btd6-red) 0%,
        var(--btd6-yellow) 25%,
        var(--btd6-green) 50%,
        var(--btd6-blue) 75%,
        var(--btd6-purple) 100%);
    background-size: 400% 100%;
    animation: bottomBarGlow 3s ease infinite;
}

@keyframes bottomBarGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.bottom-bar-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    padding: 16px 24px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

/* Bottom Timer */
.bottom-timer {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(74, 144, 226, 0.1);
    border: 2px solid var(--btd6-blue);
    border-radius: 15px;
    padding: 8px 16px;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.timer-icon-bottom {
    font-size: 1.5rem;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.timer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timer-label-bottom {
    font-family: 'Comfortaa', cursive;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timer-value-bottom {
    font-family: 'Fredoka', cursive;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--btd6-red);
    text-shadow: 1px 1px 2px rgba(208, 2, 27, 0.3);
    animation: bottomTimerGlow 2s ease-in-out infinite;
}

@keyframes bottomTimerGlow {
    0%, 100% {
        text-shadow: 1px 1px 2px rgba(208, 2, 27, 0.3);
    }
    50% {
        text-shadow: 1px 1px 2px rgba(208, 2, 27, 0.3), 0 0 10px rgba(208, 2, 27, 0.5);
    }
}

/* Bottom Language Selector */
.bottom-language {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(126, 211, 33, 0.1);
    border: 2px solid var(--btd6-green);
    border-radius: 15px;
    padding: 8px 16px;
    box-shadow: 0 4px 15px rgba(126, 211, 33, 0.2);
    cursor: pointer;
    position: relative;
}

.lang-icon-bottom {
    font-size: 1.3rem;
    animation: iconRotate 4s ease-in-out infinite;
}

@keyframes iconRotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
}

.lang-select-bottom {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Comfortaa', cursive;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    min-width: 120px;
    width: 100%;
    height: 100%;
    padding: 0;
}

.lang-select-bottom option {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 8px;
    font-family: 'Comfortaa', cursive;
}

/* Bottom Center Section */
.bottom-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.credits-text {
    font-family: 'Comfortaa', cursive;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.credits-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

.center-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.patch-notes-btn {
    background: rgba(245, 166, 35, 0.1);
    border: 2px solid var(--btd6-yellow);
    border-radius: 12px;
    padding: 6px 12px;
    color: var(--text-primary);
    font-family: 'Comfortaa', cursive;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.patch-notes-btn:hover {
    background: rgba(245, 166, 35, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
}

.version-badge {
    background: rgba(144, 19, 254, 0.1);
    border: 2px solid var(--btd6-purple);
    border-radius: 10px;
    padding: 4px 10px;
    color: var(--btd6-purple);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.7rem;
    text-shadow: 0 0 5px rgba(144, 19, 254, 0.3);
}

.social-links {
    display: flex;
    gap: 8px;
}

.social-link {
    background: rgba(74, 144, 226, 0.1);
    border: 2px solid var(--btd6-blue);
    border-radius: 8px;
    padding: 6px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link:hover {
    background: rgba(74, 144, 226, 0.2);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}





/* BTD6 Hero Section */
.btd6-container {
    animation: fadeInBTD6 1.5s ease-out;
}

.btd6-hero {
    animation: bounceInBTD6 1.2s ease-out;
}

.btd6-title-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.btd6-main-title {
    font-family: 'Fredoka', cursive;
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-shadow:
        4px 4px 0px var(--btd6-yellow),
        8px 8px 0px var(--btd6-red),
        12px 12px 20px rgba(0, 0, 0, 0.3);
    animation: titleBounce 3s ease-in-out infinite;
    transform-origin: center;
}

@keyframes titleBounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(1deg);
    }
}

.btd6-subtitle {
    font-family: 'Comfortaa', cursive;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
}

.btd6-decorative-line {
    width: 300px;
    height: 6px;
    background: linear-gradient(90deg,
        var(--btd6-red) 0%,
        var(--btd6-yellow) 25%,
        var(--btd6-green) 50%,
        var(--btd6-blue) 75%,
        var(--btd6-purple) 100%);
    margin: 0 auto;
    border-radius: 3px;
    animation: lineShimmer 2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes lineShimmer {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; transform: scaleY(1.2); }
}

/* BTD6 Timer */
.btd6-timer {
    background: var(--card-bg);
    border: 4px solid var(--btd6-blue);
    border-radius: 25px;
    padding: 1.5rem 2rem;
    max-width: 350px;
    margin: 0 auto;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.btd6-timer::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg,
        var(--btd6-blue),
        var(--btd6-green),
        var(--btd6-yellow),
        var(--btd6-red));
    background-size: 400% 400%;
    border-radius: 25px;
    z-index: -1;
    animation: timerBorderGlow 3s ease infinite;
}

@keyframes timerBorderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btd6-timer-label {
    font-family: 'Comfortaa', cursive;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btd6-timer-value {
    font-family: 'Fredoka', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--btd6-red);
    text-shadow: 2px 2px 4px rgba(208, 2, 27, 0.3);
    margin-bottom: 1rem;
}

.btd6-timer-decoration {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.timer-balloon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: balloonBob 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timer-balloon.red {
    background: var(--btd6-red);
    animation-delay: 0s;
}

.timer-balloon.blue {
    background: var(--btd6-blue);
    animation-delay: 0.3s;
}

.timer-balloon.yellow {
    background: var(--btd6-yellow);
    animation-delay: 0.6s;
}

@keyframes balloonBob {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* BTD6-style Game Mode Cards */
.game-mode-card {
    background: var(--card-bg);
    border: 4px solid var(--btd6-blue);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transform: translateY(0);
}

/* BTD6-style border gradient effect */
.game-mode-card::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg,
        var(--btd6-red),
        var(--btd6-yellow),
        var(--btd6-green),
        var(--btd6-blue),
        var(--btd6-purple),
        var(--btd6-pink));
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    animation: rainbowBorder 3s ease infinite;
    transition: opacity 0.3s ease;
}

@keyframes rainbowBorder {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.game-mode-card:hover {
    transform: translateY(-10px) scale(1.03);
    border-color: var(--btd6-yellow);
    box-shadow:
        var(--card-shadow),
        0 0 30px rgba(245, 166, 35, 0.4),
        0 20px 40px rgba(0, 0, 0, 0.3);
}

.game-mode-card:hover::before {
    opacity: 1;
}

.game-mode-card:active {
    transform: translateY(-5px) scale(1.01);
}

.game-mode-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.game-mode-card:hover .game-mode-icon {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.game-mode-title {
    font-family: 'Fredoka', cursive;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.game-mode-card:hover .game-mode-title {
    color: var(--btd6-blue);
    text-shadow: 2px 2px 4px rgba(74, 144, 226, 0.3);
}

.game-mode-description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.5;
    font-weight: 500;
}

.game-mode-status {
    padding: 0.75rem 1.5rem;
    border-radius: 15px;
    background: var(--btd6-blue);
    border: 3px solid var(--btd6-white);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.game-mode-status::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.game-mode-card:hover .game-mode-status::before {
    left: 100%;
}

.game-mode-status.completed {
    background: var(--btd6-green);
    border-color: var(--btd6-white);
    box-shadow: 0 4px 15px rgba(126, 211, 33, 0.4);
}

.game-mode-status.failed {
    background: var(--btd6-red);
    border-color: var(--btd6-white);
    box-shadow: 0 4px 15px rgba(208, 2, 27, 0.4);
}

.status-text {
    color: var(--text-white);
    font-family: 'Fredoka', cursive;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.game-tile {
    width: 3.5rem;
    height: 3.5rem;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    margin: 0 auto;
    text-align: center;
    line-height: 1.2;
}

.game-tile.filled {
    border-color: #9ca3af;
    background-color: white;
}

.game-tile.correct {
    background: var(--btd6-green);
    border-color: var(--btd6-green);
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(126, 211, 33, 0.4);
    animation: correctPulseBTD6 0.6s ease-out;
}

.game-tile.present {
    background: var(--btd6-yellow);
    border-color: var(--btd6-yellow);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(245, 166, 35, 0.4);
    animation: presentPulseBTD6 0.6s ease-out;
}

.game-tile.absent {
    background: var(--btd6-gray);
    border-color: var(--btd6-gray);
    color: var(--text-white);
    box-shadow: 0 0 10px rgba(155, 155, 155, 0.3);
    animation: absentPulseBTD6 0.6s ease-out;
}

.game-tile.higher {
    background: var(--btd6-red);
    border-color: var(--btd6-red);
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(208, 2, 27, 0.4);
    animation: higherPulseBTD6 0.6s ease-out;
}

.game-tile.lower {
    background: var(--btd6-red);
    border-color: var(--btd6-red);
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(208, 2, 27, 0.4);
    animation: lowerPulseBTD6 0.6s ease-out;
}

/* BTD6 Tile Animations */
@keyframes correctPulseBTD6 {
    0% { transform: scale(1); }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 25px rgba(126, 211, 33, 0.8);
        border-color: rgba(126, 211, 33, 0.8);
    }
    100% { transform: scale(1); }
}

@keyframes presentPulseBTD6 {
    0% { transform: scale(1); }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 25px rgba(245, 166, 35, 0.8);
        border-color: rgba(245, 166, 35, 0.8);
    }
    100% { transform: scale(1); }
}

@keyframes absentPulseBTD6 {
    0% { transform: scale(1); }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(155, 155, 155, 0.5);
    }
    100% { transform: scale(1); }
}

@keyframes higherPulseBTD6 {
    0% { transform: scale(1); }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 25px rgba(208, 2, 27, 0.8);
        border-color: rgba(208, 2, 27, 0.8);
    }
    100% { transform: scale(1); }
}

@keyframes lowerPulseBTD6 {
    0% { transform: scale(1); }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 25px rgba(208, 2, 27, 0.8);
        border-color: rgba(208, 2, 27, 0.8);
    }
    100% { transform: scale(1); }
}

.tower-image {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4A90E2, #2C5282);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Game tiles - smaller on mobile */
    .game-tile {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.625rem;
    }

    .tower-image {
        width: 24px;
        height: 24px;
        font-size: 8px;
    }

    /* Game mode cards - stack vertically */
    .game-mode-card {
        padding: 1.5rem;
        min-height: 160px;
    }

    .game-mode-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }

    .game-mode-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .game-mode-description {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    /* Title image - smaller on mobile */
    .title-image {
        height: 120px;
        margin-bottom: 1rem;
    }

    .title-image-small {
        max-height: 60px;
    }

    /* Language selector - adjust position */
    .language-selector {
        top: 10px;
        right: 10px;
    }

    .language-btn {
        padding: 6px 10px;
        font-size: 0.875rem;
    }

    /* Images - smaller on mobile */
    .game-image {
        width: 24px;
        height: 24px;
        padding: 1px;
    }

    .game-image-large {
        width: 48px;
        height: 48px;
        padding: 3px;
    }

    .game-image-hero {
        width: 36px;
        height: 36px;
        padding: 2px;
    }

    .game-image-button {
        width: 32px;
        height: 32px;
        padding: 2px;
    }

    /* Grid adjustments */
    .grid-header > div {
        min-height: 2rem;
        font-size: 0.75rem;
        padding: 0.25rem;
    }

    .guess-row > div {
        min-height: 2.5rem;
    }

    /* Mystery image - smaller on mobile */
    .mystery-image {
        width: 160px !important;
        height: 160px !important;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .game-mode-card {
        padding: 1rem;
        min-height: 140px;
    }

    .game-mode-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .game-mode-title {
        font-size: 1.125rem;
    }

    .game-mode-description {
        font-size: 0.8rem;
    }

    /* Title image - even smaller */
    .title-image {
        height: 100px;
    }

    /* Game tiles - even smaller */
    .game-tile {
        width: 2rem;
        height: 2rem;
        font-size: 0.5rem;
    }

    /* Images - even smaller */
    .game-image {
        width: 20px;
        height: 20px;
    }

    .game-image-large {
        width: 40px;
        height: 40px;
    }

    .game-image-hero {
        width: 28px;
        height: 28px;
    }

    .game-image-button {
        width: 28px;
        height: 28px;
    }

    /* Grid headers - smaller text */
    .grid-header > div {
        font-size: 0.625rem;
        padding: 0.125rem;
    }

    /* Mystery image - smaller */
    .mystery-image {
        width: 120px !important;
        height: 120px !important;
    }

    /* Language selector - smaller */
    .language-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

/* Animation for new guesses */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guess-row {
    animation: slideIn 0.3s ease-out;
}

/* Search dropdown styling */
.search-dropdown {
    max-height: 16rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #9ca3af #f3f4f6;
}

.search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
}

.search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Hover effects */
.hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Focus styles */
.focus-ring:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Game end message animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* Stats grid styling */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Image standardization */
.game-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
}

.game-image-large {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
}

.game-image-hero {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px;
}

.game-image-button {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
}

.game-image-small {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px;
}

/* Language selector */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.language-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.language-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(126, 211, 33, 1);
}

.language-btn:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(126, 211, 33, 1);
}



/* Image mode specific styles - Optimized for performance */
.mystery-image {
    transition: filter 0.3s ease, transform 0.3s ease;
    will-change: filter, transform;
}

.mystery-image.blur-heavy {
    filter: blur(15px) hue-rotate(180deg) saturate(0.4);
    transform: rotate(180deg) scale(0.85);
}

.mystery-image.blur-medium {
    filter: blur(10px) hue-rotate(90deg) saturate(0.7);
    transform: rotate(90deg) scale(0.92);
}

.mystery-image.blur-light {
    filter: blur(6px) hue-rotate(45deg) saturate(0.85);
    transform: rotate(45deg) scale(0.96);
}

.mystery-image.blur-minimal {
    filter: blur(3px) hue-rotate(20deg) saturate(0.95);
    transform: rotate(20deg) scale(0.99);
}

.mystery-image.clear {
    filter: none;
    transform: none;
}

/* Title image styling */
.title-image {
    height: 200px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8))
            drop-shadow(0 0 10px rgba(0, 0, 0, 0.5))
            drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.8))
            drop-shadow(-2px -2px 0px rgba(0, 0, 0, 0.8));
}

.title-image-small {
    max-height: 80px;
    width: auto;
    filter: none;
}

/* Failed guess styling */
.failed-guess {
    border: 3px solid #D0021B !important;
    background: rgba(208, 2, 27, 0.1) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Grid cell centering */
.guess-row {
    align-items: center;
}

.guess-row > div {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.5rem;
}

/* Ensure images in tiles are centered */
.game-tile img {
    margin: 0 auto;
    display: block;
}

/* Header row styling */
.grid-header {
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

.grid-header > div {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    text-align: center;
}

/* Mobile-first improvements */
@media (max-width: 640px) {
    /* Ensure proper touch targets */
    .game-mode-card {
        min-height: 140px;
        touch-action: manipulation;
    }

    /* Better button sizing for touch */
    button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improve text readability */
    .game-mode-title {
        line-height: 1.3;
    }

    .game-mode-description {
        line-height: 1.4;
    }

    /* Better spacing for small screens */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Optimize modal for mobile */
    .modal-backdrop {
        padding: 0.75rem;
    }

    /* Better input sizing */
    input[type="text"] {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }

    /* Improve suggestion buttons */
    .suggestion-button {
        padding: 0.75rem;
        min-height: 60px;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .title-image {
        height: 80px;
    }

    .game-mode-card {
        min-height: 120px;
        padding: 1rem;
    }

    .game-mode-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .mystery-image {
        width: 140px !important;
        height: 140px !important;
    }
}

/* BTD6 Responsive Design */
@media (max-width: 768px) {
    .btd6-original-title {
        height: 80px;
    }

    .bottom-bar-content {
        padding: 12px 16px;
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }

    .bottom-timer,
    .bottom-language,
    .bottom-center {
        width: 100%;
        justify-content: center;
    }

    .center-actions {
        flex-direction: column;
        gap: 8px;
    }

    .timer-icon-bottom,
    .lang-icon-bottom {
        font-size: 1.2rem;
    }

    .timer-value-bottom {
        font-size: 1.1rem;
    }

    .lang-select-bottom {
        font-size: 0.8rem;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .btd6-original-title {
        height: 70px;
    }

    .bottom-bar-content {
        padding: 10px 12px;
        gap: 8px;
    }

    .bottom-timer,
    .bottom-language {
        padding: 6px 12px;
    }

    .credits-text {
        font-size: 0.65rem;
    }

    .patch-notes-btn {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    .version-badge {
        font-size: 0.6rem;
        padding: 3px 8px;
    }

    .social-link {
        padding: 4px;
    }

    .social-link svg {
        width: 12px;
        height: 12px;
    }

    .timer-icon-bottom,
    .lang-icon-bottom {
        font-size: 1rem;
    }

    .timer-label-bottom {
        font-size: 0.6rem;
    }

    .timer-value-bottom {
        font-size: 1rem;
    }

    .lang-select-bottom {
        font-size: 0.75rem;
        min-width: 90px;
    }
}

/* Tile with Arrow Styles */
.tile-with-arrow {
    position: relative;
}

.tile-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 4px;
}

.tile-value {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
}

.tile-arrow {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1;
    opacity: 0.9;
    animation: arrowBounce 0.6s ease-out;
}

/* Arrow bounce animation */
@keyframes arrowBounce {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0.9;
        transform: scale(1);
    }
}

/* Enhanced tile states with better arrow visibility */
.game-tile.higher .tile-arrow {
    color: #ffffff;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.game-tile.lower .tile-arrow {
    color: #ffffff;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Ensure correct tiles don't show arrows */
.game-tile.correct .tile-arrow {
    display: none;
}

.game-tile.absent .tile-arrow {
    display: none;
}

.game-tile.present .tile-arrow {
    display: none;
}

/* Hide arrows for categorical properties that don't have order */
.game-tile.no-arrow .tile-arrow {
    display: none;
}
