:root {
    --quest-primary: #7a3b2e;
    --quest-primary-dark: #5c2b21;
    --quest-accent: #d99b3b;
    --quest-accent-light: #f0c27b;
    --quest-bg: #f7f2ec;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
}

body {
    background-color: var(--quest-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Контент растягивается на всё свободное место между шапкой и подвалом,
   поэтому коричневый футер всегда "прилипает" к низу экрана без белых зазоров */
.page-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}
.page-main > * { flex-shrink: 0; }
.page-main > .auth-bg,
.page-main > .quest-bg {
    flex: 1 0 auto;
}

.page-fade { animation: pageFadeIn .5s ease both; }

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

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(18px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217,155,59,.55); }
    50% { box-shadow: 0 0 0 10px rgba(217,155,59,0); }
}

@keyframes softBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(540deg); opacity: 0; }
}

/* ---------- Кнопки ---------- */
.btn-quest, .btn-outline-quest {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.btn-quest {
    background: linear-gradient(135deg, var(--quest-primary), var(--quest-primary-dark));
    border-color: var(--quest-primary);
    color: #fff;
    font-weight: 600;
    letter-spacing: .5px;
    box-shadow: 0 3px 10px rgba(122,59,46,.25);
}
.btn-quest:hover {
    background: linear-gradient(135deg, var(--quest-primary-dark), var(--quest-primary));
    border-color: var(--quest-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(122,59,46,.35);
}
.btn-quest:active { transform: translateY(0) scale(.98); }

.btn-outline-quest {
    border-color: var(--quest-primary);
    color: var(--quest-primary);
    font-weight: 600;
    background: transparent;
}
.btn-outline-quest:hover {
    background-color: var(--quest-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(122,59,46,.25);
}

/* Ripple effect (triggered via main.js) */
.btn-quest .ripple, .btn-outline-quest .ripple, .btn-hint .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: rippleAnim .55s ease-out;
    background: rgba(255,255,255,.55);
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(3); opacity: 0; }
}

/* ---------- Навигация ---------- */
.quest-navbar {
    background: linear-gradient(120deg, var(--quest-primary), var(--quest-primary-dark));
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.quest-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--quest-accent);
    box-shadow: 0 0 0 3px rgba(217,155,59,.25);
    transition: transform .3s ease;
}
.navbar-brand:hover .brand-logo { transform: rotate(-8deg) scale(1.08); }
.quest-navbar .nav-link {
    color: rgba(255,255,255,.85);
    position: relative;
    transition: color .2s ease;
}
.quest-navbar .nav-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 2px;
    background: var(--quest-accent);
    transition: width .25s ease;
}
.quest-navbar .nav-link.active,
.quest-navbar .nav-link:hover {
    color: #fff;
    font-weight: 600;
}
.quest-navbar .nav-link.active::after,
.quest-navbar .nav-link:hover::after { width: 100%; }

/* ---------- Splash / загрузочный экран ---------- */
.splash-screen {
    min-height: 100vh;
    background: linear-gradient(rgba(20,10,5,.55), rgba(20,10,5,.75)),
                url('../images/city-bg.jpg') center/cover no-repeat;
    background-color: #3a2318;
    position: relative;
    overflow: hidden;
}
.splash-screen::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(217,155,59,.18), transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(217,155,59,.12), transparent 45%);
    animation: softBounce 6s ease-in-out infinite;
}
.splash-content { position: relative; z-index: 1; animation: floatUp .8s ease both; }
.splash-eyebrow {
    letter-spacing: 3px;
    font-size: .95rem;
    opacity: .85;
}
.splash-title {
    font-weight: 800;
    font-size: 2.2rem;
    max-width: 700px;
    margin: 0 auto;
}
.splash-city {
    font-weight: 800;
    color: var(--quest-accent);
    letter-spacing: 4px;
    margin-top: 1rem;
    animation: softBounce 3s ease-in-out infinite;
}

/* ---------- Hero (главная) ---------- */
.hero-block {
    background: linear-gradient(rgba(20,10,5,.5), rgba(20,10,5,.7)),
                url('../images/city-bg.jpg') center/cover no-repeat;
    background-color: var(--quest-primary);
    position: relative;
}

.feature-card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    border-radius: 16px;
    transition: transform .25s ease, box-shadow .25s ease;
    animation: floatUp .5s ease both;
}
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 30px rgba(122,59,46,.18);
}
.feature-icon {
    font-size: 2.6rem;
    margin-bottom: .5rem;
    display: inline-block;
    transition: transform .3s ease;
}
.feature-card:hover .feature-icon { transform: scale(1.15) rotate(-6deg); }

/* ---------- Auth (фон авторизации/регистрации) ---------- */
.auth-bg {
    min-height: 0;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(20,10,5,.72), rgba(92,43,33,.72)),
                url('../images/city-bg.jpg') center/cover no-repeat;
}
.auth-bg::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(217,155,59,.25) 0, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(217,155,59,.18) 0, transparent 40%);
    animation: softBounce 7s ease-in-out infinite;
}
.auth-card {
    border: none;
    border-radius: 20px;
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(6px);
    box-shadow: 0 20px 45px rgba(0,0,0,.35);
    animation: floatUp .6s ease both;
}
.auth-card .card-body h2 {
    color: var(--quest-primary);
    font-weight: 800;
}
.auth-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--quest-accent), var(--quest-primary));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto .75rem;
    color: #fff;
    box-shadow: 0 6px 16px rgba(122,59,46,.35);
    animation: softBounce 3s ease-in-out infinite;
}
.success-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 1rem;
    color: #fff;
    box-shadow: 0 8px 20px rgba(46,125,50,.4);
    animation: floatUp .5s ease both, softBounce 2.4s ease-in-out .5s infinite;
}

/* ---------- Карта ---------- */
#quest-map {
    height: 460px;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0,0,0,.12);
    border: 3px solid #fff;
}
.leaflet-control-attribution { font-size: 10px; opacity: .75; }

.route-btns .btn { border-radius: 30px; font-weight: 600; font-size: .85rem; }
.route-btns .btn.active-route {
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
}

.quest-route-anim, .quest-progress-line { animation: dashMove 1s linear infinite; }
@keyframes dashMove { to { stroke-dashoffset: -100; } }

.map-legend {
    display: flex; flex-wrap: wrap; gap: 1rem;
    font-size: .85rem;
    color: #6b5b4f;
}
.map-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

.location-card-compact .card-body { padding: .5rem .75rem; }
.location-cards-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}
.location-cards-scroll::-webkit-scrollbar { width: 6px; }
.location-cards-scroll::-webkit-scrollbar-thumb { background: var(--quest-accent); border-radius: 4px; }

.reviews-scroll {
    max-height: 560px;
    overflow-y: auto;
    padding-right: 8px;
}
.reviews-scroll::-webkit-scrollbar { width: 6px; }
.reviews-scroll::-webkit-scrollbar-thumb { background: var(--quest-accent); border-radius: 4px; }

.location-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: transform .22s ease, box-shadow .22s ease;
    overflow: hidden;
}
.location-card:hover { transform: translateY(-5px); box-shadow: 0 14px 26px rgba(0,0,0,.12); }
.location-card.status-locked { opacity: .65; }
.location-card.status-completed { border-left: 5px solid #2e7d32; background: linear-gradient(90deg, rgba(46,125,50,.06), transparent 30%); }
.location-card.status-unlocked { border-left: 5px solid var(--quest-accent); background: linear-gradient(90deg, rgba(217,155,59,.08), transparent 30%); }

/* Leaflet marker divIcons — крупные "стикеры" с эффектами */
.quest-sticker {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 54px; height: 54px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,.35);
    animation: stickerPop .4s cubic-bezier(.34,1.56,.64,1) both;
}
.quest-sticker::after {
    content: '';
    position: absolute; left: 50%; bottom: -9px;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 9px solid #fff;
}
.sticker-emoji { font-size: 1.7rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
@keyframes stickerPop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}
.sticker-locked {
    background: linear-gradient(145deg, #b0b0b0, #7d7d7d);
    filter: saturate(.6);
}
.sticker-unlocked {
    background: linear-gradient(145deg, var(--quest-accent-light), var(--quest-accent), var(--quest-primary));
    animation: stickerPop .4s cubic-bezier(.34,1.56,.64,1) both, pulseGlow 1.7s ease-in-out infinite;
}
.sticker-completed {
    background: linear-gradient(145deg, #81c784, #43a047, #2e7d32);
    box-shadow: 0 6px 16px rgba(46,125,50,.5);
}
.quest-marker-wrap:hover .quest-sticker { transform: scale(1.15); z-index: 1000; }

.location-photo { max-height: 340px; object-fit: cover; cursor: zoom-in; transition: filter .2s ease; }
.location-photo:hover { filter: brightness(1.05); }

.fun-fact-card {
    background: #fdf1de;
    border-left: 4px solid var(--quest-accent);
    border-radius: 12px;
    position: relative;
    animation: floatUp .5s ease both;
}

/* Сравнение "до / после" */
.compare-wrap {
    position: relative;
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    border-radius: 14px;
    user-select: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.compare-wrap img {
    display: block;
    width: 100%;
    object-fit: cover;
    max-height: 420px;
    pointer-events: none;
}
.compare-before {
    position: absolute; top: 0; left: 0; height: 100%;
    overflow: hidden;
    width: 50%;
    border-right: 3px solid #fff;
}
.compare-before img { width: var(--compare-w, 100vw); max-width: none; height: 100%; }
.compare-handle {
    position: absolute; top: 50%; left: 50%;
    width: 42px; height: 42px;
    background: var(--quest-accent);
    border: 3px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex; align-items: center; justify-content: center;
    cursor: ew-resize;
    box-shadow: 0 4px 10px rgba(0,0,0,.35);
    color: #fff;
    font-weight: 700;
}
.compare-slider {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0; cursor: ew-resize;
    margin: 0;
}
.compare-label {
    position: absolute; top: 10px;
    background: rgba(0,0,0,.55);
    color: #fff; padding: .25rem .7rem;
    border-radius: 20px; font-size: .75rem; letter-spacing: .5px;
}
.compare-label.then { left: 10px; }
.compare-label.now { right: 10px; }

/* ---------- Вопросы ---------- */
.quest-bg {
    background: linear-gradient(180deg, rgba(247,242,236,1), rgba(240,194,123,.15)),
                url('../images/city-bg.jpg') center/cover no-repeat;
    position: relative;
    min-height: 0;
    flex: 1 0 auto;
}
.quest-bg::before {
    content: '';
    position: absolute; inset: 0;
    background: rgba(247,242,236,.88);
}
.quest-bg > .container { position: relative; z-index: 1; }

.quest-option {
    border: 1px solid #e2d9cd;
    border-radius: 12px;
    padding: .65rem 1rem;
    transition: border-color .2s ease, background-color .2s ease, transform .15s ease;
    cursor: pointer;
}
.quest-option:hover { border-color: var(--quest-accent); background: #fdf6ea; transform: translateX(3px); }
.quest-option.selected { border-color: var(--quest-primary); background: #f6e9de; }

.hint-levels { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-hint {
    position: relative; overflow: hidden;
    border-radius: 30px;
    font-weight: 600;
    font-size: .85rem;
    transition: transform .18s ease, box-shadow .18s ease;
}
.btn-hint:hover { transform: translateY(-2px); }
.btn-hint.level-easy { border-color: #66bb6a; color: #2e7d32; }
.btn-hint.level-easy:hover { background: #66bb6a; color: #fff; }
.btn-hint.level-medium { border-color: #ffa726; color: #e65100; }
.btn-hint.level-medium:hover { background: #ffa726; color: #fff; }
.btn-hint.level-answer { border-color: #ef5350; color: #c62828; }
.btn-hint.level-answer:hover { background: #ef5350; color: #fff; }

.hint-box { animation: floatUp .35s ease both; border-radius: 12px; }

.puzzle-strip { display: flex; gap: 4px; border-radius: 10px; overflow: hidden; }
.puzzle-tile {
    flex: 1;
    aspect-ratio: 1.4 / 1;
    background-color: #e6ddd0;
    display: flex; align-items: center; justify-content: center;
    filter: grayscale(1) brightness(.55);
    position: relative;
    transition: filter .5s ease;
}
.puzzle-tile.revealed {
    filter: none;
    animation: puzzleReveal .6s ease both;
}
.puzzle-lock { font-size: 1.3rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
@keyframes puzzleReveal {
    0% { filter: grayscale(1) brightness(.55); transform: scale(.9); }
    60% { transform: scale(1.05); }
    100% { filter: none; transform: scale(1); }
}

/* ---------- Результаты ---------- */
.result-card { border: none; border-radius: 24px; animation: floatUp .5s ease both; }
.stat-box { background: #f7f2ec; border-radius: 12px; padding: .85rem; transition: transform .2s ease; }
.stat-box:hover { transform: translateY(-3px); }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--quest-primary); }
.stat-label { font-size: .8rem; color: #888; }
.title-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--quest-accent), var(--quest-accent-light));
    color: #402400;
    font-weight: 700;
    padding: .6rem 1.2rem;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(217,155,59,.35);
}

/* ---------- История ---------- */
.history-timeline { position: relative; padding-left: 2rem; }
.history-timeline::before {
    content: '';
    position: absolute; left: 10px; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--quest-accent), var(--quest-primary));
    border-radius: 3px;
}
.history-event { position: relative; margin-bottom: 1.75rem; animation: floatUp .5s ease both; }
.history-event::before {
    content: '';
    position: absolute; left: -2.02rem; top: .3rem;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--quest-accent);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--quest-primary);
}
.history-photo-strip { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .4rem; }
.history-photo-strip img {
    width: 140px; height: 100px; object-fit: cover; border-radius: 10px;
    flex: 0 0 auto; transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
.history-photo-strip img:hover { transform: scale(1.06) translateY(-3px); box-shadow: 0 10px 18px rgba(0,0,0,.25); }

.accordion-button:not(.collapsed) {
    background-color: rgba(217,155,59,.15);
    color: var(--quest-primary-dark);
    box-shadow: none;
}
.accordion-button:focus { box-shadow: none; border-color: var(--quest-accent); }

/* ---------- Достижения ---------- */
.achievement-card {
    border: none; border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
}
.achievement-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 16px 28px rgba(0,0,0,.14); }
.achievement-card.locked { opacity: .5; filter: grayscale(1); }
.achievement-card.earned { animation: floatUp .5s ease both; }
.achievement-icon {
    font-size: 2.8rem;
    display: inline-block;
    animation: softBounce 3s ease-in-out infinite;
}
.achievement-card.locked .achievement-icon { animation: none; }
.achievement-modal-icon {
    width: 90px; height: 90px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.6rem;
    background: linear-gradient(135deg, var(--quest-accent), var(--quest-primary));
    color: #fff;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 24px rgba(122,59,46,.35);
    animation: softBounce 2.2s ease-in-out infinite;
}

/* ---------- Профиль ---------- */
.profile-banner {
    background: linear-gradient(135deg, var(--quest-primary), var(--quest-accent));
    border-radius: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.profile-banner::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 45%);
}
.profile-avatar {
    width: 92px; height: 92px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    border: 3px solid rgba(255,255,255,.7);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; font-weight: 800;
    color: #fff;
    position: relative; z-index: 1;
}
.quest-progress-bar {
    background: linear-gradient(90deg, var(--quest-accent), var(--quest-primary));
    transition: width 1s ease;
}
.progress { border-radius: 20px; overflow: hidden; background: #efe6da; }

/* ---------- Footer ---------- */
.quest-footer { background-color: var(--quest-primary-dark); color: #fff; }

/* ---------- Общие анимации появления карточек по очереди ---------- */
.stagger > * { animation: floatUp .5s ease both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .13s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .23s; }
.stagger > *:nth-child(6) { animation-delay: .28s; }
.stagger > *:nth-child(7) { animation-delay: .33s; }

/* ---------- Админ-панель ---------- */
.admin-body { background: #f7f2ec; }

.admin-sidebar {
    width: 250px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--quest-primary-dark), #40201a);
    box-shadow: 3px 0 14px rgba(0,0,0,.15);
    position: sticky;
    top: 0;
}
.admin-sidebar h5 {
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: .5rem;
    display: flex; align-items: center; gap: .5rem;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,.78);
    padding: .65rem 1.1rem;
    border-radius: 8px;
    margin: 0 .6rem .2rem;
    transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.admin-sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, var(--quest-accent), rgba(217,155,59,.15));
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.admin-sidebar .nav-link:hover:not(.active) {
    color: #fff;
    background: rgba(255,255,255,.08);
    transform: translateX(3px);
}
.admin-sidebar .nav-divider { height: 1px; background: rgba(255,255,255,.12); margin: .75rem 1rem; }

.admin-content { max-width: none; width: 100%; }
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.admin-topbar h1 { color: var(--quest-primary-dark); margin: 0; }

/* Карточки статистики */
.stat-card {
    border: none; border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    background: #fff;
    border-left: 4px solid var(--quest-accent);
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(122,59,46,.14); }
.stat-card-value { font-size: 2rem; font-weight: 800; color: var(--quest-primary); }
.stat-card-label { color: #a08b78; letter-spacing: 1px; font-size: .78rem; text-transform: uppercase; }
.stat-card-icon {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}

/* Панели/формы */
.admin-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    border-top: 4px solid var(--quest-accent);
}
.admin-panel h5 { color: var(--quest-primary-dark); }

/* Таблицы — ровные, с фирменными цветами */
.admin-table-wrap {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    overflow: hidden;
}
table.admin-table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
table.admin-table thead th {
    background: linear-gradient(120deg, var(--quest-primary), var(--quest-primary-dark));
    color: #fff;
    font-weight: 600;
    font-size: .82rem;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: .85rem 1rem;
    border: none;
    white-space: nowrap;
    vertical-align: middle;
}
table.admin-table tbody td {
    padding: .75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0e8dc;
    font-size: .93rem;
}
table.admin-table tbody tr:last-child td { border-bottom: none; }
table.admin-table tbody tr { transition: background-color .15s ease; }
table.admin-table tbody tr:hover { background-color: #fdf6ea; }
table.admin-table tbody tr:nth-child(even) { background-color: #fbf7f1; }
table.admin-table tbody tr:nth-child(even):hover { background-color: #fdf6ea; }

.admin-scroll-table { max-height: 380px; overflow-y: auto; }
.admin-scroll-table::-webkit-scrollbar { width: 6px; }
.admin-scroll-table::-webkit-scrollbar-thumb { background: var(--quest-accent); border-radius: 4px; }

.admin-badge-guest { background: #9a9a9a; }
.admin-badge-admin { background: var(--quest-primary); }
.admin-badge-active { background: #2e7d32; }

.admin-search input { border-radius: 30px 0 0 30px; }
.admin-search button { border-radius: 0 30px 30px 0; }

@media (max-width: 767px) {
    .admin-sidebar { width: 100%; min-height: auto; position: static; }
    .d-flex.admin-shell { flex-direction: column; }
}

@media (max-width: 576px) {
    .splash-title { font-size: 1.5rem; }
    #quest-map { height: 340px; }
}

/* ---------- Настройка размера шрифта (доступность) ---------- */
html[data-fontsize="large"] { font-size: 18px; }
html[data-fontsize="xlarge"] { font-size: 21px; }

/* ---------- Тёмная тема ---------- */
html[data-theme="dark"] body {
    background-color: #1c1a17;
    color: #e8e3da;
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .admin-table-wrap,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .location-card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .achievement-card,
html[data-theme="dark"] .modal-content {
    background-color: #2a2622;
    color: #e8e3da;
}
html[data-theme="dark"] .text-muted { color: #a89e91 !important; }
html[data-theme="dark"] .quest-bg { background-image: none; background-color: #1c1a17; }
html[data-theme="dark"] .quest-bg::before { background: rgba(28,26,23,.9); }
html[data-theme="dark"] .fun-fact-card { background: #33291c; color: #e8e3da; }
html[data-theme="dark"] .hint-box { background: #263238 !important; color: #e8e3da; }
html[data-theme="dark"] table.admin-table tbody td { border-bottom-color: #3a352e; }
html[data-theme="dark"] table.admin-table tbody tr:nth-child(even) { background-color: #24211d; }
html[data-theme="dark"] table.admin-table tbody tr:hover { background-color: #332b22; }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background-color: #332e28;
    color: #e8e3da;
    border-color: #4a443b;
}
html[data-theme="dark"] .form-control::placeholder { color: #8a8074; }
html[data-theme="dark"] .accordion-item { background-color: #2a2622; color: #e8e3da; border-color: #3a352e; }
html[data-theme="dark"] .accordion-button { background-color: #2a2622; color: #e8e3da; }
html[data-theme="dark"] .accordion-button:not(.collapsed) { background-color: #3a2e1e; color: #f0c27b; }
html[data-theme="dark"] .quest-option { border-color: #4a443b; }
html[data-theme="dark"] .quest-option:hover { background: #33291c; }
html[data-theme="dark"] .btn-outline-quest { color: #f0c27b; border-color: #f0c27b; }
html[data-theme="dark"] .btn-outline-quest:hover { background-color: #f0c27b; color: #2a2622; }
html[data-theme="dark"] .profile-avatar { background: rgba(0,0,0,.25); }
html[data-theme="dark"] #themeToggleBtn { font-size: 1rem; }

/* v3 */
.order-list{list-style:none;padding:0;margin:0 0 .5rem}
.order-list li{display:flex;justify-content:space-between;align-items:center;gap:.5rem;padding:.5rem .75rem;margin-bottom:.4rem;background:#fff;border:1px solid #d9c9b0;border-radius:10px}
.speed-timer{color:#b36b00;font-weight:600}
.share-box canvas{max-width:100%;height:auto;border-radius:12px}
