/* Hızlı Maç ekranı. Tüm sınıflar .quick-match- / .qm- önekli (AGENTS.md §4.1).
   Modern beyaz/gri/mavi (buz mavisi güven paleti, §11.8) — koyu lacivert tema yerine. */

.quick-match-screen {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  /* Alt boşluk sohbet balonunun butonları örtmesini engeller. */
  padding: 14px 16px 96px;
  min-height: 100%;
}

/* ---------------------------------------------------------------- başlık */

.quick-match-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quick-match-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-match-title {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #0f172a;
}

.quick-match-sub {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.quick-match-refresh-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0284c7;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.quick-match-refresh-btn:hover { background: #f0f9ff; border-color: #38bdf8; }
.quick-match-refresh-btn:active { transform: scale(0.97); }

/* ---------------------------------------------------------------- zorluk seçimi */

.quick-match-difficulty {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.qm-diff-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 11px 8px;
  border-radius: 12px;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  touch-action: manipulation;
}

.qm-diff-btn:hover { transform: translateY(-2px); }
.qm-diff-btn:active { transform: scale(0.98); }

.qm-diff-icon { font-size: 17px; }

.qm-diff-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: #334155;
}

.qm-diff-desc {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
}

.qm-diff-btn.easy.active { border-color: #22c55e; background: rgba(34, 197, 94, 0.08); }
.qm-diff-btn.easy.active .qm-diff-name { color: #16a34a; }
.qm-diff-btn.medium.active { border-color: #38bdf8; background: rgba(2, 132, 199, 0.08); }
.qm-diff-btn.medium.active .qm-diff-name { color: #0284c7; }
.qm-diff-btn.hard.active { border-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.qm-diff-btn.hard.active .qm-diff-name { color: #dc2626; }

/* ---------------------------------------------------------------- durumlar */

.qm-loading, .qm-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 46px 20px;
  color: #64748b;
  text-align: center;
}

.qm-loading-icon { font-size: 30px; }

.qm-loading-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.qm-error-title { margin: 0; font-weight: 900; color: #dc2626; }
.qm-error-detail { margin: 0; font-size: 12px; color: #64748b; }

.qm-empty { padding: 18px; text-align: center; font-size: 12px; color: #94a3b8; }

/* ---------------------------------------------------------------- maç öncesi */

.qm-prematch-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
}

.qm-versus {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #bae6fd;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: #0284c7;
}

.qm-team-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.qm-team-card.home { border-left: 3px solid #0284c7; }
.qm-team-card.away { border-left: 3px solid #ef4444; }

.qm-team-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
}

.qm-team-logo { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex-shrink: 0; }
.qm-team-logo svg { width: 100%; height: 100%; }
.qm-team-logo-fallback { font-size: 20px; }

.qm-team-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.qm-team-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qm-team-role {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.3px;
}

.qm-team-ovr {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}

.qm-team-ovr small {
  display: block;
  font-size: 8px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.6px;
}

.qm-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
}

.qm-line { display: flex; align-items: center; gap: 7px; }

.qm-line-label {
  width: 62px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
}

.qm-line-track {
  flex: 1;
  height: 5px;
  background: #eef2f7;
  border-radius: 3px;
  overflow: hidden;
}

.qm-line-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 3px;
}

.qm-line-val {
  width: 28px;
  text-align: right;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.qm-conditions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding-bottom: 10px;
}

.qm-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 7px;
  background: #f0f9ff;
  font-size: 10px;
  color: #334155;
}

.qm-pill-label { flex: 1; color: #64748b; font-weight: 600; }
.qm-pill strong { font-family: 'Chakra Petch', sans-serif; font-weight: 800; }

.qm-squad-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #94a3b8;
  padding: 6px 0;
  border-top: 1px solid #eef2f7;
}

.qm-squad-list { display: flex; flex-direction: column; gap: 3px; }

.qm-player-row, .qm-rating-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f8fafc;
}

.qm-pos {
  width: 32px;
  flex-shrink: 0;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  padding: 2px 0;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
}

.qm-pname {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qm-povr {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.qm-fit {
  display: inline-block;
  margin-left: 5px;
  width: 13px;
  height: 13px;
  line-height: 13px;
  text-align: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  color: #ffffff;
}

.qm-fit.warn { background: #eab308; }
.qm-fit.bad { background: #ef4444; }

/* ---------------------------------------------------------------- aksiyonlar */

.qm-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.qm-btn-primary {
  flex: 1;
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.qm-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(2, 132, 199, 0.38); }
.qm-btn-primary:active { transform: scale(0.98); }

.qm-btn-secondary {
  padding: 12px 16px;
  border-radius: 11px;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.qm-btn-secondary:hover { border-color: #38bdf8; color: #0284c7; background: #f0f9ff; }

/* ---------------------------------------------------------------- maç sonucu */

.qm-result-head {
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.qm-result-head.home { border-color: rgba(34, 197, 94, 0.5); }
.qm-result-head.away { border-color: rgba(239, 68, 68, 0.5); }

.qm-verdict {
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #0f172a;
  margin-bottom: 8px;
}

.qm-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.qm-sb-team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}

.qm-scoreboard .qm-sb-team:last-child { justify-content: flex-end; }

.qm-sb-logo { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }
.qm-sb-logo svg { width: 100%; height: 100%; }

.qm-sb-score {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 2px;
}

.qm-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.qm-timeline-box, .qm-stats-box, .qm-ratings-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.qm-ratings-box { margin-top: 12px; }

.qm-box-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.7px;
  color: #94a3b8;
  padding-bottom: 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid #eef2f7;
}

.qm-timeline {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 330px;
  overflow-y: auto;
  cursor: grab;
  touch-action: pan-y;
}

.qm-timeline:active { cursor: grabbing; }

.qm-event {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #f8fafc;
  border-left: 2px solid #cbd5e1;
}

.qm-event.goal, .qm-event.penalty_goal { border-left-color: #22c55e; background: rgba(34, 197, 94, 0.06); }
.qm-event.big_chance_missed, .qm-event.penalty_miss { border-left-color: #38bdf8; }
.qm-event.yellow_card { border-left-color: #eab308; }
.qm-event.red_card { border-left-color: #ef4444; }

.qm-minute {
  flex-shrink: 0;
  width: 30px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.qm-event-text { font-size: 11px; line-height: 1.45; color: #334155; }

.qm-stat-row {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.qm-stat-val {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.qm-stat-val.home { text-align: left; }
.qm-stat-val.away { text-align: right; }

.qm-stat-mid { display: flex; flex-direction: column; gap: 3px; }

.qm-stat-label {
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #94a3b8;
  text-transform: uppercase;
}

.qm-stat-bar {
  display: flex;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: #eef2f7;
}

.qm-stat-bar-home { background: #0284c7; }
.qm-stat-bar-away { background: #ef4444; }

.qm-ratings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 5px;
}

.qm-rating-goals { font-size: 10px; }

.qm-rating-val {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
}

.rating-elite { background: rgba(217, 70, 239, 0.12); color: #c026d3; }
.rating-good { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.rating-ok { background: rgba(56, 189, 248, 0.14); color: #0284c7; }
.rating-poor { background: #eef2f7; color: #64748b; }

/* ---------------------------------------------------------------- OVR renk kademeleri */

.quick-match-screen .ovr-mutant { color: #c026d3; }
.quick-match-screen .ovr-red { color: #dc2626; }
.quick-match-screen .ovr-orange { color: #ea580c; }
.quick-match-screen .ovr-yellow { color: #ca8a04; }
.quick-match-screen .ovr-green { color: #0e7490; } /* DENEME: turkuaz/açık mavi (beyaz zeminde kontrast için koyu ton) */
.quick-match-screen .ovr-grey { color: #94a3b8; }

/* ---------------------------------------------------------------- telefon genişliği */

@container game (max-width: 860px) {
  .qm-prematch-grid { grid-template-columns: 1fr; }
  .qm-versus { justify-self: center; }
  .qm-result-grid { grid-template-columns: 1fr; }
}

@container game (max-width: 520px) {
  .quick-match-screen { padding: 12px 16px 24px; }
  .quick-match-difficulty { grid-template-columns: 1fr; }
  .qm-diff-btn { flex-direction: row; justify-content: flex-start; gap: 8px; }
  .qm-diff-desc { text-align: left; }
  .qm-btn-primary { min-width: 0; width: 100%; }
  .qm-sb-score { font-size: 28px; }
}
