@font-face { font-family: 'PT Root UI'; src: url('../fonts/pt-root-ui_light.woff2') format('woff2'), url('../fonts/pt-root-ui_light.woff') format('woff'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'PT Root UI'; src: url('../fonts/pt-root-ui_regular.woff2') format('woff2'), url('../fonts/pt-root-ui_regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'PT Root UI'; src: url('../fonts/pt-root-ui_medium.woff2') format('woff2'), url('../fonts/pt-root-ui_medium.woff') format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'PT Root UI'; src: url('../fonts/pt-root-ui_bold.woff2') format('woff2'), url('../fonts/pt-root-ui_bold.woff') format('woff'); font-weight: 700; font-style: normal; font-display: swap; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'PT Root UI', system-ui, sans-serif;
  background: #F0F0F0;
  color: #1A1A1A;
}
a { color: #1A1A1A; text-decoration: none; }
a:hover { color: #1A1A1A; }
input::placeholder { color: #999999; opacity: 1; }

.page {
  min-height: 100vh;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
}

/* ============ NAV ============ */
.nav-desktop {
  position: sticky;
  top: 8px;
  z-index: 40;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 24px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
}
.nav-mobile { display: none; }
.nav-side { flex: 1; display: flex; }
.nav-side.left { justify-content: flex-start; }
.nav-side.right { justify-content: flex-end; gap: 8px; }
.nav-logo-wrap { flex: 0 0 auto; display: flex; justify-content: center; }
.nav-tabs { display: flex; align-items: center; gap: 4px; background: #F0F0F0; border-radius: 12px; padding: 4px; }
.nav-tab {
  display: flex; align-items: center; gap: 7px;
  color: #1A1A1A; border-radius: 10px; padding: 9px 16px;
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background 0.15s ease;
}
.nav-tab:hover { background: #FFFFFF; }
.nav-tab.active { background: #F74A96; color: #FFFFFF; }
.nav-tab.active:hover { background: #E63A88; }
.nav-btn {
  display: flex; align-items: center; gap: 8px;
  background: #FFFFFF; border: 1px solid #EAEAEA; border-radius: 12px;
  padding: 9px 16px; font-size: 15px; font-weight: 500; color: #1A1A1A;
  cursor: pointer; transition: background 0.15s ease;
}
.nav-btn:hover { background: #F7F7F7; }
.lang-toggle {
  display: flex; align-items: center; gap: 4px;
  background: #F0F0F0; border-radius: 12px; padding: 4px;
}
.lang-btn {
  border: none; background: transparent; font-family: inherit;
  font-size: 15px; font-weight: 500; color: #1A1A1A;
  padding: 6px; border-radius: 10px;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.lang-btn:hover:not(.active) { background: #FFFFFF; }
.lang-btn.active { background: #1A1A1A; color: #FFFFFF; }

.hamburger { flex: 0 0 auto; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ham-line { transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; transform-box: view-box; transform-origin: 14px 14px; }
.ham-top { transform: translateY(-5px); }
.ham-bot { transform: translateY(5px); }
.page.menu-open .ham-top { transform: rotate(45deg); }
.page.menu-open .ham-mid { opacity: 0; }
.page.menu-open .ham-bot { transform: rotate(-45deg); }

/* ============ MOBILE OVERLAY ============ */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: #F0F0F0; padding: 8px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 12px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.page.menu-open .overlay { opacity: 1; visibility: visible; }
.overlay-topbar {
  flex: 0 0 auto; background: #FFFFFF; border-radius: 24px; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
}
.overlay-panel {
  flex: 1; background: #FFFFFF; border-radius: 24px; padding: 12px 12px 32px;
  display: flex; flex-direction: column; overflow: hidden;
}
.overlay-menu { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.overlay-menu-item {
  background: #F7F7F7; border-radius: 24px; display: flex; align-items: center; gap: 20px;
  cursor: pointer; padding: 20px 16px; transition: background 0.15s ease;
}
.overlay-menu-item:hover { background: #F0F0F0; }
.overlay-menu-item span { font-size: 20px; font-weight: 500; color: #1A1A1A; }

/* ============ MAIN CONTENT SHARED ============ */
.content { max-width: 748px; margin: 48px auto 0; flex: 1; width: 100%; }
.page-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; }
.page-heading .icon-box {
  width: 36px; height: 36px; border-radius: 13px; background: #1A1A1A;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.page-heading .title { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.search-box {
  display: flex; align-items: center; gap: 10px; background: #FFFFFF;
  border: 1px solid #EAEAEA; border-radius: 12px; padding: 0 16px;
  height: 48px; width: 360px; box-sizing: border-box;
}
.search-box img { opacity: 0.4; }
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 16px; font-weight: 400; color: #1A1A1A; min-width: 0;
}

/* ============ FOOTER ============ */
.site-footer {
  width: 100%; max-width: 900px; margin: 56px auto 0; background: #FFFFFF; border-radius: 20px;
  padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; height: 64px;
  box-sizing: border-box;
}
.site-footer .footer-meta { display: flex; align-items: center; gap: 40px; font-size: 14px; font-weight: 400; color: #666666; }

/* ============ RATING TABLE (desktop) ============ */
.rating-col-headers {
  display: grid; grid-template-columns: 96px minmax(0,1fr) 90px 90px 90px;
  column-gap: 8px; padding: 0 24px; margin-bottom: 12px;
}
.rating-col-headers span { font-size: 12px; font-weight: 400; color: #999999; }
.rating-card { background: #FFFFFF; border-radius: 24px; padding: 6px 24px; margin-bottom: 20px; }
.rating-card:last-child { margin-bottom: 0; }
.rating-row {
  display: grid; grid-template-columns: 96px minmax(0,1fr) 90px 90px 90px; column-gap: 8px;
  align-items: center; padding: 15px 12px; margin: 0 -12px; border-radius: 14px;
  text-decoration: none; color: inherit; cursor: pointer; transition: background 0.15s ease;
}
.rating-row:hover { background: #FAFAFA; }
.row-divider { height: 1px; background: #F0F0F0; }
.rank-cell { display: flex; align-items: center; gap: 8px; }
.rank-cell .rank { font-size: 16px; font-weight: 700; color: #1A1A1A; }
.change { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 500; }
.change.up { color: #5AAD32; }
.change.down { color: #ED6455; }
.player-name { font-size: 15px; font-weight: 500; color: #1A1A1A; }
.plate {
  display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 12px;
  font-size: 14px; font-weight: 500; color: #1A1A1A; background: #F7F7F7;
}
.plate.no-rating { color: #999999; }
.rating-plate {
  display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 14px;
  border-radius: 12px; background: #F7F7F7;
}
.rating-plate .val { font-size: 14px; font-weight: 500; color: #F74A96; }

/* ============ RATING CARDS (mobile) ============ */
.player-cards { display: none; flex-direction: column; gap: 8px; }
.player-card {
  background: #FFFFFF; border-radius: 20px; padding: 20px; display: flex; flex-direction: column;
  gap: 24px; text-decoration: none; color: inherit; cursor: pointer; transition: background 0.15s ease;
}
.player-card:hover { background: #FAFAFA; }
.player-card-top { display: flex; flex-direction: column; gap: 12px; }
.player-card-line { display: grid; grid-template-columns: 64px 1fr; align-items: center; }
.player-card-line .label { font-size: 15px; font-weight: 400; color: #999999; width: 64px; flex: none; box-sizing: border-box; }
.player-card-line .val { font-size: 17px; font-weight: 700; color: #1A1A1A; }
.player-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.player-card-stats .stat { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.player-card-stats .stat .label { font-size: 13px; font-weight: 400; color: #999999; }
.mini-plate {
  display: flex; align-items: center; justify-content: center; background: #F5F5F5; border-radius: 10px;
  padding: 8px 16px; font-size: 15px; font-weight: 500; color: #1A1A1A; height: 40px; box-sizing: border-box;
}
.mini-plate.no-rating { color: #999999; }
.mini-rating-plate {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; background: #F5F5F5;
  border-radius: 10px; padding: 8px 16px; height: 40px; box-sizing: border-box;
}
.mini-rating-plate .val { font-size: 15px; font-weight: 500; color: #F74A96; }

/* ============ TOURNAMENTS: scheduled row ============ */
.section-label { font-size: 16px; font-weight: 400; color: #999999; margin-bottom: 16px; }
.trow {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #FFFFFF;
  border-radius: 26px; padding: 10px; box-sizing: border-box;
}
.sched-row { align-items: stretch; margin-bottom: 32px; }
.completed-list { display: flex; flex-direction: column; gap: 12px; }

.tourn-card {
  position: relative; border-radius: 16px; padding: 20px; overflow: hidden; box-sizing: border-box;
  min-height: 160px; background: #F0F0F0;
}
.tourn-card-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; justify-content: space-between; height: 100%; }
.tourn-card .tourn-title { font-size: 22px; font-weight: 700; }
.tourn-card-meta { display: flex; flex-direction: column; gap: 14px; }
.meta-line { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.meta-line .meta-label { color: #999999; }
.meta-line .meta-val { font-weight: 500; }
.tourn-ball {
  position: absolute; right: -24px; top: 65%; left: 50%; transform: translateY(-50%);
  width: 240px; height: 240px; object-fit: contain; z-index: 0;
}

.action-card {
  background: #F7F7F7; border-radius: 16px; padding: 20px; display: flex; flex-direction: column;
  gap: 12px; box-sizing: border-box; justify-content: space-between;
}
.action-card-mobile { display: none; }
.join-btn {
  display: inline-flex; align-self: flex-start; align-items: center; justify-content: center; gap: 10px;
  background: #1A1A1A; color: #FFFFFF; border-radius: 16px; padding: 14px 20px;
  font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background 0.15s ease;
}
.join-btn:hover { background: #292929; color: #FFFFFF; }
.join-btn-mobile { display: none; }
.spots-line { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.spots-line .spots-label { color: #999999; }
.spots-line .spots-val { font-weight: 700; font-size: 16px; }

.leaderboard-card {
  background: #F7F7F7; border-radius: 16px; padding: 16px 20px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 12px; justify-content: center;
}
.leaderboard-row { display: flex; align-items: center; gap: 12px; }
.leaderboard-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.leaderboard-row .rank { font-size: 15px; font-weight: 700; width: 14px; flex: 0 0 auto; }
.leaderboard-row .name { font-size: 15px; font-weight: 500; flex: 1; min-width: 0; }
.leaderboard-row .rating-pill {
  display: flex; align-items: center; justify-content: center; gap: 4px; background: #FFFFFF; border-radius: 10px;
  padding: 6px 10px; flex: 0 0 auto; width: 70px; box-sizing: border-box;
}
.leaderboard-row .rating-pill span { font-size: 14px; font-weight: 500; color: #F74A96; }

/* ============ TOURNAMENT DETAIL ============ */
.back-btn {
  width: 48px; height: 40px; border-radius: 16px; background: #EBEBEB;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s ease; border: 1px solid #E6E6E6EB;
}
.back-btn:hover { background: #E0E0E0; }
.title-row { margin-bottom: 20px; }

.detail-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #FFFFFF;
  border-radius: 26px; padding: 10px; box-sizing: border-box; margin-bottom: 32px;
}
.spots-card { background: #F7F7F7; border-radius: 16px; padding: 20px; box-sizing: border-box; min-height: 160px; display: flex; flex-direction: column; justify-content: flex-end; }

.banner {
  background: #FFFFFF; border-radius: 24px; padding: 24px 28px; box-sizing: border-box;
  margin-bottom: 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.banner-text { font-size: 18px; font-weight: 500; line-height: 1.45; color: #1A1A1A; max-width: 480px; }
.banner-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: #1A1A1A; color: #FFFFFF; border-radius: 16px; padding: 16px 22px;
  font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; flex: 0 0 auto;
  transition: background 0.15s ease;
}
.banner-btn:hover { background: #292929; color: #FFFFFF; }

.detail-table-row {
  display: grid; grid-template-columns: 40px minmax(0,1fr) 90px 90px 90px 90px; column-gap: 8px; align-items: center;
}
.detail-col-headers { padding: 0 24px; margin-bottom: 12px; }
.detail-col-headers span { font-size: 12px; font-weight: 400; color: #999999; }
.detail-card { background: #FFFFFF; border-radius: 24px; padding: 6px 24px; }
.detail-row-item { padding: 15px 12px; margin: 0 -12px; border-radius: 14px; }
.detail-row-item .num { font-size: 16px; font-weight: 700; color: #1A1A1A; }
.detail-row-item .name { font-size: 15px; font-weight: 500; }
.plate.rank-plate { font-weight: 500; }

.detail-cards { display: none; flex-direction: column; gap: 8px; }
.detail-card-item {
  background: #FFFFFF; border-radius: 20px; padding: 20px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 20px;
}
.detail-card-item .card-line { display: flex; gap: 16px; align-items: baseline; }
.detail-card-item .card-line .label { font-size: 13px; font-weight: 400; color: #999999; }
.detail-card-item .card-line .num { font-size: 16px; font-weight: 700; color: #1A1A1A; }
.detail-card-item .card-line .name { font-size: 15px; font-weight: 500; }
.detail-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.detail-card-stats .stat { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.detail-card-stats .stat .label { font-size: 12px; font-weight: 400; color: #999999; }
.detail-card-stats .mini-plate { padding: 8px 6px; height: 40px; }
.detail-card-stats .mini-rating-plate { padding: 8px 10px; height: 40px; }

/* ============ PLAYER PROFILE ============ */
.profile-content { max-width: 444px; margin: 48px auto 0; flex: 1; width: 100%; }
.player-name-big { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.05; }

.profile-card { background: #FFFFFF; border-radius: 24px; padding: 20px; margin-bottom: 8px; }
.profile-card:last-child { margin-bottom: 0; }
.profile-name-card { display: flex; align-items: flex-end; gap: 16px; }
.profile-id-pill { color: #4D4D4D; flex-shrink: 0; }
.stat-group { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-block { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.stat-block .label { font-size: 12px; font-weight: 400; color: #999999; }
.stat-pill { background: #F5F5F5; border-radius: 12px; padding: 12px 18px; display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100px; height: 48px; box-sizing: border-box; white-space: nowrap; }
.stat-pill .val { font-size: 18px; font-weight: 500; color: #F74A96; }
.stat-pill .rank-val { font-size: 18px; font-weight: 500; color: #1A1A1A; }

.stat-row3 { display: flex; gap: 12px; flex-direction: row; width: 100%; align-items: stretch; }
.stat-col { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; flex: 1; min-width: 0; }
.stat-col .label { font-size: 12px; font-weight: 400; color: #999999; width: 100%; }
.plate-full { background: #F5F5F5; border-radius: 12px; padding: 12px 14px; display: inline-flex; align-items: center; font-size: 18px; font-weight: 500; color: #1A1A1A; box-sizing: border-box; width: 100%; height: 48px; }
.matches-plate { justify-content: flex-start; gap: 8px; }
.matches-plate .wl { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }

.two-col { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.two-col .box { flex: 1 1 160px; box-sizing: border-box; background: #FFFFFF; border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.two-col .box .label { font-size: 12px; font-weight: 400; color: #999999; }
.two-col .box .val { font-size: 18px; font-weight: 500; color: #1A1A1A; }

.equip-card { background: #FFFFFF; border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 24px; }
.equip-item { display: flex; flex-direction: column; gap: 8px; }
.equip-item .label { font-size: 12px; font-weight: 400; color: #999999; }
.equip-item .val { font-size: 18px; font-weight: 500; color: #1A1A1A; }

/* ============ SKELETON LOADING ============ */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.skeleton {
  background: #E0E0E0;
  border-radius: 6px;
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .nav-desktop { display: none !important; }
  .nav-mobile { display: flex !important; }
  .page { padding: 8px 8px 32px !important; }
  .lang-btn { padding: 8px 14px; font-size: 14px; }
  .lang-toggle { align-self: flex-start; }
  .overlay-panel > img { margin: 0 0 32px; }

  .rating-col-headers, .detail-col-headers { display: none; }
  .rating-row, .rating-card { display: none !important; }
  .table-view { display: none !important; }
  .player-cards { display: flex !important; }
  .detail-cards { display: flex !important; }

  .head-row { flex-direction: column; align-items: stretch !important; gap: 24px !important; margin-bottom: 16px !important; }
  .head-row .page-heading { margin-bottom: 0 !important; }
  .search-box { width: 100% !important; height: 52px !important; border-radius: 16px !important; }

  .trow { grid-template-columns: 1fr !important; gap: 12px !important; }
  .sched-row { margin-bottom: 32px !important; }
  .completed-list { gap: 12px !important; }
  .action-card { display: none !important; }
  .action-card-mobile { display: flex !important; flex-direction: column; gap: 12px; background: #F7F7F7; border-radius: 16px; padding: 20px; }
  .join-btn-mobile { display: flex !important; flex-direction: row; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; align-self: stretch; }
  .page-heading { margin-bottom: 24px !important; }

  .content { margin-top: 32px !important; }
  .profile-content { margin-top: 24px !important; }
  .title-row { margin-top: 0 !important; margin-bottom: 16px !important; padding-left: 0; }
  .player-name-big { font-size: 22px !important; }
  .name-row-inner { flex-wrap: wrap; }
  .stat-row3 { display: flex !important; gap: 12px !important; flex-wrap: nowrap; }

  .detail-row { grid-template-columns: 1fr !important; }
  .spots-card { min-height: unset !important; }
  .banner { flex-direction: column; align-items: stretch !important; }
  .banner-btn { width: 100%; box-sizing: border-box; justify-content: center !important; }
}
