/* Ergonomie pronostics — inspirée plateformes type Pronostic Games */

.pronostic-flow {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Étapes */
.steps {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--c-muted);
  border-radius: var(--radius);
  border: 1px solid var(--c-highlight-high);
}

.steps__item {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-accent);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.steps__item:hover {
  background: rgba(255, 255, 255, 0.7);
}

.steps__item--active {
  background: var(--c-background);
  color: var(--c-primary);
  box-shadow: var(--shadow);
}

.steps__item--done {
  color: var(--c-pitch-light);
}

.steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--c-highlight-high);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.steps__item--active .steps__num {
  background: var(--c-primary);
  color: #fff;
}

.steps__item--done .steps__num {
  background: var(--c-pitch-light);
  color: #fff;
}

/* Grille principale */
.pronostic-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 960px) {
  .pronostic-layout {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }

  .pronostic-layout--bet-open {
    grid-template-columns: 260px 1fr 340px;
  }
}

.panel {
  background: var(--c-background);
  border: 1px solid var(--c-highlight-high);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.panel__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel--profile {
  border-top: 3px solid var(--c-secondary);
}

.panel--matches {
  border-top: 3px solid var(--c-pitch-light);
}

.panel--bet {
  border-top: 3px solid var(--c-gold-dark);
}

@media (max-width: 959px) {
  .panel--bet {
    position: sticky;
    bottom: 0;
    z-index: 20;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  }
}

/* Recherche + filtres poules */
.match-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.match-search {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  font: inherit;
  border: 1px solid var(--c-highlight);
  border-radius: 999px;
  background: var(--c-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%234d4d4d' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.1a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 0.85rem center;
}

.match-search:focus {
  outline: 2px solid var(--c-secondary);
  border-color: var(--c-secondary);
  background-color: #fff;
}

.pool-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pool-tab {
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--c-highlight);
  border-radius: 999px;
  background: var(--c-background);
  color: var(--c-accent);
  cursor: pointer;
  transition: all 0.15s;
}

.pool-tab:hover {
  border-color: var(--c-pitch-light);
  color: var(--c-pitch);
}

.pool-tab--active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

/* Cartes match */
.match-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: min(520px, 60vh);
  overflow-y: auto;
  padding-right: 0.25rem;
  scroll-behavior: smooth;
}

.match-grid-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--c-accent);
  padding: 0.5rem 0.75rem;
  background: var(--c-muted);
  border-radius: var(--radius);
}

.match-group__title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-pitch);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.match-group__count {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--c-accent);
  background: var(--c-highlight-high);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.match-group__list {
  display: grid;
  gap: 0.65rem;
}

.match-card__locked {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.62rem;
  font-style: italic;
  color: var(--c-accent);
}

.match-grid::-webkit-scrollbar {
  width: 6px;
}

.match-grid::-webkit-scrollbar-thumb {
  background: var(--c-highlight);
  border-radius: 3px;
}

.match-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid var(--c-highlight-high);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  width: 100%;
}

.match-card:hover:not(:disabled) {
  border-color: var(--c-secondary);
  box-shadow: var(--shadow);
}

.match-card--selected {
  border-color: var(--c-primary);
  background: var(--c-pitch-pale);
  box-shadow: var(--shadow-football);
}

.match-card--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.match-card--has-bet::after {
  content: "✓";
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--c-pitch-light);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-card {
  position: relative;
}

.match-card__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.match-card__team--away {
  text-align: center;
}

.match-card__team .team-row {
  flex-direction: column;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-primary);
}

.match-card__meta {
  text-align: center;
  font-size: 0.68rem;
  color: var(--c-accent);
  line-height: 1.3;
}

.match-card__vs {
  font-weight: 800;
  font-size: 0.7rem;
  color: var(--c-pitch-light);
}

.match-card__date {
  display: block;
  font-weight: 600;
}

/* Drapeaux */
.flag-wrap {
  display: inline-flex;
  line-height: 0;
}

.flag-img {
  width: 36px;
  height: 27px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.flag-img--lg {
  width: 56px;
  height: 42px;
}

.flag-img--sm {
  width: 28px;
  height: 21px;
}

.flag-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.flag-emoji--lg {
  font-size: 2.75rem;
}

.flag-emoji--sm {
  font-size: 1.35rem;
}

.flag-emoji--fallback[hidden] {
  display: none;
}

.team-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.team-row__name {
  font-weight: 600;
}

/* Panneau pronostic (face-à-face) */
.pronostic-panel__empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--c-accent);
}

.pronostic-panel__empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.match-faceoff {
  text-align: center;
  margin-bottom: 1.25rem;
}

.match-faceoff__meta {
  font-size: 0.8rem;
  color: var(--c-accent);
  margin: 0 0 1rem;
}

.match-faceoff__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.match-faceoff__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.match-faceoff__team .team-row {
  flex-direction: column;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-primary);
}

.match-faceoff__score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-pitch);
  background: var(--c-gold);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--c-pitch-light);
}

/* Choix gagnant — cartes cliquables */
.winner-pick {
  margin-bottom: 1.25rem;
}

.winner-pick__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-accent);
  margin-bottom: 0.5rem;
}

.winner-pick__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

@media (min-width: 400px) {
  .winner-pick__options {
    grid-template-columns: 1fr auto 1fr;
  }
}

.winner-pick__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem;
  border: 2px solid var(--c-highlight-high);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-primary);
  transition: all 0.15s;
}

.winner-pick__btn:hover {
  border-color: var(--c-secondary);
  background: var(--c-pitch-pale);
}

.winner-pick__btn--selected {
  border-color: var(--c-pitch-light);
  background: linear-gradient(180deg, var(--c-pitch-pale), #fff);
  box-shadow: 0 0 0 2px var(--c-pitch-light);
}

.winner-pick__btn--draw {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  padding: 0.6rem;
}

@media (min-width: 400px) {
  .winner-pick__btn--draw {
    grid-column: auto;
  }
}

.winner-pick__btn .team-row {
  flex-direction: column;
  font-size: 0.75rem;
}

/* Stepper buts */
.stepper {
  display: flex;
  align-items: stretch;
  max-width: 200px;
}

.stepper__btn {
  width: 2.75rem;
  border: 1px solid var(--c-highlight);
  background: var(--c-muted);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-primary);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.stepper__btn:hover {
  background: var(--c-pitch-pale);
}

.stepper__btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.stepper__btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.stepper__input {
  flex: 1;
  min-width: 3rem;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  border-top: 1px solid var(--c-highlight);
  border-bottom: 1px solid var(--c-highlight);
  border-left: none;
  border-right: none;
  border-radius: 0;
  padding: 0.5rem;
  color: var(--c-primary);
}

.stepper__input:focus {
  outline: none;
  background: var(--c-pitch-pale);
}

.field-block {
  margin-bottom: 1rem;
}

.field-block__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-accent);
  margin-bottom: 0.5rem;
}

/* Cartes pronos avec drapeaux */
.bet-card__faceoff {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: var(--c-pitch-pale);
  border-radius: var(--radius);
}

.bet-card__faceoff .team-row {
  font-weight: 700;
  color: var(--c-primary);
}

.bet-card__faceoff-vs {
  font-weight: 800;
  color: var(--c-pitch-light);
  font-size: 0.85rem;
}

.bet-card__winner-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.match-grid-empty--loading {
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}

.match-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--c-accent);
}

/* Auth */
.btn--demo {
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow-football);
  transition: transform 0.1s, box-shadow 0.15s;
}

.btn--demo:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(27, 94, 32, 0.35);
}

.btn--demo:disabled {
  opacity: 0.7;
  cursor: wait;
}

.auth-demo-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--c-accent);
  margin: 0 0 1.25rem;
}

.auth-help {
  background: #e3f2fd;
  border: 1px solid var(--c-secondary);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--c-text);
}

.auth-help ol {
  margin: 0.5rem 0 0.5rem 1.1rem;
  padding: 0;
}

.auth-help__demo {
  margin: 0.65rem 0 0;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border-radius: var(--radius);
  border: 1px dashed var(--c-secondary);
}

.auth-help code {
  background: var(--c-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 700;
}

.auth-switch-hint {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  text-align: center;
}

.auth-switch-hint a {
  font-weight: 700;
  color: var(--c-primary);
}

.auth-screen {
  background: var(--c-pitch-pale);
}

.auth-screen__inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.auth-card h2 {
  margin: 0 0 0.5rem;
  color: var(--c-primary);
}

.auth-card__intro {
  color: var(--c-accent);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.offline-banner {
  display: none;
  background: #2e7d32;
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.4;
}

html.is-offline-mode .offline-banner {
  display: block;
}

.auth-form--hidden {
  display: none !important;
}

.auth-success {
  margin-top: 0.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #e8f5e9 0%, #f1f8e9 100%);
  border: 2px solid #43a047;
}

.auth-success__message {
  margin: 0 0 1rem;
  font-weight: 600;
  color: #2e7d32;
}

.auth-success__label {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-success__password {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--c-primary);
  user-select: all;
}

.auth-success__hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--c-accent);
  line-height: 1.5;
}

.auth-success__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-forgot-hint {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--c-accent);
  text-align: center;
}

.auth-forgot-hint a {
  font-weight: 700;
  color: var(--c-primary);
}

.auth-forgot-intro {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--c-accent);
}

.auth-site-hint {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  background: #e8f0fa;
  border-radius: 8px;
  color: #00519e;
}

.auth-gmail-hint {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  background: #fff8e1;
  border-radius: 8px;
  border: 1px solid #ffb74d;
  color: #5d4037;
}

body.mode-auth .site-nav a:not(.site-header__brand) {
  pointer-events: none;
  opacity: 0.45;
}

body.mode-auth #header-user {
  display: none !important;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  padding: 0.65rem 0.5rem;
  font: inherit;
  font-weight: 600;
  border: 2px solid var(--c-highlight);
  background: var(--c-muted);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  z-index: 2;
  min-height: 44px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.auth-tab:hover:not(.auth-tab--active) {
  border-color: var(--c-secondary);
  background: #e3f2fd;
}

.auth-tab--active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

.auth-form .form-grid {
  margin-bottom: 1rem;
}

.rgpd-consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.85rem;
  margin: 1rem 0;
  cursor: pointer;
}

.rgpd-consent input {
  width: auto;
  margin-top: 0.2rem;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-primary);
}

.btn--small {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn--danger {
  color: var(--c-error-text);
  border-color: var(--c-error-text);
}

.card--warn {
  border-left: 4px solid var(--c-gold-dark);
  margin-bottom: 1rem;
}

.account-readonly p {
  margin: 0.25rem 0;
}

.rgpd-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Scores */
.scores-summary {
  margin-bottom: 1.5rem;
}

.scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.scores-card {
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--c-highlight-high);
}

.scores-card__value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--c-primary);
}

.scores-card__label {
  font-size: 0.75rem;
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scores-card--won .scores-card__value {
  color: var(--c-pitch-light);
}

.scores-card--lost .scores-card__value {
  color: var(--c-error-text);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge--won {
  background: var(--c-message);
  color: var(--c-success);
}

.badge--lost {
  background: #ffebee;
  color: var(--c-error-text);
}

.badge--pending {
  background: var(--c-muted);
  color: var(--c-accent);
}

.bet-card--won {
  border-left-color: var(--c-pitch-light);
}

.bet-card--lost {
  border-left-color: var(--c-error-text);
}

.bet-card__result {
  font-size: 0.85rem;
  color: var(--c-accent);
  margin: 0 0 0.5rem;
}

.bet-card__pred-score {
  grid-column: 1 / -1;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.bet-card__pred-score dd {
  margin: 0;
}

.bet-card__scoreline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--c-highlight);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.bet-card__score-col {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.bet-card__score-col--home {
  justify-content: flex-end;
  text-align: right;
}

.bet-card__score-col--away {
  justify-content: flex-start;
  text-align: left;
}

.bet-card__score-col--nums {
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  background: var(--c-pitch-pale);
  border-radius: 8px;
}

.bet-card__score-flag {
  flex-shrink: 0;
  line-height: 0;
}

.bet-card__score-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
  color: var(--c-text);
  word-break: break-word;
}

.bet-card__score-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1;
  min-width: 1.1rem;
  text-align: center;
}

.bet-card__score-sep {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-accent);
  opacity: 0.7;
}

.bet-card__score-fallback {
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .bet-card__scoreline {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
  }

  .bet-card__score-col--home,
  .bet-card__score-col--away {
    justify-content: center;
    text-align: center;
  }

  .bet-card__score-col--nums {
    order: -1;
  }
}
