/* =====================================================
   스마일농구단 – 모바일 앱 스타일
   ===================================================== */

/* ---------- 기본 폰트 & 색상 ---------- */
:root {
  --primary:     #2563eb;
  --primary-dark:#1d4ed8;
  --accent:      #f97316;
  --bg:          #f1f5f9;
  --card-bg:     #ffffff;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h:    56px;
  --bottom-nav-h:62px;
  --radius:      14px;
}

html { scroll-behavior: smooth; }

body.docs {
  background: var(--bg) !important;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== 상단 헤더 (모바일 앱 스타일) ===== */
.header.fixed-top {
  height: var(--header-h);
  background: var(--primary) !important;
  border-bottom: none !important;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}

.header.fixed-top .navbar {
  padding: 0 16px;
  height: var(--header-h);
  background: transparent !important;
}

.header.fixed-top .navbar-brand img {
  height: 32px !important;
  filter: brightness(0) invert(1);
}

/* 헤더 우상단 버튼들 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff !important;
  border: none;
  cursor: pointer;
  font-size: 17px;
  transition: background .2s;
  text-decoration: none;
}

.header-icon-btn:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* 기존 사이드바 토글 버튼 스타일 재정의 */
.sidenav-toggler {
  background: rgba(255,255,255,0.15) !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}
.sidenav-toggler-line {
  background: #fff !important;
}

/* ===== 사이드바 ===== */
#sidenav-main {
  top: var(--header-h) !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: 4px 0 16px rgba(0,0,0,0.08);
}

#sidenav-main .navbar-nav .nav-link {
  padding: 10px 16px;
  border-radius: 10px;
  margin: 2px 8px;
  color: var(--text) !important;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  transition: background .15s, color .15s;
}

#sidenav-main .navbar-nav .nav-link:hover,
#sidenav-main .navbar-nav .nav-link.active {
  background: var(--primary);
  color: #fff !important;
}

#sidenav-main .navbar-nav .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

/* ===== 메인 콘텐츠 ===== */
.main-content {
  padding-top: calc(var(--header-h) + 16px) !important;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px) !important;
  min-height: 100vh;
}

@media (min-width: 1200px) {
  .main-content { margin-left: 250px !important; }
}

.docs-content { padding: 0 !important; }

/* ===== 카드 ===== */
.card {
  border: none !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
  margin-bottom: 14px;
}

.card-body { padding: 16px !important; }

/* ===== 버튼 ===== */
.btn { border-radius: 10px !important; font-weight: 600; letter-spacing: -0.2px; }
.btn-primary { background: var(--primary) !important; border-color: var(--primary) !important; }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }
.btn-sm { font-size: 0.82rem !important; padding: 6px 14px !important; }
.btn-lg { padding: 12px 24px !important; }

/* 출석 버튼 (팀 페이지) */
.btn-join-yes   { background: #16a34a !important; border-color: #16a34a !important; color: #fff !important; }
.btn-join-no    { background: #dc2626 !important; border-color: #dc2626 !important; color: #fff !important; }
.btn-join-think { background: #d97706 !important; border-color: #d97706 !important; color: #fff !important; }

/* ===== 폼 컨트롤 ===== */
.form-control {
  border-radius: 10px !important;
  border: 1.5px solid var(--border) !important;
  font-size: 0.92rem;
  padding: 10px 14px !important;
  transition: border-color .2s, box-shadow .2s;
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
}

/* ===== 타이포 ===== */
h2, .docs-page-title h2 { font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 10px; }
h3 { font-size: 1.1rem; font-weight: 600; }
p, li { font-size: 0.92rem; line-height: 1.7; }

/* ===== 섹션 구분선 ===== */
hr.divider { border-color: var(--border); margin: 20px 0; }

/* ===== BottomNav (모바일 전용) ===== */
#bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--bottom-nav-h);
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 1040;
  padding-bottom: var(--safe-bottom);
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
}

#bottom-nav .bnav-inner {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: stretch;
  flex-wrap: nowrap;
  padding: 0;
  margin: 0;
  list-style: none;
}

#bottom-nav .bnav-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  gap: 2px;
  transition: color .15s;
  padding: 4px 0;
  cursor: pointer;
  background: none;
  border: none;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}

#bottom-nav .bnav-item i {
  font-size: 1.1rem;
  display: block;
  line-height: 1;
}

#bottom-nav .bnav-item.active,
#bottom-nav .bnav-item:active {
  color: var(--primary);
}

#bottom-nav .bnav-item.active i { color: var(--primary); }

@media (max-width: 991px) {
  #bottom-nav { display: flex !important; flex-direction: row !important; }

  /* 모바일에서는 사이드바 숨기고 바텀 Nav 사용 */
  #sidenav-main { display: none !important; }

  /* 헤더에서 사이드바 토글 버튼 숨기기 */
  .sidenav-toggler { display: none !important; }

  .main-content {
    margin-left: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .container-fluid { padding: 0 !important; }
}

/* ===== PWA 설치 배너 ===== */
#pwa-install-banner {
  display: none;
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 8px);
  left: 12px;
  right: 12px;
  background: #1e293b;
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  z-index: 1050;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: slideUp .3s ease;
}

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

#pwa-install-banner .banner-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

#pwa-install-banner .banner-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}

#pwa-install-banner .banner-actions {
  display: flex;
  gap: 8px;
}

#pwa-install-banner .btn-install {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

#pwa-install-banner .btn-dismiss {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ===== 알림 토스트 ===== */
#push-toast {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 12px;
  right: 12px;
  background: #1e293b;
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  z-index: 9999;
  display: none;
  font-size: 0.88rem;
  animation: slideDown .3s ease;
}

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

/* ===== 배지 (알림 뱃지) ===== */
.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  vertical-align: super;
}

/* ===== 리스트 카드 (회원 목록 등) ===== */
.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.member-card .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary);
  flex-shrink: 0;
}

.member-card .info { flex: 1; }
.member-card .name { font-weight: 700; font-size: 0.95rem; }
.member-card .sub  { font-size: 0.78rem; color: var(--text-muted); }

/* ===== 게임 상태 배지 ===== */
.game-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.game-badge.yes  { background: #dcfce7; color: #16a34a; }
.game-badge.no   { background: #fee2e2; color: #dc2626; }
.game-badge.think{ background: #fef3c7; color: #d97706; }

/* ===== 이미지 ===== */
img.w-100 { border-radius: var(--radius); }

/* ===== 스크롤바 슬림 ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ===== 데스크탑 미세 조정 ===== */
@media (min-width: 992px) {
  .main-content {
    padding-bottom: 24px !important;
  }
}

/* ===== 모바일 드로어 메뉴 ===== */
#mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  backdrop-filter: blur(2px);
}

#mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: #fff;
  z-index: 2001;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

#mobile-drawer.open {
  transform: translateX(0);
}

#mobile-drawer-overlay.open {
  display: block;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--primary);
  flex-shrink: 0;
}

.drawer-logo {
  height: 32px;
  filter: brightness(0) invert(1);
}

#btn-drawer-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 80px;
}

.drawer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.drawer-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  transition: background .15s;
  border-radius: 0;
}

.drawer-nav li a:hover,
.drawer-nav li a:active {
  background: #f1f5fb;
  color: var(--primary);
}

.drawer-nav li a i {
  width: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.drawer-nav li a:hover i,
.drawer-nav li a:active i {
  color: var(--primary);
}

.drawer-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 20px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

/* 드로어는 모바일에서만 */
@media (min-width: 992px) {
  #mobile-drawer,
  #mobile-drawer-overlay,
  #btn-mobile-menu {
    display: none !important;
  }
}

/* =====================================================
   선수카드 (Player Card)
   ===================================================== */

/* 등급 범례 */
.pc-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #666;
}

/* 등급 배지 */
.pc-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.85rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.pc-grade-badge.grade-S { background: linear-gradient(135deg, #f7971e, #ffd200); color: #333; box-shadow: 0 2px 8px rgba(255,210,0,.4); }
.pc-grade-badge.grade-A { background: linear-gradient(135deg, #7b2ff7, #c86dd7); }
.pc-grade-badge.grade-B { background: linear-gradient(135deg, #1a6aff, #38bdf8); }
.pc-grade-badge.grade-C { background: linear-gradient(135deg, #11998e, #38ef7d); }
.pc-grade-badge.grade-D { background: linear-gradient(135deg, #636e72, #b2bec3); }

/* 카드 그리드 */
.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

/* 개별 선수카드 */
.pc-card {
  border-radius: 16px;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
  background: #1c2333;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.pc-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,.28); }

/* 등급별 카드 배경 */
.pc-card.grade-S { background: linear-gradient(160deg, #3d2c00 0%, #1c1400 100%); border: 1.5px solid #ffd200; }
.pc-card.grade-A { background: linear-gradient(160deg, #2a0a4a 0%, #150028 100%); border: 1.5px solid #9b59b6; }
.pc-card.grade-B { background: linear-gradient(160deg, #0a1a40 0%, #030d20 100%); border: 1.5px solid #1a6aff; }
.pc-card.grade-C { background: linear-gradient(160deg, #042a1a 0%, #011510 100%); border: 1.5px solid #11998e; }
.pc-card.grade-D { background: linear-gradient(160deg, #1a1f2a 0%, #0d1018 100%); border: 1.5px solid #636e72; }

/* 카드 상단 행 */
.pc-card-top {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.pc-ovr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.pc-ovr-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: .06em;
  opacity: .7;
  text-transform: uppercase;
}
.pc-ovr-num {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.pc-pos-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
}

/* 선수 사진 */
.pc-photo-wrap {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 2px;
}
.pc-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pc-initial {
  font-size: 2rem;
  font-weight: 900;
  color: rgba(255,255,255,.8);
}

/* 이름 */
.pc-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* 미니 스탯 바 */
.pc-mini-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.pc-ms-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.pc-ms-label {
  font-size: 0.6rem;
  width: 30px;
  text-align: right;
  opacity: .75;
  flex-shrink: 0;
}
.pc-ms-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.12);
  border-radius: 2px;
  overflow: hidden;
}
.pc-ms-fill {
  height: 100%;
  background: rgba(255,255,255,.7);
  border-radius: 2px;
  transition: width .3s;
}
.pc-ms-val {
  font-size: 0.6rem;
  width: 20px;
  text-align: right;
  opacity: .85;
  flex-shrink: 0;
}

/* 상세보기 버튼 */
.pc-detail-btn {
  margin-top: 6px;
  width: 100%;
  padding: 5px 0;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  text-align: center;
  display: block;
}
.pc-detail-btn:hover { background: rgba(255,255,255,.22); }

.pc-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  padding: 40px 0;
}

/* ── 선수 상세 모달 ──────────────────────────── */
.pc-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1050;
}
.pc-modal-overlay.active { display: block; }

.pc-modal {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(460px, 100vw);
  background: #fff;
  z-index: 1051;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 32px rgba(0,0,0,.18);
}
.pc-modal.active { display: flex; }

.pc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--primary, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.pc-modal-head button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.pc-modal-head button:hover { background: rgba(255,255,255,.2); }

.pc-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

/* 모달 선수 헤더 */
.pc-modal-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 14px;
  borderless: 1px solid #e9ecef;
  border-radius: 12px;
  background: #f8fafc;
}
.pc-modal-photo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pc-modal-photo { width: 100%; height: 100%; object-fit: cover; }
.pc-modal-initial { font-size: 2rem; font-weight: 900; color: #aaa; }

.pc-modal-hero-info { flex: 1; }
.pc-modal-name { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.pc-modal-meta { margin-bottom: 8px; }
.pc-modal-ovr-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pc-modal-ovr-big {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  color: #1a1a2e;
}

/* 전체 스탯 바 */
.pc-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.pc-stat-label {
  width: 80px;
  min-width: 80px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #444;
  flex-shrink: 0;
  white-space: nowrap;
}
.pc-weight {
  font-size: 0.65rem;
  color: #999;
  font-weight: 400;
  margin-left: 3px;
}
.pc-stat-bar-wrap {
  flex: 1;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}
.pc-stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
  min-width: 2px;
}
.pc-stat-num {
  width: 28px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 700;
  color: #333;
  flex-shrink: 0;
}

/* 비공개 능력치 */
.pc-hidden-stats {
  margin-top: 16px;
  padding: 14px;
  background: #fdf4ff;
  border-radius: 12px;
  border: 1px dashed #c77dff;
}
.pc-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #666;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 편집 영역 */
.pc-edit-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pc-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pc-edit-hidden { background: #fdf4ff; padding: 6px 10px; border-radius: 8px; }
.pc-edit-label {
  width: 80px;
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
}
.pc-edit-slider-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pc-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #dee2e6;
  border-radius: 2px;
  outline: none;
}
.pc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.pc-slider-val {
  width: 28px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
}
.pc-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e9ecef;
}

/* 모바일: 카드 크기 조정 */
@media (max-width: 480px) {
  .pc-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pc-ovr-num { font-size: 1.5rem; }
  .pc-photo-wrap { width: 60px; height: 60px; }
}

/* =====================================================
   선수카드 v2 — 신규 요소
   ===================================================== */

/* Page header */
.pc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.pc-page-title   { margin: 0; font-size: 1.4rem; font-weight: 800; }
.pc-page-sub     { margin: 2px 0 0; font-size: .82rem; color: #888; }
.pc-legend-note  { margin-left: 12px; color: #aaa; font-size: .75rem; }

/* Mode toggle button */
.pc-mode-btn {
  padding: 8px 18px;
  border-radius: 24px;
  border: 2px solid var(--primary, #2563eb);
  background: #fff;
  color: var(--primary, #2563eb);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.pc-mode-btn:hover  { background: #eff6ff; }
.pc-mode-btn.active { background: var(--primary, #2563eb); color: #fff; }

/* Grade sections */
.pc-grade-section     { margin-bottom: 28px; }
.pc-grade-section-hd  { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.pc-section-label     { font-weight: 800; font-size: .95rem; color: #333; }
.pc-section-count     { font-size: .82rem; color: #999; }
.pc-section-line      { flex: 1; height: 1px; background: #e9ecef; margin-left: 4px; }

/* Unrated badge on card */
.pc-unrated-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Loading indicator */
.pc-loading { text-align: center; color: #aaa; padding: 50px; font-size: .95rem; }

/* Extra stats label in modal */
.pc-extra-stats-label {
  font-size: .75rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 14px 0 6px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

/* My OVR row */
.pc-my-ovr-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pc-my-ovr     { font-size: 1.4rem; font-weight: 800; color: var(--primary, #2563eb); }

/* edit details/summary */
.pc-edit-details {
  margin-top: 16px;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  overflow: hidden;
}
.pc-edit-summary {
  padding: 12px 16px;
  background: #f8fafc;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.pc-edit-summary::-webkit-details-marker { display: none; }
.pc-edit-details[open] .pc-edit-summary  { border-bottom: 1px solid #e9ecef; }
.pc-edit-details .pc-edit-grid           { padding: 0 14px; }
.pc-edit-details .pc-edit-actions        { padding: 12px 14px; }


/* ================================================
   Player Card v6 additions
   ================================================ */

/* Fix label wrapping in mini stat bars */
.pc-ms-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Two-tab mode bar */
.pc-tab-bar {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.pc-tab-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid var(--primary, #3498db);
    background: transparent;
    color: var(--primary, #3498db);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.pc-tab-btn.active {
    background: var(--primary, #3498db);
    color: #fff;
}
.pc-tab-btn:hover:not(.active) {
    background: rgba(52,152,219,.12);
}

/* Notice / guide block */
.pc-notice-block {
    background: rgba(10, 30, 60, 0.85);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 10px;
    padding: 0;
    margin: 12px 0 16px;
    overflow: hidden;
    backdrop-filter: blur(4px);
}
.pc-notice-summary {
    padding: 11px 14px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 700;
    color: #7ecfff;
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    user-select: none;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.pc-notice-summary::-webkit-details-marker { display: none; }
.pc-notice-summary small { font-weight: 400; color: rgba(200,230,255,.55); font-size: .75rem; }
.pc-notice-arrow {
    margin-left: auto;
    font-size: .7rem;
    transition: transform .25s;
    color: rgba(200,230,255,.55);
}
details.pc-notice-block[open] .pc-notice-arrow { transform: rotate(180deg); }
.pc-notice-list {
    margin: 0;
    padding: 0 16px 14px 16px;
    list-style: none;
    font-size: .82rem;
    color: #d8eeff;
    line-height: 1.75;
}
.pc-notice-list li { padding: 2px 0; }
.pc-notice-list strong { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.pc-notice-highlight { color: #ffd86e !important; font-weight: 700; }
.pc-notice-list .text-muted { color: rgba(200,230,255,.5) !important; }

/* Ghost card (avg mode, unrated) */
.pc-card-ghost {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%) !important;
    border: 2px dashed rgba(255,255,255,.2) !important;
    opacity: .75;
}
.pc-card-ghost:hover { opacity: 1; }
.pc-ovr-ghost {
    color: rgba(255,255,255,.3) !important;
    font-size: 1.4rem !important;
}
.pc-ghost-msg {
    text-align: center;
    color: rgba(255,255,255,.45);
    font-size: .78rem;
    line-height: 1.5;
    padding: 6px 0 4px;
}
.pc-ghost-msg small { font-size: .72rem; }
.pc-grade-badge-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 4px;
    background: #444;
    color: #888;
    font-size: .75rem;
    font-weight: 700;
}

/* No-ratings message inside modal */
.pc-no-rating-msg {
    text-align: center;
    padding: 20px 10px;
    color: #aaa;
    font-size: .85rem;
    line-height: 1.6;
}
.pc-no-rating-msg i { font-size: 1.2rem; margin-bottom: 6px; display: block; }

/* Self-rating blocked message */
.pc-self-block {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: .85rem;
    font-weight: 600;
}
.pc-self-block i { margin-right: 6px; }

/* Unrated badge on mine-mode card */
.pc-unrated-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,.6);
    color: #ccc;
    font-size: .65rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}

/* ================================================
   Player Card v7 — 동의 게이트 / 나이·키 / 헤더 개선
   ================================================ */

/* 페이지 헤더 우측 그룹 */
.pc-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* 시즌 선택 피커 */
.pc-season-picker {
    position: relative;
}
.pc-season-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(80,180,255,.45);
    background: rgba(80,180,255,.1);
    color: rgba(160,220,255,.95);
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.pc-season-btn:hover { background: rgba(80,180,255,.2); }
#pc-season-arrow {
    font-size: .68rem;
    transition: transform .22s ease;
}
.pc-season-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 170px;
    background: #152845;
    border: 1px solid rgba(80,180,255,.3);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.55);
    z-index: 300;
    overflow: hidden;
}
.pc-season-dropdown.active { display: block; }
.pc-season-item {
    padding: 10px 16px;
    font-size: .83rem;
    color: rgba(255,255,255,.72);
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pc-season-item:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,.05); }
.pc-season-item:hover { background: rgba(255,255,255,.07); }
.pc-season-item.pc-season-active {
    color: #80d4ff;
    font-weight: 700;
    background: rgba(80,180,255,.12);
}
.pc-season-cur {
    font-size: .68rem;
    background: rgba(80,180,255,.22);
    color: #80d4ff;
    padding: 1px 7px;
    border-radius: 8px;
    margin-left: 6px;
    font-weight: 600;
}

/* 분야별 Top3 */
.pc-top3-wrap {
    margin-top: 44px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.pc-top3-hd {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pc-top3-hd .fas { color: #f1c40f; font-size: 1rem; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pc-top3-sub {
    font-size: .72rem;
    color: #64748b;
    font-weight: 400;
    margin-left: 4px;
}
.pc-top3-group {
    margin-bottom: 26px;
}
.pc-top3-glabel {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 10px;
    padding-left: 2px;
}
.pc-top3-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pc-top3-cat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px 12px;
    flex: 1 1 155px;
    min-width: 155px;
    max-width: 200px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.pc-top3-cat-hd {
    font-size: .78rem;
    font-weight: 700;
    color: #1e293b;
    padding-left: 9px;
    margin-bottom: 8px;
}
.pc-top3-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.pc-t3-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}
.pc-t3-item:hover { background: #f1f5f9; }
.pc-t3-medal {
    font-size: .95rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.pc-t3-photo-wrap {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,.1);
}
.pc-t3-photo { width: 100%; height: 100%; object-fit: cover; }
.pc-t3-initial {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 700; color: #475569;
    background: #e2e8f0;
}
.pc-t3-info { flex: 1; min-width: 0; }
.pc-t3-name {
    font-size: .75rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pc-t3-val {
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
}
@media (max-width: 500px) {
    .pc-top3-cat { min-width: 140px; }
}

/* 점수계산 방식 버튼 */
.pc-formula-btn {
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid rgba(100,180,255,.5);
    background: transparent;
    color: rgba(130,200,255,.9);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.pc-formula-btn:hover {
    background: rgba(80,160,255,.15);
    color: #90c8ff;
}

/* 점수계산 방식 모달 */
.pc-formula-modal {
    max-width: 480px;
    width: 94%;
}
.pc-formula-body {
    padding: 4px 0 8px;
}
.pc-formula-intro {
    font-size: .88rem;
    color: rgba(255,255,255,.75);
    margin-bottom: 10px;
    line-height: 1.6;
}
.pc-formula-expr {
    display: inline-block;
    background: rgba(255,255,255,.07);
    border-left: 3px solid #64b4ff;
    padding: 8px 14px;
    border-radius: 0 8px 8px 0;
    font-size: .9rem;
    color: #aee0ff;
    font-family: monospace;
    letter-spacing: .04em;
    margin-bottom: 16px;
}
.pc-formula-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}
.pc-formula-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.pc-formula-table th,
.pc-formula-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    color: rgba(255,255,255,.8);
    text-align: left;
}
.pc-formula-table thead th {
    color: rgba(255,255,255,.45);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding-bottom: 8px;
}
.pc-formula-table tfoot td {
    border-top: 1px solid rgba(255,255,255,.18);
    border-bottom: none;
}
.pc-formula-table .pf-total {
    text-align: right;
    font-weight: 700;
    color: #aee0ff;
    font-size: .82rem;
}
.pf-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.pf-w {
    font-weight: 700;
    color: #fff;
    text-align: center;
    width: 60px;
}
.pf-w-extra {
    color: #ffd580;
}
.pc-formula-grade {
    background: rgba(255,255,255,.05);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.pc-formula-grade-title {
    font-size: .75rem;
    color: rgba(255,255,255,.45);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.pc-formula-grade-list {
    font-size: .82rem;
    color: rgba(255,255,255,.75);
    line-height: 2;
}
.pc-formula-note {
    font-size: .78rem;
    color: rgba(255,255,255,.45);
    margin: 0;
    line-height: 1.5;
}

/* 동의 철회 버튼 */
.pc-revoke-btn {
    padding: 4px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255,100,100,.5);
    background: transparent;
    color: rgba(255,150,150,.9);
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.pc-revoke-btn:hover {
    background: rgba(255,80,80,.15);
    color: #ff9090;
}

/* 카드 나이·키 라인 */
.pc-age-hei {
    font-size: .72rem;
    color: rgba(255,255,255,.5);
    text-align: center;
    margin: 2px 0 4px;
    letter-spacing: .02em;
}

/* 모달 메타 (나이·키) */
.pc-modal-meta-item {
    display: inline-block;
    font-size: .78rem;
    color: rgba(255,255,255,.6);
    margin-left: 4px;
}

/* 동의 게이트 화면 */
.pc-agree-gate {
    max-width: 520px;
    margin: 40px auto;
    background: rgba(10,25,50,.92);
    border: 1px solid rgba(100,180,255,.25);
    border-radius: 16px;
    padding: 32px 28px;
    text-align: center;
    backdrop-filter: blur(6px);
}
.pc-agree-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}
.pc-agree-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #7ecfff;
    margin-bottom: 18px;
}
.pc-agree-body {
    text-align: left;
    font-size: .88rem;
    color: #c8e6ff;
    line-height: 1.7;
    margin-bottom: 22px;
}
.pc-agree-body p { margin-bottom: 10px; }
.pc-agree-body strong { color: #fff; }
.pc-agree-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 14px;
}
.pc-agree-list li { padding: 3px 0; }
.pc-agree-note {
    font-size: .78rem;
    color: rgba(200,230,255,.55);
    margin-top: 10px;
}
.pc-agree-actions {
    margin-top: 6px;
}
.pc-agree-actions .btn-lg {
    font-size: .9rem;
    padding: 10px 24px;
    border-radius: 24px;
    font-weight: 700;
}
.pc-agree-cancel-link {
    margin-top: 14px;
    font-size: .78rem;
    color: rgba(200,230,255,.45);
}
.pc-agree-cancel-link a {
    color: rgba(200,230,255,.65);
    text-decoration: underline;
}

/* ===== iOS PWA 설치 가이드 배너 ===== */
#pwa-ios-banner {
  display: none;
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 8px);
  left: 12px;
  right: 12px;
  background: #1e3a8a;
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px 16px;
  z-index: 1050;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: slideUp .3s ease;
}
.ios-banner-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}
#pwa-ios-banner .banner-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  padding-right: 28px;
}
#pwa-ios-banner .banner-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,.7);
  margin-bottom: 10px;
}
.ios-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ios-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  background: rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 7px 10px;
}
.ios-step-num {
  background: var(--primary, #2563eb);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
/* iOS 공유 아이콘 (SVG 인라인) */
.ios-share-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8'/%3E%3Cpolyline points='16 6 12 2 8 6'/%3E%3Cline x1='12' y1='2' x2='12' y2='15'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin: 0 2px;
}
.ios-share-icon-sm {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8'/%3E%3Cpolyline points='16 6 12 2 8 6'/%3E%3Cline x1='12' y1='2' x2='12' y2='15'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin: 0 1px;
}

/* ===== 홈 페이지 설치 카드 ===== */
#home-install-card {
  display: none;
  position: relative;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #60a5fa 100%);
  color: #fff;
  border-radius: 16px;
  padding: 18px 16px 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 24px rgba(37,99,235,.45);
}
.hic-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(255,255,255,.22);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background .15s;
}
.hic-close:hover { background: rgba(255,255,255,.4); }
#home-install-android,
#home-install-ios {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.hic-app-icon {
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,.22);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.hic-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 6px;
}
.hic-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hic-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}
.hic-row2 {
  font-size: 0.75rem;
  color: rgba(255,255,255,.82);
  line-height: 1.4;
}
.hic-btn {
  background: #fff;
  color: #1d4ed8;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .1s, box-shadow .1s;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  white-space: nowrap;
}
.hic-btn:active { transform: scale(.96); }

/* ===== iPhone Standalone Safe Area (아이폰 전용) ===== */
html.ios-standalone {
  --safe-top: env(safe-area-inset-top, 0px);
}

html.ios-standalone .header.fixed-top {
  padding-top: var(--safe-top);
  height: calc(var(--header-h) + var(--safe-top));
}

html.ios-standalone .header.fixed-top .navbar {
  height: var(--header-h);
}

html.ios-standalone .main-content {
  padding-top: calc(var(--header-h) + var(--safe-top) + 16px) !important;
}

html.ios-standalone #sidenav-main {
  top: calc(var(--header-h) + var(--safe-top)) !important;
}

html.ios-standalone #bottom-nav {
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}
