/* Cookie Clicker Layout Styling */

.clicker-dashboard {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    margin: 40px auto;
    max-width: 1000px;
    padding: 20px;
}

@media (max-width: 768px) {
    .clicker-dashboard {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Left Panel: Clicker main panel */
.clicker-main-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.score-display {
    text-align: center;
    margin-bottom: 25px;
}

.count-label {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--doge-gold);
    font-weight: 700;
}

.count-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    margin: 5px 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.cps-display {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Clicking Object Styling */
.clickable-wrapper {
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.sticker-cookie {
    width: 100%;
    height: 100%;
    transition: transform 0.08s ease-out;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
    animation: cookieBob 3s ease-in-out infinite;
}

@keyframes cookieBob {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-6px) rotate(1deg);
    }
}

/* Sticker Hover and Pop Effect */
.clickable-wrapper:hover .sticker-cookie {
    transform: scale(1.05) translateY(-3px) rotate(0.5deg);
    animation-play-state: paused;
}

.clickable-wrapper:active .sticker-cookie {
    transform: scale(0.92);
}

.cookie-image-file {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.cookie-svg-fallback {
    width: 100%;
    height: 100%;
}

/* Right Panel: Shop list */
.shop-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.shop-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

/* Shop Buttons */
.upgrade-btn {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    text-align: left;
    color: #fff;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.upgrade-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2) !important;
}

.upgrade-btn.locked:hover {
    transform: none;
}

.upgrade-btn.affordable {
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.03);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.05);
}

.upgrade-btn.affordable:hover {
    background: rgba(255, 215, 0, 0.06);
    border-color: rgba(255, 215, 0, 0.6);
}

.upgrade-icon {
    font-size: 1.6rem;
    color: var(--doge-gold);
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.upgrade-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.upgrade-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.upgrade-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
}

.upgrade-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.upgrade-cost {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--doge-gold);
}

.upgrade-cost::before {
    content: "🍪 ";
    font-size: 0.9rem;
}

.upgrade-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    font-weight: 600;
}

/* Save / Reset Layout */
.reset-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 25px;
}

.reset-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.reset-danger {
    color: #ff8a80;
    border-color: rgba(255, 138, 128, 0.2);
}

.reset-danger:hover {
    background: rgba(255, 138, 128, 0.08);
    border-color: rgba(255, 138, 128, 0.4);
}

/* Particle / Floating Score Styles */
.particle {
    position: absolute;
    color: #ffb74d;
    font-weight: 900;
    font-size: 2.8rem;
    pointer-events: none;
    user-select: none;
    z-index: 99999;
    animation: floatUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4), 0 3px 6px rgba(0, 0, 0, 0.9);
}

@keyframes floatUp {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -150px) scale(1.2);
        opacity: 0;
    }
}

/* Instruction Prompt Block */
.instruction-box {
    background: rgba(255, 183, 77, 0.03);
    border: 1px dashed rgba(255, 183, 77, 0.3);
    padding: 20px;
    border-radius: 12px;
}

.prompt-code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    border-radius: 6px;
    color: #ffb74d;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    margin: 8px 0;
    word-break: break-all;
}

/* Screen Shake & Sparkle Animations */
.clicker-main-panel.shake {
    animation: screenShake 0.15s ease-in-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-3px, -1px); }
    50% { transform: translate(3px, 1px); }
    75% { transform: translate(-2px, 1px); }
}

.sparkle-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    user-select: none;
    z-index: 99;
    animation: shootSparkle 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

@keyframes shootSparkle {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}
