/* ============================================================
   MIDNIGHT HAUNT — Halloween design system
   Shared theme for the Halloween Neighborhood Registration site
   ============================================================ */

:root {
    --night-0: #070312;
    --night-1: #0e0722;
    --night-2: #1b0d33;
    --night-3: #241040;
    --panel: rgba(34, 19, 63, 0.92);
    --panel-2: rgba(18, 10, 36, 0.95);
    --panel-line: #4b2e7b;
    --panel-line-soft: #3a2464;
    --pumpkin: #ff8a1e;
    --pumpkin-hi: #ffb054;
    --pumpkin-lo: #e5560b;
    --witch: #8b5cf6;
    --witch-soft: #a78bfa;
    --bone: #f1e8da;
    --muted: #b3a2cf;
    --toxic: #5df06b;
    --danger: #ff5d5d;
    --font-display: 'Creepster', 'Segoe UI', Tahoma, sans-serif;
    --font-body: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--bone);
    background:
        radial-gradient(120% 70% at 50% 115%, rgba(255, 122, 24, 0.16) 0%, rgba(255, 122, 24, 0) 55%),
        radial-gradient(90% 55% at 78% -12%, rgba(139, 92, 246, 0.20) 0%, rgba(139, 92, 246, 0) 60%),
        linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 42%, var(--night-2) 76%, var(--night-3) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::after {
    /* soft vignette */
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(2, 1, 8, 0.55) 100%);
    pointer-events: none;
    z-index: 1;
}

/* ============================================================
   SCENE — night sky, moon, stars, skyline, fog, bats
   ============================================================ */

.scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.scene-stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.6px 1.6px at 22px 34px, rgba(255, 255, 255, 0.9), transparent 60%),
        radial-gradient(1.1px 1.1px at 118px 72px, rgba(255, 248, 220, 0.75), transparent 60%),
        radial-gradient(1.3px 1.3px at 66px 148px, rgba(214, 200, 255, 0.8), transparent 60%),
        radial-gradient(1px 1px at 172px 118px, rgba(255, 255, 255, 0.65), transparent 60%),
        radial-gradient(1.4px 1.4px at 210px 30px, rgba(255, 236, 190, 0.8), transparent 60%),
        radial-gradient(1px 1px at 96px 196px, rgba(255, 255, 255, 0.55), transparent 60%);
    background-size: 250px 250px;
    animation: twinkle 4.6s ease-in-out infinite alternate;
}

.scene-stars.stars-2 {
    background-image:
        radial-gradient(1.2px 1.2px at 40px 90px, rgba(255, 214, 160, 0.7), transparent 60%),
        radial-gradient(1px 1px at 140px 40px, rgba(255, 255, 255, 0.6), transparent 60%),
        radial-gradient(1.5px 1.5px at 80px 180px, rgba(230, 220, 255, 0.75), transparent 60%),
        radial-gradient(1px 1px at 190px 150px, rgba(255, 255, 255, 0.5), transparent 60%);
    background-size: 190px 190px;
    animation-delay: -2.3s;
    animation-duration: 6.1s;
}

@keyframes twinkle {
    from { opacity: 0.45; }
    to   { opacity: 1; }
}

.scene-moon {
    position: absolute;
    top: 3.5vh;
    right: 5vw;
    width: clamp(130px, 19vw, 250px);
    filter: drop-shadow(0 0 26px rgba(255, 226, 156, 0.28));
}

.scene-moon .halo {
    animation: haloPulse 7s ease-in-out infinite;
}

@keyframes haloPulse {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

.scene-skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: clamp(120px, 24vh, 250px);
}

.scene-skyline svg {
    display: block;
    width: 100%;
    height: 100%;
}

.scene-skyline .win {
    filter: drop-shadow(0 0 5px rgba(255, 179, 64, 0.9));
    animation: winFlicker 5.2s linear infinite;
}

.scene-skyline .win.w2 { animation-delay: -1.7s; animation-duration: 6.4s; }
.scene-skyline .win.w3 { animation-delay: -3.1s; animation-duration: 4.4s; }
.scene-skyline .win.w4 { animation-delay: -2.2s; animation-duration: 7.1s; }
.scene-skyline .win.w5 { animation-delay: -4.6s; animation-duration: 5.7s; }

@keyframes winFlicker {
    0%, 100% { opacity: 1; }
    6%  { opacity: 0.55; }
    9%  { opacity: 0.95; }
    14% { opacity: 0.4; }
    17% { opacity: 0.9; }
    52% { opacity: 1; }
    55% { opacity: 0.75; }
    58% { opacity: 1; }
}

.scene-fog {
    position: absolute;
    bottom: -6vh;
    left: -25vw;
    width: 150vw;
    height: 32vh;
    background:
        radial-gradient(46% 60% at 28% 82%, rgba(167, 139, 250, 0.13), transparent 70%),
        radial-gradient(40% 55% at 72% 90%, rgba(255, 150, 80, 0.09), transparent 70%);
    animation: fogDrift 46s ease-in-out infinite alternate;
}

.scene-fog.fog-2 {
    bottom: -10vh;
    animation-duration: 61s;
    animation-delay: -20s;
    animation-direction: alternate-reverse;
    opacity: 0.8;
}

@keyframes fogDrift {
    from { transform: translateX(-6vw); }
    to   { transform: translateX(6vw); }
}

/* --- Bats --- */

.bat-wrap {
    position: absolute;
    top: var(--y, 16%);
    left: 0;
    animation: flyAcross var(--dur, 40s) linear infinite;
    animation-delay: var(--delay, 0s);
    will-change: transform;
}

.bat-wrap .bat-bob {
    animation: batBob 2.6s ease-in-out infinite;
}

.bat-wrap svg {
    display: block;
    width: var(--w, 84px);
    height: auto;
    transform: scale(var(--s, 1));
    transform-origin: center;
}

@keyframes flyAcross {
    from { transform: translateX(-14vw); }
    to   { transform: translateX(112vw); }
}

@keyframes batBob {
    0%, 100% { transform: translateY(0) rotate(2deg); }
    50%      { transform: translateY(-26px) rotate(-3deg); }
}

.bat-wing-l {
    transform-box: view-box;
    transform-origin: 100px 44px;
    animation: flapL 0.42s ease-in-out infinite alternate;
}

.bat-wing-r {
    transform-box: view-box;
    transform-origin: 100px 44px;
    animation: flapR 0.42s ease-in-out infinite alternate;
}

@keyframes flapL {
    from { transform: rotate(-14deg); }
    to   { transform: rotate(10deg); }
}

@keyframes flapR {
    from { transform: rotate(14deg); }
    to   { transform: rotate(-10deg); }
}

/* ============================================================
   ICON SPRITE
   ============================================================ */

.hv-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.16em;
    flex-shrink: 0;
}

.icon-lg {
    width: 1.55em;
    height: 1.55em;
    vertical-align: -0.3em;
}

/* ============================================================
   LAYOUT & CARDS
   ============================================================ */

.page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 34px 20px 60px;
    position: relative;
    z-index: 2;
}

.container,
.login-container,
.dashboard-container {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--panel-line);
    border-radius: 20px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 138, 30, 0.07),
        0 0 46px rgba(139, 92, 246, 0.10);
    padding: 40px;
    width: 100%;
    position: relative;
    z-index: 2;
    margin: 26px 0;
}

.container { max-width: 800px; }
.login-container { max-width: 420px; }
.dashboard-container {
    max-width: 1200px;
    display: none; /* revealed by admin.js after successful login */
}

/* ============================================================
   CARD DECORATIONS — ghost, bat, jack-o'-lanterns, web, spider
   ============================================================ */

.deco {
    position: absolute;
    pointer-events: none;
    z-index: 3;
}

/* Ghost peeking over the card edge */
.deco-ghost {
    top: -58px;
    left: -26px;
    width: 92px;
    animation: ghostFloat 5.5s ease-in-out infinite;
    filter: drop-shadow(0 6px 14px rgba(167, 139, 250, 0.35));
}

.deco-ghost svg { display: block; width: 100%; height: auto; }

.deco-ghost .ghost-eyes {
    transform-box: fill-box;
    transform-origin: center;
    animation: ghostBlink 4.8s ease-in-out infinite;
}

@keyframes ghostFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-13px) rotate(3deg); }
}

@keyframes ghostBlink {
    0%, 91%, 100% { transform: scaleY(1); }
    94%           { transform: scaleY(0.08); }
    97%           { transform: scaleY(1); }
}

/* Small bat perched on the card corner */
.deco-bat {
    top: -46px;
    right: 34px;
    width: 74px;
    animation: ghostFloat 4.2s ease-in-out infinite reverse;
}

.deco-bat svg { display: block; width: 100%; height: auto; }

/* Pair of jack-o'-lanterns sitting at the card foot */
.deco-jack {
    bottom: -26px;
    right: -20px;
    width: 128px;
    animation: jackFloat 6.5s ease-in-out infinite;
}

.deco-jack svg { display: block; width: 100%; height: auto; }

.deco-jack .jack-face { animation: jackFlicker 3.4s linear infinite; }

@keyframes jackFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

@keyframes jackFlicker {
    0%, 100% { opacity: 1; }
    8%  { opacity: 0.72; }
    10% { opacity: 1; }
    34% { opacity: 0.85; }
    37% { opacity: 1; }
    68% { opacity: 0.78; }
    71% { opacity: 1; }
    82% { opacity: 0.9; }
}

/* Spider web draped in the card corner */
.deco-web {
    top: -1px;
    right: -1px;
    width: 128px;
    opacity: 0.5;
    z-index: 1;
}

.deco-web svg { display: block; width: 100%; height: auto; }

/* Spider descending on a silk thread */
.deco-spider {
    top: -4px;
    right: 118px;
    width: 54px;
    z-index: 4;
}

.deco-spider svg { display: block; width: 100%; height: auto; }

.deco-spider .spider-drop {
    transform-box: view-box;
    animation: spiderDrop 6s ease-in-out infinite alternate;
}

.deco-spider .leg {
    transform-box: fill-box;
    transform-origin: 50% 0%;
}

.deco-spider .leg.l1 { animation: legWiggle 2.1s ease-in-out infinite alternate; }
.deco-spider .leg.l2 { animation: legWiggle 2.1s ease-in-out infinite alternate -0.5s; }
.deco-spider .leg.l3 { animation: legWiggle 2.1s ease-in-out infinite alternate -1s; }

@keyframes spiderDrop {
    from { transform: translateY(0); }
    to   { transform: translateY(52px); }
}

@keyframes legWiggle {
    from { transform: rotate(-5deg); }
    to   { transform: rotate(5deg); }
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1.display {
    font-family: var(--font-display);
    font-weight: 400;
    text-align: center;
    color: var(--pumpkin-hi);
    font-size: clamp(2rem, 5.4vw, 3rem);
    letter-spacing: 1px;
    line-height: 1.15;
    margin-bottom: 10px;
    text-shadow:
        0 3px 0 #3a1c05,
        0 0 22px rgba(255, 138, 30, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

h1.display .icon-lg {
    width: 1.35em;
    height: 1.35em;
    color: var(--pumpkin);
    filter: drop-shadow(0 0 10px rgba(255, 138, 30, 0.6));
}

h2 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--pumpkin-hi);
    font-size: 1.45rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 0 #3a1c05, 0 0 14px rgba(255, 138, 30, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3,
.map-section h3 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--pumpkin-hi);
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    text-shadow: 0 2px 0 #3a1c05, 0 0 12px rgba(255, 138, 30, 0.28);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================
   NAV MENU
   ============================================================ */

.nav-menu {
    background: rgba(18, 10, 36, 0.9);
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    width: 100%;
}

.nav-menu li {
    flex: 1;
    margin: 0;
}

.nav-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 20px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.25s, color 0.25s;
    border-right: 1px solid var(--panel-line-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu a:last-child {
    border-right: none;
}

.nav-menu a:hover {
    background: rgba(139, 92, 246, 0.16);
    color: var(--bone);
}

.nav-menu a.active,
.nav-menu li a.active {
    background: linear-gradient(180deg, #ff9a2e 0%, #e5560b 100%) !important;
    color: #2a1206 !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

@media (max-width: 600px) {
    .nav-menu a {
        padding: 12px 10px;
        font-size: 14px;
        gap: 6px;
    }
}

/* ============================================================
   COUNTDOWN TIMER
   ============================================================ */

.timer {
    text-align: center;
    background: rgba(18, 10, 36, 0.85);
    border: 1px dashed var(--pumpkin);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 30px;
    box-shadow: 0 0 26px rgba(255, 138, 30, 0.12), inset 0 0 30px rgba(255, 138, 30, 0.05);
}

.timer-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.92em;
    color: var(--pumpkin-hi);
    margin-bottom: 6px;
    letter-spacing: 0.4px;
}

.timer-display {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--bone);
    text-shadow: 0 0 14px rgba(255, 138, 30, 0.55), 0 2px 0 rgba(0, 0, 0, 0.6);
    letter-spacing: 2px;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-section {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--pumpkin-hi);
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--panel-line);
    border-radius: 10px;
    font-size: 16px;
    font-family: var(--font-body);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    background: #120a26;
    color: var(--bone);
}

textarea {
    resize: vertical;
    min-height: 84px;
}

option {
    background: #120a26;
    color: var(--bone);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--pumpkin);
    box-shadow: 0 0 0 3px rgba(255, 138, 30, 0.22), 0 0 18px rgba(255, 138, 30, 0.15);
    background: #170d30;
}

input::placeholder,
textarea::placeholder {
    color: #7d6ba4;
}

/* ============================================================
   BUTTONS
   ============================================================ */

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(180deg, #ff9a2e 0%, #e5560b 100%);
    color: #2a1206;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 18px rgba(229, 86, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: 0 10px 26px rgba(229, 86, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    background: linear-gradient(180deg, #453462 0%, #2c2043 100%);
    color: #93839f;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-green {
    background: linear-gradient(180deg, #4fc94f 0%, #2b8a2b 100%);
    color: #0c2a0c;
    box-shadow: 0 6px 18px rgba(79, 201, 79, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-green:hover:not(:disabled) {
    box-shadow: 0 10px 26px rgba(79, 201, 79, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-red {
    background: linear-gradient(180deg, #f0564e 0%, #a91f1f 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(240, 86, 78, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-red:hover:not(:disabled) {
    box-shadow: 0 10px 26px rgba(240, 86, 78, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.logout-btn {
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
}

.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(42, 18, 6, 0.35);
    border-top-color: #2a1206;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.loading-spinner.light {
    border-color: rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   MESSAGES
   ============================================================ */

.error {
    background: linear-gradient(180deg, rgba(120, 22, 26, 0.9) 0%, rgba(74, 12, 18, 0.9) 100%);
    color: #ffb3b3;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    border: 1px solid #a33236;
    box-shadow: 0 0 20px rgba(255, 93, 93, 0.18);
    text-align: center;
}

.success-message {
    background: linear-gradient(180deg, rgba(18, 74, 30, 0.92) 0%, rgba(9, 46, 18, 0.92) 100%);
    color: #c9f7cd;
    padding: 24px;
    border-radius: 14px;
    text-align: center;
    margin-top: 20px;
    display: none;
    border: 1px solid #2f9e44;
    box-shadow: 0 0 26px rgba(93, 240, 107, 0.16);
}

.success-message > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
}

.pin-display {
    font-family: var(--font-mono);
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 8px;
    margin: 12px 0;
    color: var(--toxic);
    text-shadow: 0 0 14px rgba(93, 240, 107, 0.65);
}

/* ============================================================
   MAP
   ============================================================ */

.map-section {
    margin-bottom: 30px;
}

.map-instructions {
    background: rgba(139, 92, 246, 0.12);
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid var(--pumpkin);
    border-top: 1px solid var(--panel-line-soft);
    border-right: 1px solid var(--panel-line-soft);
    border-bottom: 1px solid var(--panel-line-soft);
    color: var(--muted);
    display: flex;
    align-items: flex-start;
    gap: 9px;
    line-height: 1.5;
}

.map-instructions strong {
    color: var(--pumpkin-hi);
    display: flex;
    align-items: center;
    gap: 7px;
}

.map-container {
    height: 400px;
    width: 100%;
    border: 1px solid var(--panel-line);
    border-radius: 14px;
    position: relative;
    background: #0a0518;
    overflow: hidden;
    box-shadow: 0 0 26px rgba(139, 92, 246, 0.12), inset 0 0 0 1px rgba(255, 138, 30, 0.05);
}

#map {
    height: 100%;
    width: 100%;
    border-radius: 13px;
    background: #0a0518;
}

.coordinates-display {
    background: rgba(18, 10, 36, 0.9);
    padding: 12px;
    border-radius: 10px;
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 14px;
    text-align: center;
    color: var(--pumpkin-hi);
    border: 1px solid var(--panel-line);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Night-mode tiles */
.leaflet-tile {
    filter: brightness(0.62) invert(1) contrast(2.3) hue-rotate(188deg) saturate(0.38) brightness(0.64);
}

.leaflet-container {
    background: #0a0518;
}

html .leaflet-bar a,
html .leaflet-bar a:hover {
    background: #1b1035;
    color: var(--pumpkin-hi);
    border-bottom-color: var(--panel-line-soft);
}

html .leaflet-bar a:hover {
    background: #26164a;
}

html .leaflet-bar {
    border: 1px solid var(--panel-line-soft);
    border-radius: 8px;
    overflow: hidden;
}

html .leaflet-control-attribution {
    background: rgba(10, 5, 24, 0.75);
    color: #8d7cb0;
    font-size: 10px;
}

html .leaflet-control-attribution a {
    color: var(--witch-soft);
}

/* Leaflet popups — dark tombstone style */
html .leaflet-popup-content-wrapper {
    background: #1b1035;
    color: var(--bone);
    border: 1px solid #6d4aa8;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(139, 92, 246, 0.25);
}

html .leaflet-popup-tip {
    background: #1b1035;
    border: 1px solid #6d4aa8;
}

html .leaflet-popup-close-button {
    color: var(--muted) !important;
}

.hw-popup {
    min-width: 210px;
}

.hw-popup-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--pumpkin-hi);
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 15px;
}

.hw-popup-row {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #9c8cc0;
    font-size: 12.5px;
    margin-top: 4px;
}

.hw-popup-notes {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: #e4d7b8;
    font-size: 13px;
    margin: 8px 0;
    padding: 8px 10px;
    background: rgba(255, 138, 30, 0.08);
    border-left: 3px solid var(--pumpkin);
    border-radius: 6px;
}

.hw-popup-notes .icon { margin-top: 2px; }

/* Pumpkin map marker */
.pumpkin-marker {
    filter: drop-shadow(0 0 7px rgba(255, 150, 40, 0.85)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
    animation: markerBob 3.2s ease-in-out infinite;
}

.pumpkin-marker svg { display: block; }

@keyframes markerBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

.house-marker {
    filter: drop-shadow(0 0 7px rgba(167, 139, 250, 0.8)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
}

.house-marker svg { display: block; }

/* ============================================================
   STATS
   ============================================================ */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.14) 0%, rgba(18, 10, 36, 0.9) 100%);
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid var(--panel-line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-number {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--pumpkin-hi);
    text-shadow: 0 0 14px rgba(255, 138, 30, 0.5);
}

.stat-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9em;
    color: var(--muted);
}

/* ============================================================
   STREETS VIEW (public)
   ============================================================ */

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    flex: 1;
    min-width: 200px;
    max-width: 420px;
    position: relative;
}

.search-box .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #7d6ba4;
    pointer-events: none;
}

.search-box input {
    padding-left: 40px;
}

.streets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.street-card {
    background: linear-gradient(180deg, rgba(34, 19, 63, 0.9) 0%, rgba(18, 10, 36, 0.95) 100%);
    border: 1px solid var(--panel-line);
    border-radius: 14px;
    padding: 20px;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
    position: relative;
    cursor: pointer;
}

.street-card:hover {
    transform: translateY(-3px);
    border-color: var(--pumpkin);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 138, 30, 0.12);
}

.street-card.expanded {
    border-color: var(--pumpkin);
    box-shadow: 0 0 20px rgba(255, 138, 30, 0.15);
}

.expand-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    color: var(--pumpkin-hi);
    transition: transform 0.3s;
    display: flex;
}

.street-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.street-details {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--panel-line);
}

.street-card.expanded .street-details {
    display: block;
}

.address-item {
    background: rgba(18, 10, 36, 0.85);
    border: 1px solid var(--panel-line-soft);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.address-number {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffd9a6;
    font-weight: 700;
    font-size: 1.05em;
    margin-bottom: 5px;
}

.address-notes {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: #e4d7b8;
    font-size: 0.9em;
    margin-top: 5px;
    padding: 8px 10px;
    background: rgba(255, 138, 30, 0.07);
    border-radius: 6px;
    border-left: 3px solid var(--pumpkin);
}

.address-notes .icon { margin-top: 2px; }

.address-date {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #9c8cc0;
    font-size: 0.8em;
    margin-top: 5px;
}

.street-header {
    margin-bottom: 15px;
    padding-right: 28px;
}

.street-name {
    color: var(--pumpkin-hi);
    font-size: 1.15em;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(255, 138, 30, 0.25);
}

.street-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    margin-bottom: 10px;
}

.house-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.house-number {
    background: #1c0f36;
    color: #ffd9a6;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 0.9em;
    border: 1px solid var(--panel-line);
    font-family: var(--font-mono);
}

.no-submissions {
    color: #8d7cb0;
    font-style: italic;
}

.loading-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    color: var(--pumpkin-hi);
    padding: 40px 20px;
    font-size: 1.1em;
}

/* ============================================================
   ADMIN DASHBOARD
   ============================================================ */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--panel-line);
    gap: 16px;
    flex-wrap: wrap;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.export-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: rgba(18, 10, 36, 0.85);
    border: 1px solid var(--panel-line);
    border-radius: 12px;
}

.export-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#zoom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--pumpkin) 0%, var(--witch) 100%);
    outline: none;
    opacity: 0.85;
    transition: opacity 0.2s;
    padding: 0;
    border: none;
}

#zoom-slider:hover { opacity: 1; }

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--pumpkin-hi);
    border: 3px solid #2a1206;
    box-shadow: 0 0 10px rgba(255, 138, 30, 0.7);
    cursor: pointer;
}

#zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pumpkin-hi);
    border: 3px solid #2a1206;
    box-shadow: 0 0 10px rgba(255, 138, 30, 0.7);
    cursor: pointer;
}

#zoom-value {
    color: var(--pumpkin-hi);
    font-family: var(--font-mono);
    font-weight: 700;
}

.streets-management {
    margin-bottom: 30px;
}

.streets-grid.admin-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 0;
}

.streets-grid.admin-grid .street-card {
    cursor: default;
    padding: 15px;
}

.streets-grid.admin-grid .street-card:hover {
    transform: none;
}

.street-card.unavailable {
    opacity: 0.55;
    border-color: var(--panel-line-soft);
}

.street-card.unavailable:hover {
    border-color: var(--panel-line-soft);
    box-shadow: none;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 27px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3f2a63;
    transition: 0.3s;
    border-radius: 27px;
    border: 1px solid var(--panel-line-soft);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bone);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: linear-gradient(90deg, var(--pumpkin) 0%, var(--pumpkin-lo) 100%);
    border-color: var(--pumpkin-lo);
    box-shadow: 0 0 12px rgba(255, 138, 30, 0.45);
}

input:checked + .toggle-slider::before {
    transform: translateX(25px);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
}

.addresses-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(18, 10, 36, 0.9);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 22px rgba(139, 92, 246, 0.1);
    border: 1px solid var(--panel-line-soft);
}

.addresses-table th,
.addresses-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #251543;
}

.addresses-table th {
    background: rgba(139, 92, 246, 0.14);
    font-weight: 700;
    color: var(--pumpkin-hi);
    font-size: 0.92em;
    letter-spacing: 0.4px;
}

.addresses-table tr:hover td {
    background: rgba(255, 138, 30, 0.05);
}

.addresses-table td {
    color: var(--muted);
    vertical-align: top;
}

.addresses-table td small { color: inherit; }

.pin {
    font-family: var(--font-mono);
    font-weight: 700;
    background: rgba(18, 10, 36, 0.95);
    padding: 4px 9px;
    border-radius: 6px;
    color: var(--toxic);
    text-shadow: 0 0 8px rgba(93, 240, 107, 0.6);
    border: 1px solid rgba(93, 240, 107, 0.45);
    letter-spacing: 2px;
}

.remove-address-btn {
    width: auto;
    padding: 7px 13px;
    font-size: 12.5px;
    border-radius: 8px;
    gap: 6px;
}

/* ============================================================
   LINKS / FOOTERS
   ============================================================ */

.admin-link,
.back-link {
    text-align: center;
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.admin-link a,
.back-link a {
    color: var(--pumpkin-hi);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.25s, text-shadow 0.25s;
    font-size: 1.02em;
}

.admin-link a:hover,
.back-link a:hover {
    color: #ffd9a6;
    text-shadow: 0 0 12px rgba(255, 179, 64, 0.5);
}

.back-link.panel {
    margin: 40px 0 20px;
    padding: 18px;
    background: rgba(18, 10, 36, 0.85);
    border: 1px solid var(--panel-line);
    border-radius: 12px;
}

/* ============================================================
   RESPONSIVE & MOTION
   ============================================================ */

@media (max-width: 768px) {
    .container,
    .login-container,
    .dashboard-container {
        padding: 22px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 300px;
    }

    .streets-grid {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .logout-btn {
        width: 100%;
    }

    .addresses-table {
        font-size: 13px;
    }

    .addresses-table th,
    .addresses-table td {
        padding: 9px 10px;
        white-space: nowrap;
    }

    .deco-ghost {
        width: 68px;
        top: -44px;
        left: -14px;
    }

    .deco-jack {
        width: 92px;
        bottom: -18px;
        right: -10px;
    }

    .deco-web {
        width: 90px;
    }

    .deco-spider {
        width: 40px;
        right: 84px;
    }

    .scene-moon {
        right: 2vw;
        width: clamp(110px, 26vw, 190px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
