html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

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

body {
    background: #2e4054;
}

#map-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
}

html {
    touch-action: none;
}

.land {
    stroke: #2e4054;
    stroke-width: 0.4;
    shape-rendering: geometricPrecision;
}

.lake {
    fill: #2e4054;
    stroke: none;
    pointer-events: none;
}

.river {
    fill: none;
    stroke: #2e4054;
    stroke-width: 0.3;
    pointer-events: none;
}

.map-layer {
    will-change: transform;
}

.country-label {
    fill: #4a4535;
    font-family: Georgia, serif;
    font-weight: bold;
    text-anchor: middle;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-rendering: geometricPrecision;
    paint-order: stroke;
    stroke: #e8e2d0;
    stroke-width: 3px;
    stroke-linejoin: round;
}

.city {
    fill: #1a1a16;
    pointer-events: none;
}

.city-label {
    fill: #3a392f;
    font-family: Georgia, serif;
    font-style: italic;
    pointer-events: none;
    text-rendering: geometricPrecision;
    paint-order: stroke;
    stroke: #e8e2d0;
    stroke-width: 2px;
    stroke-linejoin: round;
}

.battle {
    fill: #740707;
    stroke: #ffffff;
    stroke-width: 0.5px;
    cursor: pointer;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

.battle-label {
    fill: #7a1f1f;
    font-family: Georgia, serif;
    font-weight: bold;
    pointer-events: none;
    text-rendering: geometricPrecision;
    paint-order: stroke;
    stroke: #f5f1e6;
    stroke-width: 3px;
    stroke-linejoin: round;
}

#tooltip {
    position: fixed;
    display: none;
    max-width: 280px;
    background: #e8e2d0;
    color: #1a1a16;
    padding: 10px 12px;
    border-radius: 4px;
    font-family: Georgia, serif;
    font-size: 13px;
    line-height: 1.4;
    pointer-events: auto;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

#tooltip h3 {
    margin: 0 0 2px 0;
    font-size: 14px;
}

#tooltip .dates {
    font-size: 11px;
    color: #6b6555;
    margin-bottom: 6px;
}

#tt-close {
    float: right;
    cursor: pointer;
    font-size: 16px;
    margin-left: 8px;
}

#tt-readmore {
    display: block;
    margin-top: 8px;
    color: #740707;
    font-weight: bold;
    text-decoration: none;
    font-size: 12px;
}

#tt-readmore:hover {
    text-decoration: underline;
}

#onboarding {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(46, 64, 84, 0.75);
    z-index: 20;
    align-items: center;
    justify-content: center;
}

#onboarding-card {
    position: relative;
    max-width: 420px;
    width: calc(100% - 48px);
    background: #e8e2d0;
    color: #1a1a16;
    padding: 28px 26px 24px;
    border-radius: 6px;
    font-family: Georgia, serif;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

#onboarding-card h2 {
    margin: 0 0 12px 0;
    font-size: 20px;
}

#onboarding-card p {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #3a392f;
}

#onboarding-close {
    position: absolute;
    top: 12px;
    right: 16px;
    cursor: pointer;
    font-size: 20px;
    color: #6b6555;
}

#onboarding-dismiss {
    display: block;
    margin-left: auto;
    background: #740707;
    color: #e8e2d0;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    font-family: Georgia, serif;
    font-size: 14px;
    cursor: pointer;
}

#onboarding-dismiss:hover {
    background: #5a0505;
}