/* Title Screen Styles */
.title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #a4c639 0%, #8BC34A 50%, #4CAF50 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

.title-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.title-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    padding: 20px;
    animation: bounce 1s ease;
}

.title-logo {
    position: relative;
    margin-bottom: 40px;
}

.logo-meme {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    animation: float 3s ease-in-out infinite;
}

.title-meme-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.3));
}

.title-meme-icon .sunglasses {
    transform-origin: center;
    transform: translateY(-100px);
    opacity: 0;
    animation: dropSunglasses 0.5s ease forwards 1.5s;
}

.left-lens, .right-lens {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

@keyframes dropSunglasses {
    0% { transform: translateY(-20px); opacity: 0; }
    70% { transform: translateY(2px); opacity: 1; }
    85% { transform: translateY(-1px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

.title-game-name {
    font-family: 'Fredoka One', cursive;
    font-size: 3.8rem;
    color: #ffffff;
    text-shadow: 4px 4px 0 #ffcc00, 8px 8px 0px rgba(0,0,0,0.2);
    letter-spacing: 2px;
    transform: rotate(-3deg);
    margin: 0 auto;
    line-height: 0.9;
    animation: pulse 2s infinite;
    background: linear-gradient(to right, #ffcc00, #ff9900, #ff6600);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.3));
}

.title-game-subtitle {
    display: block;
    font-size: 3.2rem;
    color: #ffffff;
    text-shadow: 3px 3px 0 #ffcc00, 6px 6px 0px rgba(0,0,0,0.2);
    transform: rotate(2deg) translateY(-5px);
    background: linear-gradient(to right, #ff6b6b, #ff4757, #ff1844);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.3));
}

.android-badge {
    position: absolute;
    top: -20px;
    right: -30px;
    background: #4285f4;
    color: #fff;
    font-size: 1rem;
    padding: 5px 10px;
    border-radius: 10px;
    transform: rotate(5deg);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    font-family: 'Roboto', sans-serif;
    text-transform: uppercase;
    font-weight: bold;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: shake 4s infinite 2s;
}

.android-icon {
    font-size: 1.4rem;
}

.android-badge .android-icon::before {
    content: "🌐";
}

.title-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.start-game-button {
    background: linear-gradient(to bottom, #ffdd00, #ffaa00);
    color: #333;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2), 0 0 0 5px rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    font-family: 'Fredoka One', cursive;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
    animation: pulse 2s infinite 0.5s;
}

.start-game-button:hover, 
.start-game-button:focus {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 5px rgba(255, 255, 255, 0.4);
}

.start-game-button:active {
    transform: translateY(2px) scale(0.98);
}

.game-version {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-style: italic;
}

.floating-memes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-meme {
    position: absolute;
    font-size: var(--size);
    left: var(--left);
    bottom: -50px;
    animation: floatUp var(--duration) linear infinite var(--delay);
    opacity: 0.7;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); will-change: transform; }
    50% { transform: translateY(-15px) rotate(3deg); will-change: transform; }
    100% { transform: translateY(0px) rotate(0deg); will-change: transform; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0% { transform: translateY(-50px); opacity: 0; }
    60% { transform: translateY(20px); opacity: 1; }
    80% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes shake {
    0% { transform: rotate(5deg); }
    2% { transform: rotate(10deg); }
    4% { transform: rotate(5deg); }
    6% { transform: rotate(10deg); }
    8% { transform: rotate(5deg); }
    10% { transform: rotate(5deg); }
    100% { transform: rotate(5deg); }
}

/* Media Queries for Title Screen */
@media (max-width: 767px) {
    .title-game-name {
        font-size: 2.8rem;
    }
    
    .title-game-subtitle {
        font-size: 2.4rem;
    }
    
    .logo-meme {
        width: 100px;
        height: 100px;
    }
    
    .android-badge {
        font-size: 0.8rem;
        right: -20px;
    }
    
    .start-game-button {
        padding: 12px 30px;
        font-size: 1.3rem;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', 'Montserrat', sans-serif;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overscroll-behavior: none;
    overflow-x: hidden;
    position: relative;
    height: 100%;
    width: 100%;
    touch-action: manipulation;
}

body {
    background-color: #f5f5f5;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: linear-gradient(120deg, #e8f5e9 0%, #f5f7ff 100%);
    overscroll-behavior-y: none;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
    overscroll-behavior: none;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><rect width='60' height='60' fill='%23ffffff' fill-opacity='0.05'/><path d='M15 15L45 45M45 15L15 45' stroke='%23ffcc00' stroke-width='2' stroke-opacity='0.2'/><circle cx='30' cy='30' r='5' fill='%23ff6b6b' fill-opacity='0.15'/></svg>");
    background-size: 30px 30px;
}

h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.8rem;
    margin-bottom: 15px;
    background: linear-gradient(to right, #ff6b6b, #ff4757, #ff1844);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.1);
    letter-spacing: 1px;
    transform: rotate(-2deg);
    position: relative;
    display: inline-block;
    filter: drop-shadow(3px 3px 0 rgba(255, 204, 0, 0.5));
}

h1, h2, h3 {
    position: relative;
}

h1::after, h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='20'><path d='M0 10 Q 12.5 0, 25 10 Q 37.5 20, 50 10 Q 62.5 0, 75 10 Q 87.5 20, 100 10' fill='none' stroke='%23a4c639' stroke-width='1' stroke-opacity='0.2'/></svg>");
    background-size: 100px 20px;
    z-index: 1;
}

.android-edition-tag {
    position: absolute;
    top: -15px;
    right: -50px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: #fff;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 10px;
    transform: rotate(5deg);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
    font-family: 'Roboto', sans-serif;
    text-shadow: none;
    border: 2px dashed #fff;
    text-transform: uppercase;
    font-weight: bold;
}

.android-edition-tag::before {
    content: "🌐";
    margin-right: 4px;
}

.android-edition-tag::after {
    content: "💻";
    margin-left: 4px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border-radius: 30px;
    padding: 12px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 0 10px rgba(255, 255, 255, 0.6);
    font-weight: bold;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><circle cx='10' cy='10' r='1' fill='%23000' fill-opacity='0.1'/></svg>");
    background-size: 10px 10px;
    z-index: -1;
}

.meme-count, .memes-per-second {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meme-count::before {
    content: "😂";
    font-size: 1.5rem;
}

.memes-per-second::before {
    content: "⏱️";
    font-size: 1.5rem;
}

#meme-counter, #mps-counter {
    background: linear-gradient(to right, #ff6b6b, #ff4757, #ff1844);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease-out;
    padding: 0 5px;
    font-size: 1.3rem;
    position: relative;
}

#meme-counter::after, #mps-counter::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #ff6b6b, #ff4757, #ff1844);
    opacity: 0.5;
    border-radius: 2px;
}

#mps-counter {
    background: linear-gradient(to right, #a4c639, #8BC34A, #4CAF50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#mps-counter::after {
    background: linear-gradient(to right, #a4c639, #8BC34A, #4CAF50);
}

.game-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.tab-button {
    background: linear-gradient(to bottom, #ffffff, #f5f5f5);
    border: 2px solid #a4c639;
    color: #333;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='20' cy='20' r='2' fill='%23a4c639' fill-opacity='0.2'/><circle cx='0' cy='0' r='2' fill='%23a4c639' fill-opacity='0.2'/><circle cx='40' cy='0' r='2' fill='%23a4c639' fill-opacity='0.2'/><circle cx='0' cy='40' r='2' fill='%23a4c639' fill-opacity='0.2'/><circle cx='40' cy='40' r='2' fill='%23a4c639' fill-opacity='0.2'/></svg>");
    background-size: 20px 20px;
}

.tab-button:hover {
    background: linear-gradient(to bottom, #e8f5e9, #c8e6c9);
    transform: translateY(-2px);
}

.tab-button.active {
    background: linear-gradient(135deg, #a4c639 0%, #8BC34A 100%);
    color: #fff;
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    background-image: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.tab-content {
    display: none;
    overscroll-behavior: none;
    position: relative;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.tab-content.active {
    display: block;
    transform: translateX(0);
    opacity: 1;
}

.tab-content.slide-left {
    transform: translateX(-20px);
    opacity: 0;
}

.tab-content.slide-right {
    transform: translateX(20px);
    opacity: 0;
}

.tab-content.active {
    display: block;
}

main {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 768px) {
    main {
        justify-content: center;
    }
}

.clicker-area {
    flex: none;
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.5) 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), inset 0 0 20px rgba(255, 255, 255, 0.6);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><circle cx='40' cy='40' r='30' stroke='%23ffcc00' stroke-width='1' stroke-opacity='0.1' fill='none'/><circle cx='40' cy='40' r='20' stroke='%23ffcc00' stroke-width='1' stroke-opacity='0.1' fill='none'/><circle cx='40' cy='40' r='10' stroke='%23ffcc00' stroke-width='1' stroke-opacity='0.1' fill='none'/></svg>");
    background-size: 40px 40px;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.meme-button {
    position: relative;
    width: 180px;
    height: 180px;
    cursor: pointer;
    transition: transform 0.1s;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.2));
    will-change: transform, opacity;
}

.meme-button:active {
    transform: scale(0.92);
}

.meme-icon {
    width: 100%;
    height: 100%;
    animation: float 3s ease-in-out infinite;
    will-change: transform, opacity;
}

.permanent-sunglasses {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.permanent-sunglasses .left-lens,
.permanent-sunglasses .right-lens {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.meme-sunglasses {
    display: none; /* Hide the old toggle sunglasses since we now have permanent ones */
}

.meme-button.clicked .eye,
.meme-button.clicked .pupil,
.meme-button.clicked .eye-highlight {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.click-text {
    margin-top: 25px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #555;
    background: #FFDE00;
    padding: 8px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
}

.click-effect {
    position: absolute;
    pointer-events: none;
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffcc00;
    text-shadow: 2px 2px 1px rgba(0, 0, 0, 0.5);
    opacity: 0;
    z-index: 5;
    will-change: transform, opacity;
}

.text-particle {
    position: absolute;
    pointer-events: none;
    font-family: 'Fredoka One', cursive;
    font-weight: bold;
    text-shadow: 
        2px 2px 0 rgba(0,0,0,0.2), 
        -2px -2px 0 rgba(0,0,0,0.1);
    z-index: 10;
    will-change: transform, opacity;
    transition: 
        transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.5s ease-out;
    white-space: nowrap;
    text-align: center;
    filter: 
        drop-shadow(0 1px 2px rgba(0,0,0,0.3))
        brightness(1.2);
    transform-origin: center;
    opacity: 0;
}

.text-particle.number-effect {
    font-size: 1.8rem;
    color: #ffcc00;
    text-shadow: 
        3px 3px 0 rgba(255, 204, 0, 0.3), 
        -3px -3px 0 rgba(255, 204, 0, 0.2);
}

.text-particle.emoji-effect {
    font-size: 2rem;
    opacity: 0.9;
    filter: 
        drop-shadow(0 2px 3px rgba(0,0,0,0.4))
        brightness(1.3);
}

.mlg-text-particle {
    position: absolute;
    pointer-events: none;
    font-family: 'Fredoka One', cursive;
    font-weight: bold;
    font-size: 2.5rem;
    z-index: 15;
    will-change: transform, opacity;
    text-shadow: 
        2px 2px 0 rgba(255, 0, 0, 0.7),
        -2px -2px 0 rgba(0, 0, 255, 0.7),
        0 0 10px rgba(255, 255, 0, 0.9);
    color: white;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    animation: 
        mlgTextGlitch 0.3s steps(2, start) infinite,
        mlgTextShake 0.2s linear infinite;
}

@keyframes mlgTextGlitch {
    0% { clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%); }
    50% { clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%); }
}

@keyframes mlgTextShake {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-50%, -50%) rotate(2deg); }
    50% { transform: translate(-50%, -50%) rotate(-2deg); }
    75% { transform: translate(-50%, -50%) rotate(1deg); }
    100% { transform: translate(-50%, -50%) rotate(-1deg); }
}

.click-particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.smooth-mode .text-particle {
    transition: 
        transform 0.4s linear,
        opacity 0.3s linear;
}

.smooth-mode .text-particle.mlg-text-particle {
    animation: none;
}

.boost-container {
    margin-top: 20px;
    text-align: center;
}

.boost-button {
    background: linear-gradient(to bottom, #ff6b6b, #ff4757, #ff1844);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(255, 75, 75, 0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.boost-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 75, 75, 0.4);
}

.boost-button:disabled {
    background: linear-gradient(to bottom, #ccc, #999);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.boost-timer {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #ff6b6b;
}

.upgrades-container {
    flex: 1;
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 3px solid #ffcc00;
    overscroll-behavior: none;
}

.building-info {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #ff6b6b;
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
    overscroll-behavior: none;
}

.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
    border-left: 4px solid #ffcc00;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.upgrade-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.upgrade-item.disabled {
    opacity: 0.7;
    background: #eaeaea;
    border-left-color: #ccc;
}

.upgrade-info {
    flex: 1;
}

.upgrade-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.upgrade-description {
    font-size: 0.8rem;
    color: #666;
    margin-top: 3px;
}

.upgrade-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-top: 8px;
}

.upgrade-cost, .upgrade-mps {
    color: #ff6b6b;
    font-weight: bold;
}

.upgrade-amount {
    font-weight: bold;
    font-size: 1.4rem;
    padding: 0 15px;
    color: #ffcc00;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.2);
}

.buy-button {
    background: linear-gradient(to bottom, #ffdd00, #ffaa00);
    border: none;
    color: #333;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 0 #cc8800;
}

.buy-button:hover {
    background: linear-gradient(to bottom, #ffee00, #ffbb00);
    transform: translateY(-2px);
}

.buy-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #cc8800;
}

.buy-button:disabled {
    background: linear-gradient(to bottom, #dddddd, #bbbbbb);
    cursor: not-allowed;
    box-shadow: 0 3px 0 #999999;
}

.stats-container {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.buildings-container {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.buildings-container::before, .meme-haven-container::before, .stats-container::before, 
.minigames-container::before, .settings-container::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    border-top: 3px solid rgba(164, 198, 57, 0.3);
    border-left: 3px solid rgba(164, 198, 57, 0.3);
    z-index: 1;
}

.buildings-container::after, .meme-haven-container::after, .stats-container::after, 
.minigames-container::after, .settings-container::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-bottom: 3px solid rgba(164, 198, 57, 0.3);
    border-right: 3px solid rgba(164, 198, 57, 0.3);
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
    overscroll-behavior: none;
}

.stat-box {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #ffcc00;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='50' height='50'><path d='M0 0l50 50M50 0L0 50' stroke='%23ff6b6b' stroke-width='0.5' stroke-opacity='0.1'/></svg>");
    background-size: 25px 25px;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #ffcc00, #ff6b6b, #a4c639);
    opacity: 0.7;
}

.stat-box h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    font-family: 'Fredoka One', cursive;
}

.stat-box h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.stat-box p {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-left: 2px solid rgba(164, 198, 57, 0.3);
    transition: background 0.2s ease, transform 0.2s ease;
}

.stat-box p:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
}

.stat-box p span {
    font-weight: bold;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 80px;
    text-align: center;
}

.unlocked-achievement {
    color: #4cd137;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(76, 209, 55, 0.1);
    margin: 5px 0;
    border-left: 2px solid #4cd137;
}

.unlocked-achievement::before {
    content: '🏆';
    margin-right: 5px;
}

.achievement-progress {
    margin-top: 15px;
    font-weight: bold;
    text-align: center;
    color: #ff6b6b;
    padding: 10px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
    font-size: 1.1rem;
}

.achievement-progress::before {
    content: '🏅';
    margin-right: 8px;
}

.minigames-container {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: relative;
}

.minigame-intro {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #666;
}

.minigame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    overscroll-behavior: none;
}

.minigame-card {
    background: #f8f8f8;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.minigame-card:hover {
    transform: translateY(-5px);
    border-color: #ffcc00;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.minigame-card h3 {
    color: #ff6b6b;
    margin-bottom: 10px;
}

.minigame-card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.minigame-button {
    background: linear-gradient(to bottom, #ffdd00, #ffaa00);
    border: none;
    color: #333;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.minigame-button:hover {
    transform: scale(1.05);
}

.minigame-area {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-top: 20px;
    border: 3px solid #ffcc00;
    min-height: 400px;
}

.minigame-area.active {
    display: block;
}

.exit-minigame {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 20px;
}

.start-minigame {
    background: #4cd137;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    margin: 20px auto;
    display: block;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.memory-card {
    position: relative;
    height: 100px;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: bold;
}

.card-back {
    background: linear-gradient(135deg, #ffcc00, #ffaa00);
    font-size: 2rem;
    color: white;
}

.card-front {
    background: #fff;
    transform: rotateY(180deg);
    font-size: 1.2rem;
    color: #333;
}

.reaction-area {
    position: relative;
    width: 100%;
    height: 350px;
    background: #f0f0f0;
    border-radius: 15px;
    margin: 20px 0;
    overflow: hidden;
}

#reaction-timer, #reaction-score {
    position: absolute;
    top: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    z-index: 2;
}

#reaction-timer {
    left: 10px;
    color: #ff6b6b;
}

#reaction-score {
    right: 10px;
    color: #4cd137;
}

#reaction-target-area {
    position: relative;
    width: 100%;
    height: 100%;
}

.reaction-target {
    position: absolute;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 1;
}

.reaction-target:hover {
    transform: scale(1.1);
}

.target-meme {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
}

.trivia-container {
    background: #f5f5f5;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

#trivia-question {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

#trivia-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.trivia-option {
    background: white;
    border: 2px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.trivia-option:hover {
    border-color: #ffcc00;
    background: #fff9e6;
}

.trivia-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.trivia-option.correct-option {
    border-color: #4cd137;
    background: #eaffea;
}

#trivia-result {
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 10px;
    margin-top: 15px;
    border-radius: 10px;
}

.correct-answer {
    color: #4cd137;
    background: #f0fff0;
}

.wrong-answer {
    color: #ff6b6b;
    background: #fff0f0;
}

.achievement-popup {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffcc00, #ffaa00);
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    z-index: 1000;
    text-align: center;
    border: 3px solid #fff;
    min-width: 250px;
    opacity: 0;
    pointer-events: none;
}

.achievement-popup.show {
    bottom: 30px;
    opacity: 1;
    pointer-events: auto;
}

.achievement-content h3 {
    margin-bottom: 8px;
    color: #333;
    font-family: 'Fredoka One', cursive;
}

.settings-container {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.settings-box {
    background: #f5f5f5;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #ffcc00;
}

.settings-box h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

.reset-button {
    background: linear-gradient(to bottom, #ff6b6b, #ff4757);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
}

.reset-button:hover {
    background: linear-gradient(to bottom, #ff4757, #ff3344);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 75, 75, 0.3);
}

.reset-confirm {
    display: none;
    background: #fff0f0;
    border: 2px solid #ff6b6b;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.reset-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.reset-yes {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.reset-no {
    background: #aaa;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border-top: none;
    overflow: hidden;
    padding: 8px 0;
    overscroll-behavior: none;
}

.mobile-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #a4c639, #8BC34A, #4CAF50, #a4c639);
    background-size: 200% 100%;
    animation: gradientMove 4s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    padding: 5px 0;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    width: 14.28%;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
}

.mobile-nav-item.active {
    color: #a4c639;
    transform: translateY(-10px);
}

.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #a4c639;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(164, 198, 57, 0.8);
}

.mobile-nav-icon {
    font-size: 1.6rem;
    margin-bottom: 4px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: transparent;
    position: relative;
}

.mobile-nav-item.active .mobile-nav-icon {
    background: linear-gradient(135deg, rgba(164, 198, 57, 0.2) 0%, rgba(139, 195, 74, 0.2) 100%);
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(164, 198, 57, 0.2), 0 0 0 2px rgba(164, 198, 57, 0.1);
}

.mobile-nav-item span {
    transition: all 0.2s ease;
    opacity: 0.9;
    font-family: 'Fredoka One', cursive;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.mobile-nav-item.active span {
    opacity: 1;
    font-weight: bold;
}

@media (max-width: 767px) {
    .meme-haven-stats {
        padding: 15px;
    }
    
    .heavenly-meme-counter, .potential-memes, .meme-multiplier {
        font-size: 1rem;
    }
    
    .ascend-button {
        padding: 12px 30px;
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .android-edition-tag {
        font-size: 0.7rem;
        right: -30px;
        top: -10px;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        border-radius: 20px;
        margin: 0 10px 15px;
    }
    
    #meme-counter, #mps-counter {
        font-size: 1.2rem;
    }
    
    .meme-count::before, .memes-per-second::before {
        font-size: 1.3rem;
    }
    
    .meme-button {
        width: 130px;
        height: 130px;
    }
    
    .click-text {
        font-size: 1.1rem;
    }
    
    .game-tabs {
        flex-wrap: wrap;
        padding: 0 5px;
    }
    
    .tab-button {
        flex: 1;
        min-width: 80px;
        font-size: 0.85rem;
        padding: 10px 8px;
        margin-bottom: 5px;
    }
    
    .clicker-area, .upgrades-container {
        padding: 15px;
        margin: 0 5px;
    }
    
    .upgrade-item {
        padding: 12px 10px;
    }
    
    .boost-button {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .buy-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* Additional mobile improvements */
    .upgrade-name {
        font-size: 1rem;
    }
    
    .minigame-grid {
        grid-template-columns: 1fr;
    }
    
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .memory-card {
        height: 80px;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .game-tabs {
        display: none;
    }
    
    .buildings-grid {
        grid-template-columns: 1fr;
    }
    
    .building-stats {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .mobile-nav-container {
        justify-content: space-between;
    }
    
    .mobile-nav-item {
        width: 14.28%;
    }
    
    .game-container {
        padding-bottom: 90px;
        overscroll-behavior: none;
    }
    
    .buildings-container::before, .meme-haven-container::before, .stats-container::before, 
    .minigames-container::before, .settings-container::before,
    .buildings-container::after, .meme-haven-container::after, .stats-container::after, 
    .minigames-container::after, .settings-container::after {
        width: 15px;
        height: 15px;
    }
    
    .divider {
        height: 20px;
    }
}

.buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
    overscroll-behavior: none;
}

.building-card {
    display: flex;
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #ccc;
    transition: all 0.3s;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><path d='M0 15h60M0 30h60M0 45h60' stroke='%23000' stroke-width='0.5' stroke-opacity='0.07'/><path d='M15 0v60M30 0v60M45 0v60' stroke='%23000' stroke-width='0.5' stroke-opacity='0.07'/></svg>");
    background-size: 30px 30px;
    position: relative;
}

.building-card.owned {
    border-left-color: #ffcc00;
    background: linear-gradient(135deg, #fffbeb 0%, #fff8e1 100%);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><path d='M0 15h60M0 30h60M0 45h60' stroke='%23ffcc00' stroke-width='0.5' stroke-opacity='0.1'/><path d='M15 0v60M30 0v60M45 0v60' stroke='%23ffcc00' stroke-width='0.5' stroke-opacity='0.1'/></svg>");
    background-size: 30px 30px;
}

.building-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffcc00, #ffaa00);
    border-radius: 50%;
    margin-right: 15px;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(255, 204, 0, 0.3);
}

.building-details {
    flex: 1;
}

.building-details h3 {
    color: #333;
    margin-bottom: 5px;
    font-size: 1.3rem;
}

.building-details p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.building-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.building-owned span, .building-output span, .building-cost span {
    font-weight: bold;
    color: #ff6b6b;
}

.building-buy-button {
    background: linear-gradient(to bottom, #ffdd00, #ffaa00);
    border: none;
    color: #333;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 0 #cc8800;
    margin-top: 5px;
}

.building-buy-button:hover {
    background: linear-gradient(to bottom, #ffee00, #ffbb00);
    transform: translateY(-2px);
}

.building-buy-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #cc8800;
}

.building-buy-button:disabled {
    background: linear-gradient(to bottom, #dddddd, #bbbbbb);
    cursor: not-allowed;
    box-shadow: 0 3px 0 #999999;
}

/* Building Info Modal Styles */
.info-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #ffcc00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    border: none;
    z-index: 2;
    transition: all 0.2s;
}

.info-button:hover {
    transform: scale(1.1);
    background: #ff9900;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.building-info-modal {
    background: white;
    border-radius: 15px;
    max-width: 90%;
    width: 320px;
    padding: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
    border-top: 5px solid #ffcc00;
}

.modal-overlay.active .building-info-modal {
    transform: scale(1);
}

.building-info-modal .close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #ff6b6b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    border: none;
}

.building-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.modal-building-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffcc00, #ffaa00);
    border-radius: 50%;
    margin-right: 10px;
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
}

.modal-building-title {
    flex: 1;
}

.modal-building-title h3 {
    margin: 0 0 3px 0;
    color: #333;
}

.modal-building-title p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
}

.info-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
}

.info-stat:last-child {
    border-bottom: 1px solid #f0f0f0;
}

.info-label {
    font-weight: bold;
    color: #555;
}

.info-value {
    color: #ff6b6b;
    font-weight: bold;
}

.info-produced-container {
    margin-top: 15px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
}

.info-produced-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    font-size: 0.9rem;
}

.info-produced-value {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff6b6b;
    background: #fff;
    padding: 8px;
    border-radius: 5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Meme Haven Styles */
.meme-haven-container {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='70' height='70'><path d='M35 10L40 25L55 25L45 35L50 50L35 40L20 50L25 35L15 25L30 25L35 10Z' fill='%23a4c639' fill-opacity='0.08'/></svg>");
    background-size: 35px 35px;
    position: relative;
}

.meme-haven-description {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #666;
}

.meme-heaven-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.meme-haven-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f5f5f5;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 500px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.heavenly-meme-counter, .potential-memes, .meme-multiplier {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    display: flex;
    justify-content: center;
    position: relative;
}

.heavenly-meme-counter span, .potential-memes span, .meme-multiplier span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.heavenly-meme-counter span::before {
    content: "😇";
    font-size: 1.5rem;
    margin-right: 10px;
}

.potential-memes span::before {
    content: "⬆️";
    font-size: 1.5rem;
    margin-right: 10px;
}

.meme-multiplier span::before {
    content: "✨";
    font-size: 1.5rem;
    margin-right: 10px;
}

.tooltip {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
    white-space: nowrap;
    text-align: center;
}

.heavenly-meme-counter:hover .tooltip {
    opacity: 1;
}

.prestige-requirements {
    width: 100%;
    max-width: 500px;
    margin-bottom: 25px;
}

.requirement-text {
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #ff6b6b;
}

.progress-container {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, #a4c639, #8BC34A);
    transition: width 0.5s;
}

.ascend-button {
    background: linear-gradient(135deg, #a4c639 0%, #8BC34A 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(164, 198, 57, 0.4);
    margin-bottom: 20px;
}

.ascend-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(164, 198, 57, 0.5);
}

.ascend-button:disabled {
    background: linear-gradient(135deg, #cccccc 0%, #aaaaaa 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.meme-haven-warning {
    background: #fff0f0;
    border: 2px solid #ff6b6b;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    display: none;
    max-width: 500px;
}

.meme-haven-warning p {
    margin-bottom: 10px;
    font-weight: bold;
    color: #ff4757;
}

.ascension-confirm {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.confirm-ascend-button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.cancel-ascend-button {
    background: #aaa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.history-meme {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.2) 0%, rgba(164, 198, 57, 0.2) 100%);
    padding: 12px;
    margin: 10px 0;
    border-radius: 10px;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
    box-shadow: inset 0 0 15px rgba(255, 204, 0, 0.1);
    border: 1px dashed rgba(255, 107, 107, 0.3);
}

.history-meme:hover {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.3) 0%, rgba(255, 107, 107, 0.3) 100%);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

@media (max-width: 767px) {
    .history-meme {
        padding: 8px;
        font-size: 1rem;
    }
}

/* History Timeline Styles */
.history-container {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow-y: auto;
    max-height: 80vh;
    overscroll-behavior: none;
}

.history-container::before, .history-container::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 1;
}

.history-container::before {
    top: 10px;
    left: 10px;
    border-top: 3px solid rgba(164, 198, 57, 0.3);
    border-left: 3px solid rgba(164, 198, 57, 0.3);
}

.history-container::after {
    bottom: 10px;
    right: 10px;
    border-bottom: 3px solid rgba(164, 198, 57, 0.3);
    border-right: 3px solid rgba(164, 198, 57, 0.3);
}

.history-intro {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #666;
    font-style: italic;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 6px;
    background: linear-gradient(to bottom, #ffcc00, #a4c639);
    top: 0;
    bottom: 0;
    left: 50px;
    margin-left: -3px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(164, 198, 57, 0.5);
}

.timeline-item {
    padding: 10px 40px 10px 80px;
    position: relative;
    background-color: inherit;
    width: 100%;
    margin-bottom: 30px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 43px;
    background-color: white;
    border: 4px solid #ffcc00;
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.5);
}

.timeline-date {
    position: absolute;
    left: 0;
    top: 15px;
    font-weight: bold;
    font-size: 1.2rem;
    color: #ff6b6b;
    width: 40px;
    text-align: right;
}

.timeline-content {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #ffcc00;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.timeline-content h3 {
    margin-top: 0;
    color: #a4c639;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.timeline-content p {
    margin: 10px 0;
    line-height: 1.5;
    color: #555;
}

.history-quote {
    font-style: italic;
    padding: 15px;
    margin: 15px 0;
    background: rgba(164, 198, 57, 0.1);
    border-radius: 8px;
    position: relative;
}

.history-quote::before {
    content: '"';
    font-size: 3rem;
    position: absolute;
    left: 5px;
    top: -10px;
    color: rgba(164, 198, 57, 0.3);
    font-family: 'Georgia', serif;
}

.meme-future-note {
    background: rgba(255, 204, 0, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    font-weight: bold;
    color: #ff6b6b;
    text-align: center;
}

.history-footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    font-style: italic;
    color: #666;
}

@media (max-width: 767px) {
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        padding-left: 60px;
    }
    
    .timeline-item::after {
        left: 23px;
        width: 15px;
        height: 15px;
    }
    
    .timeline-date {
        left: -5px;
        font-size: 1rem;
        width: 30px;
    }
    
    .timeline-content h3 {
        font-size: 1.1rem;
    }
    
    .history-container {
        padding: 15px;
    }
    
    .mobile-nav-container {
        justify-content: space-between;
    }
    
    .mobile-nav-item {
        width: 14.28%;
    }
}

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff9b9b 100%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.loading-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    padding: 20px;
}

.loading-meme {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-meme-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.3));
}

.loading-smile {
    animation: loadingSmile 1.5s ease-in-out infinite;
}

@keyframes loadingSmile {
    0% { d: path('M30 65 Q50 85 70 65'); }
    50% { d: path('M30 65 Q50 45 70 65'); }
    100% { d: path('M30 65 Q50 85 70 65'); }
}

.loading-dot {
    opacity: 0;
}

.dot1 {
    animation: fadeDot 1.2s infinite 0s;
}

.dot2 {
    animation: fadeDot 1.2s infinite 0.4s;
}

.dot3 {
    animation: fadeDot 1.2s infinite 0.8s;
}

@keyframes fadeDot {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.loading-text {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
    animation: loadingText 1.5s ease-in-out infinite;
}

@keyframes loadingText {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.loading-progress-container {
    width: 250px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #ffcc00, #ffaa00);
    border-radius: 20px;
    animation: loadProgress 3s ease-out;
}

@keyframes loadProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.loading-tips {
    max-width: 80%;
    color: #fff;
    font-style: italic;
    font-size: 1.1rem;
    margin-top: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.loading-meme-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.rain-meme {
    position: absolute;
    font-size: 2rem;
    opacity: 0.4;
    animation: memeRain 3s linear infinite;
    top: -50px;
}

.rain-meme:nth-child(1) { left: 10%; animation-delay: 0s; }
.rain-meme:nth-child(2) { left: 25%; animation-delay: 0.3s; }
.rain-meme:nth-child(3) { left: 40%; animation-delay: 0.6s; }
.rain-meme:nth-child(4) { left: 60%; animation-delay: 0.1s; }
.rain-meme:nth-child(5) { left: 75%; animation-delay: 0.7s; }
.rain-meme:nth-child(6) { left: 85%; animation-delay: 0.2s; }
.rain-meme:nth-child(7) { left: 20%; animation-delay: 0.5s; }
.rain-meme:nth-child(8) { left: 50%; animation-delay: 0.4s; }

@keyframes memeRain {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    30% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Optional FPS counter styles (if you want to display it) */
.fps-counter {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    font-family: monospace;
}

.setting-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #a4c639;
}

input:focus + .slider {
    box-shadow: 0 0 1px #a4c639;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.smooth-mode .meme-button {
    transition: transform 0.1s linear;
}

.smooth-mode .meme-icon {
    animation: float 5s ease-in-out infinite;
}

.smooth-mode .tab-content,
.smooth-mode .stats-grid,
.smooth-mode .upgrades-list,
.smooth-mode .minigame-grid,
.smooth-mode .buildings-grid {
    will-change: transform;
    transform: translateZ(0);
}

.smooth-mode .floating-meme {
    display: none;
}

.smooth-mode .rain-meme {
    opacity: 0.3;
}

.simple-effect {
    font-size: 1.5rem;
    color: #ffcc00;
    position: absolute;
    pointer-events: none;
    opacity: 0.9;
    transition: all 0.5s ease-out;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
    z-index: 10;
}

.setting-description {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.divider {
    position: relative;
    height: 30px;
    margin: 20px 0;
    overflow: hidden;
}

.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    transform: translateY(-50%);
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='20'><path d='M0 10 Q 12.5 0, 25 10 Q 37.5 20, 50 10 Q 62.5 0, 75 10 Q 87.5 20, 100 10' fill='none' stroke='%23a4c639' stroke-width='1' stroke-opacity='0.2'/></svg>");
    background-size: 100px 20px;
}

.version-changes {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.version-changes ul {
    margin: 5px 0 0 15px;
    padding: 0;
}

.version-changes li {
    margin-bottom: 5px;
    position: relative;
    padding-left: 5px;
}

.version-changes li::before {
    content: '•';
    position: absolute;
    left: -10px;
    color: #a4c639;
}

/* Update notification styles */
.update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    max-width: 350px;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.3s ease;
    border-left: 5px solid #a4c639;
    overflow: hidden;
}

.update-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.update-content {
    padding: 15px;
}

.update-content h3 {
    color: #ff6b6b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.update-changes {
    max-height: 200px;
    overflow-y: auto;
    margin: 10px 0;
    font-size: 0.9rem;
    background: rgba(164, 198, 57, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
}

.update-changes ul {
    margin-top: 5px;
    margin-left: 20px;
    padding: 0;
}

.update-changes li {
    margin-bottom: 4px;
}

.update-close {
    background: #a4c639;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    float: right;
    margin-top: 5px;
}

.update-close:hover {
    background: #93b32d;
}

.encyclopedia-link {
    display: inline-block;
    background: linear-gradient(to bottom, #a4c639, #8BC34A);
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    margin-top: 15px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(164, 198, 57, 0.4);
}

.encyclopedia-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(164, 198, 57, 0.5);
}

.encyclopedia-link:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(164, 198, 57, 0.3);
}

/* MLG Flash Effect Styles */
@keyframes mlgShake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.mlg-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    animation: mlgShake 0.5s linear;
    mix-blend-mode: screen;
    opacity: 0.7;
}

/* Additional shake for meme button during MLG effect */
.meme-button.mlg-shake {
    animation: mlgShake 0.5s linear;
}

/* Autosave Indicator Styles */
.autosave-indicator {
    position: fixed;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autosave-indicator.show {
    opacity: 1;
}

.autosave-indicator::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-left-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Offline Progress Popup Styles */
.offline-progress-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    max-width: 350px;
    width: 90%;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid #a4c639;
    text-align: center;
    pointer-events: none;
}

.offline-progress-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.offline-progress-popup h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
}

.offline-memes {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.2) 0%, rgba(164, 198, 57, 0.2) 100%);
    padding: 15px;
    border-radius: 15px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.offline-memes .meme-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b6b;
}

.offline-close {
    background: linear-gradient(to bottom, #a4c639, #8BC34A);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(164, 198, 57, 0.3);
}

.offline-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(164, 198, 57, 0.4);
}

.offline-close:active {
    transform: translateY(1px);
}

.bonus-tooltip {
    position: relative;
    cursor: help;
    font-size: 0.9rem;
    margin-left: 5px;
}

.bonus-tooltip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

.meme-haven-bonus-info {
    margin-top: 15px;
    background: rgba(164, 198, 57, 0.1);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}