/* Mine Empire - CSS Styles */

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

/* Prevent horizontal overflow on mobile */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(100, 255, 218, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(100, 255, 218, 0.8);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(100, 255, 218, 0.4);
    }
    50% {
        box-shadow: 0 8px 30px rgba(100, 255, 218, 0.8), 0 0 20px rgba(100, 255, 218, 0.5);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    70% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes resourcePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

.game-notification {
    animation: slideIn 0.3s ease-out;
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.resource-gained {
    animation: resourcePulse 0.3s ease-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #e0e6ed;
    min-height: 100vh;
    line-height: 1.6;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(-5px);
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98), rgba(22, 33, 62, 0.98));
    color: #64ffda;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid rgba(100, 255, 218, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-width: 250px;
    white-space: normal;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 2px);
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(26, 26, 46, 0.98);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

[data-tooltip]:hover::before {
    opacity: 1;
}

/* Progress bars */
.progress {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 8px 8px 0 0;
}

.progress-bar {
    height: 100%;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 10px currentColor;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.progress-green .progress-bar { 
    background: linear-gradient(90deg, #4caf50, #8bc34a);
}
.progress-blue .progress-bar { 
    background: linear-gradient(90deg, #2196f3, #00bcd4);
}
.progress-purple .progress-bar { 
    background: linear-gradient(90deg, #7e57c2, #ab47bc);
}
.progress-orange .progress-bar { 
    background: linear-gradient(90deg, #ff9800, #ffc107);
}
.progress-red .progress-bar { 
    background: linear-gradient(90deg, #f44336, #ff5722);
}

/* Notification System */
.game-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    color: #64ffda;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.game-notification.success {
    border-color: #4caf50;
    color: #4caf50;
}

.game-notification.error {
    border-color: #f44336;
    color: #f44336;
}

.game-notification.info {
    border-color: #2196f3;
    color: #2196f3;
}

.game-notification.warning {
    border-color: #ff9800;
    color: #ff9800;
}

/* Game Container */
#game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: flex-start;
}

/* Header Styles */
.game-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.game-header:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.game-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.game-header h1:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}

.resource-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.resource-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(100, 255, 218, 0.5);
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.2);
    transform: translateY(-2px) scale(1.05);
}

.resource-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.resource-item:hover .resource-icon {
    transform: scale(1.2) rotate(5deg);
}

.resource-label {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

.resource-value {
    font-size: 1.1rem;
    font-weight: bold;
    margin-left: auto;
    transition: all 0.3s ease;
}

.resource-item:hover .resource-value {
    text-shadow: 0 0 10px currentColor;
}

.resource-item.stone .resource-value { color: #8d8d8d; }
.resource-item.coal .resource-value { color: #b0b0b0; }
.resource-item.iron .resource-value { color: #a8a8a8; }
.resource-item.silver .resource-value { color: #c0c0c0; }
.resource-item.gold .resource-value { color: #ffd700; }

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin: 0 20px;
    flex-wrap: wrap;
    min-height: 50px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 10px;
    white-space: nowrap;
    position: relative;
    flex-shrink: 1;
    height: auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-btn:hover {
    color: #64ffda;
    background: rgba(100, 255, 218, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.2);
}

.tab-btn.active {
    color: #64ffda;
    background: rgba(100, 255, 218, 0.25);
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.4), inset 0 0 15px rgba(100, 255, 218, 0.1);
    transform: translateY(-1px);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #64ffda, transparent);
    border-radius: 2px;
    box-shadow: 0 0 10px #64ffda;
}

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

.tab-content.active {
    display: block;
    margin: 0;
    padding: 0;
}

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

/* Panel Grid Layout */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    align-items: start;
}

/* Main Game Area */
.game-main {
    display: block;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 0;
    padding: 0;
    min-height: 0;
}

/* Panel Styles */
.panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 20px rgba(100, 255, 218, 0.1);
    border-color: rgba(100, 255, 218, 0.2);
}

.panel h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #64ffda;
    border-bottom: 2px solid rgba(100, 255, 218, 0.3);
    padding-bottom: 10px;
    transition: all 0.3s ease;
}

.panel:hover h2 {
    color: #64ffda;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.4);
}

.panel h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #ffd700;
    opacity: 0.9;
}

/* Resources Panel */
.resource-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resource-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #64ffda;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.resource-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: #64ffda;
    border-left-width: 6px;
    padding-left: 13px;
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.15);
    transform: translateX(2px);
}

.resource-type {
    font-weight: 500;
    color: #e0e6ed;
    transition: color 0.3s ease;
}

.resource-row:hover .resource-type {
    color: #64ffda;
}

.resource-count {
    font-weight: bold;
    color: #64ffda;
    transition: all 0.3s ease;
}

.resource-row:hover .resource-count {
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.6);
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.action-btn, .upgrade-btn, .control-btn, .prestige-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.action-btn::before, .upgrade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before, .upgrade-btn:hover::before {
    left: 100%;
}

.action-btn:hover, .upgrade-btn:hover, .control-btn:hover, .prestige-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.7);
}

.action-btn:active, .upgrade-btn:active, .control-btn:active, .prestige-button:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:disabled, .upgrade-btn:disabled, .control-btn:disabled, .prestige-button:disabled {
    background: #5c5c5c;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
    filter: grayscale(50%);
}

.action-btn:disabled:hover, .upgrade-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Ensure button text is white when enabled */
.action-btn .btn-title,
.action-btn .btn-cost,
.action-btn .btn-description,
.sell-btn .btn-title,
.sell-btn .btn-cost,
.sell-btn .btn-description {
    color: white;
}

/* Disabled button text color */
.action-btn:disabled .btn-title,
.action-btn:disabled .btn-cost,
.action-btn:disabled .btn-description,
.sell-btn:disabled .btn-title,
.sell-btn:disabled .btn-cost,
.sell-btn:disabled .btn-description {
    color: #a0aec0;
}

/* Button Variants */
.sell-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.sell-btn:hover {
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.6);
    background: linear-gradient(135deg, #0e7d72 0%, #2fd068 100%);
}

.marketer-btn {
    background: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
    box-shadow: 0 4px 15px rgba(252, 70, 107, 0.4);
}

.marketer-btn:hover {
    box-shadow: 0 8px 25px rgba(252, 70, 107, 0.6);
}

.mine-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.4);
}

.mine-btn:hover {
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.7), 0 0 20px rgba(255, 215, 0, 0.4);
    transform: translateY(-4px) scale(1.03);
    border-color: rgba(255, 215, 0, 0.7);
}

.mine-btn:active {
    transform: translateY(-2px) scale(0.99);
}

.worker-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.worker-btn:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.processing-btn {
    background: linear-gradient(135deg, #a044ff 0%, #6a3093 100%);
    box-shadow: 0 4px 15px rgba(160, 68, 255, 0.4);
}

.processing-btn:hover {
    box-shadow: 0 8px 25px rgba(160, 68, 255, 0.6);
    background: linear-gradient(135deg, #9138ed 0%, #5e2881 100%);
}

.craft-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
    border: 2px solid rgba(245, 87, 108, 0.4);
    position: relative;
}

.craft-btn:hover {
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.6);
    background: linear-gradient(135deg, #df82ea 0%, #e4465b 100%);
    border-color: rgba(245, 87, 108, 0.6);
}

.craft-btn:disabled {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
    border-color: rgba(74, 85, 104, 0.5) !important;
    color: #a0aec0 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    box-shadow: none !important;
}

.craft-btn:active:not(:disabled) {
    animation: craftPulse 0.3s ease-out;
}

@keyframes craftPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
        box-shadow: 0 0 20px rgba(240, 147, 251, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.3);
    }
    100% {
        transform: scale(1);
    }
}

.trader-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.trader-btn:hover {
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.6);
    background: linear-gradient(135deg, #3d9bec 0%, #00e0ec 100%);
}

.transport-btn {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #2c3e50;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
}

.transport-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.6);
    background: linear-gradient(135deg, #ed888c 0%, #ecbddd 100%);
}

.city-btn {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #2c3e50;
    box-shadow: 0 4px 15px rgba(252, 182, 159, 0.4);
}

.city-btn:hover {
    box-shadow: 0 8px 25px rgba(252, 182, 159, 0.6);
    background: linear-gradient(135deg, #eddac0 0%, #eaa48d 100%);
}

.research-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-bottom: 10px;
    padding: 15px;
    text-align: left;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.research-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.research-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.research-btn.purchased {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.research-btn.purchased:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.research-tree {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.research-tier {
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border-left: 4px solid #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.2);
}

.research-tier h3 {
    color: #64ffda;
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-align: center;
    border-bottom: 2px solid rgba(100, 255, 218, 0.3);
    padding-bottom: 10px;
}

.research-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #ffffff;
}

.research-cost {
    font-size: 0.9rem;
    color: #ffd700;
    font-weight: 500;
}

.research-effect {
    font-size: 0.85rem;
    color: #a8edea;
    font-style: italic;
}

.prestige-button {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 50%, #ff8c00 100%);
    color: #1a1a2e;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.6);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.prestige-button:hover {
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.7), 0 0 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #ffed4e 0%, #ffc850 50%, #ff9500 100%);
    transform: translateY(-4px) scale(1.03);
}

.prestige-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    border: 2px solid rgba(231, 76, 60, 0.6);
}

.prestige-btn:hover {
    box-shadow: 0 8px 30px rgba(231, 76, 60, 0.7);
    background: linear-gradient(135deg, #ff5547 0%, #d43f30 100%);
}

.unlock-btn {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 50%, #8e44ad 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.4);
    border: 2px solid rgba(155, 89, 182, 0.5);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.unlock-btn::before {
    content: '🔓';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2em;
    opacity: 0.15;
    transition: all 0.3s ease;
    pointer-events: none;
}

.unlock-btn:hover {
    box-shadow: 0 8px 30px rgba(142, 68, 173, 0.7), 0 0 20px rgba(155, 89, 182, 0.5);
    background: linear-gradient(135deg, #9b59b6 0%, #b370cf 50%, #9b59b6 100%);
    border-color: rgba(155, 89, 182, 0.8);
}

.unlock-btn:hover::before {
    opacity: 0.25;
    transform: translateY(-50%) scale(1.1);
}

.unlock-btn:disabled {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
    border-color: rgba(74, 85, 104, 0.5) !important;
    color: #a0aec0 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    box-shadow: none !important;
    transform: none !important;
}

.unlock-btn:disabled::before {
    content: '🔒';
    opacity: 0.3;
}

.unlock-btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
}

.unlock-btn:disabled .btn-title,
.unlock-btn:disabled .btn-cost,
.unlock-btn:disabled .btn-description {
    color: #a0aec0 !important;
}

.danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.4);
}

.danger:hover {
    box-shadow: 0 8px 25px rgba(255, 65, 108, 0.6);
}

/* Button Content */
.btn-title, .upgrade-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 5px;
}

.btn-cost, .upgrade-cost {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 3px;
}

.btn-description, .upgrade-effect {
    font-size: 0.8rem;
    opacity: 0.8;
    font-style: italic;
}

/* Upgrades Panel */
.upgrade-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.upgrade-category {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upgrade-btn {
    text-align: left;
    padding: 12px 18px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.upgrade-btn:hover {
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.6);
}

.upgrade-btn.purchased {
    background: #2d5a2d;
    cursor: default;
    opacity: 0.7;
}

.upgrade-btn.purchased:hover {
    transform: none;
    box-shadow: none;
}

/* Statistics Panel */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #ffd700;
}

.stat-label {
    font-weight: 500;
    color: #e0e6ed;
}

.stat-value {
    font-weight: bold;
    color: #ffd700;
}

/* Prestige Panel */
.prestige-panel {
    border: 2px solid #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.prestige-info {
    text-align: center;
}

.prestige-stats {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Footer Controls */
.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.game-footer:hover {
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
}

.control-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.save-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

#save-status {
    padding: 8px 18px;
    background: #2d5a2d;
    color: #64ffda;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

#save-status.saving {
    background: #b8860b;
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.3);
    animation: pulse 1.5s infinite;
}

#save-status.error {
    background: #8b0000;
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
}

#user-status {
    padding: 8px 18px;
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(100, 255, 218, 0.3);
    border-top-color: #64ffda;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #game-container {
        padding: 8px;
        gap: 12px;
    }
    
    .game-main {
        grid-template-columns: 1fr;
    }
    
    .resource-display {
        gap: 12px;
        padding: 10px;
    }
    
    .resource-item {
        flex-direction: row;
        gap: 8px;
        padding: 8px;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .control-buttons {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .game-footer {
        flex-direction: column;
        gap: 12px;
        padding: 10px;
    }
    
    .panel {
        padding: 12px;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    #game-container {
        padding: 5px;
        gap: 8px;
    }
    
    .game-header {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 1.8rem;
    }
    
    .resource-display {
        gap: 8px;
        padding: 8px;
    }
    
    .resource-item {
        padding: 6px;
        gap: 6px;
    }
    
    .resource-value {
        font-size: 1.1rem;
    }
    
    .panel {
        padding: 10px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .action-btn, .upgrade-btn, .control-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
        margin-left: 0;
        margin-right: 0;
    }
    
    .game-footer {
        padding: 8px;
    }
}

/* Animation Classes */
.pulse {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.flash {
    animation: flash 0.5s;
}

@keyframes flash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(100, 255, 218, 0.3); }
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 255, 218, 0.8);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    margin: 5% auto;
    padding: 0;
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
}

.modal-header h3 {
    margin: 0;
    color: #64ffda;
    font-size: 1.5em;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
}

.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #ff6b6b;
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #64ffda;
    font-weight: bold;
    font-size: 0.9em;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #64ffda;
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.primary-btn, .secondary-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-btn {
    background: linear-gradient(45deg, #64ffda, #4fc3f7);
    color: #1a1a2e;
}

.primary-btn:hover {
    background: linear-gradient(45deg, #4fc3f7, #64ffda);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(100, 255, 218, 0.3);
}

.secondary-btn {
    background: transparent;
    color: #64ffda;
    border: 1px solid #64ffda;
}

.secondary-btn:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: translateY(-2px);
}

.auth-toggle {
    text-align: center;
    margin-top: 15px;
}

.auth-toggle p {
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

.link {
    color: #64ffda;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.link:hover {
    color: #4fc3f7;
}

.status-message {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    margin-top: 15px;
}

.status-message.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-message.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.status-message.info {
    background: rgba(100, 255, 218, 0.2);
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.emptyspace {
    min-height: 10vh;
}

/* =================================================================
   ENHANCED MOBILE OPTIMIZATIONS
   ================================================================= */

/* Additional mobile fixes for cards and panels */
@media (max-width: 768px) {
    /* Ensure all panels fit within viewport */
    .panel {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix panel grid to stack vertically */
    .panel-grid {
        grid-template-columns: 1fr !important;
        max-width: 100%;
    }
    
    /* Fix action buttons grid */
    .action-buttons {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    /* Ensure buttons don't overflow - improved touch targets */
    .action-btn, .upgrade-btn, .sell-btn, .control-btn, .prestige-btn {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        font-size: 1rem;
        padding: 16px 20px;
        min-height: 48px;
    }
    
    .btn-title {
        font-size: 1.1rem;
    }
    
    .btn-cost, .btn-description {
        font-size: 0.9rem;
    }
    
    /* Fix resource display wrapping */
    .resource-display {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .resource-item {
        min-width: 140px;
        flex: 0 1 calc(50% - 10px);
        padding: 10px 15px;
        min-height: 44px;
    }
    
    /* Fix tab buttons - better touch targets */
    .tab-navigation {
        padding: 10px 12px;
        margin: 0 10px;
        min-height: 55px;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .tab-btn {
        flex: 1 1 auto;
        min-width: 90px;
        font-size: 0.85rem;
        padding: 10px 8px;
        min-height: 44px;
    }
    
    /* Better spacing for resource rows */
    .resource-row {
        padding: 12px 15px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    /* Improved game header for mobile */
    .game-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    /* Ultra-compact mode for very small screens */
    #game-container {
        padding: 3px;
    }
    
    .game-header {
        padding: 8px;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .resource-item {
        min-width: 120px;
        padding: 6px;
        font-size: 0.85rem;
    }
    
    .resource-value {
        font-size: 1rem;
    }
    
    .panel {
        padding: 8px;
    }
    
    .panel h2 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .action-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .btn-title {
        font-size: 0.9rem;
    }
    
    .btn-cost, .btn-description {
        font-size: 0.75rem;
    }
    
    /* Stack resource items vertically on tiny screens */
    .resource-display {
        flex-direction: column;
    }
    
    .resource-item {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    /* Make tabs stack in two rows */
    .tab-navigation {
        padding: 6px 8px;
        min-height: 45px;
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .tab-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        font-size: 0.75rem;
        padding: 8px 4px;
        min-height: 35px;
    }
    
    /* Reduce resource grid spacing */
    .resource-grid {
        gap: 6px;
    }
    
    .resource-row {
        font-size: 0.85rem;
        padding: 4px;
    }
}

/* Landscape orientation fixes for mobile */
@media (max-width: 900px) and (orientation: landscape) {
    #game-container {
        padding: 5px;
    }
    
    .game-header {
        padding: 8px;
    }
    
    .resource-display {
        gap: 6px;
    }
    
    .resource-item {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
    
    .panel {
        padding: 10px;
    }
}

/* =================================================================
   ATMOSPHERIC THEMES - Progressive darkening as rebirth increases
   ================================================================= */

/* Remove all filter-based approaches - they cause layout bugs */

/* Bright - Tech Empire (Rebirth 0) */
.atmosphere-bright body {
    color: #1a1a2e !important;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%) !important;
}

.atmosphere-bright .game-header {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(0, 180, 216, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 180, 216, 0.2) !important;
}

.atmosphere-bright .game-header h1 {
    background: linear-gradient(135deg, #0077b6 0%, #00b4d8 50%, #0096c7 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-weight: 900 !important;
    text-shadow: none !important;
    filter: drop-shadow(0 2px 4px rgba(0, 119, 182, 0.3)) !important;
}

.atmosphere-bright .panel {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1a1a2e !important;
    border: 1px solid rgba(0, 180, 216, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 180, 216, 0.1) !important;
}

.atmosphere-bright h2,
.atmosphere-bright h3,
.atmosphere-bright h4 {
    color: #0077b6 !important;
    font-weight: 700 !important;
}

.atmosphere-bright .resource-label,
.atmosphere-bright .resource-type,
.atmosphere-bright .btn-title,
.atmosphere-bright .research-title,
.atmosphere-bright span,
.atmosphere-bright p,
.atmosphere-bright label {
    color: #1a1a2e !important;
}

.atmosphere-bright .resource-value,
.atmosphere-bright .resource-count {
    color: #0077b6 !important;
    font-weight: 700 !important;
}

/* Removed problematic dark text color override - buttons should always have white text */

.atmosphere-bright .action-btn {
    background: linear-gradient(135deg, #00b4d8 0%, #0096c7 100%) !important;
    border: 2px solid #0077b6 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.3) !important;
}

.atmosphere-bright .action-btn:hover {
    background: linear-gradient(135deg, #0096c7 0%, #0077b6 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 180, 216, 0.5) !important;
}

.atmosphere-bright .action-btn:disabled {
    background: linear-gradient(135deg, #b0bec5 0%, #90a4ae 100%) !important;
    color: #546e7a !important;
    border-color: #78909c !important;
    opacity: 0.7 !important;
}

.atmosphere-bright .btn-title,
.atmosphere-bright .btn-cost,
.atmosphere-bright .btn-description {
    color: #ffffff !important;
}

.atmosphere-bright .action-btn:disabled .btn-title,
.atmosphere-bright .action-btn:disabled .btn-cost,
.atmosphere-bright .action-btn:disabled .btn-description {
    color: #546e7a !important;
}

.atmosphere-bright .tab-btn {
    color: #0077b6 !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(0, 180, 216, 0.2) !important;
}

.atmosphere-bright .tab-btn.active {
    background: linear-gradient(135deg, #00b4d8 0%, #0096c7 100%) !important;
    color: #ffffff !important;
    border: 2px solid #0077b6 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.3) !important;
}

.atmosphere-bright .tab-btn:hover {
    background: rgba(0, 180, 216, 0.2) !important;
    color: #0077b6 !important;
    border-color: #00b4d8 !important;
}

.atmosphere-bright .resource-item {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 180, 216, 0.3) !important;
}

.atmosphere-bright .resource-row {
    background: rgba(255, 255, 255, 0.6) !important;
    border-left: 4px solid #00b4d8 !important;
}

.atmosphere-bright .progress {
    background: rgba(0, 119, 182, 0.15) !important;
}

.atmosphere-bright .progress-bar {
    background: linear-gradient(90deg, #00b4d8, #0077b6) !important;
}

/* Neutral - Retail Chain (Rebirth 1) */
.atmosphere-neutral body {
    background: linear-gradient(135deg, #2c3e50, #34495e, #2c3e50);
}

.atmosphere-neutral .panel {
    background: rgba(26, 26, 46, 0.85);
}

/* Dim - Mining Corporation (Rebirth 2) */
.atmosphere-dim body {
    background: linear-gradient(135deg, #2c3e50, #34495e, #2c3e50);
}

.atmosphere-dim .panel {
    background: rgba(26, 26, 46, 0.9);
    border-color: rgba(139, 115, 85, 0.5);
}

/* Dark - Failing Factory (Rebirth 3) */
.atmosphere-dark body {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 50%, #000000 100%);
}

.atmosphere-dark .panel {
    background: rgba(15, 15, 15, 0.95);
    border-color: rgba(80, 80, 80, 0.5);
}

.atmosphere-dark .action-btn {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    color: #a0a0a0;
}

/* Darker - Artisan Workshop (Rebirth 4) */
.atmosphere-darker body {
    background: linear-gradient(135deg, #0f0f0f 0%, #050505 50%, #000000 100%);
}

.atmosphere-darker .panel {
    background: rgba(10, 10, 10, 0.98);
    border-color: rgba(139, 69, 19, 0.4);
}

.atmosphere-darker h1, .atmosphere-darker h2 {
    color: #8b7355;
}

/* Grim - Street Vendor (Rebirth 5) */
.atmosphere-grim body {
    background: linear-gradient(135deg, #0a0a0a 0%, #000000 50%, #000000 100%);
}

.atmosphere-grim .panel {
    background: rgba(5, 5, 5, 0.99);
    border-color: rgba(74, 74, 74, 0.3);
}

.atmosphere-grim .resource-value {
    color: #999;
}

/* Bleak - Scavenger (Rebirth 6) */
.atmosphere-bleak body {
    background: linear-gradient(135deg, #1a0000 0%, #0d0000 50%, #000000 100%);
}

.atmosphere-bleak .panel {
    background: rgba(10, 0, 0, 0.99);
    border-color: rgba(139, 0, 0, 0.3);
}

.atmosphere-bleak h1, .atmosphere-bleak h2, .atmosphere-bleak .resource-label {
    color: #ff6b6b;
}

/* Desolate - Hermit (Rebirth 7) */
.atmosphere-desolate body {
    background: #000000;
}

.atmosphere-desolate .panel {
    background: rgba(0, 0, 0, 0.99);
    border-color: rgba(42, 42, 42, 0.2);
}

.atmosphere-desolate .resource-value,
.atmosphere-desolate .btn-title {
    color: #666;
}

/* Sterile - Hospital (Rebirth 8) */
.atmosphere-sterile body {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 50%, #d0d0d0 100%);
}

.atmosphere-sterile .panel {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(200, 200, 200, 0.8);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
}

.atmosphere-sterile h1, .atmosphere-sterile h2, .atmosphere-sterile .resource-label {
    color: #1e293b;
}

.atmosphere-sterile .resource-value {
    color: #334155;
}

.atmosphere-sterile .action-btn {
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    color: #1e293b;
    border-color: #64748b;
}

.atmosphere-sterile .btn-title, .atmosphere-sterile .btn-cost, .atmosphere-sterile .btn-description {
    color: #1e293b;
}

.atmosphere-sterile .panel-title {
    color: #1e293b;
}

.atmosphere-sterile p, .atmosphere-sterile span, .atmosphere-sterile div {
    color: #334155;
}

.atmosphere-sterile .tab-btn {
    background: rgba(30, 41, 59, 0.9);
    color: #f1f5f9;
    border-color: #475569;
}

.atmosphere-sterile .tab-btn.active {
    background: rgba(15, 23, 42, 1);
    color: #ffffff;
    border-color: #1e293b;
}

.atmosphere-sterile .tab-btn:hover {
    background: rgba(51, 65, 85, 0.95);
    color: #ffffff;
}

/* Arcade-specific text styling for Sterile theme (Rebirth 8) */
.atmosphere-sterile #arcade-tab .panel h2 {
    color: #1e293b !important;
    border-bottom-color: rgba(30, 41, 59, 0.3) !important;
}

.atmosphere-sterile #arcade-tab .panel:hover h2 {
    color: #1e293b !important;
    text-shadow: none !important;
}

.atmosphere-sterile #arcade-tab .resource-type {
    color: #1e293b !important;
}

.atmosphere-sterile #arcade-tab .resource-count {
    color: #000000 !important;
}

.atmosphere-sterile #arcade-tab .resource-row:hover .resource-type {
    color: #1e293b !important;
}

.atmosphere-sterile #arcade-tab .resource-row:hover .resource-count {
    color: #000000 !important;
    text-shadow: none !important;
}

/* Only target the main intro paragraph, not the legal disclaimer */
.atmosphere-sterile #arcade-tab .panel > p[style*="margin-bottom: 15px"] {
    color: #1e293b !important;
    opacity: 1 !important;
}

/* Make the tip box more readable - lighter background, dark text */
.atmosphere-sterile #arcade-tab div[style*="background: rgba(59, 130, 246"] {
    background: rgba(219, 234, 254, 0.8) !important;
    border-color: rgba(59, 130, 246, 0.6) !important;
}

.atmosphere-sterile #arcade-tab div[style*="background: rgba(59, 130, 246"] p {
    color: #1e293b !important;
}

.atmosphere-sterile #arcade-tab div[style*="background: rgba(59, 130, 246"] strong {
    color: #1e3a8a !important;
}

/* Void - The End (Rebirth 9) */
.atmosphere-void body {
    background: #000000;
}

.atmosphere-void .panel {
    background: rgba(0, 0, 0, 1);
    border-color: rgba(26, 26, 26, 0.5);
}

.atmosphere-void h1, .atmosphere-void h2 {
    color: #333;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.atmosphere-void .resource-value,
.atmosphere-void .btn-title {
    color: #222;
}

/* Special styling for game ending */
.game-ending {
    animation: fadeToBlack 10s ease-in-out;
}

@keyframes fadeToBlack {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0.1;
    }
}

.ending-btn {
    animation: endingPulse 2s infinite;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%) !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}

@keyframes endingPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.6);
    }
}

/* DOS Game Modal Styles */
#dos-game-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

#dos-game-modal .modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
}

#dos-game-modal .modal-body {
    padding: 0;
    background: #000;
}

#dosbox {
    width: 100%;
    min-height: 500px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dosbox canvas {
    width: 100%;
    height: auto;
    max-height: 600px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#dos-game-playtime {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #64ffda;
}
