/* ================================
   깔끔한 흰바탕 디자인
   ================================ */
:root{
  --w: 1200px;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
}

* { 
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body{
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { 
  color: inherit; 
  text-decoration: none; 
}

.container { 
  max-width: var(--w); 
  margin: 0 auto; 
  padding: 24px 20px;
}

/* ================================
   TOPBAR / NAV
================================ */
.topbar{
  position: sticky; 
  top: 0; 
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: visible;
}

.nav{
  position: relative;
  display: flex; 
  gap: 20px; 
  align-items: center; 
  justify-content: space-between;
  padding: 16px 20px; 
  max-width: var(--w); 
  margin: 0 auto;
}

.brand { 
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900; 
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.5px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.brand:hover {
  opacity: 0.7;
}

.brand::before{
  content: "";
  width: 22px;
  height: 22px;
  display: inline-block;
  background-image: url("/favicon_io/favicon-32x32.png");
  background-size: cover;
  background-repeat: no-repeat;
}

.home-hero-title{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  text-align: center;
  width: 100%;
}
.home-hero-title::before{
  content: "";
  width: 28px;
  height: 28px;
  display: inline-block;
  background-image: url("/favicon_io/favicon-32x32.png");
  background-size: cover;
  background-repeat: no-repeat;
}

/* 공통 모달 오버레이 & 카드 & 닫기 버튼 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
}

.modal-card {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 20px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.15s ease;
  z-index: 1;
}
.modal-close:hover {
  color: #111827;
}

.menu { 
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap; 
}

.menu a{
  padding: 10px 16px; 
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.menu a:hover{
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: none !important;
}

.mobile-menu-btn:hover {
  background: rgba(148, 163, 184, 0.1) !important;
}

.mobile-menu-btn:active {
  background: rgba(148, 163, 184, 0.15) !important;
}

.mobile-menu-btn:focus {
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.mobile-menu-btn:focus-visible {
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-btn span + span {
  margin-top: 4px;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ================================
   ADMIN DASHBOARD LAYOUT
================================ */
.admin-mobile-menu-btn {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 101;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: transparent !important;
  border: none !important;
  border-radius: 8px;
  outline: none !important;
  cursor: pointer;
  padding: 6px;
  transition: all 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
  box-shadow: none !important;
}

.admin-mobile-menu-btn:hover {
  background: rgba(148, 163, 184, 0.1) !important;
}

.admin-mobile-menu-btn:active {
  background: rgba(148, 163, 184, 0.15) !important;
}

.admin-mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #1f2937;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.admin-mobile-menu-btn span + span {
  margin-top: 4px;
}

.admin-mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.admin-mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.admin-mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.admin-layout {
  min-height: 100vh;
  display: flex;
  background: #0f172a;
  position: relative;
}

.admin-sidebar {
  width: 240px;
  background: #020617;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 16px;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

.admin-sidebar::-webkit-scrollbar {
  width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.admin-sidebar-header {
  margin-bottom: 8px;
}

.admin-logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.admin-logo-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.admin-menu-item {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-menu-item:hover {
  background: rgba(148, 163, 184, 0.18);
}

.admin-menu-item:active {
  background: rgba(148, 163, 184, 0.25);
}

.admin-menu-item:focus {
  outline: none;
  background: rgba(148, 163, 184, 0.18);
}

.admin-menu-item.active {
  background: #e5e7eb;
  color: #020617;
}

.admin-sidebar-footer {
  margin-top: auto;
}

.admin-logout-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: transparent;
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-logout-btn:hover {
  background: #f87171;
  border-color: #fecaca;
  color: #0b1120;
}

.admin-main {
  flex: 1;
  background: var(--bg-secondary);
  padding: 24px 24px 40px;
  overflow-x: hidden;
  margin-left: 240px;
  min-height: 100vh;
}

.admin-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-main-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.admin-main-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

/* ================================
   LAYOUT
================================ */
h1 { 
  margin: 0 0 24px; 
  font-size: 32px; 
  font-weight: 900; 
  letter-spacing: -0.5px;
  color: var(--text);
}

h2 { 
  margin: 0 0 16px; 
  font-size: 20px; 
  font-weight: 700;
  color: var(--text);
}

.small { 
  opacity: 0.8; 
  font-size: 14px; 
  line-height: 1.6; 
  color: var(--text-muted);
}

.center{ 
  display: flex; 
  justify-content: center; 
}

.grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
  gap: 20px; 
  margin-bottom: 20px;
}

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

/* ================================
   HOME PAGE
================================ */
.home-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.home-card:hover {
  background: var(--bg);
  box-shadow: none;
  transform: none;
  border-color: #111827;
}

@media (max-width: 520px) {
  .home-card {
    padding: 20px 12px;
  }
}

/* ================================
   CARD
================================ */
.card{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.card:hover{
  box-shadow: var(--shadow-md);
}

.card h2{
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* ================================
   TABLE
================================ */
.table{
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.table th, .table td{
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table thead th{ 
  background: var(--bg-secondary);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

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

.table tbody tr:hover{ 
  background: var(--bg-secondary);
}

.table tbody td{
  text-align: center;
}

.table tbody td:first-child{
  text-align: left;
  font-weight: 600;
}

.table thead th{
  text-align: center;
}

.table thead th:first-child{
  text-align: left;
}

/* 한 줄 테이블 전용 (가로 스크롤과 함께 사용) */
.table--nowrap th,
.table--nowrap td{
  white-space: nowrap;
}

/* 가로 스크롤 래퍼 */
.table-scroll{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll .table{
  width: 100%;
  min-width: 100%;
}

/* ================================
   SCHEDULE
================================ */
.matchList { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}

.matchRow{
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.matchRow:hover{
  background: var(--bg-secondary);
  box-shadow: none;
  transform: none;
  border-color: #111827;
}

.matchRow.played{ 
  background: var(--bg);
  border-color: #111827;
}
.matchLink{
  display: block;
  color: inherit;
  text-decoration: none;
}

/* MATCH DETAIL */
.scorecard{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
}
.score-team{
  text-align: center;
}
.score-name{
  font-weight: 800;
  font-size: 16px;
}
.score-link{
  text-decoration: none;
  color: inherit;
}
.score-core{
  font-weight: 900;
  font-size: 22px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}
.metaGrid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.metaVal{
  font-weight: 700;
  color: var(--text);
}

.matchTeams{ 
  font-weight: 700; 
  color: var(--text);
}

.matchMeta{
  font-weight: 600;
  color: var(--text-muted);
  font-size: 14px;
}

/* ================================
   INPUTS / BUTTONS
================================ */
input, select, textarea{
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

input:focus, select:focus, textarea:focus{
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.1);
}

textarea{
  min-height: 200px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.row { 
  display: flex; 
  gap: 16px; 
  align-items: flex-start; 
  margin: 16px 0; 
  flex-wrap: wrap; 
}

.row > label.lbl {
  min-width: 100px;
  flex-shrink: 0;
}

.row.two { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 16px; 
  align-items: start; 
}

@media (max-width: 520px) { 
  .row.two { 
    grid-template-columns: 1fr;
    gap: 12px;
  } 
}

.lbl { 
  font-size: 14px; 
  font-weight: 600; 
  display: block; 
  margin-bottom: 8px; 
  color: var(--text);
}

.btns { 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap; 
  margin-top: 16px; 
}

button{
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

button:hover{
  background: var(--bg-secondary);
  border-color: #9ca3af;
  color: var(--text);
}

button.ghost{ 
  background: transparent;
  border-color: var(--border);
}

button.ghost:hover{
  background: var(--bg-secondary);
}

button:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

button.primary,
button:not(.ghost):not(:disabled):hover{
  background: #4b5563;
  border-color: #4b5563;
  color: white;
}

button.primary:hover{
  background: #374151;
}

/* ================================
   LINKS
================================ */
.teamLink{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  transition: all 0.2s;
}

.teamLink:hover{
  background: var(--bg-secondary);
  border-color: #111827;
  color: var(--text);
}

.playerLink{
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s;
}

.playerLink:hover{ 
  color: var(--text);
}

/* ================================
   PILL / BADGE
================================ */
.pill{
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 14px;
}

.pill[data-kind="win"]{
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.pill[data-kind="hot"]{ 
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.pill[data-kind="neutral"]{ 
  background: var(--bg-secondary);
  border-color: var(--border);
}

/* ================================
   FORM (최근 3경기)
================================ */
.formRow{
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.formLabel{
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.formDots{ 
  display: inline-flex; 
  gap: 8px; 
  align-items: center; 
}

.formDot{
  width: 12px; 
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
}

.formDot[data-r="W"]{ 
  background: #22c55e; 
  border-color: #16a34a; 
}

.formDot[data-r="D"]{ 
  background: #94a3b8; 
  border-color: #64748b; 
}

.formDot[data-r="L"]{ 
  background: #ef4444;  
  border-color: #dc2626; 
}

.formDot[data-r="N"]{ 
  background: var(--bg); 
  border-color: var(--border); 
}

.formText{ 
  font-size: 13px; 
  color: var(--text-muted); 
  font-weight: 500; 
}

/* ================================
   MOBILE
================================ */
@media (max-width: 520px){
  /* 하단 탭바 제거됨 → 불필요한 추가 여백 제거 */
  body{
    padding-bottom: 0;
  }

  .container{ 
    padding: 16px; 
  }

  h1{ 
    font-size: 24px; 
  }

  h2{ 
    font-size: 18px; 
  }

  .card{ 
    padding: 16px; 
  }

  /* 카드 안 테이블이 남는 공간 없이 꽉 차도록 */
  .card > .table{
    margin: 0;
    width: 100%;
  }

  .menu{ 
    display: none !important; 
  }

  /* 테이블은 모바일에서도 그대로 표시 (가로 스크롤로 대응) */

  .mList{ 
    display: none; 
  }

  .matchRow{ 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 8px; 
  }

  .mItem{
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
  }

  .mTop{
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    gap: 12px;
    font-weight: 700;
    margin-bottom: 12px;
  }

  .mMeta{
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 14px;
  }

  .kv{ 
    display: flex; 
    justify-content: space-between; 
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }

  .k{ 
    color: var(--text-muted); 
    font-weight: 500; 
  }

  .v{ 
    font-weight: 600; 
  }

  .mItemLink { 
    display: block; 
  }

  .mItemLink:active { 
    transform: scale(0.98); 
  }

  /* 모바일 탭바 */
  .tabbar{
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 100;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 6px rgba(0,0,0,0.1);
  }
  .tabbarInner{
    max-width: var(--w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
  .tab{
    display:flex;
    flex-direction: column;
    align-items:center;
    justify-content:center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
  }
  .tab .ico{ font-size: 18px; line-height: 1; }

  .tab.active{
    background: var(--bg-secondary);
    color: var(--primary);
  }
  .tab.active .ico{ color: var(--primary); }
}

/* ================================
   UTILITIES
================================ */
.goalList{
  margin-top: 12px;
}

.goalItem{
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.warn{
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #991b1b;
  font-size: 14px;
  margin-top: 12px;
}

/* PC 기본: 모바일 전용 UI 숨김 */
.mList { display: none; }
.tabbar, .sheetOverlay { display: none !important; }

/* ================================
   MOBILE OPTIMIZATION
================================ */
@media (max-width: 768px) {
  .container {
    padding: 16px 12px;
    max-width: 100%;
  }

  .home-hero-title{
    font-size: 22px !important;
    white-space: nowrap;
  }
  .home-hero-title::before{
    width: 22px;
    height: 22px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .card {
    padding: 16px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .nav {
    position: relative;
    padding: 12px 16px;
    max-width: 100%;
    gap: 12px;
  }

  .brand {
    font-size: 18px;
  }

  .mobile-menu-btn {
    display: flex;
    margin-left: auto;
  }

  .menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 12px 16px;
    flex-direction: column;
    gap: 4px;
    z-index: 250;
  }

  .menu.open {
    display: flex !important;
  }

  .menu a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 15px;
    color: var(--text);
    width: 100%;
    text-align: left;
  }

  .menu a:hover{
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
  }

  .card {
    padding: 16px;
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
  }

  .card > * {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .card .small {
    font-size: 13px;
    line-height: 1.6;
    max-width: 100%;
  }

  .table {
    font-size: 13px;
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  .table th, .table td {
    padding: 8px 10px;
    white-space: normal;
    word-break: keep-all;
  }

  .table-scroll .table{
    width: max-content;
    min-width: 640px;
    table-layout: auto;
  }

  .matchRow {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    min-width: max-content;
  }

  .matchList {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .matchList::-webkit-scrollbar {
    height: 6px;
  }

  .matchList::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
  }

  .matchList::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
  }

  .matchList::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
  }

  input, select, textarea {
    padding: 10px 12px;
    font-size: 14px;
  }

  button {
    padding: 10px 16px;
    font-size: 13px;
  }

  .btns {
    gap: 8px;
    flex-direction: column;
  }

  .btns button {
    width: 100%;
  }

  /* 모달 모바일 최적화 */
  .modal-card {
    max-width: calc(100vw - 24px) !important;
    width: calc(100vw - 24px) !important;
    margin: 12px !important;
    padding: 20px 16px !important;
  }

  .modal-close {
    top: 8px;
    right: 10px;
    font-size: 24px;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 모달 배경 터치 최적화 */
  .modal-overlay {
    padding: 12px !important;
    align-items: flex-end !important;
  }

  .modal-overlay > .card {
    max-height: 90vh;
    overflow-y: auto;
    margin-bottom: 0 !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
  }

  /* 관리자 페이지 모바일 최적화 */
  .admin-mobile-menu-btn {
    display: flex;
  }

  .admin-layout {
    flex-direction: column;
    position: relative;
  }

  .admin-sidebar {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    min-height: auto;
    padding: 12px 16px;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: none;
    overflow: visible;
  }

  .admin-sidebar.open {
    display: flex;
  }

  .admin-sidebar-header {
    display: none;
  }

  .admin-menu {
    width: 100%;
    flex-direction: column;
    gap: 4px;
    margin-top: 0;
  }

  .admin-menu-item {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
  }

  .admin-menu-item:hover {
    background: rgba(148, 163, 184, 0.12);
  }

  .admin-menu-item.active {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text);
  }

  .admin-sidebar-footer {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  .admin-logout-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: #dc2626;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .admin-logout-btn:hover {
    background: rgba(220, 38, 38, 0.1);
  }

  .admin-logout-btn::before {
    content: "🚪";
    font-size: 16px;
  }

  .admin-main {
    width: 100%;
    padding: 16px 12px;
    margin-left: 0;
  }

  .admin-main-header {
    padding: 16px 0;
    margin-bottom: 16px;
  }

  .admin-main-title {
    font-size: 20px;
  }

  .admin-main-sub {
    font-size: 13px;
  }

  .row.two {
    grid-template-columns: 1fr;
  }

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

  .row > * {
    width: 100%;
  }

  /* 관리자 대시보드 모바일 레이아웃 */
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    flex-direction: column;
    padding: 16px 16px 12px;
  }

  .admin-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-menu-item {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .admin-main {
    padding: 12px 12px 24px;
  }
}

@media (max-width: 520px){
  .mList { display: flex; }
  .tabbar { display: block; }
  
  /* 모바일 시트 오버레이 */
  .sheetOverlay{
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(0,0,0,.55);
    display:none;
  }
  .sheetOverlay.show{ display:block; }

  .sheet{
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    max-width: var(--w);
    margin: 0 auto;
  }
  .sheetTop{
    display:flex; align-items:center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .sheetTitle{ font-weight: 700; font-size: 16px; }
  .sheetClose{
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text);
  }
  .teamGrid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .teamBtn{
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    font-weight: 600;
    text-align: center;
    color: var(--text);
  }
  .teamBtn:hover{
    background: var(--primary);
    border-color: var(--primary);
    color: white;
  }
}
