:root {
    --bg-color: #0d0d12;
    --text-primary: #ffffff;
    --text-muted: #8e8e93;
    --accent: #f1c40f;
    --accent-glow: rgba(241, 196, 15, 0.4);
    --glass-bg: rgba(20, 20, 28, 0.72);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #1c1c22;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.hidden { display: none !important; }

.app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh;
    position: relative;
    background: #eeeeec;
    overflow: hidden;
}

.map-area {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #eeeeec;
}

/* ===== Auth ===== */
.auth-screen {
    position: absolute;
    inset: 0;
    z-index: 5000;
    background: linear-gradient(160deg, #0d0d12, #1a1a28);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card { width: 100%; max-width: 340px; text-align: center; }

.logo {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo span { color: #f1c40f; }

.tagline {
    color: var(--text-muted);
    margin: 4px 0 28px;
    font-size: 15px;
}

.auth-tabs {
    display: flex;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
}

.auth-tab.active { background: #f1c40f; color: #14141c; }

.auth-card input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 15px;
    outline: none;
}

.auth-card input:focus { border-color: #f1c40f; }

.auth-error {
    color: #ff6b6b;
    font-size: 13px;
    min-height: 18px;
    margin-top: 10px;
}

.auth-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 24px;
}

/* ===== Header ===== */
.glass-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 18px 20px;
    background: linear-gradient(to bottom, rgba(13, 13, 18, 0.55) 10%, rgba(13, 13, 18, 0) 100%);
    pointer-events: none;
}

.glass-header > * { pointer-events: auto; }

.mode-slider-container {
    padding: 12px 15px;
    background: var(--glass-bg);
    border-radius: 20px;
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    margin-bottom: 10px;
}

.temp-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 10px;
    background: linear-gradient(to right, #3498db 0%, #2ecc71 25%, #f1c40f 50%, #ff4f9a 75%, #e74c3c 100%);
    outline: none;
    margin-bottom: 10px;
}

.temp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    border: 3px solid #1a1a24;
}

.temp-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.temp-labels span { cursor: pointer; padding: 3px 5px; border-radius: 8px; }
.temp-labels span:hover { background: rgba(255, 255, 255, 0.1); }

.label-blue { color: #5dade2; }
.label-green { color: #58d68d; }
.label-yellow { color: #f4d03f; }
.label-pink { color: #ff7ab5; }
.label-red { color: #ec7063; }

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 5px;
}

.mode-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    flex: 1;
}

.icon-btn {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
}

.notice {
    margin-top: 10px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 68px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 34px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 50px;
    position: relative;
}

.nav-item i { font-size: 24px; }
.nav-item span { font-size: 10px; font-weight: 500; }
.nav-item.active { color: white; }
.nav-item.active i { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }

.upload-btn { position: relative; top: -18px; }

.plus-circle {
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, var(--accent), #2c3e50);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px var(--accent-glow);
    border: 5px solid #14141c;
}

.plus-circle i { font-size: 30px; color: white; }

/* ===== Sheets ===== */
.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 82vh;
    background: rgba(20, 20, 28, 0.94);
    backdrop-filter: blur(30px);
    border-top: 1px solid var(--glass-border);
    border-radius: 30px 30px 0 0;
    z-index: 2000;
    transform: translateY(105%);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.05);
    display: flex;
    flex-direction: column;
}

.bottom-sheet.open { transform: translateY(0); }

.sheet-handle-wrap {
    padding: 14px;
    display: flex;
    justify-content: center;
    cursor: pointer;
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sheet-content {
    padding: 0 24px 30px;
    overflow-y: auto;
}

.sheet-content::-webkit-scrollbar { display: none; }

.sheet-title { text-align: center; margin-bottom: 18px; font-size: 20px; }

.profile-header {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.avatar-placeholder {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: linear-gradient(45deg, #2c3e50, var(--accent));
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 42px;
    color: rgba(255, 255, 255, 0.7);
    border: 3px solid rgba(255, 255, 255, 0.12);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: visible;
}

.avatar-placeholder.has-photo i { display: none; }

.avatar-upload { cursor: pointer; }

.avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: #14141c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 3px solid #14141c;
}

.section-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
}

.section-card h3 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-card p { font-size: 15px; line-height: 1.5; }

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

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 13px 15px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 15px;
    outline: none;
    resize: none;
}

.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 6px;
}

.toggle-row strong { font-size: 14px; display: block; }
.toggle-row small { font-size: 12px; color: var(--text-muted); line-height: 1.35; display: block; margin-top: 2px; }

.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }

.switch .knob {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    cursor: pointer;
    transition: 0.25s;
}

.switch .knob::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.25s;
}

.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::before { transform: translateX(22px); }

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.btn {
    width: 100%;
    padding: 15px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn:active { transform: scale(0.98); }
.btn-primary { background: white; color: var(--bg-color); }
.btn-secondary { background: transparent; color: white; border: 1px solid var(--glass-border); }

.save-status {
    text-align: center;
    font-size: 13px;
    color: #58d68d;
    min-height: 18px;
    margin-top: 10px;
}

/* ===== Feed ===== */
.feed-panel {
    position: absolute;
    inset: 0;
    z-index: 800;
    background: #101014;
    display: none;
}

.feed-panel.open { display: block; }

.feed-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 190px 18px 110px;
}

.feed-scroll::-webkit-scrollbar { display: none; }

.feed-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.feed-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 13px;
    display: flex;
    gap: 14px;
    cursor: pointer;
}

.feed-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.85);
    background: linear-gradient(45deg, #2c3e50, var(--accent));
    background-size: cover;
    background-position: center;
}

.feed-avatar.has-photo i { display: none; }

.feed-info h4 { font-size: 15px; margin-bottom: 3px; }
.feed-info p { font-size: 13px; color: var(--text-muted); line-height: 1.45; }

.feed-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 30px;
    font-size: 14px;
    line-height: 1.6;
}

.feed-empty i { font-size: 44px; display: block; margin-bottom: 12px; color: var(--accent); }

/* ===== Toast ===== */
.toast {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 20, 28, 0.95);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 20px;
    border-radius: 16px;
    font-size: 14px;
    z-index: 4000;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
    max-width: 85%;
    text-align: center;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Map-Pins ===== */
.custom-pin { cursor: pointer; }

.pin {
    position: relative;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    z-index: 2;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    background-size: cover;
    background-position: center;
}

.dot.avatar-dot {
    width: 34px;
    height: 34px;
}

.pulse-ring {
    position: absolute;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid;
    animation: ripple 2.5s linear infinite;
    z-index: 1;
}

@keyframes ripple {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

.maplibregl-ctrl-attrib { display: none !important; }
