/* Multi-Game PWA Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Game Menu Styles */
.game-menu-container {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.875rem;
}

.login-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.login-info {
    text-align: center;
    color: #666;
    font-size: 0.875rem;
}

.login-info p {
    margin-bottom: 0.25rem;
}

.login-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    background: #f8fafc;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.user-details p {
    opacity: 0.9;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
}

.dashboard-main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.games-section, .user-stats-section {
    margin-bottom: 3rem;
}

.games-section h3, .user-stats-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

/* Game Cards */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.game-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.game-icon {
    font-size: 2.5rem;
    background: #f3f4f6;
    border-radius: 12px;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-info h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.game-category {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.progress-indicator {
    margin-left: auto;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.game-description {
    margin-bottom: 1rem;
    color: #4b5563;
    line-height: 1.5;
}

.game-features {
    margin-bottom: 1.5rem;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.feature-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.play-time {
    color: #6b7280;
    font-size: 0.875rem;
}

.game-actions {
    display: flex;
    gap: 0.75rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
    background: #f3f4f6;
    border-radius: 10px;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-outline {
    background: transparent;
    color: #374151;
    border: 2px solid #d1d5db;
}

.btn-outline:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

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

/* Menu Button - Improved visibility and mobile support */
.menu-btn {
    position: fixed !important;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(37, 99, 235, 0.95) !important;
    color: white !important;
    border: 2px solid #2563eb !important;
    backdrop-filter: blur(10px);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    min-height: 44px;
    min-width: 44px;
    border-radius: 12px;
}

.menu-btn:hover {
    background: rgba(29, 78, 216, 1) !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.menu-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Enhanced menu button for mobile */
@media (max-width: 768px) {
    .menu-btn {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .back-to-dashboard {
        top: 0.75rem !important;
        left: 0.75rem !important;
        padding: 0.5rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    .survival-message, .strategy-message {
        max-width: 95vw;
        padding: 1rem;
        margin: 0 1rem;
    }
    
    .message-content {
        padding-right: 0.5rem;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .message-close-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1.1rem;
    }
}

/* Survival Game Styles - Improved contrast and mobile support */
.survival-header {
    background: linear-gradient(135deg, #047857 0%, #064e3b 100%);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.survival-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.vital-signs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.vital {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    min-width: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.vital-bar {
    width: 60px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.vital-fill {
    height: 100%;
    background: #10b981;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.vital.health .vital-fill { background: #ef4444; }
.vital.oxygen .vital-fill { background: #60a5fa; }
.vital.energy .vital-fill { background: #fbbf24; }

/* Improved vital signs text contrast */
.vital-icon {
    font-size: 1.1rem;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.3));
}

.vital span {
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.world-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.time-display, .weather-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
}

/* Strategy Game Styles - Improved contrast and mobile support */
.strategy-header {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.commander-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.commander-avatar {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.commander-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.resource-display {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.resource {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
}

.resource-icon {
    font-size: 1.25rem;
}

.resource-amount {
    font-weight: 600;
}

/* Message Notifications */
.survival-message, .strategy-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    animation: messageSlideIn 0.3s ease;
    position: relative;
}

/* Message close button */
.message-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: 600;
}

.message-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
    transform: scale(1.1);
}

.message-content {
    padding-right: 1rem;
}

/* Back to dashboard button styling - Fixed position in lower left */
.back-to-dashboard {
    position: fixed !important;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 200;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #374151 !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(10px);
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.back-to-dashboard:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Start/Pause Menu Styles */
.pause-menu {
    position: fixed;
    bottom: 4.5rem;
    left: 1.5rem;
    z-index: 199;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    min-width: 200px;
    padding: 0.75rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.pause-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.pause-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
}

.pause-menu-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.pause-menu-item:active {
    background: rgba(59, 130, 246, 0.2);
}

.pause-menu-separator {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0.5rem 0;
}

.survival-message-success, .strategy-message-success {
    border-left: 4px solid #10b981;
}

.survival-message-error, .strategy-message-error {
    border-left: 4px solid #ef4444;
}

.survival-message-warning, .strategy-message-warning {
    border-left: 4px solid #f59e0b;
}

.survival-message-story, .strategy-message-story {
    border-left: 4px solid #3b82f6;
    max-width: 500px;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Achievement Notification */
.achievement-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: achievementSlideIn 0.5s ease;
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.achievement-icon {
    font-size: 2rem;
}

.achievement-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.achievement-desc {
    opacity: 0.9;
    font-size: 0.875rem;
}

@keyframes achievementSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design - Enhanced for iPhone and mobile devices */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
    }
    
    .vital-signs {
        justify-content: center;
        gap: 0.75rem;
        flex-direction: column;
    }
    
    .vital {
        min-width: 200px;
        padding: 0.875rem;
        justify-content: space-between;
    }
    
    .resource-display {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .resource {
        min-width: 100px;
        justify-content: center;
    }
    
    .login-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .game-card {
        margin: 0 0.5rem;
    }
    
    .survival-header,
    .strategy-header {
        padding: 0.75rem;
    }
    
    .survival-stats,
    .strategy-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .world-info {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
}

/* Enhanced Mobile Optimizations for Survival and Strategy Games */
@media (max-width: 768px) {
    /* Survival Game Specific Mobile Improvements */
    .survival-stats {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .vital-signs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .vital {
        min-width: unset;
        padding: 0.75rem;
        justify-content: center;
        text-align: center;
    }
    
    .world-info {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .world-stat {
        background: rgba(255, 255, 255, 0.1);
        padding: 0.75rem;
        border-radius: 8px;
        text-align: center;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    /* Strategy Game Specific Mobile Improvements */
    .commander-info {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .strategy-resources {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .resource-display {
        background: rgba(255, 255, 255, 0.1);
        padding: 0.75rem;
        border-radius: 8px;
        text-align: center;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    /* Fixed back button positioning for mobile */
    .back-to-dashboard {
        bottom: 1rem;
        left: 1rem;
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    .pause-menu {
        bottom: 3.5rem;
        left: 1rem;
        min-width: 180px;
    }
}

/* iPhone specific optimizations */
@media (max-width: 414px) {
    .vital-signs {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .vital {
        padding: 0.625rem;
        font-size: 0.9rem;
    }
    
    .vital-bar {
        width: 50px;
        height: 6px;
    }
    
    .game-header {
        padding: 0.875rem;
    }
    
    .world-info, .strategy-resources {
        grid-template-columns: 1fr;
    }
    
    .back-to-dashboard {
        bottom: 0.75rem;
        left: 0.75rem;
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .pause-menu {
        bottom: 3rem;
        left: 0.75rem;
        min-width: 160px;
    }
    
    .company-info h1 {
        font-size: 1.25rem;
    }
    
    .dashboard-main {
        padding: 1rem 0.75rem;
    }
    
    .tab-btn {
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Original Business Tycoon Game Styles (preserved) */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.game-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Header Styles - Improved spacing and contrast */
.game-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
    padding: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.company-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0.25rem;
}

.level-info {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.separator {
    color: #9ca3af;
}

.resources {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.resource {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(37, 99, 235, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.resource-icon {
    font-size: 1rem;
}

/* Main Game Area - Improved spacing */
.game-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Tabs - Improved spacing */
.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    gap: 0.5rem;
    overflow-x: auto;
    border: 2px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 0;
    letter-spacing: 0.02em;
}

.tab-btn.active {
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.tab-btn:not(.active):hover {
    background: rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Grid Layouts */
.buildings-grid,
.workers-grid,
.research-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .buildings-grid,
    .workers-grid,
    .research-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .buildings-grid,
    .workers-grid,
    .research-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .game-container {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* Building/Worker/Research Cards */
.building-card,
.worker-card,
.research-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.building-card:hover,
.worker-card:hover,
.research-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.card-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 10px;
}

.card-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.card-description {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.3;
}

.card-owned {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-stats {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-label {
    font-size: 0.85rem;
    color: #4b5563;
}

.stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

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

/* Stats Tab */
.stats-container {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-group {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.stat-group h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.stat-item:last-child {
    border-bottom: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Footer */
.game-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.pwa-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.theme-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.theme-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.install-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.install-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.status-indicators {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-appear {
    animation: slideUp 0.3s ease forwards;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .game-header {
        padding: 0.75rem;
    }
    
    .company-info h1 {
        font-size: 1.25rem;
    }
    
    .resources {
        gap: 0.5rem;
    }
    
    .resource {
        padding: 0.375rem 0.625rem;
        font-size: 0.85rem;
    }
    
    .game-main {
        padding: 0.75rem;
    }
    
    .tabs {
        gap: 0.125rem;
        padding: 0.15rem;
    }
    
    .tab-btn {
        padding: 0.625rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .building-card,
    .worker-card,
    .research-card {
        padding: 0.875rem;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .card-info h3 {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* PWA Display Mode */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
    
    .game-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Light theme (explicit) */
body.light-theme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
}

body.light-theme .game-header,
body.light-theme .game-footer {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .tabs {
    background: rgba(255, 255, 255, 0.9);
}

body.light-theme .building-card,
body.light-theme .worker-card,
body.light-theme .research-card,
body.light-theme .stat-group {
    background: white;
    color: #333;
}

/* Removed dark mode for simpler, consistent light theme */

/* Removed dark theme styles for simpler UI */

/* High contrast support */
@media (prefers-contrast: high) {
    .tab-btn.active {
        box-shadow: 0 0 0 2px #fff;
    }
    
    .btn-primary {
        box-shadow: 0 0 0 1px #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
    }
}

/* Focus styles for accessibility */
.tab-btn:focus,
.btn:focus,
.install-btn:focus,
.theme-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Better desktop keyboard navigation */
@media (hover: hover) {
    .tab-btn:focus-visible,
    .btn:focus-visible,
    .install-btn:focus-visible,
    .theme-btn:focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: 2px;
    }
    
    .building-card:focus-within,
    .worker-card:focus-within,
    .research-card:focus-within {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
}

/* Touch targets */
@media (pointer: coarse) {
    .tab-btn,
    .btn,
    .install-btn {
        min-height: 44px;
        min-width: 44px;
    }
}