#main-menu {
	position: fixed; top: 0; left: 0; width: 100%; height: 100%;
	background-color: var(--bg-color);
	z-index: 2000;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	transition: transform 0.3s ease-in-out;
}
#main-menu.hidden { transform: translateY(-100%); pointer-events: none; }

.menu-title { font-size: 3rem; margin-bottom: 10px; letter-spacing: 4px; }
.menu-desc { color: #aaa; margin-bottom: 40px; max-width: 400px; text-align: center; line-height: 1.5; }

.menu-btn {
	background: #252526; border: 1px solid #444; color: white;
	padding: 15px 30px; margin: 10px; width: 220px;
	font-size: 1.2rem; cursor: pointer; border-radius: 8px;
	transition: all 0.2s; text-transform: uppercase; font-weight: bold;
	display: flex; align-items: center; justify-content: center; gap: 10px;
}
.menu-btn:hover { background: #333; border-color: var(--accent-blue); transform: scale(1.05); }
.menu-btn.primary { background: var(--correct-green); border: none; }
.menu-btn.primary:hover { background: #467a42; }

.back-btn {
    position: absolute;
    left: 15px;
    top: 15px; 
    transform: none; 
    
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    border-radius: 6px;
    color: #eee;
    font-size: 24px;
    padding: 5px 12px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s;
    line-height: 1;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: #4a90e2;
}

#next-round-btn {
	display: none;
	margin-top: 15px; width: 100%; padding: 12px;
	background: var(--accent-blue); color: white; border: none;
	border-radius: 6px; font-weight: bold; font-size: 1rem; cursor: pointer;
}
#next-round-btn:hover { opacity: 0.9; }
:root {
	--bg-color: #1a1a1b;
	--ocean-color: #2c2c2e;
	--text-color: #ffffff;
	--accent-blue: #4a90e2;
	--correct-green: #538d4e;
	--partial-yellow: #b59f3b;
	--wrong-red: #3a3a3c;
	--border-radius: 8px;
}

body {
	font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
	background-color: var(--bg-color);
	color: var(--text-color);
	margin: 0;
	display: flex; flex-direction: column; align-items: center;
	height: 100vh; overflow: hidden;
}

header { 
	position: relative;
	padding: 15px 10px; width: 100%; text-align: center; 
	background: var(--bg-color); z-index: 10; border-bottom: 1px solid #333;
}
h1 { margin: 0; font-size: 1.5rem; letter-spacing: 2px; text-transform: uppercase; }
.subtitle { 
	margin: 5px 0 0 0; font-size: 0.9rem; color: #aaa; font-weight: normal; 
	max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.4;
}

.top-section { margin-top: 15px; width: 100%; display: flex; justify-content: center; flex-shrink: 0; }

.diagram-container {
	background: white; 
	padding: 10px; 
	border-radius: var(--border-radius); 
	height: 220px;
	width: 400px;
	max-width: 90%;
	box-shadow: 0 4px 15px rgba(0,0,0,0.5); 
	display: flex; align-items: center; justify-content: center;
}

.diagram-container img { 
	max-height: 100%; 
	max-width: 100%; 
	width: auto; 
	height: auto; 
	object-fit: contain; 
	display: block; 
}
#map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#world-map {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.map-wrapper {
	width: 95%; max-width: 1000px; 
	flex-grow: 1;
	background-color: var(--ocean-color); border: 1px solid #444;
	border-radius: var(--border-radius); position: relative; overflow: hidden; margin: 15px 0;
}
svg { width: 100%; height: 100%; cursor: grab; }
svg:active { cursor: grabbing; }

path { fill: #d3d3d3; stroke: #111; stroke-width: 0.5px; transition: fill 0.3s; cursor: pointer; }
path:hover { fill: #bbb; }
path.regional { fill: var(--partial-yellow) !important; opacity: 0.8; }
path.wrong { fill: var(--wrong-red) !important; opacity: 0.8; }
path.selected { fill: var(--accent-blue) !important; }
path.correct { fill: var(--correct-green) !important; }

.zoom-controls { position: absolute; bottom: 10px; right: 10px; display: flex; flex-direction: column; gap: 5px; }
.zoom-btn { width: 35px; height: 35px; background: rgba(0,0,0,0.6); color: white; border: 1px solid #555; border-radius: 4px; cursor: pointer; font-size: 20px; display:flex; justify-content:center; align-items:center; }

.bottom-section { width: 95%; max-width: 600px; padding-bottom: 20px; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }

.controls { display: flex; gap: 10px; background: #252526; padding: 10px; border-radius: var(--border-radius); align-items: center; }
.status-text { flex-grow: 1; font-weight: bold; color: #aaa; text-align: left; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-text span { color: var(--accent-blue); }

input { padding: 10px; width: 80px; text-align: center; font-size: 16px; border-radius: 4px; border: 1px solid #555; background: #333; color: white; }
button.guess-btn { padding: 10px 20px; font-size: 14px; font-weight: bold; background: var(--correct-green); color: white; border: none; border-radius: 4px; cursor: pointer; text-transform: uppercase; }
button.guess-btn:disabled { background: #555; cursor: not-allowed; }

.history-log { display: flex; flex-direction: column; gap: 5px; max-height: 80px; overflow-y: auto; }
.history-row { display: flex; justify-content: space-between; background: #252526; padding: 8px 12px; border-radius: 4px; border-left: 5px solid var(--wrong-red); animation: slideIn 0.3s ease-out; font-size: 0.9rem; }
.history-row.win { border-left-color: var(--correct-green); }
.history-row.close { border-left-color: var(--partial-yellow); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

#main-timer-box { display: none; text-align: center; background: #252526; padding: 8px; border-radius: 8px; border: 1px solid #444; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 100; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal-content { background: #121213; padding: 30px; border-radius: 10px; text-align: center; border: 1px solid #444; width: 90%; max-width: 350px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); position: relative; }
.modal-title { font-size: 1.5rem; margin-bottom: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; color: white; }
.modal-info { font-size: 1rem; color: #ccc; margin-bottom: 20px; line-height: 1.6; }
.close-btn { position: absolute; top: 10px; right: 15px; background: transparent; border: none; color: #666; font-size: 24px; cursor: pointer; font-weight: bold; }
.close-btn:hover { color: white; }
.stats-container { background: rgba(255, 255, 255, 0.05); padding: 10px; border-radius: 8px; margin: 15px 0; text-align: left; max-height: 150px; overflow-y: auto; }
.stat-header { font-size: 0.9rem; font-weight: bold; margin-bottom: 5px; text-align: center; color: #aaa; }
.mini-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #333; font-size: 0.8rem; color: #ccc; }
.mini-row:last-child { border-bottom: none; }