/* Royal Farmers FC — Player card photo styles */

/* Photo card variant */
.player-card--photo {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.player-card__photo {
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  position: relative;
  background: var(--rf-graphite-2);
  flex-shrink: 0;
}

.player-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
  display: block;
  transition: transform 0.4s var(--rf-ease-out);
}

.player-card--photo:hover .player-card__photo img {
  transform: scale(1.04);
}

.player-card__photo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(10, 10, 10, 0.72);
  border: 1px solid var(--rf-gold);
  color: var(--rf-gold);
  font-family: var(--rf-font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--rf-r-sm);
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

.player-card__info {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-card--photo .player-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--rf-fg);
  letter-spacing: 0.02em;
}

.player-card--photo .player-card__pos {
  font-size: 10px;
  color: var(--rf-fg-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.player-card--photo .player-card__stats {
  border-top: 1px solid var(--rf-line);
  padding-top: 8px;
  margin-top: auto;
}

/* Squad full-roster grid */
.squad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

@media (max-width: 720px) {
  .squad-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
  .player-card__photo {
    aspect-ratio: 3 / 4;
  }
}

/* ========================================
   PLAYER PROFILE MODAL
   ======================================== */

.profile-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.profile-panel {
  background: var(--rf-graphite-2);
  border: 1px solid var(--rf-line-strong);
  border-radius: var(--rf-r-lg);
  box-shadow: var(--rf-shadow-pop);
  width: 100%; max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
}

/* ── Head ── */
.profile-head {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 28px 28px 24px;
  border-bottom: 1px solid var(--rf-line);
  position: relative;
}

.profile-photo {
  width: 96px; height: 128px; flex-shrink: 0;
  border-radius: var(--rf-r-md); overflow: hidden;
  border: 2px solid var(--rf-gold);
}
.profile-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 10%;
}

.profile-num-badge {
  width: 96px; height: 128px; flex-shrink: 0;
  border-radius: var(--rf-r-md);
  background: var(--rf-graphite-3);
  border: 2px solid var(--rf-line-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--rf-font-display); font-size: 36px; font-weight: 700;
  color: var(--rf-gold);
}

.profile-identity { flex: 1; }
.profile-jersey {
  font-family: var(--rf-font-display); font-size: 13px; font-weight: 700;
  color: var(--rf-gold); letter-spacing: 0.12em; margin-bottom: 4px;
}
.profile-name {
  font-family: var(--rf-font-display); font-size: 28px; font-weight: 900;
  color: var(--rf-fg); margin: 0 0 8px; letter-spacing: 0.04em;
}
.profile-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12px; color: var(--rf-fg-2);
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.profile-meta span:nth-child(even) { color: var(--rf-fg-4); }

.profile-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--rf-graphite-3); color: var(--rf-fg-2);
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--rf-dur-fast);
}
.profile-close:hover { background: var(--rf-red); color: #fff; }

/* ── Body ── */
.profile-body { padding: 24px 28px 28px; }

.profile-section-title {
  font-size: 10px; font-weight: 800; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--rf-fg-3);
  margin-bottom: 16px;
}

/* ── Season Table ── */
.season-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.season-table th {
  text-align: right; padding: 6px 12px 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--rf-fg-3);
  border-bottom: 1px solid var(--rf-line-strong);
}
.season-table th:first-child { text-align: left; }

.season-table td {
  text-align: right; padding: 10px 12px;
  color: var(--rf-fg-2); border-bottom: 1px solid var(--rf-line);
  font-variant-numeric: tabular-nums;
}
.season-table td:first-child { text-align: left; }

.season-year {
  font-family: var(--rf-font-mono); font-size: 13px;
  font-weight: 700; color: var(--rf-fg-3) !important;
}
.season-row--current td { background: rgba(201,147,42,0.07); }
.season-row--current .season-year { color: var(--rf-gold) !important; }

.stat-highlight { color: var(--rf-fg) !important; font-weight: 700; }
.stat-dim { color: var(--rf-fg-3) !important; font-size: 12px; }

.season-table tfoot .season-total td {
  border-top: 2px solid var(--rf-line-strong);
  border-bottom: none;
  color: var(--rf-fg) !important; font-weight: 700;
  background: var(--rf-graphite-3);
}
.season-total td:first-child {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--rf-fg-3) !important;
}

/* ── Career KPIs (players without season data) ── */
.profile-career-kpis {
  display: flex; gap: 24px;
}
.career-kpi {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1; background: var(--rf-graphite-3); border-radius: var(--rf-r-md); padding: 16px 8px;
}
.career-kpi span {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rf-fg-3);
}
.career-kpi b {
  font-family: var(--rf-font-display); font-size: 28px; font-weight: 700; color: var(--rf-fg);
}

/* ── Videos ── */
.profile-videos {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--rf-line);
}
.pvid-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.pvid-card {
  display: flex; flex-direction: column;
  background: var(--rf-ink);
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-r-md);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
  cursor: pointer;
}
.pvid-card:hover {
  border-color: #fb7299;
  transform: translateY(-2px);
}
.pvid-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a0812 0%, #0a0d1a 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.pvid-bilibili {
  position: absolute;
  font-size: 56px; font-weight: 900;
  color: #fb7299; opacity: 0.12;
  user-select: none; line-height: 1;
  font-family: var(--rf-font-display);
}
.pvid-play-btn {
  position: relative; z-index: 1;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(251,114,153,0.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
  padding-left: 3px;
  box-shadow: 0 2px 12px rgba(251,114,153,0.5);
  transition: transform 150ms ease, background 150ms ease;
}
.pvid-card:hover .pvid-play-btn {
  transform: scale(1.14);
  background: #fb7299;
}
.pvid-info {
  padding: 8px 10px 10px;
}
.pvid-name {
  font-size: 12px; font-weight: 700;
  color: var(--rf-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pvid-tag {
  font-size: 10px; color: var(--rf-fg-3);
  letter-spacing: 0.06em;
  margin-top: 3px;
}
.pvid-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 0;
  font-size: 12px; color: var(--rf-fg-3); letter-spacing: 0.06em;
}
.pvid-spinner {
  display: inline-block;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(251,114,153,0.25);
  border-top-color: #fb7299;
  animation: pvid-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes pvid-spin { to { transform: rotate(360deg); } }
.pvid-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.pvid-more {
  display: block;
  margin-top: 14px;
  font-size: 11px; font-weight: 600;
  color: #fb7299;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 8px;
  border: 1px solid rgba(251,114,153,0.25);
  border-radius: var(--rf-r-sm);
  transition: background 150ms ease;
}
.pvid-more:hover {
  background: rgba(251,114,153,0.08);
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .profile-panel { max-height: 100vh; border-radius: var(--rf-r-md) var(--rf-r-md) 0 0; }
  .profile-modal { align-items: flex-end; padding: 0; }
  .profile-head { padding: 20px 16px; gap: 14px; }
  .profile-photo, .profile-num-badge { width: 72px; height: 96px; }
  .profile-name { font-size: 22px; }
  .profile-body { padding: 16px 16px 24px; }
  .season-table th, .season-table td { padding: 8px 8px; font-size: 13px; }
}

/* ========================================
   MILESTONES MODULE
   ======================================== */

.ms-section { position: relative; }

.ms-more-btn {
  background: none; border: 1px solid var(--rf-line-strong);
  color: var(--rf-fg-3); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 12px; border-radius: var(--rf-r-sm);
  cursor: pointer; transition: border-color 150ms, color 150ms;
}
.ms-more-btn:hover { border-color: var(--rf-gold); color: var(--rf-gold); }

/* ── Horizontal timeline ── */
.ms-timeline-wrap {
  position: relative;
  padding-bottom: 8px;
}

.ms-axis-line {
  position: absolute;
  left: 0; right: 0;
  top: calc(44px + 45px + 10px); /* label + avatar + gap to dot */
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--rf-line-strong) 5%, var(--rf-line-strong) 95%, transparent);
  pointer-events: none;
  z-index: 0;
}

.ms-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  cursor: grab;
  user-select: none;
  padding-bottom: 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* hide scrollbar */
  scrollbar-width: none;
}
.ms-track::-webkit-scrollbar { display: none; }

.ms-hint {
  text-align: right;
  font-size: 10px;
  color: var(--rf-fg-4);
  letter-spacing: 0.08em;
  margin-top: 6px;
}

/* ── Card ── */
.ms-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 150px;
  padding: 0 8px;
  position: relative;
  z-index: 1;
}

.ms-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.35;
  min-height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}

.ms-avatar {
  width: 45px; height: 45px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--rf-line-strong);
  flex-shrink: 0;
  background: var(--rf-graphite-3);
  display: flex; align-items: center; justify-content: center;
}
.ms-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 10%;
}
.ms-avatar-initials {
  font-family: var(--rf-font-display);
  font-size: 15px; font-weight: 900;
  color: var(--rf-fg-3);
}

.ms-axis-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin: 6px 0 4px;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.ms-date {
  font-size: 10px;
  color: var(--rf-fg-3);
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

/* ── Full timeline modal ── */
.ms-modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.ms-modal-panel {
  background: var(--rf-graphite-2);
  border: 1px solid var(--rf-line-strong);
  border-radius: var(--rf-r-lg);
  box-shadow: var(--rf-shadow-pop);
  width: 100%; max-width: 520px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.ms-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--rf-line);
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--rf-fg-3);
  flex-shrink: 0;
}

.ms-modal-close {
  background: var(--rf-graphite-3); border: 0;
  width: 28px; height: 28px; border-radius: 50%;
  color: var(--rf-fg-2); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 150ms;
}
.ms-modal-close:hover { background: var(--rf-red); color: #fff; }

.ms-modal-body {
  overflow-y: auto;
  padding: 16px 24px 24px;
}

/* ── Vertical timeline items ── */
.ms-vitem {
  display: flex;
  gap: 0;
  align-items: flex-start;
  min-height: 56px;
}

/* date cell — shared base */
.ms-vitem-datecell {
  width: 120px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--rf-fg-3);
  letter-spacing: 0.02em;
  line-height: 1.4;
  padding-top: 6px;
}
.ms-vitem-datecell--l { text-align: right; padding-right: 12px; }
.ms-vitem-datecell--r { text-align: left;  padding-left: 12px; }

/* content cell */
.ms-vitem-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
}
.ms-vitem-content--l { padding-right: 12px; justify-content: flex-end; flex-direction: row-reverse; }
.ms-vitem-content--r { padding-left: 12px;  justify-content: flex-start; }

.ms-vitem-spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
}

.ms-vitem-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 5px currentColor;
}

.ms-vitem-line {
  width: 2px;
  flex: 1;
  min-height: 30px;
  background: var(--rf-line);
  margin-top: 3px;
}

.ms-vitem-photo {
  width: 32px; height: 32px;
  object-fit: cover; object-position: center 10%;
  border-radius: 50%;
  border: 1px solid var(--rf-line-strong);
  flex-shrink: 0;
}

.ms-vitem-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .ms-card { width: 120px; }
  .ms-avatar { width: 40px; height: 40px; }
  .ms-axis-line { top: calc(44px + 40px + 10px); }
  .ms-modal-panel { max-height: 100vh; border-radius: var(--rf-r-md) var(--rf-r-md) 0 0; }
  .ms-modal { align-items: flex-end; padding: 0; }
  .ms-vitem-left { width: 88px; font-size: 10px; }
}

/* ========================================
   MONTHLY RANKINGS
   ======================================== */
.mr-section { }

.mr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.mr-panel {
  background: var(--rf-graphite-2);
  border: 1px solid var(--rf-line-strong);
  border-radius: var(--rf-r-lg);
  overflow: hidden;
}

.mr-panel-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rf-fg-3);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--rf-line);
}

.mr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rf-line);
  transition: background 120ms ease;
}
.mr-row:last-child { border-bottom: none; }
.mr-row--clickable { cursor: pointer; }
.mr-row--clickable:hover { background: rgba(255,255,255,0.04); }

.mr-rank {
  width: 28px;
  text-align: center;
  font-family: var(--rf-font-display);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.mr-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--rf-line-strong);
  background: var(--rf-graphite-3);
  display: flex; align-items: center; justify-content: center;
}
.mr-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 10%;
}
.mr-initials {
  font-size: 13px; font-weight: 700;
  color: var(--rf-fg-3);
}

.mr-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mr-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--rf-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mr-num {
  font-size: 10px;
  color: var(--rf-fg-4);
  letter-spacing: 0.06em;
}

.mr-val {
  font-family: var(--rf-font-display);
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* 轮播容器 */
.mr-carousel-wrap {
  overflow: hidden;
  touch-action: pan-y;
}
.mr-carousel-track {
  display: flex;
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.mr-carousel-slide {
  width: 100%;
  flex-shrink: 0;
}

/* 左右箭头导航 */
.mr-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mr-nav-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--rf-line-strong);
  background: var(--rf-graphite-2);
  color: var(--rf-fg);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 120ms, opacity 120ms;
}
.mr-nav-btn:hover:not(:disabled) { background: var(--rf-graphite-3); }
.mr-nav-btn:disabled { opacity: 0.3; cursor: default; }
.mr-nav-label {
  font-size: 12px;
  color: var(--rf-fg-3);
  min-width: 36px;
  text-align: center;
}

/* 月份标签栏 */
.mr-month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  justify-content: center;
}
.mr-month-tab {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--rf-line-strong);
  background: transparent;
  color: var(--rf-fg-3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}
.mr-month-tab:hover { border-color: var(--rf-gold); color: var(--rf-fg); }
.mr-month-tab--active {
  background: var(--rf-gold);
  border-color: var(--rf-gold);
  color: #000;
}

@media (max-width: 900px) {
  .mr-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .mr-grid { grid-template-columns: 1fr; }
  .mr-val { font-size: 16px; }
  .mr-month-tab { font-size: 11px; padding: 3px 10px; }
}
