/* ================================
   PAGE — NEXT MATCH BLOCK (Homepage)
================================ */
body {
  overflow-x: hidden;
}

.next-match {
  background: #f5f5f5;
  padding: 30px 20px;
  margin: 0 auto 40px;
  border-radius: 12px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.match-header span {
  font-weight: 700;
  font-size: 18px;
}

.team-badge {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 0 6px rgba(0,0,0,0.15);
}

.match-info h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

.match-info p {
  margin-bottom: 4px;
  color: #444;
}

/* ================================
   PAGE — PLAYER PROFILE
================================ */
.player-profile {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

.profile-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 15px;
  font-size: 1rem;
}

/* ================================
   PAGE — NEWS GRID
================================ */
#newsGrid {
  padding: 20px;
  display: grid;
  gap: 20px;
}

.news-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
}

.news-item img {
  width: 100%;
  border-radius: 12px 12px 0 0;
}

.news-item-content {
  padding: 14px;
}

.news-item-content h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.news-item-content p {
  color: #555;
}

.page-btn {
  padding: 8px 14px;
  margin: 4px;
  border: none;
  background: #ddd;
  border-radius: 6px;
  cursor: pointer;
}

.page-btn.active {
  background: #b30000;
  color: #fff;
}

/* ================================
   PAGE — ARTICLE PAGE
================================ */
.article-header {
  padding: 20px;
  text-align: center;
}

.article-header h1 {
  font-size: 26px;
  margin-bottom: 10px;
}

.article-meta {
  color: #666;
  margin-bottom: 20px;
}

#articleImage {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 20px;
}

#articleContent {
  padding: 20px;
  color: #333;
}

/* ================================
   PAGE — HISTORY PAGE
================================ */
.history-content {
  padding: 40px 20px;
}

.history-inner {
  max-width: 900px;
  margin: 0 auto;
}

.history-content h2 {
  margin-top: 50px;
  margin-bottom: 15px;
  font-size: 1.8rem;
  font-weight: 700;
}

.timeline-block {
  margin: 25px 0;
  padding-left: 20px;
  border-left: 3px solid #b30000;
}

.timeline-year {
  font-weight: 700;
  color: #b30000;
  display: block;
  margin-bottom: 5px;
}

.history-divider {
  text-align: center;
  margin: 40px 0;
}

.history-divider img {
  width: 80px;
  opacity: 0.8;
}

/* ============================================
   MINI TABLE (compact)
================================ */
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.mini-table th {
  background: #b30000;
  color: #fff;
  padding: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.mini-table td {
  padding: 8px;
  border-bottom: 1px solid #ddd;
  word-break: break-word;
}

.league-scroll.mini {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  margin-bottom: 15px;
}

/* ============================================
   DESKTOP — ALIGN MINI TABLE COLUMNS (FIX)
================================ */
@media (min-width: 601px) {

  .mini-table {
    table-layout: fixed;
  }

  .mini-table th:nth-child(1),
  .mini-table td:nth-child(1) {
    width: 60px;
    text-align: center;
  }

  .mini-table th:nth-child(2),
  .mini-table td:nth-child(2) {
    width: 220px;
  }

  .mini-table th:nth-child(3),
  .mini-table td:nth-child(3),
  .mini-table th:nth-child(4),
  .mini-table td:nth-child(4),
  .mini-table th:nth-child(5),
  .mini-table td:nth-child(5),
  .mini-table th:nth-child(6),
  .mini-table td:nth-child(6),
  .mini-table th:nth-child(7),
  .mini-table td:nth-child(7),
  .mini-table th:nth-child(8),
  .mini-table td:nth-child(8) {
    width: 70px;
    text-align: center;
  }
}

/* ============================================
   FULL TABLE OVERLAY (fixed)
================================ */
.league-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9999;
}

.league-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.league-panel {
  background: #fff;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
}

.league-overlay.active .league-panel {
  transform: translateY(0);
}

.close-league-panel {
  background: none;
  border: none;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  float: right;
  margin-top: -10px;
  margin-right: -5px;
}

/* FULL TABLE SCROLL WRAPPER */
.league-scroll.full {
  overflow-x: auto;
  padding-bottom: 10px;
}

/* FULL TABLE INSIDE OVERLAY */
.overlay-table {
  width: 100%;
  table-layout: fixed !important;
  border-collapse: collapse;
  margin-top: 20px;
}

.overlay-table th,
.overlay-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  word-break: break-word !important;
  white-space: normal !important;
}

/* Highlight Shortwood */
.highlight-shortwood {
  background: #ffeaea !important;
  font-weight: bold;
}

/* ============================================
   PREMIUM FULL TABLE (page)
================================ */
.league-table {
  margin-bottom: 50px;
}

.league-table h2 {
  margin-bottom: 15px;
  font-size: 22px;
  font-weight: 700;
  color: #b30000;
}

.league-compact {
  display: flex;
  justify-content: space-between;
  background: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  margin-bottom: 15px;
  font-size: 15px;
}

.league-full-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-size: 15px;
}

/* ============================================
   DESKTOP — ALIGN HEADER WITH FLOATING ROWS
================================ */
@media (min-width: 601px) {

  .league-full-table thead {
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .league-full-table thead th {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .league-full-table {
    table-layout: fixed;
  }
}

.league-full-table thead th {
  background: #b30000;
  color: #fff;
  padding: 12px 14px;
  font-weight: 700;
  text-align: left;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
}

.league-full-table tbody tr {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.league-full-table tbody tr:hover {
  background: #f7f7f7;
  transform: translateY(-2px);
}

.league-full-table td {
  padding: 12px 14px;
  vertical-align: middle;
  white-space: nowrap;
}

.league-full-table tbody tr td:first-child {
  border-radius: 8px 0 0 8px;
}

.league-full-table tbody tr td:last-child {
  border-radius: 0 8px 8px 0;
}

.league-full-table .pos {
  font-weight: 700;
  width: 40px;
  text-align: center;
}

.league-full-table .team {
  font-weight: 600;
}

.league-full-table .pts {
  font-weight: 700;
  color: #b30000;
}

/* ============================================
   BUTTONS
================================ */
.open-full-table-btn {
  width: 100%;
  padding: 10px 0;
  background: #b30000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
}

.open-full-table-btn:hover {
  background: #8a0000;
}

/* ============================================
   MOBILE FIXES — FULL TABLE OVERLAY
================================ */
@media (max-width: 600px) {

  .league-overlay .league-panel {
    padding: 12px;
  }

  .league-full-table {
    font-size: 13px;
    min-width: 600px;
  }

  .league-full-table th,
  .league-full-table td {
    padding: 6px 4px;
    white-space: nowrap;
  }

  .league-full-table th:nth-child(1),
  .league-full-table td:nth-child(1) { width: 40px; text-align: center; }

  .league-full-table th:nth-child(2),
  .league-full-table td:nth-child(2) { width: 160px; }

  .league-full-table th:nth-child(3),
  .league-full-table td:nth-child(3),
  .league-full-table th:nth-child(4),
  .league-full-table td:nth-child(4),
  .league-full-table th:nth-child(5),
  .league-full-table td:nth-child(5),
  .league-full-table th:nth-child(6),
  .league-full-table td:nth-child(6),
  .league-full-table th:nth-child(7),
  .league-full-table td:nth-child(7),
  .league-full-table th:nth-child(8),
  .league-full-table td:nth-child(8) {
    width: 50px;
    text-align: center;
  }

  .league-scroll.full {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================
   MOBILE FIXES — MINI TABLE
================================ */
@media (max-width: 600px) {

  .league-scroll.mini {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mini-table {
    min-width: 600px;
    font-size: 13px;
  }

  .mini-table th,
  .mini-table td {
    white-space: nowrap;
    padding: 6px 4px;
  }

  .mini-table th:nth-child(1),
  .mini-table td:nth-child(1) { width: 40px; text-align: center; }

  .mini-table th:nth-child(2),
  .mini-table td:nth-child(2) { width: 160px; }

  .mini-table th:nth-child(3),
  .mini-table td:nth-child(3),
  .mini-table th:nth-child(4),
  .mini-table td:nth-child(4),
  .mini-table th:nth-child(5),
  .mini-table td:nth-child(5),
  .mini-table th:nth-child(6),
  .mini-table td:nth-child(6),
  .mini-table th:nth-child(7),
  .mini-table td:nth-child(7),
  .mini-table th:nth-child(8),
  .mini-table td:nth-child(8) {
    width: 50px;
    text-align: center;
  }
}
