/* File: assets/css/style.css */
:root {
    --bg-dark: #0a0a0c;
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --glass-bg: rgba(18, 18, 20, 0.88);
    --glass-border: rgba(212, 175, 55, 0.25);
    
    /* Màu Độ Hiếm */
    --rarity-thuong: #9ca3af;
    --rarity-hiem: #3b82f6;
    --rarity-suthi: #a855f7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.bg-shape { position: fixed; filter: blur(120px); z-index: -1; opacity: 0.3; animation: float 15s infinite ease-in-out; }
.shape-1 { width: 50vw; height: 50vw; background: #b45309; top: -10vw; left: -10vw; border-radius: 50%; }
.shape-2 { width: 40vw; height: 40vw; background: #0f766e; bottom: -5vw; right: -5vw; border-radius: 50%; }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, 30px); } }

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

@keyframes confettiFall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2000;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 16px;
    border-radius: 2px;
    animation: confettiFall 2.5s linear forwards;
}

.app-container { width: 100%; max-width: 900px; padding: 16px; margin: 0 auto; }

.header { text-align: center; margin-bottom: 18px; padding-top: 8px; }
.header h1 { margin: 0; font-size: 30px; font-weight: 800; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 0 15px var(--gold-glow); }
.header p { color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 2px; margin-top: 6px; }

/* Auth Panel & Mute Toggle */
.auth-panel { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.btn-google { background: white; color: #000; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn-google:hover { filter: brightness(0.95); }
.user-badge { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.06); padding: 5px 15px 5px 5px; border-radius: 30px; border: 1px solid var(--glass-border); }
.user-badge img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--gold); object-fit: cover; }
.user-badge span { font-size: 13px; font-weight: bold; color: var(--gold); }
.btn-mute-toggle { background: rgba(255,255,255,0.08); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.18); padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-mute-toggle:hover { border-color: var(--gold); color: #fff; }

/* Banner Thống kê cá nhân & Thời tiết */
.personal-stats-banner {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #e2e8f0;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 12px;
    text-align: center;
    margin-bottom: 14px;
}
.weather-banner {
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 14px;
}
.weather-banner.rain { background: rgba(56, 189, 248, 0.15); border: 1px solid #38bdf8; color: #bae6fd; }
.weather-banner.clear { background: rgba(212, 175, 55, 0.12); border: 1px solid rgba(212, 175, 55, 0.35); color: #fef08a; }

/* BỘ LỌC TABS GIAO DIỆN GAME */
.filter-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.15); color: var(--text-muted); padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.25s; }
.tab-btn:hover { border-color: var(--gold); color: #fff; }
.tab-btn.active { background: linear-gradient(180deg, rgba(212,175,55,0.25) 0%, rgba(0,0,0,0.85) 100%); border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }

.glass-panel { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); margin-bottom: 20px; }

/* Công tắc Chim bay vs Đường đi thực tế OSRM */
.gis-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    background: #050507;
    padding: 5px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 14px;
}
.gis-mode-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 7px;
    padding: 9px 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.gis-mode-btn.active {
    background: rgba(212, 175, 55, 0.22);
    color: var(--gold);
    border: 1px solid var(--gold);
}

.filter-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.form-group { display: flex; align-items: center; background: #000; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 4px; margin-bottom: 16px; min-width: 0; }
.form-group span { color: var(--gold); padding: 0 12px; font-weight: bold; font-size: 14px; white-space: nowrap; }
.form-control { flex: 1; width: 100%; min-width: 0; background: transparent; border: none; color: white; font-size: 16px; padding: 10px 8px; outline: none; }
.select-control { cursor: pointer; font-size: 13px; text-align: center; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.select-control option { color: #000; background: #fff; }

/* Nút chọn nhanh ngân sách */
.quick-budget-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.quick-label { font-size: 12px; color: var(--text-muted); }
.chip-budget {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.chip-budget:hover, .chip-budget.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
}
.chip-pref { border-color: #f87171; color: #fca5a5; }

.btn-gradient {
    width: 100%;
    padding: 15px 12px;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.25s;
    background: linear-gradient(90deg, #b48608, #fbf5b7, #b48608);
    color: #000;
    box-shadow: 0 0 20px var(--gold-glow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-gradient:hover:not(:disabled) { filter: brightness(1.15); }
.btn-gradient:disabled { opacity: 0.75; cursor: wait; }

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.25);
    border-top-color: #000;
    border-radius: 50%;
    animation: spinnerRotate 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.location-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(212, 175, 55, 0.35);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.btn-pick-map {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.btn-pick-map:hover { background: var(--gold); color: #000; }
.btn-group-mode { border-color: #c084fc; color: #e9d5ff; background: rgba(168, 85, 247, 0.15); }
.btn-group-mode:hover { background: #a855f7; color: #fff; }

.privacy-note {
    text-align: center;
    font-size: 11px;
    color: #cbd5e1;
    margin: 12px 0 0 0;
    line-height: 1.45;
}

.empty-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.btn-quick-fix {
    background: #1e293b;
    color: #38bdf8;
    border: 1px solid #38bdf8;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-quick-fix:hover { background: #38bdf8; color: #000; }

/* Bản đồ khám phá trên trang chủ */
.explore-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.open-now-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #4ade80;
    cursor: pointer;
}
.home-explore-map {
    height: 290px;
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    z-index: 1;
}

/* BĂNG CHUYỀN GACHA */
.gacha-window { height: 200px; border: 2px solid var(--gold); position: relative; overflow: hidden; background: #050505; border-radius: 8px; box-shadow: inset 0 0 40px rgba(0,0,0,0.9); margin-bottom: 20px; }
.target-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; background: linear-gradient(180deg, transparent, #fff, transparent); transform: translateX(-50%); z-index: 10; box-shadow: 0 0 15px #fff; }
.gacha-track { display: flex; height: 100%; width: max-content; }

.gacha-item { width: 160px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; background: #111; border-right: 1px solid #333; position: relative; flex-shrink: 0; }
.gacha-item::before { content: attr(data-rarity); position: absolute; top: 5px; left: 5px; font-size: 10px; font-weight: 800; padding: 2px 5px; border-radius: 3px; background: rgba(0,0,0,0.8); }
.gacha-item.thuong { border-top: 3px solid var(--rarity-thuong); } .gacha-item.thuong::before { color: var(--rarity-thuong); border: 1px solid var(--rarity-thuong); }
.gacha-item.hiem { border-top: 3px solid var(--rarity-hiem); background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, #111 70%); } .gacha-item.hiem::before { color: var(--rarity-hiem); border: 1px solid var(--rarity-hiem); }
.gacha-item.suthi { border-top: 3px solid var(--rarity-suthi); background: radial-gradient(circle, rgba(168,85,247,0.15) 0%, #111 70%); } .gacha-item.suthi::before { color: var(--rarity-suthi); border: 1px solid var(--rarity-suthi); }

.gacha-item img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; border: 2px solid rgba(255,255,255,0.2); }
.gacha-item .name { font-size: 14px; font-weight: bold; text-align: center; color: #fff; width: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* MODAL KẾT QUẢ VIP */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transition: 0.35s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    background: #121212;
    border: 1px solid var(--gold);
    border-radius: 12px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 22px 20px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0,0,0,0.85), 0 0 15px var(--gold-glow);
    position: relative;
    transform: scale(0.9);
    transition: 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .modal-content { transform: scale(1); }

.modal-close-x {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
}
.modal-close-x:hover { background: #ef4444; border-color: #ef4444; }

.m-title { font-size: 11px; color: var(--gold); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 6px; }
.m-name { font-size: 26px; font-weight: 800; color: #fff; margin: 0 0 6px; font-family: serif; line-height: 1.2; }
.m-price { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

.m-context-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.ctx-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 15px;
}
.ctx-badge.warning { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid #f59e0b; }
.ctx-badge.info { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; border: 1px solid #38bdf8; }

.m-img-wrapper { position: relative; width: 130px; height: 130px; margin: 0 auto 16px; }
.m-img-wrapper img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); box-shadow: 0 0 20px rgba(0,0,0,0.8); position: relative; z-index: 2; }
.m-img-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 165px; height: 165px; background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%); z-index: 1; animation: spin 4s linear infinite; }

.result-map-box {
    height: 175px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 12px;
    z-index: 1;
}

.other-restaurants-box {
    text-align: left;
    background: rgba(255,255,255,0.04);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    max-height: 115px;
    overflow-y: auto;
}

.app-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.app-btn { background: #1f1f23; border: 1px solid #3f3f46; border-radius: 8px; padding: 10px 4px; color: #fff; text-decoration: none; font-size: 12px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: 0.2s; }
.app-btn:hover { background: #27272a; border-color: var(--gold); }

.modal-extra-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.btn-sub-action {
    background: #1f2937;
    color: #e2e8f0;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
}
.btn-sub-action:hover { background: #374151; color: #fff; }

.btn-continue { width: 100%; background: linear-gradient(90deg, #b48608, #fbf5b7, #b48608); color: #000; font-weight: 800; padding: 13px; border: none; border-radius: 6px; cursor: pointer; letter-spacing: 2px; }

.nominatim-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    background: #000;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 4px;
}
.btn-search-loc {
    background: var(--gold);
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.group-members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    min-height: 28px;
}
.member-chip {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid #c084fc;
    color: #f3e8ff;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
}

/* GRID KHO PHẦN THƯỞNG */
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 20px; }
.pool-card { background: #111; border: 1px solid #333; border-radius: 10px; padding: 15px; text-align: center; position: relative; transition: 0.3s; }
.pool-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.pool-card::before { content: attr(data-rarity); position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 800; padding: 3px 6px; border-radius: 4px; background: rgba(0,0,0,0.8); z-index: 2; }
.pool-card.thuong { border-top: 3px solid var(--rarity-thuong); } .pool-card.thuong::before { color: var(--rarity-thuong); border: 1px solid var(--rarity-thuong); }
.pool-card.hiem { border-top: 3px solid var(--rarity-hiem); background: radial-gradient(circle at top, rgba(59,130,246,0.1) 0%, #111 60%); } .pool-card.hiem::before { color: var(--rarity-hiem); border: 1px solid var(--rarity-hiem); }
.pool-card.suthi { border-top: 3px solid var(--rarity-suthi); background: radial-gradient(circle at top, rgba(168,85,247,0.15) 0%, #111 60%); } .pool-card.suthi::before { color: var(--rarity-suthi); border: 1px solid var(--rarity-suthi); }

.pool-card img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.1); margin-bottom: 10px; transition: 0.3s; }
.pool-card:hover img { border-color: var(--gold); box-shadow: 0 0 15px var(--gold-glow); }
.pool-card-info h4 { margin: 0 0 5px; font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool-card-info .price { margin: 0 0 5px; font-size: 13px; color: #4ade80; font-weight: bold; }
.pool-card-info .loc { margin: 0; font-size: 12px; color: var(--text-muted); }

/* VIP PAGINATION */
.vip-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 25px; flex-wrap: wrap; }
.vip-pagination a, .vip-pagination span { padding: 8px 14px; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; text-decoration: none; color: var(--text-muted); font-size: 13px; font-weight: 600; transition: 0.25s; background: rgba(0,0,0,0.6); cursor: pointer; }
.vip-pagination a:hover { background: rgba(212,175,55,0.15); color: var(--gold); border-color: var(--gold); }
.vip-pagination .active { background: linear-gradient(180deg, #b48608, #604604); color: #fff; border-color: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }

.error-msg { color: #f87171; text-align: center; margin-top: 14px; font-weight: 600; font-size: 13px; line-height: 1.5; }

@media (max-height: 740px) {
    .m-img-wrapper { width: 95px; height: 95px; margin-bottom: 10px; }
    .m-img-glow { width: 120px; height: 120px; }
    .m-name { font-size: 22px; }
    .result-map-box { height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
    .bg-shape, .m-img-glow { animation: none !important; }
    .gacha-track { transition-duration: 0.4s !important; }
}