@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
    --signature-yellow: #FFDE00;
    --text-black: #1E1E1E;
    --bg-gray: #F5F5F7;
    --card-white: #ffffff;
    --subtext-gray: #888;
    --accent-red: #ff6b6b;
}

/* --- Base Layout & Scroll Fix --- */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-black);
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    word-break: keep-all;
    overflow-wrap: break-word;
}

main {
    width: 100%;
    flex: 1;
    min-height: 0;
    max-width: 480px;
    background: rgba(245, 245, 247, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 500px) {
    main {
        max-height: 850px;
        border-radius: 30px;
        border: 1px solid rgba(255, 255, 255, 0.5);
    }
}

/* --- Background Animation --- */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    filter: blur(80px);
}
.blob { position: absolute; border-radius: 50%; opacity: 0.3; }
.blob1 { width: 400px; height: 400px; background: #ffc3a0; top: -150px; left: -150px; animation: move 25s infinite alternate; }
.blob2 { width: 500px; height: 500px; background: #a8e063; bottom: -200px; right: -200px; animation: move 30s infinite alternate; }
.blob3 { width: 300px; height: 300px; background: #764ba2; bottom: 50px; left: 100px; animation: move 20s infinite alternate; }
@keyframes move { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(100px, 50px) rotate(90deg); } }

/* --- Screen & Typography --- */
.screen {
    position: absolute; width: 100%; min-height: 100%;
    padding: 25px; box-sizing: border-box;
    display: flex; flex-direction: column;
    align-items: center; text-align: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
#start-screen { justify-content: flex-start; padding-top: 40px; }
.game-screen { justify-content: flex-start; padding-top: 80px; }
.hidden { opacity: 0; transform: scale(0.97); pointer-events: none; }
.content-box { width: 100%; }
h2 { font-size: 2rem; font-weight: 800; margin-bottom: 25px; line-height: 1.3; }
h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-black); margin: 0 0 4px 0; }
h4 { font-size: 1.1rem; font-weight: 700; color: var(--subtext-gray); }
.small-text { font-size: 0.9rem; color: var(--subtext-gray); }
.error-message { color: var(--accent-red); font-weight: bold; margin-top: 10px; min-height: 1em; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- Common Components --- */
button {
    background-color: var(--signature-yellow); color: var(--text-black);
    border: none; padding: 18px 30px; font-size: 1.1rem; font-weight: 700;
    border-radius: 16px; cursor: pointer;
    transition: all 0.2s ease;
    width: 100%; box-shadow: 0 4px 15px rgba(255, 222, 0, 0.3);
}
button:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(255, 222, 0, 0.5); }
button:disabled { background-color: #ccc; color: #888; cursor: not-allowed; box-shadow: none; transform: none; }
button:disabled:hover { background-color: #ccc; box-shadow: none; transform: none; }

.back-btn {
    position: absolute; top: 20px; left: 20px;
    background: rgba(224, 224, 224, 0.7); color: #333;
    width: 40px; height: 40px; padding: 0; font-size: 1.5rem; line-height: 40px; text-align: center;
    z-index: 5; border-radius: 50%; border: none;
    cursor: pointer; transition: background-color 0.2s; box-shadow: none;
}
.back-btn:hover { background: #ccc; transform: none; box-shadow: none; }

.name-input-wrapper { display: flex; gap: 10px; margin-bottom: 15px; width: 100%; }
.participant-input { flex-grow: 1; border: 2px solid #ddd; border-radius: 12px; padding: 12px; font-size: 1rem; }
.add-participant-btn {
    flex-shrink: 0; width: 50px; height: 50px;
    padding: 0; font-size: 2rem; line-height: 50px;
    border-radius: 12px;
}

.name-tags { margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
.name-tag {
    background-color: var(--text-black); color: white; padding: 8px 12px; border-radius: 20px;
    display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
    animation: tag-pop 0.3s ease-out;
}
@keyframes tag-pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.winner-name { font-size: 2.5rem; font-weight: 900; color: var(--text-black); }
.winner-pop-animation { animation: winner-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes winner-pop { from { transform: scale(0.5) rotate(-15deg); opacity: 0; } to { transform: scale(1) rotate(0deg); opacity: 1; } }

/* --- Screen Specific Styles --- */

/* Start Screen */
.app-header {
    text-align: center; margin-bottom: 15px; width: 100%;
    animation: fadeInUp 0.5s ease-out;
}
.logo-image {
    width: 80%; max-width: 320px; height: auto;
    margin: 0 auto 10px auto; object-fit: contain;
}
.main-subtitle {
    font-size: 1rem; color: var(--subtext-gray); margin-bottom: 30px; line-height: 1.5;
    text-align: center;
    animation: fadeInUp 0.5s ease-out 0.1s;
    animation-fill-mode: both;
}
.menu-card-container { display: grid; grid-template-columns: 1fr; gap: 15px; width: 100%; }
.menu-card {
    padding: 20px; border-radius: 20px; box-shadow: 0 8px 25px rgba(0,0,0,0.07);
    cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex; align-items: center; gap: 20px;
    opacity: 0; animation: fadeInUp 0.5s ease-out; animation-fill-mode: both;
    color: white;
}
.menu-card:nth-child(1) { animation-delay: 0.2s; background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); }
.menu-card:nth-child(2) { animation-delay: 0.3s; background: linear-gradient(135deg, #a88beb 0%, #f7ce68 100%); }
.menu-card:nth-child(3) { animation-delay: 0.4s; background: linear-gradient(135deg, #5ee7df 0%, #b490ca 100%); }
.menu-card:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(0,0,0,0.1); }
.card-text { text-align: left; }
.menu-card p { font-size: 0.9rem; color: rgba(255,255,255,0.8); margin: 0; }
.menu-card h3 { color: white; }
.card-icon {
    width: 60px; height: 60px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; background-color: rgba(255,255,255,0.2);
}
.card-icon svg { color: white; width: 32px; height: 32px; }

.start-screen-footer {
    margin-top: 40px;
    width: 100%;
    animation: fadeInUp 0.5s ease-out 0.5s;
    animation-fill-mode: both;
}
.start-screen-footer hr {
    border: none;
    border-top: 1px solid #e5e8eb;
    margin-bottom: 20px;
}
.start-screen-footer .creator-info {
    font-size: 0.8rem;
    color: var(--subtext-gray);
    margin: 5px 0;
    line-height: 1.5;
}
.start-screen-footer a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-black);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}
.start-screen-footer a:hover {
    color: var(--signature-yellow);
}
.github-icon {
    width: 0.9em;
    height: 0.9em;
    vertical-align: -0.1em;
}

.location-notice {
    font-size: 0.8rem;
    color: var(--subtext-gray);
    margin: 15px 0 0 0;
    padding: 10px;
    background-color: rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 8px;
    line-height: 1.4;
}
.location-notice.small {
    margin-top: 20px;
    padding: 8px;
    font-size: 0.75rem;
}


/* Location, Category, Radius Screens */
#map { width: 100%; height: 250px; border-radius: 16px; margin-top: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
#current-location-btn { background-color: var(--text-black); color: var(--card-white); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.category-cards { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }
.card {
    background: var(--card-white); padding: 30px 20px; flex-basis: 100px; border-radius: 15px;
    font-size: 1.5rem; font-weight: 700; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer; transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.radius-control { width: 100%; margin: 20px 0; }
#radius-slider { width: 100%; cursor: pointer; }
.radius-display { font-size: 2rem; font-weight: bold; color: var(--text-black); margin-top: 10px; }
#search-btn { margin-top: 20px; width: 100%; }

/* Roulette Screen (Slot Machine) */
.slot-machine {
    display: flex; justify-content: center; align-items: center; gap: 15px;
    margin: 30px 0; width: 100%; height: 150px; background: #e0e0e0;
    border-radius: 20px; padding: 20px; box-shadow: inset 0 5px 15px rgba(0,0,0,0.1);
    position: relative; border: 4px solid #fff;
}
.slot-machine::before {
    content: ''; position: absolute; top: 50%; left: 10px; right: 10px; height: 60px; transform: translateY(-50%);
    background: rgba(255, 222, 0, 0.2); border-top: 2px solid var(--signature-yellow);
    border-bottom: 2px solid var(--signature-yellow); z-index: 1;
}
.reel { width: 100px; height: 100%; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.1); position: relative; }
.reel-container { position: absolute; top: 0; left: 0; width: 100%; }
.reel-item { width: 100%; height: 150px; font-size: 4rem; display: flex; justify-content: center; align-items: center; }

/* Result Screen */
.result-box { justify-content: center; }
#result-card {
    position: relative;
    background-color: var(--card-white); border: 1px solid #eee; padding: 20px;
    border-radius: 16px; width: 100%; box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); text-align: left;
}
.result-map-link-wrapper {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}
.result-map-link-wrapper:hover {
    transform: scale(1.05);
}
.result-card-map-link {
    width: 44px;
    height: 44px;
    background-color: #FFDE00;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.result-card-map-link svg {
    width: 24px;
    height: 24px;
}
.map-link-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--subtext-gray);
    margin-top: 4px;
}
#result-card h3 { margin: 0 0 10px 0; font-size: 1.5rem; padding-right: 60px; }
#result-card p { margin: 5px 0; color: var(--subtext-gray); }
.result-actions { display: flex; gap: 10px; width: 100%; margin-top: 20px; }
#retry-btn, #restart-btn { background-color: #4e5968; color: white; flex-grow: 1; box-shadow: 0 4px 10px rgba(78, 89, 104, 0.2); }
.mol-bbang-section { width: 100%; }
.mol-bbang-section hr { border: none; border-top: 1px solid #eee; margin: 30px 0; }

/* Game Screens */
.game-select-cards { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
.game-card {
    background: var(--card-white); padding: 20px; border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07); cursor: pointer; text-align: left;
    display: grid; grid-template-columns: 40px 1fr; align-items: center;
    gap: 10px 15px; transition: transform 0.2s, box-shadow 0.2s;
}
.game-card:hover { transform: scale(1.03); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.game-card .emoji { grid-row: 1 / 3; font-size: 2.5rem; }
.game-card .title { font-weight: 700; font-size: 1.1rem; }
.game-card .desc { font-size: 0.9rem; color: var(--subtext-gray); }
.game-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.reset-btn { background-color: #a0a0a0; color: white; }

/* Ladder Game */
.ladder-container { width: 100%; height: 300px; margin: 20px 0; position: relative; }
.ladder-content {
    width: 100%; height: 100%; background-color: var(--card-white);
    border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 20px 0; box-sizing: border-box; display: flex;
    flex-direction: column; justify-content: space-between;
}
.ladder-row { display: flex; justify-content: space-around; padding: 0 10px; }
.ladder-participant, .ladder-result { font-weight: bold; padding: 0 5px; text-align: center; }
.ladder-participant { cursor: pointer; }
.ladder-result.winner { color: var(--accent-red); }
.ladder-body { flex-grow: 1; position: relative; display: flex; justify-content: space-around; }
.ladder-vertical { width: 4px; background-color: #ccc; height: 100%; }
.ladder-rung { position: absolute; height: 4px; background-color: #ccc; }
.ladder-path { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dashoffset 1.5s cubic-bezier(0.47, 0, 0.745, 0.715); }
#ladder-result-area {
    width: 100%; margin: 20px auto 0; padding: 20px; background-color: var(--card-white);
    border-radius: 16px; box-shadow: 0 8px 25px rgba(0,0,0,0.07); text-align: left;
    transition: all 0.3s ease; transform: scale(0.95); opacity: 0; box-sizing: border-box;
}
#ladder-result-area.visible { transform: scale(1); opacity: 1; }
.result-title { font-size: 1rem; font-weight: 700; color: var(--subtext-gray); margin: 0 0 15px 0; text-align: center; }
#ladder-winner-list { display: grid; gap: 10px; }
.winner-item { display: flex; align-items: center; font-size: 1.2rem; font-weight: bold; }
.winner-item .name { flex-grow: 1; }
.winner-item .result { padding: 4px 10px; border-radius: 8px; color: var(--text-black); }
.winner-item .result.winner { background-color: var(--accent-red); color: white; }

/* Bomb Game */
.bomb-tags-container { min-height: 150px; display: flex; justify-content: center; align-items: center; border: 2px dashed #eee; padding: 15px; flex-wrap: wrap; }
.bomb-tag.active { background-color: var(--accent-red); transform: scale(1.3) rotate(5deg); animation: shake 0.3s infinite; }
.bomb-tag.winner { animation: winner-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes shake { 0% { transform: translate(1px, 1px) rotate(5deg); } 50% { transform: translate(-1px, -1px) rotate(-5deg); } 100% { transform: translate(1px, 1px) rotate(5deg); } }
#bomb-result-area { margin-top: 20px; }

/* Scratch Game */
.scratch-cards-container-div { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; }
.scratch-card-div { position: relative; width: 200px; height: 100px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); background-color: var(--card-white); }
.scratch-result-text-div { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; font-size: 2rem; font-weight: 900; color: var(--text-black); user-select: none; z-index: 1; }
.scratch-result-text-div.winner { color: var(--accent-red); }
.scratch-cover-div {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #bdbdbd; border-radius: 10px; cursor: grab; transition: opacity 0.5s ease;
    display: flex; align-items: center; justify-content: center; z-index: 2;
}
.scratch-cover-div:active { cursor: grabbing; }
.scratch-cover-text { color: white; font-size: 1.5rem; font-weight: 700; user-select: none; }

@media (min-width: 500px) {
    .app-footer {
        border-bottom-left-radius: 30px;
        border-bottom-right-radius: 30px;
    }
}

.map-search-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--card-white);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 15px;
    width: 100%;
}

#map-search-input {
    flex-grow: 1;
    border: none;
    padding: 18px 20px;
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    color: var(--text-black);
}
#map-search-input:focus {
    outline: none;
}

#map-search-btn {
    width: 60px;
    height: 58px; /* input padding(18*2) + font(16*1.25) approx */
    flex-shrink: 0;
    border: none;
    background-color: var(--signature-yellow);
    color: var(--text-black);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    transition: background-color 0.2s;
}
#map-search-btn:hover {
    background-color: #ffd000;
    transform: none;
    box-shadow: none;
}

/* Location Screen - 반경 슬라이더 스타일 */
#location-screen .radius-control-wrapper {
    width: 100%;
    margin-top: 20px;
    background: var(--card-white);
    border-radius: 16px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    box-sizing: border-box;
}
#location-screen .radius-control-wrapper hr {
    display: none;
}
#location-screen .radius-control-wrapper h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-align: left;
    color: var(--text-black);
}
#location-screen .radius-control {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}
#location-screen .radius-control #radius-slider {
    flex-grow: 1;
    margin: 0;
}
#location-screen .radius-control .radius-display {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    flex-shrink: 0;
    color: var(--subtext-gray);
}
#location-screen .radius-control .radius-display span {
    color: var(--text-black);
    font-size: 1.1rem;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* .hidden 클래스가 modal-overlay에 적용될 때 */
.modal-overlay.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.modal-content {
    background: var(--card-white);
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 85%;
    max-width: 320px;
    position: relative;
    box-sizing: border-box;
}

.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 10px 0;
    line-height: 1.3;
}

.modal-content p.modal-text {
    font-size: 1rem;
    color: var(--subtext-gray);
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-content .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #aaa;
    background: transparent;
    border: none;
    border-radius: 50%;
    box-shadow: none;
    line-height: 30px;
}
.modal-content .close-btn:hover {
    background: #f0f0f0;
    transform: none;
    box-shadow: none;
}

.modal-confirm-btn {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
}

#map-confirmation-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: 16px; /* 맵 radius와 동일하게 */
    border-bottom-right-radius: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
}

#map-confirmation-bar.visible {
    transform: translateY(0);
}

#map-confirmation-bar p {
    margin: 0;
    font-size: 0.9rem;
    flex-grow: 1;
    text-align: left;
}

#map-confirmation-bar button {
    width: auto;
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: none;
}
#map-confirmation-bar button:hover {
    transform: none;
    box-shadow: none;
}
.map-search-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--card-white);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 15px;
    width: 100%;
}

/* 새로 추가된 현위치 아이콘 버튼 */
.map-search-wrapper .icon-btn {
    width: 50px;
    height: 58px; /* input 높이와 맞춤 */
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-black);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    transition: background-color 0.2s;
}
.map-search-wrapper .icon-btn:hover {
    background-color: #f0f0f0;
    transform: none;
    box-shadow: none;
}

#map-search-input {
    flex-grow: 1;
    border: none;
    padding: 18px 0;
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    color: var(--text-black);
}
#map-search-input:focus {
    outline: none;
}

#map-search-btn {
    width: 60px;
    height: 58px;
}


#map-confirmation-bar {
    width: 100%;
    background: var(--card-white);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-top: 15px;
    padding: 15px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;

    transition: all 0.3s ease;
    transform: scale(1);
    opacity: 1;
    overflow: hidden;
}

#map-confirmation-bar.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}

#map-confirmation-bar p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-black);
    flex-grow: 1;
    text-align: left;
}

#map-confirmation-bar button {
    width: auto;
    padding: 12px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: none;
}
#map-confirmation-bar button:hover {
    transform: none;
    box-shadow: none;
}

.map-search-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--card-white);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 15px;
    width: 100%;
}


#map-search-input {
    flex-grow: 1;
    border: none;
    padding: 18px 20px; /* [수정] 패딩 복구 */
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    color: var(--text-black);
}
#map-search-input:focus {
    outline: none;
}

#map-search-btn {
    width: 60px;
    height: 58px;
    flex-shrink: 0;
    border: none;
    background-color: var(--signature-yellow);
    color: var(--text-black);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    transition: background-color 0.2s;
}
#map-search-btn:hover {
    background-color: #ffd000;
    transform: none;
    box-shadow: none;
}

#current-location-btn {
    background-color: var(--text-black);
    color: var(--card-white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-bottom: 15px; /* 지도와 간격 */
}

#map-confirmation-bar {
    width: 100%;
    background: var(--card-white);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-top: 15px;
    padding: 15px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    transform: scale(1);
    opacity: 1;
    overflow: hidden;
}
#map-confirmation-bar.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}
#map-confirmation-bar p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-black);
    flex-grow: 1;
    text-align: left;
}
#map-confirmation-bar button {
    width: auto;
    padding: 12px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: none;
}
#map-confirmation-bar button:hover {
    transform: none;
    box-shadow: none;
}

#location-screen .radius-control-wrapper {
    width: 100%;
    margin-top: 20px;
    background: var(--card-white);
    border-radius: 16px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    box-sizing: border-box;
}
#location-screen .radius-control-wrapper h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-align: left;
    color: var(--text-black);
}
#location-screen .radius-control {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}
#location-screen .radius-control #radius-slider {
    flex-grow: 1;
    margin: 0;
}
#location-screen .radius-control .radius-display {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    flex-shrink: 0;
    color: var(--subtext-gray);
}
#location-screen .radius-control .radius-display span {
    color: var(--text-black);
    font-size: 1.1rem;
}


#map-confirmation-bar {
    position: sticky;
    bottom: 15px;

    left: 25px;
    right: 25px;
    width: auto;

    z-index: 100;

    background: var(--card-white);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    margin-top: 15px;
    padding: 15px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;

    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(0) scale(1);
    opacity: 1;
}

#map-confirmation-bar.hidden {
    opacity: 0;
    transform: translateY(100px) scale(0.95);
    pointer-events: none;

}
#map-wrapper {
    position: relative;
    z-index: 0;
}


.ai-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); /* Cyan/Blue Gradient */
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.4);
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    padding: 0;
}

.ai-fab:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.6);
}

.ai-fab .sparkle-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 2px;
}

.ai-fab .ai-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: white;
}

.ai-modal {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 340px;
    height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-modal.hidden {
    opacity: 0;
    transform: scale(0.5) translateY(50px);
    pointer-events: none;
}

.ai-header {
    padding: 15px 20px;
    background: linear-gradient(90deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-title {
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 5px;
}

.close-ai-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    padding: 0;
    width: auto;
    height: auto;
    box-shadow: none;
    cursor: pointer;
}
.close-ai-btn:hover { transform: none; color: #333; }

.ai-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #fcfcfc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-message-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    max-width: 85%;
}

.ai-message-wrapper.bot {
    align-self: flex-start;
}

.ai-message-wrapper.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    background: #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ai-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.bot .ai-bubble {
    background: white;
    border: 1px solid #eee;
    border-bottom-left-radius: 4px;
    color: #333;
}

.user .ai-bubble {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.ai-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

#ai-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

#ai-input:focus {
    border-color: #4facfe;
}

#ai-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 242, 254, 0.3);
}

#ai-send-btn:disabled {
    background: #eee;
    cursor: default;
    box-shadow: none;
}