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

:root {
    --paper:     #f4ecd8;
    --paper-2:   #e8d9b5;
    --sepia:     #3d2b1f;
    --sepia-2:   #7a5c3a;
    --gold:      #b38728;
    --gold-grad: linear-gradient(135deg,#bf953f,#fcf6ba,#b38728,#fbf5b7,#aa771c);
    --blood:     #8b0000;
    --shadow:    0 20px 60px rgba(0,0,0,.35);
}

html, body {
    width: 100%;
    background: var(--paper);
    font-family: 'Spectral', Georgia, serif;
    color: var(--sepia);
    overflow-x: hidden;
}

#map-section {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    line-height: 0;
    background: var(--paper);
}

#map-wrapper {
    position: relative;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

#main-map {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    filter: sepia(.1) contrast(1.05);
}

#markers-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.marker {
    position: absolute;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M4,4 Q11,11 16,16 Q21,21 28,28' stroke='%238b0000' stroke-width='3.4' stroke-linecap='round' fill='none'/%3E%3Cpath d='M28,4 Q21,11 16,16 Q11,21 4,28' stroke='%238b0000' stroke-width='3.4' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center/24px no-repeat;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.3));
    transition: transform .2s;
}
.marker:hover { transform: translate(-50%,-50%) scale(1.4); filter: drop-shadow(0 0 7px rgba(139,0,0,.6)); }
.marker.emoji-pin { background: none; font-size: 22px; display: flex; align-items: center; justify-content: center; }

#main-footer {
    width: 100%;
    background: var(--paper-2);
    border-top: 3px solid var(--gold);
    padding: 72px 24px 60px;
}

.footer-inner {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.footer-info {
    text-align: center;
}

.footer-line-1 {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    letter-spacing: 2px;
    color: var(--sepia);
    margin-bottom: 8px;
}

.footer-line-2 {
    font-size: 18px;
    color: var(--sepia-2);
    font-style: italic;
    margin-bottom: 12px;
}

.footer-line-2 strong {
    color: var(--sepia);
    font-style: normal;
}

.footer-line-3 {
    font-size: 14px;
    color: var(--sepia-2);
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.footer-hashtag {
    font-size: 15px;
    color: var(--gold);
    letter-spacing: 1px;
    font-weight: 600;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#footer-logo {
    width: 80px;
    cursor: pointer;
    filter: sepia(.4);
    transition: filter .3s, transform .3s;
    user-select: none;
    -webkit-user-select: none;
}
#footer-logo:hover { filter: none; transform: scale(1.06); }

.brand-name {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    letter-spacing: 8px;
    color: var(--gold);
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30,18,10,.88);
    backdrop-filter: blur(8px);
    z-index: 9000;
    justify-content: center;
    align-items: center;
    padding: 16px;
}
.overlay.open { display: flex; }

.card {
    position: relative;
    background: var(--paper);
    background-image: url('https://www.transparenttextures.com/patterns/parchment.png');
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 52px 36px 36px;
    box-shadow: var(--shadow);
    width: 100%;
    overflow-y: auto;
    max-height: 90vh;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
}
.card::-webkit-scrollbar { width: 5px; }
.card::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
.card-narrow { max-width: 400px; }
.card-wide { max-width: 800px; }

.x-btn {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--blood);
    cursor: pointer;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: transform .25s;
}
.x-btn:hover { transform: rotate(90deg) scale(1.15); }

.card-title {
    font-size: 24px;
    text-align: center;
    color: var(--sepia);
    margin-bottom: 10px;
    letter-spacing: 2px;
}
.card-title.cinzel { font-family: 'Cinzel', serif; }

.card-sub {
    font-size: 14px;
    color: var(--sepia-2);
    text-align: center;
    margin-bottom: 16px;
    font-style: italic;
    min-height: 18px;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg,transparent,var(--gold),transparent);
    margin: 0 auto 28px;
    width: 60%;
}

input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #d9cdb0;
    border-radius: 12px;
    font-size: 20px;
    text-align: center;
    letter-spacing: 6px;
    font-family: inherit;
    background: rgba(255,255,255,.7);
    color: var(--sepia);
    margin-bottom: 16px;
    transition: border-color .2s, box-shadow .2s;
}
input[type="password"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(179,135,40,.18); }
input[type="password"].error { border-color: var(--blood); box-shadow: 0 0 0 3px rgba(139,0,0,.18); }

.btn-primary {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--gold-grad);
    border: none;
    border-radius: 10px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--sepia);
    cursor: pointer;
    box-shadow: 0 5px 0 #7a5c1e;
    transition: .15s;
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #7a5c1e; }

.btn-secondary {
    display: block;
    width: 100%;
    padding: 13px;
    background: rgba(61,43,31,.08);
    border: 1.5px solid #d9cdb0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--sepia-2);
    cursor: pointer;
    transition: background .2s;
}
.btn-secondary:hover { background: rgba(61,43,31,.15); }

.entry-card {
    background: rgba(255,255,255,.5);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    border-left: 4px solid var(--gold);
}
.entry-card img { width: 100%; border-radius: 6px; border: 6px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.12); margin-bottom: 14px; display: block; }
.entry-card audio { width: 100%; margin-bottom: 14px; display: block; }
.entry-card p { font-size: 16px; line-height: 1.8; font-style: italic; }
.entry-card .del-btn {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 14px; padding: 8px 16px;
    border: 1.5px solid #e0c8c8; border-radius: 8px;
    background: none; color: var(--blood);
    font-size: 13px; cursor: pointer;
    transition: background .2s;
}
.entry-card .del-btn:hover { background: #fde0e0; }

textarea {
    width: 100%;
    min-height: 110px;
    border: 1.5px solid #d9cdb0;
    border-radius: 12px;
    padding: 14px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    background: rgba(255,255,255,.7);
    color: var(--sepia);
    resize: vertical;
    margin-bottom: 16px;
    transition: border-color .2s;
}
textarea:focus { border-color: var(--gold); }

.compose-tools {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1.5px solid #d9cdb0;
    border-radius: 14px;
    background: rgba(255,255,255,.6);
    color: var(--sepia);
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s, border-color .2s;
}
.tool-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.tool-btn:hover { background: var(--paper-2); }



.voice-recording {
    background: #e53935 !important;
    color: #fff !important;
    border-color: #c62828 !important;
    animation: pulse-mic 1.4s infinite;
}
@keyframes pulse-mic {
    0%   { box-shadow: 0 0 0 0 rgba(229,57,53,.5); }
    70%  { box-shadow: 0 0 0 10px rgba(229,57,53,0); }
    100% { box-shadow: 0 0 0 0 rgba(229,57,53,0); }
}

.rec-timer {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    color: #e53935;
    font-weight: bold;
    letter-spacing: 1px;
    min-width: 52px;
}

.media-preview { margin-bottom: 14px; }
.media-preview img { width: 100%; border-radius: 8px; border: 6px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: block; }

.discard-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 9px 16px;
    border: 1.5px solid #e0c8c8;
    border-radius: 8px;
    background: none;
    color: var(--blood);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s;
}
.discard-btn:hover { background: #fde0e0; }

.compose-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }

.empty-note { text-align: center; padding: 40px 0; opacity: .45; font-style: italic; }

.admin-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,.4);
    border-left: 4px solid var(--blood);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.admin-row span { flex: 1; font-size: 13px; line-height: 1.5; }
.admin-row button {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border: none; background: none;
    font-size: 18px; cursor: pointer;
    border-radius: 50%; transition: background .2s;
}
.admin-row button:hover { background: #fde0e0; }

.hidden { display: none !important; }

@media (max-width: 600px) {
    .card { padding: 48px 18px 24px; }
    .card-title { font-size: 20px; }
    .compose-tools { gap: 8px; }
    .tool-btn { padding: 10px 14px; font-size: 13px; }
    .footer-text p { font-size: 15px; }
}
