
:root {
    --bd-green: #006a4e;
    --bd-red: #f42a41;
    --bg-color: #08c2b8;
}

body {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    /* background: rgb(56, 226, 112); */
}

/* --- HUD (Fixed Overlays) --- */
.hud-top {
    position: fixed;
    top: clamp(10px, 2vw, 20px);
    left: clamp(10px, 2vw, 20px);
    right: clamp(10px, 2vw, 20px);

    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    gap: clamp(10px, 2vw, 20px);

    pointer-events: none;
    z-index: 100;
    /* background: #0004fd; */
}

.hud-vertical {
    position: fixed;
    right: clamp(10px, 2vw, 20px);
    top: clamp(130px, 12vh, 140px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 300;
    max-height: calc(100vh - 120px);

    /* background: #08c2b8; */
}

.hud-vertical button {
    width: clamp(70px, 10vw, 140px);
    padding: clamp(6px, 1vw, 12px);
    font-size: clamp(0.85rem, 1vw, 1rem);
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    border: none;
}

.hud-horizontal {
    position: fixed;
    left: clamp(10px, 2vw, 20px);
    bottom: clamp(100px, 12vh, 120px);
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    z-index: 300;
    max-height: calc(100vh - 120px);

    /* background: #08c2b8; */
}

.hud-horizontal button {
    width: clamp(70px, 10vw, 140px);
    padding: clamp(6px, 1vw, 12px);
    font-size: clamp(0.85rem, 1vw, 1rem);
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    border: none;
}

.btn-group {
    display: flex; 
    gap: 8px; 
    margin-top: 10px; 
    justify-content: flex-end; 
    /* background-color: #f71919; */
}

button {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(241, 4, 4, 0.08);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    
    /* background-color: #6719f7; */
}

#map-selector {
    margin-top: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    font-size: 1rem;
    font-style: italic;
    color: #ffffff;
    cursor: pointer;
    background: rgb(255, 66, 198);
}
.hud-vertical .btn-skip { background: #524fff;}
.hud-vertical .btn-restart { background: #27ae60;}


.hud-horizontal .btn-sound { background: #006a4e;}
.hud-horizontal .btn-label { background: var(--bg-color);}
.hud-horizontal .btn-learn { background: #8d6442;}
.btn-home { background: #34495e;}

.card {
    background: white;
    padding: clamp(8px, 1.2vw, 14px) clamp(5px, 1.8vw, 20px);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    pointer-events: none;
    max-width: 45vw;
    width: fit-content;
    font-weight: bold;
}

.hud-top .card:first-child {
    min-width: clamp(180px, 30vw, 200px);
}

#target-name {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 800;
    color: var(--bd-green);
    margin-top: 4px;
    display: block;
}

.stats-area {
    text-align: left;
    font-size: clamp(1.05rem, 1.2vw, 1.2rem);
    min-width: clamp(160px, 22vw, 250px);
    /* background: #111; */
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 4px;
    gap: 10px;
    opacity: 1;
    /* background: #111; */
}

#status-msg {
    font-weight: bold;
    height: 24px;
    line-height: 24px;
    margin: 5px 0;
    font-size: clamp(1rem, 2vw, 1rem);
    transition: opacity 0.3s;
    opacity: 0;
    text-align: left;
}

/* --- MAP CONTAINER --- */
.map-viewport {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    touch-action: none;
    /* background: #0004fd; */
}

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

svg {
    height: 100%;
    width: 100%;
    max-width: none;
}

.map-region path {
    cursor: pointer;
    transition: all 0.25s ease;
    stroke: #002fff;
    stroke-width: 1.5;
}

.map-region:not(.locked):not(.selected):hover path {
    opacity: .25;
}

.locked path {
    /* fill: rgb(51, 240, 44) !important; */
    stroke: rgb(255, 0, 212) !important;
    stroke-width: 1.5;
    opacity: 0.4;
    filter: brightness(1.05);
    pointer-events: none;
}

.learn-mode .map-region path {
    stroke: #333 !important;
    stroke-width: 2.5;
    opacity: 0.95;
    pointer-events: none;
}

.division-label {
    display: none;
    font-size: 12px;
    font-weight: 800;
    fill: #000000;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;

    /* Better readability */
    paint-order: stroke;
    stroke: white;
    stroke-width: 3px;
    stroke-linejoin: round;
}

/* Show labels in learn, normal mode */
.learn-mode .division-label,
.show-labels .division-label {
    display: block;
}

/* Result Card */

.result-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

.result-card {
    background: white;
    padding: 35px;
    border-radius: 16px;
    width: 350px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.result-card h2 {
    margin-top: 0;
    color: var(--bd-green);
}

.result-line {
    margin: 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

