/* ═══════════════════════════════════════
   WC Draft Manager — Mobile-first UI
   ═══════════════════════════════════════ */

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

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #21262d;
  --border: #30363d;
  --green: #3fb950;
  --green-dim: #238636;
  --gold: #e3b341;
  --orange: #d29922;
  --red: #f85149;
  --blue: #58a6ff;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --radius: 12px;
  --radius-sm: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 52px;
  --touch: 44px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.45;
  overflow-x: hidden;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px calc(12px + var(--safe-bottom));
}

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  background: linear-gradient(var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
}

.app-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
}

.mode-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(88, 166, 255, 0.12);
  color: var(--blue);
  border: 1px solid rgba(88, 166, 255, 0.25);
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.75rem;
}

/* ── Oyun modu seçimi ── */
.mode-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(13, 17, 23, 0.94);
  backdrop-filter: blur(8px);
}

.mode-overlay.hidden {
  display: none;
}

.mode-card {
  width: 100%;
  max-width: 440px;
  padding: 28px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.mode-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.mode-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.mode-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.mode-options {
  display: grid;
  gap: 10px;
}

.mode-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: var(--touch);
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.mode-option:hover {
  border-color: var(--green);
  background: rgba(63, 185, 80, 0.08);
}

.mode-option-icon {
  font-size: 1.75rem;
}

.mode-option-title {
  font-size: 1rem;
  font-weight: 700;
}

.mode-option-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mode-back {
  float: left;
  margin-bottom: 8px;
}

.mode-room-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.mode-join-row {
  display: flex;
  gap: 8px;
}

.mode-join-row input {
  flex: 1;
  min-height: var(--touch);
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.mode-room-code {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin: 12px 0;
}

.mode-room-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 10px;
  min-height: 1.2em;
}

.mode-lobby-players {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.mode-lobby-players li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.mode-lobby-players .lobby-player-name {
  font-weight: 700;
}

.mode-lobby-players .lobby-player-state {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mode-lobby-players .lobby-player-state.is-ready {
  color: var(--green);
}

.online-room-panel {
  padding: 14px;
  margin-bottom: 10px;
  background: rgba(88, 166, 255, 0.06);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: var(--radius-sm);
  text-align: center;
}

.online-room-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.online-room-code {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin: 6px 0 10px;
}

.online-room-state {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tab {
  min-height: var(--touch);
  min-width: 72px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab.active {
  background: var(--green-dim);
  color: #fff;
}

/* ── Views ── */
.view {
  display: none;
  gap: 14px;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.view-draft.active {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .view-draft.active {
    grid-template-columns: 1fr 300px;
  }
  .view-match.active {
    display: grid;
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
}

.view-match {
  position: relative;
}

.view-match.locked .match-stage,
.view-match.locked .match-controls {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

/* ── Maç kapısı (kadro zorunluluğu) ── */
.match-gate {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(4px);
}

.view-match.unlocked .match-gate {
  display: none;
}

.match-gate-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.gate-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.gate-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.gate-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.gate-progress {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(227, 179, 65, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(227, 179, 65, 0.2);
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gate-actions .btn-play {
  width: 100%;
}

.gate-continue {
  width: 100%;
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green-dim);
}

/* ── Maç sonu istatistik ekranı ── */
.match-stats-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(6px);
}

.match-stats-overlay.hidden {
  display: none;
}

.match-stats-card {
  width: 100%;
  max-width: 480px;
  max-height: min(90vh, 680px);
  overflow-y: auto;
  padding: 24px 20px 20px;
  background: linear-gradient(180deg, var(--surface) 0%, #12161c 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.stats-headline {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 6px;
}

.stats-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-muted);
}

/* ── Skor panosu ── */
.stats-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.stats-team-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  min-height: 96px;
}

.stats-team-block-home {
  background: linear-gradient(135deg, rgba(21, 101, 192, 0.22) 0%, rgba(21, 101, 192, 0.06) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-team-block-away {
  background: linear-gradient(225deg, rgba(198, 40, 40, 0.22) 0%, rgba(198, 40, 40, 0.06) 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-win-home .stats-team-block-home {
  box-shadow: inset 0 0 0 2px rgba(100, 181, 246, 0.45);
}

.stats-win-away .stats-team-block-away {
  box-shadow: inset 0 0 0 2px rgba(239, 154, 154, 0.45);
}

.stats-win-home .stats-team-block-home .stats-team-score,
.stats-win-away .stats-team-block-away .stats-team-score {
  text-shadow: 0 0 24px rgba(255, 215, 0, 0.35);
}

.stats-team-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-team-block-home .stats-team-label { color: #90caf9; }
.stats-team-block-away .stats-team-label { color: #ef9a9a; }

.stats-team-score {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stats-team-block-home .stats-team-score { color: #64b5f6; }
.stats-team-block-away .stats-team-score { color: #ef5350; }

.stats-score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 10px;
  background: rgba(0, 0, 0, 0.4);
  min-width: 44px;
}

.stats-ft-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.stats-score-sep {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-muted);
  opacity: 0.5;
  line-height: 1;
}

/* ── Goller (sol / sağ) ── */
.stats-scorers-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
  text-align: left;
}

.stats-scorers-col {
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.stats-scorers-col-home {
  border-top: 3px solid #1565c0;
}

.stats-scorers-col-away {
  border-top: 3px solid #c62828;
}

.stats-scorers-heading {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.stats-scorers-col-home .stats-scorers-heading { color: #64b5f6; }
.stats-scorers-col-away .stats-scorers-heading { color: #ef9a9a; }

.stats-scorers-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stats-scorer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-scorer-item:last-child {
  border-bottom: none;
}

.stats-scorer-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

.stats-scorer-item .scorer-minute {
  min-width: 26px;
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stats-scorer-home .scorer-name { color: #90caf9; font-weight: 600; }
.stats-scorer-away .scorer-name { color: #ef9a9a; font-weight: 600; }

/* ── İstatistik tablosu ── */
.stats-table {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.stats-table-head {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border);
}

.stats-col-home {
  text-align: right;
  color: #64b5f6;
}

.stats-col-mid {
  text-align: center;
  color: var(--text-muted);
}

.stats-col-away {
  text-align: left;
  color: #ef9a9a;
}

.stats-rows {
  display: flex;
  flex-direction: column;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.stat-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.stat-home {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #64b5f6;
}

.stat-away {
  text-align: left;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ef5350;
}

.stat-mid {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.stat-dual-bar {
  display: flex;
  height: 5px;
  margin-top: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(239, 83, 80, 0.25);
}

.stat-dual-home {
  height: 100%;
  background: linear-gradient(90deg, #1565c0, #64b5f6);
  border-radius: 999px 0 0 999px;
  transition: width 0.5s ease;
}

.stat-dual-away {
  height: 100%;
  background: linear-gradient(90deg, #ef5350, #c62828);
  border-radius: 0 999px 999px 0;
  transition: width 0.5s ease;
}

.stats-close {
  flex: 1;
}

.stats-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.stats-rematch {
  flex: 1;
}

.stats-rematch-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 4px;
  min-height: 1.2em;
}

.field input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ── Pitch ── */
.pitch-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  overflow: hidden;
}

.pitch-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

#draftSahasi { cursor: crosshair; }

.pitch-wrap-match {
  position: relative;
  padding: 0;
  background: #1a3a1a;
}

.pitch-wrap-match canvas {
  border-radius: 0 0 6px 6px;
}

/* ── Maç skor overlay ── */
.score-overlay {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(13, 17, 23, 0.92);
  border-bottom: 1px solid var(--border);
}

.score-team {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-home { justify-content: flex-start; }
.score-away { justify-content: flex-end; }

.team-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.team-score {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 1.5ch;
  text-align: center;
}

.score-home .team-score { color: var(--blue); }
.score-away .team-score { color: var(--red); }

.score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.match-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.match-badge.live {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
  border-color: var(--green-dim);
  animation: pulse-badge 1.5s ease infinite;
}

.match-badge.ended {
  background: rgba(227, 179, 65, 0.12);
  color: var(--gold);
  border-color: rgba(227, 179, 65, 0.3);
}

.match-minute {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ── Live ticker ── */
.live-ticker {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 44px;
}

.live-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

.live-ticker.active .live-dot {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-badge 1s ease infinite;
}

.live-ticker.goal .live-dot {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.live-ticker.chance .live-dot {
  background: var(--orange);
}

.live-ticker.sub .live-dot {
  background: #66bb6a;
}

.live-ticker.card-yellow .live-dot {
  background: #fdd835;
  box-shadow: 0 0 8px #fdd835;
}

.live-ticker.card-yellow #liveCommentaryText {
  color: #fff176;
  font-weight: 600;
}

.live-ticker.card-red .live-dot {
  background: #f44336;
  box-shadow: 0 0 8px #f44336;
}

.live-ticker.card-red #liveCommentaryText {
  color: #ef9a9a;
  font-weight: 700;
}

.live-ticker.setpiece .live-dot {
  background: var(--blue);
}

.live-ticker.setpiece #liveCommentaryText {
  color: #90caf9;
}

.live-ticker.sub #liveCommentaryText {
  color: #a5d6a7;
  font-weight: 600;
}

#liveCommentaryText {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}

.live-ticker.goal #liveCommentaryText {
  color: var(--gold);
  font-weight: 600;
}

/* ── Maç öncesi kadrolar ── */
.prematch-lineups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.lineup-col {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.lineup-col-home {
  border-top: 3px solid var(--blue);
}

.lineup-col-away {
  border-top: 3px solid var(--red);
}

.lineup-header {
  margin-bottom: 8px;
}

.lineup-title {
  font-size: 0.85rem;
  font-weight: 800;
  margin: 0 0 2px;
}

.lineup-col-home .lineup-title { color: var(--blue); }
.lineup-col-away .lineup-title { color: var(--red); }

.lineup-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
}

.lineup-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  margin: 4px 0 0;
}

.lineup-col-home .lineup-value { color: #64b5f6; }
.lineup-col-away .lineup-value { color: #ef9a9a; }

.lineup-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 8px 0 4px;
}

.lineup-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lineup-list-bench {
  opacity: 0.85;
}

.lineup-player {
  display: grid;
  grid-template-columns: 42px 1fr 28px;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.lineup-player:last-child {
  border-bottom: none;
}

.lineup-slot {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lineup-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineup-ovr {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--gold);
}

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

/* ── Maç kontrolleri ── */
.match-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 899px) {
  .match-controls {
    position: static;
    z-index: auto;
    padding-bottom: 0;
    background: none;
  }

  .view-match.active {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .match-stage {
    flex-shrink: 0;
  }

  .view-match.is-live .match-controls {
    display: none;
  }

  .view-match.is-live.active {
    min-height: calc(100dvh - var(--header-h) - 20px);
  }

  .view-match.is-live .match-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .view-match.is-live .pitch-wrap-match {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }

  .view-match.is-live .pitch-wrap-match canvas {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
  }

  .live-ticker {
    flex-shrink: 0;
    margin-top: 6px;
  }

  #liveCommentaryText {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .prematch-lineups {
    max-height: min(38vh, 320px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.control-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.btn-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dim) 100%);
  box-shadow: 0 4px 14px rgba(63, 185, 80, 0.25);
}

.btn-play:disabled {
  background: var(--surface-2);
  box-shadow: none;
  color: var(--text-muted);
}

.btn-play .btn-icon {
  font-size: 0.85rem;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ── Buttons ── */
.btn {
  min-height: var(--touch);
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-primary {
  background: var(--green-dim);
  color: #fff;
  width: 100%;
}

.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green-dim);
  width: 100%;
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-chip {
  flex: 1;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  min-height: 40px;
}

.btn-chip-warn {
  color: var(--orange);
  border-color: rgba(210, 153, 34, 0.4);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* ── Panels ── */
.sidebar, .match-controls { display: flex; flex-direction: column; gap: 10px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.panel-accent .panel-title {
  color: var(--gold);
  font-size: 1.05rem;
}

.panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  margin-bottom: 12px;
}

.panel-collapsible {
  padding: 0;
  overflow: hidden;
}

.panel-collapsible summary {
  padding: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  min-height: var(--touch);
  display: flex;
  align-items: center;
}

.panel-collapsible summary::-webkit-details-marker { display: none; }

.panel-collapsible summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.panel-collapsible[open] summary::after { content: '−'; }

.panel-collapsible .hint,
.panel-collapsible .commentary-box,
.panel-collapsible .settings-body {
  padding: 0 14px 14px;
}

.settings-body { display: flex; flex-direction: column; gap: 10px; }

/* ── Form ── */
.field { display: block; }

.field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.field input {
  width: 100%;
  min-height: var(--touch);
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 16px; /* iOS zoom önleme */
}

.field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.15);
}

/* ── Draft ── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.stat-grid dt {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-grid dd {
  font-size: 0.95rem;
  font-weight: 600;
}

#draftFormation {
  color: var(--gold);
  font-weight: 800;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(420px, 50vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.player-list::-webkit-scrollbar {
  width: 6px;
}

.player-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--touch);
  padding: 8px 12px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.player-card.selected {
  border-color: var(--gold);
  background: rgba(227, 179, 65, 0.06);
}

.player-ovr {
  font-weight: 800;
  font-size: 1rem;
  min-width: 28px;
  color: var(--gold);
}

.player-name { flex: 1; font-size: 0.875rem; }

.player-pos {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 4px;
}

.status-text {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--green);
  min-height: 1.2em;
}

.api-warning-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  padding: 10px 14px;
  background: #7f1d1d;
  color: #fecaca;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
  border-bottom: 1px solid #991b1b;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Commentary log ── */
.commentary-box {
  max-height: 160px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

@media (min-width: 900px) {
  .commentary-box { max-height: 220px; }
}

.commentary-box .line {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.commentary-box .line:last-child { border-bottom: none; }

.commentary-box .line.goal { color: var(--gold); font-weight: 600; }
.commentary-box .line.chance { color: var(--orange); }
.commentary-box .line.card-yellow { color: #fff176; font-weight: 600; }
.commentary-box .line.card-red { color: #ef9a9a; font-weight: 700; }
.commentary-box .line.setpiece { color: #90caf9; }

/* ── Desktop: maç stage sticky ── */
@media (min-width: 900px) {
  .match-stage {
    position: sticky;
    top: calc(var(--header-h) + 8px);
  }

  .live-ticker { margin-top: 10px; }
}

/* ── Küçük ekran optimizasyonu ── */
@media (max-width: 380px) {
  .team-score { font-size: 1.5rem; }
}
