* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f4ecd8;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.game-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    padding: 20px;
}

.stats {
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    padding: 15px 30px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#cookie-count-display {
    font-size: clamp(30px, 8vw, 50px);
    font-weight: 900;
    color: #5d4037;
}

.cps-text {
    font-size: 18px;
    color: #8b4513;
}

#cookie {
    font-size: clamp(180px, 45vw, 350px);
    cursor: pointer;
    user-select: none;
    transition: transform 0.05s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#cookie:active {
    transform: scale(0.92);
}

.sidebar {
    width: 350px;
    background-color: #3d2b1f;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    overflow-y: auto;
}

.sidebar h2 {
    text-align: center;
    margin-top: 0;
    border-bottom: 2px solid #5d4037;
    padding-bottom: 10px;
}

.upgrade-item {
    background-color: #5d4037;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: background 0.2s;
}

.upgrade-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.upgrade-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.upgrade-texts {
    display: flex;
    flex-direction: column;
}

.upgrade-name {
    font-weight: bold;
    font-size: 1.1em;
}

.upgrade-desc {
    font-size: 0.85em;
    color: #d7ccc8;
}

.upgrade-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.upgrade-amount {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
}

button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: #8b4513;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover:not(:disabled) {
    background-color: #a0522d;
}

button:disabled {
    background-color: #2e1f16;
    color: #777;
    cursor: not-allowed;
}

.header-container {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 15px;
}

.logo {
  height: 60px;
  width: auto;
}

.logo-text {
  font-size: 24px;
  font-weight: bold;
  font-family: 'Latin Modern Mono', monospace;
  color: #000;
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}

#shop-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    background: #8b4513;
    color: white;
    padding: 10px 20px;
    border: 2px solid #ffd700;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

@media (max-width: 800px) {
    #shop-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        border-left: none;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-area {
        height: 100vh;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .sidebar h2 {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
    }
}