:root {
    --cookie-brown: #5c3d2e;
    --cookie-light: #f7e9d0;
    --cookie-orange: #e67e22;
    --cookie-dark: #8b4513;
    --cookie-gold: #ffd700;
    --cookie-red: #d9534f;
    --cookie-green: #5cb85c;
    --text-light: #fff8e7;
    --text-dark: #3e2723;
    --shadow: 0 4px 12px rgba(92, 61, 46, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--cookie-light);
    color: var(--text-dark);
    font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 248, 231, 0.8) 0%, rgba(247, 233, 208, 0.9) 90%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="15" cy="15" r="7" fill="%235c3d2e" opacity="0.1"/><circle cx="40" cy="30" r="5" fill="%235c3d2e" opacity="0.1"/><circle cx="70" cy="20" r="8" fill="%235c3d2e" opacity="0.1"/></svg>');
}

h1, h2, h3 {
    color: var(--cookie-dark);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

h1 {
    font-size: 2.5rem;
    color: var(--cookie-orange);
}

h2 {
    font-size: 1.8rem;
    margin-top: 20px;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

a {
    color: var(--cookie-orange);
    transition: color 0.3s;
}

a:hover {
    color: var(--cookie-dark);
}

hr {
    border: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--cookie-orange), transparent);
    margin: 15px auto;
    max-width: 300px;
}

#content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin: 25px auto;
}

.stats {
    background: rgba(255, 248, 231, 0.95);
    border-radius: 20px;
    padding: 25px;
    border: 3px solid var(--cookie-orange);
    box-shadow: var(--shadow);
    min-width: 300px;
    margin: 0 auto;
    max-width: 500px;
    width: 100%;
}

#cookie {
    display: block;
    margin: 50px auto;
    width: 250px;
    height: 250px;
    cursor: pointer;
    transition: all 0.2s;
    filter: drop-shadow(0 10px 15px rgba(139, 69, 19, 0.3));
    user-select: none;
}

#cookie:hover {
    transform: scale(1.05);
}

#cookie:active {
    transform: scale(0.92);
}

.btn, .shop-button {
    background: linear-gradient(to bottom, var(--cookie-orange), var(--cookie-dark));
    color: var(--text-light);
    border: none;
    border-radius: 50px;
    padding: 16px 25px;
    margin: 12px 0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: block;
    width: 100%;
    text-align: left;
    box-shadow: var(--shadow);
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.btn-svg {
    display: flex;
    align-items: center;
}

.shop-button {
    text-align: center;
    font-size: 1.05rem;
}

.btn::after, .shop-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20px;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(25deg);
    transition: all 0.6s;
}

.btn:hover::after, .shop-button:hover::after {
    left: 120%;
}

.btn:hover, .shop-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(139, 69, 19, 0.4);
}

.btn:active, .shop-button:active {
    transform: translateY(1px);
}

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

.btntext a {
    color: var(--text-light) !important;
    font-weight: 600;
}

.navbar {
    background: linear-gradient(to right, var(--cookie-dark), var(--cookie-orange));
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px;
}

.element {
    cursor: pointer;
    flex: 1;
    min-width: 180px;
    max-width: 220px;
}

.element-inner {
    padding: 14px 5px;
    border-radius: 12px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
    text-align: center;
    margin: 5px;
}

.element-inner:hover {
    background: rgba(255, 255, 255, 0.25);
}

.element-inner a {
    color: var(--text-light);
    font-weight: 600;
    font-size: 1.05rem;
    padding: 5px 10px;
}

footer {
    background: transparent !important;
}

#cookies, #cps, #prestige, 
#autoCount, #grandmaCount {
    font-weight: 700;
    color: var(--cookie-orange);
    font-size: 1.3rem;
    display: inline-block;
}

#prestige {
    color: var(--cookie-gold);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

.save-info {
    background: rgba(255, 248, 231, 0.8);
    border-radius: 15px;
    padding: 15px;
}

#save {
    color: var(--cookie-green);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 15px;
}

#fileLoader {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.overlay-content {
    background: var(--cookie-light);
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--cookie-orange);
}

.overlay-head h1 {
    color: var(--cookie-dark);
    margin-bottom: 20px;
    font-size: 2.2rem;
}

.overlay-main {
    text-align: left;
    padding: 15px 0;
}

.overlay-main ul {
    padding-left: 25px;
    margin: 15px 0;
}

.overlay-main li {
    margin-bottom: 12px;
}

.overlay-foot {
    margin-top: 20px;
}

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

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

#save {
    animation: fadeOut 2s 1s forwards;
}

@media (max-width: 1100px) {
    .navigation {
        gap: 3px;
    }
    
    .element {
        min-width: 160px;
    }
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
        align-items: center;
    }
    
    .stats {
        width: 100%;
        max-width: 600px;
    }
    
    #cookie {
        width: 220px;
        height: 220px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .element {
        min-width: 140px;
        max-width: 180px;
    }
    
    .element-inner a {
        font-size: 0.95rem;
    }
    
    .btn, .shop-button {
        padding: 14px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 600px) {
    #content {
        padding: 15px 10px;
    }
    
    #cookie {
        width: 200px;
        height: 200px;
        margin: 15px auto;
    }
    
    .stats {
        padding: 20px 15px;
    }
    
    .overlay-content {
        padding: 20px 15px;
    }
    
    .navigation {
        justify-content: space-around;
    }
    
    .element {
        min-width: 45%;
        max-width: 48%;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.9rem;
    }
    
    .element {
        min-width: 100%;
        max-width: 100%;
    }
    
    #cookies, #cps, #prestige, 
    #autoCount, #grandmaCount {
        font-size: 1.2rem;
    }
    
    .btn-inner {
        flex-direction: column;
        gap: 8px;
    }
    
    .btntext {
        text-align: center;
    }
}

@media (max-width: 360px) {
    #cookie {
        width: 180px;
        height: 180px;
    }
    
    .shop-button {
        font-size: 0.95rem;
    }
}

.stats a, .overlay-main a, .overlay-main li a {
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 1.05rem;
}

.overlay-main strong {
    color: var(--cookie-dark);
}

.shop-button a {
    display: block;
    margin: 5px 0;
    color: var(--text-light);
    text-align: center;
}

#closeAbout, #acceptCookiesBtn {
    background: linear-gradient(to bottom, var(--cookie-green), #4a9e48) !important;
}