/* assets/css/catcher_ranking.css */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #080818;
  color: white;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(78,205,196,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78,205,196,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none; z-index: 0;
}

.orb { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; }
.orb-1 { width: 500px; height: 500px; background: rgba(255,215,0,0.07); top: -150px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: rgba(78,205,196,0.07); bottom: 0; left: -100px; }

.connection-status {
  position: fixed; top: 12px; left: 12px;
  background: rgba(0,0,0,0.7); color: white;
  padding: 6px 13px; border-radius: 16px; font-size: 12px; font-weight: 600;
  z-index: 900; border: 1px solid rgba(255,255,255,0.12);
}
.connection-status.connected    { background: rgba(76,175,80,0.85); }
.connection-status.disconnected { background: rgba(244,67,54,0.85); }

.container { max-width: 1100px; margin: auto; padding: 28px 20px 80px; position: relative; z-index: 1; }

/* Top bar */
.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: rgba(255,255,255,0.45); font-size: 13px; font-weight: 500;
  padding: 9px 16px; border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
  transition: all 0.2s;
}
.back-btn:hover { color: white; border-color: rgba(255,255,255,0.22); }

.header-stats { display: flex; gap: 10px; }
.hstat {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 16px; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  min-width: 80px;
}
.hstat-num { font-size: 1.2rem; font-weight: 900; color: #4ECDC4; line-height: 1; margin-bottom: 3px; }
.hstat-num.gold { color: #FFD700; }
.hstat-label { font-size: 10px; opacity: 0.4; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* Page header */
.page-header { margin-bottom: 28px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: #FFD700; opacity: 0.7; margin-bottom: 12px; }
h1 { font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 900; line-height: 0.95; letter-spacing: -2px; }
.line-white { display: block; color: white; }
.line-grad {
  display: block;
  background: linear-gradient(90deg, #FFD700, #FF6B6B, #4ECDC4);
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200% auto; animation: gradMove 4s linear infinite;
}
@keyframes gradMove { to { background-position: -200% center; } }

/* Controls */
.controls {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 16px;
}
.sort-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sort-btn {
  padding: 9px 18px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.sort-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.sort-btn.active { background: rgba(255,215,0,0.15); border-color: rgba(255,215,0,0.4); color: #FFD700; }

.search-wrap { position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 1rem; opacity: 0.45; }
.search-input {
  padding: 10px 16px 10px 40px; font-size: 13px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 24px;
  background: rgba(255,255,255,0.05); color: white; width: 240px;
  transition: all 0.2s; font-family: inherit;
}
.search-input::placeholder { color: rgba(255,255,255,0.3); }
.search-input:focus { outline: none; border-color: rgba(255,215,0,0.35); background: rgba(255,255,255,0.08); }

/* Table */
.table-wrap {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px; overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: rgba(255,215,0,0.08); color: rgba(255,255,255,0.7);
  padding: 14px 12px; text-align: center; font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; border: none;
  position: sticky; top: 0; z-index: 10;
}
td {
  padding: 13px 12px; text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.05); color: white;
}
tbody tr { cursor: pointer; transition: background-color 0.15s ease; }
tbody tr:hover td { background: rgba(255,215,0,0.06); }

/* Medal rows */
.gold-row   td { background: rgba(255,215,0,0.08);   border-bottom-color: rgba(255,215,0,0.15); }
.silver-row td { background: rgba(192,192,192,0.07); border-bottom-color: rgba(192,192,192,0.15); }
.bronze-row td { background: rgba(205,127,50,0.07);  border-bottom-color: rgba(205,127,50,0.15); }

/* My row */
tbody tr.my-row td { background: rgba(78,205,196,0.1) !important; border-bottom: 1px solid rgba(78,205,196,0.2) !important; }
tbody tr.my-row td:first-child { border-left: 3px solid #4ECDC4; }
tbody tr.my-row:hover td { background: rgba(78,205,196,0.18) !important; }

/* YOU badge */
.you-badge {
  display: inline-block; font-size: 8px; font-weight: 800; padding: 2px 6px; border-radius: 6px;
  margin-left: 6px; background: rgba(78,205,196,0.25); color: #4ECDC4;
  border: 1px solid rgba(78,205,196,0.4); vertical-align: middle;
}

/* Rank badges */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; font-weight: 800; font-size: 0.9rem; color: white; position: relative;
}
.rank-1 { background: linear-gradient(45deg,#FFD700,#FFA500); box-shadow: 0 0 12px rgba(255,215,0,0.4); }
.rank-2 { background: linear-gradient(45deg,#C0C0C0,#E8E8E8); color: #333; }
.rank-3 { background: linear-gradient(45deg,#CD7F32,#DAA520); }
.rank-other { background: rgba(80,80,100,0.7); font-size: 0.8rem; }
.rank-1::after { content:'👑'; position:absolute; top:-6px; right:-6px; font-size:0.9rem; }
.rank-2::after { content:'🥈'; position:absolute; top:-5px; right:-5px; font-size:0.8rem; }
.rank-3::after { content:'🥉'; position:absolute; top:-5px; right:-5px; font-size:0.8rem; }

/* Cells */
.catcher-cell { font-weight: 700; font-size: 0.95rem; text-align: left; padding-left: 16px; }
.level-display { font-size: 0.75rem; opacity: 0.45; margin-top: 3px; }
.points-cell { font-weight: 800; color: #FFD700; font-size: 1rem; }
.team-count { color: #4ECDC4; font-weight: 700; }

/* Name tiers */
.catcher-name { display: inline-block; font-weight: 800; background-size: 200% auto; background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: shine 3s linear infinite; }
.king,.god { background-image: linear-gradient(90deg,#ffd700,#fff,#ffd700); }
.flame     { background-image: linear-gradient(90deg,#ff4444,#fff,#ff4444); }
.diamond   { background-image: linear-gradient(90deg,#00bfff,#fff,#00bfff); }
.shine     { background-image: linear-gradient(90deg,#32cd32,#fff,#32cd32); }
.normal    { color: white; background: none; -webkit-text-fill-color: white; animation: none; }
@keyframes shine { to { background-position: -200% center; } }

/* Loading */
.loading { text-align: center; padding: 48px; color: rgba(255,255,255,0.4); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.spinner { width: 22px; height: 22px; border: 2px solid rgba(255,255,255,0.15); border-top-color: #FFD700; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* FAB */
.refresh-fab {
  position: fixed; bottom: 20px; right: 20px;
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(45deg,#4ECDC4,#44A08D);
  border: none; color: white; font-size: 1.1rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3); z-index: 1000; transition: transform 0.2s;
}
.refresh-fab:hover { transform: scale(1.1); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 1024px) { th:nth-child(5), td:nth-child(5) { display: none; } }
@media (max-width: 768px) {
  .controls { flex-direction: column; align-items: flex-start; }
  .search-input { width: 100%; max-width: 260px; }
  th:nth-child(4), td:nth-child(4) { display: none; }
  td { padding: 10px 6px; }
  .catcher-cell { padding-left: 10px; }
  h1 { letter-spacing: -1px; }
}
@media (max-width: 600px) { .table-wrap { overflow-x: auto; } table { min-width: 380px; } }
@media (max-width: 480px) { table { font-size: 12px; } .rank-badge { width: 28px; height: 28px; font-size: 0.75rem; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }