/* Alinhado a values-night do app Android */
:root {
  --bg-main: #0a0a0a;
  --surface-card: #141414;
  --surface-elevated: #1a1a1a;
  --primary: #00c853;
  --primary-dim: #009624;
  --text-primary: #f5f5f5;
  --text-secondary: #9e9e9e;
  --card-stroke: #252525;
  --live: #ff1744;
  --badge-purple-bg: rgba(168, 85, 247, 0.14);
  --badge-purple-border: rgba(168, 85, 247, 0.4);
  --badge-purple-text: #e9d5ff;
  --radius-card: 16px;
  --radius-chip: 100px;
  --radius-sm: 8px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 20px 28px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.app-header {
  padding-top: 12px;
}

.app-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.app-subtitle {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Card programação */
.card {
  border-radius: 14px;
  border: 1px solid var(--card-stroke);
  background: var(--surface-elevated);
}

.card--info {
  margin-top: 14px;
  padding: 12px 14px;
}

.card-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-info-text {
  flex: 1;
  min-width: 0;
}

.card-info-text strong {
  display: block;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-info-text span {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.card-info-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--card-stroke);
  background: transparent;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(0, 200, 83, 0.08);
  border-color: rgba(0, 200, 83, 0.35);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn.is-active {
  background: rgba(0, 200, 83, 0.12);
  border-color: var(--primary);
}

.search-wrap {
  margin-top: 10px;
}

.search-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-stroke);
  background: var(--surface-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9375rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.2);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.api-error {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 23, 68, 0.35);
  background: rgba(255, 23, 68, 0.08);
  color: #ffb4b4;
  font-size: 0.85rem;
}

.loading {
  display: flex;
  justify-content: center;
  padding: 24px;
}

.loading[hidden] {
  display: none !important;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--card-stroke);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px 16px;
  font-size: 0.9rem;
  margin: 0;
}

/* Cabeçalho de liga */
.league-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.league-bar {
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

.league-name {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* Card de jogo */
.match-card {
  margin: 6px 0;
  padding: 16px 18px 14px;
  background: var(--surface-card);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.match-card:hover {
  border-color: rgba(0, 200, 83, 0.25);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.match-card:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.35);
}

.match-card:focus:not(:focus-visible) {
  box-shadow: none;
}

.match-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.match-time {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary);
}

.match-status-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-badge {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 23, 68, 0.15);
  border: 1px solid rgba(255, 23, 68, 0.35);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--live);
  text-transform: uppercase;
}

.match-card.is-live .live-badge {
  display: inline-flex;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.8s ease-in-out infinite;
}

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

.status-chip {
  padding: 4px 12px;
  border-radius: var(--radius-chip);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-chip--today {
  background: var(--badge-purple-bg);
  border: 1px solid var(--badge-purple-border);
  color: var(--badge-purple-text);
}

.status-chip--live {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #0b0f14;
}

.status-chip--muted {
  background: rgba(158, 158, 158, 0.12);
  border: 1px solid var(--card-stroke);
  color: var(--text-secondary);
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 4px 8px;
  margin-top: 14px;
}

.team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.team-col--away .team-logo {
  margin-left: auto;
  margin-right: auto;
}

.team-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--surface-elevated);
}

.team-name {
  margin-top: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
  hyphens: auto;
}

.score-col {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  align-self: start;
  padding-top: 4px;
}

.score {
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.score--lg {
  font-size: 2.75rem;
}

.score--sm {
  font-size: 1.75rem;
  color: var(--text-secondary);
}

.score-divider {
  font-size: 1.375rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0 2px;
}

/* Assistir: botão + dica do canal */
.match-watch {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.btn-watch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #00e676 0%, var(--primary) 100%);
  color: #0b0f14;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 200, 83, 0.25);
}

.btn-watch:hover {
  filter: brightness(1.05);
}

.btn-watch:active {
  transform: scale(0.98);
}

.match-channels-hint {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.35;
  padding: 0 4px;
}

.match-channels-hint:empty {
  display: none;
}

/* Dialog onde assistir */
.watch-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  max-width: calc(100vw - 24px);
  width: 420px;
}

.watch-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.watch-panel {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-card);
  padding: 18px 16px 16px;
  max-height: min(78vh, 560px);
  display: flex;
  flex-direction: column;
}

.watch-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}

.watch-close:hover {
  color: var(--text-primary);
  background: var(--surface-elevated);
}

.watch-hint-label {
  margin: 0 0 2px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.watch-hint {
  margin: 0 32px 8px 0;
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.watch-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.watch-sub {
  margin: 6px 0 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.watch-loading {
  display: flex;
  justify-content: center;
  padding: 16px;
}

.watch-loading[hidden] {
  display: none !important;
}

.watch-error {
  margin: 0 0 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 23, 68, 0.08);
  border: 1px solid rgba(255, 23, 68, 0.3);
  color: #ffb4b4;
  font-size: 0.8rem;
}

.watch-error[hidden] {
  display: none !important;
}

.watch-options {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.watch-options li {
  margin-bottom: 8px;
}

.watch-opt-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--card-stroke);
  border-radius: 12px;
  background: var(--surface-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.watch-opt-btn:hover {
  border-color: rgba(0, 200, 83, 0.4);
  background: rgba(0, 200, 83, 0.06);
}

.watch-opt-btn.is-match {
  border-color: rgba(0, 200, 83, 0.45);
}

.detail-watch {
  margin-top: 14px;
}

/* Dialog detalhes */
.detail-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  max-width: calc(100vw - 32px);
  width: 400px;
}

.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.detail-panel {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-card);
  padding: 20px 18px 22px;
}

.detail-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}

.detail-close:hover {
  color: var(--text-primary);
  background: var(--surface-elevated);
}

.detail-league {
  margin: 0 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.detail-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.detail-meta {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.detail-score-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.detail-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 0;
}

.detail-logo {
  border-radius: 50%;
  background: var(--surface-elevated);
  object-fit: contain;
}

.detail-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.detail-status {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-tv {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.detail-tv:empty {
  display: none;
}
