/* ============================================
   MEW CLICKER - Mew to Ascend
   Cookie Clicker Visual Style
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Kavoon&display=swap');

:root {
    --bg-cookie: #0a3464;
    --bg-cookie-dark: #061a38;
    --bg-store: #0e0e0e;
    --bg-store-item: #1a1410;
    --bg-store-hover: #2a2218;
    --bg-topbar: #1a0e06;
    --border-store: #3a3020;
    --brown-dark: #4b261b;
    --brown-mid: #6b4026;
    --brown-light: #9f7547;
    --brown-pale: #b6986d;
    --cream: #f5e6c8;
    --white: #fff;
    --green: #6f6;
    --green-dim: #4a4;
    --red: #f66;
    --gold: #e8c252;
    --gold-bright: #ffd700;
    --text: #e8dcc8;
    --text-dim: #9a8a72;
    --text-bright: #fff;
    --font-display: 'Kavoon', cursive;
    --font-body: 'Merriweather', Georgia, serif;

    /* Tier-specific theme (defaults: tier 0) */
    --tier-bg: #1a1a1a;
    --tier-accent: #666;
    --tier-glow: none;
    --tier-particle-opacity: 0;
}

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

body {
    background: #000;
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---- PARTICLE BACKGROUND CANVAS ---- */
#particle-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

/* ---- TOP BAR ---- */
#top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: linear-gradient(180deg, #2a1a0c, #1a0e06);
    border-bottom: 2px solid var(--brown-mid);
    position: sticky;
    top: 0;
    z-index: 100;
}

#title-section {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

#title-section h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--cream);
    text-shadow: 2px 2px 0 #000, 0 0 10px rgba(245, 230, 200, 0.3);
    cursor: pointer;
}

#subtitle {
    font-size: 0.75rem;
    color: var(--brown-light);
    letter-spacing: 1px;
}

#top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

#mute-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
#mute-btn:hover { opacity: 1; }

#tier-section {
    text-align: right;
}

#tier-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    display: block;
}

#tier-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--cream);
    transition: color 0.5s;
}

/* ---- NEWS TICKER ---- */
#news-ticker {
    background: var(--brown-dark);
    border-bottom: 2px solid var(--brown-mid);
    padding: 5px 24px;
    font-size: 0.72rem;
    color: var(--brown-pale);
    overflow: hidden;
    white-space: nowrap;
}

#news-text {
    display: inline-block;
    animation: ticker 20s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* ---- MAIN CONTENT: 3-Column Cookie Clicker Layout ---- */
#main-content {
    display: grid;
    grid-template-columns: 200px 1fr 340px;
    gap: 0;
    height: calc(100vh - 80px);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ---- CENTER PANEL: THE MEWING ZONE (Cookie Area) ---- */
#center-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 24px 20px;
    gap: 20px;
    background: var(--tier-bg);
    position: relative;
    transition: background 1.5s ease;
}

/* Subtle overlay */
#center-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.03) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(255,255,255,0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* PSL Counter */
#psl-display {
    font-family: var(--font-display);
    font-size: 1.8rem;
    text-align: center;
    color: var(--white);
    text-shadow: 2px 2px 0 #000, 0 0 20px rgba(255,255,255,0.2);
    letter-spacing: -0.5px;
}

#psl-count { font-variant-numeric: tabular-nums; }

.label {
    color: var(--cream);
    font-size: 1.2rem;
    margin-left: 6px;
}

#pps-display {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    text-shadow: 1px 1px 0 #000;
    margin-top: -8px;
}

#pps-count { color: var(--cream); }

/* Mewing Zone */
#mewing-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

#tier-badge { display: none; }

/* ---- CLICK AREA ---- */
#click-area {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #4a3828, #2a1a0e 70%, #1a0e06);
    border: 4px solid var(--brown-mid);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.5s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    position: relative;
    outline: none;
    box-shadow: 0 4px 30px rgba(0,0,0,0.6), 0 0 60px rgba(107, 64, 38, 0.2), inset 0 -4px 15px rgba(0,0,0,0.4);
}

#click-area:hover {
    box-shadow: 0 4px 30px rgba(0,0,0,0.6), 0 0 80px rgba(159, 117, 71, 0.3), inset 0 -4px 15px rgba(0,0,0,0.4);
    transform: scale(1.04);
}

#click-area:active, #click-area.clicking {
    transform: scale(0.92);
    box-shadow: 0 2px 15px rgba(0,0,0,0.8), 0 0 40px rgba(159, 117, 71, 0.4), inset 0 4px 15px rgba(0,0,0,0.5);
}

/* ---- FACE CONTAINER (hero element, large + animated) ---- */
#face-container {
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
    animation: faceBreathe 3s ease-in-out infinite;
}

#face-container svg {
    width: 100%;
    height: 100%;
}

@keyframes faceBreathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

#click-area.clicking #face-container {
    animation: faceClick 0.1s ease-out;
}

@keyframes faceClick {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* Click area wrapper + Cookie Clicker light rays */
#click-area-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#click-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    pointer-events: none;
    background: repeating-conic-gradient(
        from 0deg,
        transparent 0deg 8deg,
        rgba(245, 230, 200, 0.025) 8deg 10deg,
        transparent 10deg 15deg
    );
    animation: rotateGlow 180s linear infinite;
}

#click-glow::after {
    content: '';
    position: absolute;
    inset: 18%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(159,117,71,0.2), rgba(159,117,71,0.05) 50%, transparent 70%);
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes rotateGlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulseGlow { from { opacity: 0.6; transform: scale(0.95); } to { opacity: 1; transform: scale(1.05); } }

#click-label {
    font-size: 0.65rem;
    color: var(--brown-pale);
    margin-top: 2px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 #000;
    opacity: 0.6;
}

#click-power-display {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    text-shadow: 1px 1px 0 #000;
}

#click-power-value {
    color: var(--cream);
    font-weight: 700;
}

/* Keyboard hint */
#keyboard-hint {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
    text-shadow: 1px 1px 0 #000;
    animation: fadeOut 30s ease-in forwards;
}
@keyframes fadeOut { 0%,80% { opacity: 1; } 100% { opacity: 0; } }

/* Tutorial hint */
#tutorial-hint {
    display: none;
    font-size: 0.8rem;
    color: var(--gold);
    text-shadow: 1px 1px 0 #000;
    animation: hintPulse 1s ease-in-out infinite alternate;
    text-align: center;
}
@keyframes hintPulse { from { opacity: 0.6; } to { opacity: 1; } }

/* Save indicator */
#save-indicator {
    position: fixed;
    bottom: 8px;
    right: 12px;
    font-size: 0.7rem;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 150;
    pointer-events: none;
}

/* Tier Progress */
#tier-progress {
    width: 100%;
    max-width: 300px;
    text-align: center;
}

#tier-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,0.4);
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid var(--brown-mid);
}

#tier-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brown-light), var(--gold));
    border-radius: 3px;
    transition: width 0.3s;
    box-shadow: 0 0 8px rgba(232, 194, 82, 0.4);
}

#tier-next {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
    display: block;
    text-shadow: 1px 1px 0 #000;
}

/* Stats Panel */
#stats-panel {
    width: 100%;
    max-width: 350px;
    background: rgba(0,0,0,0.3);
    border: 2px solid rgba(107, 64, 38, 0.4);
    border-radius: 8px;
    padding: 14px 18px;
}

#stats-panel h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--cream);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#share-btn, #reset-btn {
    font-size: 0.7rem;
    background: none;
    border: 1px solid var(--brown-dark);
    border-radius: 4px;
    color: var(--text-dim);
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s;
}
#share-btn:hover, #reset-btn:hover {
    border-color: var(--brown-mid);
    color: var(--cream);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 3px 0;
    color: rgba(255,255,255,0.5);
}

.stat-row span:last-child {
    color: var(--cream);
    font-weight: 700;
}

/* Ascension Button */
#ascend-btn {
    width: 100%;
    max-width: 350px;
    padding: 16px;
    background: linear-gradient(135deg, #4a1a1a, #6a2020, #4a1a1a);
    border: 3px solid #c44;
    border-radius: 10px;
    color: #ff8888;
    font-family: var(--font-display);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: ascendPulse 2s ease-in-out infinite;
    text-shadow: 1px 1px 0 #000;
}

#ascend-btn:hover {
    background: linear-gradient(135deg, #5a2525, #7a3030, #5a2525);
    box-shadow: 0 0 30px rgba(204, 68, 68, 0.4);
    transform: scale(1.02);
}

.ascend-icon { font-size: 1.2rem; }
.ascend-text { font-weight: 900; letter-spacing: 3px; }
.ascend-detail { font-family: var(--font-body); font-size: 0.7rem; color: #ffaaaa; }

@keyframes ascendPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(204, 68, 68, 0.1); }
    50% { box-shadow: 0 0 25px rgba(204, 68, 68, 0.3); }
}

/* Achievements Panel */
#achievements-panel {
    width: 100%;
    max-width: 350px;
    background: rgba(0,0,0,0.3);
    border: 2px solid rgba(107, 64, 38, 0.4);
    border-radius: 8px;
    padding: 14px 18px;
}

#achievements-panel h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--cream);
    margin-bottom: 10px;
}

#achievement-count {
    color: var(--text-dim);
    font-family: var(--font-body);
}

#achievements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.achievement-item {
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.4);
    border: 2px solid rgba(107, 64, 38, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0.2;
    position: relative;
    transition: opacity 0.3s;
}

.achievement-item.unlocked {
    opacity: 1;
    border-color: var(--brown-light);
    background: rgba(107, 64, 38, 0.3);
}

.achievement-item .ach-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #2a1a0e;
    border: 2px solid var(--brown-mid);
    border-radius: 6px;
    padding: 8px 12px;
    width: 180px;
    z-index: 200;
    font-size: 0.7rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
    text-align: center;
}

.achievement-item:hover .ach-tooltip { display: block; }
.ach-tooltip .ach-name { color: var(--cream); font-weight: 700; margin-bottom: 2px; }
.ach-tooltip .ach-desc { color: var(--text-dim); }

/* Hidden achievements */
.achievement-item.hidden-ach { opacity: 0.08; }
.achievement-item.hidden-ach.unlocked { opacity: 1; }

/* ---- LEFT PANEL: UPGRADES ---- */
#left-panel {
    background-color: #291808;
    background-image:
        repeating-linear-gradient(90deg, transparent 0px, transparent 83px, rgba(0,0,0,0.6) 83px, rgba(10,5,0,0.9) 85px, rgba(0,0,0,0.6) 87px, transparent 87px),
        repeating-linear-gradient(180deg, rgba(100,60,20,0.1) 0px, transparent 1px, transparent 3px, rgba(80,45,10,0.07) 4px, transparent 5px, transparent 10px),
        repeating-linear-gradient(178deg, transparent 0px, rgba(100,55,20,0.05) 18px, transparent 36px),
        linear-gradient(180deg, #3a2210, #2a1808 60%, #1e1004);
    border-right: 4px solid #1a0a02;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--cream);
    text-align: center;
    padding: 12px 12px 8px;
    text-shadow: 2px 2px 0 #000, 0 0 8px rgba(0,0,0,0.5);
    border-bottom: 2px solid rgba(80,40,15,0.6);
    background: rgba(0,0,0,0.3);
}

/* ---- RIGHT PANEL: THE STORE ---- */
#store-panel {
    background-color: #291808;
    background-image:
        repeating-linear-gradient(90deg, transparent 0px, transparent 83px, rgba(0,0,0,0.6) 83px, rgba(10,5,0,0.9) 85px, rgba(0,0,0,0.6) 87px, transparent 87px),
        repeating-linear-gradient(180deg, rgba(100,60,20,0.1) 0px, transparent 1px, transparent 3px, rgba(80,45,10,0.07) 4px, transparent 5px, transparent 10px),
        repeating-linear-gradient(178deg, transparent 0px, rgba(100,55,20,0.05) 18px, transparent 36px),
        linear-gradient(180deg, #3a2210, #2a1808 60%, #1e1004);
    border-left: 4px solid #1a0a02;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#store-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--cream);
    text-align: center;
    padding: 12px 16px 8px;
    text-shadow: 2px 2px 0 #000, 0 0 8px rgba(0,0,0,0.5);
    border-bottom: 2px solid rgba(80,40,15,0.6);
    background: rgba(0,0,0,0.3);
}

/* Upgrades Section */
#upgrades-panel { padding: 10px 8px; flex: 1; }
#upgrades-list { display: flex; flex-wrap: wrap; gap: 6px; }

.upgrade-item {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2a1a0e, #1a0e06);
    border: 2px solid var(--brown-dark);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.upgrade-item:hover {
    border-color: var(--brown-light);
    background: linear-gradient(135deg, #3a2818, #2a1a0e);
    transform: scale(1.1);
}

.upgrade-item.affordable {
    border-color: var(--brown-light);
    box-shadow: 0 0 8px rgba(159, 117, 71, 0.4);
}

.upgrade-item.purchased {
    opacity: 0.25;
    pointer-events: none;
    border-color: var(--green-dim);
}

.upgrade-item.locked {
    pointer-events: none;
    background: linear-gradient(135deg, #151010, #0d0808);
    border-color: rgba(60,40,20,0.4);
    font-size: 0;
}
.upgrade-item.locked::after {
    content: "?";
    position: absolute;
    font-size: 1.4rem;
    color: rgba(255,255,255,0.12);
    font-weight: bold;
}

/* Blackpill special styling */
.blackpill-upgrade {
    border-color: #222 !important;
    background: linear-gradient(135deg, #0a0a0a, #1a0a1a) !important;
    box-shadow: 0 0 12px rgba(100,0,100,0.3) !important;
    animation: blackpillPulse 2s ease-in-out infinite;
}
@keyframes blackpillPulse {
    0%,100% { box-shadow: 0 0 8px rgba(100,0,100,0.2); }
    50% { box-shadow: 0 0 20px rgba(100,0,100,0.5); }
}

.upgrade-tooltip {
    display: none;
    position: fixed;
    background: #2a1a0e;
    border: 2px solid var(--brown-mid);
    border-radius: 6px;
    padding: 10px 14px;
    width: 220px;
    max-width: 90vw;
    z-index: 500;
    font-size: 0.72rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* Shared tooltip */
#shared-tooltip {
    position: fixed;
    z-index: 500;
    pointer-events: none;
    background: #2a1a0e;
    border: 2px solid var(--brown-mid);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.72rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}

.upgrade-tooltip .tt-name, #shared-tooltip .tt-name { color: var(--cream); font-weight: 700; font-size: 0.82rem; margin-bottom: 4px; }
.upgrade-tooltip .tt-cost, #shared-tooltip .tt-cost { color: var(--green); margin-bottom: 6px; }
.upgrade-tooltip .tt-desc, #shared-tooltip .tt-desc { color: var(--text-dim); line-height: 1.4; }

/* Mogging Section */
#buildings-panel { padding: 10px 0; flex: 1; }
#buildings-panel h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--brown-pale);
    padding: 0 12px 8px;
}

.building-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(90deg, rgba(60, 30, 10, 0.5), rgba(40, 20, 5, 0.3));
    border-top: 1px solid rgba(120, 70, 30, 0.12);
    border-bottom: 1px solid rgba(0,0,0,0.4);
    cursor: pointer;
    transition: all 0.12s;
    position: relative;
}

.building-item:hover { background: linear-gradient(90deg, rgba(100, 55, 20, 0.6), rgba(60, 30, 10, 0.4)); }
.building-item.affordable { background: linear-gradient(90deg, rgba(100, 60, 25, 0.65), rgba(65, 35, 12, 0.45)); }
.building-item.locked { display: none; }

.building-icon { font-size: 1.8rem; width: 40px; text-align: center; flex-shrink: 0; }
.building-info { flex: 1; min-width: 0; }
.building-name { font-size: 0.8rem; font-weight: 700; color: var(--cream); }
.building-cost { font-size: 0.7rem; color: var(--green); }
.building-cost.too-expensive { color: var(--red); }
.building-pps { font-size: 0.62rem; color: var(--text-dim); }

.building-count {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: rgba(255,255,255,0.15);
    min-width: 30px;
    text-align: right;
}
.building-count.has-some { color: var(--cream); text-shadow: 1px 1px 0 #000; }

.building-tooltip {
    display: none;
    position: fixed;
    background: #2a1a0e;
    border: 2px solid var(--brown-mid);
    border-radius: 6px;
    padding: 10px 14px;
    width: 220px;
    z-index: 500;
    font-size: 0.72rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
    pointer-events: none;
}

.building-tooltip .tt-name, #shared-tooltip.building-tooltip .tt-name { color: var(--cream); font-weight: 700; margin-bottom: 4px; }
.building-tooltip .tt-desc, #shared-tooltip.building-tooltip .tt-desc { color: var(--text-dim); line-height: 1.4; margin-bottom: 6px; }
.building-tooltip .tt-produces, #shared-tooltip.building-tooltip .tt-produces { color: var(--green); font-size: 0.68rem; }

/* ---- FLOATING TEXT ---- */
#floating-texts {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 300;
}

.float-text {
    position: absolute;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cream);
    text-shadow: 2px 2px 0 #000, 0 0 10px rgba(245, 230, 200, 0.4);
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 301;
}

.float-text.beginner {
    color: var(--gold);
    font-size: 1.3rem;
    text-shadow: 2px 2px 0 #000, 0 0 15px rgba(232, 194, 82, 0.6);
}

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

/* ---- GOLDEN MEW ---- */
#golden-mew {
    position: fixed;
    font-size: 3rem;
    cursor: pointer;
    z-index: 250;
    filter: drop-shadow(0 0 10px gold);
    animation: goldenFloat 3s ease-in-out infinite, goldenPulse 0.8s ease-in-out infinite alternate;
    transition: transform 0.1s;
}

#golden-mew:hover { transform: scale(1.2); }

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

@keyframes goldenPulse {
    from { filter: drop-shadow(0 0 8px gold); }
    to { filter: drop-shadow(0 0 16px gold) brightness(1.2); }
}

/* ---- BUFF INDICATOR ---- */
#buff-indicator {
    position: fixed;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(107, 64, 38, 0.8), rgba(75, 38, 27, 0.8));
    border: 2px solid var(--brown-light);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: var(--cream);
    z-index: 150;
    animation: buffPulse 1s ease-in-out infinite;
    white-space: nowrap;
    text-shadow: 1px 1px 0 #000;
}

@keyframes buffPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(159, 117, 71, 0.2); }
    50% { box-shadow: 0 0 20px rgba(159, 117, 71, 0.5); }
}

#buff-text { font-weight: 700; }
#buff-timer { margin-left: 8px; color: var(--brown-pale); }

/* ---- NOTIFICATIONS ---- */
#notifications {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.notification {
    background: linear-gradient(135deg, #2a1a0e, #3a2818);
    border: 2px solid var(--brown-mid);
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.8rem;
    color: var(--cream);
    animation: notifIn 0.3s ease-out, notifOut 0.5s 2.5s ease-in forwards;
    box-shadow: 0 4px 20px rgba(0,0,0,0.7);
    white-space: nowrap;
    text-shadow: 1px 1px 0 #000;
}

@keyframes notifIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes notifOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* ---- ASCENSION MODAL ---- */
#ascension-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#ascension-content {
    background: linear-gradient(135deg, #2a1a0e, #3a2215, #2a1a0e);
    border: 3px solid var(--gold);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 0 60px rgba(232, 194, 82, 0.2);
}

#ascension-content h2 { font-family: var(--font-display); color: var(--gold); font-size: 1.5rem; margin-bottom: 12px; text-shadow: 1px 1px 0 #000; }
#ascension-content p { color: var(--text-dim); margin-bottom: 16px; font-size: 0.82rem; }

#ascension-stats { background: rgba(0,0,0,0.4); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.asc-stat { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.82rem; }
.asc-label { color: var(--text-dim); }
.asc-stat span:last-child { color: var(--gold); font-weight: 700; }
.asc-warning { color: var(--red) !important; font-size: 0.72rem !important; }

#ascension-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

#asc-confirm {
    padding: 10px 28px;
    background: linear-gradient(135deg, var(--brown-mid), var(--brown-light));
    border: 2px solid var(--gold);
    border-radius: 6px;
    color: var(--white);
    font-family: var(--font-display);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 1px 1px 0 #000;
}
#asc-confirm:hover { background: linear-gradient(135deg, var(--brown-light), var(--gold)); box-shadow: 0 0 20px rgba(232, 194, 82, 0.4); }

#asc-cancel {
    padding: 10px 28px;
    background: transparent;
    border: 2px solid var(--brown-dark);
    border-radius: 6px;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}
#asc-cancel:hover { border-color: var(--brown-mid); color: var(--cream); }

/* Blackpill "crash" effect */
.blackpill-crash #game { filter: invert(1) hue-rotate(180deg); transition: filter 0.3s; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: var(--brown-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brown-mid); }

/* ============================================
   TIER-SPECIFIC VISUAL PROGRESSION
   ============================================ */

body.tier-0 { --tier-bg: #1a1a1a; }
body.tier-1 { --tier-bg: #1e1e2a; }
body.tier-2 { --tier-bg: #1a1e2e; }
body.tier-3 { --tier-bg: #1e2430; }
body.tier-4 { --tier-bg: #1a2a3a; }
body.tier-5 { --tier-bg: radial-gradient(ellipse at 50% 40%, #1a3a5a, #1a2a4a 60%, #0d1525); }
body.tier-6 { --tier-bg: radial-gradient(ellipse at 50% 40%, #3a1a5a, #2a1a4a 60%, #150d25); }
body.tier-7 { --tier-bg: radial-gradient(ellipse at 50% 40%, #3a3010, #2a2010 60%, #151008); }
body.tier-8 { --tier-bg: radial-gradient(ellipse at 50% 40%, #3a2008, #2a1808 60%, #150c04); }
body.tier-9 { --tier-bg: radial-gradient(ellipse at 50% 40%, #3a3218, #2a2218 60%, #1a1610); }

/* Tier glow on click area */
body.tier-0 #click-area { border-color: #444433; }
body.tier-1 #click-area { border-color: #554433; }
body.tier-2 #click-area { border-color: #6a6a50; }
body.tier-3 #click-area { border-color: #5a7a5a; }
body.tier-4 #click-area { border-color: #4CAF50; box-shadow: 0 4px 30px rgba(0,0,0,0.6), 0 0 40px rgba(76, 175, 80, 0.2); }
body.tier-5 #click-area { border-color: #2196F3; box-shadow: 0 4px 30px rgba(0,0,0,0.6), 0 0 40px rgba(33, 150, 243, 0.25); }
body.tier-6 #click-area { border-color: #9C27B0; box-shadow: 0 4px 30px rgba(0,0,0,0.6), 0 0 40px rgba(156, 39, 176, 0.25); }
body.tier-7 #click-area { border-color: var(--gold); box-shadow: 0 4px 30px rgba(0,0,0,0.6), 0 0 60px rgba(232, 194, 82, 0.3); }
body.tier-8 #click-area { border-color: #ff6622; box-shadow: 0 4px 30px rgba(0,0,0,0.6), 0 0 60px rgba(255, 102, 34, 0.35), 0 0 100px rgba(255, 102, 34, 0.15); }
body.tier-9 #click-area { border-color: #f44; box-shadow: 0 4px 30px rgba(0,0,0,0.6), 0 0 60px rgba(255, 68, 68, 0.3), 0 0 120px rgba(255, 215, 0, 0.15); }

/* Tier name colors */
body.tier-2 #tier-name { color: #aaa87a; }
body.tier-3 #tier-name { color: #8ab88a; }
body.tier-4 #tier-name { color: #6f6; }
body.tier-5 #tier-name { color: #6af; }
body.tier-6 #tier-name { color: #c6f; }
body.tier-7 #tier-name { color: var(--gold); text-shadow: 0 0 15px rgba(232, 194, 82, 0.5), 1px 1px 0 #000; }
body.tier-8 #tier-name { color: #ff7733; text-shadow: 0 0 15px rgba(255, 102, 34, 0.5), 1px 1px 0 #000; }
body.tier-9 #tier-name { color: #f66; text-shadow: 0 0 20px rgba(255, 68, 68, 0.5), 0 0 40px rgba(255, 215, 0, 0.3), 1px 1px 0 #000; }

/* ============================================
   MOBILE RESPONSIVE — TABBED LAYOUT
   ============================================ */

#mobile-tabs { display: none; }

@media (max-width: 768px) {
    #main-content {
        display: block;
        height: auto;
        overflow: visible;
        padding-bottom: 60px;
    }

    /* Default: show center panel only */
    #left-panel { display: none; border-right: none; }
    #store-panel { display: none; border-left: none; }

    body[data-tab="upgrades"] #left-panel { display: flex; min-height: calc(100vh - 140px); }
    body[data-tab="upgrades"] #center-panel { display: none; }
    body[data-tab="store"] #store-panel { display: flex; min-height: calc(100vh - 140px); }
    body[data-tab="store"] #center-panel { display: none; }

    #center-panel {
        min-height: calc(100vh - 140px);
        padding: 16px 12px;
    }

    #click-area {
        width: 220px;
        height: 220px;
    }

    #face-container {
        width: 190px;
        height: 190px;
    }

    #click-glow {
        width: 380px;
        height: 380px;
    }

    /* Mobile tab bar */
    #mobile-tabs {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: linear-gradient(180deg, #2a1a0c, #1a0e06);
        border-top: 2px solid var(--brown-mid);
    }

    .mobile-tab-btn {
        flex: 1;
        padding: 10px 0;
        background: none;
        border: none;
        color: var(--text-dim);
        font-family: var(--font-body);
        font-size: 0.7rem;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        transition: color 0.2s;
    }

    .mobile-tab-btn .tab-icon { font-size: 1.2rem; }
    .mobile-tab-btn.active { color: var(--cream); }
    .mobile-tab-btn.active .tab-icon { filter: drop-shadow(0 0 4px rgba(245,230,200,0.4)); }

    #top-bar {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        text-align: center;
        padding: 6px 12px;
    }

    #title-section h1 { font-size: 1.6rem; }
    #tier-section { text-align: center; }

    /* PSL counter always visible */
    #psl-display { font-size: 1.5rem; }

    /* Bigger upgrade icons on mobile */
    .upgrade-item {
        width: 70px;
        height: 70px;
        font-size: 2rem;
        border-radius: 10px;
    }
    #upgrades-list { gap: 8px; justify-content: center; padding: 4px; }
    #upgrades-panel { padding: 12px; }

    .building-tooltip, .upgrade-tooltip { display: none !important; }

    /* Notifications above tab bar */
    #notifications { bottom: 70px; }

    #keyboard-hint { display: none !important; }
}
