/* 프로필 모달 이미지 개선 */
.profile-modal-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: #eee;
}

a.member-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.member-card {
  background: #f4f7f6;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 110px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  text-align: center;
  user-select: none;
}

.member-card-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.member-card.selected {
  border-color: #4CAF50;
  background: #e8f5e9;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.08);
}

.member-card .nickname {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  font-size: 1.05em;
}

.member-card .join-date {
  font-size: 0.85em;
  color: #888;
}

.participants-section h3 {
  margin-bottom: 8px;
  color: #4CAF50;
  font-size: 1.1em;
}

.selected-count {
  font-size: 0.95em;
  color: #607D8B;
  margin-bottom: 6px;
}

.selected-count.max {
  color: #E53935;
  font-weight: bold;
}

/* assets/style.css */

/* 기본 설정 */
:root {
  --primary-color: #4CAF50;
  /* 골프 잔디 색상 */
  --secondary-color: #607D8B;
  /* 차분한 회색 */
  --accent-color: #FFC107;
  /* 포인트 강조 색상 */
  --page-max-width: 1100px;
  /* centralized content width for desktop */
  --text-color: #333;
  --light-text-color: #666;
  --background-color: #f4f7f6;
  --card-background: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  --mobile-padding: 15px;
  --desktop-padding: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 헤더 */
.main-header {
  background-color: var(--card-background);
  color: var(--text-color);
  padding: var(--mobile-padding);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  font-size: 1.8em;
  line-height: 1;
}

.main-header h1 {
  font-size: 1.4em;
  margin: 0;
  color: var(--primary-color);
  font-weight: 600;
}

/* Site logo sizing: central control for consistent height and responsive scaling */
.main-header .logo img,
#siteLogo {
  height: 45px;
  /* desktop default */
  width: auto;
  display: block;
}

@media (max-width: 480px) {

  .main-header .logo img,
  #siteLogo {
    height: 40px;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* PWA install button shared style (header + page placement) */
.pwa-install-btn {
  padding: 2px 8px;
  margin: 1px 2px;
  border-radius: 10px;
  background: linear-gradient(90deg, #1fdfc5, #026669);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.8em;
  box-shadow: 0 6px 18px rgba(255, 152, 0, 0.12);
  cursor: pointer;
  display: inline-block;
}

.pwa-install-btn:hover {
  filter: brightness(1.02) saturate(1.05);
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .pwa-install-btn {
    padding: 2px 8px;
    font-size: 0.80em;
  }
}

.user-info {
  color: var(--text-color);
  font-size: 0.9em;
  font-weight: 500;
}

/* 로그아웃 버튼 */
.logout-button {
  padding: 6px 12px;
  background-color: var(--secondary-color);
  color: white !important;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.logout-button:hover {
  background-color: #546E7A;
  text-decoration: none;
}

/* 로그인/회원가입 버튼 */
.header-right .login-button,
.header-right .register-button {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-right .login-button {
  background-color: var(--primary-color);
  color: white;
}

.header-right .register-button {
  background-color: var(--accent-color);
  color: var(--text-color);
}

.header-right .login-button:hover {
  background-color: #45a049;
}

.header-right .register-button:hover {
  background-color: #ffb300;
}

/* 모바일에서 헤더 버튼 크기 조정 */
@media (max-width: 480px) {
  .main-header {
    padding: 10px 15px;
  }

  .main-header h1 {
    font-size: 1.2em;
  }

  .header-right {
    gap: 6px;
  }

  .header-right .login-button,
  .header-right .register-button {
    padding: 5px 8px;
    font-size: 0.75em;
  }

  .user-info {
    font-size: 0.8em;
  }

  .logout-button {
    padding: 5px 8px;
    font-size: 0.75em;
  }

  /* 포인트 페이지 작은 화면 최적화 */
  .points-balance-card {
    padding: 18px;
    margin-bottom: 20px;
  }

  .balance-header h2 {
    font-size: 1.1em;
    color: #FFD700;
    /* 골드색 유지 */
  }

  .balance-number {
    font-size: 1.6em;
  }

  .service-card {
    padding: 12px;
  }

  .service-header {
    gap: 8px;
    margin-bottom: 10px;
  }

  .service-icon {
    font-size: 1.6em;
  }

  .service-title {
    font-size: 1em;
  }

  .service-description {
    font-size: 0.8em;
    margin-bottom: 10px;
  }

  .service-price {
    font-size: 0.9em;
    margin-bottom: 10px;
    line-height: 1.7;
  }
}

/* 매우 작은 화면 (300px 이하) 추가 최적화 */
@media (max-width: 320px) {
  .container {
    padding: 10px;
  }

  .points-balance-card {
    padding: 15px;
  }

  .balance-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .current-balance {
    text-align: left;
    width: 100%;
  }

  .balance-number {
    font-size: 1.6em;
    white-space: nowrap;
  }

  /* 탭(풀-블리드)과 아래 그룹셀렉터 간 간격 확보 */
  .rounds-top-bar>nav.fullwidth-tabs {
    margin-bottom: 10px;
  }

  /* 페이지 컨테이너(그룹 선택 등)는 nav 아래에 오므로 시각적으로 nav가 떠보이지 않도록 정리 */
  .rounds-top-bar>.page-container {
    position: relative;
    z-index: 1;
  }

  .service-card {
    padding: 10px;
  }

  .service-header {
    gap: 6px;
    margin-bottom: 8px;
  }

  .service-icon {
    font-size: 1.4em;
  }

  .service-title {
    font-size: 0.95em;
  }

  .status-badge {
    font-size: 0.7em;
    padding: 2px 5px;
  }

  .expiry-date {
    font-size: 0.75em;
  }
}

.logout-button:hover {
  background-color: #546E7A;
}


/* 버튼 스타일 */
.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.95em;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.1s ease;
  border: none;
  font-weight: 600;
  white-space: nowrap;
}

.button:active {
  transform: translateY(1px);
}

.primary-button {
  background-color: var(--primary-color);
  color: white;
}

.primary-button:hover {
  background-color: #43A047;
}

.secondary-button {
  background-color: var(--secondary-color);
  color: white;
}

.secondary-button:hover {
  background-color: #546E7A;
}

.danger-button {
  background-color: #EF5350;
  color: white;
}

.danger-button:hover {
  background-color: #E53935;
}

.orange-button {
  background-color: #FF9800;
  color: white;
}

.orange-button:hover {
  background-color: #F57C00;
}

.orange-button:disabled {
  background-color: #FFCC80;
  cursor: not-allowed;
  opacity: 0.6;
}

.large-button {
  padding: 12px 25px;
  font-size: 1.1em;
}

.small-button {
  padding: 6px 12px;
  font-size: 0.8em;
  border-radius: 6px;
  min-width: auto;
  white-space: nowrap;
}

/* 그룹 액션 버튼들 간격 조정 */
.group-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  width: 100%;
  justify-content: flex-end;
  align-items: center;
}

.group-actions .small-button {
  flex-grow: 0;
  flex-shrink: 0;
}

/* 그룹 선택 버튼 스타일 개선 */
.group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 15px;
}

.group-buttons .button {
  padding: 12px 24px;
  font-size: 1em;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.group-buttons .primary-button {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.group-buttons .primary-button:hover {
  background-color: #388E3C;
  box-shadow: 0 6px 20px rgba(56, 142, 60, 0.6);
}

.group-buttons .secondary-button {
  background-color: var(--secondary-color);
  color: white;
}

.group-buttons .secondary-button:hover {
  background-color: #455A64;
  box-shadow: 0 4px 10px rgba(69, 90, 100, 0.5);
}

/* 라운드 카드 스타일 개선 */
.rounds-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 15px;
  width: 100%;
}

.round-item {
  background-color: var(--card-background);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 18px;
  display: block;
  transition: box-shadow 0.3s ease;
  max-width: 100%;
  min-width: 300px;
  /* 최근경기> 최근라운드 카드 최소 너비 설정 */
  margin: 0 0 15px 0;
}

.round-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.round-item .round-info {
  margin-bottom: 12px;
}

.round-item .round-actions {
  text-align: right;
}

.round-card {
  background-color: var(--card-background);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: block;
  transition: box-shadow 0.3s ease;
  margin-bottom: 15px;
  max-width: 100%;
  min-width: 0;
  /* allow cards to shrink on narrow viewports; mobile-specific styles further tune spacing */
}

/* 스코어카드 페이지용 round-card는 세로 배치 */
.scorecard-page .round-card {
  display: block;
  padding: 20px;
  max-width: 100%;
}

.round-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.round-info h3 {
  font-size: 1.2em;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.round-info .round-date,
.round-info .round-players {
  font-size: 0.9em;
  color: var(--text-color);
  margin-bottom: 4px;
}

.round-actions .button {
  padding: 8px 16px;
  font-size: 0.9em;
  border-radius: 10px;
}

/* 반응형 간단 보완 */
@media (max-width: 480px) {
  .group-buttons {
    justify-content: center;
  }

  .round-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .round-actions {
    margin-top: 12px;
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
}

/* 메인 컨테이너: constrained to the page max width for desktop */
.container {
  max-width: 100%;
  margin: 10px auto;
  padding: 8px 6px;
  flex-grow: 1;
  /* 푸터가 항상 아래에 있도록 */
}

@media (min-width: 768px) {
  .container {
    max-width: var(--page-max-width);
  }
}

/* 스코어카드 페이지는 전체 너비 사용 */
.scorecard-page .container {
  max-width: 100%;
  margin: 10px auto;
  padding: 8px 6px;
}

/* 그룹 페이지도 기본 container max-width 사용 */
body:has(.group-management) .container {
  max-width: var(--page-max-width);
  /* 1100px, 포인트 페이지와 동일 */
  min-width: 320px;
}

section {
  background-color: var(--card-background);
  padding: 25px;
  margin-bottom: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

section h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.6em;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

/* 폼 스타일 */
form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

form label {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 5px;
  font-size: 0.95em;
}

form input[type="email"],
form input[type="password"],
form input[type="text"],
form input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1em;
  margin-bottom: 10px;
}

form button {
  margin-top: 10px;
  width: 100%;
  /* 모바일에서 폼 버튼 너비 */
}

.guest-intro {
  text-align: center;
  padding: 40px var(--mobile-padding);
}

.guest-intro h2 {
  font-size: 1.8em;
  color: var(--primary-color);
  margin-bottom: 15px;
  border-bottom: none;
}

.guest-intro p {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: var(--light-text-color);
}


/* 대시보드 (index.php) */
.dashboard .quick-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
  flex-wrap: wrap;
  /* 모바일에서 줄바꿈 */
}

.dashboard .quick-actions .button {
  flex-grow: 1;
  min-width: 120px;
}

.info-card {
  background-color: #e8f5e9;
  /* Light green */
  border-left: 5px solid var(--primary-color);
  padding: 20px;
  margin-top: 30px;
  border-radius: 5px;
}

.info-card h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

/* 홈 - 최근 스코어 카드 (상단 배치, 강조 디자인) */
.home-score-card {
  background: linear-gradient(135deg, #1565C0, #0D47A1, #01579B);
  color: white;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 25px rgba(13, 71, 161, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}

.home-score-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(13, 71, 161, 0.35);
}

.home-score-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 2px;
}

.score-icon {
  font-size: 1.1em;
}

.score-label {
  font-size: 1.1em;
  font-weight: 600;
  color: #64DD17;
}

.home-score-number {
  font-size: 5em;
  font-weight: 800;
  color: #FFEB3B;
  line-height: 1;
  margin: 5px 0;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  letter-spacing: 3px;
}

.home-score-meta {
  font-size: 1.1;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 5px;
}

@media (max-width: 480px) {
  .home-score-card {
    padding: 15px 18px;
    margin-bottom: 18px;
  }

  .home-score-number {
    font-size: 3.8em;
  }

  .score-label {
    font-size: 1.1em;
  }

  .home-score-meta {
    font-size: 0.8em;
  }
}

/* 공인 핸디캡 카드 */
.handicap-card {
  background: linear-gradient(135deg, #e8f4f0 0%, #d4eee5 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #b8dac8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.handicap-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.handicap-user {
  flex: 1;
}

.handicap-name {
  font-size: 1.1em;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.handicap-club {
  font-size: 0.75em;
  color: #666;
  font-weight: 500;
}

.handicap-menu {
  font-size: 1.3em;
  color: #666;
  cursor: pointer;
  padding: 0 5px;
}

/* Handicap share popover (three-dot menu) */
.handicap-menu {
  position: relative;
  /* popover anchor */
}

.handicap-share-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 8px;
  min-width: 160px;
  display: none;
  z-index: 22000;
  /* above modals fallback */
}

.handicap-share-popover {
  font-size: 0.80em;
  /* overall smaller text for compact popover */
}

.handicap-share-popover .popover-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 700;
  color: #222;
}

.handicap-share-popover .popover-item:hover {
  background: #f5f5f5;
}

/* small caret indicator */
.handicap-share-popover::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: white;
  transform: rotate(45deg);
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Mobile fixed popover (applied via JS when viewport is small) */
.handicap-share-popover.mobile-fixed-popover {
  position: fixed !important;
  z-index: 23000 !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  min-width: 140px;
}

/* Utility class used during image capture to force-hide any share popovers */
.hide-popovers-for-capture .handicap-share-popover {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.handicap-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.handicap-label-box {
  flex: 1;
}

.handicap-system {
  font-size: 0.55em;
  color: #666;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.handicap-title {
  font-size: 0.85em;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 3px;
}

.handicap-date {
  font-size: 0.7em;
  color: #888;
}

.handicap-value-box {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.handicap-number {
  font-size: 4em;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
}

.handicap-arrow {
  font-size: 1.8em;
  line-height: 1;
}

.handicap-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 12px 16px;
  margin: 15px -20px -20px -20px;
  background: linear-gradient(135deg, #9efc96 0%, #a9f7e8 100%);
  border-radius: 0 0 16px 16px;
}

.handicap-logo-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.handicap-logo {
  font-size: 0.65em;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.handicap-logo.usga {
  background: #1e3a8a;
  color: white;
}

.handicap-logo.kga {
  background: white;
  color: #1e3a8a;
  border: 1.5px solid #1e3a8a;
}

.handicap-provider {
  display: flex;
  gap: 8px;
  align-items: center;
}

.smartscore-logo {
  font-size: 0.6em;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.ngolf-logo {
  font-size: 0.65em;
  font-weight: 700;
  color: #4CAF50;
}

@media (max-width: 480px) {
  .handicap-card {
    padding: 16px;
  }

  .handicap-footer {
    margin: 12px -16px -16px -16px;
    padding: 10px 14px;
  }

  .handicap-name {
    font-size: 1em;
  }

  .handicap-club {
    font-size: 0.7em;
  }

  .handicap-number {
    font-size: 3.2em;
  }

  .handicap-arrow {
    font-size: 1.5em;
  }

  .handicap-logo {
    font-size: 0.6em;
    padding: 2px 6px;
  }

  .smartscore-logo,
  .ngolf-logo {
    font-size: 0.55em;
  }
}

/* 베스트 스코어 카드 */
.best-score-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  position: relative;
  padding-top: 46px;
}

.best-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #ff4444;
  color: white;
  font-size: 0.65em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 15px;
  letter-spacing: 0.5px;
  z-index: 1;
}

.best-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.best-info {
  flex: 1;
}

.best-course-name {
  font-size: 1em;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 3px;
}

.best-date {
  font-size: 0.75em;
  color: #e53935;
}

.best-score-number {
  font-size: 2.8em;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .best-score-card {
    padding: 15px 16px;
    padding-top: 42px;
  }

  .best-badge {
    font-size: 0.6em;
    padding: 3px 8px;
    top: 14px;
    left: 14px;
  }

  .best-content {
    gap: 10px;
  }

  .best-course-name {
    font-size: 0.95em;
  }

  .best-date {
    font-size: 0.7em;
  }

  .best-score-number {
    font-size: 2.4em;
  }
}

/* 그룹 목록 (groups.php) - Accordion 스타일 */

.group-list,
.invitation-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.group-list li,
.invitation-list li {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.group-list li.active {
  border-color: var(--primary-color);
}

/* 그룹 헤더 (클릭 가능) */
.group-header {
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.group-header:hover {
  background-color: var(--hover-color, #f5f5f5);
}

.group-header:active {
  background-color: var(--active-color, #eeeeee);
}

.group-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-grow: 1;
  min-width: 0;
}

.group-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1.05em;
}

.group-owner {
  font-size: 0.95em;
  white-space: nowrap;
}

.group-members {
  font-size: 0.95em;
  white-space: nowrap;
}

.toggle-icon {
  font-size: 0.9em;
  color: var(--light-text-color);
  transition: transform 0.3s ease;
  margin-left: 12px;
  flex-shrink: 0;
}

.group-list li span,
.invitation-list li span {
  font-weight: 600;
  color: var(--text-color);
}

.group-actions,
.invitation-actions {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  padding: 15px 18px;
  width: 100%;
  justify-content: flex-end;
  background-color: var(--background-color);
  border-top: 1px solid var(--border-color);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }

  to {
    opacity: 1;
    max-height: 200px;
  }
}

.group-actions .button,
.invitation-actions .button {
  flex-grow: 0;
  flex-shrink: 0;
  min-width: auto;
}

.point-info {
  font-size: 0.85em;
  color: var(--light-text-color);
  margin-top: 5px;
  width: 100%;
  text-align: right;
}

/* 모바일 최적화 */
@media (max-width: 600px) {
  .group-header {
    padding: 12px 15px;
  }

  .group-info {
    gap: 8px;
    font-size: 0.95em;
  }

  .group-name {
    font-size: 1em;
  }

  .group-owner,
  .group-members {
    font-size: 0.9em;
  }

  .toggle-icon {
    font-size: 0.85em;
    margin-left: 8px;
  }

  .group-actions,
  .invitation-actions {
    padding: 12px 15px;
    gap: 8px;
  }

  .group-actions .button,
  .invitation-actions .button {
    font-size: 0.9em;
    padding: 8px 12px;
  }
}

/* 받은 초대 알림 배지 */
.notification-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: white;
  font-size: 0.7em;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
  min-width: 18px;
  text-align: center;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(238, 90, 111, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(238, 90, 111, 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.6);
  }
}

/* 그룹 페이지 빈 상태 카드 */
.empty-state-card {
  text-align: center;
  padding: 20px 10px;
  margin: 10px auto;
  max-width: 500px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
  color: white;
}

.empty-state-card .empty-icon {
  font-size: 3.5em;
  margin-bottom: 10px;
  display: block;
  opacity: 0.9;
}

.empty-state-card h3 {
  font-size: 1.3em;
  margin-bottom: 10px;
  color: white;
  font-weight: 600;
}

.empty-state-card p {
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .empty-state-card {
    padding: 20px 10px;
    margin: 10px 0;
    border-radius: 12px;
  }

  .empty-state-card .empty-icon {
    font-size: 3em;
  }

  .empty-state-card h3 {
    font-size: 1.2em;
  }

  .empty-state-card p {
    font-size: 0.9em;
  }
}


/* 포인트 & 차트 (points.php) */
.points-summary {
  text-align: center;
}

.points-summary .current-points {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--accent-color);
  margin: 10px 0 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.chart-feature .chart-status {
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
}

.chart-status.active {
  background-color: #e8f5e9;
  /* Light green */
  color: var(--primary-color);
}

.chart-status.inactive {
  background-color: #ffe0b2;
  /* Light orange */
  color: #f57c00;
}

.chart-feature .button {
  margin: 0 auto;
  display: block;
  width: fit-content;
}

.points-log-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.9em;
}

.points-log-table th,
.points-log-table td {
  border: 1px solid var(--border-color);
  padding: 12px 8px;
  text-align: left;
}

.points-log-table th {
  background-color: var(--background-color);
  font-weight: 600;
  color: var(--secondary-color);
}

.points-log-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.points-log-table .positive {
  color: var(--primary-color);
  font-weight: 600;
}

.points-log-table .negative {
  color: #E53935;
  font-weight: 600;
}

.warning-text {
  color: #E53935;
  font-weight: 600;
  text-align: center;
  margin-top: 10px;
}


/* 푸터 */
.main-footer {
  background-color: var(--secondary-color);
  color: white;
  text-align: center;
  padding: 15px var(--mobile-padding);
  margin-top: 30px;
  font-size: 0.9em;
}

/* 하단 고정 네비게이션 
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-background);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 999;
    padding: 8px 0;
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--light-text-color);
    padding: 5px 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 50px;
    flex: 1;
}

.bottom-nav-item:hover {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--primary-color);
    text-decoration: none;
}

.bottom-nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.bottom-nav-item .nav-icon {
    font-size: 1.2em;
    margin-bottom: 2px;
}

.bottom-nav-item .nav-label {
    font-size: 0.7em;
    line-height: 1;
    margin-top: 2px;
}
*/

/* 하단 네비게이션 바 */
.nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 72px;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
  /* 전체 배경 그라디언트: 아래는 진하고 위로 갈수록 페이드 */
  background-image:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0.14) 3%,
      rgba(255, 255, 255, 0.08) 5%,
      rgba(255, 255, 255, 0) 10%),
    linear-gradient(to top, #4d556a 0%, #4d556a 100%);
  border-top: 2px solid #8292aa;
}

/* 메뉴 컨테이너 */
.nav-container {
  width: 480px;
  display: flex;
  height: 100%;
  justify-content: space-between;
  align-items: center;
}

/* 공통 메뉴 아이템 */
.nav-item {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  transition: color 0.25s ease, flex 0.25s ease, padding 0.25s ease, background 0.25s ease;
  padding: 0 8px;
  /* 기본 좌우 여백 */
}

/* 구분선 */
.nav-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background-color: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 0;
}

/* 아이콘/라벨 */
/* 기존 이모지 기반 아이콘을 이미지로 대체: .nav-img 사용 */
.nav-icon {
  font-size: 22px;
  margin-bottom: 4px;
  color: #fff;
  transition: transform 0.25s ease, filter 0.25s ease, color 0.25s ease;
}

.nav-img {
  width: 32px;
  /* 기본 아이콘 너비 (증가) */
  height: auto;
  display: block;
  margin-bottom: 6px;
  transition: transform 0.22s cubic-bezier(.2, .9, .2, 1), filter 0.22s ease, opacity 0.18s ease;
  will-change: transform, filter;
}

.nav-label {
  color: inherit;
  text-decoration: none;
}

/* 링크 전역 hover 규칙이 하단 네비에도 적용되어 밑줄이 생기므로 강제 제거 */
.nav-item,
.nav-item .nav-label,
.nav-item .nav-icon,
.bottom-nav-item,
.bottom-nav-item .nav-label,
.bottom-nav-item .nav-icon {
  text-decoration: none !important;
}

.nav-item:hover,
.bottom-nav-item:hover {
  text-decoration: none !important;
}

/* pressed 상태: 즉각적인 피드백만 주고 스케일은 하지 않음 (페이지 전환 후 server-side active로 처리) */
.nav-item.pressed .nav-icon,
.bottom-nav-item.pressed .nav-icon {
  transform: none !important;
  /* prevent interim scaling */
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.28));
  opacity: 0.98;
}

/* 비선택 hover */
.nav-item:not(.active):hover {
  color: #aab9d3;
}

.nav-item:not(.active):hover .nav-icon,
.nav-item:not(.active):hover .nav-img {
  filter: drop-shadow(0 0 6px rgba(170, 185, 211, 0.65));
  transform: scale(1.12);
}

/* 선택된 메뉴: 화살표 공간을 조금 더 확보하고 레이어 기준을 명확히 */
.nav-item.active {
  color: #fff;
  background-image:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0.14) 3%,
      rgba(255, 255, 255, 0.08) 5%,
      rgba(255, 255, 255, 0) 10%),
    linear-gradient(to top, #557091 0%, #557091 100%);
  flex: 1.5;
  /* 화살표 공간 넉넉히 - 원래대로 레이아웃 변화 허용 */
  position: relative;
  /* pseudo 요소 위치 기준 */
  z-index: 2;
}

/* 기본 삼각형: 위/아래는 투명, 좌/우만 색 지정, 배경 제거 */
.nav-item.active::before,
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 9999;

  /* 삼각형 형태 */
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;

  /* 내부 채움이나 inset 제거 */
  background: transparent;
  box-shadow: none;
  -webkit-box-shadow: none;

  /* 외곽 그림자만 사용 (삼각형 모양에만 적용) */
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.36));
  opacity: 1;
}

/* 왼쪽 화살표: 오른쪽 border에 색 지정 (채움처럼 보임) */
.nav-item.active::before {
  left: 8px;
  border-right: 10px solid rgba(203, 215, 230, 1);
  /* 내부 색 */
  /* 아주 얇은 하이라이트만 남기려면 아래처럼 설정 (옵션) */
  /* box-shadow: 0 1px 0 rgba(255,255,255,0.06); */
}

/* 오른쪽 화살표: 왼쪽 border에 색 지정 */
.nav-item.active::after {
  right: 8px;
  border-left: 10px solid rgba(203, 215, 230, 1);
  /* box-shadow 제거해서 배경색 블록이 생기지 않도록 함 */
}

/* hover 강조 (그림자만 조금 강화) */
.nav-item.active:hover::before,
.nav-item.active:hover::after {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

/* 아이콘(이미지)만 확대해서 위로 이동 (라벨은 건드리지 않음) - transform 사용으로 레이아웃 변경 방지 */
.nav-item.active .nav-icon,
.nav-item.active .nav-img {
  display: inline-block;
  /* transform이 아이콘 박스에만 적용되도록 */
  transform: translateY(-12px) scale(1.6);
  /* 위로 이동 + 더 크게 확대 */
  transition: transform 0.26s cubic-bezier(.2, .9, .2, 1), opacity 0.22s ease;
  line-height: 1;
}

/* 라벨은 그대로 유지: 위치나 마진을 건드리지 않음 */
.nav-item.active .nav-label {
  display: block;
  margin-top: 0;
  /* 기존 간격 유지(필요시 조절) */
  transform: none !important;
  /* 다른 규칙이 덮어쓰는 걸 방지 */
  transition: none;
}

/* Replace pseudo-element triangles with robust inline SVG arrows
   - hide old ::before/::after triangles (they caused clipping/compat issues)
   - show .nav-arrow SVGs for the active item with a stroke (outline) + drop shadow
*/
.nav-item::before,
.nav-item::after {
  display: none !important;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  /* original size */
  height: 22px;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
  z-index: 3;
  /* above nav background but below modals */
}

.nav-arrow svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-arrow.nav-arrow-left {
  left: 8px;
  transform: translateY(-50%) translateX(-6px);
}

.nav-arrow.nav-arrow-right {
  right: 8px;
  transform: translateY(-50%) translateX(6px);
}

/* path styling: fill for interior, stroke for outline, and CSS drop-shadow for softer shadow */
.nav-arrow svg path {
  fill: #e7eef7;
  /* light interior */
  stroke: rgba(0, 0, 0, 0.55);
  /* outline color */
  stroke-width: 1.6px;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.36));
}

.nav-item.active .nav-arrow {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.nav-item.active:hover .nav-arrow svg path {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

@media (max-width:600px) {
  .nav-arrow {
    width: 18px;
    height: 18px;
  }

  .nav-arrow.nav-arrow-left {
    left: 6px;
    transform: translateY(-50%) translateX(-4px);
  }

  .nav-arrow.nav-arrow-right {
    right: 6px;
    transform: translateY(-50%) translateX(4px);
  }
}

/* 모바일 보정 */
@media (max-width:600px) {

  .nav-item.active::before,
  .nav-item.active::after {
    border-top-width: 9px;
    border-bottom-width: 9px;
  }

  .nav-item.active::before {
    left: 6px;
  }

  .nav-item.active::after {
    right: 6px;
  }

}

/* 끝: 하단 네비게이션 바 **************************/

/* 메인 컨테이너에 하단 네비게이션 공간 확보 */
body {
  padding-bottom: 70px;
}


/* 모달 (팝업) 스타일 */
.modal {
  display: none;
  /* 기본적으로 숨김 */
  position: fixed;
  /* 화면 전체를 덮음 */
  /* Raise modal stacking so it appears above sticky banners like sample-mode-banner */
  z-index: 20000 !important;
  /* ensure modals appear above other high-z elements */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  /* 내용이 길면 스크롤 가능 */
  overflow-x: hidden;
  /* prevent modal from forcing page to expand horizontally */
  background-color: rgba(0, 0, 0, 0.4);
  /* 배경을 어둡게 */
  /* 가운데 정렬을 위한 flex 속성들 */
  align-items: center;
  justify-content: center;
}

/* 모달이 표시될 때의 스타일 */
.modal[style*="display: flex"],
.modal.show {
  display: flex;
}

.modal-content {
  background-color: var(--card-background);
  margin: auto;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  /* 모바일 최적화 */
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 20001;
  /* keep modal content above the backdrop and other positioned elements */
}

/* Announcement modal: enforce a safe max width and contain wide content
   so the popup doesn't expand the page horizontally. Images/tables inside
   the announcement will scale down to fit. Use a slightly larger desktop
   max-width than the generic modal for richer announcement content. */
#announcementModal .modal-content {
  /* limit announcement width so it never expands the page horizontally */
  max-width: 680px !important;
  width: min(92%, 680px) !important;
  overflow: auto;
  /* enable internal scroll if announcement content is very tall */
  word-break: break-word;
  box-sizing: border-box;
  margin: 0 12px;
  /* small horizontal gutter on very narrow screens */
}

/* Ensure images/tables inside announcements don't force the modal wider */
#announcementModal .modal-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

#announcementModal .modal-content table {
  max-width: 100%;
  display: block;
  /* allow horizontal scrolling inside the modal if needed */
  overflow: auto;
}

#announcementModal .modal-content pre,
#announcementModal .modal-content code {
  max-width: 100%;
  white-space: pre-wrap;
  /* wrap long code blocks */
}

.modal-content h2,
.modal-content h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
  text-align: center;
}

.modal-content form {
  margin-top: 20px;
}

.close-button {
  color: var(--secondary-color);
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

/* 메시지 스타일 */
.message {
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  border: 1px solid transparent;
}

.message.success {
  background-color: #e8f5e9;
  /* Light green */
  color: #2e7d32;
  /* Darker green */
  border-color: #a5d6a7;
}

.message.error {
  background-color: #ffebee;
  /* Light red */
  color: #c62828;
  /* Darker red */
  border-color: #ef9a9a;
}

.point-detail {
  font-size: 0.9em;
  color: var(--light-text-color);
  margin-top: 5px;
}

/* 멤버 목록 스타일 */
.member-list {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

/* 멤버 스와이프 래퍼 */
.member-list .member-item-wrapper {
  position: relative;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 5px;
}

.member-list li {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-list .member-item-wrapper .member-item {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
  touch-action: pan-y;
  cursor: grab;
}

.member-list .member-item-wrapper .member-item:active {
  cursor: grabbing;
}

/* 퇴출 버튼 (뒤에 숨김) */
.member-list .member-kick-action {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80px;
  background: #f44336;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.member-list .member-kick-action button {
  background: none;
  border: none;
  color: white;
  font-weight: bold;
  font-size: 0.9em;
  cursor: pointer;
  padding: 10px;
}

.member-list li span {
  flex-grow: 1;
}

/* 초대 목록 스타일 (별도 유지) */
.invitation-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.invitation-list li {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.invitation-list li>div:first-child {
  flex-grow: 1;
  min-width: 150px;
}

.invitation-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 순위표 스타일 */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.ranking-table th,
.ranking-table td {
  border: 1px solid var(--border-color);
  padding: 8px;
  text-align: center;
}

.ranking-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
}

.ranking-table tbody tr:nth-child(even) {
  background-color: var(--background-color);
}

.ranking-table tbody tr:hover {
  background-color: #e8f5e9;
}

/* 반응형 디자인: 데스크톱 및 태블릿 */
@media (min-width: 768px) {
  .main-header {
    padding: var(--desktop-padding);
  }

  .main-header h1 {
    font-size: 1.6em;
  }

  .header-right .login-button,
  .header-right .register-button {
    padding: 8px 16px;
    font-size: 0.9em;
  }

  .user-info {
    font-size: 1em;
  }

  .logout-button {
    padding: 8px 16px;
    font-size: 0.9em;
  }

  .container {
    padding: var(--desktop-padding);
    margin: 30px auto;
  }

  section {
    padding: 35px;
  }

  section h2 {
    font-size: 1.8em;
  }

  form button {
    width: auto;
    /* 버튼 원래 너비 */
    align-self: flex-start;
    /* 왼쪽 정렬 */
  }

  .guest-intro h2 {
    font-size: 2.5em;
  }

  .guest-intro p {
    font-size: 1.2em;
  }

  .dashboard .quick-actions {
    flex-wrap: nowrap;
  }

  .dashboard .quick-actions .button {
    flex-grow: 0;
    /* 늘어나지 않음 */
    width: auto;
  }

  .group-list li,
  .invitation-list li {
    flex-wrap: nowrap;
  }

  .group-actions,
  .invitation-actions {
    margin-top: 0;
    width: auto;
  }

  .group-actions .button,
  .invitation-actions .button {
    flex-grow: 0;
  }

  .point-info {
    text-align: left;
    width: auto;
  }

}

/* 새로운 포인트 페이지 스타일 */
.points-balance-card {
  background: linear-gradient(135deg, #2E7D32, #1B5E20, #0D4F0D);
  color: white;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.balance-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 10px;
}

.balance-header h2 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 600;
  flex-shrink: 0;
  color: #FFFFFF;
  /* 흰색 */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.current-balance {
  text-align: right;
  min-width: 0;
  flex-shrink: 1;
}

.balance-number {
  font-size: 1.8em;
  font-weight: 700;
  display: inline;
  line-height: 1;
  word-break: break-all;
  color: #FFD700;
  /* 골드색 */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.balance-unit {
  font-size: 1em;
  opacity: 0.95;
  margin-left: 5px;
  color: #FFD700;
  /* 골드색 */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.charge-btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  width: 100%;
  padding: 12px;
  font-weight: 600;
}

.charge-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

/* 서비스 그리드 */
.point-services {
  margin-bottom: 30px;
}

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 20px;
}

.service-card {
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.service-card.active {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #f8fff9, #ffffff);
}

.service-card.coming-soon {
  opacity: 0.7;
  background-color: #f9f9f9;
}

.service-card {
  display: block;
}

.service-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.service-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.service-title {
  flex: 1;
  margin: 0;
  font-size: 1em;
  color: var(--text-color);
  font-weight: 600;
}

.service-info {
  width: 100%;
}

.service-info h3 {
  display: none;
  /* 헤더에서 이미 표시하므로 숨김 */
}

.service-status {
  margin-bottom: 8px;
}

.service-info h3 {
  margin: 0 0 8px 0;
  font-size: 1.1em;
  color: var(--text-color);
  word-break: keep-all;
}

.service-status {
  margin-bottom: 10px;
}

.status-badge {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 0.75em;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge:contains("✅") {
  background-color: #e8f5e8;
  color: #2e7d32;
}

.service-status.active .status-badge {
  background-color: #e8f5e8;
  color: #2e7d32;
}

.service-status.inactive .status-badge {
  background-color: #ffebee;
  color: #c62828;
}

.expiry-date {
  font-size: 0.8em;
  color: var(--primary-color);
  font-weight: 600;
  margin: 3px 0 0 0;
  word-break: keep-all;
}

.service-description {
  color: var(--light-text-color);
  font-size: 0.88em;
  line-height: 1.5;
  margin-bottom: 12px;
  word-break: keep-all;
}

.service-price {
  font-weight: 700;
  color: var(--text-color);
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 12px;
  word-break: keep-all;
}

.service-price .price-item {
  color: #222;
}

.service-price .price-item strong {
  color: var(--primary-color);
}

.service-price .price-note {
  color: #444;
  font-weight: 600;
}

.service-card .button {
  font-size: 0.9em;
  padding: 8px 16px;
  margin-top: 5px;
}

/* 포인트 내역 */
.points-log-list {
  margin-top: 15px;
}

/* 스와이프 삭제를 위한 래퍼 */
.log-item-wrapper {
  position: relative;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 8px;
}

.log-item {
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 0;
  transition: background-color 0.2s ease, transform 0.3s ease;
  position: relative;
  z-index: 2;
  touch-action: pan-y;
  /* 세로 스크롤은 허용, 가로만 제한 */
  cursor: grab;
}

.log-item:active {
  cursor: grabbing;
}

/* 삭제 버튼 (뒤에 숨김) */
.delete-action {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80px;
  background: #f44336;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.delete-action button {
  background: none;
  border: none;
  color: white;
  font-weight: bold;
  font-size: 0.9em;
  cursor: pointer;
  padding: 10px;
}


.log-item.positive {
  border-left: 4px solid var(--primary-color);
}

.log-item.negative {
  border-left: 4px solid #f44336;
}

.log-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.log-description {
  flex: 1;
  font-weight: 500;
  color: var(--text-color);
}

.log-amount {
  font-weight: 600;
  font-size: 1.1em;
}

.log-amount.plus {
  color: var(--primary-color);
}

.log-amount.minus {
  color: #f44336;
}

.log-date {
  font-size: 0.8em;
  color: var(--light-text-color);
}

.view-all-btn {
  width: 100%;
  margin-top: 15px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--light-text-color);
}

.empty-state p {
  margin-bottom: 10px;
}

/* 반응형 디자인 */
@media (min-width: 768px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .balance-number {
    font-size: 2.8em;
  }

  .service-card {
    padding: 25px;
  }
}

@media (min-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 라운드 페이지 스타일 */
.rounds-overview {
  margin-bottom: 25px;
}

.overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.overview-header h2 {
  margin: 0;
  color: var(--text-color);
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.stat-card {
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 2em;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9em;
  color: var(--light-text-color);
  font-weight: 500;
}

.recent-rounds {
  margin-bottom: 25px;
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.empty-icon {
  font-size: 4em;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: 10px;
  color: var(--text-color);
}

.empty-state p {
  color: var(--light-text-color);
  margin-bottom: 25px;
  line-height: 1.5;
  max-width: 100%;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 모바일 최적화 */
@media (max-width: 480px) {
  .overview-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .overview-header h2 {
    text-align: center;
  }

  .stats-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-number {
    font-size: 1.8em;
  }

  .empty-state {
    padding: 40px 15px;
  }

  .empty-icon {
    font-size: 3em;
  }
}

/* 모달 추가 스타일 */
.modal-service-info {
  margin: 20px 0;
}

.service-features ul {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.service-features li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9em;
}

.service-features li:last-child {
  border-bottom: none;
}

.service-pricing {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: center;
}

.price-info {
  font-size: 1.1em;
  margin-bottom: 10px;
}

.current-points {
  color: var(--primary-color);
  font-size: 0.9em;
}

.warning-text {
  color: #f44336;
  font-weight: 500;
  text-align: center;
  margin-top: 10px;
}

.fullwidth-tabs {
  width: 100%;
  margin-top: 8px;
  display: flex;
  /* let flex children ( .rounds-top-item ) expand (they use flex:1) */
  justify-content: flex-start;
  background: var(--card-background, #fff);
  box-shadow: var(--shadow);
  border-bottom: 1.5px solid var(--border-color);
  z-index: 10;
}

.rounds-top-bar {
  padding: 0 !important;
}

.rounds-top-menu {
  gap: 0;
  padding: 0;
}

.rounds-top-item {
  flex: 1 0 0;
  /* ensure equal-width tabs and allow them to shrink/grow evenly */
  text-align: center;
  padding: 14px 0 12px 0;
  font-size: 1.08em;
  font-weight: 600;
  color: #757575;
  /* subtle, very light neutral tab background */
  background: var(--tab-background, #f8f9fa);
  border: none;
  border-bottom: 3px solid transparent;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rounds-top-item:hover {
  color: #1976d2;
  background: #e3f2fd;
}

.rounds-top-item.active {
  color: #1565c0;
  /* vibrant blue active tab with strong contrast */
  background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%);
  border-bottom: 3px solid #1976d2;
  border-radius: 0;
  font-weight: 700;
  z-index: 11;
}

/* Page container to constrain wide desktop layouts and center content */
.page-container {
  width: 100%;
  max-width: var(--page-max-width);
  /* use centralized variable */
  margin: 0 auto;
  /* match .container padding so top-bar and main content align visually */
  padding: 0 var(--desktop-padding);
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .page-container {
    max-width: 960px;
  }
}

/* Strong stacking rules for the rounds top bar: force group selector (first row)
   and tabs (second row). Prefer structural rules without !important so they
   can be overridden only when necessary by higher-specificity selectors. */
.rounds-top-bar {
  margin-bottom: 12px;
  /* visual spacing below the top bar */
}

.rounds-top-bar .page-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* Ensure each direct child of the page-container occupies the full width */
.rounds-top-bar .page-container>* {
  width: 100%;
  box-sizing: border-box;
}

/* Top row that contains the group selector (and any left-side controls) */
.rounds-top-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  /* allow wrapping so children (e.g., nav) can drop to next line if needed */
  flex-wrap: wrap;
  padding: 0;
  box-sizing: border-box;
}

/* Make sure nav always appears below the top row */
.rounds-top-menu {
  order: 2;
}

.group-select-container {
  order: 1;
}

/* If the nav/tabs are placed inside .rounds-top-row (some pages include it that way),
   force the nav to occupy full width below the selector without using !important */
.rounds-top-row>nav.rounds-top-menu.fullwidth-tabs {
  order: 2;
  flex: 1 0 100%;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  /* ensure the nav itself lays out its items across the full width */
  display: flex;
  gap: 0;
}

.rounds-top-row>nav.rounds-top-menu.fullwidth-tabs .rounds-top-item {
  /* make each tab expand evenly and allow text centering */
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Fallback stronger rules scoped under .rounds-top-bar to handle pages where
   other styles or inline attributes still prevent full-width tabs. Kept scoped
   and minimal to avoid global !important usage. */
.rounds-top-bar .page-container>.rounds-top-row>nav.rounds-top-menu.fullwidth-tabs {
  width: 100% !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  box-sizing: border-box !important;
}

.rounds-top-bar .page-container>.rounds-top-row>nav.rounds-top-menu.fullwidth-tabs .rounds-top-item {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  text-align: center !important;
}

/* Ensure the dropdown gap is enforced even if inline styles are present */
.group-select-container>.group-dropdown {
  top: calc(100% + 12px) !important;
}

/* Group selector: full-width, prominent visual affordance */
.group-select-container {
  position: relative;
  display: block;
  /* occupy full line */
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.group-select-container .button {
  width: 100%;
  /* fill container */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  /* 깔끔하고 모던한 보라색-파란색 그라데이션 */
  background: linear-gradient(135deg, #7F00FF 0%, #E100FF 100%);
  /* 보라색 계열 시작, 보라색 계열 끝 */
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
  /* 그림자 색상도 그라데이션에 어울리게 변경 */
  box-shadow: 0 12px 26px rgba(127, 0, 255, 0.2);
  text-align: left;
  /* make selected group obvious */
}

.group-select-container .button::after {
  content: "▼";
  font-size: 0.86rem;
  color: #fff;
  margin-left: 12px;
  /* 텍스트와 화살표 간 간격 */
  flex-shrink: 0;
  user-select: none;
}

.group-select-container .button:hover,
.group-select-container .button:focus {
  /* 호버 시 더 밝고 생동감 있는 보라색-파란색 그라데이션 */
  background: linear-gradient(135deg, #9C33FF 0%, #F57EFF 100%);
  /* 더 밝은 보라색 계열 */
  /* 호버 그림자도 변경된 색상 계열로 */
  box-shadow: 0 18px 40px rgba(156, 51, 255, 0.3);
  transform: translateY(-1px);
  outline: none;
}

.group-dropdown {
  position: absolute;
  /* reduce vertical gap so the dropdown appears closer to the button */
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  /* align with full-width selector */
  background: var(--card-background, #fff);
  /* match the button's purple accent for visual harmony */
  border: 2px solid rgba(127, 0, 255, 0.95);
  border-radius: 10px;
  /* subtle purple glow plus normal shadow for depth */
  box-shadow: 0 8px 20px rgba(127, 0, 255, 0.06), 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  margin: 6px 0 0 0;
  list-style: none;
  min-width: unset;
  max-width: calc(100% - 40px);
  width: auto;
  z-index: 9999;
  box-sizing: border-box;
  margin-left: 20px;
  margin-right: 20px;
}

.group-dropdown-item {
  padding: 10px 22px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.25s ease, color 0.25s ease;
  color: #333;
  user-select: none;
}

.group-dropdown-item:hover,
.group-dropdown-item:focus {
  /* use purple hover to match the group-select button */
  background: linear-gradient(135deg, #9C33FF 0%, #F57EFF 100%);
  color: #fff;
  outline: none;
}

/* ============================================
   라운드 상세 모달 (최근경기 상세)
   ============================================ */
.round-detail-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.13);
  max-width: 340px;
  width: 92vw;
  padding: 22px 18px 18px 18px;
  position: relative;
  text-align: center;
}

.round-detail-modal .close-button {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.3em;
  cursor: pointer;
}

/* ============================================
   라운드 상세 모달 스타일
   ============================================ */
.round-detail-modal .modal-round-title {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
}

.round-detail-modal .modal-round-date {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 20px;
}

.round-detail-modal .modal-round-date .time-badge {
  display: inline-block;
  background: #e3f2fd;
  color: #1976d2;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  margin-left: 8px;
}

.round-detail-modal .players-ranking {
  margin: 15px 0 20px 0;
}

.round-detail-modal .player-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #ccc;
  transition: all 0.2s;
}

.round-detail-modal .player-rank-item:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateX(3px);
}

.round-detail-modal .player-rank-item.rank-1 {
  border-left-color: #4CAF50;
  background: linear-gradient(90deg, #e8f5e9 0%, #f8f9fa 100%);
}

.round-detail-modal .player-rank-item.rank-2 {
  border-left-color: #42a5f5;
  background: linear-gradient(90deg, #e3f2fd 0%, #f8f9fa 100%);
}

.round-detail-modal .player-rank-item.rank-3 {
  border-left-color: #ffca28;
  background: linear-gradient(90deg, #fff8e1 0%, #f8f9fa 100%);
}

.round-detail-modal .rank-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 50px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95em;
  color: #666;
}

.round-detail-modal .player-rank-item.rank-1 .rank-number {
  background: #4CAF50;
  color: #fff;
  border-color: #4CAF50;
  font-size: 1.05em;
}

.round-detail-modal .player-rank-item.rank-2 .rank-number {
  background: #42a5f5;
  color: #fff;
  border-color: #42a5f5;
}

.round-detail-modal .player-rank-item.rank-3 .rank-number {
  background: #ffca28;
  color: #333;
  border-color: #ffca28;
}

.round-detail-modal .player-info {
  flex: 1;
}

.round-detail-modal .player-name {
  font-size: 1.05em;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.round-detail-modal .player-score {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--primary-color);
}

.round-detail-modal .player-score.no-score {
  color: #999;
  font-weight: 500;
  font-size: 0.95em;
}

.round-detail-modal .mini-chip {
  display: inline-block;
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 600;
}

.round-detail-modal .mini-chip.birdie {
  background: #4fc3f7;
  color: #fff;
}

.round-detail-modal .mini-chip.par {
  background: #ffd600;
  color: #333;
}

.round-detail-modal .modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.round-detail-modal .modal-actions .button {
  flex: 1;
  padding: 14px 20px;
  font-size: 1em;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s;
}

.round-detail-modal .modal-actions .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.round-detail-modal .modal-actions .button.primary-button {
  background: var(--primary-color);
  color: #fff;
}

.round-detail-modal .modal-actions .button.secondary-button {
  background: #757575;
  color: #fff;
}

@media (max-width: 600px) {
  .round-detail-modal .modal-round-title {
    font-size: 1.15em;
  }

  .round-detail-modal .player-rank-item {
    padding: 12px;
    gap: 10px;
  }

  .round-detail-modal .rank-number {
    min-width: 44px;
    height: 44px;
    font-size: 0.9em;
  }

  .round-detail-modal .player-name {
    font-size: 0.95em;
  }

  .round-detail-modal .player-score {
    font-size: 1em;
  }

  .round-detail-modal .mini-chip {
    font-size: 0.7em;
    padding: 2px 6px;
  }

  .round-detail-modal .modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .round-detail-modal .modal-actions .button {
    width: 100%;
  }
}

/* ============================================
   view_round.php 모바일 최적화 스타일
   ============================================ */
.score-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  overflow-x: auto;
  padding: 5px 0;
  -webkit-overflow-scrolling: touch;
}

.score-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f7f6;
  font-weight: 600;
  color: #333;
  text-align: center;
  cursor: pointer;
  font-size: 0.95em;
  transition: all 0.2s;
  flex-shrink: 0;
}

.score-tab.active {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.score-tab span {
  font-size: 1.3em;
  font-weight: 700;
  margin-top: 3px;
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 15px;
  -webkit-overflow-scrolling: touch;
}

.total-row {
  font-weight: bold;
  background: #f0f0f0 !important;
}

.score-input-modal {
  min-width: 365px;
  /* user requested minimum width */
  max-width: 880px;
  /* allow wider modal so 8 buttons can sit on one row */
  max-height: 85vh;
  overflow-y: auto;
  padding: 18px;
}

.score-input-modal h3 {
  font-size: 1.15em;
  margin-bottom: 16px;
  text-align: center;
  color: var(--primary-color);
}

.holes-section {
  margin-bottom: 0;
}

.holes-section h4 {
  font-size: 1em;
  color: #666;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-color);
}

/* Prefill quick-action button variants (view_round score input modal) */
.prefill-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.prefill-actions .btn-all-par {
  background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(76, 175, 80, 0.18);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
}

.prefill-actions .btn-all-par:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(76, 175, 80, 0.22);
}

.prefill-actions .btn-all-bogey {
  background: linear-gradient(135deg, #FF7043 0%, #FF8A65 100%);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(255, 112, 67, 0.16);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
}

.prefill-actions .btn-all-bogey:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(255, 112, 67, 0.20);
}

.prefill-actions .btn-clear {
  background: linear-gradient(135deg, #90A4AE 0%, #B0BEC5 100%);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(144, 164, 174, 0.12);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
}

.prefill-actions .btn-clear:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(144, 164, 174, 0.16);
}

/* Ensure small-button sizing stays compact inside modal */
.prefill-actions .button.small-button {
  padding: 6px 10px;
  font-size: 0.92em;
}

.score-input-table {
  width: 100%;
  border-collapse: collapse;
}

.score-input-table td {
  padding: 0;
  border-bottom: none;
}

.hole-number {
  width: 44px;
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
  font-size: 1em;
}

.score-buttons {
  /* Default to 8 columns so buttons try to fit on a single row; add a very small gap
     so each button breathes slightly — 2px gives a tight but visible separation. */
  display: grid;
  gap: 2px;
  align-items: center;
  grid-template-columns: repeat(8, minmax(28px, 1fr));
}

@media (min-width: 720px) {

  /* Slightly larger minimum on wider viewports for better spacing */
  .score-buttons {
    grid-template-columns: repeat(8, minmax(36px, 1fr));
  }
}

/* When the viewport is very narrow, reduce button padding/font-size to help fit
   all options in one line inside the modal (subject to min-width). */
@media (max-width: 420px) {
  .score-btn {
    padding: 3px 5px;
    font-size: 0.82em;
    border-radius: 6px;
  }

  .score-buttons {
    gap: 2px;
  }
}

.score-btn-label {
  display: block;
  cursor: pointer;
}

.score-btn-label input {
  display: none;
}

.score-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 3px 4px;
  /* reduced padding for tighter layout */
  min-height: 28px;
  /* slightly smaller to match reduced padding */
  border-radius: 8px;
  background: #f4f7f6;
  color: #333;
  /* Ensure the button text uses the same UI font as the rest of the page,
     avoiding platform fallbacks that can render negative signs differently. */
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 700;
  font-size: 0.95em;
  line-height: 1;
  transition: transform 0.12s ease, background 0.12s ease;
  border: 1px solid #ececec;
  box-sizing: border-box;
  user-select: none;
}

.score-btn-label.active .score-btn {
  /* keep move-up when JS sets active class; color is applied only when checked */
  transform: translateY(-2px);
}

/* Colored gradient variants for relative-score buttons (-2 .. +5) */
.score-btn-label input[value="-2"]:checked+.score-btn,
.score-btn-label.active input[value="-2"]+.score-btn {
  /* Eagle */
  background: linear-gradient(135deg, #1565c0 0%, #42a5f5 100%);
  color: #fff;
  border-color: transparent;
}

.score-btn-label input[value="-1"]:checked+.score-btn,
.score-btn-label.active input[value="-1"]+.score-btn {
  /* Birdie */
  background: linear-gradient(135deg, #2e7d32 0%, #66bb6a 100%);
  color: #fff;
  border-color: transparent;
}

.score-btn-label input[value="0"]:checked+.score-btn,
.score-btn-label.active input[value="0"]+.score-btn {
  /* Par */
  background: linear-gradient(135deg, #9e9e9e 0%, #bdbdbd 100%);
  color: #fff;
  border-color: transparent;
}

.score-btn-label input[value="1"]:checked+.score-btn,
.score-btn-label.active input[value="1"]+.score-btn {
  /* Bogey */
  background: linear-gradient(135deg, #ff8a65 0%, #ff7043 100%);
  color: #fff;
  border-color: transparent;
}

.score-btn-label input[value="2"]:checked+.score-btn,
.score-btn-label.active input[value="2"]+.score-btn {
  /* Double bogey */
  background: linear-gradient(135deg, #ff7043 0%, #f44336 100%);
  color: #fff;
  border-color: transparent;
}

.score-btn-label input[value="3"]:checked+.score-btn,
.score-btn-label.active input[value="3"]+.score-btn {
  /* +3 */
  background: linear-gradient(135deg, #ef5350 0%, #e53935 100%);
  color: #fff;
  border-color: transparent;
}

.score-btn-label input[value="4"]:checked+.score-btn,
.score-btn-label.active input[value="4"]+.score-btn {
  /* +4 */
  background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 100%);
  color: #fff;
  border-color: transparent;
}

.score-btn-label input[value="5"]:checked+.score-btn,
.score-btn-label.active input[value="5"]+.score-btn {
  /* +5 */
  background: linear-gradient(135deg, #5c6bc0 0%, #3949ab 100%);
  color: #fff;
  border-color: transparent;
}

/* Hover / active variants for the gradient buttons */
.score-btn-label.active input[value="-2"]+.score-btn,
.score-btn-label input[value="-2"]:checked+.score-btn {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(33, 150, 243, 0.18);
}

.score-btn-label.active input[value="-1"]+.score-btn,
.score-btn-label input[value="-1"]:checked+.score-btn {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(76, 175, 80, 0.18);
}

.score-btn-label.active input[value="0"]+.score-btn,
.score-btn-label input[value="0"]:checked+.score-btn {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(158, 158, 158, 0.12);
}

.score-btn-label.active input[value="1"]+.score-btn,
.score-btn-label input[value="1"]:checked+.score-btn {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255, 138, 101, 0.16);
}

.score-btn-label.active input[value="2"]+.score-btn,
.score-btn-label input[value="2"]:checked+.score-btn {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(244, 67, 54, 0.16);
}

.score-btn-label.active input[value="3"]+.score-btn,
.score-btn-label input[value="3"]:checked+.score-btn {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(233, 30, 99, 0.16);
}

.score-btn-label.active input[value="4"]+.score-btn,
.score-btn-label input[value="4"]:checked+.score-btn {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(142, 36, 170, 0.16);
}

.score-btn-label.active input[value="5"]+.score-btn,
.score-btn-label input[value="5"]:checked+.score-btn {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(63, 81, 181, 0.16);
}

.modal-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
}

.modal-form-actions .button {
  flex: 1;
  max-width: 150px;
  padding: 12px 20px;
  font-size: 1em;
}

@media (max-width: 600px) {
  .round-card {
    /* increase spacing and base font-size on small viewports so content is readable
       and avoid forcing a large minimum width which caused horizontal scrolling */
    padding: 8px 10px;
    font-size: 0.95em;
    border-radius: 8px;
    min-height: 30px;
    max-width: 100% !important;
    min-width: 0;
    /* allow the card to shrink to the container width */
    overflow: visible;
  }

  .round-item {
    padding: 18px 12px !important;
    margin: 0 0 15px 0 !important;
    border-radius: 12px !important;
    max-width: 100% !important;
  }

  .score-tab {
    min-width: 60px;
    padding: 8px 10px;
    font-size: 0.9em;
  }

  .score-tab span {
    font-size: 1.2em;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 6px 3px !important;
    font-size: 0.9em !important;
  }

  .score-input-modal {
    max-width: 95vw !important;
    padding: 10px !important;
  }

  .hole-number {
    width: 26px;
    font-size: 0.95em;
  }

  .score-btn {
    min-width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 0.85em;
  }

  .score-buttons {
    gap: 2px;
  }

  .score-input-table td {
    padding: 0 1px;
  }

  .holes-section h4 {
    font-size: 0.95em;
  }
}

/* ============================================
   스코어카드 UI (이미지 스타일)
   ============================================ */
.round-title-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
  padding: 0 5px;
}

.round-title-header .course-name {
  flex: 1;
  font-size: 1.3em;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

.round-title-header .round-date-badge {
  font-size: 0.8em;
  color: #666;
  background: #f5f5f5;
  padding: 5px 10px;
  border-radius: 12px;
  white-space: nowrap;
  font-weight: 500;
}

.scorecard-header {
  margin-bottom: 15px;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 8px;
}

.scorecard-player-row {
  display: flex;
  gap: 8px;
  justify-content: space-around;
  flex-wrap: wrap;
}

.scorecard-player {
  flex: 1;
  min-width: 60px;
  text-align: center;
  padding: 5px;
  background: white;
  border-radius: 6px;
  border: 2px solid #e0e0e0;
  transition: all 0.2s;
}

.scorecard-player:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.scorecard-player .player-name {
  font-weight: 600;
  color: #1976d2;
  font-size: 0.95em;
  margin-bottom: 4px;
}

.scorecard-player .player-total {
  font-size: 1.3em;
  font-weight: 700;
  color: #333;
}

.table-wrapper {
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.scorecard-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: white;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  table-layout: fixed;
}

.scorecard-table thead th {
  background: #1976d2;
  color: white;
  padding: 8px 2px;
  font-size: 0.8em;
  font-weight: 600;
  text-align: center;
  border: 1px solid #1565c0;
}

.scorecard-table thead th:first-child {
  background: #333;
  width: 55px;
}

.scorecard-table thead th.total-col {
  background: #ff6f00;
  width: 35px;
}

.scorecard-table tbody td {
  padding: 8px 2px;
  text-align: center;
  border: 1px solid #e0e0e0;
  font-size: 0.85em;
}

.scorecard-table tbody td.player-cell {
  font-weight: 600;
  background: #f5f5f5;
  text-align: left;
  padding-left: 6px;
  color: #1976d2;
  width: 55px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scorecard-table tbody td.total-col {
  font-weight: 700;
  background: #fff3e0;
  color: #e65100;
  font-size: 1.05em;
}

.scorecard-table tbody tr:hover {
  background: #f0f7ff;
}

.scorecard-footer {
  margin-top: 20px;
  text-align: center;
  padding-bottom: 80px;
}

.scorecard-footer .button {
  min-width: 250px;
  padding: 14px 30px;
  font-size: 1.05em;
  font-weight: 600;
}

@media (max-width: 600px) {
  .scorecard-page .container {
    padding: 5px 3px;
  }

  .scorecard-page .round-card {
    padding: 10px;
  }

  .round-title-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
    padding: 0 3px;
  }

  .round-title-header .course-name {
    font-size: 1.05em;
  }

  .round-title-header .round-date-badge {
    font-size: 0.65em;
    padding: 3px 6px;
  }

  .scorecard-header {
    margin: 0 3px 12px 3px;
    padding: 8px;
  }

  .scorecard-player-row {
    gap: 5px;
  }

  .table-wrapper {
    margin: 0;
    width: 100%;
    overflow-x: auto;
  }

  .scorecard-table {
    width: 100%;
  }

  .scorecard-table thead th {
    padding: 8px 4px;
    font-size: 0.85em;
    /* slightly larger for readability on small screens */
  }

  .scorecard-table thead th:first-child {
    width: 45px;
  }

  .scorecard-table thead th.total-col {
    width: 30px;
  }

  .scorecard-table tbody td {
    padding: 8px 4px;
    font-size: 0.9em;
  }

  .scorecard-table tbody td.player-cell {
    width: 45px;
    padding-left: 4px;
  }

  .scorecard-player {
    min-width: 60px;
    padding: 6px;
  }

  .scorecard-player .player-name {
    font-size: 0.85em;
  }

  .scorecard-player .player-total {
    font-size: 1.15em;
  }

  .scorecard-footer {
    padding-bottom: 90px;
  }

  .scorecard-footer .button {
    min-width: 200px;
    padding: 12px 20px;
    font-size: 1em;
  }
}

/* Full scorecard modal (loaded via round_scorecard_modal.php) */
.full-scorecard-container {
  font-size: 13px;
  line-height: 1.25;
}

.full-scorecard-container .fs-player-block {
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.full-scorecard-container .fs-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.full-scorecard-container .fs-player-name {
  display: inline-block;
  font-weight: 700;
  font-size: 1.05em;
  /* larger name for readability */
  color: #fff;
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(46, 125, 50, 0.12);
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-scorecard-container .fs-score-badge {
  display: inline-block;
  background: linear-gradient(135deg, #e8f5e9 0%, #ffffff 100%);
  color: #2e7d32;
  padding: 8px 10px;
  font-size: 1.05em;
  /* larger score number */
  border-radius: 12px;
  font-weight: 800;
}

.full-scorecard-container .fs-chip {
  display: inline-block;
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 8px;
}

.full-scorecard-container .fs-chip-birdie {
  background: #4fc3f7;
  color: #fff;
}

.full-scorecard-container .fs-chip-par {
  background: #ffd600;
  color: #333;
}

.full-scorecard-container table th {
  background: #2f4f6f;
  color: #fff;
}

.full-scorecard-container td,
.full-scorecard-container th {
  padding: 4px 6px;
}

/* The full scorecard modal body is injected with inline padding by JS
   (id: fullScorecardModal_body). Override that inline padding so the
   table can use more horizontal space on small screens. Only targets
   the fullScorecard modal to avoid changing other modals. */
#fullScorecardModal_body {
  padding-left: 4px !important;
  padding-right: 4px !important;
}

@media (max-width: 480px) {
  .full-scorecard-container .fs-player-name {
    font-size: 0.98em;
    padding: 5px 8px;
  }

  .full-scorecard-container .fs-score-badge {
    font-size: 0.98em;
    padding: 6px 8px;
  }
}


/* ============================================
   통계/분석 페이지 (stats.php)
   ============================================ */

/* 사용자 선택 배지 */
.user-selector {
  margin-bottom: 20px;
}

.user-selector h3 {
  margin-bottom: 10px;
  color: var(--text-color);
  font-size: 1.05em;
}

.user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-badge {
  display: inline-block;
  padding: 7px 12px;
  background: var(--background-color);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.9em;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.user-badge:hover {
  background: rgba(76, 175, 80, 0.1);
  border-color: var(--primary-color);
  text-decoration: none;
}

.user-badge.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 프로필 & 핸디캡 섹션 */
.stats-profile {
  background: var(--card-background);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* 통합 프로필 & 통계 카드 */
.stats-profile-combined {
  background: var(--card-background);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: nowrap;
  gap: 25px;
  align-items: stretch;
}

.profile-section {
  display: flex;
  gap: 20px;
  align-items: center;
  flex: 0 0 auto;
  min-width: 280px;
  max-width: 350px;
}

.stats-divider {
  width: 1px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, transparent, var(--border-color), transparent);
  margin: 10px 0;
}

.summary-section {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  padding-left: 10px;
}

.summary-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-badge {
  background: var(--background-color);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.badge-label {
  font-size: 0.85em;
  color: var(--light-text-color);
  font-weight: 600;
}

.badge-value {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--primary-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.badge-value.best {
  color: #4CAF50;
}

.badge-value.worst {
  color: #FF9800;
}

/* 통계 배지 그리드 (1x4) */
.summary-badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.summary-badge-box {
  background: var(--background-color);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  transition: all 0.2s;
}

.summary-badge-box:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.badge-box-label {
  font-size: 0.8em;
  color: var(--light-text-color);
  font-weight: 600;
  margin-bottom: 6px;
}

.badge-box-value {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--primary-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 최고점수 카드 스타일 */
.summary-badge-box:has(.badge-box-value.best) {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border: 2px solid #4CAF50;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.summary-badge-box:has(.badge-box-value.best):hover {
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
  transform: translateY(-2px);
}

.summary-badge-box:has(.badge-box-value.best) .badge-box-label {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
}

.badge-box-value.best {
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 최저점수 카드 스타일 */
.summary-badge-box:has(.badge-box-value.worst) {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
  border: 2px solid #FF9800;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.summary-badge-box:has(.badge-box-value.worst):hover {
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
  transform: translateY(-2px);
}

.summary-badge-box:has(.badge-box-value.worst) .badge-box-label {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
}

.badge-box-value.worst {
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 차트 잠김 상태 */
.chart-locked {
  text-align: center;
  padding: 60px 20px;
  background: var(--background-color);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
}

.lock-icon {
  font-size: 4em;
  margin-bottom: 15px;
  opacity: 0.5;
}

.chart-locked h3 {
  margin: 0 0 10px 0;
  color: var(--text-color);
}

.chart-locked p {
  color: var(--light-text-color);
  margin-bottom: 20px;
}

.chart-locked .button {
  display: inline-block;
  padding: 10px 24px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar {
  flex-shrink: 0;
}

.avatar-placeholder {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4em;
  color: #757575;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-placeholder:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  /* show upper part of photo (face) */
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 프로필 이미지 모달 */
.profile-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  animation: fadeIn 0.3s ease;
}

.profile-modal-content {
  position: relative;
  margin: 5% auto;
  max-width: 500px;
  background: var(--card-background);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.profile-modal-image {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
}

/* Image cropper modal (simple draggable + zoom UI) */
.image-cropper-modal {
  /* force the cropper modal to top of stacking context so it won't appear
     underneath other modals or dropdowns (some components use very high
     z-index values). Use a high value but keep it local to this selector.
     The !important is intentional here to override inline styles added by
     JS-based modal helpers if necessary. */
  z-index: 30000 !important;
}

.image-cropper-modal .modal-content {
  max-width: 520px;
  padding: 18px;
  /* Ensure the modal content itself is above the backdrop and other
     positioned elements. */
  z-index: 30001;
  /* no !important needed here */
}

.cropper-viewport {
  width: 360px;
  height: 360px;
  max-width: 92vw;
  max-height: 92vw;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px auto;
  background: #f3f3f3;
  position: relative;
  touch-action: none;
}

.cropper-image {
  position: absolute;
  top: 0;
  left: 0;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.cropper-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.cropper-controls input[type=range] {
  width: 160px;
}

.cropper-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.cropper-preview-hint {
  text-align: center;
  font-size: 0.9em;
  color: #666;
}

.profile-close {
  position: absolute;
  top: 10px;
  right: 15px;
  color: white;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.profile-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.profile-upload-form {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.profile-upload-form h3 {
  margin: 0 0 10px 0;
  font-size: 1.1em;
  color: var(--text-color);
}

.file-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.file-input-wrapper input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9em;
}

.file-input-wrapper .upload-btn {
  width: 100%;
}

.profile-info {
  flex: 1;
}

.profile-info h2 {
  margin: 0 0 12px 0;
  color: var(--primary-color);
  font-size: 1.6em;
}

.handicap-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  /* container for combined tooltip */
}

.handicap-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.handicap-label {
  font-size: 0.85em;
  color: var(--light-text-color);
  display: flex;
  align-items: center;
  gap: 4px;
}

.info-tooltip {
  cursor: pointer;
  font-size: 1em;
  user-select: none;
}

.tooltip-bubble {
  position: absolute;
  top: 100%;
  left: 50%;
  /* center by default */
  transform: translateX(-50%);
  margin-top: 8px;
  background: var(--primary-color);
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: tooltipFadeIn 0.2s ease;
  max-width: 92vw;
  box-sizing: border-box;
}

.help-button {
  padding: 4px 8px;
  font-size: 0.78em;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  line-height: 1;
  border: 1px solid #f6c844;
  background: linear-gradient(180deg, #fff7c6 0%, #fff0a0 100%);
  color: #5a3d00;
  box-shadow: 0 2px 6px rgba(246, 200, 68, 0.12);
}

.help-button:hover {
  transform: translateY(-1px);
}

/* specific styling for the combined help tooltip to appear near SR핸디 */
#tooltip-help {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff8d6;
  /* pale yellow */
  color: #3a2a00;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

#tooltip-help::before {
  border-bottom-color: #fff8d6;
}

.tooltip-bubble::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--primary-color);
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-5px);
    /* preserve horizontal centering during animation */
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.handicap-value {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--primary-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 통계 요약 카드 */
.stats-summary {
  margin-bottom: 25px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.summary-card {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}

.summary-label {
  font-size: 1.05em;
  color: var(--text-color);
  margin-bottom: 8px;
  font-weight: 600;
}

.summary-value {
  font-size: 2em;
  font-weight: 700;
  color: var(--primary-color);
}

.summary-value.best {
  color: #4CAF50;
}

.summary-value.worst {
  color: #FF9800;
}

/* 차트 섹션 */
.stats-chart {
  background: var(--card-background);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.stats-chart h3 {
  margin: 0 0 15px 0;
  color: var(--text-color);
  font-size: 1.2em;
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* 테이블 섹션 */
.stats-table {
  background: var(--card-background);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.stats-table h3 {
  margin: 0 0 15px 0;
  color: var(--text-color);
  font-size: 1.2em;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rounds-table {
  width: 100%;
  border-collapse: collapse;
}

.rounds-table thead th {
  background: var(--background-color);
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--secondary-color);
  border-bottom: 2px solid var(--border-color);
  font-size: 0.9em;
}

.rounds-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

.rounds-table tbody tr:hover {
  background: rgba(76, 175, 80, 0.05);
}

.rounds-table tbody td {
  padding: 12px 10px;
  font-size: 0.95em;
}

.score-cell {
  font-weight: 700;
  color: var(--primary-color);
  text-align: right;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .stats-profile-combined {
    flex-direction: column;
    gap: 15px;
    padding: 16px;
  }

  .profile-section {
    min-width: auto;
    width: 100%;
    max-width: 100%;
    gap: 15px;
  }

  .profile-avatar {
    flex-shrink: 0;
  }

  .profile-info {
    flex: 1;
  }

  .stats-divider {
    width: 100%;
    height: 1px;
    margin: 10px 0;
  }

  .summary-section {
    width: 100%;
    justify-content: center;
    padding-left: 0;
  }

  .summary-badges {
    justify-content: center;
    width: 100%;
  }

  .summary-badge {
    flex: 1 1 auto;
  }

  .summary-badges-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .summary-badge-box {
    padding: 6px 6px;
  }

  .badge-box-label {
    font-size: 0.75em;
  }

  .badge-box-value {
    font-size: 1.3em;
  }
}

@media (max-width: 480px) {
  .stats-profile-combined {
    padding: 14px;
  }

  .profile-section {
    gap: 12px;
  }

  .avatar-placeholder {
    width: 100px;
    height: 100px;
    font-size: 3.5em;
  }

  .profile-image {
    width: 100px;
    height: 100px;
  }

  .profile-info h2 {
    font-size: 1.25em;
    margin: 0 0 8px 0;
  }

  .handicap-info {
    gap: 12px;
    flex-direction: row;
  }

  .handicap-value {
    font-size: 1.4em;
  }

  .handicap-label {
    font-size: 0.8em;
  }

  .summary-badges {
    gap: 8px;
  }

  .summary-badge {
    padding: 6px 12px;
    min-width: auto;
    flex: 1 1 calc(50% - 4px);
  }

  .badge-label {
    font-size: 0.75em;
  }

  .badge-value {
    font-size: 1.2em;
  }

  .profile-modal-content {
    margin: 10% auto;
    max-width: 90%;
  }

  .profile-modal-image {
    max-height: 300px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .summary-card {
    padding: 14px;
  }

  .summary-label {
    font-size: 0.75em;
  }

  .summary-value {
    font-size: 1.6em;
  }

  /* Chart container: let contents determine height so multiple charts won't overlap on narrow screens */
  .chart-container {
    height: 200px;
    /* 모바일에서도 충분한 높이 확보 (auto -> 200px) */
    grid-auto-rows: auto;
    align-items: start;
    /* ensure each chart card starts at top of its grid cell */
  }

  .rounds-table thead th {
    padding: 10px 6px;
    font-size: 0.85em;
  }

  .rounds-table tbody td {
    padding: 10px 6px;
    font-size: 0.9em;
  }
}

/* 연도 필터 뱃지 - 가로형 텍스트 전용 스타일 */
.year-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 15px;
  background: #f5f5f5;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 600;
  color: #757575;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.year-badge:hover {
  border-color: #4CAF50;
  color: #4CAF50;
  background: #f1f8f4;
  transform: translateY(-1px);
}

/* 활성화 상태 - 그린 */
.year-badge.active {
  background: #4CAF50;
  border-color: #4CAF50;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.25);
}

.year-badge.active:hover {
  background: #45a049;
  border-color: #45a049;
  color: #ffffff;
}

/* 전체 버튼 - 오렌지 강조 */
.year-badge.year-all {
  background: #fff3e0;
  border-color: #ffb74d;
  color: #f57c00;
}

.year-badge.year-all:hover {
  border-color: #ff9800;
  color: #ff9800;
  background: #ffe0b2;
}

.year-badge.year-all.active {
  background: #ff9800;
  border-color: #ff9800;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.year-badge.year-all.active:hover {
  background: #f57c00;
  border-color: #f57c00;
}

/* 비활성화 상태 */
.year-badge:not(.active) {
  opacity: 0.6;
}

.year-badge:not(.active):hover {
  opacity: 1;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .year-badge {
    padding: 5px 10px;
    font-size: 0.85em;
  }
}

/* view_round 상단 타이틀 행 (코스명/일시 + 수정 버튼) */
.round-title-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.round-title-header .course-name {
  margin: 0;
  font-size: 1.3em;
  font-weight: 800;
  color: #333;
}

.round-title-header .round-date-badge {
  display: inline-block;
  margin-top: 6px;
  background: #f1f5f9;
  color: #374151;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9em;
}

/* Groups page: custom bubble style (keeps stats .tooltip-bubble unchanged) */
.group-tooltip-bubble {
  background: linear-gradient(180deg, #0f1724, #111827);
  /* slightly darker */
  color: #fff;
  padding: 10px 14px;
  /* increased horizontal padding */
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
  font-weight: 700;
  font-size: 0.98em;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}

.group-tooltip-bubble::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  /* arrow on top of the bubble pointing up toward the card */
  border-bottom: 8px solid rgba(17, 24, 39, 0.98);
  top: -6px;
}

.group-tooltip-bubble.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 140ms ease, transform 140ms ease;
}

/* group tooltip has no internal close button; clicking outside will close it */

/* ---------------------------------------------
  Recent rounds (moved from rounds.php)
  Mini score tables: front/back 1-9 / 10-18
  --------------------------------------------- */
.rounds-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.round-item {
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  gap: 8px;
}

.round-info {
  width: 100%;
}

.round-top-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.round-top-line .course-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #222;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-count {
  font-weight: 700;
  color: #555;
  flex: 0 0 auto;
}

.round-second-line {
  margin-top: 6px;
  color: #666;
  font-size: 0.95rem;
}

.inline-my-score {
  margin-top: 10px;
}

.mini-score-table {
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: fixed;
  width: 100%;
}

.mini-score-table thead th {
  font-size: 0.9rem;
  padding: 6px 8px;
  background: #1976d2;
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.mini-score-table thead th.total-col {
  background: #ff6f00;
  color: #fff;
}

.mini-score-table th,
.mini-score-table td {
  padding: 4px 6px;
  border: 1px solid #eee;
  overflow: hidden;
  white-space: nowrap;
}

.mini-score-table tbody tr td {
  background: #fbfcfd;
}

.mini-score-table tbody tr td.total-col {
  background: #fff2e8;
  font-weight: 700;
}

.mini-score-wrap {
  width: 100%;
  overflow-x: auto;
}

.round-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

/* round footer / total display */
.round-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.round-total {
  color: #2ecc71;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.round-total.small {
  font-size: 1.4rem;
}

.round-footer .round-actions {
  margin-top: 0;
}
/* ===== iOS / Safari specific tweaks (non-invasive, Chrome-safe) ===== */
/* Limits: uses @supports (-webkit-touch-callout: none) to target WebKit/Safari-like engines */
@supports (-webkit-touch-callout: none) {
  html, body {
    -webkit-text-size-adjust: 100%; /* prevent automatic text size changes */
  }

  * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
  }

  button, input, select, textarea {
    -webkit-appearance: none;
    -webkit-border-radius: 0;
  }

  /* Stabilize transforms / prevent subpixel jitter on icons */
  .nav-item .nav-icon,
  .nav-item .nav-img {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  /* Slightly improve font rendering on iOS for compact UI elements */
  .member-card .nickname,
  .points-balance-card,
  .balance-number,
  .round-total {
    -webkit-font-smoothing: antialiased;
  }

  /* Use tabular numerals for score/number columns to avoid digit-width shifts */
  .score,
  .balance-number,
  .round-total,
  .mini-score-table td,
  .mini-score-table th {
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum" 1;
    font-feature-settings: "tnum";
  }

  /* Reduce accidental selection / touch callouts on interactive elements */
  a, button {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
  }
}

/* General mobile-safe rule: keep browser from auto-scaling text */
html { -webkit-text-size-adjust: 100%; }

/* End of iOS/Safari tweaks */