/* Heartopia Wiki Common Styles */

/* Font Import (Pretendard) - Common for all pages */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    --main-bg-color: #FFFCFD;
    /* Soft pink tint */
    --bg-gradient-start: #FFFDFB;
    --bg-gradient-end: #FFF7F2;
    --content-bg: rgba(255, 255, 255, 0.95);
    /* Slightly brighter content bg */
    --text-color: #202122;
    --header-height: 120px;
    /* Standardized padding-top for body */
    --border-color: #a7d7f9;
    --link-color: #0645ad;
    --card-bg: #ffffff;
    --filter-bg: #fff;
    --stat-label: #777;
    --stat-value: #333;
    --border-subtle: #f0f0f0;
    --header-text: #333;
    --navbar-bg: rgba(255, 255, 255, 0.97);
    --footer-bg: #f8f9fa;
    --footer-surface: #fff9fb;
    --footer-surface-end: #f7f8ff;
    --footer-text: #3f3b46;
    --footer-muted: #77727f;
    --footer-border: rgba(113, 94, 130, 0.14);
    --footer-chip: rgba(255, 255, 255, 0.72);
    --nav-hover: #f1f3f5;
    --shadow: rgba(0, 0, 0, 0.05);

    /* Flexible Variables for Modals & Special Cases */
    --modal-header-bg: linear-gradient(135deg, #4D342E, #795548);
    --modal-header-danger: linear-gradient(135deg, #d63384, #ff7f9d);
    --modal-header-text: #ffffff;
    --coupon-bg: #fff3cd;
}

[data-theme='dark'] {
    --main-bg-color: #1A1A1A;
    --bg-gradient-start: #1A1A1A;
    --bg-gradient-end: #141414;
    --content-bg: #222222;
    --text-color: #E2E2E2;
    --border-color: #333333;
    --link-color: #ff9fb1;
    --card-bg: #242424;
    --filter-bg: #2A2A2A;
    --stat-label: #A0A0A0;
    --stat-value: #E2E2E2;
    --border-subtle: #3A3A3A;
    --header-text: #EEEEEE;
    --navbar-bg: #1B1B1B;
    --footer-bg: #1A1A1A;
    --footer-surface: #211d22;
    --footer-surface-end: #1b1d26;
    --footer-text: #f1ebf0;
    --footer-muted: #aaa3ad;
    --footer-border: rgba(255, 255, 255, 0.11);
    --footer-chip: rgba(255, 255, 255, 0.055);
    --nav-hover: #292929;
    --shadow: rgba(0, 0, 0, 0.6);

    /* Flexible Variables for Modals & Special Cases */
    --modal-header-bg: linear-gradient(135deg, #2a2a2a, #1f1f1f);
    --modal-header-danger: linear-gradient(135deg, #301015, #3a151b);
    --modal-header-text: #e2e2e2;
    --coupon-bg: #2b281f;
}

/* Bootstrap 유틸리티 클래스 다크모드 오버라이드 (하드코딩 색상 → 프로젝트 변수 통일) */
[data-theme='dark'] .text-muted {
    color: var(--stat-label) !important;
}

[data-theme='dark'] .text-secondary {
    color: var(--stat-label) !important;
}



*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    padding-top: var(--header-height);
    /* Accommodate fixed header */
}

/* Common Layout Wrapper */
.mw-body {
    max-width: 1280px;
    margin: 0 auto;
    background-color: transparent;
    /* Removed background */
    border: none;
    /* Removed border */
    padding: 2em 3em;
    min-height: calc(100vh - var(--header-height));
    box-shadow: none;
    /* Removed shadow */
}

@media (max-width: 991px) {
    :root {
        --header-height: 70px;
    }

    .mw-body {
        padding: 1.5rem 1rem;
    }

    .page-header {
        margin-bottom: 20px;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }
}

/* Common Page Header Style */
.page-header {
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header h1 {
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

/* --- Wiki Common Grid & Card Layout --- */
.wiki-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.wiki-item-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 15px var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid var(--border-subtle);
}

.wiki-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #e0f2fe;
}

.wiki-item-image {
    width: 100%;
    height: 150px;
    background: var(--nav-hover);
    /* Light Blue tint default */
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Variant backgrounds for different types can be added via specific classes if needed, 
   but keeping it generic for now or overriding in page-specific logic */

.wiki-item-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;

}

.wiki-item-info {
    text-align: center;
}

.wiki-item-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--link-color);
    margin-bottom: 5px;
    text-decoration: none;
    display: block;
}

.wiki-item-name:hover {
    text-decoration: underline;
}

.wiki-item-tag {
    display: inline-block;
    background: #e0f2f1;
    color: #00796b;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    cursor: default;
    transition: all 0.2s;
    text-decoration: none;
}

.wiki-item-tag.location-link {
    cursor: pointer;
}

.wiki-item-tag.location-link:hover {
    background: #b2dfdb;
    color: #004d40;
    transform: translateY(-2px);
}

/* --- Stats Table --- */
.wiki-item-stats {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
}

.wiki-item-stats td {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.stat-label {
    color: var(--stat-label);
    font-weight: 500;
    width: 80px;
}

.stat-label.stat-label-wide {
    width: 110px;
}

.stat-value {
    color: var(--stat-value);
    font-weight: 600;
    text-align: right;
}

/* --- Filter Bar (Heartopia Style Redesign) --- */
.wiki-filter-container {
    background: var(--filter-bg);
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 5px 15px var(--shadow);
    margin-bottom: 30px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
}

.filter-top-tier {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Search Wrapper */
.search-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 15px;
    padding: 10px 15px;
    min-width: 200px;
    transition: all 0.2s;
}

.search-wrapper i {
    color: var(--stat-label);
    margin-right: 10px;
}

.search-wrapper .search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text-color);
    font-weight: 500;
}

.search-wrapper:focus-within {
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(6, 69, 173, 0.1);
}

/* Filter Button */
.btn-filter-toggle {
    background: #fff0f3;
    color: #c2185b;
    border: 1px solid #f8bbd0;
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(194, 24, 91, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-filter-toggle:hover {
    background: #fce4ec;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 24, 91, 0.12);
}

.btn-filter-toggle:active {
    transform: translateY(0);
}

[data-theme='dark'] .btn-filter-toggle {
    background: rgba(255, 159, 177, 0.1);
    color: #ff9fb1;
    border: 1px solid rgba(255, 159, 177, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-theme='dark'] .btn-filter-toggle:hover {
    background: rgba(255, 159, 177, 0.18);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Reset Circular Button */
.btn-reset-icon {
    background: #ffebee; /* Soft pinkish */
    color: #c62828;
    border: 1px solid #ffcdd2;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(198, 40, 40, 0.05);
    transition: all 0.2s ease;
}

.btn-reset-icon:hover {
    background: #ffcdd2;
    transform: translateY(-2px);
}

/* Advanced Tier */
.filter-advanced-tier {
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 20px;
    border-radius: 16px;
    padding: 24px 20px 20px;
    background: var(--nav-hover);
    position: relative;
    margin-top: 5px;
    border: 1px solid var(--border-subtle);
}

.filter-advanced-tier.show {
    display: flex;
    animation: fadeInDown 0.3s ease forwards;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 2단 분리 레이아웃용 영역 */
.advanced-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 중간 구분선 (가로) */
.advanced-divider {
    height: 1px;
    background-color: var(--border-subtle);
    width: 100%;
    margin: 5px 0;
}

.section-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--stat-label);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-label i {
    color: var(--link-color);
}

.advanced-controls-box {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

/* Unified Custom Select Pill */
.filter-select-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--card-bg);
    overflow: hidden;
    height: 40px;
    box-shadow: 0 2px 5px var(--shadow);
}

.filter-select-wrapper .prefix {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--stat-label);
    padding: 0px 10px 0px 15px;
    background: var(--filter-bg);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    height: 100%;
}

.filter-select-wrapper select {
    border: none;
    background: transparent;
    padding: 0px 30px 0px 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    outline: none;
    cursor: pointer;
    appearance: none;
    height: 100%;
    /* Custom arrow for select */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23b6b6b6%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px auto;
}

/* 펼친 옵션 팝업: 사이트 테마와 통일 (OS 다크/라이트와 무관하게 일관된 색) */
.filter-select-wrapper select option {
    color: var(--text-color);
    background-color: var(--card-bg);
}

/* 부모 필터 선택 전: 종속 드롭다운 비활성 상태 */
.filter-select-wrapper.filter-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.filter-select-wrapper.filter-disabled select {
    cursor: not-allowed;
    pointer-events: none;
}

/* iOS Toggle Drop-in for Dream Event */
.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0 15px;
    background: var(--card-bg);
    height: 40px;
    box-shadow: 0 2px 5px var(--shadow);
}

.toggle-switch-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* Standard Switch CSS updated for Heartopia */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  margin: 0;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ddd;
  transition: .4s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .slider {
  background-color: #ff80ab; /* Pinkish color for event */
}
input:checked + .slider:before {
  transform: translateX(16px);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #888;
    display: none;
}

/* --- Sort Chips (New UI) --- */
.sort-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sort-chip {
    border: none;
    background: var(--card-bg);
    color: #888;
    padding: 6px 15px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    box-shadow: 0 2px 5px var(--shadow);
}

.sort-chip:hover {
    background: var(--nav-hover);
    color: #555;
    transform: translateY(-1px);
}

.sort-chip.active {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
    font-weight: 700;
}

.sort-chip i {
    font-size: 0.8rem;
}

.vr {
    width: 1px;
    background-color: var(--border-subtle);
    height: 28px;
    display: inline-block;
}

/* --- Header Server Time & Community Weather --- */
.header-weather {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: 12px;
}

.header-daily-locations {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 13px;
    color: var(--text-color);
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    font-size: 0.72rem;
    white-space: nowrap;
}

.header-daily-location {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.header-daily-location__icon {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    object-fit: contain;
}

.header-daily-location strong {
    padding: 5px 9px;
    border: 1px solid rgba(72, 194, 193, 0.3);
    border-radius: 999px;
    color: #2f7779;
    background: rgba(72, 194, 193, 0.12);
    font-size: 0.74rem;
    line-height: 1;
}

.header-daily-location--oak strong {
    color: #875f40;
    border-color: rgba(174, 124, 80, 0.3);
    background: rgba(174, 124, 80, 0.12);
}

[data-theme='dark'] .header-daily-location--fluorite strong {
    color: #82d9d7;
    border-color: rgba(103, 214, 211, 0.34);
    background: rgba(72, 194, 193, 0.14);
}

[data-theme='dark'] .header-daily-location--oak strong {
    color: #d8ad84;
    border-color: rgba(207, 157, 111, 0.34);
    background: rgba(174, 124, 80, 0.15);
}

.header-daily-locations__admin {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    margin-left: 1px;
    color: var(--stat-label);
    border-radius: 8px;
    text-decoration: none;
}

.header-daily-locations__admin:hover,
.header-daily-locations__admin:focus-visible {
    color: #d94d88;
    background: rgba(224, 104, 155, 0.12);
}

.header-weather__button {
    display: flex;
    height: 38px;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    color: var(--text-color);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 3px 12px var(--shadow);
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    font-size: 0.76rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.header-weather__button:hover,
.header-weather__button:focus-visible,
.header-weather.is-open .header-weather__button {
    border-color: rgba(224, 104, 155, 0.52);
    box-shadow: 0 5px 18px rgba(187, 83, 130, 0.13);
}

.header-weather__button:active {
    transform: translateY(1px);
}

.header-weather__clock,
.header-weather__current {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-weather__clock {
    color: var(--stat-label);
}

.header-weather__clock i {
    color: #a88da0;
}

.header-weather__clock strong {
    color: var(--text-color);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.header-weather__current {
    min-width: 74px;
    color: var(--text-color);
    font-weight: 700;
}

.header-weather__current img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.header-weather__divider {
    width: 1px;
    height: 15px;
    background: var(--border-subtle);
}

.header-weather__chevron {
    color: var(--stat-label);
    font-size: 0.62rem;
    transition: transform 0.18s ease;
}

.header-weather.is-open .header-weather__chevron {
    transform: rotate(180deg);
}

.weather-panel {
    position: absolute;
    z-index: 1005;
    top: calc(100% + 8px);
    right: 0;
    width: min(760px, calc(100vw - 30px));
    max-height: calc(100vh - 145px);
    overflow: hidden;
    color: var(--text-color);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 22px 55px rgba(64, 48, 62, 0.2);
}

.weather-panel__header,
.weather-vote-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border-subtle);
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 159, 193, 0.14), transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(134, 158, 255, 0.12), transparent 38%);
}

.weather-panel__header p,
.weather-vote-dialog__header p {
    margin: 0 0 3px;
    color: #c05e8a;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

[data-theme='dark'] .weather-panel__header p,
[data-theme='dark'] .weather-vote-dialog__header p,
[data-theme='dark'] .weather-section__heading > span,
[data-theme='dark'] .weather-detail-card__time span {
    color: #f0a8c7;
}

.weather-panel__header h2,
.weather-vote-dialog__header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.weather-icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    color: var(--stat-label);
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.weather-icon-button:hover,
.weather-icon-button:focus-visible {
    color: var(--text-color);
    background: var(--nav-hover);
}

.weather-panel__body {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding: 22px 24px 24px;
}

.weather-section + .weather-section,
.weather-vote-section + .weather-vote-section {
    margin-top: 26px;
}

.weather-section__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.weather-section__heading h3 {
    margin: 0 0 3px;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.weather-section__heading p {
    margin: 0;
    color: var(--stat-label);
    font-size: 0.7rem;
}

.weather-section__heading > span {
    flex: 0 0 auto;
    color: #b1698b;
    font-size: 0.65rem;
    font-weight: 700;
}

.weather-detail-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 9px;
}

.weather-detail-card {
    min-width: 0;
    padding: 12px 10px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--filter-bg);
    text-align: center;
}

.weather-detail-card:first-child {
    border-color: rgba(226, 102, 155, 0.42);
    background: linear-gradient(145deg, rgba(255, 239, 246, 0.88), var(--filter-bg));
}

[data-theme='dark'] .weather-detail-card:first-child {
    background: linear-gradient(145deg, rgba(114, 47, 75, 0.22), var(--filter-bg));
}

.weather-detail-card__time span,
.weather-detail-card__time strong {
    display: block;
}

.weather-detail-card__time span {
    margin-bottom: 2px;
    color: #b75e88;
    font-size: 0.62rem;
    font-weight: 750;
}

.weather-detail-card__time strong {
    color: var(--text-color);
    font-size: 0.7rem;
}

.weather-detail-card__weather {
    display: grid;
    min-height: 70px;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 8px 0 5px;
}

.weather-detail-card__icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.weather-detail-card__weather strong {
    color: var(--text-color);
    font-size: 0.75rem;
}

.weather-detail-card__weather small {
    color: #ae708d;
    font-size: 0.55rem;
}

.weather-detail-card > span {
    display: block;
    overflow: hidden;
    color: var(--stat-label);
    font-size: 0.57rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-detail-card.is-empty .weather-detail-card__weather strong,
.weather-detail-card.is-tied .weather-detail-card__weather strong,
.weather-day-card.is-empty strong,
.weather-day-card.is-tied strong {
    color: var(--stat-label);
}

.weather-week-list {
    display: grid;
    grid-template-columns: repeat(7, minmax(70px, 1fr));
    gap: 8px;
}

.weather-day-card {
    display: grid;
    min-width: 0;
    place-items: center;
    gap: 2px;
    padding: 9px 5px 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--filter-bg);
}

.weather-day-card > span {
    color: var(--text-color);
    font-size: 0.67rem;
    font-weight: 750;
}

.weather-day-card > small {
    color: var(--stat-label);
    font-size: 0.55rem;
}

.weather-day-card__icon {
    width: 27px;
    height: 27px;
    margin: 4px 0 2px;
    object-fit: contain;
}

.weather-day-card > strong {
    overflow: hidden;
    max-width: 100%;
    color: var(--text-color);
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-panel__footer {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--filter-bg);
}

.weather-panel__footer p {
    margin: 0;
    color: var(--stat-label);
    font-size: 0.68rem;
}

.weather-primary-button,
.weather-secondary-button,
.weather-login-link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 16px;
    border-radius: 11px;
    font-size: 0.76rem;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.weather-primary-button {
    color: #fff;
    border: 1px solid #d65b91;
    background: linear-gradient(135deg, #e56d9f, #c94f84);
    box-shadow: 0 7px 16px rgba(195, 72, 126, 0.2);
}

.weather-primary-button:hover,
.weather-primary-button:focus-visible {
    color: #fff;
    filter: brightness(1.04);
}

.weather-primary-button:disabled {
    opacity: 0.48;
    box-shadow: none;
    cursor: not-allowed;
}

.weather-secondary-button {
    color: var(--text-color);
    border: 1px solid var(--border-subtle);
    background: var(--card-bg);
}

.weather-login-link {
    color: #b24d7b;
    border: 1px solid rgba(210, 90, 143, 0.24);
    background: rgba(255, 235, 244, 0.58);
}

[data-theme='dark'] .weather-login-link {
    color: #eba4c2;
    background: rgba(139, 54, 92, 0.16);
}

.weather-empty-message {
    grid-column: 1 / -1;
    margin: 0;
    padding: 28px;
    color: var(--stat-label);
    border: 1px dashed var(--border-subtle);
    border-radius: 14px;
    font-size: 0.78rem;
    text-align: center;
}

.weather-vote-modal {
    position: fixed;
    z-index: 2100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.weather-vote-modal[hidden],
.weather-panel[hidden] {
    display: none;
}

.weather-vote-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(24, 18, 23, 0.62);
    backdrop-filter: blur(5px);
}

.weather-vote-dialog {
    position: relative;
    display: flex;
    width: min(920px, 100%);
    max-height: min(840px, calc(100vh - 48px));
    flex-direction: column;
    overflow: hidden;
    color: var(--text-color);
    border: 1px solid var(--border-subtle);
    border-radius: 22px;
    background: var(--card-bg);
    box-shadow: 0 28px 80px rgba(19, 14, 18, 0.35);
}

.weather-vote-dialog__body {
    overflow-y: auto;
    padding: 22px 24px 28px;
}

.weather-vote-guide {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    padding: 11px 13px;
    color: #8a5a71;
    border: 1px solid rgba(210, 99, 146, 0.18);
    border-radius: 12px;
    background: rgba(255, 237, 245, 0.62);
}

[data-theme='dark'] .weather-vote-guide {
    color: #d9a7bc;
    background: rgba(134, 51, 87, 0.14);
}

.weather-vote-guide p {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.55;
}

.weather-vote-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.weather-vote-row:last-child {
    border-bottom: 0;
}

.weather-vote-row__label span,
.weather-vote-row__label strong {
    display: block;
}

.weather-vote-row__label span {
    margin-bottom: 2px;
    color: #ba6089;
    font-size: 0.66rem;
    font-weight: 750;
}

.weather-vote-row__label strong {
    color: var(--text-color);
    font-size: 0.75rem;
}

.weather-choice-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(82px, 1fr));
    gap: 7px;
}

.weather-choice {
    display: flex;
    min-width: 0;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 7px;
    color: var(--stat-label);
    border: 1px solid var(--border-subtle);
    border-radius: 11px;
    background: var(--filter-bg);
    font-size: 0.68rem;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.weather-choice:hover,
.weather-choice:focus-visible {
    border-color: rgba(218, 97, 149, 0.42);
    transform: translateY(-1px);
}

.weather-choice.is-selected {
    color: #a3406f;
    border-color: rgba(215, 85, 143, 0.5);
    background: rgba(255, 232, 242, 0.72);
}

.weather-choice.is-pending {
    box-shadow: 0 0 0 2px rgba(217, 89, 145, 0.15);
}

[data-theme='dark'] .weather-choice.is-selected {
    color: #f1b1cc;
    background: rgba(136, 48, 87, 0.2);
}

.weather-choice__icon {
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    object-fit: contain;
}

.weather-vote-dialog__footer {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--filter-bg);
}

.weather-vote-dialog__footer p {
    margin: 0;
    color: var(--stat-label);
    font-size: 0.72rem;
}

.weather-vote-dialog__footer > div {
    display: flex;
    gap: 8px;
}

body.weather-modal-open {
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .nav-bar .navbar-nav {
        width: auto;
        min-width: 0;
    }

    .header-weather {
        position: sticky;
        right: 0;
        margin-left: 6px;
        padding-left: 8px;
        background: linear-gradient(90deg, transparent, var(--navbar-bg) 18%);
    }

    .header-weather__button {
        box-shadow: 0 3px 14px var(--shadow);
    }

}

@media (max-width: 767.98px) {
    .header-daily-locations {
        gap: 9px;
    }

    .header-weather__button {
        gap: 7px;
        padding: 0 9px;
    }

    .header-weather__clock > span,
    .header-weather__divider {
        display: none;
    }

    .header-weather__current {
        min-width: 0;
    }

    .weather-panel {
        position: fixed;
        top: calc(var(--header-height) + 6px);
        right: 10px;
        left: 10px;
        width: auto;
        max-height: calc(100vh - var(--header-height) - 16px);
        border-radius: 17px;
    }

    .weather-panel__header,
    .weather-vote-dialog__header {
        padding: 18px 18px 15px;
    }

    .weather-panel__body {
        max-height: calc(100vh - var(--header-height) - 165px);
        padding: 18px;
    }

    .weather-detail-list,
    .weather-week-list {
        display: flex;
        overflow-x: auto;
        padding-bottom: 5px;
        scroll-snap-type: x proximity;
    }

    .weather-detail-card {
        min-width: 112px;
        scroll-snap-align: start;
    }

    .weather-day-card {
        min-width: 76px;
        scroll-snap-align: start;
    }

    .weather-panel__footer {
        padding: 11px 18px;
    }

    .weather-vote-modal {
        align-items: end;
        padding: 0;
    }

    .weather-vote-dialog {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 22px 22px 0 0;
    }

    .weather-vote-dialog__body {
        padding: 18px;
    }

    .weather-vote-row {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .weather-choice-list {
        display: flex;
        overflow-x: auto;
        padding: 2px 1px 5px;
    }

    .weather-choice {
        min-width: 86px;
    }

    .weather-vote-dialog__footer {
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
        padding: 12px 18px max(14px, env(safe-area-inset-bottom));
    }

    .weather-vote-dialog__footer > div {
        display: grid;
        grid-template-columns: 0.75fr 1.25fr;
    }
}

@media (max-width: 479.98px) {
    .header-daily-locations {
        gap: 6px;
        padding: 0 7px;
    }

    .header-daily-location strong {
        max-width: 62px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-weather__current span,
    .header-weather__chevron {
        display: none;
    }

    .header-weather__current img {
        width: 24px;
        height: 24px;
    }

    .weather-section__heading {
        align-items: flex-start;
    }

    .weather-panel__footer p {
        display: none;
    }

    .weather-panel__footer .weather-primary-button,
    .weather-panel__footer .weather-login-link {
        width: 100%;
    }
}

/* --- Site Footer --- */
.site-footer {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin-top: 72px;
    color: var(--footer-text);
    background: linear-gradient(115deg, var(--footer-surface) 0%, var(--footer-surface-end) 100%);
    border-top: 1px solid var(--footer-border);
}

.site-footer__glow {
    position: absolute;
    z-index: -1;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    filter: blur(12px);
    opacity: 0.42;
    pointer-events: none;
}

.site-footer__glow--left {
    top: -250px;
    left: -120px;
    background: radial-gradient(circle, rgba(255, 165, 198, 0.45), transparent 68%);
}

.site-footer__glow--right {
    right: -110px;
    bottom: -270px;
    background: radial-gradient(circle, rgba(138, 162, 255, 0.36), transparent 68%);
}

[data-theme='dark'] .site-footer__glow {
    opacity: 0.18;
}

.site-footer__container {
    width: min(1160px, calc(100% - 48px));
    margin: 0 auto;
}

.site-footer__main {
    display: grid;
    grid-template-columns: minmax(300px, 1.35fr) minmax(440px, 1fr);
    gap: clamp(56px, 8vw, 112px);
    padding: 58px 0 46px;
}

.site-footer__brand-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--footer-text);
    text-decoration: none;
}

.site-footer__brand-link:hover {
    color: var(--footer-text);
}

.site-footer__logo {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.52);
    box-shadow: 0 10px 28px rgba(113, 82, 113, 0.13);
}

[data-theme='dark'] .site-footer__logo {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.site-footer__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-footer__brand-link strong {
    display: block;
    margin-bottom: 2px;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.045em;
}

.site-footer__brand-link small {
    display: block;
    color: #b56f92;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

[data-theme='dark'] .site-footer__brand-link small {
    color: #e19bbb;
}

.site-footer__description {
    max-width: 440px;
    margin: 22px 0 0;
    color: var(--footer-muted);
    font-size: 0.95rem;
    line-height: 1.75;
    letter-spacing: -0.015em;
}

.site-footer__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(170px, 1fr));
    gap: clamp(36px, 5vw, 64px);
}

.site-footer__eyebrow {
    margin: 0 0 5px;
    color: #bb7297;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

[data-theme='dark'] .site-footer__eyebrow {
    color: #d794b3;
}

.site-footer__nav-group h2 {
    margin: 0 0 16px;
    color: var(--footer-text);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.site-footer__nav-group a {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 9px;
    margin: 0 0 11px;
    color: var(--footer-muted);
    font-size: 0.86rem;
    font-weight: 550;
    text-decoration: none;
    transition: color 0.18s ease, transform 0.18s ease;
}

.site-footer__nav-group a i {
    width: 16px;
    color: #aa9ead;
    font-size: 0.78rem;
    text-align: center;
    transition: color 0.18s ease;
}

.site-footer__nav-group a:hover,
.site-footer__nav-group a:focus-visible {
    color: #a94878;
    transform: translateX(3px);
}

.site-footer__nav-group a:hover i,
.site-footer__nav-group a:focus-visible i {
    color: #cf6e9d;
}

[data-theme='dark'] .site-footer__nav-group a:hover,
[data-theme='dark'] .site-footer__nav-group a:focus-visible {
    color: #f0aac9;
}

.site-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 22px 0 26px;
    border-top: 1px solid var(--footer-border);
}

.site-footer__legal {
    min-width: 0;
}

.site-footer__legal p {
    margin: 0;
    color: var(--footer-muted);
    font-size: 0.7rem;
    line-height: 1.65;
}

.site-footer__legal .site-footer__copyright {
    margin-top: 4px;
    color: var(--footer-text);
    font-weight: 650;
}

.footer-visitor-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
    padding: 9px 15px;
    border: 1px solid var(--footer-border);
    border-radius: 16px;
    background: var(--footer-chip);
    box-shadow: 0 8px 24px rgba(89, 70, 92, 0.06);
}

.footer-visitor-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-visitor-stat__icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    font-size: 0.72rem;
}

.footer-visitor-stat__icon--today {
    color: #c87a16;
    background: rgba(255, 184, 77, 0.16);
}

.footer-visitor-stat__icon--weekly {
    color: #667ed1;
    background: rgba(112, 137, 229, 0.14);
}

.footer-visitor-stat small,
.footer-visitor-stat strong {
    display: block;
    line-height: 1.15;
}

.footer-visitor-stat small {
    margin-bottom: 2px;
    color: var(--footer-muted);
    font-size: 0.6rem;
    font-weight: 650;
}

.footer-visitor-stat strong {
    color: var(--footer-text);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.footer-visitor-stats__divider {
    width: 1px;
    height: 24px;
    background: var(--footer-border);
}

@media (max-width: 767.98px) {
    .site-footer {
        margin-top: 52px;
    }

    .site-footer__container {
        width: min(100% - 32px, 560px);
    }

    .site-footer__main {
        grid-template-columns: 1fr;
        gap: 38px;
        padding: 42px 0 32px;
    }

    .site-footer__description {
        max-width: none;
    }

    .site-footer__nav {
        gap: 24px;
    }

    .site-footer__bottom {
        align-items: flex-start;
        flex-direction: column-reverse;
        gap: 18px;
        padding: 20px 0 24px;
    }

    .footer-visitor-stats {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 479.98px) {
    .site-footer__desktop-break {
        display: none;
    }

    .site-footer__logo {
        width: 52px;
        height: 52px;
        border-radius: 16px;
    }

    .site-footer__brand-link strong {
        font-size: 1.25rem;
    }

    .site-footer__nav {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-visitor-stats {
        gap: 12px;
        padding-inline: 12px;
    }
}

/* --- Villager Card Styles --- */
.villager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
    gap: 30px;
    padding: 20px 0;
}

.villager-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid var(--border-subtle);
    transition: transform 0.2s;
}

.villager-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.villager-header {
    background-color: #e8f5e9;
    /* Light Green background like the image */
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

[data-theme='dark'] .villager-header {
    background-color: #2d3e2d;
}

[data-theme='dark'] .villager-name {
    color: #e0e0e0;
}

.villager-avatar {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    flex-shrink: 0;
}

.villager-avatar img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.villager-title-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.villager-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #4a4a4a;
}

.villager-job {
    background-color: #c8e6c9;
    /* Darker green badge */
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
}

.villager-body {
    padding: 25px;
}

.villager-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.villager-info-list li {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #555;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

[data-theme='dark'] .villager-info-list li {
    color: #ccc;
}

.villager-info-list li i {
    margin-top: 4px;
    /* Align icon with text */
    width: 20px;
    text-align: center;
}

.villager-info-list li strong {
    color: #333;
    font-weight: 700;
    min-width: 70px;
    /* Align values */
}

/* Tags for Gifts */
.villager-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.villager-tag {
    background: #ffebee;
    color: #c62828;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Specific styling for tag variations if needed later */
.villager-tag:nth-child(even) {
    background: #e0f2f1;
    color: #00695c;
}

.villager-tag:nth-child(3n) {
    background: #f3e5f5;
    color: #7b1fa2;
}

.villager-footer {
    padding: 0 25px 25px;
}

.full-profile-link {
    color: #ff80ab;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
}

.full-profile-link:hover {
    color: #f50057;
    text-decoration: underline;
}

/* --- Interactive NPC Card Styles (Collapsible) --- */
.npc-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    position: relative;
    /* Elastic height for grid alignment */
    display: flex;
    flex-direction: column;
    /* height: 100%; Removed to allow expansion */
}

.npc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.npc-header {
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.npc-avatar {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: #f5f5f5;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.npc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.npc-info {
    flex-grow: 1;
}

.npc-name-group {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.npc-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0;
}

.npc-subtitle {
    font-size: 0.95rem;
    color: #ff8a80;
    /* Pinkish tone */
    font-weight: 600;
}

.npc-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.npc-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-guide {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-shop {
    background: #fff3e0;
    color: #f57c00;
}

.badge-event {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-quest {
    background: #e8f5e9;
    color: #2e7d32;
}

.npc-meta {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-row i {
    width: 16px;
    text-align: center;
    color: #999;
}

/* Toggle Button */
.npc-toggle-btn {
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid #eee;
    padding: 12px;
    color: #ff8a80;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.npc-toggle-btn:hover {
    background: #fff5f5;
    color: #ff5252;
}

/* Icon rotation when expanded */
.npc-toggle-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.npc-toggle-btn i {
    transition: transform 0.3s;
}

/* Expanded Details Section */
.npc-details-inner {
    padding: 20px;
    background: #fafafa;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Role Blocks */
.role-block {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.role-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.role-icon {
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.role-content {
    flex: 1;
}

.role-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 5px;
}

.role-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.item-badge {
    display: inline-block;
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: #555;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Gift Boxes */
.gift-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 5px;
}

.gift-box {
    padding: 12px;
    border-radius: 12px;
    height: 100%;
}

.gift-box.loved {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

[data-theme='dark'] .gift-box.loved {
    background: #1e2e1e;
    border-color: #2d4d2d;
}

.gift-box.disliked {
    background: #ffebee;
    border: 1px solid #ffcdd2;
}

[data-theme='dark'] .gift-box.disliked {
    background: #3a1e1e;
    border-color: #5a2a2a;
}

.gift-header {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gift-box.loved .gift-header {
    color: #2e7d32;
}

.gift-box.disliked .gift-header {
    color: #c62828;
}

.gift-content {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

/* Responsive Gift Section */
@media (max-width: 450px) {
    .gift-section {
        grid-template-columns: 1fr;
    }
}

/* --- View Toggle Buttons --- */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--nav-hover);
    border-radius: 10px;
    padding: 3px;
}

.view-toggle-btn {
    border: none;
    background: transparent;
    color: #999;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    color: #666;
    background: rgba(0, 0, 0, 0.05);
}

.view-toggle-btn.active {
    background: var(--card-bg);
    color: var(--link-color);
    box-shadow: 0 1px 3px var(--shadow);
}

[data-theme='dark'] .view-toggle-btn.active {
    background: #555;
    color: #a0cfff;
}

/* --- Wiki Table View --- */
.wiki-table-container {
    display: none;
    margin-bottom: 40px;
}

.wiki-table-container.active {
    display: block;
}

.wiki-grid-layout.hidden {
    display: none !important;
}

.wiki-table-layout {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid var(--border-subtle);
}

.wiki-table-layout thead th {
    background: var(--nav-hover);
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--stat-label);
    text-align: left;
    border-bottom: 2px solid var(--border-subtle);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.wiki-table-layout tbody tr {
    transition: background 0.15s;
}

.wiki-table-layout tbody tr:hover {
    background: var(--nav-hover);
}

.wiki-table-layout tbody td {
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.wiki-table-layout tbody tr:last-child td {
    border-bottom: none;
}

.wiki-table-layout .table-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--nav-hover);
    padding: 2px;
}

.wiki-table-layout .table-thumb-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--nav-hover);
    color: #ccc;
    font-size: 1.2rem;
}

.wiki-table-layout .table-name-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
}

.wiki-table-layout .table-name-link:hover {
    text-decoration: underline;
}

.wiki-table-layout .table-location-link {
    color: #00796b;
    text-decoration: none;
    font-size: 0.85rem;
}

.wiki-table-layout .table-location-link:hover {
    text-decoration: underline;
    color: #004d40;
}

.wiki-table-layout .table-price {
    font-weight: 600;
    color: var(--stat-value);
}

/* Responsive Table */
@media (max-width: 768px) {
    .wiki-table-layout {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wiki-table-layout thead th,
    .wiki-table-layout tbody td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .wiki-table-layout .table-thumb {
        width: 32px;
        height: 32px;
    }

    .wiki-table-layout .table-thumb-placeholder {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .search-input {
        max-width: 100%;
    }

    .view-toggle {
        align-self: center;
    }
}

/* ==========================================
   모바일 최적화 (480px 이하 - 소형 스마트폰)
   ========================================== */
@media (max-width: 480px) {
    .mw-body {
        padding: 1rem 0.75rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .wiki-grid-layout {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .wiki-item-card {
        padding: 14px;
        border-radius: 14px;
    }

    .wiki-item-image {
        height: 110px;
    }

    .wiki-item-image img {
        width: 85px;
        height: 85px;
    }

    .wiki-item-name {
        font-size: 1rem;
    }

    .wiki-item-stats {
        font-size: 0.82rem;
    }

    .filter-bar {
        padding: 14px;
        gap: 10px;
    }

    .villager-grid {
        gap: 16px;
    }

    .villager-header {
        padding: 16px;
        gap: 14px;
    }

    .villager-name {
        font-size: 1.2rem;
    }

    .villager-body {
        padding: 16px;
    }

    .sort-chip {
        padding: 5px 8px;
        font-size: 0.82rem;
    }

    /* 정렬+뷰+초기화 행이 넘칠 경우 가로 스크롤 처리 */
    .d-flex.align-items-center.gap-2 {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        max-width: 100%; /* 화면 밖으로 넘침 방지 */
    }
}

/* ==========================================
   Multi-Select Custom Dropdown (Premium)
   ========================================== */
.filter-multi-select-wrapper {
    position: relative;
    display: flex;
    overflow: visible;
    z-index: 20;
}

.filter-select-wrapper.filter-multi-select-wrapper .multi-select-trigger {
    border: 0;
    border-radius: 0 12px 12px 0;
    box-shadow: none;
    height: 100%;
    background: transparent;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--card-bg);
    min-width: 110px;
    height: 40px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px var(--shadow);
}

.multi-select-trigger:hover {
    border-color: var(--link-color);
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1050;
    min-width: 150px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: 0 10px 30px var(--shadow);
    padding: 8px 0;
    display: none;
    backdrop-filter: blur(10px);
}

.multi-select-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-opt {
    padding: 6px 14px;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.dropdown-opt:hover {
    background: var(--nav-hover);
}

.dropdown-opt label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    width: 100%;
    margin: 0;
}

.dropdown-opt input[type="checkbox"] {
    accent-color: var(--link-color);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.dropdown-div {
    height: 1px;
    background: var(--border-subtle);
    margin: 6px 0;
}
