* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #111; font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }

.user-id-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 8, 18, 0.72);
    backdrop-filter: blur(12px);
}
.user-id-modal.show { display: flex; }
.user-id-box {
    width: min(360px, 100%);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    background: rgba(20,20,32,0.96);
    color: #fff;
    padding: 22px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.4);
}
.user-id-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; letter-spacing: 0; }
.user-id-copy { font-size: 13px; line-height: 1.6; color: rgba(255,255,255,0.58); margin-bottom: 16px; }
.user-id-input {
    width: 100%;
    height: 46px;
    border: 1px solid rgba(77,184,255,0.34);
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 0 12px;
    outline: none;
    margin-top: 10px;
}
.user-id-input::placeholder { color: rgba(255,255,255,0.32); }
.user-id-error {
    min-height: 18px;
    margin-top: 8px;
    color: #ff8a8a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}
.user-id-submit {
    width: 100%;
    height: 46px;
    margin-top: 12px;
    border: 0;
    border-radius: 10px;
    background: #4db8ff;
    color: #06111f;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

#map-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(rgba(77,184,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77,184,255,0.08) 1px, transparent 1px),
        radial-gradient(circle at 50% 45%, rgba(77,184,255,0.16), transparent 34%),
        #10131d;
    background-size: 64px 64px, 64px 64px, 100% 100%, auto;
}
#map { width: 100%; height: 100%; filter: grayscale(0.08) contrast(1.03); overflow: hidden; background: transparent; }
.leaflet-container { background: transparent !important; }
.leaflet-tile-pane { opacity: 1; }
#map-wrap::after {
    content: "Map loading";
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 50;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,0.44);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    pointer-events: none;
}
#map-wrap.tiles-ready::after { display: none; }
#map-wrap.tiles-error::after { content: "Map network unavailable - check app internet permission"; }

/* canvas: Leaflet mapPane above, position:absolute
   z-index is assigned in JS, below marker panes */
#fog-canvas, #age-canvas, #stay-canvas {
    position: absolute;
    top: 0; left: 0;
    display: block;
    pointer-events: none;
}
#fog-canvas { z-index: 1; }
#age-canvas { z-index: 2; }
#stay-canvas { z-index: 3; }
.leaflet-fogPane-pane {
    position: absolute !important; top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important; overflow: hidden !important; pointer-events: none !important;
    z-index: 590 !important;
}
.leaflet-marker-pane  { z-index: 600 !important; }
.leaflet-popup-pane   { z-index: 1000 !important; }
.leaflet-tooltip-pane { z-index: 1001 !important; }
.leaflet-photoPane-pane   { z-index: 630 !important; }
.leaflet-memoryPane-pane  { z-index: 640 !important; }
.leaflet-playerPane-pane  { z-index: 650 !important; }
.leaflet-tourPane-pane {z-index: 660 !important; }
.leaflet-libraryPane-pane { z-index: 665 !important; }
.leaflet-overlay-pane { z-index: 400 !important; }

.photo-cluster-icon { background: transparent !important; border: none !important; }
.photo-cluster-inner {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255, 213, 92, 0.92); border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { display: none !important; }

#top-bar {
    position: absolute; top: 14px; left: 14px; right: auto;
    display: flex; justify-content: flex-start; align-items: center; z-index: 1000; gap: 8px;
    max-width: calc(100vw - 22px);
}
#ham-btn {
    width: 48px; height: 48px; flex-shrink: 0; background: rgba(30,30,45,0.75);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    cursor: pointer; backdrop-filter: blur(8px);
}
.hline { width: 20px; height: 2px; background: #fff; border-radius: 1px; }

#rec-status-box {
    width: 58px; padding: 8px 0; text-align: center; background: rgba(30,30,45,0.55); border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px; color: rgba(255,255,255,0.82); font-size: 12px; font-weight: 800;
    backdrop-filter: blur(8px); transition: 0.25s ease; white-space: nowrap;
    flex-shrink: 0; overflow: hidden; text-overflow: clip;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 8px 18px rgba(0,0,0,0.16);
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
#rec-status-box.recording { background: rgba(255,70,70,0.28); border-color: rgba(255,80,80,0.75); color: #ff9a9a; animation: blink 1.2s ease-in-out infinite; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 0 18px rgba(255,70,70,0.18); }

#sidebar {
    position: fixed; top: 0; left: -334px; width: 334px; height: 100%;
    background: rgba(18,18,30,0.98); backdrop-filter: blur(18px); z-index: 2000;
    transition: left 0.3s ease; padding: 0; color: white;
    box-shadow: 10px 0 30px rgba(0,0,0,0.42); display: flex; flex-direction: column;
    overflow: hidden;
}
#sidebar.open { left: 0; }
#sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; z-index: 1999; }
#sidebar-overlay.show { display: block; }

/* Sidebar header, toggle, tabs */
.sidebar-header { padding: 26px 20px 0; flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.sidebar-header h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: #4db8ff; }
#fog-toggle-wrap { padding: 0 20px; flex-shrink: 0; }
#top-tabs { padding: 0 20px; flex-shrink: 0; }

/* Center scroll area */
#sidebar-content { flex: 1; overflow-y: auto; min-height: 0; padding: 12px 20px 12px; }

/* Fixed bottom tabs */
#bottom-tabs {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 20px 22px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(14,14,24,0.98);
}
.close-btn { cursor: pointer; font-size: 18px; color: rgba(255,255,255,0.88); }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.1); margin-bottom: 18px; flex-shrink: 0; }

.fog-toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 2px 16px; cursor: pointer; flex-shrink: 0; }
.fog-toggle-label { font-size: 15px; color: rgba(255,255,255,0.9); font-weight: 700; }
.fog-toggle-state { font-size: 12px; font-weight: 700; min-width: 52px; text-align: center; padding: 5px 10px; border-radius: 999px; transition: 0.25s ease; white-space: nowrap; }
.fog-toggle-state.on { background: rgba(32,34,63,0.9); color: rgba(255,255,255,0.92); border: 1px solid rgba(115,123,255,0.25); }
.fog-toggle-state.off { background: rgba(240,240,245,0.92); color: rgba(30,30,45,0.85); border: 1px solid rgba(0,0,0,0.1); }
.toggle-switch { width: 54px; height: 32px; border-radius: 999px; position: relative; transition: background 0.25s ease; flex-shrink: 0; }
.toggle-switch.on { background: rgba(103,101,170,0.9); }
.toggle-switch.off { background: rgba(220,220,230,0.85); }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform 0.25s ease; box-shadow: 0 2px 8px rgba(0,0,0,0.28); }
.toggle-switch.on .toggle-knob { transform: translateX(22px); }
.toggle-switch.off .toggle-knob { transform: translateX(0); background: rgba(80,80,100,0.7); }

/* 지도 표시 레이어 토글 패널 */
#map-layer-wrap { padding: 0 20px; flex-shrink: 0; }
.map-layer-caret { font-size: 13px; color: rgba(255,255,255,0.55); transition: transform 0.25s ease; }
.map-layer-caret.open { transform: rotate(180deg); }
.map-layer-panel { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.map-layer-panel.expanded { max-height: 320px; }
.map-layer-item { display: flex; align-items: center; gap: 10px; padding: 9px 2px; cursor: pointer; }
.map-layer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--layer-color, #888); flex-shrink: 0; }
.map-layer-name { flex: 1; font-size: 14px; color: rgba(255,255,255,0.88); }
.map-layer-name em { font-style: normal; font-size: 11px; color: rgba(255,255,255,0.4); margin-left: 6px; }
.map-layer-item.unavailable { cursor: default; opacity: 0.55; }
.map-layer-item.unavailable .toggle-switch { pointer-events: none; }
.toggle-switch.small { width: 40px; height: 24px; }
.toggle-switch.small .toggle-knob { width: 18px; height: 18px; top: 3px; left: 3px; }
.toggle-switch.small.on .toggle-knob { transform: translateX(16px); }

.sidebar-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; flex-shrink: 0; }
.sidebar-tab { min-height: 68px; text-align: center; padding: 12px 6px 10px; border-radius: 14px; color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.09); cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.sidebar-tab-icon { display: block; font-size: 24px; line-height: 1; opacity: 0.92; }
.sidebar-tab-icon.text-icon {
    min-width: 30px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
}
.sidebar-tab-text { display: block; font-size: 12px; font-weight: 700; letter-spacing: -0.01em; color: inherit; }
.sidebar-tab.active { color: #fff; }
#tab-memory { border-color: rgba(255,120,170,0.42); }
#tab-memory .sidebar-tab-icon { color: #ff8aac; }
#tab-memory.active { border-color: #ff8aac; background: linear-gradient(180deg, rgba(77,32,56,0.92), rgba(58,24,44,0.9)); }
#tab-photo { border-color: rgba(255,210,92,0.42); }
#tab-photo .sidebar-tab-icon { color: #ffd55c; }
#tab-photo.active { border-color: #ffd55c; background: linear-gradient(180deg, rgba(89,70,16,0.92), rgba(63,48,9,0.9)); }
#tab-gpx { border-color: rgba(84,186,255,0.42); }
#tab-gpx .sidebar-tab-icon { color: #54baff; }
#tab-gpx.active { border-color: #54baff; background: linear-gradient(180deg, rgba(24,59,92,0.92), rgba(18,42,72,0.9)); }

.tab-panel { overflow-y: visible; }

/* Bottom tab button area */
#bottom-tabs .sidebar-tab { min-height: 68px; }
#tab-badge.active { border-color: #ffd84d; background: linear-gradient(180deg, rgba(80,65,0,0.9), rgba(60,48,0,0.9)); color: #fff; }
#tab-visit.active { border-color: #78dc8c; background: linear-gradient(180deg, rgba(0,60,20,0.9), rgba(0,44,14,0.9)); color: #fff; }
#tab-item.active { border-color: #c084fc; background: linear-gradient(180deg, rgba(50,0,80,0.9), rgba(36,0,60,0.9)); color: #fff; }

/* Badge grid */
#badge-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; background: rgba(255,216,77,0.08); border: 1px solid rgba(255,216,77,0.25); border-radius: 12px; text-align: center; }
.badge-icon { font-size: 28px; line-height: 1; }
.badge-name { font-size: 10px; color: rgba(255,255,255,0.8); font-weight: 600; line-height: 1.3; }
.badge-date { font-size: 9px; color: rgba(255,255,255,0.35); }
.character-badge {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 24%, #fff8d7 0 14%, #ffd84d 15% 48%, #ff8f3d 49% 100%);
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.16), 0 4px 12px rgba(0,0,0,0.22);
}
.badge-face {
    position: relative;
    width: 30px;
    height: 30px;
    display: inline-block;
    border-radius: 40% 40% 48% 48%;
    background: #fff;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
}
.badge-eyes::before,
.badge-eyes::after {
    content: "";
    position: absolute;
    top: 14px;
    width: 4px;
    height: 5px;
    border-radius: 50%;
    background: #25222a;
}
.badge-eyes::before { left: 9px; }
.badge-eyes::after { right: 9px; }
.badge-fountain { background: #d9f6ff; border-radius: 50% 50% 44% 44%; }
.badge-fountain::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 6px;
    height: 3px;
    border-radius: 999px;
    background: #37aee8;
}
.badge-splash::before,
.badge-splash::after {
    content: "";
    position: absolute;
    top: -6px;
    width: 7px;
    height: 12px;
    border-radius: 999px;
    background: #7ddcff;
}
.badge-splash::before { left: 7px; transform: rotate(-22deg); }
.badge-splash::after { right: 7px; transform: rotate(22deg); }
.badge-heendy { background: #fff; border-radius: 44% 44% 50% 50%; }
.badge-heendy::after {
    content: "";
    position: absolute;
    left: 12px;
    bottom: 6px;
    width: 6px;
    height: 4px;
    border-radius: 0 0 50% 50%;
    background: #ff8aac;
}
.badge-ears::before,
.badge-ears::after {
    content: "";
    position: absolute;
    top: -5px;
    width: 8px;
    height: 10px;
    border-radius: 50% 50% 30% 30%;
    background: #fff;
}
.badge-ears::before { left: 5px; transform: rotate(-18deg); }
.badge-ears::after { right: 5px; transform: rotate(18deg); }
.badge-duo { display: inline-flex; align-items: flex-end; justify-content: center; gap: 0; }
.badge-duo .badge-face { width: 24px; height: 28px; }
.badge-hanam { background: #ffe2a8; transform: rotate(-6deg); }
.badge-bangul { background: #c9ecff; margin-left: -4px; transform: rotate(7deg); }
.badge-street { background: #d8e6ff; border-radius: 42% 42% 50% 50%; }
.badge-sign {
    position: absolute;
    left: 6px;
    right: 6px;
    top: -5px;
    height: 9px;
    border-radius: 3px;
    background: #78dc8c;
    box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}
.photo-ai-result {
    margin: 0 auto 8px;
    padding: 6px 9px;
    border-radius: 999px;
    width: fit-content;
    max-width: 260px;
    font-size: 11px;
    font-weight: 800;
    color: rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}
.photo-ai-result.accepted {
    color: #15151d;
    background: #ffd84d;
    border-color: rgba(255,255,255,0.46);
}

/* Visit list */
#visit-list { display: flex; flex-direction: column; gap: 6px; }
.visit-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(120,220,140,0.07); border: 1px solid rgba(120,220,140,0.2); border-radius: 10px; cursor: pointer; transition: 0.2s; }
.visit-item:hover { background: rgba(120,220,140,0.14); }
.visit-icon { font-size: 18px; flex-shrink: 0; }
.visit-info { flex: 1; min-width: 0; }
.visit-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-date { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }

/* Item list */
#item-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.item-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; background: rgba(192,132,252,0.08); border: 1px solid rgba(192,132,252,0.25); border-radius: 12px; text-align: center; }
.item-icon { font-size: 28px; line-height: 1; }
.item-name { font-size: 10px; color: rgba(255,255,255,0.8); font-weight: 600; line-height: 1.3; }
.memory-item { background: rgba(255,255,255,0.05); padding: 15px; border-radius: 10px; margin-bottom: 10px; cursor: pointer; border: 1px solid rgba(255,255,255,0.1); transition: 0.2s; }
.memory-item:hover { border-color: #4db8ff; background: rgba(255,255,255,0.1); }
.item-name { display: block; font-weight: bold; margin-bottom: 4px; }
.item-date { display: block; font-size: 12px; color: rgba(255,255,255,0.6); }
.memory-actions { display: flex; gap: 8px; margin-top: 10px; }
.memory-action-btn { flex: 1; padding: 8px; border: none; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; }
.memory-action-btn.move { background: #4db8ff; color: #fff; }
.memory-action-btn.delete { background: #ff5555; color: #fff; }
.empty-message { opacity: 0.5; text-align: center; margin-top: 40px; font-size: 13px; }

#photo-list-container { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.photo-list-item { border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); cursor: pointer; position: relative; aspect-ratio: 1; background: rgba(255,255,255,0.04); transition: 0.2s; }
.photo-list-item:hover { border-color: #4db8ff; transform: scale(1.02); }
.photo-list-item img { width:100%; height:100%; object-fit:cover; display:block; }
.photo-list-date { position: absolute; bottom:0; left:0; right:0; padding: 4px 6px; font-size: 10px; color: rgba(255,255,255,0.8); background: linear-gradient(transparent, rgba(0,0,0,0.65)); }
.photo-list-del { position: absolute; top:4px; right:4px; width:20px; height:20px; border-radius: 50%; background: rgba(255,60,60,0.85); color: #fff; font-size: 11px; font-weight: bold; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.photo-list-item:hover .photo-list-del { opacity: 1; }

.photo-menu { position: absolute; right: 86px; bottom: 150px; background: rgba(20,20,35,0.96); border: 1px solid rgba(255,255,255,0.15); border-radius: 14px; z-index: 1100; overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease; backdrop-filter: blur(12px); }
.photo-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.photo-menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 20px; cursor: pointer; transition: background 0.15s; }
.photo-menu-item:hover { background: rgba(255,255,255,0.08); }
.photo-menu-item:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,0.07); }
.photo-menu-icon { font-size: 20px; }
.photo-menu-label { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; }
#photo-menu-overlay { position: fixed; inset: 0; z-index: 1099; display: none; }
#photo-menu-overlay.show { display: block; }

.gpx-section-label { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.5); letter-spacing: 0.04em; margin-bottom: 12px; }
.gpx-dial-wrap { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.gpx-dial-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.gpx-dial-row:last-of-type { margin-bottom: 0; }
.gpx-dial-icon { font-size: 16px; flex-shrink: 0; }
.gpx-dial-title { font-size: 12px; color: rgba(255,255,255,0.5); width: 36px; flex-shrink: 0; }
.gpx-dial-controls { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.dial-btn { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); color: #fff; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.15s; padding: 0; user-select: none; }
.dial-btn:active { background: rgba(77,184,255,0.25); transform: scale(0.93); }
.dial-value { min-width: 80px; text-align: center; font-size: 13px; font-weight: 600; color: #fff; background: rgba(77,184,255,0.12); border: 1px solid rgba(77,184,255,0.25); border-radius: 8px; padding: 4px 6px; }
.gpx-dial-range-info { margin-top: 10px; font-size: 11px; color: rgba(255,255,255,0.35); text-align: center; }
.gpx-name-row { margin-bottom: 10px; }
.gpx-name-input { width: 100%; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; color: #fff; font-size: 13px; padding: 10px 12px; outline: none; }
.gpx-name-input:focus { border-color: #4db8ff; }
.gpx-name-input::placeholder { color: rgba(255,255,255,0.3); }
.gpx-action-btn { width: 100%; padding: 11px; border: none; border-radius: 12px; font-size: 13px; font-weight: 700; cursor: pointer; transition: 0.2s; margin-bottom: 6px; }
.gpx-action-btn.export { background: rgba(77,184,255,0.18); color: #4db8ff; border: 1px solid rgba(77,184,255,0.4); }
.gpx-action-btn.export:active { background: rgba(77,184,255,0.32); }
.gpx-action-btn.import { background: rgba(120,220,140,0.14); color: #78dc8c; border: 1px solid rgba(120,220,140,0.35); }
.gpx-action-btn.import:active { background: rgba(120,220,140,0.28); }
#gpx-saved-list { display: flex; flex-direction: column; gap: 8px; }
.gpx-saved-item { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: 0.2s; }
.gpx-saved-item:hover { border-color: #4db8ff; background: rgba(77,184,255,0.1); }
.gpx-saved-item.active-route { border-color: #4db8ff; background: rgba(77,184,255,0.16); }
.gpx-saved-icon { font-size: 18px; flex-shrink: 0; }
.gpx-saved-info { flex: 1; min-width: 0; }
.gpx-saved-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gpx-saved-meta { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.gpx-saved-del { width: 24px; height: 24px; border-radius: 6px; background: rgba(255,80,80,0.15); border: 1px solid rgba(255,80,80,0.3); color: #ff6b6b; font-size: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: 0.15s; }
.gpx-saved-del:hover { background: rgba(255,80,80,0.3); }
.gpx-status { margin-top: 8px; font-size: 12px; color: rgba(255,255,255,0.4); min-height: 16px; text-align: center; }

#controls { position: absolute; bottom: 72px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 12px; transition: bottom 0.3s ease; }
#controls.hud-open { bottom: 252px; }
.btn { width: 56px; height: 56px; border-radius: 50%; background: rgba(30,30,45,0.82); display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.1); cursor: pointer; font-size: 20px; color: #fff; backdrop-filter: blur(8px); transition: 0.2s; }
#photo-btn { border-color: #ffd55c; }
#memo-btn { border-color: #ff8aac; }
#traffic-btn {
    border-color: #fee500;
    background: rgba(32, 30, 20, 0.86);
}
.traffic-icon { font-size: 11px; font-weight: 800; color: #78dc8c; letter-spacing: 0; }
.route-icon {
    width: 27px;
    height: 27px;
    color: #fee500;
    display: block;
    overflow: visible;
}
#loc-btn {
    border-color: #54baff;
    position: relative;
}
.record-loc-btn .loc-record-icon {
    position: relative;
    z-index: 2;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #4db8ff;
    box-shadow: 0 0 0 4px rgba(77,184,255,0.12), 0 0 10px rgba(77,184,255,0.62);
    transition: 0.2s ease;
}
.record-loc-btn .loc-crosshair {
    position: relative;
    width: 28px;
    height: 28px;
    border: 2px solid #4db8ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.record-loc-btn .loc-crosshair::before,
.record-loc-btn .loc-crosshair::after {
    content: "";
    position: absolute;
    background: #4db8ff;
    border-radius: 999px;
}
.record-loc-btn .loc-crosshair::before {
    width: 34px;
    height: 2px;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(90deg, #4db8ff 0 8px, transparent 8px 26px, #4db8ff 26px 34px);
}
.record-loc-btn .loc-crosshair::after {
    width: 2px;
    height: 34px;
    left: 50%;
    top: -5px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #4db8ff 0 8px, transparent 8px 26px, #4db8ff 26px 34px);
}
.record-loc-btn.recording {
    border-color: rgba(255,80,80,0.68);
}
.record-loc-btn.recording .loc-record-icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #ff4444;
    box-shadow: 0 0 0 5px rgba(255,68,68,0.13), 0 0 12px rgba(255,68,68,0.7);
}
.icon-stop { width: 14px; height: 14px; background: #ff4444; border-radius: 2px; }
.icon-rec { width: 14px; height: 14px; background: #4db8ff; border-radius: 50%; }

#help-btn { position: absolute; bottom: 72px; left: 20px; width: 56px; height: 56px; border-radius: 50%; background: rgba(30,30,45,0.82); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); font-size: 20px; font-weight: bold; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1000; backdrop-filter: blur(8px); transition: bottom 0.3s ease; }
#help-btn.hud-open { bottom: 252px; }
#help-btn:hover { border-color: #4db8ff; color: #4db8ff; }

#kakao-traffic-wrap {
    position: absolute;
    inset: 0;
    z-index: 900;
    display: none;
}
#kakao-traffic-wrap.show { display: block; }
#kakao-traffic-map { width: 100%; height: 100%; }
#kakao-traffic-close {
    position: absolute;
    top: 78px;
    right: 16px;
    z-index: 901;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(20,20,35,0.82);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

#help-popup { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 3000; align-items: flex-end; justify-content: center; padding-bottom: 30px; }
#help-popup.show { display: flex; }
.help-content { background: rgba(20,20,30,0.97); border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; padding: 0; width: calc(100% - 40px); max-width: 400px; color: #fff; overflow: hidden; max-height: 80vh; overflow-y: auto; }
.help-tab-row { display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 0 16px; }
.help-tab { flex: 1; text-align: center; padding: 14px 0; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.35); border-bottom: 2px solid transparent; cursor: pointer; transition: 0.2s; }
.help-tab.active { color: #4db8ff; border-bottom-color: #4db8ff; }
.help-close { cursor: pointer; font-size: 18px; color: rgba(255,255,255,0.45); padding: 14px 0 14px 12px; flex-shrink: 0; }
.help-panel { padding: 18px 20px; }
.help-notice { background: rgba(77,184,255,0.08); border: 1px solid rgba(77,184,255,0.2); border-radius: 10px; padding: 12px 14px; font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.7; margin-bottom: 14px; }
.help-notice b { color: #4db8ff; }
.help-link { display: block; padding: 14px; background: rgba(255,235,0,0.12); border: 1px solid rgba(255,235,0,0.35); border-radius: 12px; color: #ffe800; text-decoration: none; font-size: 14px; font-weight: 600; text-align: center; transition: 0.2s; }
.help-link:hover { background: rgba(255,235,0,0.2); }
.help-tutorial-link { width: calc(100% - 32px); margin: 0 16px 16px; cursor: pointer; font-family: inherit; }
.help-guide-list { display: flex; flex-direction: column; gap: 14px; }
.help-guide-item { display: flex; align-items: flex-start; gap: 12px; }
.help-guide-icon { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.red-dot { background: rgba(255,68,68,0.15); border-color: rgba(255,68,68,0.3); }
.red-dot::after { content: ""; width: 10px; height: 10px; background: #ff4444; border-radius: 50%; }
.blue-dot { position: relative; background: rgba(20,28,42,0.92); border-color: rgba(77,184,255,0.42); box-shadow: inset 0 0 0 1px rgba(77,184,255,0.16); }
.blue-dot::before { content: ""; width: 14px; height: 14px; border: 1.5px solid #4db8ff; border-radius: 50%; box-shadow: 0 0 8px rgba(77,184,255,0.55); }
.blue-dot::after { content: ""; position: absolute; width: 20px; height: 20px; background: linear-gradient(#4db8ff,#4db8ff) 50% 0/1.5px 5px no-repeat, linear-gradient(#4db8ff,#4db8ff) 50% 100%/1.5px 5px no-repeat, linear-gradient(#4db8ff,#4db8ff) 0 50%/5px 1.5px no-repeat, linear-gradient(#4db8ff,#4db8ff) 100% 50%/5px 1.5px no-repeat; border-radius: 50%; }
.help-guide-text { flex: 1; padding-top: 4px; }
.help-guide-text b { font-size: 13px; color: #fff; display: block; margin-bottom: 3px; }
.help-guide-text span { font-size: 11px; color: rgba(255,255,255,0.45); line-height: 1.6; }

#hud { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(20,20,30,0.92); z-index: 1600; border-top: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(10px); transition: height 0.3s ease; overflow: hidden; height: calc(70px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); pointer-events: auto; }
#hud.expanded { height: calc(250px + env(safe-area-inset-bottom)); }
#hud-handle { display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 10px 18px; cursor: pointer; touch-action: manipulation; pointer-events: auto; user-select: none; -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
#hud-mini-avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #dbeafe; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); font-size: 20px; line-height: 1; }
#hud-mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
#hud-mini-line { color: rgba(255,255,255,0.88); font-size: 13px; font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud-mini-xp-track { position: relative; height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); }
.hud-mini-xp-fill { position: absolute; top: 0; bottom: 0; width: 0%; transition: width 0.35s ease; }
.hud-mini-xp-fill.mini-dist { left: 0; background: #4f7cff; }
.hud-mini-xp-fill.mini-memory { left: 33.333%; background: #d9ff35; }
.hud-mini-xp-fill.mini-photo { left: 66.666%; background: #ff922e; }
#hud.expanded #hud-mini-line { color: #fff; }
#hud-basic { opacity: 0; transform: translateY(6px); transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none; padding: 0 14px 14px; }
#hud.expanded #hud-basic { opacity: 1; transform: translateY(0); pointer-events: auto; }
#hud-user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(77,184,255,0.10); border: 1px solid rgba(77,184,255,0.20); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; min-width: 0; }
#hud-avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #dbeafe; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); font-size: 18px; line-height: 1; }
#hud-user-main { min-width: 0; flex: 0 1 86px; }
#hud-user-label { font-size: 9px; color: rgba(255,255,255,0.38); letter-spacing: 0.04em; margin-bottom: 3px; font-weight: 700; }
#hud-user-id { font-size: 14px; color: #fff; font-weight: 800; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hud-game-line { flex: 1 1 auto; min-width: 0; color: rgba(255,255,255,0.82); font-size: 12px; font-weight: 800; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud-user-change-btn { flex-shrink: 0; border: 1px solid rgba(255,255,255,0.16); border-radius: 8px; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 700; padding: 7px 10px; cursor: pointer; }
#hud-title-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
#hud-title-wrap { flex: 1; }
#hud-title-label { font-size: 9px; color: rgba(255,255,255,0.3); letter-spacing: 0.06em; margin-bottom: 3px; font-weight: 600; }
#hud-title-text { font-size: 17px; color: #fff; font-weight: 600; letter-spacing: 0.02em; }
#hud-level-wrap { text-align: right; }
#hud-level-label { font-size: 9px; color: rgba(255,255,255,0.3); letter-spacing: 0.06em; margin-bottom: 2px; font-weight: 600; }
#hud-level-num { font-size: 28px; color: #4db8ff; font-weight: 700; line-height: 1; }
#hud-progress-row { display: flex; gap: 8px; }
.hud-prog-item { flex: 1; padding: 8px 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; }
.hud-prog-label { font-size: 9px; color: rgba(255,255,255,0.3); letter-spacing: 0.04em; margin-bottom: 4px; font-weight: 600; }
.hud-prog-current { font-size: 13px; color: #fff; font-weight: 600; margin-bottom: 5px; }
.hud-prog-bar-wrap { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-bottom: 4px; overflow: hidden; }
.hud-prog-bar { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.hud-prog-next { font-size: 9px; color: rgba(255,255,255,0.35); line-height: 1.4; }
#hud-xp-row { display: flex; align-items: center; gap: 10px; margin: -2px 0 10px; }
#hud-xp-label { flex: 0 0 auto; font-size: 10px; color: rgba(255,255,255,0.42); font-weight: 800; }
#hud-xp-track { position: relative; flex: 1; height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1); }
.hud-xp-fill { position: absolute; top: 0; bottom: 0; width: 0%; transition: width 0.35s ease; }
.hud-xp-fill.xp-dist { left: 0; background: #4f7cff; }
.hud-xp-fill.xp-memory { left: 33.333%; background: #ffd84d; }
.hud-xp-fill.xp-photo { left: 66.666%; background: #ffd84d; }

.player-marker { width: 18px; height: 18px; background: #4db8ff; border: 3px solid rgba(255,255,255,0.95); border-radius: 50%; box-shadow: 0 0 14px rgba(77,184,255,0.95); }
.memory-marker { width: 28px; height: 28px; display: flex; justify-content: center; align-items: center; color: #ffd84d; font-size: 22px; text-shadow: 0 0 10px rgba(255,216,77,0.9);  }
.photo-marker { overflow: hidden; cursor: pointer; }
.photo-marker img { display: block; }

.popup-delete-btn { margin-top: 8px; padding: 6px 12px; border: none; border-radius: 8px; background: #ff5555; color: #fff; cursor: pointer; font-size: 12px; font-weight: 600; width: 100%; }
.popup-delete-btn:hover { background: #ff3333; }
.leaflet-popup { z-index: 2000 !important; }
.leaflet-popup-content-wrapper { background: rgba(20,20,30,0.95) !important; color: #fff !important; border: 1px solid rgba(255,255,255,0.15) !important; border-radius: 12px !important; box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 13px !important; line-height: 1.6 !important; color: #fff !important; }
.leaflet-popup-content b { font-size: 14px; color: #fff; }
.leaflet-popup-content small { color: rgba(255,255,255,0.5); font-size: 11px; }
.leaflet-popup-tip { background: rgba(20,20,30,0.95) !important; }
.leaflet-popup-close-button { color: rgba(255,255,255,0.5) !important; font-size: 18px !important; }
.photo-popup img { border-radius: 8px; margin-bottom: 8px; display: block; }

/* Nearby tour recommendation panel */
#tour-panel { position: absolute; top: 80px; left: 14px; width: 160px; z-index: 1000; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#tour-panel.collapsed #tour-list,
#tour-panel.collapsed #tour-expand-btn,
#tour-panel.collapsed #festival-strip,
#tour-panel.collapsed #festival-strip-label,
#tour-panel.collapsed #tour-loading,
#tour-panel.collapsed #tour-empty { display: none !important; }
#tour-header { display: flex; align-items: center; justify-content: space-between; background: rgba(20,20,35,0.55); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 8px 10px; cursor: pointer; pointer-events: auto; }
#tour-header-right { display: flex; align-items: center; gap: 5px; }
#tour-title { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.8); }
#tour-count { font-size: 10px; color: rgba(255,255,255,0.4); font-weight: 600; }
#tour-close-btn {
    width: 18px; height: 18px; border: none; border-radius: 999px;
    background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.75);
    font-size: 12px; line-height: 1; cursor: pointer;
    display: none; align-items: center; justify-content: center;
}
#tour-close-btn:hover { background: rgba(255,255,255,0.22); color: #fff; }
#tour-list { display: flex; flex-direction: column; gap: 5px; max-height: 240px; overflow: hidden; transition: max-height 0.3s ease; }
#tour-list.expanded { max-height: 70vh; overflow-y: auto; }
.tour-card { background: rgba(20,20,35,0.55); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 10px; cursor: pointer; transition: 0.2s; pointer-events: auto; }
.tour-card:hover { border-color: rgba(120,220,140,0.5); background: rgba(120,220,140,0.08); }
.library-map-marker-wrap { background: transparent !important; border: none !important; }
.library-map-marker {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 7px 3px 5px; border-radius: 999px;
    background: rgba(30, 58, 138, 0.92);
    border: 1px solid rgba(96, 165, 250, 0.78);
    color: #eff6ff; font-size: 10px; font-weight: 800;
    line-height: 1; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.42);
}
.library-map-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #60a5fa; border: 2px solid #eff6ff;
    box-shadow: 0 0 0 2px rgba(30,58,138,0.48);
    flex-shrink: 0;
}
.library-map-label { color: #eff6ff; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.tour-card-name { font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.tour-card-type { font-size: 9px; color: rgba(120,220,140,0.8); font-weight: 600; margin-bottom: 2px; }
.tour-card-addr { font-size: 9px; line-height: 1.35; color: rgba(255,255,255,0.52); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.tour-card-dist { font-size: 9px; color: rgba(255,255,255,0.35); }
#tour-expand-btn { display: none; text-align: center; padding: 6px; background: rgba(20,20,35,0.55); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; font-size: 10px; color: rgba(255,255,255,0.5); font-weight: 600; cursor: pointer; transition: 0.2s; pointer-events: auto; }
#tour-expand-btn:hover { border-color: rgba(120,220,140,0.4); color: #78dc8c; }
#tour-loading { background: rgba(20,20,35,0.55); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 10px; text-align: center; font-size: 11px; color: rgba(255,255,255,0.4); pointer-events: auto; }
#tour-empty { background: rgba(20,20,35,0.55); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 10px; text-align: center; font-size: 11px; color: rgba(255,255,255,0.35); pointer-events: auto; }

/* Festival badge */
#tour-festival-badge { display: none; background: #4db8ff; color: #fff; font-size: 9px; font-weight: 700; border-radius: 999px; padding: 2px 7px; margin-left: 4px; white-space: nowrap; }
#tour-festival-badge.show { display: inline-block; }

/* Festival horizontal list */
#festival-strip { display: none; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 8px; padding: 8px 4px; pointer-events: auto; }
#festival-strip::-webkit-scrollbar { display: none; }
#festival-strip.show { display: flex; }
.festival-card { flex-shrink: 0; width: 120px; background: rgba(77,184,255,0.10); border: 1px solid rgba(77,184,255,0.35); border-radius: 10px; padding: 9px 10px; cursor: pointer; pointer-events: auto; transition: 0.2s; }
.festival-card:hover { background: rgba(77,184,255,0.2); }
.festival-card-name { font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.festival-card-date { font-size: 9px; color: #4db8ff; font-weight: 600; margin-bottom: 2px; }
.festival-card-dist { font-size: 9px; color: rgba(255,255,255,0.35); }
#festival-strip-label { font-size: 10px; font-weight: 700; color: #4db8ff; padding: 6px 4px 2px; display: none; pointer-events: none; }
#festival-strip-label.show { display: block; }

/* Language selector */
#lang-toggle { position: static; display: flex; gap: 6px; flex-shrink: 0; }
.lang-btn { min-width: 32px; height: 30px; padding: 0 8px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.15); background: rgba(30,30,45,0.75); color: rgba(255,255,255,0.5); font-size: 11px; font-weight: 800; cursor: pointer; backdrop-filter: blur(8px); transition: 0.2s; box-shadow: 0 7px 16px rgba(0,0,0,0.16); }
.lang-btn.active { background: rgba(77,184,255,0.34); border-color: #4db8ff; color: #dff5ff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10), 0 0 18px rgba(77,184,255,0.24); }

/* Badge grid */
#badge-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; background: rgba(255,216,77,0.08); border: 1px solid rgba(255,216,77,0.25); border-radius: 12px; text-align: center; }
.badge-icon { font-size: 28px; line-height: 1; }
.badge-name { font-size: 10px; color: rgba(255,255,255,0.8); font-weight: 600; line-height: 1.3; }
.badge-date { font-size: 9px; color: rgba(255,255,255,0.35); }

/* Visit list */
#visit-list { display: flex; flex-direction: column; gap: 6px; }
.visit-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(120,220,140,0.07); border: 1px solid rgba(120,220,140,0.2); border-radius: 10px; cursor: pointer; transition: 0.2s; }
.visit-item:hover { background: rgba(120,220,140,0.14); }
.visit-icon { font-size: 18px; flex-shrink: 0; }
.visit-info { flex: 1; min-width: 0; }
.visit-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-date { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }

/* Item list */
#item-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.item-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; background: rgba(192,132,252,0.08); border: 1px solid rgba(192,132,252,0.25); border-radius: 12px; text-align: center; }
.item-icon { font-size: 28px; line-height: 1; }
.item-name { font-size: 10px; color: rgba(255,255,255,0.8); font-weight: 600; line-height: 1.3; }

.tour-card {
    position: relative;
    border-color: var(--tour-border, rgba(120,220,140,0.5));
    background: linear-gradient(90deg, var(--tour-fill, rgba(120,220,140,0.1)), rgba(20,20,35,0.58));
}
.tour-card::before {
    content: "";
    position: absolute;
    top: 9px; bottom: 9px; left: 0;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--tour-color, #78dc8c);
}
.tour-card:hover {
    border-color: var(--tour-color, #78dc8c);
    background: linear-gradient(90deg, var(--tour-fill, rgba(120,220,140,0.14)), rgba(20,20,35,0.72));
}
.tour-card-type,
.tour-popup-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid var(--tour-border, rgba(120,220,140,0.45));
    background: var(--tour-fill, rgba(120,220,140,0.12));
    color: var(--tour-color, #78dc8c);
    font-size: 9px;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 4px;
}
.tour-popup-tag { margin: 6px 0 5px; font-size: 10px; }
.tour-popup-detail {
    max-width: 280px;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.76);
    font-size: 11px;
    line-height: 1.55;
}
.tour-popup-detail p { margin: 0 0 6px; }
.tour-popup-detail.loading,
.tour-popup-detail.muted { color: rgba(255,255,255,0.45); }
.tour-map-marker-wrap {
    background: transparent !important;
    border: none !important;
}
.tour-map-marker {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 3px 7px 3px 4px;
    border-radius: 999px;
    border: 1px solid var(--tour-border, rgba(120,220,140,0.55));
    background: rgba(18,18,28,0.86);
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    white-space: nowrap;
}
.tour-map-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--tour-color, #78dc8c);
    border: 2px solid rgba(255,255,255,0.95);
    box-shadow: 0 0 8px var(--tour-color, #78dc8c);
    flex-shrink: 0;
}
.tour-map-label {
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0,0,0,0.65);
}
#tour-festival-badge {
    background: #c084fc;
}
.festival-card {
    background: linear-gradient(180deg, var(--tour-fill, rgba(192,132,252,0.14)), rgba(20,20,35,0.62));
    border-color: var(--tour-border, rgba(192,132,252,0.45));
}
.festival-card:hover {
    background: linear-gradient(180deg, var(--tour-fill, rgba(192,132,252,0.22)), rgba(20,20,35,0.72));
    border-color: var(--tour-color, #c084fc);
}
.festival-card-date,
#festival-strip-label {
    color: var(--tour-color, #c084fc);
}
@media (max-width: 420px) {
    #top-bar { top: 10px; left: 8px; gap: 5px; max-width: calc(100vw - 12px); }
    #ham-btn { width: 48px; height: 48px; }
    #rec-status-box { width: 46px; padding: 7px 0; font-size: 11px; }
    #lang-toggle { gap: 3px; }
    .lang-btn { min-width: 28px; height: 28px; padding: 0 5px; }
    #hud-game-line { font-size: 11px; }
}

#auto-recording-notice {
    position: fixed;
    inset: 0;
    z-index: 4200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(0, 0, 0, 0.38);
}
#auto-recording-notice.show { display: flex; }
.auto-recording-box {
    position: relative;
    width: min(360px, 100%);
    padding: 22px 20px 20px;
    border-radius: 16px;
    background: rgba(18, 20, 32, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.46);
    color: #fff;
    backdrop-filter: blur(16px);
}
.auto-recording-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.auto-recording-title {
    padding-right: 30px;
    margin-bottom: 10px;
    color: #4db8ff;
    font-size: 17px;
    font-weight: 800;
}
.auto-recording-copy {
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.7;
    word-break: keep-all;
}

#photo-btn.mission-active {
    position: relative;
    border-color: rgba(255, 255, 255, 0.9);
    background: conic-gradient(from 0deg, #ff5f7e, #ffd55c, #78dc8c, #4db8ff, #a78bfa, #ff5f7e);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.16), 0 0 22px rgba(120,220,140,0.8);
    animation: missionPulse 1.4s ease-in-out infinite;
}
#photo-btn.mission-active::after {
    content: "미션";
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 3px 6px;
    border-radius: 999px;
    background: #fff;
    color: #161827;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.28);
}
@keyframes missionPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

.popup-memory-btn {
    margin-top: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 216, 77, 0.45);
    border-radius: 8px;
    background: rgba(255, 216, 77, 0.16);
    color: #ffd84d;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    width: 100%;
}
.popup-memory-btn:hover { background: rgba(255, 216, 77, 0.26); }
#tab-photo .sidebar-tab-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.giloa-tutorial {
    position: fixed;
    inset: 0;
    z-index: 4600;
    display: none;
    pointer-events: none;
}
.giloa-tutorial.show {
    display: block;
    pointer-events: auto;
}
.giloa-tutorial-dim {
    position: absolute;
    inset: 0;
    background: rgba(3,6,14,0.28);
    backdrop-filter: none;
}
.giloa-tutorial-card {
    position: absolute;
    left: 50%;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: min(430px, calc(100vw - 28px));
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 10px;
    align-items: end;
}
.giloa-tutorial-skip {
    position: absolute;
    right: 8px;
    top: -8px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 50%;
    background: rgba(17,19,31,0.92);
    color: rgba(255,255,255,0.86);
    font-size: 22px;
    line-height: 1;
}
.giloa-guide-stage {
    position: relative;
    height: 172px;
    align-self: end;
}
.giloa-guide-image {
    position: absolute;
    left: -12px;
    bottom: -2px;
    width: 148px;
    height: auto;
    z-index: 2;
    object-fit: contain;
    filter: drop-shadow(0 16px 22px rgba(0,0,0,0.38));
}
.giloa-guide-glow {
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: rgba(77,184,255,0.28);
    filter: blur(22px);
}
.giloa-guide-bubble {
    min-height: 176px;
    border: 1px solid rgba(77,184,255,0.28);
    border-radius: 16px;
    padding: 18px 18px 14px;
    background: rgba(18,20,33,0.94);
    color: #fff;
    box-shadow: 0 18px 50px rgba(0,0,0,0.46), inset 0 0 0 1px rgba(255,255,255,0.05);
    backdrop-filter: none;
}
.giloa-tutorial-kicker {
    color: #4db8ff;
    font-size: 11px;
    font-weight: 900;
    margin-bottom: 8px;
}
.giloa-tutorial-title {
    padding-right: 24px;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.32;
    margin-bottom: 8px;
    word-break: keep-all;
}
.giloa-tutorial-copy {
    min-height: 48px;
    color: rgba(255,255,255,0.76);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.58;
    word-break: keep-all;
}
.giloa-tutorial-progress {
    display: flex;
    gap: 5px;
    margin: 13px 0 12px;
}
.giloa-tutorial-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
}
.giloa-tutorial-dot.active {
    width: 18px;
    border-radius: 999px;
    background: #4db8ff;
}
.giloa-tutorial-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.giloa-tutorial-btn {
    min-width: 68px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}
.giloa-tutorial-btn.ghost {
    background: rgba(255,255,255,0.07);
}
.giloa-tutorial-btn.primary {
    border-color: rgba(77,184,255,0.64);
    background: #4db8ff;
    color: #06111f;
}
.tutorial-target {
    position: relative;
    z-index: 4700 !important;
    outline: 3px solid #4db8ff !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 7px rgba(77,184,255,0.18), 0 0 30px rgba(77,184,255,0.95) !important;
}
@media (max-width: 420px) {
    .giloa-tutorial-card {
        grid-template-columns: 92px 1fr;
        gap: 6px;
        bottom: calc(78px + env(safe-area-inset-bottom));
    }
    .giloa-guide-stage { height: 142px; }
    .giloa-guide-image { width: 122px; left: -18px; }
    .giloa-guide-bubble { min-height: 168px; padding: 16px 15px 13px; }
    .giloa-tutorial-title { font-size: 16px; }
}

.giloa-tutorial-card {
    width: min(330px, calc(100vw - 24px));
    bottom: auto;
    transform: none;
    grid-template-columns: 86px 1fr;
    gap: 8px;
    align-items: center;
}
.giloa-tutorial-card.intro {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.giloa-guide-stage {
    height: 116px;
}
.giloa-guide-image {
    left: 0;
    bottom: 0;
    width: 96px;
}
.giloa-guide-glow {
    left: 20px;
    bottom: 16px;
    width: 56px;
    height: 56px;
}
.giloa-guide-bubble {
    position: relative;
    min-height: 0;
    padding: 13px 14px 12px;
    border-radius: 14px;
}
.giloa-guide-bubble::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 44px;
    width: 16px;
    height: 16px;
    background: rgba(18,20,33,0.96);
    border-left: 1px solid rgba(77,184,255,0.28);
    border-bottom: 1px solid rgba(77,184,255,0.28);
    transform: rotate(45deg);
}
.giloa-tutorial-card.near-left {
    grid-template-columns: 1fr 86px;
}
.giloa-tutorial-card.near-left .giloa-guide-stage {
    order: 2;
}
.giloa-tutorial-card.near-left .giloa-guide-bubble::before {
    left: auto;
    right: -9px;
    border-left: 0;
    border-bottom: 0;
    border-right: 1px solid rgba(77,184,255,0.28);
    border-top: 1px solid rgba(77,184,255,0.28);
}
.giloa-tutorial-card.near-bottom .giloa-guide-bubble::before,
.giloa-tutorial-card.intro .giloa-guide-bubble::before {
    top: -9px;
    left: 34px;
    border-left: 1px solid rgba(77,184,255,0.28);
    border-top: 1px solid rgba(77,184,255,0.28);
    border-bottom: 0;
}
.giloa-tutorial-kicker {
    display: none;
}
.giloa-tutorial-title {
    padding-right: 24px;
    margin-bottom: 5px;
    font-size: 17px;
}
.giloa-tutorial-copy {
    min-height: 0;
    font-size: 12px;
    line-height: 1.45;
}
.giloa-tutorial-progress {
    margin: 9px 0 10px;
}
.giloa-tutorial-btn {
    min-width: 58px;
    height: 34px;
}
.giloa-tutorial-skip {
    right: -6px;
    top: -10px;
}
.pose-point-left .giloa-guide-image {
    transform: scaleX(-1) rotate(-8deg);
}
.pose-point-right .giloa-guide-image {
    transform: rotate(8deg);
}
.pose-focus .giloa-guide-image {
    transform: scale(0.95) rotate(-4deg);
}
.pose-peek .giloa-guide-image {
    transform: translateX(-8px) rotate(10deg);
}
.pose-cheer .giloa-guide-image {
    transform: translateY(-5px) scale(1.05);
}
