* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Georgia, serif;
    background: #f5efe0;
    color: #2c1a0e;
}

header {
    background: #2c1a0e;
    color: #f5efe0;
    padding: 1.5rem 2rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    letter-spacing: 0.05em;
}

header p {
    margin-top: 0.5rem;
    font-size: 1rem;
    opacity: 0.8;
}

#race-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

.spotlight-row {
    width: 100%;
    max-width: 450px;
    display: flex;
    justify-content: center;
}

.spotlight-row .rider-card {
    width: 100%;
    flex: 1 1 auto;
}

.fellowship-chasers-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

.fellowship-chasers-grid .rider-card {
    flex: 1 1 220px;
    max-width: 450px;
}

.rider-card {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(245, 239, 224, 0.25);
    border-radius: 6px;
    padding: 0.6rem 1.4rem;
    min-width: 0;
    text-align: center;
    box-sizing: border-box;
}

@media (max-width: 500px) {
    #race-panel {
        gap: 0.55rem;
        padding: 0 0.25rem;
    }
    .spotlight-row {
        max-width: 100%;
    }
    .fellowship-chasers-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.5rem;
    }
    .fellowship-chasers-grid .rider-card {
        padding: 0.5rem 0.5rem;
        max-width: 100%;
    }
    .rider-card {
        padding: 0.5rem 0.6rem;
    }
    .rider-km {
        font-size: 1.35rem;
    }
    .race-gap, .rider-gap {
        font-size: 0.72rem;
        white-space: normal;
        text-align: center;
    }
    .rider-last-ride {
        display: none;
    }
}

.rider-name {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

.rider-km {
    font-size: 1.6rem;
    font-weight: bold;
    margin: 0.15rem 0;
}

.race-bar {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    height: 5px;
    margin: 0.3rem 0;
    overflow: hidden;
}

.race-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.rider-gap {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.2rem;
    font-style: italic;
}

.rider-checkpoints {
    display: flex;
    flex-direction: column;
    font-size: 0.72rem;
    opacity: 0.75;
    margin-top: 0.2rem;
    gap: 0.1rem;
}

.cp-last {
    opacity: 0.7;
}

.cp-next {
    font-style: italic;
}

.rider-last-ride {
    font-size: 0.7rem;
    opacity: 0.65;
    margin-top: 0.3rem;
    font-style: italic;
}


main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#map-section {
    position: relative;
}

#map {
    width: 100%;
    height: 500px;
    border: 2px solid #2c1a0e;
    border-radius: 4px;
}

#coord-display {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(44, 26, 14, 0.75);
    color: #f5efe0;
    font-size: 0.75rem;
    font-family: monospace;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    pointer-events: none;
    z-index: 1000;
}


.cp-label {
    background: rgba(255, 252, 240, 0.88) !important;
    border: 1px solid rgba(44, 26, 14, 0.4) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
    border-radius: 3px !important;
    font-family: Georgia, serif;
    font-size: 0.9rem;
    font-weight: bold;
    color: #1a0a00 !important;
    white-space: nowrap;
    padding: 2px 7px !important;
}
.cp-label::before { display: none; }
.cp-label-start { color: #1a0a00 !important; }
.cp-label-end   { color: #1a0a00 !important; }

h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #2c1a0e;
    padding-bottom: 0.4rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
}

input, select {
    padding: 0.5rem;
    border: 1px solid #2c1a0e;
    border-radius: 3px;
    background: #fffdf7;
    font-family: inherit;
    font-size: 1rem;
}

button {
    margin-top: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: #2c1a0e;
    color: #f5efe0;
    border: none;
    border-radius: 3px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    align-self: flex-start;
}

button:hover {
    background: #4a2e1a;
}

.rider-submit-row {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.rider-btn {
    flex: 1;
    margin-top: 0;
    align-self: auto;
    font-weight: bold;
    letter-spacing: 0.04em;
}

.rider-btn-blue  { background: #3a6aa8; }
.rider-btn-blue:hover  { background: #2d5490; }
.rider-btn-red   { background: #a83a3a; }
.rider-btn-red:hover   { background: #902d2d; }
.rider-btn-green { background: #3a8a4a; }
.rider-btn-green:hover { background: #2d6e3a; }

.picker-label {
    font-size: 0.95rem;
    opacity: 0.75;
    margin-bottom: 0.5rem;
}

.rider-avatar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.rider-avatar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    color: #2c1a0e;
    margin-top: 0;
    transition: background 0.15s;
}

.rider-avatar-btn:hover {
    background: rgba(44, 26, 14, 0.08);
}

.new-rider-btn {
    background: #888;
    margin-top: 0;
}

.switch-btn {
    align-self: center;
    margin-bottom: 0.8rem;
}

#ride-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#ride-list li {
    background: #fffdf7;
    border: 1px solid #c9b99a;
    border-radius: 3px;
    padding: 0.6rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.delete-btn {
    background: #fdf0ed;
    border: 1px solid #e2b4b4;
    color: #a04040;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    margin-top: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.delete-btn:hover {
    background: #a04040;
    color: #fff;
    border-color: #8c2e2e;
}

.inline-confirm-btn {
    background: #a83a3a;
    color: #fff;
    border: 1px solid #8c2e2e;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    margin-top: 0;
    line-height: 1;
    transition: background 0.15s;
}

.inline-confirm-btn:hover {
    background: #8b2525;
}

.inline-cancel-btn {
    background: #f0ebe1;
    color: #3e2e20;
    border: 1px solid #c4b69d;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    margin-top: 0;
    line-height: 1;
    transition: background 0.15s;
}

.inline-cancel-btn:hover {
    background: #e3dcce;
}

.share-ride-btn {
    background: none;
    border: 1px solid #c9b99a;
    color: #2c1a0e;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.2em 0.5em;
    border-radius: 3px;
    margin-top: 0;
    font-family: inherit;
}

#strava-connect {
    display: flex;
    align-items: center;
}

#submit-btn {
    height: 2.4rem;
    padding: 0 1.2rem;
    flex: none;
}

.strava-oauth-btn {
    display: flex;
    align-items: center;
}

.strava-oauth-btn img {
    display: block;
    height: 2.4rem;
    width: auto;
}

.strava-connected-label {
    font-size: 0.8rem;
    color: #fc4c02;
    font-weight: bold;
    opacity: 0.8;
}

.strava-connected-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.strava-sync-btn {
    background: #fc5200;
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    font-weight: bold;
    color: #fff;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.strava-sync-btn:hover {
    opacity: 0.9;
}

.strava-disconnect-btn {
    background: transparent;
    border: 1px solid rgba(44, 26, 14, 0.35);
    color: #5a4030;
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.strava-disconnect-btn:hover {
    background: rgba(180, 40, 40, 0.1);
    border-color: #b42828;
    color: #b42828;
}

.strava-badge {
    font-size: 0.75rem;
    font-weight: bold;
    color: #fff;
    background: #fc4c02;
    padding: 0.25em 0.5em;
    border-radius: 3px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* --- The Ring-Bearer Styles (SSR Card Edition) --- */

.ring-bearer-banner {
    display: none !important;
}

.ring-bearer-card {
    position: relative;
    background: linear-gradient(155deg, rgba(46, 30, 14, 0.94) 0%, rgba(22, 14, 7, 0.97) 100%) !important;
    border: 1.5px solid #eec04b !important;
    box-shadow:
        0 0 16px rgba(245, 185, 45, 0.45),
        0 0 32px rgba(220, 140, 20, 0.22),
        inset 0 0 16px rgba(255, 215, 60, 0.14) !important;
    animation: ssrAuraGlow 3.2s ease-in-out infinite;
    overflow: hidden;
}

/* Subtle SSR holographic light glint across the card surface */
.ring-bearer-card::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -70%;
    width: 240%;
    height: 220%;
    background: linear-gradient(
        115deg,
        transparent 40%,
        rgba(255, 225, 120, 0.04) 47%,
        rgba(255, 240, 180, 0.16) 50%,
        rgba(255, 225, 120, 0.04) 53%,
        transparent 60%
    );
    transform: rotate(15deg);
    animation: ssrCardShimmer 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes ssrCardShimmer {
    0% {
        transform: translateY(-80%) rotate(15deg);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    50%, 100% {
        transform: translateY(80%) rotate(15deg);
        opacity: 0;
    }
}

@keyframes ssrAuraGlow {
    0%, 100% {
        border-color: #d4af37;
        box-shadow:
            0 0 14px rgba(245, 185, 45, 0.38),
            0 0 28px rgba(220, 140, 20, 0.18),
            inset 0 0 14px rgba(255, 215, 60, 0.1);
    }
    50% {
        border-color: #ffe07a;
        box-shadow:
            0 0 22px rgba(255, 215, 60, 0.6),
            0 0 42px rgba(245, 160, 30, 0.3),
            inset 0 0 20px rgba(255, 215, 60, 0.22);
    }
}

.ring-bearer-card .rider-km {
    color: #ffe68a !important;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.55), 0 0 22px rgba(230, 160, 30, 0.35) !important;
}

/* Floating One Ring on the Avatar */
.ring-bearer-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.ring-bearer-avatar-wrap img,
.ring-bearer-avatar-wrap > div:last-child {
    box-shadow: 0 0 0 2px #f0c54a, 0 0 12px rgba(255, 215, 0, 0.7) !important;
}

.avatar-ring-crown {
    position: absolute;
    top: -11px;
    right: -8px;
    z-index: 5;
    filter: drop-shadow(0 0 6px rgba(255, 215, 60, 0.95)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    animation: ringCrownFloat 2.6s ease-in-out infinite;
}

@keyframes ringCrownFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 5px rgba(255, 210, 50, 0.85)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    }
    50% {
        transform: translateY(-3px) scale(1.08);
        filter: drop-shadow(0 0 10px rgba(255, 225, 80, 1)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.9));
    }
}

.ring-chaser-status {
    color: rgba(210, 205, 195, 0.75);
}

/* Plain / Greyed-out style for non-Ring-Bearer cards */
.chaser-card {
    background: rgba(18, 16, 15, 0.45) !important;
    border: 1px solid rgba(140, 130, 120, 0.2) !important;
    opacity: 0.65;
    filter: grayscale(45%);
    box-shadow: none !important;
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.chaser-card:hover {
    opacity: 0.88;
    filter: grayscale(15%);
}

.chaser-card .rider-name {
    color: #9e968c !important;
}

.chaser-card .rider-km {
    color: #bab3a7 !important;
    text-shadow: none !important;
}

.chaser-card .cp-last,
.chaser-card .cp-next,
.chaser-card .rider-last-ride {
    opacity: 0.7;
}

/* Map marker for the Ring-Bearer with Fellowship Relic Halo */
.ring-bearer-div-icon {
    background: none !important;
    border: none !important;
}

.ring-bearer-marker {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring-pulse-halo {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #d4af37;
    background: rgba(212, 175, 55, 0.22);
    animation: ringHaloPulse 2s infinite ease-out;
    pointer-events: none;
}

.ring-bearer-dot {
    position: relative;
    z-index: 2;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2.5px solid #2c1a0e;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

/* Orbiting Relic Badges */
.relic-badge {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(22, 16, 10, 0.94);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.85);
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    user-select: none;
}

.relic-badge:hover {
    transform: scale(1.45) !important;
    z-index: 30;
}

.relic-glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.relic-glyph svg {
    width: 11px;
    height: 11px;
    display: block;
}

/* 12 o'clock: The One Ring (0 km) */
.relic-ring {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 1.4px solid #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
    animation: relicFloatTop 2.6s infinite ease-in-out;
}

/* 2 o'clock: Sting (Rivendell, 710 km) */
.relic-sting {
    top: 2px;
    right: -4px;
    border: 1.4px solid #60a5fa;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
    animation: relicFloatRight 2.9s infinite ease-in-out;
}

/* 4 o'clock: Staff of the Grey (Moria Exit, 1,120 km) */
.relic-staff {
    bottom: 0px;
    right: -3px;
    border: 1.4px solid #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
    animation: relicFloatBottom 3.2s infinite ease-in-out;
}

/* 8 o'clock: Leaf of Lórien Brooch (Lothlórien, 1,500 km) */
.relic-leaf {
    bottom: 0px;
    left: -3px;
    border: 1.4px solid #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
    animation: relicFloatBottomLeft 2.7s infinite ease-in-out;
}

/* 10 o'clock: Shelob's Trophy (Cirith Ungol, 2,780 km) */
.relic-shelob {
    top: 2px;
    left: -4px;
    border: 1.4px solid #c084fc;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
    animation: relicFloatLeft 3s infinite ease-in-out;
}

@keyframes relicFloatTop {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -2.5px); }
}
@keyframes relicFloatRight {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}
@keyframes relicFloatBottom {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}
@keyframes relicFloatBottomLeft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}
@keyframes relicFloatLeft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Relic shelf in sidebar rider card */
.rider-relic-shelf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}
.relic-shelf-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 9999px;
    background: rgba(30, 22, 15, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.35);
    font-size: 0.72rem;
    color: #e5d5b5;
}
.relic-shelf-badge svg {
    width: 12px;
    height: 12px;
    display: inline-block;
    vertical-align: -1px;
}

.popup-ring-bearer {
    color: #b8860b;
    font-weight: bold;
    font-size: 0.85rem;
}

@keyframes ringHaloPulse {
    0% {
        transform: scale(0.7);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.35;
    }
    100% {
        transform: scale(0.7);
        opacity: 0.9;
    }
}

/* Golden radiant trail on Middle-earth map for Ring-Bearer */
.ring-bearer-trail-glow {
    filter: drop-shadow(0 0 8px rgba(255, 190, 40, 0.9)) drop-shadow(0 0 16px rgba(245, 150, 20, 0.55));
    pointer-events: none;
}

/* Checkpoint Landmark Markers */
.checkpoint-div-icon {
    background: none !important;
    border: none !important;
}

.checkpoint-node {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
}

.checkpoint-node:hover {
    transform: scale(1.28);
    z-index: 500 !important;
}

.checkpoint-major {
    width: 34px;
    height: 34px;
}

/* Unreached / Locked Checkpoints */
.checkpoint-locked {
    background: radial-gradient(circle at 35% 35%, #3c2a1c 0%, #1e130a 100%);
    border: 2px solid #6b533e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    color: #dfcdba;
    opacity: 0.92;
}

.checkpoint-locked .checkpoint-svg-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
    opacity: 0.9;
}

/* Reached / Unlocked Checkpoints */
.checkpoint-reached {
    background: radial-gradient(circle at 35% 35%, #fff9e6 0%, #d4a338 55%, #8c5e12 100%);
    border: 2px solid #4a2e05;
    box-shadow: 0 0 12px rgba(255, 210, 80, 0.85), 0 2px 8px rgba(0, 0, 0, 0.8);
    color: #2b1602;
}

.checkpoint-reached .checkpoint-svg-icon {
    filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.5)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.checkpoint-glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.checkpoint-svg-icon {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

.checkpoint-major .checkpoint-svg-icon {
    width: 22px;
    height: 22px;
}

/* Beacon halo on next immediate objective */
.checkpoint-next-objective::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2.5px solid #e5a93b;
    animation: checkpointPulse 1.8s infinite ease-out;
    pointer-events: none;
}

@keyframes checkpointPulse {
    0% {
        transform: scale(0.85);
        opacity: 0.95;
    }
    100% {
        transform: scale(1.65);
        opacity: 0;
    }
}

/* Tolkien Map Tooltip & Popup Enhancements */
.cp-tooltip-km {
    font-size: 0.78rem;
    opacity: 0.75;
    font-weight: normal;
    margin-left: 3px;
}

.cp-tooltip-svg {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 4px;
    color: #5c381c;
}

.tolkien-popup-svg {
    width: 32px;
    height: 32px;
    display: inline-block;
    color: #a87e24;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.leaflet-popup-content-wrapper {
    background: #fdfaf3 !important;
    border: 2px solid #3c2415 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 18px rgba(20, 10, 5, 0.6) !important;
    color: #2b180d !important;
    font-family: Georgia, 'Times New Roman', serif !important;
    padding: 2px !important;
}

.leaflet-popup-tip {
    background: #fdfaf3 !important;
    border: 2px solid #3c2415 !important;
}

.tolkien-popup {
    padding: 0.35rem 0.45rem;
    min-width: 210px;
    max-width: 270px;
}

.tolkien-popup-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(60, 36, 21, 0.25);
    padding-bottom: 0.4rem;
    margin-bottom: 0.45rem;
}

.tolkien-popup-glyph {
    font-size: 1.5rem;
    line-height: 1;
}

.tolkien-popup-title-group {
    display: flex;
    flex-direction: column;
}

.tolkien-popup-title {
    font-size: 1.05rem;
    font-weight: bold;
    color: #2c1508;
    line-height: 1.2;
}

.tolkien-popup-dist {
    font-size: 0.78rem;
    color: #6b4d36;
    font-style: italic;
}

.tolkien-popup-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.status-unlocked {
    background: rgba(220, 175, 40, 0.22);
    color: #724c04;
    border: 1px solid rgba(180, 135, 25, 0.45);
}

.status-locked {
    background: rgba(80, 60, 50, 0.12);
    color: #554438;
    border: 1px solid rgba(80, 60, 50, 0.25);
}

.tolkien-popup-lore {
    font-size: 0.84rem;
    line-height: 1.45;
    color: #3b281c;
    font-style: italic;
    background: rgba(44, 26, 14, 0.04);
    border-left: 3px solid #b8860b;
    padding: 0.35rem 0.5rem;
    border-radius: 2px;
}

/* Road & Specialized Route Segment Styling */
.cartographic-road-casing {
    filter: drop-shadow(0 1px 2px rgba(20, 10, 5, 0.45));
}

.moria-tunnel-glow {
    filter: drop-shadow(0 0 6px rgba(180, 210, 255, 0.75));
    animation: moriaRunicPulse 3s infinite ease-in-out;
}

@keyframes moriaRunicPulse {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

.anduin-river-wake {
    filter: drop-shadow(0 0 4px rgba(100, 180, 220, 0.6));
}

.dead-marshes-glow {
    filter: drop-shadow(0 0 5px rgba(120, 220, 150, 0.7));
    animation: marshMistPulse 4s infinite ease-in-out;
}

@keyframes marshMistPulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.mordor-fire-glow {
    filter: drop-shadow(0 0 7px rgba(255, 68, 17, 0.85));
    animation: mordorEmberPulse 2.5s infinite ease-in-out;
}

@keyframes mordorEmberPulse {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

.road-tooltip {
    background: rgba(36, 22, 14, 0.9) !important;
    border: 1px solid rgba(220, 180, 100, 0.4) !important;
    color: #f7eedb !important;
    font-family: Georgia, serif !important;
    font-size: 0.8rem !important;
    padding: 3px 8px !important;
    border-radius: 3px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}
.road-tooltip::before {
    display: none !important;
}

