.page-header { margin-bottom: 24px; }

.room-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 10px 14px;
}
.room-selector-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.room-select {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--t1);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  width: auto;
}
.page-header .label-tag { margin-bottom: 6px; }
.page-header h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 900; line-height: 1.1; }

.phase-tabs { display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto; padding-bottom: 4px; }
.phase-tabs::-webkit-scrollbar { display: none; }
.phase-btn {
  padding: 8px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.phase-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.group-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.group-filter::-webkit-scrollbar { display: none; }
.filter-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; flex-shrink: 0; }
.group-btns { display: flex; gap: 6px; flex-wrap: nowrap; }
.group-btn {
  height: 32px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.group-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.group-section-header {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* Standings */
.group-standings {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
}
.standings-header {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.standings-table thead th {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 8px;
  text-align: center;
}
.standings-table thead th.col-team { text-align: left; padding-left: 14px; }
.standings-table tbody tr {
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.standings-table tbody tr:hover { background: var(--surface2); }
.standings-table tbody tr.qualified { border-left: 3px solid var(--primary); }
.standings-table td {
  padding: 9px 8px;
  text-align: center;
  color: var(--text-muted);
}
.col-team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 8px 9px 12px !important;
  text-align: left !important;
  min-width: 0;
}
.standing-rank {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.standing-flag { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.standing-name {
  font-weight: 700;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.83rem;
}
.col-pts { font-weight: 900; color: var(--t1); }
.gd-pos { color: #22c55e; font-weight: 700; }
.gd-neg { color: #ef4444; font-weight: 700; }

.matches-list { display: flex; flex-direction: column; gap: 12px; }

@keyframes match-enter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Match card — new design */
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
  animation: match-enter 0.35s ease both;
}
.match-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.match-card.finished { opacity: 0.8; }
.match-card--special {
  border-color: #f59e0b;
  background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, #f59e0b 16%, var(--surface)) 100%);
  box-shadow: 0 0 0 2px #f59e0b, 0 6px 24px color-mix(in srgb, #f59e0b 28%, transparent);
}
.match-card--special:hover { border-color: #fbbf24; }
.match-multiplier-badge,
.prog-multiplier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #1a1200;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 2px 6px color-mix(in srgb, #000 24%, transparent);
}

.match-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.match-card-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.match-card-teams {
  display: flex;
  align-items: center;
  padding: 14px 14px 12px;
  gap: 10px;
}
.match-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.match-team.away { align-items: flex-end; }
.team-flag { font-size: 1.8rem; line-height: 1; }
.team-name { font-size: 0.95rem; font-weight: 700; }

.match-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 60px;
}
.match-vs { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); letter-spacing: 2px; }
.match-score-live {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--t1);
  letter-spacing: 2px;
  text-align: center;
}
.modal-locked-msg .match-score-live {
  display: inline-block;
  background: var(--surface2);
  border-radius: 12px;
  padding: 12px 32px;
  font-size: 2.8rem;
  letter-spacing: 4px;
}
.live-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--red, #ef4444);
  letter-spacing: 0.5px;
}
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red, #ef4444); margin-right: 3px; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.match-card-bottom {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.match-card-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.btn-preds-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}
.btn-preds-toggle.open { background: var(--acc-d); border-color: var(--primary); }

.match-preds-panel {
  border-top: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 0 0 16px 16px;
}
.preds-panel-inner { padding: 12px 14px; }
.preds-panel-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.preds-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.preds-row:last-child { border-bottom: none; }
.preds-row--me .preds-name { font-weight: 700; color: var(--acc); }
.preds-name { color: var(--text-muted); }
.preds-right { display: flex; gap: 8px; align-items: center; }
.preds-score { font-weight: 800; font-family: monospace; color: var(--t1); }
.preds-pts { color: var(--primary); font-weight: 700; font-size: 0.78rem; }
.preds-loading { padding: 12px 14px; color: var(--text-muted); font-size: 0.82rem; }
.prono-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface2);
}
.prono-status.has-prono { border-color: var(--primary); color: var(--primary); background: var(--acc-d); }
.prono-status.exact { border-color: var(--primary); color: #fff; background: var(--primary); }
.prono-status.correct { border-color: #22c55e; color: #22c55e; background: rgba(34,197,94,0.1); }
.prono-status.wrong { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }

.btn-pronostiquer {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-pronostiquer.done {
  background: var(--surface3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 0;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 20px; }
}
.modal {
  width: 100%;
  max-width: 480px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: 0 -8px 40px color-mix(in srgb, var(--t1) 12%, transparent);
}
@media (min-width: 600px) { .modal { border-radius: 20px; box-shadow: 0 8px 40px color-mix(in srgb, var(--t1) 12%, transparent); } }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 50px;
}
.modal-match-header { text-align: center; margin-bottom: 24px; }
.modal-teams-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.modal-team { text-align: center; flex: 1; }
.modal-team .team-flag { font-size: 2.2rem; display: block; margin-bottom: 4px; }
.modal-team .team-name { font-size: 0.9rem; font-weight: 700; }
.modal-vs { font-size: 0.85rem; color: var(--text-muted); font-weight: 700; letter-spacing: 2px; }
.modal-match-meta { font-size: 0.8rem; color: var(--text-muted); }

.score-inputs { display: flex; align-items: flex-end; gap: 16px; justify-content: center; margin-bottom: 20px; }
.score-team { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; }
.score-team-name { font-weight: 700; font-size: 0.88rem; text-align: center; color: var(--text-muted); }
.score-team input {
  width: 80px;
  height: 80px;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  padding: 0;
  border-radius: 16px;
  background: var(--surface2);
  border: 2px solid var(--border);
  color: var(--t1);
  -moz-appearance: textfield;
}
.score-team input::-webkit-inner-spin-button,
.score-team input::-webkit-outer-spin-button { -webkit-appearance: none; }
.score-team input:focus { border-color: var(--primary); outline: none; }
.team-name { font-weight: 700; font-size: 0.85rem; text-align: center; }
.score-sep { font-size: 1.4rem; color: var(--text-muted); font-weight: 900; flex-shrink: 0; padding-bottom: 24px; }

.modal-locked-msg { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--text-muted); font-size: 0.9rem; padding: 16px 0; gap: 8px; }
.group-predictions { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.group-predictions h4 { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.prediction-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.prediction-row:last-child { border-bottom: none; }
.pred-score { font-weight: 800; font-family: monospace; color: var(--t1); text-align: right; min-width: 60px; }
.pred-points { color: var(--primary); font-weight: 700; font-size: 0.82rem; min-width: 40px; text-align: right; }

.prono-row-me td { font-weight: 700; }
.prono-row-me .standing-name { color: var(--acc); }

@media (max-width: 380px) {
  .standings-table { font-size: 0.72rem; }
  .standings-table thead th,
  .standings-table td { padding: 5px 4px; }
  .col-team { padding: 5px 6px 5px 6px !important; gap: 5px; }
  .standing-name { font-size: 0.72rem; }
  .standing-flag { font-size: 1rem; }
}
