:root {
  --bg: #08182b;
  --bg-2: #123154;
  --surface: rgba(255, 255, 255, 0.95);
  --surface-soft: rgba(255, 255, 255, 0.86);
  --text: #12233b;
  --muted: #4b6080;
  --primary: #00a6a6;
  --primary-2: #ff8a00;
  --danger: #d7263d;
  --ok: #2d9f5d;
  --radius: 16px;
  --shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 138, 0, 0.28), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(0, 166, 166, 0.3), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  min-height: 100vh;
}

h1,
h2,
h3 {
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(6, 17, 32, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.brand-kicker {
  display: block;
  color: #f5b96f;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
}

.brand-title {
  font-family: 'Bungee', sans-serif;
  font-size: 1.15rem;
  color: #fff;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.pill {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}

.container {
  width: min(1200px, 95%);
  margin: 1.2rem auto 2.4rem;
  display: grid;
  gap: 1rem;
}

.hero {
  color: #fff;
  background: linear-gradient(120deg, rgba(0, 166, 166, 0.3), rgba(255, 138, 0, 0.34));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.panel-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab-btn {
  border: 1px solid #b9c8df;
  background: #fff;
  color: #1f3253;
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.is-active {
  border-color: #00959a;
  background: linear-gradient(120deg, #00a6a6, #12c7c7);
  color: #06242f;
}

.tab-panel {
  display: none;
  gap: 1rem;
}

.tab-panel.is-active {
  display: grid;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 > .panel,
.grid-3 > .panel {
  min-width: 0;
}

.form-grid {
  display: grid;
  gap: 0.7rem;
}

.panel .form-grid .btn {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: normal;
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  color: #203252;
}

input,
select,
textarea,
button {
  font: inherit;
  min-width: 0;
}

input,
select,
textarea {
  border: 1px solid #d7deea;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  background: #fff;
}

.btn {
  border-radius: 10px;
  border: none;
  padding: 0.62rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(120deg, var(--primary), #12c7c7);
  color: #06242f;
}

.btn-outline {
  background: #fff;
  border: 1px solid #b9c8df;
  color: #1f3253;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.fil-rouge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-fil-rouge {
  background: linear-gradient(120deg, #d7263d, #ff6b6b);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.92rem;
  transition: filter 0.15s;
}

.btn-fil-rouge:hover {
  filter: brightness(1.1);
}

.fil-rouge-team-list {
  display: grid;
  gap: 0.4rem;
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.fil-rouge-team-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.fil-rouge-team-option:hover {
  background: rgba(0, 0, 0, 0.04);
}

.fil-rouge-team-option input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--danger);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #e7edf6;
}

th {
  color: #3a4f73;
  font-size: 0.92rem;
}

.muted {
  color: var(--muted);
}

.status {
  padding: 0.25rem 0.56rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-brouillon {
  background: #eceff4;
}

.status-ouvert,
.status-en_cours {
  background: #dbf6f2;
  color: #00574f;
}

.status-termine,
.status-archive {
  background: #ffdede;
  color: #862531;
}

.status-ouverte {
  background: #cfeedd;
  color: #0f4a2b;
}

.status-en_cloture {
  background: #ffe2b6;
  color: #714600;
}

.status-cloturee {
  background: #ffd4db;
  color: #6a1d2c;
}

.status-en_ecriture {
  background: #e3ebf7;
  color: #233b5e;
}

.status-envoyee_correction {
  background: #ffe8b8;
  color: #704300;
}

.status-en_cours_correction {
  background: #ffd9c2;
  color: #7f3000;
}

.status-corrigee {
  background: #cfeedd;
  color: #0f4a2b;
}

.status-non_soumise {
  background: #e8e8e8;
  color: #666;
}



.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inline-review-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.inline-review-form input {
  min-width: 120px;
}

.correction-table-panel {
  margin-top: 0.9rem;
}

.correction-submission-list {
  margin-bottom: 0.9rem;
}

.correction-submission-selected {
  background: #dbe9ff;
}

.correction-layout-view {
  display: none;
}

.correction-layout-view.is-active {
  display: block;
}

.correction-matrix-wrap th,
.correction-matrix-wrap td {
  text-align: center;
}

.correction-matrix-wrap th:first-child,
.correction-matrix-wrap td:first-child {
  text-align: left;
  white-space: nowrap;
}

.matrix-round-header {
  vertical-align: middle;
}

.matrix-round-header div {
  line-height: 1.3;
}

.status-sm {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
}

.matrix-status-btn {
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.15);
  font: inherit;
}
.matrix-status-btn:hover {
  filter: brightness(0.9);
}
.matrix-round-status-form {
  display: inline;
}

/* ── Popup overlay ─────────────────────────── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.popup-box {
  background: #fff;
  border-radius: 8px;
  padding: 2rem 2.5rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.popup-box p {
  margin: 0 0 1.2rem;
  font-size: 1.05rem;
  line-height: 1.4;
}
.popup-error {
  border-top: 4px solid #c0392b;
}
.popup-error p {
  color: #c0392b;
}
.popup-success {
  border-top: 4px solid #27ae60;
}
.popup-success p {
  color: #27ae60;
}
.popup-box .btn {
  padding: 0.5rem 2rem;
}

.matrix-cell-link {
  display: block;
  text-decoration: none;
  padding: 0.2rem;
  border-radius: 4px;
}
.matrix-cell-link:hover {
  background: rgba(0,0,0,0.06);
}
.matrix-cell-selected {
  outline: 2px solid #0066cc;
  background: rgba(0, 102, 204, 0.06);
}

.review-actions-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.correction-cell {
  vertical-align: top;
}

.correction-cell-content {
  display: grid;
  gap: 0.35rem;
}

.correction-expected-answer {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1565c0;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  margin-bottom: 0.3rem;
  display: inline-block;
  letter-spacing: 0.02em;
}

.correction-cell-answer {
  font-weight: 600;
  word-break: break-word;
}

.correction-cell-ok {
  background: #cfeedd;
  border-left: 4px solid #218b4f;
}

.correction-cell-ko {
  background: #ffd9df;
  border-left: 4px solid #b2253a;
}

.correction-cell-pending {
  background: #ffeec2;
  border-left: 4px solid #b77b00;
}

.inline-review-form-compact {
  margin: 0;
}

.btn-compact {
  min-width: 2.25rem;
  padding: 0.42rem 0.6rem;
  line-height: 1;
}

.participant-review-legend {
  margin-top: -0.2rem;
  margin-bottom: 0.7rem;
}

.participant-cell-legend {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-weight: 600;
}

.col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.adjustment-points.positive {
  color: #0a7a33;
  font-weight: 700;
}

.adjustment-points.negative {
  color: var(--danger);
  font-weight: 700;
}

.participant-cell-legend-ok {
  background: #cfeedd;
  color: #0f4a2b;
}

.participant-cell-legend-ko {
  background: #ffd9df;
  color: #5f1623;
}

.participant-cell-ok {
  border-color: #218b4f;
  background: #d6f0e2;
}

.participant-cell-ko {
  border-color: #b2253a;
  background: #ffe2e7;
}

/* Joker row selection */
.joker-row-selectable {
  cursor: pointer;
  transition: background 0.2s;
}
.joker-row-selectable:hover {
  background: rgba(255, 193, 7, 0.2) !important;
  outline: 2px solid #ffc107;
  outline-offset: -2px;
}

.chip {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: #e9f2ff;
  color: #23375b;
  font-size: 0.85rem;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #050505;
}

.auth-card {
  width: min(540px, 96%);
  border-radius: var(--radius);
  background: #1A1A1A;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
  padding: 1.1rem;
  text-align: center;
  border: 1px solid #2A2A2A;
  color: #FFFFFF;
}

.auth-card h1 {
  color: #FFFFFF;
}

.auth-card .muted {
  color: #B8B8B8;
}

.auth-card label {
  color: #B8B8B8;
}

.auth-card input {
  background: #111111;
  border: 1px solid #2A2A2A;
  color: #FFFFFF;
}

.auth-card input:focus {
  border-color: #F20D0D;
  outline: none;
}

.auth-card .btn-primary {
  background: #F20D0D;
  border: none;
  color: #FFFFFF;
}

.auth-card .btn-primary:hover {
  background: #8A0F0A;
}

.auth-card .credentials {
  color: #B8B8B8;
  border-top: 1px solid #2A2A2A;
  margin-top: 1rem;
  padding-top: 1rem;
}

.auth-logo {
  max-width: 160px;
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 12px;
}

.auth-card .credentials h3 {
  color: #FFFFFF;
}

.auth-card .credentials ul {
  list-style: none;
  padding: 0;
}

.auth-card .credentials li {
  color: #FFFFFF;
  font-family: monospace;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.auth-card .form-grid .btn {
  width: 100%;
}

.participant-public-link {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  text-align: center;
}

.alert {
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.7rem;
}

.alert-error {
  background: #ffe3e3;
  color: #742130;
}

.alert-success {
  background: #dff7e7;
  color: #185535;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 9998;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: min(460px, 92%);
  background: #fff;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.credentials {
  margin-top: 1rem;
  background: var(--surface-soft);
  border: 1px solid #d5e1f4;
  border-radius: 12px;
  padding: 0.85rem;
}

.credentials ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.public-screen {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  color: #fff;
  padding: 1.2rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 138, 0, 0.35), transparent 33%),
    radial-gradient(circle at 10% 30%, rgba(0, 166, 166, 0.34), transparent 30%),
    linear-gradient(140deg, #091a2f, #112c4a 58%, #133d63);
}

.public-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
}

.public-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.public-screen .btn-outline {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.public-kicker {
  margin: 0;
  color: #ffc07a;
  letter-spacing: 0.15em;
  font-size: 0.76rem;
}

.public-ranking-wrap {
  border-radius: 18px;
  padding: 0.7rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.16);
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.public-ranking th,
.public-ranking td {
  border-color: rgba(255, 255, 255, 0.12);
}

.public-ranking tbody tr:nth-child(1) {
  background: rgba(255, 179, 70, 0.2);
}

.public-ranking tbody tr:nth-child(2) {
  background: rgba(158, 213, 225, 0.2);
}

.public-ranking tbody tr:nth-child(3) {
  background: rgba(186, 152, 115, 0.2);
}

#public-round-status-panel {
  margin-top: 1rem;
}

#public-round-status-panel h2 {
  color: rgba(255, 255, 255, 0.85);
}

#public-round-status-table th {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

#public-round-status-table td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

#public-round-status-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 900px) {
  .grid-3,
  .grid-2,
  .form-grid-4,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .public-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Mobile participant view ────────────────── */
@media (max-width: 600px) {
  .container {
    padding: 0.5rem;
  }

  .panel {
    padding: 0.75rem;
  }

  .hero h1 {
    font-size: 1.2rem;
  }

  .hero p {
    font-size: 0.85rem;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
  }

  .table-wrap table {
    font-size: 0.8rem;
    min-width: 400px;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 0.4rem 0.3rem;
  }

  .table-wrap input {
    width: 100%;
    min-width: 60px;
    font-size: 0.85rem;
    padding: 0.4rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    text-align: center;
  }

  .btn {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }

  select {
    font-size: 0.9rem;
  }

  .alert {
    font-size: 0.85rem;
    padding: 0.6rem;
  }
}

/* ── Presenter tab ─────────────────────────── */
.presenter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.btn-presenter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 140px;
}

.btn-presenter:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-presenter.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 166, 166, 0.25);
}

.presenter-btn-icon {
  font-size: 1.6rem;
}

.btn-presenter-filrouge { background: linear-gradient(135deg, #d7263d, #ff6b6b); color: #fff; }
.btn-presenter-ranking { background: linear-gradient(135deg, #1e88e5, #42a5f5); color: #fff; }
.btn-presenter-round { background: linear-gradient(135deg, #7b1fa2, #ba68c8); color: #fff; }
.btn-presenter-podium { background: linear-gradient(135deg, #f9a825, #ffcc02); color: #3a2e00; }
.btn-presenter-progress { background: linear-gradient(135deg, #00838f, #26c6da); color: #fff; }
.btn-presenter-podium-manual { background: linear-gradient(135deg, #e65100, #ff9800); color: #fff; }
.btn-presenter-next { background: linear-gradient(135deg, #00c853, #69f0ae); color: #1b3a1b; font-size: 1.1rem; margin-top: 0.5rem; padding: 0.6rem 2rem; border-radius: 12px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.btn-presenter-next:hover { filter: brightness(1.1); }
.btn-presenter-next.hidden { display: none; }
.btn-presenter-prev { background: linear-gradient(135deg, #ff7043, #ffab91); color: #3e2723; font-size: 1.1rem; margin-top: 0.5rem; padding: 0.6rem 2rem; border-radius: 12px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.btn-presenter-prev:hover { filter: brightness(1.1); }

.presenter-progress-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
  max-width: 600px;
}

.presenter-progress-bubbles .progress-bubble {
  width: 44px;
  height: 44px;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  border-width: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(0, 0, 0, 0.7);
}

.presenter-progress-bubbles .progress-bubble:hover {
  filter: brightness(1.2);
  transform: scale(1.1);
}

.presenter-progress-bubbles .progress-bubble.bubble-done::after {
  font-size: 1.4rem;
}

.presenter-progress-nav {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.presenter-round-picker {
  margin: 0.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.presenter-round-picker.hidden {
  display: none;
}

#presenter-status {
  margin-top: 0.5rem;
  font-style: italic;
}

/* ── Public view switching ─────────────────── */
.public-view {
  display: none;
}

.public-view-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Countdown screen (clôture manche) ───── */
.countdown-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  animation: countdown-fadeIn 0.4s ease;
}

.countdown-kicker {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.5rem;
}

.countdown-round-name {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 2rem;
  text-align: center;
}

.countdown-timer {
  font-size: clamp(14rem, 35vw, 28rem);
  font-weight: 900;
  color: #fff;
  line-height: 0.9;
  text-shadow: 0 0 60px rgba(255, 100, 100, 0.7), 0 0 120px rgba(255, 50, 50, 0.4);
  animation: countdown-pulse 1s ease-in-out infinite;
  font-variant-numeric: tabular-nums;
}

.countdown-sub {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 2rem 0 0;
}

@keyframes countdown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes countdown-fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Fil rouge screen ──────────────────────── */
.fil-rouge-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  animation: filRouge-fadeIn 0.6s ease;
}

.fil-rouge-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff4444, #b71c1c);
  box-shadow: 0 0 60px rgba(255, 50, 50, 0.6), 0 0 120px rgba(255, 50, 50, 0.3);
  animation: filRouge-pulse 1.8s ease-in-out infinite;
  margin-bottom: 2rem;
}

.fil-rouge-title {
  font-size: 5rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 40px rgba(255, 50, 50, 0.7);
  letter-spacing: 0.15em;
}

@keyframes filRouge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 60px rgba(255, 50, 50, 0.6), 0 0 120px rgba(255, 50, 50, 0.3); }
  50% { transform: scale(1.12); box-shadow: 0 0 80px rgba(255, 50, 50, 0.8), 0 0 160px rgba(255, 50, 50, 0.4); }
}

@keyframes filRouge-fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Progress / Suivi screen ────────────────── */
.progress-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 2vh 2vw;
}

.progress-round-title {
  font-size: 4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.08em;
  margin-bottom: 3rem;
  text-shadow: 0 0 30px rgba(100, 200, 255, 0.4);
  text-align: center;
}

.progress-bubbles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  max-width: 1200px;
}

.progress-bubble {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  border: 4px solid rgba(255, 255, 255, 0.15);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.progress-bubble.bubble-done {
  background: rgba(255, 60, 60, 0.15);
  border-color: #e53935;
  color: #e53935;
}

.progress-bubble.bubble-done::after {
  content: '✕';
  position: absolute;
  font-size: 2.8rem;
  font-weight: 900;
  color: #e53935;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.7;
}

.progress-bubble.bubble-done > span {
  opacity: 0.4;
}

.progress-bubble.bubble-current {
  background: rgba(76, 175, 80, 0.15);
  border-color: #4caf50;
  color: #fff;
  box-shadow: 0 0 25px rgba(76, 175, 80, 0.5), 0 0 60px rgba(76, 175, 80, 0.2);
  transform: scale(1.15);
  animation: bubble-pulse 2s ease-in-out infinite;
}

@keyframes bubble-pulse {
  0%, 100% { box-shadow: 0 0 25px rgba(76, 175, 80, 0.5), 0 0 60px rgba(76, 175, 80, 0.2); }
  50% { box-shadow: 0 0 35px rgba(76, 175, 80, 0.7), 0 0 80px rgba(76, 175, 80, 0.3); }
}

/* ── Podium screen ─────────────────────────── */
.podium-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-height: 0;
  padding: 2vh 2vw;
  overflow: hidden;
}

.podium-main-title {
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.12em;
  margin-bottom: 1vh;
  text-shadow: 0 0 40px rgba(255, 200, 0, 0.6);
  flex-shrink: 0;
}

.podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(1rem, 3vw, 3.5rem);
  width: 100%;
  max-width: 1400px;
  flex: 1;
  min-height: 0;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(60px);
}

.podium-place.podium-reveal {
  animation: podium-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.podium-team-name {
  font-size: clamp(1.2rem, 3.5vw, 3.8rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.4vh;
  text-align: center;
  max-width: 500px;
  word-wrap: break-word;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.6);
  line-height: 1.1;
}

.podium-score {
  font-size: clamp(1rem, 2.5vw, 2.8rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5vh;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.podium-block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(180px, 22vw, 340px);
  border-radius: 18px 18px 0 0;
  font-size: clamp(3rem, 5vw, 5.5rem);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.9);
}

.podium-block-1 {
  height: clamp(160px, 38vh, 380px);
  background: linear-gradient(180deg, #ffd700, #c49a00);
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

.podium-block-2 {
  height: clamp(120px, 28vh, 280px);
  background: linear-gradient(180deg, #c0c0c0, #8a8a8a);
  box-shadow: 0 0 40px rgba(192, 192, 192, 0.4);
}

.podium-block-3 {
  height: clamp(80px, 20vh, 200px);
  background: linear-gradient(180deg, #cd7f32, #8b5a2b);
  box-shadow: 0 0 35px rgba(205, 127, 50, 0.4);
}

@keyframes podium-rise {
  from { opacity: 0; transform: translateY(60px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   Pagination
   ══════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.pagination-info {
  font-size: 0.9rem;
  color: var(--text-secondary, #666);
}
.btn-sm {
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
  border: none;
}
.btn-danger:hover {
  background: #b02a37;
}

/* ══════ Team detail modal ══════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-content {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  position: relative;
  width: min(500px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
}
.modal-close:hover {
  color: #000;
}

/* Team detail modal — compact, no-scroll layout */
.team-detail-card {
  max-width: 600px;
  padding: 1.2rem 1.5rem;
}
.team-detail-body {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}
.team-detail-info {
  flex: 1;
  min-width: 0;
}
.team-detail-info p {
  margin: 4px 0;
  font-size: 0.9em;
  line-height: 1.4;
}
.team-detail-qr {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.team-detail-qr img {
  width: 180px;
  height: 180px;
}
@media (max-width: 550px) {
  .team-detail-body {
    flex-direction: column;
    align-items: center;
  }
  .team-detail-qr img {
    width: 150px;
    height: 150px;
  }
}

.team-row-clickable:hover {
  background: var(--surface-soft, #f0f4ff);
}

/* ══════════════════════════════════════════════════════════════
   Toast notifications
   ══════════════════════════════════════════════════════════════ */
.toast-notification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.toast-notification.toast-visible {
  opacity: 1;
  transform: translateY(0);
}
.toast-info {
  background: #1a3a5c;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.toast-public {
  font-size: 1.3rem;
  padding: 1rem 2rem;
  bottom: 2.5rem;
  right: 2.5rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 200, 0, 0.4);
}

/* ── Joker Used Overlay (public screen) ── */
#joker-used-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  transition: opacity 0.5s ease;
}
#joker-used-overlay.joker-overlay-visible {
  opacity: 1;
}
.joker-overlay-content {
  text-align: center;
  color: #fff;
  animation: jokerPulse 2s ease-in-out infinite;
}
.joker-overlay-icon {
  font-size: 6rem;
  margin-bottom: 0.5rem;
  animation: jokerBounce 1s ease-out;
}
.joker-overlay-title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #ffc107;
  text-shadow: 0 0 30px rgba(255, 193, 7, 0.6);
  margin-bottom: 1rem;
}
.joker-overlay-team {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.joker-overlay-detail {
  font-size: 1.5rem;
  opacity: 0.8;
}
@keyframes jokerBounce {
  0% { transform: scale(0) rotate(-20deg); }
  50% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes jokerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ══════════════════════════════════════════════════════════════
   Thèmes visuels — Écran public
   Sélection via ?theme=festif|corporate|neon|sobre (défaut)
   ══════════════════════════════════════════════════════════════ */

/* Thème Festif */
.public-screen.theme-festif {
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 0, 128, 0.3), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(255, 200, 0, 0.35), transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(0, 200, 255, 0.2), transparent 50%),
    linear-gradient(135deg, #1a0533, #2d1b69 50%, #0d1b3e);
}
.public-screen.theme-festif .public-kicker { color: #ff6ec7; }
.public-screen.theme-festif .public-ranking-wrap {
  border-color: rgba(255, 110, 199, 0.3);
  background: rgba(255, 255, 255, 0.06);
}
.public-screen.theme-festif .podium-block-1 {
  background: linear-gradient(180deg, #ff6ec7, #d946a8);
  box-shadow: 0 0 60px rgba(255, 110, 199, 0.5);
}
.public-screen.theme-festif .podium-main-title {
  text-shadow: 0 0 40px rgba(255, 110, 199, 0.7);
}

/* Thème Corporate */
.public-screen.theme-corporate {
  background: linear-gradient(160deg, #0f2027, #203a43 50%, #2c5364);
}
.public-screen.theme-corporate .public-kicker {
  color: #7ec8e3;
  letter-spacing: 0.2em;
}
.public-screen.theme-corporate .public-ranking-wrap {
  border-color: rgba(126, 200, 227, 0.2);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.public-screen.theme-corporate .podium-block-1 {
  background: linear-gradient(180deg, #3a7bd5, #2563a0);
  box-shadow: 0 0 30px rgba(58, 123, 213, 0.4);
}
.public-screen.theme-corporate .podium-main-title {
  font-family: inherit;
  letter-spacing: 0.08em;
  text-shadow: 0 0 20px rgba(126, 200, 227, 0.5);
}

/* Thème Néon */
.public-screen.theme-neon {
  background: #0a0a0a;
}
.public-screen.theme-neon .public-kicker {
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
}
.public-screen.theme-neon .public-ranking-wrap {
  border: 1px solid rgba(0, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
  background: rgba(0, 255, 255, 0.03);
}
.public-screen.theme-neon .public-ranking tbody tr:nth-child(1) {
  background: rgba(255, 0, 128, 0.15);
  box-shadow: inset 0 0 20px rgba(255, 0, 128, 0.1);
}
.public-screen.theme-neon .public-ranking tbody tr:nth-child(2) {
  background: rgba(0, 255, 255, 0.1);
}
.public-screen.theme-neon .public-ranking tbody tr:nth-child(3) {
  background: rgba(128, 0, 255, 0.1);
}
.public-screen.theme-neon .podium-block-1 {
  background: linear-gradient(180deg, #ff0080, #cc0066);
  box-shadow: 0 0 60px rgba(255, 0, 128, 0.6), 0 0 120px rgba(255, 0, 128, 0.3);
}
.public-screen.theme-neon .podium-block-2 {
  background: linear-gradient(180deg, #0ff, #0aa);
  box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
}
.public-screen.theme-neon .podium-block-3 {
  background: linear-gradient(180deg, #8000ff, #5500aa);
  box-shadow: 0 0 40px rgba(128, 0, 255, 0.5);
}
.public-screen.theme-neon .podium-main-title {
  text-shadow: 0 0 30px #ff0080, 0 0 60px rgba(255, 0, 128, 0.4);
}

/* ══════════════════════════════════════════════════════════════
   Barres de score animées — Classement public
   ══════════════════════════════════════════════════════════════ */
.public-ranking td.score-bar-cell {
  position: relative;
  overflow: hidden;
}
.public-ranking .score-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(255, 200, 0, 0.25), rgba(255, 200, 0, 0.08));
  border-radius: 0 8px 8px 0;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}
.public-ranking .score-value {
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════════
   Confettis podium
   ══════════════════════════════════════════════════════════════ */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}
