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

body {
    font-family: 'Roboto', sans-serif;
    background-color: #0a0a1a;
    color: #e0e0ff;
    line-height: 1.6;
    overflow: hidden;
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    position: relative;
}

/* Top Bar - Modern Design */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, rgba(26, 26, 58, 0.95), rgba(38, 38, 80, 0.95));
    padding: 10px 20px;
    border-bottom: 2px solid #4a4a9a;
    height: 70px;
    position: relative;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

h1 {
    color: #5d8ffc;
    text-shadow: 0 0 10px rgba(93, 143, 252, 0.5);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

/* Resources Display - Modern Design */
.resources-container {
    display: flex;
    gap: 15px;
}

.resource {
    display: flex;
    align-items: center;
    background: linear-gradient(to bottom, rgba(52, 52, 110, 0.8), rgba(42, 42, 90, 0.8));
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #4a4a9a;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.resource:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.resource-icon {
    font-size: 1.4rem;
    margin-right: 10px;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
}

.resource-info {
    display: flex;
    flex-direction: column;
}

.resource-name {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 500;
}

.resource-value {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Game Time Display */
.game-time {
    text-align: right;
    font-size: 1rem;
    min-width: 200px;
    background: rgba(42, 42, 90, 0.6);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #4a4a9a;
}

#gameStatus {
    font-size: 0.9rem;
    color: #7da5fc;
    margin-top: 3px;
}

/* Main Game Area */
.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1506318137071-a8e063b4bec0?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
}

.grid-cell {
    background-color: rgba(37, 37, 80, 0.3);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(93, 143, 252, 0.1);
}

.grid-cell:hover {
    background-color: rgba(53, 53, 112, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.grid-cell.selected {
    box-shadow: 0 0 0 2px #5d8ffc, 0 0 10px rgba(93, 143, 252, 0.8);
}

.grid-cell.mine {
    background-color: #8b4513;
}

.grid-cell.powerPlant {
    background-color: #4169e1;
}

.grid-cell.habitat {
    background-color: #228b22;
}

.grid-cell.researchLab {
    background-color: #9932cc;
}

.grid-cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

.building-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 5px rgba(255, 255, 255, 0.7)); }
    100% { transform: scale(1.1); filter: brightness(1.2) drop-shadow(0 0 8px rgba(255, 255, 255, 0.9)); }
}

/* Canvas Container */
#canvas-container {
    position: absolute;
    top: 70px;
    left: 0;
    right: 320px; /* Slightly wider side panel */
    bottom: 0;
    z-index: 0;
}

/* Side Panel - Modern Design */
.side-panel {
    position: absolute;
    top: 70px;
    right: 0;
    width: 320px;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(30, 30, 65, 0.97), rgba(20, 20, 45, 0.97));
    border-left: 2px solid #4a4a9a;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.4);
}

/* Panel Sections */
.panel-section {
    margin-bottom: 20px;
    background: rgba(40, 40, 85, 0.6);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(93, 143, 252, 0.3);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-btn {
    background: linear-gradient(to bottom, #3a3a7a, #2a2a6a);
    color: #e0e0ff;
    border: 1px solid #4a4a9a;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.control-btn:hover {
    background: linear-gradient(to bottom, #4a4a9a, #3a3a8a);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.speed-controls {
    display: flex;
    gap: 5px;
}

.speed-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speed-btn.active {
    background: linear-gradient(to bottom, #5d8ffc, #4a7ae6);
    border-color: #7da5fc;
    box-shadow: 0 0 10px rgba(93, 143, 252, 0.5);
}

/* Building Categories */
.building-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-btn {
    flex: 1;
    min-width: 80px;
    background: linear-gradient(to bottom, #3a3a7a, #2a2a6a);
    color: #e0e0ff;
    border: 1px solid #4a4a9a;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: center;
}

.category-btn:hover {
    background: linear-gradient(to bottom, #4a4a9a, #3a3a8a);
    transform: translateY(-2px);
}

.category-btn.active {
    background: linear-gradient(to bottom, #5d8ffc, #4a7ae6);
    border-color: #7da5fc;
    box-shadow: 0 0 10px rgba(93, 143, 252, 0.5);
}

/* Building Cards - Modern Design */
.building-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.building-card {
    display: flex;
    align-items: center;
    background: linear-gradient(to bottom, rgba(45, 45, 95, 0.8), rgba(35, 35, 75, 0.8));
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(93, 143, 252, 0.3);
    position: relative;
    z-index: 100;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.building-card:hover {
    background: linear-gradient(to bottom, rgba(55, 55, 115, 0.8), rgba(45, 45, 95, 0.8));
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.building-card.selected {
    border: 2px solid #5d8ffc;
    box-shadow: 0 0 15px rgba(93, 143, 252, 0.7);
}

.building-icon {
    font-size: 2rem;
    margin-right: 15px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.building-info {
    flex: 1;
}

.building-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #ffffff;
}

.building-cost {
    color: #ffcc00;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 3px;
}

.building-effect {
    color: #7da5fc;
    font-size: 0.9rem;
}

.building-cost-upkeep {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 3px;
}

/* Selected Tile Info */
.info-panel {
    background: rgba(40, 40, 85, 0.6);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(93, 143, 252, 0.3);
}

.info-panel h3 {
    margin-bottom: 10px;
    color: #7da5fc;
}

/* Mini Feed */
.mini-feed {
    margin-top: auto;
    border-top: 1px solid #4a4a9a;
    padding-top: 15px;
    background: rgba(40, 40, 85, 0.6);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(93, 143, 252, 0.3);
    max-height: 200px;
    overflow: hidden;
}

.mini-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mini-feed-header h3 {
    color: #7da5fc;
}

.mini-feed-content {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.log-entry {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(74, 74, 154, 0.3);
    font-size: 0.9rem;
    background: rgba(30, 30, 65, 0.4);
    margin-bottom: 5px;
    border-radius: 5px;
}

/* Fix for date display */
#gameDate {
    font-family: 'Courier New', monospace;
    min-width: 150px;
    display: inline-block;
    text-align: right;
    font-size: 1.1rem;
    color: #ffffff;
}

/* Cash highlight */
#credits .resource-name {
    font-weight: bold;
    color: #ffcc00;
}

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

::-webkit-scrollbar-track {
    background: rgba(30, 30, 65, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(93, 143, 252, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(93, 143, 252, 0.7);
}

/* Tutorial Overlay - Modern Design */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 26, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.tutorial-panel {
    background: linear-gradient(135deg, rgba(35, 35, 75, 0.95), rgba(25, 25, 55, 0.95));
    border: 2px solid #5d8ffc;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    box-shadow: 0 0 40px rgba(93, 143, 252, 0.6);
    position: relative;
    overflow: hidden;
}

.tutorial-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #5d8ffc, #8a6eff, #5d8ffc);
    background-size: 200% 100%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

.tutorial-panel h2 {
    color: #ffffff;
    margin-bottom: 25px;
    text-align: center;
    font-size: 2.2rem;
    text-shadow: 0 0 15px rgba(93, 143, 252, 0.7);
    letter-spacing: 1px;
}

.tutorial-content {
    margin-bottom: 30px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.tutorial-content p {
    margin-bottom: 15px;
    color: #e0e0ff;
}

.tutorial-content ol {
    margin: 20px 0;
    padding-left: 25px;
}

.tutorial-content li {
    margin-bottom: 15px;
    position: relative;
}

.tutorial-content li strong {
    color: #8a6eff;
    font-weight: 700;
}

.developer-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(93, 143, 252, 0.3);
    text-align: center;
    font-size: 0.9rem;
    color: #b0b0d0;
}

.developer-info p {
    margin: 5px 0;
}

.primary-btn {
    background: linear-gradient(to bottom, #6e9ffc, #5d8ffc);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.15rem;
    display: block;
    margin: 0 auto;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(93, 143, 252, 0.4);
    letter-spacing: 0.5px;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(93, 143, 252, 0.6);
    background: linear-gradient(to bottom, #7eafff, #6e9ffc);
}

/* Resource animations */
@keyframes resourcePulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.resource-indicator {
    position: absolute;
    font-size: 0.8rem;
    color: white;
    pointer-events: none;
    animation: resourcePulse 1s forwards;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .command-panel {
        height: 150px;
        flex-wrap: wrap;
    }
    
    .building-options {
        order: 4;
        width: 100%;
    }
}

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #0a0a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-progress {
    width: 300px;
    height: 10px;
    background-color: #1a1a3a;
    border-radius: 5px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #5d8ffc;
    width: 0%;
    transition: width 0.3s;
}

/* Side panel for building options (right side) */
.side-panel {
    position: absolute;
    top: 70px; /* Height of top bar */
    right: 0;
    width: 300px;
    bottom: 0;
    background-color: rgba(26, 26, 58, 0.95); /* More opaque background */
    border-left: 2px solid #3a3a7a;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow-y: auto;
    z-index: 100; /* Ensure it's above the canvas */
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3); /* Add shadow for depth */
}

/* Resource name update */
#credits .resource-name {
    font-weight: bold;
    color: #ffcc00;
}

/* Building cards with more details */
.building-card {
    display: flex;
    align-items: center;
    background-color: rgba(37, 37, 80, 0.7);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(93, 143, 252, 0.3);
}

.building-card:hover {
    background-color: rgba(53, 53, 112, 0.8);
    transform: translateY(-2px);
}

.building-cost-upkeep {
    color: #ff6b6b;
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Game controls in side panel */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Mini feed in side panel */
.mini-feed {
    margin-top: auto;
    border-top: 1px solid #3a3a7a;
    padding-top: 10px;
}

/* Version tag styling */
.version-tag {
    font-size: 0.6rem;
    background-color: rgba(93, 143, 252, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 8px;
    font-weight: normal;
    letter-spacing: 0.5px;
} 