/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Courier New', 'Consolas', monospace;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(0.5rem, 2vw, 1.25rem);
    transition: background 0.3s ease;
    position: relative;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(139, 69, 19, 0.02) 0px,
            transparent 1px,
            transparent 2px,
            rgba(139, 69, 19, 0.02) 3px
        );
    pointer-events: none;
    z-index: 0;
}

body.night-mode {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0f00 50%, #0d0600 100%);
}

body.night-mode::before {
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(255, 200, 100, 0.05) 0px,
            transparent 1px,
            transparent 2px,
            rgba(255, 200, 100, 0.05) 3px
        );
}

/* Container */
.container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: clamp(12px, 3vw, 20px);
    padding: clamp(1rem, 3vw, 2rem);
    box-shadow: 
        0 0 40px rgba(139, 69, 19, 0.2),
        0 0 80px rgba(139, 69, 19, 0.1),
        inset 0 0 60px rgba(139, 69, 19, 0.03);
    max-width: 1400px;
    width: 100%;
    animation: fadeIn 0.5s ease-in;
    border: 2px solid rgba(139, 69, 19, 0.2);
    position: relative;
    z-index: 1;
}

body.night-mode .container {
    background: rgba(20, 10, 5, 0.95);
    border-color: rgba(255, 200, 100, 0.4);
    box-shadow: 
        0 0 40px rgba(255, 200, 100, 0.3),
        0 0 80px rgba(255, 200, 100, 0.1),
        inset 0 0 60px rgba(255, 200, 100, 0.05);
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: #8B4513;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.3);
    flex: 1;
    text-align: center;
    min-width: 200px;
}

body.night-mode .header h1 {
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.back-btn, .night-mode-btn {
    background: linear-gradient(145deg, #8B4513, #654321);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: clamp(0.4rem, 2vw, 0.6rem) clamp(0.8rem, 3vw, 1.2rem);
    border-radius: 8px;
    cursor: pointer;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    text-decoration: none;
    display: inline-block;
}

.back-btn:hover, .night-mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

body.night-mode .back-btn,
body.night-mode .night-mode-btn {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
    border-color: rgba(255, 215, 0, 0.5);
}

/* Stats Wrapper */
.stats-wrapper {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(210, 180, 140, 0.1) 100%);
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

body.night-mode .stats-wrapper {
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: rgba(255, 200, 100, 0.4);
}

.main-stats, .prestige-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.prestige-stats {
    margin-bottom: 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(139, 69, 19, 0.2);
}

body.night-mode .prestige-stats {
    border-top-color: rgba(255, 200, 100, 0.3);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #8B4513;
    font-weight: bold;
}

body.night-mode .stat-label {
    color: #FFA500;
}

.stat-value {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: #654321;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.2);
}

body.night-mode .stat-value {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.rebirth-btn {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
    border: 2px solid rgba(255, 215, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.rebirth-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.rebirth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Main Content Layout */
.main-content-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Cookie Clicker Area */
.clicker-area {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    min-height: 300px;
    flex: 0 0 auto;
}

/* Tabs Section */
.tabs-section {
    flex: 1;
    min-width: 0;
}

/* Bulk Buy Controls */
.bulk-buy-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(210, 180, 140, 0.1));
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
}

body.night-mode .bulk-buy-controls {
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.15), rgba(255, 215, 0, 0.1));
    border-color: rgba(255, 200, 100, 0.4);
}

.bulk-label {
    font-size: 1rem;
    font-weight: bold;
    color: #8B4513;
}

body.night-mode .bulk-label {
    color: #FFD700;
}

.bulk-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bulk-btn {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: bold;
    color: #654321;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    min-width: 60px;
}

.bulk-btn:hover {
    background: linear-gradient(145deg, #e8e8e8, #d8d8d8);
    transform: translateY(-2px);
}

.bulk-btn.active {
    background: linear-gradient(145deg, #8B4513, #654321);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 10px rgba(139, 69, 19, 0.3);
}

body.night-mode .bulk-btn {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-color: rgba(255, 200, 100, 0.3);
    color: #FFA500;
}

body.night-mode .bulk-btn:hover {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
}

body.night-mode .bulk-btn.active {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
    border-color: rgba(255, 215, 0, 0.5);
}


.cookie-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cookie-btn {
    width: clamp(150px, 30vw, 350px);
    height: clamp(150px, 30vw, 350px);
    border-radius: 50%;
    background: linear-gradient(145deg, #D2691E, #8B4513);
    border: 4px solid rgba(139, 69, 19, 0.5);
    cursor: pointer;
    font-size: clamp(5rem, 15vw, 14rem);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s ease;
    box-shadow: 
        0 10px 40px rgba(139, 69, 19, 0.4),
        inset 0 -5px 20px rgba(0, 0, 0, 0.2),
        inset 0 5px 20px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.cookie-btn::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 15%;
    width: 30%;
    height: 30%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.cookie-btn:active {
    transform: scale(0.95);
}

.cookie-btn:hover {
    filter: brightness(1.1);
}

body.night-mode .cookie-btn {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    border-color: rgba(255, 215, 0, 0.7);
    box-shadow: 
        0 10px 40px rgba(255, 215, 0, 0.5),
        inset 0 -5px 20px rgba(0, 0, 0, 0.3),
        inset 0 5px 20px rgba(255, 255, 255, 0.2);
}

.cookie-emoji {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* Click Numbers Animation */
#click-numbers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.click-number {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: #8B4513;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: floatUp 1s ease-out forwards;
    pointer-events: none;
    z-index: 100;
}

body.night-mode .click-number {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

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

/* Golden Cookie */
.golden-cookie-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.golden-cookie {
    position: absolute;
    font-size: 4rem;
    cursor: pointer;
    pointer-events: all;
    animation: goldenPulse 1s ease-in-out infinite, goldenFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    z-index: 50;
}

@keyframes goldenPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: bold;
    color: #654321;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.tab-btn:hover {
    background: linear-gradient(145deg, #e8e8e8, #d8d8d8);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(145deg, #8B4513, #654321);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

body.night-mode .tab-btn {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-color: rgba(255, 200, 100, 0.3);
    color: #FFA500;
}

body.night-mode .tab-btn:hover {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
}

body.night-mode .tab-btn.active {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
    border-color: rgba(255, 215, 0, 0.5);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    color: #8B4513;
    margin-bottom: 1rem;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    text-align: center;
}

body.night-mode .tab-content h3 {
    color: #FFD700;
}

/* Buildings Grid */
.buildings-grid {
    display: grid;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.building-item {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 240, 0.9));
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.building-item:hover:not(.disabled) {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    border-color: rgba(139, 69, 19, 0.5);
}

.building-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.night-mode .building-item {
    background: linear-gradient(145deg, rgba(40, 40, 40, 0.9), rgba(30, 30, 30, 0.9));
    border-color: rgba(255, 200, 100, 0.4);
}

.building-icon {
    font-size: 3rem;
    text-align: center;
}

.building-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.building-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #8B4513;
}

body.night-mode .building-name {
    color: #FFD700;
}

.building-desc {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

body.night-mode .building-desc {
    color: #999;
}

.building-production {
    font-size: 0.9rem;
    color: #654321;
    font-weight: bold;
}

body.night-mode .building-production {
    color: #FFA500;
}

.building-buy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.building-owned {
    font-size: 0.9rem;
    color: #8B4513;
    font-weight: bold;
}

body.night-mode .building-owned {
    color: #FFA500;
}

.building-cost {
    background: linear-gradient(145deg, #8B4513, #654321);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.building-item:not(.disabled):hover .building-cost {
    background: linear-gradient(145deg, #A0522D, #8B4513);
    transform: scale(1.05);
}

body.night-mode .building-cost {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
}

/* Upgrades Grid */
.upgrades-info {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(139, 69, 19, 0.2);
}

body.night-mode .upgrades-info {
    background: rgba(255, 200, 100, 0.1);
    border-color: rgba(255, 200, 100, 0.3);
}

.upgrades-info p {
    color: #654321;
    font-size: 0.95rem;
}

body.night-mode .upgrades-info p {
    color: #FFA500;
}

.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.upgrade-item {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 240, 0.9));
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upgrade-item:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(139, 69, 19, 0.3);
    border-color: rgba(139, 69, 19, 0.5);
}

.upgrade-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.night-mode .upgrade-item {
    background: linear-gradient(145deg, rgba(40, 40, 40, 0.9), rgba(30, 30, 30, 0.9));
    border-color: rgba(255, 200, 100, 0.4);
}

.upgrade-icon {
    font-size: 3rem;
}

.upgrade-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #8B4513;
    text-align: center;
}

body.night-mode .upgrade-name {
    color: #FFD700;
}

.upgrade-desc {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    font-style: italic;
}

body.night-mode .upgrade-desc {
    color: #999;
}

.upgrade-cost {
    background: linear-gradient(145deg, #8B4513, #654321);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.85rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

body.night-mode .upgrade-cost {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
}

.no-items-msg {
    text-align: center;
    padding: 3rem 1rem;
    color: #8B4513;
}

body.night-mode .no-items-msg {
    color: #FFA500;
}

.no-items-msg p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.no-items-msg .hint {
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.8;
}

/* Achievements */
.achievement-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.6rem 1rem;
    background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    color: #654321;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.filter-btn:hover {
    background: linear-gradient(145deg, #e8e8e8, #d8d8d8);
}

.filter-btn.active {
    background: linear-gradient(145deg, #8B4513, #654321);
    color: white;
}

body.night-mode .filter-btn {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    color: #FFA500;
}

body.night-mode .filter-btn.active {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.achievement-item {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 240, 0.9));
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
}

.achievement-item.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.achievement-item.unlocked {
    border-color: #FFD700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

body.night-mode .achievement-item {
    background: linear-gradient(145deg, rgba(40, 40, 40, 0.9), rgba(30, 30, 30, 0.9));
    border-color: rgba(255, 200, 100, 0.4);
}

.achievement-icon {
    font-size: 3rem;
    min-width: 50px;
    text-align: center;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-size: 1rem;
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 0.25rem;
}

body.night-mode .achievement-name {
    color: #FFD700;
}

.achievement-desc {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

body.night-mode .achievement-desc {
    color: #999;
}

/* Prestige Tab */
.prestige-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-box {
    background: rgba(139, 69, 19, 0.1);
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
}

body.night-mode .info-box {
    background: rgba(255, 200, 100, 0.1);
    border-color: rgba(255, 200, 100, 0.4);
}

.info-box h4 {
    color: #8B4513;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

body.night-mode .info-box h4 {
    color: #FFD700;
}

.info-box p, .info-box li {
    color: #654321;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

body.night-mode .info-box p,
body.night-mode .info-box li {
    color: #FFA500;
}

.info-box ul {
    margin-left: 1.5rem;
}

.prestige-calculator {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    padding: 1.5rem;
}

.prestige-calculator h4 {
    color: #8B4513;
    margin-bottom: 1rem;
    text-align: center;
}

body.night-mode .prestige-calculator h4 {
    color: #FFD700;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    color: #654321;
    font-weight: bold;
}

body.night-mode .calc-row {
    background: rgba(0, 0, 0, 0.3);
    color: #FFA500;
}

.calc-row.highlight {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.3));
    border: 2px solid rgba(255, 215, 0, 0.5);
    font-size: 1.1rem;
}

.prestige-confirm-btn {
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    border: 3px solid rgba(255, 215, 0, 0.7);
    border-radius: 12px;
    color: #000;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.prestige-confirm-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.prestige-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prestige-upgrades-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(139, 69, 19, 0.3);
}

body.night-mode .prestige-upgrades-section {
    border-top-color: rgba(255, 200, 100, 0.4);
}

.prestige-upgrades-section h4 {
    color: #8B4513;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.2rem;
}

body.night-mode .prestige-upgrades-section h4 {
    color: #FFD700;
}

.prestige-upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.prestige-upgrade-item {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.prestige-upgrade-item:hover:not(.disabled):not(.purchased) {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

.prestige-upgrade-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prestige-upgrade-item.purchased {
    background: linear-gradient(145deg, rgba(0, 255, 0, 0.2), rgba(0, 200, 0, 0.2));
    border-color: rgba(0, 255, 0, 0.5);
    cursor: default;
}

body.night-mode .prestige-upgrade-item {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.15));
}

.prestige-upgrade-icon {
    font-size: 2.5rem;
}

.prestige-upgrade-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #8B4513;
    text-align: center;
}

body.night-mode .prestige-upgrade-name {
    color: #FFD700;
}

.prestige-upgrade-desc {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    font-style: italic;
}

body.night-mode .prestige-upgrade-desc {
    color: #999;
}

.prestige-upgrade-cost {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.85rem;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.prestige-upgrade-level {
    font-size: 0.8rem;
    color: #8B4513;
    font-weight: bold;
}

body.night-mode .prestige-upgrade-level {
    color: #FFD700;
}

/* Stats Tab */
.stats-grid {
    display: grid;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
}

.stat-box {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 240, 0.9));
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 1rem;
}

body.night-mode .stat-box {
    background: linear-gradient(145deg, rgba(40, 40, 40, 0.9), rgba(30, 30, 30, 0.9));
    border-color: rgba(255, 200, 100, 0.4);
}

.stat-category {
    font-size: 1.1rem;
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(139, 69, 19, 0.3);
}

body.night-mode .stat-category {
    color: #FFD700;
    border-bottom-color: rgba(255, 200, 100, 0.4);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    color: #654321;
}

body.night-mode .stat-row {
    color: #FFA500;
}

.stat-row:nth-child(even) {
    background: rgba(139, 69, 19, 0.05);
    border-radius: 4px;
}

body.night-mode .stat-row:nth-child(even) {
    background: rgba(255, 200, 100, 0.05);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-btn {
    padding: 1rem;
    background: linear-gradient(145deg, #8B4513, #654321);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

body.night-mode .action-btn {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
}

.action-btn.save-btn {
    background: linear-gradient(145deg, #4CAF50, #45a049);
}

.action-btn.danger-btn {
    background: linear-gradient(145deg, #f44336, #da190b);
}

/* Message Display */
.message-display {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(210, 180, 140, 0.1));
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.night-mode .message-display {
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.15), rgba(255, 215, 0, 0.1));
    border-color: rgba(255, 200, 100, 0.4);
}

#message-text {
    font-size: 1rem;
    color: #8B4513;
    font-weight: bold;
}

body.night-mode #message-text {
    color: #FFD700;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border: 3px solid rgba(139, 69, 19, 0.5);
    border-radius: 15px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

body.night-mode .modal-content {
    background: #1a1a1a;
    border-color: rgba(255, 200, 100, 0.5);
}

.modal-content h3 {
    color: #8B4513;
    margin-bottom: 1rem;
    text-align: center;
}

body.night-mode .modal-content h3 {
    color: #FFD700;
}

#import-textarea {
    width: 100%;
    height: 150px;
    padding: 1rem;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    resize: vertical;
}

body.night-mode #import-textarea {
    background: #2a2a2a;
    border-color: rgba(255, 200, 100, 0.4);
    color: #FFA500;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
}

.modal-buttons .btn {
    flex: 1;
    padding: 0.75rem;
    background: linear-gradient(145deg, #8B4513, #654321);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.modal-buttons .btn:hover {
    transform: translateY(-2px);
}

.modal-buttons .cancel-btn {
    background: linear-gradient(145deg, #666, #555);
}

body.night-mode .modal-buttons .btn {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #000;
}

body.night-mode .modal-buttons .cancel-btn {
    background: linear-gradient(145deg, #444, #333);
    color: white;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(139, 69, 19, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, #8B4513, #654321);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, #A0522D, #8B4513);
}

body.night-mode ::-webkit-scrollbar-track {
    background: rgba(255, 200, 100, 0.1);
}

body.night-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, #FFD700, #FFA500);
}

/* Responsive Design */
@media (max-width: 968px) {
    .main-content-wrapper {
        flex-direction: column;
    }
    
    .clicker-area {
        width: 100%;
    }
    
    .tabs-section {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .buildings-grid {
        grid-template-columns: 1fr;
    }
    
    .building-item {
        grid-template-columns: 50px 1fr auto;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .upgrades-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        font-size: 0.8rem;
    }
    
    .tab-btn {
        min-width: 80px;
        padding: 0.6rem 0.5rem;
    }
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease;
}

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

.bounce {
    animation: bounce 0.5s ease;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    }
}

.glow {
    animation: glow 1s ease-in-out infinite;
}
