* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #f4f6f7;
  color: #111827;
}

.app { max-width: 1180px; margin: auto; padding: 28px 20px 50px; }

.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 46px; height: 46px; border-radius: 14px; background: #16a34a; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 23px; }
.brand h1 { margin: 0; font-size: 22px; }
.brand span { color: #6b7280; font-size: 13px; }

.credit-badge { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #e5e7eb; border-radius: 999px; padding: 8px 14px; box-shadow: 0 5px 20px rgba(0,0,0,.04); color: #111827; font-size: 13px; font-weight: 600; text-decoration: none; transition: border-color .15s, transform .15s; }
.credit-badge:hover { border-color: #16a34a; transform: translateY(-1px); }
.credit-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }

.date-navigation { background: #fff; padding: 10px; border-radius: 18px; margin-bottom: 22px; box-shadow: 0 5px 20px rgba(0,0,0,.04); display: flex; align-items: center; gap: 8px; }
.date-nav-arrow { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; border: 1px solid #e5e7eb; background: #fff; font-size: 18px; cursor: pointer; }
.date-nav-arrow:hover { background: #f4f6f7; }
.date-buttons { display: flex; gap: 8px; overflow-x: auto; flex: 1; }
.date-btn { min-width: 135px; border: 1px solid #e5e7eb; background: #fff; border-radius: 13px; padding: 12px 14px; text-align: left; cursor: pointer; }
.date-btn.active { background: #111827; color: #fff; border-color: #111827; }
.date-btn small { display: block; opacity: .65; margin-bottom: 4px; }
.date-btn strong { font-size: 15px; }

.grid { display: grid; grid-template-columns: 360px 1fr; gap: 22px; }
.card { background: #fff; border-radius: 20px; box-shadow: 0 5px 22px rgba(0,0,0,.04); }

.planner { padding: 22px; height: fit-content; }
.planner-header { margin-bottom: 18px; }
.planner-header h2 { margin: 0; font-size: 18px; }
.location { color: #6b7280; font-size: 13px; margin-top: 3px; }

.maghrib { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 15px; padding: 16px; margin-bottom: 18px; }
.maghrib-title { color: #15803d; font-weight: 700; font-size: 14px; }
.maghrib-time { font-size: 28px; font-weight: 800; margin-top: 5px; }
.maghrib-time.loading { color: #9ca3af; font-size: 16px; }
.maghrib-time.error { color: #b91c1c; font-size: 15px; }
.maghrib-date { color: #6b7280; font-size: 12px; margin-top: 2px; }
.maghrib-source { color: #9ca3af; font-size: 11px; margin-top: 6px; }
.maghrib-info { color: #6b7280; font-size: 12px; line-height: 1.5; margin-top: 9px; }
.maghrib-retry { margin-top: 8px; border: 1px solid #b91c1c; color: #b91c1c; background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.choice label { cursor: pointer; }
.choice input { display: none; }
.choice-box { border: 1px solid #e5e7eb; border-radius: 13px; padding: 14px 8px; text-align: center; font-size: 14px; font-weight: 600; }
.choice input:checked + .choice-box { border-color: #16a34a; background: #f0fdf4; color: #15803d; }

.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label { display: block; color: #6b7280; font-size: 12px; margin-bottom: 6px; }
.field input { width: 100%; border: 1px solid #d1d5db; border-radius: 11px; padding: 11px; font-size: 16px; }

.summary { margin-top: 18px; background: #111827; color: #fff; border-radius: 15px; padding: 15px; }
.summary small { color: #9ca3af; }
.summary strong { display: block; margin-top: 5px; font-size: 17px; }

.matches { padding: 22px; }
.matches-header { margin-bottom: 20px; }
.matches-header h2 { margin: 0; font-size: 19px; }
.matches-header span { color: #6b7280; font-size: 13px; }
.data-updated { color: #9ca3af; font-size: 11px; margin-top: 4px; }

.competition { margin-bottom: 25px; }
.competition-title { display: flex; align-items: center; gap: 8px; color: #4b5563; font-size: 13px; font-weight: 800; text-transform: uppercase; margin-bottom: 9px; }
.competition-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }

.match { border: 1px solid #e5e7eb; border-radius: 15px; padding: 14px; display: grid; grid-template-columns: 85px 1fr auto; align-items: center; gap: 15px; margin-bottom: 8px; }
.match.conflict { border-color: #f59e0b; background: #fffbeb; }

.match-time { font-size: 16px; font-weight: 800; }
.match-time.unknown { font-size: 12px; color: #9ca3af; font-weight: 600; }

.match-teams { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.team { display: flex; align-items: center; gap: 8px; }
.team-logo { width: 34px; height: 34px; object-fit: contain; }
.team-name { font-size: 14px; font-weight: 600; }
.vs { color: #9ca3af; font-size: 12px; }
.league-label { color: #9ca3af; font-size: 11px; margin-top: 4px; }

.badges { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.badge { font-size: 11px; font-weight: 700; padding: 7px 9px; border-radius: 8px; white-space: nowrap; }
.badge.important { background: #dbeafe; color: #1e40af; }
.badge.normal { background: #f3f4f6; color: #6b7280; }
.badge.conflict { background: #f59e0b; color: #fff; }
.badge.no-conflict { background: #dcfce7; color: #15803d; }
.badge.unknown { background: #f3f4f6; color: #6b7280; }

.no-matches { text-align: center; padding: 45px 20px; color: #6b7280; }
.no-matches-icon { font-size: 35px; margin-bottom: 10px; }

.source-note { margin-top: 18px; padding: 12px; background: #f9fafb; border-radius: 10px; color: #9ca3af; font-size: 11px; line-height: 1.5; }

@media(max-width: 850px) {
  .grid { grid-template-columns: 1fr; }
}

@media(max-width: 600px) {
  .app { padding: 18px 12px 40px; }
  .header { flex-wrap: wrap; gap: 10px; }
  .match { grid-template-columns: 65px 1fr; }
  .badges { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; }
}
