/* ===== CSS Custom Properties (Theme Tokens) ===== */
:root {
    /* Light Mode (default) */
    --bg: #F7F4EF;
    --surface: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #5E5E5E;
    --point: #FF6B35;
    --point-gold: #FD5E53;
    --point-soft: rgba(255, 107, 53, 0.12);
    --point-gold-soft: rgba(253, 94, 83, 0.14);
    --point-shadow: rgba(255, 107, 53, 0.18);
    --point-shadow-strong: rgba(255, 107, 53, 0.28);
    --border: #E8E1D8;

    --header-height: 56px;
    --header-panel-height: 44px; /* 확장 패널 높이 — 패딩 12+12 + 텍스트 한 줄 기준 */
    color-scheme: light;
}


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

html {
    overflow-x: hidden; /* prevent horizontal scroll on mobile */
    height: 100%;
    background-color: var(--bg); /* ensure root bg contrasts with header surface on mobile */
}

body {
    min-height: 100%;
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip; /* block horizontal overflow while preserving vertical scroll on iOS Safari */
}

button,
input,
select,
textarea {
    font-family: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.72;
}

/* ===== Header ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background-color: transparent;
    z-index: 100;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: var(--header-height);
    flex-shrink: 0;
    max-width: 940px; /* 900px content + 40px padding */
    margin: 0 auto;
    padding: 0 20px;
    background-color: var(--surface);
    /* 접힌 상태: 하단 좌우 radius
       collapse: 0.27s 후 0.08s 동안 복원 → 패널이 닫히는 마지막 구간과 동기화
       expand:   즉시 0.08s 동안 제거 → 패널이 열리기 시작하는 첫 구간과 동기화 */
    border-radius: 0 0 16px 16px;
    transition: border-radius 0.08s 0.27s;
}

/* ===== Expandable Header Panel ===== */
.app-header-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-header.header-expanded .app-header-inner {
    border-radius: 0;
    transition: border-radius 0.08s 0s;
}

.app-header.header-expanded .app-header-panel {
    max-height: var(--header-panel-height);
}

.app-header-panel-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 20px 12px;
    background: var(--surface);
    border-radius: 0 0 16px 16px;
}

.header-panel-body {
    /* Content goes here */
}

/* 사용자 페이지: 헤더 너비를 메인 컨텐츠(640px)에 맞춤 */
.app-header.user-layout .app-header-inner {
    max-width: 640px;
}

.app-logo {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    user-select: none;
    position: relative;
    top: -1px;
    text-decoration: none;
    cursor: pointer;
}

.app-logo .logo-point {
    color: var(--point);
}

/* ===== Header User Info (user dashboard) ===== */
.header-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.header-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--point);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-user-name {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

/* ===== Header Actions ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}



/* ===== Icon Button (shared style) ===== */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 4px;
    line-height: 1;
}

.icon-btn:hover {
    color: var(--point);
}

/* ===== Body ===== */
.app-body {
    padding-top: var(--header-height);
    padding-bottom: 40px;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    transition: padding-top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-body.header-expanded {
    padding-top: calc(var(--header-height) + var(--header-panel-height));
    padding-bottom: 0;
}


.app-body-inner {
    width: 100%;
    max-width: 940px; /* 900px content + 40px padding */
    margin: 0 auto;
    padding: 0 12px 0;
    background-color: var(--bg);
    min-width: 0;
}

/* Layout Container */
.layout-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.layout-main {
    flex: 1;
    width: 100%;
    max-width: 640px;
    min-width: 0;
    box-sizing: border-box;
}

.layout-main.layout-main-master {
    max-width: 100%;
}

.layout-main.layout-main-partner {
    max-width: 100%;
}

/* ===== Page Header Row (shared: title left, back button right) ===== */
.section-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.section-page-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    width: 100%;
}

.page-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    text-decoration: none;
}

.page-back-btn:hover {
    border-color: var(--point);
    color: var(--point);
}

/* ===== Utility ===== */
h1:focus {
    outline: none;
}

/* ===== Blazor Error UI ===== */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }


/* ===== Page Section (공통 페이지 상단 여백) ===== */
/* 모든 서브 페이지의 외부 컨테이너에 page-section 클래스를 추가하면
   헤더와의 간격, 하단 여백, 레이아웃이 자동으로 통일됩니다. */
.page-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 24px 80px;
}

/* reg-* 공통 클래스 (Register + StoreRegister 공용) */
.reg-field { display: flex; flex-direction: column; gap: 6px; }
.reg-label { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); letter-spacing: 0.02em; }
.reg-input-wrap { position: relative; display: flex; align-items: center; }
.reg-input-icon { position: absolute; left: 12px; color: var(--text-secondary); pointer-events: none; flex-shrink: 0; }
.reg-input {
    width: 100%;
    padding: 11px 12px 11px 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.reg-input::placeholder { color: var(--text-secondary); opacity: 0.72; }
.reg-input:focus { border-color: var(--point); box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15); }
.reg-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer;
}
.reg-submit {
    width: 100%; padding: 12px; border: none; border-radius: 10px;
    font-size: 0.95rem; font-weight: 700; cursor: pointer;
    background: var(--point); color: #0A0A0A;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.16);
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    margin-top: 6px;
}
.reg-submit:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255, 107, 53, 0.22); }
.reg-submit:active:not(:disabled) { transform: translateY(0); }
.reg-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.register-title { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); margin: 0; }
.register-form { display: flex; flex-direction: column; gap: 18px; width: 100%; }

/* ===== Dashboard Shared Styles ===== */
.dashboard {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 0 80px;
}

.dashboard-inner {
    width: 100%;
    max-width: 900px;
    min-width: 0;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin: 0 0 8px;
}

.dashboard-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.section-page-title strong {
    font-size: inherit;
    font-weight: 800;
}

/* Store Status LED */
.store-status-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Empty State */
.store-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.store-empty span {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}

/* Store Grid */
.store-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Store Card */
.store-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 140px;
}

.store-card:hover {
    border-color: var(--point);
    box-shadow: 0 4px 20px var(--point-shadow);
    transform: translateY(-2px);
}

.store-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.store-card-top-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.store-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 0;
}

.store-address {
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.store-card-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.store-card-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 4px;
    margin-top: auto;
}

/* LED + stats are siblings in a row; LED aligns with stat-value column */
.store-card-main {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.store-card-main .store-card-stats {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}

.store-card-summary {
    justify-content: flex-start;
}

.store-card-summary .store-card-stats {
    margin-top: 0;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.store-loading {
    height: 200px;
}

@media (max-width: 600px) {
    .dashboard {
        padding: 20px 0;
    }

    .store-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-title {
        font-size: 1.3rem;
    }
}

/* ===== Mobile Global Safety ===== */
@media (max-width: 600px) {
    .app-body-inner {
        padding: 0 12px;
    }

    .tab-content-panel {
        padding: 0 !important;
    }

    .user-sub-page {
        padding: 0 !important;
    }

    .user-dashboard-top {
        padding: 0 !important;
    }

    /* prevent all elements from overflowing viewport */
    img, video, svg, canvas, iframe {
        max-width: 100%;
    }

    /* prevent Safari auto-zoom on focused form controls */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    /* table scrolls within its own container */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── Settings Overlay (global fallback — CSS isolation 변경 후 브라우저 캐시 우회용) ─ */
.settings-overlay {
    position: fixed;
    inset: 0;
    min-height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 200;
    padding: 16px;
}

.settings-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: min(100%, calc(100dvh - 32px));
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.match-settings-inner {
    width: 100%;
    max-width: 900px;
    min-width: 0;
}

/* ── Match List / Form 공용 스타일 (StoreDetail + StoreSettings 공용) ── */
.match-list-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.match-list-item:hover {
    border-color: var(--point);
    box-shadow: 0 4px 14px var(--point-shadow);
}

.match-list-item.active {
    border-color: var(--point);
    box-shadow: 0 0 0 1px rgba(255, 107, 53, 0.55);
}

.match-list-item.add-new {
    justify-content: center;
    border-style: dashed;
    color: var(--text-secondary);
}

.match-list-item.add-new:hover {
    color: var(--point);
    background: rgba(255, 107, 53, 0.05);
}

.match-title {
    font-weight: 600;
    color: var(--text-primary);
}

.match-actions {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.match-list-item:hover .match-actions {
    color: var(--point);
}

.match-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 48px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.3s ease;
    position: relative;
}

.match-form-card-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.match-form-card-close:hover {
    color: var(--text-primary);
    background: var(--border);
}

/* 타이틀이 있는 카드(경기 상세 등)는 X 버튼을 카드 위에 절대 위치로 띄우지 않고 타이틀과 같은
   줄에 나란히 배치한다 — 이 경우 .match-form-card-close 전용 padding-top 버퍼(48px)가 필요 없으므로
   표준 카드 패딩(16px)으로 되돌린다. CLAUDE.md 참고. */
.match-form-card-with-title {
    padding-top: 16px;
}

.match-card-title-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.match-card-title-close:hover {
    color: var(--text-primary);
    background: var(--border);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

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

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.form-error {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
    text-align: center;
}

.form-success {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.2);
    text-align: center;
}

/* ── Playing Card (global — MarkupString로 삽입되는 요소라 CSS isolation의 scope 속성이
   붙지 않는다. 격리 CSS에 똑같이 넣어도 절대 안 먹히므로 반드시 여기(app.css)에 둔다.)
   height는 padding이 아니라 고정값으로 준다 — 슈트 기호(♥♦♠♣)마다 폰트 글리프의
   ascent/descent가 달라서 padding만으로는 카드마다 세로폭이 미묘하게 들쭉날쭉해진다
   (예: 하트가 클로버보다 살짝 커 보임). height 고정 + line-height:1 + flex 중앙정렬로
   어떤 슈트여도 카드 박스 높이가 항상 같게 만든다. ── */
.playing-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.playing-card.red { color: #dc2626; }
.playing-card.black { color: var(--text-primary); }

.playing-card.back {
    color: var(--text-secondary);
    border-style: dashed;
    background: var(--bg);
}

/* ── Store Detail (global fallback) ─────────────────────────────────── */
.store-detail {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 0 80px;
}

.store-detail-inner {
    width: 100%;
    max-width: 900px;
    min-width: 0;
}

/* ── Global Animations ─────────────────────────────────────────────────── */
/* Blazor CSS isolation scopes @keyframes, so these are defined globally */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* ── Global Utility Classes ─────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:not(:disabled):hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--point);
    color: #fff;
}

.btn-primary:not(:disabled):hover {
    box-shadow: 0 6px 16px var(--point-shadow);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:not(:disabled):hover {
    border-color: var(--point);
    color: var(--point);
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
    border-radius: 8px;
}

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

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--point);
    box-shadow: 0 0 0 3px var(--point-soft);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--border);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.form-actions.form-actions-center {
    justify-content: center;
}

.alert-error {
    font-size: 0.85rem;
    color: #dc2626;
    padding: 10px 14px;
    background: rgba(220, 38, 38, 0.08);
    border-radius: 8px;
    border-left: 3px solid #dc2626;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--point);
    color: var(--point);
}


.page-btn.active {
    background: var(--point);
    color: #fff;
    border-color: var(--point);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0 8px;
}


/* 헤더 확장 시 shortcut-card sticky top을 패널 높이만큼 추가 보정 */
.app-body.header-expanded .shortcut-card {
    top: calc(var(--header-height) + var(--header-panel-height) + 8px);
}

/* ===== User Sub-page Layout ===== */
/* 지갑, 경기, 매장, 메시지, 게시판 등 사용자 서브 페이지 공용 레이아웃 */
/* 홈(UserDashboard)의 scoped .dashboard { padding: 24px 0 } 와 동일하게 맞춤 */
.dashboard:has(.user-sub-page) {
    padding-top: 24px;
}

.user-sub-page {
    width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
}

.user-sub-page-content {
    animation: userSubPageFadeIn 0.18s ease;
}

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

.user-sub-page-placeholder {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 40px 0;
    text-align: center;
}


/* ===== Section Add Button (타이틀 우측 + 버튼) ===== */
.add-section-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--point) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--point) 20%, transparent);
    color: var(--point);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.add-section-btn:hover {
    background: var(--point);
    border-color: var(--point);
    color: #ffffff;
    transform: scale(1.08);
}


/* ===== App Select (공통 셀렉트 박스 스타일) ===== */
.app-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-select:focus {
    border-color: var(--point);
    box-shadow: 0 0 0 3px var(--point-soft);
}

.app-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== List Empty State ===== */
.list-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* match-list-card는 자체 padding: 16px이 있으므로 내부 list-empty 패딩을 보정 */
.match-list-card .list-empty {
    padding: 12px 20px;
}
