/* my.css - 마이페이지 (화이트 테마) */

/* ========== CSS Variables ========== */
:root {
    --bg-primary: #f7f7f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f2f2f4;
    --bg-accent: #eaeaec;
    --bg-hover: #ededef;

    --text-normal: #2d2d2d;
    --text-muted: #999999;
    --text-bright: #111111;
    --text-link: #4A55D8;

    --brand-primary: #5E6BF5;
    --brand-hover: #4B57C9;
    --status-green: #2da44e;
    --status-yellow: #c8930a;
    --status-red: #d93025;
    --status-pink: #c2185b;

    --border-color: #e5e5e7;
    --shadow: 0 1px 4px rgba(0,0,0,0.07);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 50%;
}

/* ========== Reset & Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-normal);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ========== Ghost / Hidden nodes (JS compatibility) ========== */
.ghost-node {
    display: none !important;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

/* ========== Navigation ========== */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    background-color: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo-img {
    height: 28px;
    width: auto;
    display: block;
}

.nav-logo-fallback {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 17px;
    color: var(--text-bright);
}

.nav-logo-icon {
    width: 26px;
    height: 26px;
    background: var(--brand-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: white;
}

/* Right side of nav */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-username {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-logout:hover {
    background: var(--bg-accent);
    color: var(--text-normal);
}

/* Profile Avatar in nav */
.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    transition: border-color 0.15s;
    background-size: cover;
    background-position: center;
}
.nav-avatar:hover { border-color: var(--brand-primary); }

/* ========== Login ========== */
.login-container {
    min-height: calc(100vh - 52px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-normal);
}

.form-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-normal);
    font-family: inherit;
    transition: border-color 0.15s;
    outline: none;
}
.form-input:focus { border-color: var(--brand-primary); }

.btn-login {
    background: var(--brand-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    margin-top: 4px;
}
.btn-login:hover { background: var(--brand-hover); }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== Main Container ========== */
.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 16px 100px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ========== INFO BAR ========== */
.mypage-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    margin-bottom: 20px;
}

.info-currency-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-chip {
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-chip-clickable {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: background 0.15s;
}
.info-chip-clickable:hover {
    background: var(--bg-accent);
}

.info-chip-icon {
    opacity: 0.75;
    flex-shrink: 0;
}

.info-chip-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    font-variant-numeric: tabular-nums;
}

.info-dot {
    color: var(--border-color);
    font-size: 16px;
    line-height: 1;
    margin: 0 2px;
}

/* Attendance button in info bar */
.info-attendance-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.info-attendance-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(94,107,245,0.05);
}

.info-attend-check {
    font-size: 11px;
    color: var(--status-green);
    font-weight: 700;
}

.info-attend-count {
    font-weight: 600;
    color: var(--text-normal);
}

.info-attend-chevron {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1;
}

/* ========== Section Cards ========== */
.section-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
}

.section-title-icon { font-size: 16px; }

.section-badge {
    font-size: 11px;
    background: var(--bg-accent);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 10px;
}

/* ========== Badges Card ========== */
.badges-main-card {
    /* uses .section-card */
}

/* Badge Grid - no card wrapper */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.badge-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px 0;
}

.badge-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
    aspect-ratio: 1;
}
.badge-item:hover {
    background: var(--bg-accent);
    transform: translateY(-2px);
}

.badge-item.locked {
    opacity: 0.35;
    filter: grayscale(0.6);
}
.badge-item.locked:hover { opacity: 0.45; }

.badge-rating-dot { display: none; }

.badge-icon {
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
}
.badge-icon img {
    width: 75px;
    height: 75px;
    object-fit: cover;
    border-radius: 10px;
}

/* Hide badge name entirely */
.badge-name { display: none; }

/* ========== Badge Detail Modal ========== */
.badge-detail-modal { max-width: 340px; }

.badge-detail-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
}

.badge-detail-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}
.badge-detail-icon-wrapper.locked { opacity: 0.4; filter: grayscale(1); }

.badge-detail-icon { width: 100%; height: 100%; }

.badge-detail-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-bright);
    text-align: center;
}

.badge-detail-rating {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
}

.badge-detail-lock {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 3px 10px;
    border-radius: 8px;
}
.badge-detail-owned {
    font-size: 12px;
    color: var(--status-green);
    background: rgba(87,242,135,0.1);
    padding: 3px 10px;
    border-radius: 8px;
}

.badge-detail-section { width: 100%; text-align: left; }
.badge-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.badge-detail-text {
    font-size: 13px;
    color: var(--text-normal);
    background: var(--bg-tertiary);
    padding: 8px 10px;
    border-radius: var(--radius-md);
}
.badge-detail-hidden {
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 0;
    font-style: italic;
}

/* ========== Section: Attendance ========== */
#section-attendance {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-section-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    transition: color 0.15s;
    margin-bottom: 4px;
}
.btn-section-back:hover { color: var(--text-bright); }

.attendance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .attendance-grid { grid-template-columns: 1fr; }
}

/* Week Navigator */
.week-section-header {
    flex-wrap: wrap;
    gap: 8px;
}

.week-navigator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.week-nav-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-normal);
    cursor: pointer;
    font-size: 10px;
    transition: all 0.15s;
    font-family: inherit;
}
.week-nav-btn:hover:not(:disabled) { background: var(--bg-accent); }
.week-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.week-nav-btn.today { width: auto; padding: 0 8px; font-size: 11px; }

.week-nav-input-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
}

.week-nav-input {
    width: 48px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px 6px;
    text-align: center;
    font-size: 12px;
    color: var(--text-normal);
    font-family: inherit;
    outline: none;
}

.week-nav-suffix { font-size: 11px; color: var(--text-muted); }

.week-nav-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.week-nav-date { font-size: 12px; color: var(--text-muted); }

.week-current-badge {
    font-size: 11px;
    background: rgba(87,242,135,0.15);
    color: var(--status-green);
    padding: 2px 8px;
    border-radius: 8px;
}

/* Ranking */
.ranking-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.ranking-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px 0; }

.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 13px;
}
.ranking-item.mine { background: rgba(94,107,245,0.12); }
.ranking-position { font-size: 15px; width: 24px; text-align: center; }
.ranking-name { flex: 1; }
.ranking-stats { display: flex; gap: 6px; }
.ranking-score { color: var(--text-primary); font-size: 12px; font-weight: 600; }
.ranking-count { color: var(--text-muted); font-size: 12px; }

/* Week Calendar */
.week-calendar { margin-top: 16px; margin-bottom: 12px; }
.calendar-loading { text-align: center; color: var(--text-muted); font-size: 13px; padding: 12px; }

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 11px;
}
.calendar-day.today {
    background: rgba(94,107,245,0.18);
    border: 1px solid var(--brand-primary);
}
.calendar-day.checked { background: rgba(87,242,135,0.12); }
.calendar-day.missed { opacity: 0.5; }

.calendar-day-name { font-size: 10px; color: var(--text-muted); }
.calendar-day-date { font-size: 12px; font-weight: 600; color: var(--text-normal); }
.calendar-day-status { font-size: 11px; height: 14px; }

/* Attendance check inline */
.attendance-check-inline {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.attendance-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.attendance-date-inline { font-size: 12px; color: var(--text-muted); display: block; }
.attendance-status-inline { font-size: 13px; color: var(--text-normal); }
.attendance-rank { color: var(--text-primary); font-weight: 600; }

.btn-attendance-inline {
    background: var(--brand-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s;
}
.btn-attendance-inline:hover:not(:disabled) { background: var(--brand-hover); }
.btn-attendance-inline:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-attendance-inline.checked { background: var(--bg-accent); color: var(--status-green); }

/* Attendance Stats Grid */
.attendance-stats-grid.compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
}
.stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.stat-value.streak { color: var(--text-primary); }
.stat-value.score { color: var(--text-primary); }
.stat-value.rank { color: var(--brand-primary); }

/* Today attendance list */
.attendance-today-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    margin-top: 16px;
    overflow-y: auto;
}

.attendance-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 16px 0; }

.attendance-record {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.attendance-record.mine { background: rgba(94,107,245,0.12); }
.attendance-record-rank { font-size: 14px; }
.attendance-record-name { flex: 1; }
.attendance-record-time { color: var(--text-muted); font-size: 11px; }

/* Reward Preview */
.reward-preview { display: flex; flex-direction: column; gap: 8px; }
.reward-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}
.reward-item:last-of-type { border-bottom: none; }
.reward-item.total { font-weight: 700; }
.reward-item.total .reward-value { color: var(--text-primary); }
.reward-label { color: var(--text-muted); }
.reward-value { font-weight: 600; color: var(--text-bright); }
.reward-notice { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ========== Store (hidden but styled) ========== */
.balance-bar {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.balance-bar-item { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.balance-bar-icon { display: flex; align-items: center; }
.balance-bar-label { color: var(--text-muted); }
.balance-bar-value { font-weight: 700; color: var(--text-bright); }

.section-grid {
    display: grid;
    gap: 12px;
}

.full-width { grid-column: 1 / -1; }

.category-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.store-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.store-item:hover { background: var(--bg-accent); border-color: var(--brand-primary); }
.store-item-icon { font-size: 28px; margin-bottom: 8px; }
.store-item-icon img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; }
.store-item-name { font-size: 13px; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
.store-item-desc { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.store-item-price { font-size: 12px; font-weight: 600; color: var(--status-yellow); display: flex; align-items: center; gap: 3px; }
.store-item-category { font-size: 10px; background: var(--bg-accent); color: var(--text-muted); padding: 2px 6px; border-radius: 4px; margin-bottom: 6px; display: inline-block; }
.store-item-code { position: absolute; top: 8px; right: 8px; font-size: 10px; color: var(--text-muted); }
.store-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 24px; grid-column: 1/-1; }

/* Inventory */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
}

.inventory-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.inventory-grid-item:hover { background: var(--bg-accent); border-color: var(--brand-primary); }
.inventory-grid-item-icon { font-size: 24px; }
.inventory-grid-item-icon img { width: 32px; height: 32px; object-fit: contain; border-radius: 4px; }
.inventory-grid-item-name { font-size: 11px; color: var(--text-muted); }
.inventory-grid-item-qty { font-size: 10px; color: var(--brand-primary); font-weight: 600; }
.inventory-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px; grid-column: 1/-1; }

/* ========== Modals ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}
.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-title { font-size: 16px; font-weight: 600; color: var(--text-bright); }

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    font-family: inherit;
}
.modal-close:hover { background: var(--bg-accent); color: var(--text-normal); }

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.btn-cancel, .btn-confirm, .btn-use, .btn-sell, .btn-apply, .btn-reset, .btn-page {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    border: none;
}
.btn-cancel { background: var(--bg-accent); color: var(--text-normal); border: 1px solid var(--border-color); }
.btn-cancel:hover { background: var(--bg-hover); }
.btn-confirm { background: var(--brand-primary); color: white; }
.btn-confirm:hover { background: var(--brand-hover); }
.btn-confirm.danger { background: var(--status-red); }
.btn-use { background: var(--status-green); color: #111; }
.btn-sell { background: var(--status-yellow); color: #111; }
.btn-apply { background: var(--brand-primary); color: white; flex: 1; }
.btn-reset { background: transparent; color: var(--status-red); border: 1px solid var(--status-red); }
.btn-reset:hover { background: rgba(237,66,69,0.1); }
.btn-page { background: var(--bg-accent); color: var(--text-normal); border: 1px solid var(--border-color); }
.btn-page:disabled { opacity: 0.4; cursor: not-allowed; }

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
}
.page-info { font-size: 12px; color: var(--text-muted); }

/* Purchase Modal */
.purchase-item-preview {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}
.purchase-item-icon { font-size: 32px; }
.purchase-item-info { flex: 1; }
.purchase-item-name { font-size: 15px; font-weight: 600; color: var(--text-bright); }
.purchase-item-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.purchase-price-info { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; align-items: center; }
.purchase-price { font-weight: 700; color: var(--status-yellow); display: flex; align-items: center; gap: 3px; }
.purchase-qty-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; }
.qty-selector { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 28px; height: 28px; background: var(--bg-accent); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-normal); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.qty-input { width: 50px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 4px; text-align: center; font-size: 14px; color: var(--text-normal); font-family: inherit; outline: none; }
.purchase-total-info { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; font-weight: 700; align-items: center; }
.purchase-total { color: var(--status-yellow); display: flex; align-items: center; gap: 3px; }
.purchase-limit-info { font-size: 12px; color: var(--text-muted); background: var(--bg-tertiary); padding: 6px 10px; border-radius: var(--radius-sm); margin-bottom: 10px; }
.purchase-confirm-text { font-size: 13px; color: var(--text-muted); }

/* Item Action */
.item-detail-preview { display: flex; gap: 12px; align-items: flex-start; }
.item-detail-icon { font-size: 36px; }
.item-detail-info { flex: 1; }
.item-detail-name { font-size: 15px; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
.item-detail-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.item-detail-quantity { font-size: 12px; color: var(--brand-primary); font-weight: 600; }

/* Titles */
.titles-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.titles-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px; }
.title-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
}
.title-item:hover { background: var(--bg-accent); border-color: var(--brand-primary); }
.title-item.applied { border-color: var(--status-green); background: rgba(87,242,135,0.08); }
.title-rating { font-size: 16px; }
.title-name { flex: 1; font-weight: 500; color: var(--text-bright); }
.title-desc { font-size: 11px; color: var(--text-muted); }
.title-applied-badge { font-size: 11px; background: rgba(87,242,135,0.15); color: var(--status-green); padding: 2px 8px; border-radius: 8px; }

/* History */
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px; }
.history-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.history-item-title { font-weight: 600; color: var(--text-bright); margin-bottom: 3px; }
.history-item-content { font-size: 12px; color: var(--text-muted); }
.history-item-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* Profile Edit */
.profile-edit-section { margin-bottom: 20px; }
.profile-edit-section:last-child { margin-bottom: 0; }
.profile-edit-section-title { font-size: 13px; font-weight: 600; color: var(--text-bright); margin-bottom: 10px; }
.profile-edit-banner-preview {
    height: 80px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-size: cover;
    background-position: center;
    margin-bottom: 8px;
}
.profile-edit-hint { font-size: 12px; color: var(--text-muted); }
.profile-edit-input-group { display: flex; gap: 8px; }

.visibility-option { margin-bottom: 8px; }
.visibility-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-normal); }
.visibility-label input[type="checkbox"] { display: none; }
.visibility-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 3px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
}
.visibility-label input:checked + .visibility-checkbox {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}
.visibility-label input:checked + .visibility-checkbox::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

/* Banner Select */
.current-banner-preview {
    height: 80px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.current-banner-label { font-size: 13px; color: var(--text-muted); }

.banner-select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.banner-select-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
}
.banner-select-item:hover { border-color: var(--brand-primary); }
.banner-select-item.applied { border-color: var(--status-green); }
.banner-select-preview { height: 60px; background-size: cover; background-position: center; }
.banner-select-info { padding: 8px; }
.banner-select-name { font-size: 12px; font-weight: 600; color: var(--text-bright); }
.banner-select-meta { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--text-muted); }

/* ========== Visit Mode Banner ========== */
.visit-mode-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(94,107,245,0.15);
    border-bottom: 1px solid var(--brand-primary);
    font-size: 13px;
    color: var(--text-normal);
}
.visit-banner-btn {
    background: var(--brand-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 12px;
    color: white;
    cursor: pointer;
    font-family: inherit;
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-normal);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease;
    max-width: 300px;
}
.toast.success { border-left: 3px solid var(--status-green); }
.toast.error   { border-left: 3px solid var(--status-red); }
.toast.warning { border-left: 3px solid var(--status-yellow); }
.toast.info    { border-left: 3px solid var(--text-link); }
.toast-icon { font-size: 14px; }

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

/* ========== Icon styles ========== */
.icon-svg { vertical-align: middle; }
.icon-currency { vertical-align: middle; }
.icon-rating { vertical-align: middle; }

/* ========== Loading ========== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Gacha Overlay ========== */
.gacha-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}
.gacha-overlay.active { display: flex; }

.gacha-pre-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.gacha-pre-header h2 { font-size: 18px; font-weight: 700; color: var(--text-bright); }
.gacha-pre-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; white-space: pre-line; }
.gacha-pre-ball {
    width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 8px;
    background: radial-gradient(circle at 35% 35%, #fff 0%, var(--brand-primary) 60%);
    box-shadow: 0 0 20px rgba(94,107,245,0.5);
}
.gacha-pre-ball.mega {
    background: radial-gradient(circle at 35% 35%, #fff 0%, #FFD700 60%);
    box-shadow: 0 0 20px rgba(255,215,0,0.5);
}
.gacha-pre-info { font-size: 13px; color: var(--text-muted); }
.gacha-pre-info strong { color: var(--text-bright); }
.gacha-pre-rates { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.gacha-pre-rates .rate { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--bg-tertiary); color: var(--text-muted); }
.gacha-pre-rates .rate.ss { color: #FFD700; }
.gacha-pre-rates .rate.s { color: #A855F7; }
.gacha-pre-rates .rate.a { color: #3B82F6; }
.gacha-pre-rates .rate.b { color: #22C55E; }
.gacha-pre-buttons { display: flex; gap: 10px; }
.gacha-pre-btn { flex: 1; padding: 12px; background: var(--brand-primary); border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; color: white; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.gacha-pre-btn:hover:not(:disabled) { background: var(--brand-hover); }
.gacha-pre-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.gacha-pre-close { background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); padding: 8px; border-radius: var(--radius-md); cursor: pointer; font-size: 13px; font-family: inherit; }

/* Gacha Reveal */
.gacha-reveal-stage { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.gcard-deck { position: relative; width: 260px; height: 340px; }
.gcard {
    position: absolute;
    inset: 0;
    perspective: 1000px;
    cursor: pointer;
    user-select: none;
    touch-action: none;
}
.gcard-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}
.gcard-front, .gcard-back {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.gcard-front {
    background: linear-gradient(135deg, #2d3748, #1a202c);
    border: 1px solid #4a5568;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
}
.gcard-front-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
}
.gcard-front-icon { font-size: 48px; }
.gcard-front-text { font-size: 13px; color: #718096; }

.gcard-back {
    background: #1a202c;
    border: 1px solid #4a5568;
    transform: rotateY(180deg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 20px;
}
.gcard-glow {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s;
}
.gcard-glow.visible { opacity: 1; }
.gcard-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gcard-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.gcard-no-image { font-size: 64px; }
.gcard-info {
    position: relative;
    z-index: 2;
    text-align: center;
    background: rgba(0,0,0,0.6);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.gcard-rating { display: flex; justify-content: center; }
.gcard-name { font-size: 14px; font-weight: 700; color: white; }
.gcard-type { font-size: 11px; color: rgba(255,255,255,0.6); }

.gacha-tier-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}
.gacha-tier-badge.small { font-size: 10px; }

.gacha-reveal-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gacha-reveal-progress { font-size: 13px; color: rgba(255,255,255,0.5); }
.gacha-reveal-btns { display: flex; gap: 10px; }

.gacha-btn-skip, .gacha-btn-finish {
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.gacha-btn-skip { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.gacha-btn-skip:hover { background: rgba(255,255,255,0.15); }
.gacha-btn-finish { background: var(--brand-primary); color: white; }
.gacha-btn-finish:hover { background: var(--brand-hover); }

/* Gacha Summary */
.gacha-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.gacha-summary h3 { font-size: 16px; font-weight: 700; color: var(--text-bright); margin-bottom: 16px; }
.gacha-summary-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.gacha-summary-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-tertiary); border-radius: var(--radius-md); font-size: 13px; }
.gacha-summary-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.gacha-summary-name { flex: 1; font-weight: 600; color: var(--text-bright); }
.gacha-summary-type { font-size: 11px; color: var(--text-muted); }
.gacha-summary-refund { font-size: 12px; color: var(--status-yellow); padding: 6px; }

/* ========== Footer ========== */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 90;
    padding: 0 24px;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: #333;
}

.footer-logo {
    display: flex;
    align-items: center;
}

.footer-logo img {
    height: 20px;
    width: auto;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.footer-logo:hover img { opacity: 0.85; }

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.footer-link {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.15s;
}
.footer-link:hover {
    color: var(--text-normal);
    text-decoration: none;
}

/* ========== Responsive ========== */
@media (max-width: 480px) {
    .main-container { padding: 40px 12px 40px; }
    .mypage-info-bar { padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
    .badge-grid { grid-template-columns: repeat(4, 1fr); }
    .attendance-stats-grid.compact { grid-template-columns: repeat(2, 1fr); }
}