/* ========================================
   Cookie Clicker - game4.fun
   Dark glassmorphism theme
======================================== */

.game-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 20px 40px;
    min-height: calc(100vh - 80px - 60px);
}

.game-header {
    text-align: center;
    margin-bottom: 24px;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleReveal 0.8s ease-out;
}

/* ===== Layout ===== */
.game-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.cookie-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.shop-area {
    width: 340px;
    flex-shrink: 0;
}

/* ===== Cookie Stats ===== */
.cookie-stats {
    text-align: center;
}

.cookie-count {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.cookie-count span:first-child {
    background: linear-gradient(135deg, var(--primary-neon), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cookie-label {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-left: 8px;
    -webkit-text-fill-color: var(--text-dim);
    background: none;
    -webkit-background-clip: unset;
}

.cookie-rate {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ===== Cookie Button ===== */
.cookie-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 260px;
    height: 260px;
}

.cookie-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 35% 35%, rgba(99,102,241,0.15), rgba(236,72,153,0.1));
    border: 2px solid var(--border-glass);
    box-shadow: var(--shadow-glass), 0 0 40px rgba(99,102,241,0.15);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 2;
}

.cookie-btn:hover {
    box-shadow: var(--shadow-glass), 0 0 60px rgba(99,102,241,0.3);
}

.cookie-btn:active,
.cookie-btn.clicking {
    transform: scale(0.9);
}

.cookie-btn.bounce {
    animation: cookieBounce 0.15s ease-out;
}

@keyframes cookieBounce {
    0%   { transform: scale(0.88); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.cookie-inner {
    font-size: 7rem;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    pointer-events: none;
}

/* ===== Float Text ===== */
.float-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.float-text {
    position: absolute;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251,191,36,0.6);
    pointer-events: none;
    animation: floatUp 0.9s ease-out forwards;
    white-space: nowrap;
}

@keyframes floatUp {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(1.3); }
}

/* ===== Golden Cookie ===== */
.golden-cookie {
    position: fixed;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 100;
    display: none;
    animation: goldenFloat 2s ease-in-out infinite, goldenGlow 1s ease-in-out infinite alternate;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.golden-cookie.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.golden-inner {
    font-size: 3rem;
    filter: drop-shadow(0 0 12px rgba(251,191,36,0.8));
    pointer-events: none;
}

@keyframes goldenFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-15px) rotate(10deg); }
}

@keyframes goldenGlow {
    from { filter: drop-shadow(0 0 12px rgba(251,191,36,0.5)); }
    to   { filter: drop-shadow(0 0 24px rgba(251,191,36,1)); }
}

.golden-status {
    background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(245,158,11,0.2));
    border: 1px solid rgba(251,191,36,0.4);
    color: #fbbf24;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

.hidden { display: none !important; }

/* ===== Shop ===== */
.shop-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-glass);
}

.shop-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-item {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition-base);
    cursor: pointer;
    user-select: none;
}

.shop-item:hover:not(.disabled) {
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.shop-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.shop-item.affordable {
    border-color: rgba(99,102,241,0.4);
    box-shadow: 0 0 15px rgba(99,102,241,0.1);
}

.shop-icon {
    font-size: 2rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    flex-shrink: 0;
}

.shop-info {
    flex: 1;
    min-width: 0;
}

.shop-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.shop-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.shop-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.shop-meta .cost-val {
    color: #fbbf24;
    font-weight: 600;
}

.shop-meta .count-val {
    color: var(--accent-cyan);
    font-weight: 600;
}

.shop-meta .rate-val {
    color: #34d399;
    font-weight: 600;
}

.shop-buy-hint {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-neon), var(--secondary-neon));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.shop-item.affordable .shop-buy-hint {
    opacity: 1;
    box-shadow: var(--glow-primary);
}

/* ===== Reset Button ===== */
.reset-btn {
    margin-top: 8px;
    padding: 8px 24px;
    border: 1px solid rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.reset-btn:hover {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.5);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 12px 28px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.23,1,0.32,1);
    z-index: 9999;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Ad Container ===== */
.g4f-ad-container {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder-content {
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-glass);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
    }

    .shop-area {
        width: 100%;
        max-width: 400px;
    }

    .cookie-wrapper {
        width: 220px;
        height: 220px;
    }

    .cookie-btn {
        width: 170px;
        height: 170px;
    }

    .cookie-inner {
        font-size: 5.5rem;
    }

    .cookie-count {
        font-size: 1.8rem;
    }

    .game-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 12px 12px 30px;
    }

    .cookie-wrapper {
        width: 190px;
        height: 190px;
    }

    .cookie-btn {
        width: 150px;
        height: 150px;
    }

    .cookie-inner {
        font-size: 4.5rem;
    }

    .shop-item {
        padding: 10px 12px;
        gap: 10px;
    }
}

/* ===== Highlight utility from global ===== */
.highlight-4 {
    color: var(--primary-neon);
}
