/**
 * Club Tournament Manager — Frontend CSS
 * ESPN Dark Style - Mobile First
 *
 * Paleta: #0d0d0d fondo, #1a1a2e cards, #e30613 rojo, #ff6b00 naranja
 * Fuentes: Oswald, Inter
 */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   BASE
   ============================================================ */
.ctm-public * {
  box-sizing: border-box;
}

.ctm-public {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #ffffff;
  line-height: 1.5;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.ctm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
}

.ctm-btn-primary {
  background: linear-gradient(135deg, #e30613 0%, #b30010 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(227, 6, 19, 0.3);
}

.ctm-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(227, 6, 19, 0.5);
  color: #fff;
  text-decoration: none;
}

.ctm-btn-ghost {
  background: transparent;
  color: #aaa;
  border: 1px solid #444;
}

.ctm-btn-ghost:hover {
  color: #fff;
  border-color: #888;
  text-decoration: none;
}

.ctm-btn-xl {
  padding: 14px 32px;
  font-size: 15px;
}

.ctm-btn-lg { padding: 12px 24px; font-size: 14px; }
.ctm-btn-sm { padding: 7px 14px; font-size: 11px; }
.ctm-btn-xs { padding: 4px 10px; font-size: 11px; }

.ctm-btn-danger {
  background: linear-gradient(135deg, #c0392b 0%, #96281b 100%);
  color: #fff;
}

.ctm-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #333;
  color: #777;
  pointer-events: none;
}

/* ============================================================
   FILTROS PÚBLICOS
   ============================================================ */
.ctm-public-filters {
  margin-bottom: 24px;
}

.ctm-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ctm-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ctm-filter-tab {
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #aaa;
  border-radius: 30px;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.ctm-filter-tab:hover,
.ctm-filter-active {
  background: rgba(227,6,19,0.2) !important;
  border-color: #e30613 !important;
  color: #fff !important;
  text-decoration: none !important;
}

.ctm-status-filters {
  display: flex;
  gap: 6px;
}

.ctm-pill-filter {
  padding: 6px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #888;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.ctm-pill-filter:hover,
.ctm-pill-active {
  background: rgba(255,107,0,0.15) !important;
  border-color: #ff6b00 !important;
  color: #ff6b00 !important;
}

/* ============================================================
   TOURNAMENT CARDS
   ============================================================ */
.ctm-tournaments-grid {
  display: grid;
  gap: 20px;
}

.ctm-grid-cols-1 { grid-template-columns: 1fr; }
.ctm-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ctm-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

.ctm-tournament-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  display: flex;
  flex-direction: column;
}

.ctm-tournament-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  border-color: rgba(227,6,19,0.3);
}

.ctm-card-sport-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  position: relative;
}

.ctm-sport-header-tennis {
  background: linear-gradient(135deg, rgba(0,100,255,0.3) 0%, rgba(0,60,180,0.3) 100%);
  border-bottom: 2px solid rgba(0,150,255,0.5);
}

.ctm-sport-header-padel {
  background: linear-gradient(135deg, rgba(0,180,80,0.3) 0%, rgba(0,120,50,0.3) 100%);
  border-bottom: 2px solid rgba(0,220,120,0.5);
}

.ctm-sport-icon-lg { font-size: 20px; }
.ctm-sport-name {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  flex: 1;
}

.ctm-tournament-status {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ctm-status-open      { background: rgba(0,200,100,0.2); color: #00cc66; border: 1px solid rgba(0,200,100,0.4); }
.ctm-status-progress  { background: rgba(255,107,0,0.2);  color: #ff6b00; border: 1px solid rgba(255,107,0,0.4); }
.ctm-status-finished  { background: rgba(100,100,140,0.2); color: #8888aa; border: 1px solid #333; }
.ctm-status-cancelled { background: rgba(200,0,0,0.2); color: #ff4444; border: 1px solid rgba(200,0,0,0.4); }

.ctm-tournament-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ctm-tournament-type-badge {
  font-size: 11px;
  color: #888;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ctm-tournament-card-title {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.ctm-tournament-card-category {
  font-size: 12px;
  color: #888;
  display: inline-flex;
  background: rgba(255,255,255,0.06);
  padding: 3px 10px;
  border-radius: 20px;
  align-self: flex-start;
  border: 1px solid #333;
}

/* Fechas */
.ctm-tournament-dates {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ctm-date-block { display: flex; flex-direction: column; gap: 1px; }
.ctm-date-label { font-size: 10px; color: #666; font-family: 'Oswald', sans-serif; letter-spacing: 0.5px; text-transform: uppercase; }
.ctm-date-day   { font-size: 13px; color: #ccc; font-weight: 500; }
.ctm-date-arrow { color: #444; font-size: 14px; }

/* Capacidad */
.ctm-tournament-capacity { display: flex; flex-direction: column; gap: 6px; }
.ctm-capacity-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.ctm-capacity-label { color: #888; }
.ctm-capacity-count { color: #ccc; font-weight: 600; }

.ctm-capacity-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.ctm-capacity-fill {
  height: 100%;
  background: linear-gradient(90deg, #00cc66, #00aa55);
  border-radius: 2px;
  transition: width 0.8s ease;
}

.ctm-capacity-full { background: linear-gradient(90deg, #e30613, #ff4444); }

.ctm-full-badge, .ctm-last-spots {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 8px;
}

.ctm-full-badge  { background: rgba(200,0,0,0.2); color: #ff4444; border: 1px solid rgba(200,0,0,0.3); }
.ctm-last-spots  { background: rgba(255,200,0,0.15); color: #ffcc00; border: 1px solid rgba(255,200,0,0.3); }

/* Fee */
.ctm-tournament-fee {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: auto;
}

.ctm-fee-amount { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700; color: #ff6b00; }
.ctm-fee-currency { font-size: 13px; color: #888; }
.ctm-fee-label   { font-size: 12px; color: #666; }
.ctm-fee-free    { font-size: 13px; color: #00cc66; }

/* Card footer */
.ctm-tournament-card-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ============================================================
   TOURNAMENT HERO
   ============================================================ */
.ctm-tournament-hero {
  position: relative;
  padding: 40px 24px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0;
}

.ctm-sport-bg-tennis {
  background: linear-gradient(135deg, #0a0a20 0%, #001040 50%, #001a60 100%);
  border-bottom: 3px solid rgba(0,150,255,0.5);
}

.ctm-sport-bg-padel {
  background: linear-gradient(135deg, #0a1a10 0%, #001a10 50%, #003020 100%);
  border-bottom: 3px solid rgba(0,200,100,0.5);
}

.ctm-tournament-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: rgba(227,6,19,0.06);
  border-radius: 50%;
}

.ctm-tournament-hero-inner { position: relative; }

.ctm-tournament-hero-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.ctm-sport-badge-lg {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 5px 14px;
  border-radius: 4px;
  text-transform: uppercase;
}

.ctm-tournament-hero-title {
  font-family: 'Oswald', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
  line-height: 1.1;
}

.ctm-tournament-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: #aaa;
  margin-bottom: 20px;
}

.ctm-hero-cta { margin-top: 8px; }

.ctm-already-registered {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(0,200,100,0.15);
  border: 1px solid rgba(0,200,100,0.4);
  border-radius: 6px;
  color: #00cc66;
  font-size: 14px;
  font-weight: 600;
}

.ctm-tournament-full {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  background: rgba(200,0,0,0.1);
  border: 1px solid rgba(200,0,0,0.3);
  border-radius: 6px;
  color: #ff4444;
  font-size: 14px;
}

/* STATS BAR */
.ctm-tournament-stats-bar {
  display: flex;
  gap: 0;
  background: #0d1020;
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid #1a1a3a;
}

.ctm-tournament-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border-right: 1px solid #1a1a3a;
  gap: 4px;
  text-align: center;
}

.ctm-tournament-stat:last-child { border-right: none; }
.ctm-tournament-stat strong { font-family: 'Oswald', sans-serif; font-size: 18px; color: #fff; }
.ctm-tournament-stat span   { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================================
   DETAIL TABS
   ============================================================ */
.ctm-detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #1a1a3a;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.ctm-detail-tab {
  padding: 12px 18px;
  background: transparent;
  border: none;
  color: #666;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.ctm-detail-tab:hover { color: #ccc; }

.ctm-detail-tab-active {
  color: #e30613 !important;
  border-bottom-color: #e30613 !important;
}

.ctm-detail-panel { animation: ctmFadeIn 0.2s ease; }

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

/* ============================================================
   BRACKET VISUAL
   ============================================================ */
.ctm-bracket-wrapper {
  overflow: hidden;
}

.ctm-bracket-scroll {
  overflow-x: auto;
  padding-bottom: 16px;
}

.ctm-bracket {
  display: flex;
  gap: 0;
  min-width: max-content;
  padding: 16px 0;
}

.ctm-bracket-round {
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 0 12px;
}

.ctm-bracket-round-label {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: #e30613;
  text-transform: uppercase;
  text-align: center;
  padding: 0 0 16px;
  border-bottom: 1px solid #333;
  margin-bottom: 16px;
}

.ctm-bracket-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 16px;
}

.ctm-bracket-match {
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: default;
}

.ctm-bracket-match:hover {
  border-color: #555;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.ctm-match-done { border-color: #2a2a4a; }

.ctm-bracket-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 8px;
  transition: background 0.15s;
}

.ctm-bracket-sep {
  height: 1px;
  background: #222;
}

.ctm-bracket-player-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}

.ctm-bracket-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.ctm-avatar-initial-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #333, #555);
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  color: #fff;
}

.ctm-bracket-name {
  font-size: 13px;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctm-bracket-score {
  display: flex;
  align-items: center;
}

.ctm-bracket-score-val {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  min-width: 28px;
  text-align: center;
}

.ctm-bracket-win-icon { color: #00cc66; font-size: 14px; }

.ctm-bracket-winner {
  background: rgba(0,200,100,0.08);
}

.ctm-bracket-winner .ctm-bracket-name {
  color: #fff;
  font-weight: 600;
}

.ctm-bracket-loser { opacity: 0.5; }
.ctm-tbd { color: #555; font-style: italic; font-size: 12px; }

/* Tooltip */
.ctm-bracket-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a4a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #ccc;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  text-align: center;
}

.ctm-bracket-match:hover .ctm-bracket-tooltip { display: block; }

.ctm-bracket-legend {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid #222;
  margin-top: 16px;
}

.ctm-legend-item { font-size: 12px; color: #888; display: flex; align-items: center; gap: 6px; }

/* ============================================================
   PARTICIPANTS GRID
   ============================================================ */
.ctm-participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.ctm-participant-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.ctm-participant-card:hover {
  transform: translateY(-2px);
  border-color: #444;
}

.ctm-participant-seed {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  color: #e30613;
  letter-spacing: 1px;
}

.ctm-participant-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e30613, #ff6b00);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ctm-participant-avatar img { width: 100%; height: 100%; object-fit: cover; }

.ctm-participant-name  { font-size: 13px; font-weight: 600; color: #fff; }
.ctm-participant-points { font-size: 11px; color: #888; font-family: 'Oswald', sans-serif; }

/* ============================================================
   MATCHES LIST
   ============================================================ */
.ctm-matches-list { display: flex; flex-direction: column; gap: 10px; }

.ctm-match-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
}

.ctm-match-card:hover { border-color: #444; }

.ctm-match-time, .ctm-match-date {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  color: #888;
  min-width: 80px;
  white-space: nowrap;
}

.ctm-match-players {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.ctm-match-player { color: #ccc; }
.ctm-match-vs     { color: #555; font-size: 11px; font-weight: 700; font-family: 'Oswald', sans-serif; }

.ctm-match-result-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ctm-player-winner { color: #fff; font-weight: 700; }
.ctm-player-loser  { color: #555; }
.ctm-win-indicator { font-size: 14px; margin-right: 4px; }

.ctm-match-score {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  color: #fff;
  min-width: 80px;
  text-align: center;
}

.ctm-match-round { font-size: 11px; color: #666; font-family: 'Oswald', sans-serif; letter-spacing: 0.5px; }

/* ============================================================
   RANKING PUBLIC
   ============================================================ */
.ctm-ranking-filters { margin-bottom: 24px; }
.ctm-ranking-sport-tabs { margin-bottom: 12px; }
.ctm-ranking-cat-filter { display: block; }

/* PODIUM */
.ctm-public-podium { margin-bottom: 32px; }

.ctm-section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 20px;
  padding-left: 12px;
  border-left: 3px solid #e30613;
}

.ctm-podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  padding: 20px 0 0;
}

.ctm-podium-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 200px;
}

.ctm-podium-crown {
  font-size: 28px;
  margin-bottom: 4px;
  animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

.ctm-podium-player-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  width: 100%;
  transition: transform 0.2s;
}

.ctm-podium-card-gold {
  background: linear-gradient(135deg, #1a1500, #2a2200);
  border-color: rgba(255,215,0,0.3);
  box-shadow: 0 0 20px rgba(255,215,0,0.1);
}

.ctm-podium-avatar-wrap { position: relative; }

.ctm-podium-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #333;
}

.ctm-podium-img-lg { width: 80px; height: 80px; border-color: #ffd700; }

.ctm-podium-initial {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #333, #555);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: #fff;
}

.ctm-podium-initial-lg { width: 80px; height: 80px; font-size: 36px; }

.ctm-medal {
  position: absolute;
  bottom: -6px;
  right: -6px;
  font-size: 20px;
}

.ctm-podium-player-name { font-weight: 700; color: #fff; font-size: 14px; }
.ctm-podium-player-cat  { font-size: 11px; color: #888; }
.ctm-podium-player-pts  { font-family: 'Oswald', sans-serif; font-size: 20px; color: #e30613; }
.ctm-podium-player-pts small { font-size: 13px; color: #888; }

.ctm-podium-base {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: #fff;
  border-radius: 4px 4px 0 0;
  margin-top: 8px;
}

.ctm-podium-base-1st { height: 80px; background: linear-gradient(180deg, #b8860b, #8b6914); }
.ctm-podium-base-2nd { height: 60px; background: linear-gradient(180deg, #778899, #5a6a7a); }
.ctm-podium-base-3rd { height: 48px; background: linear-gradient(180deg, #8b4513, #6b3510); }

/* Ranking Table */
.ctm-ranking-table-wrap { margin-top: 32px; }

.ctm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ctm-table-public thead tr { background: #0d1020; }

.ctm-table-public thead th {
  padding: 12px 14px;
  text-align: left;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #666;
  text-transform: uppercase;
  border-bottom: 1px solid #1a1a3a;
}

.ctm-table-public tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}

.ctm-table-public tbody tr:hover { background: rgba(255,255,255,0.04); }

.ctm-table-public tbody td {
  padding: 12px 14px;
  color: #ccc;
  vertical-align: middle;
}

.ctm-ranking-top3 { background: rgba(255,215,0,0.03); }
.ctm-rank-pos { width: 50px; text-align: center; }
.ctm-pos-number { font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: #fff; }
.ctm-pts-value { font-weight: 700; color: #fff; font-family: 'Oswald', sans-serif; font-size: 16px; }
.ctm-pts-label { font-size: 11px; color: #666; }
.ctm-w         { color: #00cc66; font-weight: 600; }
.ctm-l         { color: #ff4444; font-weight: 600; }

.ctm-player-cell { display: flex; align-items: center; gap: 10px; }
.ctm-player-name { color: #fff; font-weight: 600; }

.ctm-player-avatar {
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #e30613, #ff6b00);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ctm-player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ctm-avatar-sm { width: 32px; height: 32px; }
.ctm-avatar-initial { font-family: 'Bebas Neue', sans-serif; font-size: 15px; color: #fff; }

.ctm-category-badge {
  background: rgba(255,255,255,0.07);
  color: #aaa;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  border: 1px solid #2a2a4a;
}

.ctm-winrate-bar-sm {
  position: relative;
  height: 18px;
  background: rgba(255,255,255,0.06);
  border-radius: 9px;
  overflow: hidden;
  min-width: 70px;
  display: flex;
  align-items: center;
}

.ctm-winrate-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #e30613, #ff6b00);
  border-radius: 9px;
}

.ctm-winrate-label {
  position: relative;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  padding-left: 6px;
  z-index: 1;
}

.ctm-sport-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Oswald', sans-serif;
}

.ctm-sport-tennis { background: rgba(0,150,255,0.15); color: #44aaff; border: 1px solid rgba(0,150,255,0.2); }
.ctm-sport-padel  { background: rgba(0,220,120,0.15); color: #00dd77; border: 1px solid rgba(0,220,120,0.2); }
.ctm-sport-sm     { padding: 2px 6px; font-size: 10px; }

/* ============================================================
   PLAYER DASHBOARD
   ============================================================ */
.ctm-player-hero {
  background: linear-gradient(135deg, #0d0d20 0%, #1a1a3e 100%);
  border-radius: 10px;
  padding: 28px 24px;
  margin-bottom: 20px;
  border: 1px solid #2a2a4a;
  position: relative;
  overflow: hidden;
}

.ctm-player-hero::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: rgba(227,6,19,0.05);
  border-radius: 50%;
}

.ctm-player-hero-inner { display: flex; align-items: center; gap: 20px; position: relative; }

.ctm-player-hero-avatar {
  position: relative;
  flex-shrink: 0;
}

.ctm-avatar-xl {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #e30613, #ff6b00);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #333;
}

.ctm-avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.ctm-avatar-initial-xl { font-family: 'Bebas Neue', sans-serif; font-size: 36px; color: #fff; }

.ctm-player-status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #0d0d20;
}

.ctm-dot-active  { background: #00cc66; }
.ctm-dot-pending { background: #ffcc00; }

.ctm-player-hero-name {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}

.ctm-player-hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctm-player-club { font-size: 13px; color: #888; }

.ctm-player-pending-notice {
  margin-top: 8px;
  font-size: 13px;
  color: #ffcc00;
  background: rgba(255,200,0,0.1);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255,200,0,0.3);
  display: inline-block;
}

/* Player Stats Bar */
.ctm-player-stats-bar {
  display: flex;
  background: #0d1020;
  border: 1px solid #1a1a3a;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.ctm-player-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-right: 1px solid #1a1a3a;
  gap: 4px;
  text-align: center;
}

.ctm-player-stat:last-child { border-right: none; }

.ctm-player-stat-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  line-height: 1;
  color: #fff;
}

.ctm-stat-gold  { color: #ffd700; }
.ctm-stat-green { color: #00cc66; }
.ctm-stat-red   { color: #ff4444; }

.ctm-player-stat-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Player Tabs */
.ctm-player-tabs { margin-bottom: 20px; }

.ctm-tab-link { color: inherit; font-weight: 600; }

/* My Tournaments */
.ctm-my-tournaments-list { display: flex; flex-direction: column; gap: 12px; }

.ctm-my-tournament-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
}

.ctm-my-tournament-card:hover { border-color: #444; }

.ctm-my-t-info { flex: 1; }
.ctm-my-t-name { color: #fff; font-size: 14px; font-weight: 600; }
.ctm-my-t-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: #888; margin-top: 4px; }
.ctm-reg-status { color: #ffcc00; }

/* Match History */
.ctm-matches-history { display: flex; flex-direction: column; gap: 8px; }

.ctm-match-history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #1a1a2e;
  border-radius: 8px;
  border-left: 4px solid transparent;
}

.ctm-match-win  { border-left-color: #00cc66; }
.ctm-match-loss { border-left-color: #ff4444; }

.ctm-mh-result {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  font-family: 'Oswald', sans-serif;
  flex-shrink: 0;
}

.ctm-mh-win  { background: rgba(0,204,102,0.15); color: #00cc66; border: 1px solid rgba(0,204,102,0.4); }
.ctm-mh-loss { background: rgba(255,68,68,0.15);  color: #ff4444; border: 1px solid rgba(255,68,68,0.4); }

.ctm-mh-info { flex: 1; }
.ctm-mh-opponent   { font-size: 14px; color: #fff; }
.ctm-mh-tournament { font-size: 12px; color: #888; margin-top: 2px; }
.ctm-mh-date       { font-size: 11px; color: #666; margin-top: 2px; }

.ctm-mh-score { font-family: 'Oswald', sans-serif; font-size: 16px; color: #fff; }
.ctm-mh-my-score  { color: #fff; font-weight: 700; }
.ctm-mh-opp-score { color: #888; }
.ctm-mh-sep       { color: #444; padding: 0 4px; }

/* Challenges */
.ctm-challenges-list { display: flex; flex-direction: column; gap: 12px; }

.ctm-challenge-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
}

.ctm-challenge-sent     { border-left: 4px solid #ff6b00; }
.ctm-challenge-received { border-left: 4px solid #e30613; }

.ctm-challenge-type {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  color: #888;
  text-transform: uppercase;
}

.ctm-challenge-sent .ctm-challenge-type     { color: #ff6b00; }
.ctm-challenge-received .ctm-challenge-type { color: #e30613; }

.ctm-challenge-opponent { font-size: 15px; font-weight: 600; color: #fff; }
.ctm-challenge-sport    { font-size: 12px; color: #888; margin-top: 4px; }
.ctm-challenge-date     { font-size: 12px; color: #888; margin-top: 4px; }
.ctm-challenge-message  { font-size: 12px; color: #aaa; margin-top: 6px; font-style: italic; }

.ctm-challenge-actions  { display: flex; flex-direction: column; gap: 6px; }
.ctm-challenge-pending-label { color: #888; font-size: 12px; font-family: 'Oswald', sans-serif; }

/* ============================================================
   ALERTS & NOTICES
   ============================================================ */
.ctm-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.ctm-alert-info    { background: rgba(0,100,255,0.1); border: 1px solid rgba(0,100,255,0.3); color: #4488ff; }
.ctm-alert-warning { background: rgba(255,200,0,0.1); border: 1px solid rgba(255,200,0,0.3); color: #ffcc00; }
.ctm-alert a { color: inherit; font-weight: 600; }

.ctm-notice {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.ctm-notice-info  { background: rgba(0,100,255,0.1); border: 1px solid rgba(0,100,255,0.3); color: #4488ff; }
.ctm-notice-error { background: rgba(200,0,0,0.1); border: 1px solid rgba(200,0,0,0.3); color: #ff4444; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.ctm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
  gap: 10px;
}

.ctm-empty-state-sm { padding: 24px 16px; }

.ctm-empty-icon { font-size: 36px; }
.ctm-empty-state h3 { font-family: 'Oswald', sans-serif; font-size: 18px; color: #888; margin: 0; }
.ctm-empty-state p  { color: #666; margin: 0; font-size: 13px; }

.ctm-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.ctm-no-results-icon { font-size: 52px; }
.ctm-no-results h3 { font-family: 'Oswald', sans-serif; font-size: 22px; color: #888; margin: 0; }
.ctm-no-results p  { color: #666; margin: 0; }

/* ============================================================
   LOGIN REQUIRED
   ============================================================ */
.ctm-login-required {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
  background: #1a1a2e;
  border-radius: 10px;
  border: 1px solid #2a2a4a;
}

.ctm-login-required p { color: #aaa; font-size: 15px; }

/* ============================================================
   MODAL
   ============================================================ */
.ctm-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ctm-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}

.ctm-modal-content {
  position: relative;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 10px;
  width: 480px;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: ctmModalIn 0.2s ease;
}

@keyframes ctmModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ctm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #2a2a4a;
}

.ctm-modal-header h3 { margin: 0; font-family: 'Oswald', sans-serif; font-size: 18px; color: #fff; }

.ctm-modal-close {
  background: transparent;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.ctm-modal-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.ctm-modal-body { padding: 20px; }
.ctm-modal-body p { color: #ccc; font-size: 14px; margin: 0 0 14px; }

.ctm-fee-notice {
  background: rgba(255,200,0,0.1);
  border: 1px solid rgba(255,200,0,0.3);
  color: #ffcc00;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.ctm-modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #2a2a4a;
  justify-content: flex-end;
}

.ctm-form-group { display: flex; flex-direction: column; gap: 6px; }
.ctm-form-group label { font-size: 12px; color: #888; font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.5px; }

.ctm-textarea {
  background: #0d0d1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  width: 100%;
  resize: vertical;
}

.ctm-textarea:focus { outline: none; border-color: #e30613; }
.ctm-textarea-sm { min-height: 70px; }
.ctm-input {
  background: #0d0d1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
}

.ctm-input:focus { outline: none; border-color: #e30613; }

.ctm-select {
  background: #0d0d1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  width: auto;
  cursor: pointer;
}

.ctm-select:focus { outline: none; border-color: #e30613; }
.ctm-select-sm { padding: 6px 10px; font-size: 12px; }

/* ============================================================
   RESPONSIVE - MOBILE FIRST
   ============================================================ */
@media (max-width: 768px) {
  .ctm-grid-cols-3, .ctm-grid-cols-2 { grid-template-columns: 1fr; }

  .ctm-tournament-hero { padding: 24px 16px; }
  .ctm-tournament-hero-title { font-size: 26px; }

  .ctm-tournament-stats-bar { overflow-x: auto; }
  .ctm-tournament-stat { min-width: 80px; }

  .ctm-player-hero-inner { flex-direction: column; align-items: flex-start; }

  .ctm-player-stats-bar { overflow-x: auto; }
  .ctm-player-stat { min-width: 70px; padding: 12px 6px; }
  .ctm-player-stat-number { font-size: 22px; }

  .ctm-challenge-card { grid-template-columns: 1fr; }

  .ctm-podium-stage { gap: 0; }
  .ctm-podium-player { max-width: 120px; }
  .ctm-podium-player-card { padding: 12px 8px; }
  .ctm-podium-img { width: 48px; height: 48px; }
  .ctm-podium-img-lg { width: 60px; height: 60px; }
  .ctm-podium-initial { width: 48px; height: 48px; font-size: 22px; }
  .ctm-podium-initial-lg { width: 60px; height: 60px; font-size: 28px; }

  .ctm-bracket-round { min-width: 180px; }
  .ctm-filter-row { flex-direction: column; align-items: flex-start; }

  .ctm-table-public { font-size: 13px; }
  .ctm-hide-mobile { display: none; }
}

@media (max-width: 480px) {
  .ctm-detail-tab { padding: 10px 12px; font-size: 11px; }
  .ctm-tournament-hero-title { font-size: 22px; }
  .ctm-btn-xl { padding: 12px 20px; font-size: 14px; }
  .ctm-show-mobile { display: block; }
}

.ctm-show-mobile { display: none; }
