/* ==========================================================================
   매치 메이커 Pro (Match Maker Pro) - 통합 스타일시트
   ========================================================================== */

:root {
    --primary: #007bff;
    --primary-hover: #0056b3;
    --success: #28a745;
    --success-hover: #218838;
    --danger: #dc3545;
    --danger-hover: #c82333;
    --warning: #ffc107;
    --warning-hover: #e0a800;
    --purple: #6f42c1;
    --purple-hover: #593196;
    --dark: #343a40;
    --gray: #6c757d;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --bg: #f4f6f9;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

button:focus, a:focus {
    outline: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
}

/* --------------------------------------------------------------------------
   헤더 (Header)
   -------------------------------------------------------------------------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 10px;
    flex-wrap: nowrap;
    gap: 15px;
}

.header-row-top,
.header-row-bottom {
    display: contents;
}

.header-title {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    order: 1;
}

.header-title:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.header-title .brand-pro {
    display: inline;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 2;
}

.header-select {
    padding: 6px;
    font-size: 15px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    background: #fff;
    cursor: pointer;
}

.settings-group {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 14px;
    background: var(--light-gray);
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.settings-group input {
    width: 50px;
    text-align: center;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.mode-toggles {
    display: flex;
    align-items: center;
    gap: 8px;
    order: 3;
    margin-left: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 4;
}

.btn-fullscreen {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
    cursor: pointer;
}

.btn-icon-round {
    position: relative;
    background: #fff;
    border: 1.5px solid #ced4da;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    padding: 0;
    flex-shrink: 0;
}

.mode-toggles button {
    padding: 8px 16px;
    font-size: 15px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.mode-toggles button.active,
.mode-toggles button.active:disabled {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    opacity: 0.95;
    cursor: default;
}

.mode-toggles button:disabled:not(.active) {
    background: #e9ecef !important;
    color: #adb5bd !important;
    border-color: var(--border-color) !important;
    cursor: not-allowed !important;
}

.sub-modes {
    display: none;
    align-items: center;
    gap: 8px;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 14px;
}

.sub-modes.visible {
    display: flex !important;
}

/* --------------------------------------------------------------------------
   메인 레이아웃 (Container / Sidebar / Main Area)
   -------------------------------------------------------------------------- */
.container {
    display: flex;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

.sidebar {
    width: 320px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    overflow-y: auto;
    touch-action: pan-y;
}

.sidebar-top-action {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
}

.summary-panel {
    background: #e9ecef;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #333;
    line-height: 1.6;
    border: 1px solid var(--border-color);
}

.summary-panel span {
    font-weight: bold;
    color: var(--primary);
    font-size: 14px;
}

.summary-panel .sum-title {
    font-weight: bold;
    color: #555;
    margin-bottom: 4px;
    font-size: 14px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 4px;
}

.main-area {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    overflow-y: auto;
    touch-action: pan-y;
}

/* --------------------------------------------------------------------------
   급수 및 선수 카드 (Player Cards)
   -------------------------------------------------------------------------- */
.grade-section {
    margin-bottom: 15px;
}

.grade-title {
    font-weight: bold;
    padding: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-card {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 4px;
    transition: background 0.15s, box-shadow 0.15s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.player-card:hover {
    background: #f1f3f5;
}

.player-card:active {
    cursor: grabbing;
}

/* 드래그 중인 원본 카드 시각 피드백 (PC 데스크톱 마우스 드래그용) */
.player-card.is-dragging-card,
.member-chip.is-dragging-card,
.queue-group.is-dragging-card {
    opacity: 0.45 !important;
    transform: scale(0.97);
    border: 1.5px dashed #007bff !important;
    background: #e7f1ff !important;
}

.player-name {
    font-weight: bold;
}

.gender-M { color: #0056b3; }
.gender-F { color: #c82333; }

/* 공통 선수 카드 좌측 정보 컬럼 */
.player-col-name {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
}

/* 공통 선수 카드 우측 기록 및 조작 컬럼 */
.player-col-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* 게임 수 배지 (일정한 너비와 중앙 정렬로 수직 정렬 라인 보장) */
.stats-badge {
    font-size: 11px;
    background: var(--primary);
    color: white;
    padding: 2px 4px;
    border-radius: 8px;
    min-width: 44px;
    width: 44px;
    box-sizing: border-box;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
}

/* 대기 시간 배지 영역 (시계 아이콘 시작 위치를 정확히 수직 정렬) */
.player-wait-badge {
    min-width: 60px;
    width: 60px;
    box-sizing: border-box;
    text-align: left;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 11px;
    line-height: 1;
}

.player-wait-badge:empty {
    display: none;
}

.del-btn {
    color: var(--danger);
    cursor: pointer;
    padding: 2px;
    font-weight: bold;
    font-size: 14px;
    min-width: 20px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex-shrink: 0;
    border-radius: 4px;
    transition: background 0.15s;
}

.del-btn:hover {
    color: #bd2130;
    background: rgba(220, 53, 69, 0.1);
}

/* 게스트 본인 하이라이트 */
.highlight-me {
    box-shadow: 0 0 0 3px var(--warning) !important;
    background: #fffdf5 !important;
    border-color: var(--warning) !important;
    font-weight: bold;
}

/* --------------------------------------------------------------------------
   코트 및 경기장 그래픽 (Courts)
   -------------------------------------------------------------------------- */
.court-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 15px;
}

.court {
    border: 2px solid #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    overflow: hidden;
}

.court-header {
    background: #e2e3e5;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid #ccc;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-team-badge {
    background: var(--success);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.active-team-badge:active {
    cursor: grabbing;
}

.badminton-top-court {
    position: relative;
    background: #2e7d32;
    border: 4px solid white;
    min-height: 210px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    overflow: hidden;
    transition: background 0.2s, border-color 0.2s;
}

.badminton-top-court.drag-over {
    background: #1b5e20 !important;
    border: 4px dashed var(--warning) !important;
}

.net-line-vertical {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: white;
    transform: translateX(-50%);
    z-index: 1;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
    pointer-events: none;
}

.court-half-team {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    z-index: 2;
    position: relative;
    width: 44%;
    align-self: stretch;
}

.slot-box {
    width: 100%;
    flex: 1;
    min-height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 13px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    box-sizing: border-box;
}

.slot-box:hover {
    background: rgba(255, 255, 255, 0.35);
}

.slot-box.drag-over-slot {
    background: rgba(255, 193, 7, 0.5);
    border-color: var(--warning);
}

.slot-box > span {
    pointer-events: none;
}

.slot-box.drag-over-slot * {
    pointer-events: none;
}

.slot-box .player-card {
    width: 100%;
    height: 100%;
    margin: 0;
    background: white;
    color: black;
    font-weight: bold;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   대기열 (Queue Area)
   -------------------------------------------------------------------------- */
.queue-area {
    min-height: 70px;
    padding: 8px;
    background: var(--light-gray);
    border-top: 1px solid #ddd;
    cursor: pointer;
    transition: background 0.2s;
}

.queue-area:hover {
    background: #e9ecef;
}

.queue-area.drag-over {
    background: #e2e6ea !important;
    border: 2px dashed var(--primary) !important;
}

.queue-group {
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: grab;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.queue-group:active {
    cursor: grabbing;
}

.queue-group.drag-over-queue {
    border: 2px dashed var(--primary);
    background: #e7f1ff;
}

.queue-group.drag-over-queue * {
    pointer-events: none;
}

.queue-drag-handle {
    font-weight: bold;
    color: #495057;
    cursor: grab;
    padding: 2px 4px;
    border-radius: 4px;
    background: #e9ecef;
    font-size: 11px;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.member-chip {
    background: #fff;
    border: 1px solid #ced4da;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.member-chip:active {
    cursor: grabbing;
}

/* --------------------------------------------------------------------------
   버튼 및 컨트롤 (Buttons & Controls)
   -------------------------------------------------------------------------- */
button.btn, a.btn {
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    border: none;
    transition: 0.15s;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-blue { background: var(--primary); color: white; }
.btn-blue:hover { background: var(--primary-hover); }

.btn-gray { background: var(--gray); color: white; }
.btn-gray:hover { background: #5a6268; }

.btn-red { background: var(--danger); color: white; }
.btn-red:hover { background: var(--danger-hover); }

.btn-green { background: var(--success); color: white; }
.btn-green:hover { background: var(--success-hover); }

.btn-warning { background: var(--warning); color: #333; }
.btn-warning:hover { background: var(--warning-hover); }

.btn-purple { background: var(--purple); color: white; }
.btn-purple:hover { background: var(--purple-hover); }

.btn-outline {
    background: #e9ecef;
    border: 1px solid #ced4da;
    color: #495057;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-outline:hover {
    background: #dee2e6;
    border-color: #adb5bd;
    color: #212529;
}

/* --------------------------------------------------------------------------
   모달 팝업 (Modal Popup)
   -------------------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    position: relative;
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 650px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    max-height: 85vh;
    overflow-y: auto;
    touch-action: pan-y;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
    z-index: 100;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.modal-close-btn:hover {
    color: var(--danger);
    background: #f1f3f5;
    border-radius: 50%;
}

.modal-buttons {
    position: sticky;
    bottom: -25px;
    background: #ffffff;
    padding: 12px 10px 6px 10px;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    z-index: 30;
    border-top: 1px solid #f1f3f5;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
}

/* 선수 수동 배치 모달 컴포넌트 */
.manual-select-toolbar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.manual-select-toolbar .toolbar-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.manual-select-toolbar .toolbar-label {
    font-size: 11px;
    font-weight: bold;
    color: #6c757d;
    min-width: 26px;
    flex-shrink: 0;
}

.manual-select-toolbar .chip-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.manual-select-toolbar .chip-group.scrollable {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.ctrl-chip {
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 14px;
    padding: 3px 8px;
    font-size: 11px;
    color: #495057;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    line-height: 1.3;
    user-select: none;
    outline: none;
}

.ctrl-chip:hover {
    background: #e9ecef;
}

.ctrl-chip.active {
    background: #007bff;
    border-color: #007bff;
    color: #ffffff;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 123, 255, 0.3);
}

.manual-select-list-container {
    max-height: clamp(280px, 45vh, 460px);
    overflow-y: auto;
    padding-right: 4px;
    text-align: left;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.manual-select-list-container .select-pool-grid {
    max-height: none;
    overflow-y: visible;
    margin: 4px 0 8px 0;
}

.pool-section-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #4f46e5;
    border: none;
    border-left: 4px solid #312e81;
    padding: 6px 10px;
    margin: 8px 0 6px 0;
    border-radius: 5px;
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(79, 70, 229, 0.25);
}

.pool-section-header .pool-section-badge {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    font-size: 11.5px;
    padding: 2px 9px;
    color: #ffffff;
    font-weight: bold;
    letter-spacing: 0.2px;
    box-shadow: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px 15px;
    text-align: center;
    color: #495057;
    width: 100%;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

.select-pool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    text-align: left;
    margin: 10px 0;
}

@media (min-width: 640px) {
    .select-pool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.select-pool-item {
    background: #f1f3f5;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #ccc;
    font-size: 13px;
    transition: 0.15s;
    user-select: none;
}

.select-pool-item:hover {
    background: #e9ecef;
}

.select-pool-item.selected {
    background: #d4edda;
    border-color: var(--success);
    font-weight: bold;
}

.select-action-badge {
    font-weight: bold;
    font-size: 13px;
    min-width: 58px;
    width: 58px;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    box-sizing: border-box;
    color: var(--primary);
}

.select-pool-item.selected .select-action-badge {
    color: #28a745;
}

.slot-preview-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    background: #e9ecef;
    padding: 10px;
    border-radius: 8px;
}

.slot-preview-box {
    background: white;
    border: 2px dashed var(--primary);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.slot-preview-box.filled {
    border-style: solid;
    background: #e7f1ff;
    font-weight: bold;
}

/* 점수 입력 모달 */
.score-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.score-header {
    font-weight: bold;
    font-size: 16px;
    color: var(--dark);
    text-align: left;
}

.score-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.score-controls button.stepper {
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
}

.score-controls .score-display {
    font-size: 24px;
    font-weight: bold;
    width: 50px;
    text-align: center;
}

.quick-win-btn {
    padding: 8px 15px;
    background: var(--warning);
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.dest-select {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    margin-top: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* 토스트 메시지 */
#toastMessage {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 20px;
    z-index: 10000;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    max-width: 90vw;
    line-height: 1.4;
    transition: opacity 0.3s;
}

/* --------------------------------------------------------------------------
   모바일 탭 내비게이션 & 미디어 쿼리
   -------------------------------------------------------------------------- */
.mobile-tab-nav {
    display: none;
    margin-bottom: 10px;
    gap: 5px;
}

.mobile-tab-nav button {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid #ccc;
    background: #e9ecef;
    border-radius: 6px;
    cursor: pointer;
}

.mobile-tab-nav button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 코트 현황판 상단 나의 상태창: 데스크탑/태블릿에서는 대기명단이 함께 보이므로 숨기고 모바일에서만 표시 */
#courtTopMyStatus {
    display: none;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    #courtTopMyStatus {
        display: block;
    }
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }
    .header-row-top {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 8px;
    }
    .header-row-bottom {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 6px;
    }
    .header-title {
        font-size: 16px;
        gap: 5px;
        flex-wrap: wrap;
        min-width: 0;
    }
    .header-title .brand-pro {
        display: none;
    }
    .header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }
    .btn-fullscreen {
        padding: 5px 8px;
        font-size: 13px;
        border-radius: 16px;
    }
    .btn-fullscreen .fs-text {
        display: none;
    }
    .btn-icon-round {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }
    .header-controls {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 1;
        min-width: 0;
    }
    .header-select {
        padding: 4px 4px;
        font-size: 12px;
    }
    .settings-group {
        padding: 3px 5px;
        font-size: 11.5px;
        gap: 2px;
        white-space: nowrap;
    }
    .settings-group input {
        width: 32px;
        padding: 2px 1px;
        font-size: 12px;
    }
    .mode-toggles {
        margin-left: 0;
        gap: 3px;
        flex-shrink: 0;
    }
    .mode-toggles button {
        padding: 4px 7px;
        font-size: 12px;
        white-space: nowrap;
    }
    .mode-toggles button:disabled:not(.active) {
        display: none !important;
    }
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100% !important;
        max-height: none;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }
    .main-area {
        width: 100% !important;
        max-height: none;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-tab-nav {
        display: flex;
    }
    body.mobile-view-courts .sidebar {
        display: none;
    }
    body.mobile-view-players .main-area {
        display: none;
    }
    .court-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .modal-content {
        padding: 18px 14px 16px 14px;
        width: 95%;
        max-height: 90vh;
    }
    .modal-buttons {
        bottom: -16px;
        padding: 10px 4px 4px 4px;
        margin-top: 12px;
        gap: 8px;
    }
    .welcome-container {
        width: 100%;
        margin: 15px auto;
        padding: 20px 16px;
        border-radius: 10px;
    }
}

/* --------------------------------------------------------------------------
   홈(welcome) 및 모임(mygroup) 전용 카드 스타일
   -------------------------------------------------------------------------- */
.welcome-container {
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.welcome-header {
    text-align: center;
    margin-bottom: 25px;
}

.welcome-header h1 {
    font-size: 26px;
    margin-bottom: 8px;
}

.welcome-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.welcome-actions button {
    flex: 1;
    padding: 14px 10px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.group-item-card {
    border: 1px solid var(--border-color);
    background: white;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.15s;
}

.group-item-card:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* 참여자 본인 하이라이트 스타일 */
.my-player-highlight {
    background: #fff8db !important;
    border: 2px solid #ffc107 !important;
    padding: 7px 9px !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.7) !important;
    font-weight: bold;
    position: relative;
}

.my-player-badge {
    display: inline-block;
    background: #ffc107;
    color: #212529;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 6px;
    margin-right: 4px;
    letter-spacing: -0.5px;
    vertical-align: middle;
}

/* 주최자 요청 알림 뱃지 펄스 애니메이션 */
@keyframes pulse-badge {
    0% { transform: scale(1); }
    50% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.badge-pulse {
    animation: pulse-badge 1.4s infinite;
}

/* --------------------------------------------------------------------------
   인앱 커스텀 월간 달력 (Custom Calendar)
   -------------------------------------------------------------------------- */
.custom-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.custom-cal-header-cell {
    font-size: 13px;
    font-weight: bold;
    padding: 6px 0;
    text-align: center;
    background: #f8f9fa;
    border-radius: 4px;
    color: #495057;
}

.custom-cal-cell {
    min-height: 54px;
    padding: 4px 2px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: 0.15s;
    user-select: none;
}

.custom-cal-cell:hover:not(.other-month) {
    background: #eef6ff;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.custom-cal-cell.has-match {
    background: #eafaf1;
    border: 1.5px solid #28a745;
}

.custom-cal-cell.is-today {
    border: 2px solid #007bff !important;
}

.custom-cal-cell.other-month {
    opacity: 0.35;
    background: #f8f9fa;
    cursor: default;
}

.custom-cal-day-num {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
}

.custom-cal-badge {
    font-size: 10px;
    background: #28a745;
    color: #fff;
    border-radius: 4px;
    padding: 1px 4px;
    margin-top: 3px;
    font-weight: bold;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* --------------------------------------------------------------------------
   글로벌 푸터 (Footer) - 소개, 가이드, 약관, 개인정보처리방침, 문의
   -------------------------------------------------------------------------- */
.app-global-footer {
    width: 100%;
    margin-top: auto;
    padding: 24px 16px 28px;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
    font-family: inherit;
    color: #495057;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.footer-title {
    font-size: 15px;
    font-weight: 700;
    color: #212529;
    letter-spacing: -0.3px;
}

.footer-desc {
    font-size: 12px;
    color: #6c757d;
    max-width: 600px;
    line-height: 1.4;
    word-break: keep-all;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin: 4px 0;
}

.footer-link-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.footer-link-btn:hover {
    color: #007bff;
    background-color: #f1f3f5;
    text-decoration: underline;
}

.footer-sep {
    color: #ced4da;
    font-size: 11px;
    user-select: none;
}

.footer-copyright {
    font-size: 11px;
    color: #868e96;
    letter-spacing: 0.2px;
}

/* 모바일 화면 최적화 */
@media (max-width: 768px) {
    .app-global-footer {
        padding: 20px 12px 24px;
        margin-top: 24px;
    }
    .footer-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 8px;
        width: 100%;
        max-width: 360px;
    }
    .footer-link-btn {
        justify-content: center;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        padding: 8px 6px;
        font-size: 12px;
        border-radius: 6px;
    }
    .footer-link-btn:hover {
        background: #e9ecef;
    }
    .footer-sep {
        display: none;
    }
}



