:root {
  --bg-main: #0c0d10;
  --bg-card: #151820;
  --bg-card-alt: #1a1e28;
  --border-card: #262c3a;
  --text-main: #f0f2f5;
  --text-muted: #8e98a8;
  --accent-gold: #d4af37;
  --accent-gold-light: #f5d77f;
  --accent-red: #ff4757;
  --accent-green: #2ed573;
  --accent-blue: #1e90ff;
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.ls-header {
  background: #12151c;
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ls-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

.ls-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.ls-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.ls-logo {
  height: 28px;
  width: auto;
}

.ls-back-home {
  color: var(--accent-gold);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.1);
  transition: all 0.2s;
}

.ls-back-home:hover {
  background: rgba(212, 175, 55, 0.2);
}

.ls-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ls-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.ls-btn-reg {
  background: #25a244;
  color: #fff;
}

.ls-btn-reg:hover {
  background: #2dc653;
}

.ls-btn-login {
  background: linear-gradient(180deg, #d4af37, #aa820a);
  color: #000;
}

.ls-btn-login:hover {
  filter: brightness(1.1);
}

/* Status Bar */
.ls-status-bar {
  background: #171b24;
  border-bottom: 1px solid var(--border-card);
  padding: 10px 0;
  font-size: 13px;
}

.ls-status-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.ls-status-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ls-pulse-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-green);
  font-weight: 500;
}

.ls-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(46, 213, 115, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 213, 115, 0); }
}

.ls-stat-pill {
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 10px;
  border-radius: 20px;
  color: var(--text-muted);
}

.ls-stat-pill strong {
  color: var(--text-main);
}

.ls-refresh-btn {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.ls-refresh-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Controls: Tabs & Search */
.ls-controls {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 640px) {
  .ls-controls {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.ls-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ls-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.ls-tab:hover {
  background: var(--bg-card-alt);
  color: var(--text-main);
}

.ls-tab.active {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
  font-weight: 700;
}

.ls-tab-badge {
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.2);
}

.ls-tab.active .ls-tab-badge {
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}

.ls-tab-live.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.ls-search-wrap {
  position: relative;
  min-width: 220px;
}

.ls-search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 8px 12px 8px 34px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.ls-search-input:focus {
  border-color: var(--accent-gold);
}

.ls-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* Match Board */
.ls-board {
  flex: 1;
  padding-bottom: 40px;
}

.ls-league-group {
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  overflow: hidden;
}

.ls-league-header {
  background: #1c212c;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-card);
}

.ls-league-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.ls-league-name {
  color: var(--text-main);
}

.ls-league-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: normal;
}

/* Match Row */
.ls-match-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.ls-match-row:last-child {
  border-bottom: none;
}

.ls-match-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ls-match-row.is-live {
  background: rgba(255, 71, 87, 0.04);
  border-left: 3px solid var(--accent-red);
}

.ls-col-time {
  width: 75px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ls-match-time {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.ls-match-state {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.is-live .ls-match-state {
  color: var(--accent-red);
  animation: blink 1.2s infinite;
}

.is-finished .ls-match-state {
  color: var(--text-muted);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ls-col-teams {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
}

.ls-team {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ls-team-home {
  justify-content: flex-end;
  text-align: right;
}

.ls-team-away {
  justify-content: flex-start;
  text-align: left;
}

.ls-red-card {
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
}

.ls-neutral-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(220, 53, 69, 0.2);
  color: #ff7b7b;
  border: 1px solid rgba(220, 53, 69, 0.4);
  vertical-align: middle;
  margin: 0 4px;
  white-space: nowrap;
}

.ls-col-score {
  width: 90px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ls-score-box {
  background: #0f1218;
  border: 1px solid var(--border-card);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
  min-width: 54px;
  text-align: center;
}

.is-live .ls-score-box {
  color: var(--accent-gold-light);
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
}

.is-finished .ls-score-box {
  color: var(--text-main);
  background: #171c26;
}

.ls-ht-score {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Empty & Loading States */
.ls-loading, .ls-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.ls-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-card);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

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

/* Footer */
.ls-footer {
  background: #090a0d;
  border-top: 1px solid var(--border-card);
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

.ls-footer-links {
  margin-bottom: 8px;
}

.ls-footer-links a {
  color: var(--accent-gold);
  text-decoration: none;
  margin: 0 8px;
}

.ls-footer-links a:hover {
  text-decoration: underline;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .ls-col-time {
    width: 65px;
  }
  .ls-team {
    font-size: 12px;
  }
  .ls-score-box {
    font-size: 13px;
    padding: 3px 6px;
    min-width: 46px;
  }
  .ls-nav-actions .ls-btn-reg {
    display: none;
  }
}
