/* Unity 3D City Builder - Main Styles */

.unity-city-builder-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading Screen */
.unity-loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.unity-loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 20px;
}

.unity-loading-logo h2 {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.unity-loading-logo p {
    font-size: 1.2em;
    margin: 0 0 30px 0;
    opacity: 0.9;
}

.unity-loading-progress {
    margin: 30px 0;
}

.unity-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.unity-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.unity-progress-text {
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.unity-loading-tips {
    margin-top: 30px;
    text-align: left;
}

.unity-loading-tips p {
    margin: 10px 0;
    font-size: 0.9em;
    opacity: 0.8;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border-left: 3px solid #4CAF50;
}

/* Game Container */
.unity-game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.unity-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #87CEEB;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: grab;
}

.unity-canvas:active {
    cursor: grabbing;
}

/* Mobile Controls */
.unity-mobile-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: none; /* Hidden by default, shown on mobile */
}

.unity-mobile .unity-mobile-controls {
    display: block;
}

.unity-zoom-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.unity-zoom-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unity-zoom-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

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

.unity-building-menu-btn {
    position: absolute;
    bottom: 0;
    right: 0;
}

.unity-building-btn {
    width: 56px;
    height: 56px;
    margin: 6px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f1f3f4);
    color: #5f6368;
    font-size: 26px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-align: center;
    float: left;
    position: relative;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.unity-building-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 12px 24px rgba(102, 126, 234, 0.3),
        0 6px 12px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

/* Building Menu - Modern Redesign */
.unity-building-menu {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 300px;
    max-height: 85vh;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 24px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.12),
        0 12px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 200;
    overflow: hidden;
    display: none; /* Hidden by default */
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.unity-building-menu.show {
    display: block !important;
    opacity: 1 !important;
    transform: translateX(0) scale(1) !important;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.15),
        0 15px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.unity-building-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}

.unity-building-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.unity-building-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

.unity-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    font-weight: 600;
}

.unity-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.unity-building-content {
    padding: 28px;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(248,249,250,0.9) 100%);
    position: relative;
}

/* Custom scrollbar styling for building menu */
.unity-building-content::-webkit-scrollbar {
    width: 16px;
}

.unity-building-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.unity-building-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.unity-building-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

/* Firefox scrollbar styling */
.unity-building-content {
    scrollbar-width: auto;
    scrollbar-color: #667eea rgba(0, 0, 0, 0.1);
}

/* Scroll indicator for building menu */
.unity-building-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 30px;
    background: linear-gradient(to bottom, rgba(102, 126, 234, 0.3), transparent);
    pointer-events: none;
    z-index: 1;
    border-radius: 0 10px 0 0;
}

.unity-building-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 30px;
    background: linear-gradient(to top, rgba(102, 126, 234, 0.3), transparent);
    pointer-events: none;
    z-index: 1;
    border-radius: 0 0 10px 0;
}

.unity-building-category {
    margin-bottom: 28px;
    overflow: hidden; /* Clearfix for floating buttons */
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.unity-building-category:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.unity-building-category h4 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 3px solid transparent;
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-bottom: 8px;
    position: relative;
    letter-spacing: 0.5px;
}

.unity-building-category h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.unity-building-category .unity-building-btn,
.unity-building-menu .unity-building-btn {
    width: 56px;
    height: 56px;
    margin: 6px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f1f3f4);
    color: #5f6368;
    font-size: 26px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-align: center;
    float: left;
    position: relative;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.unity-building-category .unity-building-btn:hover,
.unity-building-menu .unity-building-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 12px 24px rgba(102, 126, 234, 0.3),
        0 6px 12px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

/* Tooltip for building buttons */
.unity-building-category .unity-building-btn::after,
.unity-building-menu .unity-building-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.unity-building-category .unity-building-btn:hover::after,
.unity-building-menu .unity-building-btn:hover::after {
    opacity: 1;
}

/* Ensure emoji icons display properly */
.unity-building-category .unity-building-btn,
.unity-building-menu .unity-building-btn {
    font-variant-emoji: emoji;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Make sure icons are visible and properly sized */
.unity-building-category .unity-building-btn:before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    vertical-align: middle;
}

/* Game UI */
.unity-game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* Money Display Panel */
.unity-money-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: 150px;
    z-index: 60;
}

.unity-money-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.unity-money-icon {
    font-size: 18px;
}

.unity-money-amount {
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.unity-money-details {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
}

.unity-money-income,
.unity-money-expenses {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.unity-money-label {
    opacity: 0.8;
    margin-bottom: 2px;
}

.unity-money-value {
    font-weight: bold;
    font-size: 14px;
}

.unity-money-income .unity-money-value {
    color: #C8E6C9;
}

.unity-money-expenses .unity-money-value {
    color: #FFCDD2;
}

.unity-stats-panel {
    position: absolute;
    top: 120px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.unity-stat {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    min-width: 150px;
}

.unity-stat-label {
    font-weight: bold;
    margin-right: 10px;
}

.unity-stat-value {
    color: #4CAF50;
    font-weight: bold;
}

.unity-control-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    pointer-events: auto;
}

.unity-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 5px;
}

.unity-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.unity-btn:active {
    transform: translateY(0);
}

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

.unity-load-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.unity-colors-btn {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.unity-traffic-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.unity-character-btn {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.unity-reset-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.unity-help-btn {
    background: linear-gradient(135deg, #607D8B, #455A64);
}

.unity-build-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Help Overlay */
.unity-help-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(5px);
}

.unity-help-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    margin: 20px;
}

.unity-help-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unity-help-header h3 {
    margin: 0;
    font-size: 1.5em;
}

.unity-help-body {
    padding: 30px;
}

.unity-help-section {
    margin-bottom: 25px;
}

.unity-help-section h4 {
    color: #667eea;
    margin: 0 0 10px 0;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.unity-help-section ul {
    margin: 0;
    padding-left: 20px;
}

.unity-help-section li {
    margin: 8px 0;
    line-height: 1.5;
}

/* Error Message */
.unity-error-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f44336, #d32f2f);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.unity-error-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 40px;
}

.unity-error-content h3 {
    font-size: 2em;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.unity-error-content p {
    font-size: 1.1em;
    margin: 15px 0;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .unity-city-builder-container {
        height: 500px;
    }
    
    .unity-money-panel {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        min-width: 120px;
    }
    
    .unity-money-amount {
        font-size: 14px;
    }
    
    .unity-money-details {
        font-size: 10px;
        gap: 8px;
    }
    
    .unity-stats-panel {
        top: 100px;
        right: 10px;
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .unity-stat {
        min-width: 120px;
    }
    
    .unity-control-panel {
        bottom: 10px;
        left: 10px;
        gap: 5px;
    }
    
    .unity-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .unity-building-menu {
        width: 280px;
        top: 120px;
        left: 10px;
        max-height: 55vh;
        overflow-y: auto;
    }
    
    .unity-mobile-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .unity-zoom-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .unity-building-btn {
        width: 45px;
        height: 45px;
        font-size: 22px;
        margin: 3px;
    }
    
    .unity-help-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .unity-help-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .unity-city-builder-container {
        height: 400px;
    }
    
    .unity-stats-panel {
        font-size: 0.8em;
        padding: 8px 12px;
    }
    
    .unity-stat {
        min-width: 100px;
    }
    
    .unity-btn {
        padding: 6px 10px;
        font-size: 10px;
    }
    
    .unity-building-menu {
        width: 280px;
        top: 100px;
        max-height: 50vh;
    }
    
    .unity-building-content {
        padding: 20px;
        max-height: 45vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .unity-building-category .unity-building-btn,
    .unity-building-menu .unity-building-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin: 4px;
        line-height: 1;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .unity-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .unity-zoom-btn {
        min-height: 50px;
        min-width: 50px;
    }
    
    .unity-building-btn {
        min-height: 50px;
        min-width: 50px;
    }
    
    .unity-building-category .unity-building-btn,
    .unity-building-menu .unity-building-btn {
        width: 52px;
        height: 52px;
        font-size: 24px;
        margin: 5px;
        padding: 0;
        line-height: 1;
    }
    
    .unity-building-menu {
        width: 90vw;
        max-width: 320px;
        top: 120px;
        left: 5vw;
        max-height: 65vh;
    }
    
    .unity-building-content {
        padding: 20px;
        max-height: 65vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .unity-building-category {
        margin-bottom: 15px;
    }
}

/* Dark Theme */
.unity-city-builder-container[data-theme="dark"] {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

.unity-city-builder-container[data-theme="dark"] .unity-stats-panel {
    background: rgba(0, 0, 0, 0.8);
}

.unity-city-builder-container[data-theme="dark"] .unity-building-menu {
    background: rgba(44, 62, 80, 0.95);
    color: white;
}

.unity-city-builder-container[data-theme="dark"] .unity-building-category h4 {
    color: white;
    border-bottom-color: #3498db;
}

.unity-city-builder-container[data-theme="dark"] .unity-building-category .unity-building-btn {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

.unity-city-builder-container[data-theme="dark"] .unity-building-category .unity-building-btn:hover {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* Light Theme */
.unity-city-builder-container[data-theme="light"] {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.unity-city-builder-container[data-theme="light"] .unity-stats-panel {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.unity-city-builder-container[data-theme="light"] .unity-building-menu {
    background: rgba(255, 255, 255, 0.98);
}

/* Animation Classes */
.unity-fade-in {
    animation: unityFadeIn 0.5s ease-in;
}

.unity-fade-out {
    animation: unityFadeOut 0.5s ease-out;
}

.unity-slide-up {
    animation: unitySlideUp 0.3s ease-out;
}

.unity-slide-down {
    animation: unitySlideDown 0.3s ease-out;
}

@keyframes unityFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes unityFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes unitySlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes unitySlideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Loading Animation */
.unity-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: unitySpin 1s linear infinite;
    margin: 20px auto;
}

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

/* Message Notifications */
.unity-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    word-wrap: break-word;
    display: none;
}

.unity-message-success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.unity-message-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.unity-message-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.unity-message-warning {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

/* Touch Gesture Indicator */
.unity-touch-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 100;
    display: none;
    backdrop-filter: blur(10px);
}

.unity-touch-indicator.show {
    display: block;
    animation: unityFadeIn 0.3s ease-in;
}

.unity-touch-indicator .gesture-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 16px;
}

/* Mobile Touch Hints */
.unity-mobile-hints {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 200;
    display: none;
    backdrop-filter: blur(10px);
}

.unity-mobile-hints.show {
    display: block;
    animation: unityFadeIn 0.5s ease-in;
}

.unity-mobile-hints h3 {
    margin: 0 0 15px 0;
    color: #4CAF50;
}

.unity-mobile-hints .hint-item {
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.unity-mobile-hints .hint-icon {
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.unity-mobile-hints .close-hints {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.unity-mobile-hints .close-hints:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile Building Indicator - Removed */

/* Save/Load Modal Styles */
.unity-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.unity-modal-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid #3498db;
    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);
    }
}

.unity-modal-content h3 {
    color: #ecf0f1;
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.unity-modal-content p {
    color: #bdc3c7;
    margin: 15px 0;
    font-size: 16px;
    line-height: 1.5;
}

.unity-save-code {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    font-size: 32px;
    font-weight: bold;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
    border: 2px solid #27ae60;
}

.unity-code-input {
    width: 100%;
    padding: 15px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #3498db;
    border-radius: 10px;
    background: rgba(52, 73, 94, 0.8);
    color: #ecf0f1;
    margin: 20px 0;
    letter-spacing: 2px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.unity-code-input:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.3);
    background: rgba(52, 73, 94, 1);
}

.unity-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.unity-modal-btn {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.unity-modal-btn:first-child {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.unity-modal-btn:first-child:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.unity-load-confirm {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.unity-load-confirm:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

/* Mobile Modal Adjustments */
@media (max-width: 768px) {
    .unity-modal-content {
        padding: 20px;
        max-width: 350px;
    }
    
    .unity-save-code {
        font-size: 28px;
        padding: 15px;
        letter-spacing: 2px;
    }
    
    .unity-code-input {
        font-size: 20px;
        padding: 12px;
    }
    
    .unity-modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .unity-modal-btn {
        width: 100%;
    }
}
