#puzzelGame {
  border: 0;
  outline: none;
  border-radius: 8px;
}

/* GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 30px;
  padding: 30px;
}

.dashboard-card {
  grid-column: span 4;
  background: white;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s ease;

  /* ALIGNEMENT INTERNE */
  display: flex;
  flex-direction: column;
}

.games-card {
  grid-column: span 8;
}

.podium-card {
  grid-column: span 4;
}

.dashboard-card:hover {
  transform: translateY(-6px);
}

.card-accent {
  height: 10px;
}

.card-content {
  padding: 24px;

  /* IMPORTANT */
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.6em;
  font-weight: bold;
  margin-bottom: 10px;
  color: #222;
}

.card-subtitle {
  font-size: 1.1em;
  color: #555;
  margin-bottom: 20px;
}

/* =========================
   ALIGNEMENT DES BLOCS
========================= */

.card-body-row {
  display: flex;
  align-items: stretch;
  gap: 18px;

  /* permet aux boutons de s’aligner */
  flex: 1;
}

.card-text {
  flex: 1;
  min-width: 0;

  display: flex;
  flex-direction: column;
}

.card-text .card-subtitle {
  flex: 1;
}

/* SVG ALIGNÉS */
.card-illustration {
  flex: 0 0 90px;
  width: 90px;
  height: 90px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #2b2f4a;
  opacity: 0.75;
}

.card-illustration svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================
   BOUTONS ALIGNÉS
========================= */

.card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: auto;

  min-height: 48px;

  padding: 12px 20px;
  background: linear-gradient(135deg, #2b2f4a, #1f2235);
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.16);
}

.card-button:hover {
  background: linear-gradient(135deg, #3a3f66, #2b2f4a);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

/* WEEK GRID */
.week-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 10px;
}

/* DAY BUTTON */
.day-button {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  column-gap: 10px;
  min-height: 60px;
  padding: 14px 14px 26px;
  background: linear-gradient(135deg, #2b2f4a, #1f2235);
  transition: all 0.25s ease;
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
}

.day-button:hover {
  background: linear-gradient(135deg, #3a3f66, #2b2f4a);
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

/* ICON */
.day-button .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.day-button .icon svg {
  width: 32px;
  height: 32px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* LABEL */
.day-label {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.6;
}

/* PROGRESS BAR */
.week-buttons .day-button .day-progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.25);
  overflow: hidden;
}

.week-buttons .day-button .day-progress-fill {
  display: block;
  width: var(--puzzel-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff4d4d, #ffa500, #4cd964);
  transition: width 0.4s ease;
}

/* DISABLED */
.day-button[data-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.6);
}

.day-button[data-disabled="true"]::after {
  content: "🔒";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 14px;
}

/* LOGIN MESSAGE */
.puzzel-message {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-weight: 600;
}

.puzzel-message-warning {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
}

.puzzel-message-danger {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.puzzel-message-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.login-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

/* PODIUM */
.puzzel-podium-card {
  background: linear-gradient(135deg, #2b2f4a, #1f2235);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.puzzel-podium-card p {
  text-align: center;
}

.podium-placeholder{
  text-align: center;
  padding: 8px;
}

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

.puzzel-podium-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,.14);
  font-size: 20px;
}

.puzzel-podium-item:first-child {
  border-top: 0;
}

.puzzel-podium-item:nth-child(1) {
  background: linear-gradient(90deg, rgba(255,215,0,.2), rgba(255,215,0,.05));
}

.puzzel-podium-item:nth-child(2) {
  background: linear-gradient(90deg, rgba(192,192,192,.2), rgba(192,192,192,.05));
}

.puzzel-podium-item:nth-child(3) {
  background: linear-gradient(90deg, rgba(205,127,50,.2), rgba(205,127,50,.05));
}

.puzzel-podium-rank {
  font-weight: 800;
  min-width: 70px;
}

.puzzel-podium-item:nth-child(1) .puzzel-podium-rank::before {
  content: "🥇 ";
}

.puzzel-podium-item:nth-child(2) .puzzel-podium-rank::before {
  content: "🥈 ";
}

.puzzel-podium-item:nth-child(3) .puzzel-podium-rank::before {
  content: "🥉 ";
}

.puzzel-podium-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.puzzel-podium-score {
  font-weight: 800;
  color: #ffd86b;
}

/* TIMER */
.quiz-timer {
  margin-bottom: 16px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2b2f4a, #1f2235);
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.14);
  box-sizing: border-box;
}

.quiz-timer-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.72);
  margin-bottom: 10px;
}

.quiz-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  color: #ffd86b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  box-sizing: border-box;
}

.quiz-countdown.is-live {
  color: #4cd964;
  animation: pulseLive 1.2s infinite;
}

@keyframes pulseLive {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(76,217,100,0);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 24px rgba(76,217,100,.35);
  }
}

@media (max-width: 640px) {
  .quiz-timer {
    padding: 16px;
  }

  .quiz-countdown {
    min-width: 0;
    width: 100%;
  }
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .dashboard-card,
  .games-card,
  .podium-card {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {

  .dashboard-grid {
    padding: 18px;
    gap: 22px;
  }

  .week-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-content {
    padding: 20px;
  }

  .card-title {
    font-size: 1.35em;
  }

  .card-subtitle {
    font-size: 1em;
  }

  .puzzel-podium-item {
    font-size: 17px;
    padding: 14px;
  }

  .card-body-row {
    align-items: flex-start;
  }

  .card-illustration {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
  }

  .week-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .day-button {
    min-width: 0;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 6px;
    padding: 12px 10px 24px;
  }

  .day-label {
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .day-button .icon {
    width: 28px;
    height: 28px;
  }

  .day-button .icon svg {
    width: 28px;
    height: 28px;
  }
}
