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

:root {
  --bg-color: #0d1117;
  --text-color: #e6edf3;
  --primary-color: #58a6ff;
  --secondary-color: #8b949e;
  --accent-color: #bc8cff;
  --card-bg: rgba(22, 27, 34, 0.7);
  --glass-border: 1px solid rgba(240, 246, 252, 0.1);
  --font-main: 'Outfit', sans-serif;
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --glow-gradient: linear-gradient(135deg, #1f6feb 0%, #bc8cff 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #1f1f2e 0%, #0d1117 40%);
  overflow-x: hidden;
}

#app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1,
h2,
h3 {
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  background: var(--glow-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(88, 166, 255, 0.3);
}

/* Landing Page Hero */
.hero-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}

.hero-title {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin-bottom: 3rem;
  max-width: 900px;
}

.cta-button {
  background: var(--glow-gradient);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-medium);
  box-shadow: 0 0 20px rgba(31, 111, 235, 0.4);
  position: relative;
  overflow: hidden;
  font-family: var(--font-main);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(188, 140, 255, 0.6);
}

.cta-button:active {
  transform: translateY(1px);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tournament List Page */
.tournament-list-view {
  display: none;
  /* Hidden by default */
  width: 100%;
}

.list-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tournament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.tournament-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: var(--transition-fast);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tournament-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card-date {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: block;
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.card-dist, .card-duration {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-registered {
  background: rgba(46, 160, 67, 0.2);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.3);
}

.status-open {
  background: rgba(56, 139, 253, 0.2);
  color: #58a6ff;
  border: 1px solid rgba(56, 139, 253, 0.3);
}

/* Detail View */
.detail-view {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: #0d1117;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.detail-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.back-button {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  padding: 1.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(240, 246, 252, 0.1);
  background: rgba(22, 27, 34, 0.8);
}

.back-button:hover {
  color: #79c0ff;
  background: rgba(22, 27, 34, 1);
}

.detail-layout {
  display: grid;
  grid-template-columns: 32% 34% 34%;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 61px); /* Accounts for back button header height */
}

@media (max-width: 1024px) {
  .detail-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
    height: auto;
  }
  .detail-col-info, .detail-col-players, .detail-col-pairings {
    border-right: none !important;
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
    height: auto !important;
    overflow-y: visible !important;
  }
}

.detail-col-info {
  padding: 2rem;
  overflow-y: auto;
  border-right: 1px solid rgba(240, 246, 252, 0.1);
  background: #161b22;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.detail-col-players {
  background: #0d1117;
  border-right: 1px solid rgba(240, 246, 252, 0.1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 2rem;
  height: 100%;
}

.detail-col-pairings {
  background: #0d1117;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 2rem;
  height: 100%;
}

.detail-poster {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.detail-poster img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Modal styles removed/deprecated */
.modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
}

.modal-left,
.modal-right {
  height: 100%;
  padding: 2.5rem;
}

.modal-left {
  overflow-y: auto;
  border-right: 1px solid rgba(240, 246, 252, 0.1);
  background: rgba(22, 27, 34, 0.5);
}

.modal-right {
  overflow: hidden;
  background: #0d1117;
  display: flex;
  flex-direction: column;
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  border: none;
  color: var(--secondary-color);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.detail-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #30363d;
  padding-bottom: 1rem;
}

.detail-title {
  font-size: 2rem;
  color: var(--text-color);
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.info-item label {
  display: block;
  color: var(--secondary-color);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.info-item span {
  font-size: 1.1rem;
  font-weight: 500;
}

.external-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.link-btn {
  flex: 1;
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}

.link-chess-results {
  background: var(--primary-color);
  color: white;
}

.link-chess-results:hover {
  background: #79c0ff;
}

.link-dcd {
  background: rgba(188, 140, 255, 0.2);
  color: var(--accent-color);
  border: 1px solid rgba(188, 140, 255, 0.3);
}

.link-dcd:hover {
  background: rgba(188, 140, 255, 0.3);
}

/* OCR & Poster Details */
.detail-section {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-section h3,
.detail-poster h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-section p {
  color: var(--text-color);
  font-size: 1rem;
  line-height: 1.5;
}

.detail-poster {
  margin-top: 0;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.detail-poster img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  margin-top: auto;
  margin-bottom: auto;
}

.no-poster {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-color);
  font-style: italic;
  font-size: 1.2rem;
  border: 2px dashed rgba(240, 246, 252, 0.1);
  border-radius: 20px;
}

/* Responsiveness */
@media (max-width: 900px) {
  .modal-layout {
    grid-template-columns: 1fr;
  }

  .modal-left {
    border-right: none;
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
  }

  .modal-content {
    height: 95vh;
  }
}

/* ============================================
   MI CONTRINCANTE - OPPONENT ANALYSIS STYLES
   ============================================ */

/* Opponent Input View */
.opponent-view {
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: radial-gradient(circle at top left, #1f1f2e 0%, #0d1117 40%);
  z-index: 50;
  display: block;
  overflow-y: auto;
  padding: 2rem;
}

.opponent-container {
  width: 100%;
  max-width: 700px;
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  animation: fadeIn 0.5s ease-out;
}

.opponent-title {
  font-size: 2.5rem;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.opponent-subtitle {
  text-align: center;
  color: var(--secondary-color);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.opponent-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input,
.form-group select {
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(240, 246, 252, 0.2);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  color: var(--text-color);
  font-size: 1rem;
  font-family: var(--font-main);
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.analyze-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1.25rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 1rem;
  font-family: var(--font-main);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.analyze-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(118, 75, 162, 0.5);
}

.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.analysis-status {
  min-height: 30px;
  text-align: center;
  font-size: 0.95rem;
}

/* Decision View */
.decision-view {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: #0d1117;
  z-index: 60;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4rem 2rem 2rem 2rem;
}

.decision-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease-out;
}

.decision-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(240, 246, 252, 0.1);
}

.decision-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 1.1rem;
  color: var(--secondary-color);
}

.decision-meta span {
  padding: 0.5rem 1rem;
  background: rgba(22, 27, 34, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(240, 246, 252, 0.1);
}

.decision-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.decision-block {
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-radius: 16px;
  padding: 2rem;
  animation: slideUp 0.3s ease-out;
}

.decision-block h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.decision-block h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.decision-headline {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-color: rgba(102, 126, 234, 0.3);
  text-align: center;
}

.headline-text {
  font-size: 2rem;
  margin: 1rem 0;
  line-height: 1.4;
}

.headline-text strong {
  color: #667eea;
  font-weight: 700;
}

.version-badge,
.confidence-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.5rem;
  border: 2px solid;
}

.version-active {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

.version-solid {
  background: rgba(88, 166, 255, 0.2);
  color: #58a6ff;
  border-color: rgba(88, 166, 255, 0.4);
}

.version-aggressive {
  background: rgba(255, 159, 10, 0.2);
  color: #ff9f0a;
  border-color: rgba(255, 159, 10, 0.4);
}

.version-standard {
  background: rgba(188, 140, 255, 0.2);
  color: #bc8cff;
  border-color: rgba(188, 140, 255, 0.4);
}

.confidence-high {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.4);
}

.confidence-medium {
  background: rgba(255, 191, 0, 0.2);
  color: #ffbf00;
  border-color: rgba(255, 191, 0, 0.4);
}

.confidence-low {
  background: rgba(139, 148, 158, 0.2);
  color: #8b949e;
  border-color: rgba(139, 148, 158, 0.4);
}

.pattern-moves {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.move-item {
  background: rgba(13, 17, 23, 0.9);
  border: 1px solid rgba(88, 166, 255, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: var(--primary-color);
}

.plan-list,
.forbidden-list {
  list-style: none;
  padding: 0;
}

.plan-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(240, 246, 252, 0.05);
  padding-left: 1.5rem;
  position: relative;
}

.plan-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #3fb950;
  font-weight: bold;
}

.forbidden-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(240, 246, 252, 0.05);
  padding-left: 1.5rem;
  position: relative;
  color: #ff6b6b;
}

.forbidden-list li:before {
  content: "×";
  position: absolute;
  left: 0;
  color: #ff6b6b;
  font-weight: bold;
  font-size: 1.5rem;
}

.forbidden-block {
  background: rgba(255, 107, 107, 0.05);
  border-color: rgba(255, 107, 107, 0.2);
}

.mental-block {
  background: linear-gradient(135deg, rgba(188, 140, 255, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%);
  border-color: rgba(188, 140, 255, 0.3);
}

.mental-note {
  font-size: 1.3rem;
  font-style: italic;
  text-align: center;
  color: #bc8cff;
  font-weight: 500;
  line-height: 1.6;
}

.decision-timer {
  text-align: center;
  color: var(--secondary-color);
  font-size: 0.95rem;
  padding: 1rem;
  margin-top: 1rem;
  background: rgba(255, 191, 0, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 191, 0, 0.2);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .opponent-container {
    padding: 2rem 1.5rem;
  }

  .decision-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .headline-text {
    font-size: 1.5rem;
  }
}

.cta-button+.cta-button {
  margin-top: 1rem;
}

/* ============================================
   PROFILE VIEW STYLES
   ============================================ */

.profile-view {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: radial-gradient(circle at top left, #1f1f2e 0%, #0d1117 40%);
  z-index: 50;
  overflow-y: auto;
  padding: 2rem;
}

.profile-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease-out;
}

.profile-content {
  margin-top: 2rem;
}

.profile-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(135deg, #3fb950 0%, #2ea043 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.profile-section {
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.profile-section h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.profile-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-form .form-row--player {
  grid-template-columns: 1fr 1fr 150px;
}

.profile-form .form-group--gender select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #30363d;
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.95rem;
  cursor: pointer;
}

.profile-form .form-group--gender select:focus {
  outline: none;
  border-color: var(--primary-color);
}

@media (max-width: 900px) {
  .profile-form .form-row--player {
    grid-template-columns: 1fr;
  }
}

.profile-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.save-profile-btn {
  background: linear-gradient(135deg, #3fb950 0%, #2ea043 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 1rem;
  font-family: var(--font-main);
}

.save-profile-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(63, 185, 80, 0.4);
}

.profile-status {
  min-height: 30px;
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.add-tournament-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  font-family: var(--font-main);
}

.add-tournament-btn:hover {
  background: #79c0ff;
  transform: translateY(-1px);
}

.tournament-history-table {
  overflow-x: auto;
}

#history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

#history-table th {
  background: rgba(13, 17, 23, 0.8);
  color: var(--primary-color);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid rgba(240, 246, 252, 0.1);
}

#history-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(240, 246, 252, 0.05);
}

#history-table tbody tr:hover {
  background: rgba(88, 166, 255, 0.05);
}

.history-actions {
  display: flex;
  gap: 0.5rem;
}

.edit-btn,
.delete-btn {
  padding: 0.25rem 0.75rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: var(--font-main);
}

.edit-btn {
  background: var(--primary-color);
  color: white;
}

.edit-btn:hover {
  background: #79c0ff;
}

.delete-btn {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.delete-btn:hover {
  background: rgba(255, 107, 107, 0.3);
}

.empty-history {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--secondary-color);
  font-style: italic;
}

/* ============================================
   TOURNAMENT TRACKING STYLES
   ============================================ */

.tracking-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-color);
  z-index: 100;
  padding: 2rem;
}

.tracking-container {
  max-width: 1000px;
  margin: 0 auto;
}

.tracking-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tracking-section {
  background: var(--card-bg);
  border: var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.tracking-section h3 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

/* Form Styles */
.tracking-form .form-group {
  margin-bottom: 1.5rem;
}

.tracking-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-weight: 600;
}

.tracking-form input[type="url"],
.tracking-form input[type="text"],
.tracking-form input[type="number"],
.tracking-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 8px;
  color: var(--text-color);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.tracking-form input:focus,
.tracking-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.tracking-form small {
  display: block;
  margin-top: 0.25rem;
  color: var(--secondary-color);
  font-size: 0.85rem;
}

/* Tournament Header */
.tournament-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tournament-header h3 {
  margin: 0;
  font-size: 1.8rem;
}

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  animation: pulse 2s infinite;
}

.status-badge.status-monitoring {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid #ffc107;
}

.status-badge.status-playing {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid #4caf50;
}

.status-badge.status-resting {
  background: rgba(158, 158, 158, 0.2);
  color: #9e9e9e;
  border: 1px solid #9e9e9e;
}

/* Current Pairing Card */
.current-pairing-card {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(139, 92, 246, 0.1));
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.current-pairing-card h4 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.pairing-info p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.pairing-info strong {
  color: var(--secondary-color);
  display: inline-block;
  min-width: 120px;
}

.pairing-info span {
  color: var(--text-color);
  font-weight: 600;
}

/* Game Controls */
.game-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.control-btn {
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
  position: relative;
  overflow: hidden;
}

.control-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.control-btn:hover::before {
  width: 300px;
  height: 300px;
}

.control-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.3);
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-start {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
}

.btn-finish {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: white;
}

.btn-rest {
  background: linear-gradient(135deg, #9e9e9e, #616161);
  color: white;
}

.btn-resume {
  background: linear-gradient(135deg, #2196f3, #1565c0);
  color: white;
}

.btn-finalize {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
}

/* Polling Status */
.polling-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(13, 17, 23, 0.6);
  border-radius: 8px;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

#polling-indicator {
  font-size: 1.2rem;
  animation: blink 1.5s infinite;
}

#polling-indicator.active {
  color: #4caf50;
}

#polling-indicator.inactive {
  color: #f44336;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

#polling-text {
  color: var(--secondary-color);
}

#last-update {
  margin-left: auto;
  color: var(--secondary-color);
  font-size: 0.85rem;
}

/* Rounds History */
.rounds-history {
  margin-top: 2rem;
}

.rounds-history h4 {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.3rem;
}

.table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: var(--glass-border);
}

#rounds-history-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(13, 17, 23, 0.6);
}

#rounds-history-table thead {
  background: rgba(88, 166, 255, 0.1);
}

#rounds-history-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

#rounds-history-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(139, 148, 158, 0.2);
}

#rounds-history-table tbody tr:hover {
  background: rgba(88, 166, 255, 0.05);
}

#rounds-history-table .empty-message {
  text-align: center;
  color: var(--secondary-color);
  font-style: italic;
  padding: 2rem;
}

/* Button Styles */
.btn-primary {
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, var(--primary-color), #1f6feb);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

.btn-secondary {
  padding: 0.875rem 2rem;
  background: rgba(139, 148, 158, 0.2);
  color: var(--text-color);
  border: 1px solid var(--secondary-color);
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
}

.btn-secondary:hover {
  background: rgba(139, 148, 158, 0.3);
  transform: translateY(-2px);
}

.btn-danger {
  padding: 0.875rem 2rem;
  background: rgba(244, 67, 54, 0.2);
  color: #ff6b6b;
  border: 1px solid #f44336;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
}

.btn-danger:hover {
  background: rgba(244, 67, 54, 0.3);
  transform: translateY(-2px);
}

/* Status Messages */
.status-message {
  margin-top: 1rem;
  padding: 0.875rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.status-message.success {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid #4caf50;
}

.status-message.error {
  background: rgba(244, 67, 54, 0.2);
  color: #ff6b6b;
  border: 1px solid #f44336;
}

.status-message.info {
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
  border: 1px solid #2196f3;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--card-bg);
  border: var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.modal-close {
  background: none;
  border: none;
  color: var(--secondary-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-actions button {
  flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tracking-view {
    padding: 1rem;
  }

  .tracking-title {
    font-size: 2rem;
  }

  .tracking-section {
    padding: 1.5rem;
  }

  .game-controls {
    grid-template-columns: 1fr;
  }

  .tournament-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .control-btn {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }

  #rounds-history-table {
    font-size: 0.9rem;
  }

  #rounds-history-table th,
  #rounds-history-table td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .tracking-title {
    font-size: 1.75rem;
  }

  .tracking-section {
    padding: 1rem;
  }

  #rounds-history-table {
    font-size: 0.85rem;
  }

  #rounds-history-table th,
  #rounds-history-table td {
    padding: 0.5rem;
  }
}
/* --- NEW PROFILE & TROPHY STYLES --- */

.small-action-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.small-action-btn--refresh {
  background: var(--card-bg);
  border: 1px solid #30363d;
  color: #8b949e;
}

.small-action-btn--refresh:hover {
  background: rgba(88, 166, 255, 0.08);
  border-color: #58a6ff;
  color: #58a6ff;
  transform: none;
}

.small-action-btn--refresh:active .small-action-btn__icon {
  animation: refresh-spin 0.45s ease;
}

.small-action-btn__icon {
  width: 18px;
  height: 18px;
  display: block;
}

@keyframes refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.small-action-btn:hover {
  background: #79c0ff;
  transform: scale(1.05);
}

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.trophy-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  position: relative;
  transition: all 0.3s;
  overflow: hidden;
}

.trophy-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 10px 25px rgba(255, 215, 0, 0.15);
}

.trophy-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.trophy-title {
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 0.25rem;
  display: block;
}

.trophy-tournament {
  font-size: 0.85rem;
  color: var(--secondary-color);
  display: block;
}

.trophy-date {
  font-size: 0.75rem;
  color: var(--secondary-color);
  opacity: 0.8;
  margin-top: 0.5rem;
  display: block;
}

.delete-trophy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.trophy-card:hover .delete-trophy-btn {
  opacity: 1;
}

/* Form Row Adjustments */
.form-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.form-row .form-group {
  flex: 1;
}

@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* --- EXTERNAL RESOURCE LINKS --- */
.ext-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cb-link {
  background: #333;
  color: #fff;
}

.cb-link:hover {
  background: #444;
  border-color: #58a6ff;
}

.fide-link {
  background: #1a237e;
  color: white;
}

.fide-link:hover {
  background: #283593;
  border-color: #ffd700;
}

.info-link {
  background: #2e7d32;
  color: white;
}

.info-link:hover {
  background: #388e3c;
  border-color: #81c784;
}
/* Loader Animation */
.loader {
  width: 48px;
  height: 48px;
  border: 5px solid #FFF;
  border-bottom-color: var(--primary-color);
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  margin: 0 auto;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ============================================
   CALENDAR VIEW STYLES
   ============================================ */

.calendar-view-container {
  width: 100%;
  animation: fadeIn var(--transition-medium);
}

.calendar-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: var(--glass-border);
}

.calendar-title-text {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--glow-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.calendar-nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-main);
}

.calendar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.calendar-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  text-align: center;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--secondary-color);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  min-height: 550px;
}

.calendar-day-cell {
  background: rgba(22, 27, 34, 0.4);
  backdrop-filter: blur(5px);
  border: var(--glass-border);
  border-radius: 12px;
  padding: 10px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.calendar-day-cell:hover {
  background: rgba(22, 27, 34, 0.6);
  border-color: rgba(88, 166, 255, 0.3);
}

.calendar-day-cell.today {
  border-color: var(--primary-color);
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.15);
  background: rgba(88, 166, 255, 0.03);
}

.calendar-day-cell.today .day-number-label {
  color: var(--primary-color);
  font-weight: 700;
}

.calendar-day-cell.other-month {
  opacity: 0.35;
  background: rgba(22, 27, 34, 0.1);
}

.day-number-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--secondary-color);
  align-self: flex-end;
}

.calendar-events-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.calendar-events-container::-webkit-scrollbar {
  display: none;
}

.calendar-event-item {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 4px;
}

.calendar-event-item:hover {
  transform: scale(1.02);
  filter: brightness(1.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.view-toggle-container button {
  font-family: var(--font-main);
  outline: none;
}

.view-toggle-container button.active {
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.3);
}

/* ============================================
   SCOUTING VIEW STYLES
   ============================================ */

.scouting-view {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background: radial-gradient(circle at top left, #1f1f2e 0%, #0d1117 40%);
  z-index: 50;
  display: block;
  overflow-y: auto;
  padding: 2rem;
}

.scouting-container {
  width: 100%;
  max-width: 900px;
  background: rgba(22, 27, 34, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(240, 246, 252, 0.15);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  position: relative;
  margin: 2rem auto;
  animation: fadeIn 0.5s ease-out;
}

.scouting-title {
  font-size: 2.5rem;
  text-align: center;
  background: linear-gradient(135deg, #388bfd 0%, #7928ca 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.scouting-subtitle {
  text-align: center;
  color: var(--secondary-color);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* Loading Steps & Spinner */
.scout-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 0;
  gap: 2rem;
}

.scout-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(88, 166, 255, 0.1);
  border-top: 4px solid #388bfd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

#scout-loading-text {
  font-size: 1.2rem;
  color: white;
  font-weight: 500;
  animation: pulse 1.5s infinite ease-in-out;
}

.scout-steps {
  list-style: none;
  padding: 0;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.scout-steps li {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.scout-steps li.pending {
  background: rgba(255, 255, 255, 0.03);
  color: #8b949e;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.scout-steps li.active {
  background: rgba(56, 139, 253, 0.1);
  color: #58a6ff;
  border: 1px solid rgba(56, 139, 253, 0.3);
  font-weight: 600;
  box-shadow: 0 0 15px rgba(56, 139, 253, 0.1);
}

.scout-steps li.completed {
  background: rgba(46, 160, 67, 0.1);
  color: #56d364;
  border: 1px solid rgba(46, 160, 67, 0.3);
}

/* Metadata Grid */
.scout-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.scout-meta-card {
  background: rgba(22, 27, 34, 0.7);
  border: 1px solid rgba(48, 54, 61, 0.8);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scout-meta-card h3 {
  font-size: 0.9rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.scout-meta-card .meta-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  margin: 0;
}

.ids-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #8b949e;
  margin-top: auto;
}

.elo-display {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 5px;
}

.elo-badge {
  padding: 6px 8px;
  border-radius: 6px;
  font-weight: 700;
  text-align: center;
  font-size: 0.9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.elo-badge.fide {
  background: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(56, 139, 253, 0.3);
}

.elo-badge.fada {
  background: rgba(240, 136, 62, 0.15);
  color: #f0883e;
  border: 1px solid rgba(240, 136, 62, 0.3);
}

/* External Search Links */
.external-search-links {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-link-btn {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s, transform 0.1s;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.search-link-btn:hover {
  transform: translateY(-1px);
}

.search-link-btn.chesscom-btn {
  background: #312e2b;
  color: #fff;
}

.search-link-btn.chesscom-btn:hover {
  background: #45413c;
}

.search-link-btn.chessbase-btn {
  background: #003366;
  color: #fff;
}

.search-link-btn.chessbase-btn:hover {
  background: #004d99;
}

/* Badges Row */
.scout-badges-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.scout-badge-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.badge-label {
  font-size: 0.78rem;
  color: #8b949e;
}

.badge-val {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: capitalize;
}

.badge-val.style {
  color: #bc8cff;
  background: rgba(188, 140, 255, 0.15);
}

.badge-val.experience {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.15);
}

.badge-val.activity {
  color: #58a6ff;
  background: rgba(88, 166, 255, 0.15);
}

.badge-val.color-bias {
  color: #ff7b72;
  background: rgba(255, 123, 114, 0.15);
}

/* Stats Row */
.scout-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.scout-stat-box {
  background: rgba(22, 27, 34, 0.4);
  border: 1px solid rgba(48, 54, 61, 0.5);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
}

.stat-lbl {
  font-size: 0.8rem;
  color: #8b949e;
  text-align: center;
}

/* Markdown Report Section */
.scout-report-section {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid rgba(48, 54, 61, 0.8);
  border-radius: 16px;
  padding: 2.2rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.section-title {
  font-size: 1.4rem;
  color: white;
  border-bottom: 1px solid #30363d;
  padding-bottom: 0.75rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.markdown-body {
  color: #c9d1d9;
  font-size: 1rem;
  line-height: 1.7;
}

.markdown-body h2 {
  font-size: 1.3rem;
  color: white;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
  padding-bottom: 4px;
}

.markdown-body h3 {
  font-size: 1.1rem;
  color: #58a6ff;
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
}

.markdown-body p {
  margin-bottom: 1rem;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 20px;
  margin-bottom: 1rem;
}

.markdown-body li {
  margin-bottom: 0.4rem;
}

.markdown-body strong {
  color: white;
}

.markdown-body blockquote {
  border-left: 4px solid #58a6ff;
  background: rgba(56, 139, 253, 0.05);
  padding: 8px 16px;
  margin: 1rem 0;
  border-radius: 0 6px 6px 0;
  color: #8b949e;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Responsiveness overrides for scouting view */
@media (max-width: 768px) {
  .scouting-container {
    padding: 1.5rem;
    margin: 1rem auto;
  }
  .scouting-title {
    font-size: 1.8rem;
  }
  .scout-meta-grid {
    grid-template-columns: 1fr;
  }
  .scout-stats-grid {
    grid-template-columns: 1fr;
  }
}

.ai-prizes-results {
  background: rgba(22, 27, 34, 0.95);
  border: 2px solid #30363d;
  border-radius: 8px;
  padding: 14px;
  font-size: 0.95rem;
  margin-top: 0;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  overflow: visible;
  max-height: none;
  width: 100%;
}

.ai-prizes-placeholder {
  color: #8b949e;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  text-align: center;
  padding: 8px 4px;
}

.ai-prizes-placeholder strong {
  color: #c9d1d9;
}

.tournament-prizes-config-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.tournament-prizes-config-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(48, 54, 61, 0.6);
}

.tournament-prizes-config-label {
  color: #c9d1d9;
  font-weight: 500;
  flex-shrink: 0;
}

.tournament-prizes-config-value {
  color: #8b949e;
  text-align: right;
  line-height: 1.4;
}

.ai-prizes-section-title--classification {
  margin-top: 8px;
}

.tournament-classification-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  max-height: none;
  overflow: visible;
}

.tournament-classification-row {
  display: grid;
  grid-template-columns: 36px 1fr 48px minmax(80px, 1.2fr);
  gap: 8px;
  align-items: start;
  padding: 7px 4px;
  border-bottom: 1px dashed rgba(48, 54, 61, 0.5);
  font-size: 0.85em;
}

.tournament-classification-row--fernando {
  background: rgba(88, 166, 255, 0.08);
  border-radius: 4px;
}

.tournament-classification-row--pedro {
  background: rgba(255, 123, 114, 0.08);
  border-radius: 4px;
}

.tournament-classification-rank {
  color: #8b949e;
  font-weight: 600;
}

.tournament-classification-name {
  color: white;
  font-weight: 500;
  line-height: 1.3;
}

.tournament-classification-elo {
  color: #8b949e;
  text-align: right;
}

.tournament-classification-prize {
  color: #8b949e;
  text-align: right;
  line-height: 1.3;
}

.tournament-classification-prize--won {
  color: var(--primary-color);
  font-weight: 600;
}

.ai-prizes-preview-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(48, 54, 61, 0.5);
}

.ai-prizes-section-title {
  font-weight: 700;
  color: white;
  font-size: 1.05rem;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.ai-prizes-section-title--awarded {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 1.15rem;
}

.ai-prizes-clear-btn {
  font-size: 0.85rem;
  color: #f85149;
  font-weight: normal;
  cursor: pointer;
}

.ai-prizes-config-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.ai-prizes-config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(48, 54, 61, 0.6);
  gap: 12px;
}

.ai-prizes-config-label {
  color: #c9d1d9;
  font-weight: 500;
  flex-shrink: 0;
}

.ai-prizes-config-value {
  color: #8b949e;
  text-align: right;
}

.ai-prizes-awarded-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ai-prizes-awarded-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #30363d;
  gap: 12px;
}

.ai-prizes-awarded-prize {
  color: #c9d1d9;
  font-weight: 500;
}

.ai-prizes-awarded-winner {
  font-weight: 600;
  color: var(--primary-color);
  text-align: right;
}

.info-item--prizes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.info-item-label {
  font-size: 0.8em;
  color: #8b949e;
  font-weight: 600;
}

.tournament-prizes-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: visible;
  max-height: none;
}

.tournament-prizes-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(48, 54, 61, 0.6);
}

.tournament-prizes-label {
  color: white;
  font-weight: 500;
  flex-shrink: 0;
}

.tournament-prizes-value {
  color: #8b949e;
  text-align: right;
  line-height: 1.4;
}

.tournament-prizes-raw {
  white-space: pre-line;
  color: #8b949e;
  font-size: 0.95em;
  line-height: 1.5;
  overflow: visible;
  max-height: none;
}

.ai-prize-badge {
  font-weight: bold;
  margin-left: 6px;
  cursor: help;
}

.ai-prizes-objectives {
  margin-top: 12px;
  border-top: 1px solid #30363d;
  padding-top: 10px;
}

.ai-prizes-objective-card {
  background: rgba(56, 139, 253, 0.05);
  border: 1px solid rgba(56, 139, 253, 0.15);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
}

.ai-prizes-objective-name {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.95em;
  margin-bottom: 6px;
}

.ai-prizes-objective-row {
  font-size: 0.85em;
  line-height: 1.4;
  margin-bottom: 4px;
}

.ai-prizes-objective-label {
  color: #8b949e;
}

.ai-prizes-objective-value {
  color: white;
}

.ai-prizes-objective-target {
  color: #ffc107;
  font-weight: 600;
}

.ai-prizes-objective-reason {
  color: #8b949e;
  font-size: 0.85em;
  margin: 4px 0 0;
  line-height: 1.4;
}

.detail-section--update-tournament {
  border-top: 1px solid #30363d;
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.btn-update-tournament {
  width: 100%;
  background: #1f6feb;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-update-tournament:hover {
  background: #388bfd;
}

.update-tournament-modal-content {
  max-width: 560px;
}

.update-tournament-modal-desc {
  font-size: 0.85rem;
  color: #8b949e;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.update-tournament-textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #30363d;
  background: #0d1117;
  color: white;
  font-size: 0.9em;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 0.8rem;
  outline: none;
}

.btn-update-tournament-submit {
  width: 100%;
  background: #1f6feb;
  border: none;
  padding: 10px 12px;
  border-radius: 6px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-update-tournament-submit:hover:not(:disabled) {
  background: #388bfd;
}

.btn-update-tournament-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 1024px) {
  .detail-info-grid {
    display: flex !important;
    flex-direction: column;
  }

  .tournament-classification-row {
    grid-template-columns: 32px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 8px;
  }

  .tournament-classification-rank {
    grid-row: 1 / 3;
    align-self: center;
  }

  .tournament-classification-elo {
    grid-column: 2;
    text-align: left;
    font-size: 0.8em;
  }

  .tournament-classification-prize {
    grid-column: 2;
    text-align: left;
    font-size: 0.8em;
  }

  .detail-section--update-tournament {
    margin-top: 0;
    padding-top: 0.75rem;
  }
}

/* ============================================
   MIS TORNEOS - HISTORY & STATS DASHBOARD
   ============================================ */

.my-tournaments-container {
  display: flex;
  flex-direction: column;
  height: auto;
}

.player-tournaments-col {
  background: rgba(22, 27, 34, 0.5);
  border: 1px solid rgba(240, 246, 252, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  height: auto;
}

.player-tournaments-list {
  padding-right: 4px;
}

/* Stats dashboard */
.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.stat-card {
  background: rgba(22, 27, 34, 0.8);
  border: 1px solid rgba(240, 246, 252, 0.08);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stat-label {
  font-size: 0.75em;
  color: #c9d1d9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.15em;
  font-weight: 600;
  color: #ffffff;
}

/* Tournament cards */
.my-tournament-card {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid rgba(240, 246, 252, 0.08);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  color: #ffffff;
}

.my-tournament-card:hover {
  transform: translateY(-2px);
  border-color: rgba(88, 166, 255, 0.4);
}

.my-tournament-header {
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
}

.my-tournament-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.my-tournament-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  flex: 1;
}

.my-tournament-header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  border-top: 1px solid rgba(240, 246, 252, 0.05);
  padding-top: 8px;
}

.my-tournament-details {
  display: flex;
  gap: 12px;
  font-size: 0.8em;
  color: #c9d1d9;
}

.my-tournament-details span {
  white-space: nowrap;
}

.my-tournament-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Badges */
.my-tournament-badges span {
  font-size: 0.75em;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.rank-badge {
  background: rgba(240, 246, 252, 0.05);
  color: var(--text-color);
  border: 1px solid rgba(240, 246, 252, 0.1);
}

.points-badge {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.25);
}

.rp-badge {
  background: rgba(188, 140, 255, 0.15);
  color: #bc8cff;
  border: 1px solid rgba(188, 140, 255, 0.25);
}

.var-badge {
  background: rgba(240, 246, 252, 0.05);
  border: 1px solid rgba(240, 246, 252, 0.1);
}

.prize-badge {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
  animation: shine 2s infinite;
}

.var-pos {
  color: #3fb950 !important;
  border-color: rgba(63, 185, 80, 0.3) !important;
  background: rgba(63, 185, 80, 0.1) !important;
}

.var-neg {
  color: #ff7b72 !important;
  border-color: rgba(255, 123, 114, 0.3) !important;
  background: rgba(255, 123, 114, 0.1) !important;
}

.expand-icon {
  font-size: 0.8em;
  color: var(--secondary-color);
  transition: transform var(--transition-fast);
}

/* Collapsible body */
.my-tournament-body {
  border-top: 1px solid rgba(240, 246, 252, 0.05);
  background: rgba(13, 17, 23, 0.6);
  padding: 12px;
  overflow-x: auto;
  animation: slideDown var(--transition-fast) ease-out;
}

/* Games Table */
.my-tournament-games-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.85em;
  text-align: left;
}

.my-tournament-games-table th {
  color: #ffffff;
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(240, 246, 252, 0.1);
  font-size: 0.9em;
  text-transform: uppercase;
}

/* Specific column widths for alignment */
.my-tournament-games-table th:nth-child(1),
.my-tournament-games-table td:nth-child(1) {
  width: 35px; /* Rnd */
}
.my-tournament-games-table th:nth-child(2),
.my-tournament-games-table td:nth-child(2) {
  width: 45px; /* Mesa */
}
.my-tournament-games-table th:nth-child(3),
.my-tournament-games-table td:nth-child(3) {
  width: 75px; /* Color */
}
.my-tournament-games-table th:nth-child(4),
.my-tournament-games-table td:nth-child(4) {
  width: 180px; /* Opponent */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-tournament-games-table th:nth-child(5),
.my-tournament-games-table td:nth-child(5) {
  width: 55px; /* ELO */
}
.my-tournament-games-table th:nth-child(6),
.my-tournament-games-table td:nth-child(6) {
  width: 55px; /* Result */
  text-align: center;
}

.my-tournament-games-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(240, 246, 252, 0.03);
  vertical-align: middle;
  color: #ffffff;
}

.my-tournament-games-table tr:last-child td {
  border-bottom: none;
}

.my-tournament-games-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.opponent-name-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Color indicators */
.color-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
}

.color-white {
  background: #f0f6fc;
  color: #0d1117;
}

.color-black {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
}

/* Result Badges */
.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: bold;
}

.res-win {
  background: #2ea043;
  color: white;
}

.res-loss {
  background: #da3633;
  color: white;
}

.res-draw {
  background: #30363d;
  color: #8b949e;
}

/* Animations */
@keyframes shine {
  0% { opacity: 0.85; }
  50% { opacity: 1; box-shadow: 0 0 8px rgba(255, 215, 0, 0.3); }
  100% { opacity: 0.85; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom scrollbar for opponent-view (including my-tournaments-view) */
.opponent-view::-webkit-scrollbar {
  width: 10px;
}
.opponent-view::-webkit-scrollbar-track {
  background: rgba(13, 17, 23, 0.4);
}
.opponent-view::-webkit-scrollbar-thumb {
  background: rgba(240, 246, 252, 0.15);
  border-radius: 5px;
  border: 2px solid rgba(13, 17, 23, 0.4);
}
.opponent-view::-webkit-scrollbar-thumb:hover {
  background: rgba(240, 246, 252, 0.3);
}

/* My Tournaments Grid Layout */
.my-tournaments-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 1rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .my-tournaments-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .player-tournaments-col {
    max-height: none;
  }
}

/* Neutral Variation Class */
.var-neutral {
  color: #8b949e !important;
  border-color: rgba(139, 148, 158, 0.25) !important;
  background: rgba(139, 148, 158, 0.1) !important;
}

/* Federative profile card styling */
.federative-profile-card {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid rgba(240, 246, 252, 0.08);
  border-radius: 10px;
  padding: 16px;
  color: #ffffff;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.federative-profile-card:hover {
  border-color: rgba(88, 166, 255, 0.4);
}
.federative-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(240, 246, 252, 0.08);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.fed-title-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fed-title {
  font-size: 1.1em;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}
.fed-club {
  font-size: 0.85em;
  color: var(--secondary-color);
}
.federative-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fed-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fed-sec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(240, 246, 252, 0.05);
  padding-bottom: 4px;
}
.fed-sec-title {
  font-size: 0.9em;
  font-weight: 600;
  color: #58a6ff;
}
.fed-link {
  font-size: 0.8em;
  color: #58a6ff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fed-link:hover {
  text-decoration: underline;
}
.fed-ratings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fed-rating-item {
  background: rgba(240, 246, 252, 0.03);
  border: 1px solid rgba(240, 246, 252, 0.06);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fed-rating-label {
  font-size: 0.75em;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fed-rating-value {
  font-size: 1.05em;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.fed-torneos-link {
  font-size: 0.85em;
  color: #58a6ff;
  text-decoration: none;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  text-align: center;
  font-weight: 500;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.fed-torneos-link:hover {
  background: rgba(88, 166, 255, 0.2);
  border-color: rgba(88, 166, 255, 0.4);
}
.fed-no-link {
  font-size: 0.8em;
  color: var(--secondary-color);
  font-style: italic;
}

/* --- LIVE TRACKING VIEW PREMIUM STYLES --- */
.pulse-dot {
  color: #3fb950;
  display: inline-block;
  animation: pulse-dot-key 2s infinite ease-in-out;
}

@keyframes pulse-dot-key {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

.live-player-card {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.9) 0%, rgba(31, 111, 235, 0.03) 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.live-player-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.3);
  border-color: #58a6ff !important;
}

.scouting-ai-box::-webkit-scrollbar {
  width: 4px;
}
.scouting-ai-box::-webkit-scrollbar-thumb {
  background: rgba(88, 166, 255, 0.3);
  border-radius: 2px;
}

/* ==========================================
   CSS Spinner & Loading Feedback
   ========================================== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--secondary-color);
  font-size: 1.1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================
   Responsive Adaptations & Fixes
   ========================================== */

/* Ajustes para Tablets y Móviles grandes (< 900px) */
@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: 1fr !important; /* Stack columns vertically */
    overflow-y: auto !important;           /* Allow scroll on the parent container */
  }

  .detail-left {
    border-right: none !important;
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
    overflow-y: visible !important;        /* Let it flow naturally */
    padding: 1.5rem !important;
  }

  .detail-right {
    overflow: visible !important;
    padding: 1.5rem !important;
    min-height: 350px;                     /* Ensure the poster area has space */
  }

  .detail-poster {
    justify-content: center;
    align-items: center;
  }

  .detail-poster img {
    max-height: 60vh;                      /* Limit size to avoid excessive scrolling */
    margin: 0 auto;
  }
}

/* Ajustes para Móviles Medios y Pequeños (< 768px) */
@media (max-width: 768px) {
  #app {
    padding: 1rem;                         /* Reduce side margin on mobile */
  }

  .hero-title {
    font-size: 2.5rem !important;          /* Scale down big hero titles */
  }

  .hero-subtitle {
    font-size: 1.1rem !important;
    margin-bottom: 2rem;
  }

  .cta-button {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
  }

  .detail-info-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; /* Avoid squishing details */
    gap: 1rem;
  }
}

/* Ajustes para Pantallas Muy Pequeñas (< 480px) */
@media (max-width: 480px) {
  .external-links {
    flex-direction: column !important;     /* Stack registration buttons vertically */
    gap: 0.75rem !important;
  }

  .link-btn {
    width: 100%;
  }

  .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  #btn-back-home {
    padding: 0.5rem 0;
  }
}

