:root {
    --primary: #4a5568;
    --accent: #48bb78;
    --accent-hover: #38a169;
    --danger: #e53e3e;
    --danger-hover: #c53030;
    --secondary: #718096;
    --tech: #4299e1;
    --bg: #1a202c;
    --card-bg: #2d3748;
    --text: #e2e8f0;
    --border-color: #cbd5e0;
    --pixel-border: 4px solid var(--border-color);
}

body {
    font-family: 'Press Start 2P', monospace;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    text-shadow: 2px 2px 0px #000;
}

.container {
    background-color: var(--card-bg);
    padding: 30px;
    border: var(--pixel-border);
    box-shadow: 10px 10px 0px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 800px;
    text-align: center;
}

h1, h2, h3 { 
    color: var(--accent); 
    margin-top: 0; 
    line-height: 1.5;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; margin-bottom: 15px; }

.pixel-panel {
    background-color: #1a202c;
    padding: 20px;
    border: 4px solid #4a5568;
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background-color: #000;
    color: #48bb78;
    border: 4px solid #718096;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    box-sizing: border-box;
}

input::placeholder {
    color: #4a5568;
}

input:focus {
    outline: none;
    border-color: #48bb78;
}

.btn {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    color: white;
    cursor: pointer;
    border: 4px solid #000;
    box-shadow: inset -4px -4px 0px rgba(0,0,0,0.2);
    text-transform: uppercase;
    transition: transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
    box-shadow: inset 4px 4px 0px rgba(0,0,0,0.2);
}

.primary { background-color: var(--accent); }
.primary:hover { background-color: var(--accent-hover); }

.secondary { background-color: var(--secondary); }
.secondary:hover { background-color: #4a5568; }

.danger { background-color: var(--danger); }
.danger:hover { background-color: var(--danger-hover); }

.google { background-color: #dd6b20; }
.google:hover { background-color: #c05621; }

.guest { background-color: #805ad5; }
.guest:hover { background-color: #6b46c1; }

.tech { background-color: var(--tech); }
.tech:hover { background-color: #3182ce; }

.hidden { display: none !important; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    background: #000;
    padding: 15px;
    border: 4px solid #4a5568;
    text-align: left;
}

.stat-label { 
    font-size: 10px; 
    color: #a0aec0; 
    margin-bottom: 10px;
}

.stat-value { 
    font-size: 14px; 
    color: #48bb78; 
}

.actions-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}

.modal {
    max-width: 600px;
    width: 90%;
}

.flavor-text {
    color: #ecc94b;
    font-size: 12px;
    line-height: 1.5;
    margin: 15px 0;
    text-shadow: none;
}

#offline-report-content {
    text-align: left;
    margin: 20px 0;
    background: #000;
    padding: 15px;
    border: 4px solid #4a5568;
}

.report-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 4px dashed #2d3748;
    font-size: 12px;
    color: #e2e8f0;
}

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

.report-item strong {
    color: #48bb78;
}

.error-msg { 
    color: var(--danger); 
    font-size: 10px; 
    margin-top: 10px;
    min-height: 12px;
}

@media (max-width: 600px) {
    .actions-section {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 15px;
    }
    h1 { font-size: 18px; }
    h2 { font-size: 16px; }
    
    .sidebar {
        width: 100vw;
        max-width: 100vw;
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-label {
        font-size: 8px;
    }
    
    .stat-value {
        font-size: 12px;
    }
}

/* World Map Styles */
#map-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
    background-color: #2b6cb0;
    border: none;
}

#map-viewport:active {
    cursor: grabbing;
}

#map-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    user-select: none;
}

.country-path {
    fill: #48bb78;
    stroke: #1a202c;
    stroke-width: 0.5px;
    shape-rendering: crispEdges;
    transition: fill 0.2s;
}

.country-path:hover {
    fill: #e53e3e !important;
    stroke: #fff;
    stroke-width: 1px;
}

.country-player {
    stroke: #ecc94b !important;
    stroke-width: 3px !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { filter: drop-shadow(0 0 2px rgba(236, 201, 75, 0.5)); }
    50% { filter: drop-shadow(0 0 15px rgba(236, 201, 75, 1)); }
    100% { filter: drop-shadow(0 0 2px rgba(236, 201, 75, 0.5)); }
}

.country-rival-1 {
    stroke: #e53e3e !important;
    stroke-width: 2px !important;
    animation: pulse-rival-1 1.5s infinite;
}
@keyframes pulse-rival-1 {
    0% { filter: drop-shadow(0 0 2px rgba(229, 62, 62, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(229, 62, 62, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(229, 62, 62, 0.4)); }
}

.country-rival-2 {
    stroke: #4299e1 !important;
    stroke-width: 2px !important;
    animation: pulse-rival-2 1.5s infinite;
}
@keyframes pulse-rival-2 {
    0% { filter: drop-shadow(0 0 2px rgba(66, 153, 225, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(66, 153, 225, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(66, 153, 225, 0.4)); }
}

.country-rival-3 {
    stroke: #805ad5 !important;
    stroke-width: 2px !important;
    animation: pulse-rival-3 1.5s infinite;
}
@keyframes pulse-rival-3 {
    0% { filter: drop-shadow(0 0 2px rgba(128, 90, 213, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(128, 90, 213, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(128, 90, 213, 0.4)); }
}

.country-rival-4 {
    stroke: #ed64a6 !important;
    stroke-width: 2px !important;
    animation: pulse-rival-4 1.5s infinite;
}
@keyframes pulse-rival-4 {
    0% { filter: drop-shadow(0 0 2px rgba(237, 100, 166, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(237, 100, 166, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(237, 100, 166, 0.4)); }
}

.country-rival-5 {
    stroke: #ed8936 !important;
    stroke-width: 2px !important;
    animation: pulse-rival-5 1.5s infinite;
}
@keyframes pulse-rival-5 {
    0% { filter: drop-shadow(0 0 2px rgba(237, 137, 54, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(237, 137, 54, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(237, 137, 54, 0.4)); }
}

/* New Layout Styles */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #2b6cb0;
    z-index: 10;
    overflow: hidden;
}

.overlay-ui {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 20;
    pointer-events: none;
}

.overlay-ui .actions-section {
    pointer-events: auto;
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.prompt-overlay {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    text-align: center;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.5);
    pointer-events: none;
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background-color: rgba(26, 32, 44, 0.95);
    z-index: 100;
    border-left: var(--pixel-border);
    box-shadow: -10px 0px 20px rgba(0,0,0,0.5);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
}

#map-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.9);
    border: 4px solid var(--accent);
    color: white;
    padding: 15px;
    pointer-events: none;
    z-index: 1000;
    font-size: 10px;
    min-width: 200px;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
}

.tooltip-title {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 12px;
}

.tooltip-stat {
    margin: 5px 0;
    color: #cbd5e0;
}

/* Investment UI Styles */
.investment-card {
    background-color: #1a202c;
    border: var(--pixel-border);
    border-width: 2px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8px;
    text-shadow: none;
}

.investment-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.investment-name {
    color: var(--accent);
    font-size: 10px;
    font-weight: bold;
}

.investment-details {
    color: #cbd5e0;
}

/* Formation Buttons */
.formation-btn {
    background-color: var(--secondary);
    border: var(--pixel-border);
    border-width: 2px;
    color: white;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 8px 0;
    cursor: pointer;
    text-shadow: none;
}

.formation-btn:hover {
    background-color: var(--primary);
}

.formation-btn.active {
    background-color: var(--accent);
    border-color: #fff;
    box-shadow: 0 0 5px #fff;
}

/* Event Toast */
.event-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 300px;
    animation: slideIn 0.5s forwards;
    border-color: #ecc94b;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.8);
}

.event-toast.negative {
    border-color: var(--danger);
}

.event-toast.positive {
    border-color: var(--accent);
}

@keyframes slideIn {
    from { transform: translateX(150%); }
    to { transform: translateX(0); }
}

/* Rebellion Minigame Styles */
.rebellion-cell {
    aspect-ratio: 1;
    background-color: #2d3748;
    border: 4px solid #4a5568;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset -4px -4px 0px rgba(0,0,0,0.4);
    font-family: 'Press Start 2P', monospace;
    transition: background-color 0.2s;
}
.rebellion-cell:active {
    box-shadow: inset 4px 4px 0px rgba(0,0,0,0.4);
}
.rebellion-cell.revealed-tick {
    background-color: var(--accent);
    border-color: #276749;
}
.rebellion-cell.revealed-bomb {
    background-color: var(--danger);
    border-color: #9b2c2c;
}

