*{box-sizing:border-box}
body{font-family:Arial,Helvetica,sans-serif;background:#f3f4f6;margin:0;color:#111827}
a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}
.container{max-width:1100px;margin:24px auto;padding:0 16px}.card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 2px 6px rgba(0,0,0,.04)}
.center{display:flex;justify-content:center;align-items:center}.auth-wrap{min-height:80vh}.auth-card{width:360px; padding:24px}.auth-card h2{margin:0 0 12px 0}
.input{width:100%;padding:10px 12px;border:1px solid #d1d5db;border-radius:8px;margin:8px 0}.btn{background:#2563eb;color:#fff;border:none;border-radius:8px;padding:10px 14px;cursor:pointer}
.btn:disabled{opacity:.5;cursor:not-allowed}.btn-secondary{background:#10b981}.btn-red{background:#ef4444}.btn-black{background:#000}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}@media (max-width:900px){.grid{grid-template-columns:repeat(2,1fr)}}@media (max-width:580px){.grid{grid-template-columns:1fr}}
.grid-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* allow shrinking */
  max-width: 100%;           /* no hard cap, fits screen */
  margin: 0 auto;
  margin-bottom: 30px;
  gap: 16px;
  justify-items: center;
}

.grid-home .card {
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.player-card{padding:16px;text-align:center}.player-pos{font-weight:700;margin-bottom:8px;color:#374151}.player-photo{width:110px;height:140px;object-fit:cover;border-radius:8px;border:1px solid #e5e7eb;background:#fff;margin:6px auto}
.meta{font-size:14px;color:#4b5563;margin-top:6px}.table{width:100%;border-collapse:collapse}.table th,.table td{padding:8px;border-bottom:1px solid #e5e7eb;text-align:left}.table th{background:#f9fafb}
.pagination{margin-top:10px}
.subtitle {
  font-size: 1em;
  margin-top: -5px;
  margin-bottom: -5px;
  color: #555;
  font-weight: 100;
  text-align: center;
}

.deadline {
  font-size: 1em;
  background: #991b1b;
  color: #fff;
  margin-top: 20px;
  margin-bottom: 20px;
  font-weight: 100;
  text-align: center;
}

.scale-wrap {
  margin: 16px 0;
}

.scale {
  position: relative;
  width: 100%;
  background: #e5e7eb;
  grid-template-columns: repeat(23, 1fr);
  border: 1px solid #ccc;
  display: grid;
  overflow: visible; /* allow marker to show */
}

.scale .seg {
  text-align: center;
  padding: 4px 0;
  border-right: 1px solid #ccc;
  align-items: center;
  justify-content: center;
  font-size: 0.4rem;
  color: #374151;
}
.scale .seg:last-child {
  border-right: none;
}

.scale .seg.yellow {
  background: #fde68a;
}
.scale .seg.green {
  background: #86efac;
}
.scale .seg.bust {
  background: #fca5a5;
  font-size: 0.25rem;
  font-weight: 700;
  color: #991b1b;
}
.scale .seg.bust.faded {
  background: #f3f4f6;
  color: #9ca3af;
  font-weight: 400;
}

.marker {
  position: absolute;
  top: 100%;      /* position directly below bar */
  margin-top: 0px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 12px solid red; /* red triangle */
  transform: translateX(-50%);
  z-index: 10;
}
.stats{font-size:13px;text-align:left;margin-top:6px}.stats details{background:#f9fafb;border:1px solid #e5e7eb;border-radius:8px;padding:8px}.stats summary{cursor:pointer;font-weight:600}
.stats ul{margin:6px 0 0 16px;padding:0}.stats li{margin:3px 0}.kit-img{width:56px;height:auto;display:block;margin:6px auto}
/* Welcome page buttons */
.welcome-links {
  display: flex;
  flex-wrap: wrap;         /* allow wrapping */
  justify-content: center; /* center items on each line */
  gap: 12px;               /* space between buttons */
  margin-top: 16px;
}

.welcome-links a {
  text-align: center;
  padding: 12px 20px;
  border-radius: 8px;
  white-space: nowrap;     /* keep label together */
}

/* Navigation bar */
.nav {
  background: #000;                  /* black background */
  border-bottom: 1px solid #111;     /* subtle darker divider */
}

.nav-logos {
  display: flex;
  gap: 4px;
}

.nav-logos img {
  height: 40px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  flex: 1;
}

.nav-links a {
  color: #fff;                       /* white text */
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.nav-links a:hover {
  background: #222;                  /* dark grey hover */
  color: #f3f4f6;                    /* light grey text on hover */
}

.nav-links a.active {
  background: #2563eb;   /* blue highlight */
  color: #fff;
}

.table-league {
  border-top: 3px solid #000;
  border-bottom: 3px solid #000;
  border-left: 3px solid #000;
  border-right: 3px solid #000;
}

.table-league td:first-child {
  text-align: center;
}

.table-league td:first-child .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  color: white;
  font-weight: bold;
}

/* League picks table (GW Lineup) */
.table.picks {
  font-size: 13px;
  border-collapse: collapse;
  margin-top: 12px;
  width: 100%;
  /*border-top: 3px solid #000;    /* solid top border */
  /*border-bottom: 3px solid #000; /* solid bottom border */
}

.table.picks td {
  padding: 6px 8px;
  /*border-bottom: 1px dashed #444; /* thicker + darker */
  text-align: left;
  vertical-align: middle;
}

/* vertical dividers 
.table.picks td.manager-cell,
.table.picks th:first-child {
  border-right: 1px solid #000;   /* solid black line after Manager 
}

.table.picks td.total-cell,
.table.picks th:last-child {
  border-left: 1px solid #000;   solid black line before Total
}*/

/* black background
.table.picks td.manager-cell {
  background: #000;    
  color: #fff;        
  text-transform: uppercase; 
  font-weight: bold;
  font-size: 0.6rem;
}*/

.table.picks td.total-cell {
  text-align: right;
  font-size: 1.2rem;  /* larger */
  font-weight: bold;
}

.table.picks th {
  background: #f9fafb;
  font-weight: 600;
  text-align: center;
}

.table.picks th:first-child {
  text-align: left; /* Manager */
}

.table.picks th:last-child {
  text-align: right; /* Total */
}

.table.picks img {
  width: 20px;
  height: 30px;
  vertical-align: middle;
  object-fit: cover;
  object-position: top;
  margin-right: 4px;
  border-radius: 4px;
}

/* alternating row shading */
.table.picks tbody tr:nth-child(odd) {
  background: #fefefe;  /* subtle white */
}

.table.picks tbody tr:nth-child(even) {
  background: #f3f4f6;  /* light gray */
}

.clear-btn {
  display: block;
  margin: 20px auto;     /* space above and below */
  padding: 10px 16px;
  background: #ef4444;   /* red */
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Chivo', sans-serif;
  font-size: 15px;
  cursor: pointer;
}
.clear-btn:hover {
  background: #dc2626;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 20px 0;   /* more vertical spacing */
  font-family: 'Chivo', sans-serif;
}

.filters label {
  font-weight: 600;
}

.filters select {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Chivo', sans-serif;  /* enforce Chivo font */
  background: #f9fafb;               /* subtle gray background */
  color: #111827;                    /* dark gray text */
  cursor: pointer;
  transition: background 0.2s ease;
}

.filters select:hover {
  background: #f3f4f6;               /* slightly darker on hover */
}

.gw-banner {
  display: inline-blocks;
  text-align: center;
  background: #dc2626;
  color: #fff;
  font-family: 'Chivo', sans-serif;
  font-weight: 700;
  font-size: 18px;
  padding: 6px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.rules-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
}

.rules-container h1 {
  text-align: center;
  font-size: 2.2em;
  margin-bottom: 10px;
  color: #d32f2f;
}

.rules-container .intro {
  text-align: center;
  font-size: 1.1em;
  margin-bottom: 30px;
  color: #555;
}

.rule-section {
  margin-bottom: 25px;
}

.rule-section h2 {
  margin-top: 0;
  color: #2563eb;
}

.rule-section.card {
  padding:30px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.rule-section p,
.rule-section ul,
.rule-section table {
  margin-top: 10px;
  margin-bottom: 10px;
}

.penalty-table, .lp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.penalty-table th, .penalty-table td,
.lp-table th, .lp-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
}

.penalty-table th, .lp-table th {
  background: #f5f5f5;
}

.back-link {
  text-align: center;
  margin-top: 20px;
}

.back-link a {
  font-weight: bold;
  color: #2563eb;
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}

.quick-rules {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-top: 30px;
}

.quick-rules h2 {
  margin-top: 0;
  color: #2563eb; /* blue accent */
}

.quick-rules ul {
  list-style: none;
  padding-left: 0;
  margin: 0 auto;
  display: inlin-block;
  text-align: left;
}

.quick-rules ul li {
  margin: 10px 0;
  line-height: 1.4;
}

.penalty-circle {
  display: inline-block;
  background: #e53935;   /* red */
  color: #fff;
  font-size: 0.75em;
  font-weight: bold;
  border-radius: 50%;
  padding: 4px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.player-name {
  font-size: 0.6rem;
  margin-top: 4px;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
}

.player-points {
  font-weight: bold;
  margin-top: 2px;
}

.penalty-circle-small {
  display: inline-block;
  background: red;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  line-height: 20px;
  text-align: center;
  margin-top: 4px;
}

.no-penalty-circle-small {
  display: inline-block;
  background: green;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  line-height: 20px;
  text-align: center;
  margin-top: 4px;
}

.club-badge {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* base circle */
.pos-badge {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  color: #fff;
  font-weight: bold;
  font-size: 0.75rem;
  text-align: center;
  margin: 0 auto;
}

/* color coding */
.pos-GK { background: green; }
.pos-DEF { background: red; }
.pos-MID { background: blue; }
.pos-FWD { background: black; }

@media (max-width: 600px) {
  .club-badge {
    width: 25px;
    height: 25px;
  }

  .pos-badge {
    width: 25px;
    height: 25px;
    line-height: 24px;
    font-size: 0.65rem;
  }

  .table.picks {
    font-size: 0.75rem;
  }

  .table.picks th,
  .table.picks td {
    padding: 4px;
  }
}

.extra-col {
  display: none; /* hidden by default */
}

.show-extra .extra-col {
  display: table-cell; /* visible when toggled */
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  align-items: center;
}

.filter-row {
  display: flex;
  gap: 16px;
  flex-basis: 100%; /* full width row */
  align-items: center;
}

#playerSearch {
  padding: 6px 8px;
  width: 130px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

.sync-box {
  margin: 20px 0;
  padding: 12px;
  border: 2px solid #000;
  border-radius: 6px;
  background: #f9f9f9;
  text-align: center;
}

.sync-box input[type="checkbox"] {
  transform: scale(1.3);
  margin-right: 8px;
}

.sync-label {
  font-weight: 700;
  font-size: 1.1em;
  color: #222;
}