/* 
 * YourLucky.click - Dare Game Stylesheet
 * Version complète avec corrections cosmétiques
 */

@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');

/* Reset et styles de base */
*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, h4, p, ul, li {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  /* The home page mood: white with soft violet / blue light */
  background: radial-gradient(1100px 520px at 0% 0%, rgba(201, 143, 243, 0.12), transparent 70%),
    radial-gradient(900px 480px at 100% 0%, rgba(127, 211, 224, 0.12), transparent 70%),
    var(--bg-soft);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); font-weight: 400; line-height: 1.2; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--violet-mid); outline-offset: 3px; }

/* Styles d'état du jeu */
body.game-setup {
  overflow: hidden;
}

body.game-started {
  padding-bottom: 2rem;
}

/* Styles de boutons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 8px 20px rgba(157, 98, 180, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(157, 98, 180, 0.32);
}

.btn-secondary {
  background-color: #fff;
  color: var(--violet);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--violet-mid);
}

/* Gold: the special things (special level) */
.btn-warning {
  background: var(--gold-gradient);
  color: #5a3d0c;
  box-shadow: 0 8px 20px rgba(185, 132, 39, 0.25);
}

.btn-warning:hover {
  transform: translateY(-1px);
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(43, 40, 56, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 22px;
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(43, 40, 56, 0.3);
  position: relative;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.close-modal:hover {
  color: var(--ink);
  background: var(--violet-soft);
}

.modal-step {
  margin-bottom: 1rem;
}

/* Message d'instruction (choisir au moins 3) en bleu pâle */
#step-dares .description {
  background: rgba(153, 216, 225, 0.15);
  border: 1px solid rgba(153, 216, 225, 0.35);
  color: var(--blue);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

/* Inputs et formulaires */

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0 1rem;
  border: 1px solid #ddd9e5;
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: var(--violet-mid);
  box-shadow: 0 0 0 3px var(--violet-soft);
}

.form-select {
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #ddd9e5;
  border-radius: 10px;
  background-color: #fff;
  color: var(--ink);
  width: 100%;
  max-width: 300px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg width='10' height='7' viewBox='0 0 10 7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23333' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 7px;
}

.form-select:focus {
  border-color: var(--violet-mid);
  outline: none;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête du jeu: brand and current game on a bar, the player's buttons below */
/* The home page hero photo (wheel, cards, dice) across the full width: same white veil on the right, melting into the page at the bottom */
.game-header {
  padding: 0.9rem 1rem 2.4rem;
  text-align: center;
  margin-bottom: 0;
  background:
    linear-gradient(to bottom, rgba(250, 249, 252, 0) 50%, var(--bg-soft)),
    linear-gradient(to right, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.55) 62%, rgba(255, 255, 255, 0.75) 100%),
    url('/images/hero.jpg') left 50% / cover no-repeat,
    var(--bg-soft);
}
@media (max-width: 900px) {
  .game-header {
    background:
      linear-gradient(to bottom, rgba(250, 249, 252, 0) 50%, var(--bg-soft)),
      url('/images/hero-900.jpg') 20% 50% / cover no-repeat,
      var(--bg-soft);
  }
}
.game-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto 0.9rem;
}
.game-brand { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.5rem 0.3rem 0.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); color: var(--ink); font-size: 1.1rem; }
.game-brand img { width: 30px; height: 30px; }
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 0.95rem;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .game-brand .beta-badge { display: none; }
}

/* Private beta badge (betaBadge() in includes/dare_functions.php) */
.beta-badge {
  display: inline-block;
  vertical-align: middle;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #f4e9f6;
  color: #a35bb8;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  -webkit-text-fill-color: #a35bb8; /* inside gradient titles */
  text-shadow: none;
  white-space: nowrap;
  cursor: help;
}
.game-header { position: relative; }
.game-header > .beta-badge { position: absolute; top: 0.6rem; left: 0.6rem; }
/* Header buttons: same height whatever their content (profile box with a title, emojis) */
.player-info > .player-box,
.player-info > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.2;
}
.player-info > .player-box h3 { margin: 0; line-height: 1.2; }

/* Special level modal: read-only cards, the list scrolls, the button stays visible */
.special-modal {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}
.special-modal h2 { padding-right: 2rem; }
.special-list { flex: 1; min-height: 0; overflow-y: auto; margin-top: 0.75rem; padding-right: 0.25rem; }
.special-list > * { flex-shrink: 0; }
.special-list .special-choice { cursor: default; }
.special-list .special-choice:hover { transform: none; }
.special-modal .special-foot { flex-shrink: 0; justify-content: center; }
.special-modal .special-foot .btn { flex: 1; max-width: none; }

/* Live reactions */
.reaction-bar {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 900;
  display: flex;
  gap: 0.15rem;
  padding: 0.3rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.reaction-btn {
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.reaction-btn:hover { transform: scale(1.25); }
.reaction-btn:active { transform: scale(0.9); }
.reaction-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1100; overflow: hidden; }
.reaction-float {
  position: absolute;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: reactionUp 2.8s ease-out forwards;
}
.reaction-float__emoji { font-size: 2.4rem; line-height: 1; }
.reaction-float__name {
  font-size: 0.7rem;
  font-weight: bold;
  color: #fff;
  background: rgba(120, 80, 140, 0.75);
  border-radius: 999px;
  padding: 0 0.4rem;
  margin-top: 0.15rem;
}
.reaction-float__name:empty { display: none; }
@keyframes reactionUp {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  10%  { transform: translateY(-20px) scale(1.1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(-65vh) scale(1); opacity: 0; }
}
/* Guests: the bar is a sign-up link */
.reaction-bar--locked { align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem 0.35rem 0.75rem; text-decoration: none; color: var(--violet); }
.reaction-bar__emojis { font-size: 1.25rem; letter-spacing: 0.15rem; filter: grayscale(1); opacity: 0.45; }
.reaction-bar__lock { font-size: 0.85rem; white-space: nowrap; padding: 0.35rem 0.7rem; border-radius: 999px; background: var(--violet-soft); }
.reaction-bar--locked:hover .reaction-bar__lock { background: #efe0f7; }

/* No bonus for a player without an account */
.bonus-locked { flex-basis: 100%; margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; text-align: center; }

/* Guests: the round history is replaced by an invitation to sign up */
.extras-locked { text-align: center; color: var(--text); padding: 0.5rem 0; }
.extras-locked p { margin-bottom: 1rem; }
.extras-locked__icon { font-size: 2rem; }
.extras-locked .btn { display: inline-block; text-decoration: none; }

body.game-started { padding-bottom: 4.5rem; }
@media (max-width: 600px) {
  .reaction-bar { left: 50%; right: auto; transform: translateX(-50%); }
}

/* Wheel of fortune (dares: pick of the player), the gold wheel of js/lucky_wheel.js */
.reveal-wheel {
  width: min(280px, 72vw);
  margin: 0.5rem auto 1.25rem;
}

.host-own {
  text-align: center;
  margin: 1.5rem auto 0;
  padding: 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.host-own a { color: #a35bb8; font-weight: bold; }

.share-code {
  margin-bottom: 1rem;
  padding: 0.6rem;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}
.share-code label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.share-code__row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.share-code__row input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid #e6dcef;
  border-radius: 8px;
  font: inherit;
  font-weight: bold;
  color: #a35bb8;
  background: #fff;
}
.share-code__row .btn { padding: 0.5rem 0.9rem; font-size: 0.9rem; }

.player-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.player-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: white;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Announcement Bar - permanent under header */
.announcement-bar {
  position: relative;
  z-index: 100;
  width: 100%;
  background: var(--gradient);
  color: white;
  padding: 0.75rem 1rem;
  text-align: center;
  box-shadow: 0 8px 20px rgba(157, 98, 180, 0.2);
  animation: slideDown 0.3s ease-out;
  margin: 0;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.announcement-bar.hidden {
  display: none;
}

.announcement-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.announcement-icon {
  font-size: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.announcement-content .message {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.player-box.clickable { 
  cursor: pointer; 
}

.player-flag {
  width: 24px;
  height: auto;
}

.player-country-name {
  font-size: .85rem;
  color: var(--text);
  margin-left: .4rem;
}

/* Zone principale du jeu */
#gameArea {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  #gameArea {
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto auto;
    align-items: start;
  }

  .scoreboard {
    grid-row: 1 / 3;
  }

  .round-animation {
    grid-column: 2;
    grid-row: 1;
  }

  .rounds-history {
    grid-column: 2;
    grid-row: 2;
  }
}

/* Tableau des scores */
.scoreboard {
  background-color: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.scoreboard h2 {
  font-family: var(--font);
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 1.1rem;
  text-align: center;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

/* Each player gets one of the 5 wheel colors (--pc, set by nth-child) */
.player-card {
  --pc: var(--pick-1);
  --pc-soft: var(--pick-1-soft);
  background: linear-gradient(160deg, var(--pc-soft), #fff 70%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
}
.player-card:nth-child(5n+2) { --pc: var(--pick-2); --pc-soft: var(--pick-2-soft); }
.player-card:nth-child(5n+3) { --pc: var(--pick-3); --pc-soft: var(--pick-3-soft); }
.player-card:nth-child(5n+4) { --pc: var(--pick-4); --pc-soft: var(--pick-4-soft); }
.player-card:nth-child(5n+5) { --pc: var(--pick-5); --pc-soft: var(--pick-5-soft); }

.player-card.selected {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(157, 98, 180, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(157, 98, 180, 0); }
  100% { box-shadow: 0 0 0 0 rgba(157, 98, 180, 0); }
}

.player-card h3 {
  font-size: 1rem;
  color: var(--ink);
}

.player-score {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--violet);
  display: flex;
  align-items: baseline;
  gap: .5em;
  justify-content: center;
}

.player-bonus {
  color: #2a9d8f;
  font-size: .9em;
}

/* Player dares statistics (pending/completed) */
.player-dares-stats {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.85rem;
}

.player-dares-stats .dares-pending {
  color: #f39c12;
  background: rgba(243, 156, 18, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
}

.player-dares-stats .dares-completed {
  color: #27ae60;
  background: rgba(39, 174, 96, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
}

/* Player clothing stats (dices mode) */
.player-clothes-stats {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin: 0.5rem 0;
  font-size: 1.2rem;
}

.player-clothes-stats .clothing-item {
  transition: all 0.3s ease;
}

.player-clothes-stats .clothing-item.lost {
  opacity: 0.2;
  filter: grayscale(100%);
}

.player-stats {
  font-size: 0.8rem;
  color: var(--text);
}

.player-position {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--pc, var(--violet-mid));
  color: white;
  box-shadow: 0 0 0 3px #fff, var(--shadow-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 0.8rem;
}

/* Desktop: condensed participant cards so several players fit without scrolling */
@media (min-width: 768px) {
  .scoreboard { padding: 1rem; }
  .scoreboard h2 { font-size: 1.15rem; margin-bottom: 0.8rem; }
  .players-grid { gap: 0.6rem; }
  .player-card { padding: 0.45rem 0.5rem; border-radius: 10px; line-height: 1.25; }
  .player-card h3 { font-size: 0.88rem; margin: 0; overflow-wrap: anywhere; }
  .player-position { top: -7px; left: -7px; width: 20px; height: 20px; font-size: 0.68rem; box-shadow: 0 0 0 2px #fff, var(--shadow-sm); }
  .player-score { font-size: 0.9rem; gap: 0.3em; flex-wrap: wrap; }
  .player-bonus { font-size: 0.75em; }
  .player-dares-stats { gap: 0.3rem; margin: 0.25rem 0; font-size: 0.72rem; }
  .player-dares-stats .dares-pending,
  .player-dares-stats .dares-completed { padding: 0.05rem 0.35rem; }
  .player-clothes-stats { margin: 0.2rem 0; font-size: 0.95rem; gap: 0.15rem; }
  .card-admin { margin-top: 0.35rem; padding-top: 0.3rem; }
  .card-admin__stats { font-size: 0.65rem; margin-bottom: 0.2rem; }
  .card-admin__actions .admin-action-btn { padding: 0.15rem 0.3rem; font-size: 0.66rem; }
  .player-paused-label { font-size: 0.72rem; margin: 0.15rem 0; }
}

/* Animation du tour */
.round-animation {
  background-color: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* Ne pas étirer pour remplir la ligne de grille; adapter à son contenu */
  align-self: start;
}

.countdown-screen, .player-reveal, .dare-reveal {
  width: 100%;
}

/* Empty mat before a round: hidden as soon as another screen of the round is visible */
.round-idle {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.round-idle::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url(../images/dice-sparkle-720.jpg) center / contain no-repeat;
  opacity: 0.16;
}

.round-animation:has(> :not(.hidden):not(.round-idle)) .round-idle,
.round-animation.has-played .round-idle__first,
.round-animation:not(.has-played) .round-idle__next {
  display: none;
}

.round-idle__title {
  margin: 0;
  font-family: var(--font);
  font-size: 1.5rem;
  color: var(--ink);
  animation: fadeInOut 2.4s ease-in-out infinite;
}

.round-idle__sub {
  margin: 0;
  max-width: 28rem;
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .round-idle__title { animation: none; }
}

.countdown-number {
  font-family: var(--font);
  font-size: 6rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* one pop per number: starts when shown, same 1 s step as the countdown */
  animation: countPop 1s ease-out infinite;
}

.countdown-screen .waiting {
  font-size: 1.5em;
}

@keyframes countPop {
  0% { transform: scale(1.35); opacity: 0.4; }
  30%, 100% { transform: scale(1); opacity: 1; }
}

@keyframes blink {
  50% { opacity:0; }
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.reveal-title {
  font-family: var(--font);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}

.revealed-player {
  font-family: var(--font);
  font-size: 2.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: scaleIn 0.5s ease-out;
}

.reveal-subtitle {
  font-size: 1.2rem;
  color: #99d8e1;
  margin-bottom: 0.5rem;
}

.revealed-dare {
  font-family: var(--font);
  font-size: 1.7rem;
  color: var(--ink);
  padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, var(--violet-soft), var(--blue-soft));
  border-radius: var(--radius);
  animation: scaleIn 0.5s ease-out;
}

/* Rated challenge: slider from 1 (bad) to 10 (best) under the dare */
.dare-rating {
  margin: 1rem auto 0;
  max-width: 420px;
  padding: 1rem 1.25rem;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
}
.dare-rating h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--gold-dark); }
.dare-rating__form { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.dare-rating__value { font-size: 2.2rem; font-weight: 700; color: var(--ink); line-height: 1; }
.dare-rating__value small { font-size: 1rem; color: var(--muted); }
.dare-rating input[type="range"] { width: 100%; accent-color: var(--gold-dark); cursor: pointer; }
.dare-rating__scale { display: flex; justify-content: space-between; width: 100%; font-size: 0.8rem; color: var(--muted); }
.dare-rating__summary { margin: 0.6rem 0 0; font-size: 0.95rem; color: var(--text); }
.dare-rating__summary strong { color: var(--gold-dark); font-size: 1.1rem; }

/* Timed challenge: countdown started by the host, before the vote */
.dare-timer {
  margin: 1rem auto 0;
  max-width: 420px;
  padding: 1rem 1.25rem;
  background: var(--violet-soft);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.dare-timer.hidden { display: none; }
.dare-timer__clock { font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--violet); font-variant-numeric: tabular-nums; }
.dare-timer.urgent .dare-timer__clock { color: #b3261e; animation: timerPulse 1s ease-in-out infinite; }
.dare-timer.done .dare-timer__clock { color: var(--muted); }
.dare-timer__status { margin: 0; font-size: 0.95rem; color: var(--text); }
.dare-timer__status:empty { display: none; }
.dare-timer.done .dare-timer__status { font-weight: 700; color: var(--ink); }
@keyframes timerPulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .dare-timer.urgent .dare-timer__clock { animation: none; } }

@keyframes scaleIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.voting-section {
  margin-top: 2rem;
  width: 100%;
}

.voting-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.vote-btn, .bonus-btn {
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background-color: #fff;
  box-shadow: var(--shadow-sm);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.vote-btn:hover, .bonus-btn:hover {
  background-color: var(--line);
  transform: translateY(-2px);
}

.vote-btn-special {
  background-color: rgba(215,177,218,0.2);
  color: #c47ddd;
}

.vote-btn-special:hover {
  background-color: rgba(215,177,218,0.4);
}

/* Round history: glued under the game block, as its pastel extension */
.round-animation:has(+ .rounds-history) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.rounds-history {
  position: relative;
  margin-top: -2rem; /* cancels the #gameArea gap: no space between the game block and its history */
  padding: 1.1rem 1.5rem 1.4rem;
  background: linear-gradient(180deg, var(--violet-soft), color-mix(in srgb, var(--violet-soft) 45%, #fff));
  border: 1px solid var(--line);
  border-top: 1px dashed color-mix(in srgb, var(--violet-mid) 35%, #fff);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.rounds-history h2 {
  margin: 0 0 0.8rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
}

#history-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item {
  padding: 0.7rem 0.95rem;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--violet-mid) 18%, #fff);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}

.history-round {
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-player {
  font-weight: bold;
  color: var(--ink);
}

.history-dare {
  font-style: italic;
  color: var(--text);
}

.history-pts {
  display: inline-block;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 0.8rem;
  font-weight: bold;
}

/* Outcome of a challenge: a small pill */
.history-result {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: bold;
}

.history-result-success {
  color: var(--green);
}
.history-result.history-result-success {
  background: var(--green-soft);
}

.history-result-fail {
  color: var(--red);
}
.history-result.history-result-fail {
  background: var(--red-soft);
}

#historyToggle {
  display: block;
  margin: 0.8rem auto 0;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
}

/* Panneau d'administration */
.admin-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-color: white;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 900;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.admin-panel.visible {
  transform: translateX(0);
}

.admin-panel h2 {
  font-family: var(--font);
  color: #c47ddd;
  margin-bottom: 1.5rem;
  text-align: center;
}

.admin-controls {
  margin-bottom: 2rem;
}

.admin-options {
  margin-top: 1.5rem;
}

.option-group {
  margin-bottom: 1.5rem;
}

.option-group h4 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-announcement {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

#toggleAnnouncementBtn {
  width: 100%;
  margin-bottom: 0.5rem;
}

#announcementForm {
  margin-top: 0.75rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

#announcementForm.hidden {
  display: none;
}

.admin-announcement textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
}

.admin-announcement textarea:focus {
  outline: none;
  border-color: var(--violet-mid);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.announcement-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.announcement-actions .btn {
  flex: 1;
}

.admin-players {
  margin-top: 2rem;
}

.admin-players h3 {
  margin-bottom: 1rem;
  color: var(--blue);
}

.admin-player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: var(--bg-soft);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-player-info {
  display: flex;
  flex-direction: column;
}

.admin-player-name {
  font-weight: bold;
  color: var(--ink);
}

.admin-player-country {
  font-size: 0.8rem;
  color: var(--text);
}

.admin-player-stats {
  font-size: 0.75rem;
  color: var(--muted);
}

.admin-player-alert {
  color: #dc3545;
  font-weight: bold;
  font-size: 0.8rem;
}

.admin-player-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-action-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  background-color: var(--surface-2);
  color: var(--text);
}

.admin-action-btn:hover {
  background-color: var(--line);
}

/* Host: actions under each participant card (renderPlayersList / playerAdminActions) */
.card-admin {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e6dcef;
}
.card-admin__stats { font-size: 0.7rem; color: var(--muted); margin-bottom: 0.35rem; }
.card-admin__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem; }
.card-admin__actions .admin-action-btn { flex: 1 1 auto; padding: 0.3rem 0.4rem; font-size: 0.72rem; }
.admin-action-btn--danger { color: #b3261e; }
.admin-action-btn--danger:hover { background-color: #fdecea; }
.player-card--paused { opacity: 0.75; background: #f3f3f6; }
.player-card--paused h3 { color: var(--muted); }
.player-paused-label { font-size: 0.8rem; color: var(--muted); margin: 0.3rem 0; }
.admin-players__hint { font-size: 0.8rem; color: var(--muted); margin: -0.25rem 0 0.75rem; }

/* ============================================================================
   LEVEL TABS - Version propre sans bordure verte ni coche
   ============================================================================ */

.levels-tabs {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.5rem 0;
  padding: 0.5rem 0;
}

.level-tab {
  border: none; /* ✅ Plus de bordure ! */
  background: linear-gradient(135deg, var(--surface-2) 0%, #e8eaf0 100%);
  color: #555;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.level-tab::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.level-tab:hover::before {
  width: 300px;
  height: 300px;
}

.level-tab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 12px rgba(196, 125, 221, 0.3);
  background: linear-gradient(135deg, #e0d5f0 0%, #d0c5e0 100%);
}

.level-tab.active {
  background: linear-gradient(135deg, #c47ddd 0%, #a85fc7 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(196, 125, 221, 0.4);
  transform: scale(1.08);
}

/* ✅ Barre blanche en bas au lieu de la coche verte */
.level-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 3px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px 2px 0 0;
}

/* ============================================================================
   SCROLLBAR - Plus jolie et discrète
   ============================================================================ */

/* Pour WebKit (Chrome, Safari, Edge) */
.dares-list::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.dares-categories::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.dares-list::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.dares-categories::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.dares-list::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.dares-categories::-webkit-scrollbar-thumb {
  background: #e2d6ee;
  border-radius: 10px;
  border: 2px solid #fff;
}

.dares-list::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.dares-categories::-webkit-scrollbar-thumb:hover {
  background: var(--pick-1);
}

/* Pour Firefox */
.dares-list,
.modal-content,
.dares-categories {
  scrollbar-width: thin;
  scrollbar-color: #e2d6ee transparent;
}

/* ============================================================================
   EXPECTED POINTS - Animations Fun 🎯
   ============================================================================ */

#expectedPts {
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  display: inline-block;
  margin: 0;
  transition: all 0.3s ease;
  position: relative;
  background: rgba(153, 216, 225, 0.15); /* bleu pâle */
  border: 1px solid rgba(153, 216, 225, 0.35);
  color: var(--blue);
}

/* Animation de gigotement (wiggle) */
.pot-bounce {
  animation: potWiggle 0.6s ease-in-out;
}

@keyframes potWiggle {
  0%, 100% { 
    transform: translateX(0) rotate(0deg); 
  }
  10% { 
    transform: translateX(-8px) rotate(-3deg); 
  }
  20% { 
    transform: translateX(8px) rotate(3deg); 
  }
  30% { 
    transform: translateX(-8px) rotate(-3deg); 
  }
  40% { 
    transform: translateX(8px) rotate(3deg); 
  }
  50% { 
    transform: translateX(-5px) rotate(-2deg); 
  }
  60% { 
    transform: translateX(5px) rotate(2deg); 
  }
  70% { 
    transform: translateX(-3px) rotate(-1deg); 
  }
  80% { 
    transform: translateX(3px) rotate(1deg); 
  }
  90% { 
    transform: translateX(-1px) rotate(-0.5deg); 
  }
}

/* Animation de couleurs arc-en-ciel */
.pot-rainbow {
  animation: rainbowPulse 1.2s ease-in-out;
}

@keyframes rainbowPulse {
  0% {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #dee2e6;
    box-shadow: 0 0 0 0 rgba(196, 125, 221, 0);
  }
  15% {
    background: linear-gradient(135deg, #ffcce7 0%, #ff99d6 100%);
    border-color: #ff66c4;
    box-shadow: 0 0 0 8px rgba(255, 102, 196, 0.2);
  }
  30% {
    background: linear-gradient(135deg, #ffd7a8 0%, #ffb366 100%);
    border-color: #ff9933;
    box-shadow: 0 0 0 12px rgba(255, 153, 51, 0.2);
  }
  45% {
    background: linear-gradient(135deg, #fff9a8 0%, #ffee66 100%);
    border-color: #ffe033;
    box-shadow: 0 0 0 8px rgba(255, 224, 51, 0.2);
  }
  60% {
    background: linear-gradient(135deg, #a8ffcc 0%, #66ff99 100%);
    border-color: #33ff66;
    box-shadow: 0 0 0 12px rgba(51, 255, 102, 0.2);
  }
  75% {
    background: linear-gradient(135deg, #a8d7ff 0%, #66b3ff 100%);
    border-color: #3399ff;
    box-shadow: 0 0 0 8px rgba(51, 153, 255, 0.2);
  }
  90% {
    background: linear-gradient(135deg, #dda8ff 0%, #b366ff 100%);
    border-color: #9933ff;
    box-shadow: 0 0 0 12px rgba(153, 51, 255, 0.2);
  }
  100% {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #dee2e6;
    box-shadow: 0 0 0 0 rgba(196, 125, 221, 0);
  }
}

/* Animation flash améliorée */
.pot-flash {
  animation: flashGlow 0.8s ease-in-out;
}

@keyframes flashGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(196, 125, 221, 0);
  }
  50% {
    box-shadow: 0 0 20px 5px rgba(196, 125, 221, 0.6),
                0 0 40px 10px rgba(196, 125, 221, 0.4),
                0 0 60px 15px rgba(196, 125, 221, 0.2);
    transform: scale(1.1);
  }
}

/* Effet de particules */
#expectedPts::after {
  content: '✨';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 1.5rem;
  opacity: 0;
  animation: sparkle 0.8s ease-in-out;
  pointer-events: none;
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.5) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: scale(0) rotate(360deg);
  }
}

/* ============================================================================
   DARE CHOICES - Améliorés
   ============================================================================ */

.dares-categories {
  margin-top: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.dares-category {
  margin-bottom: 2rem;
}

.level-navigation-btns {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.level-navigation-btns .back-level-btn,
.level-navigation-btns .next-level-btn {
  flex: 1;
  min-width: 200px;
  font-size: 1.05rem;
  padding: 1rem 1.5rem;
}

.level-navigation-btns .back-level-btn {
  background-color: var(--line);
  color: var(--text);
}

.level-navigation-btns .back-level-btn:hover {
  background-color: #d4d7dc;
  color: #444;
}

/* Si seulement un bouton, prendre toute la largeur */
.level-navigation-btns > button:only-child {
  flex: none;
  width: 100%;
}

.dares-category h3 {
  color: #c47ddd;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #f8f5fb 0%, #f0e9f5 100%);
  border-left: 4px solid #c47ddd;
  border-radius: 4px;
  display: none; /* Caché car on utilise les tabs maintenant */
}

.dares-category.hidden {
  display: none;
}

.dares-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* One choice color per level: aqua, violet, pink (gold stays for the special level) */
.dares-category { --lc: var(--pick-2); --lc-soft: var(--pick-2-soft); --lc-ink: var(--blue); }
.dares-category[data-degree="2"] { --lc: var(--pick-1); --lc-soft: var(--pick-1-soft); --lc-ink: var(--violet); }
.dares-category[data-degree="3"] { --lc: var(--pick-3); --lc-soft: var(--pick-3-soft); --lc-ink: var(--pink); }
.dares-category[data-degree="4"] { --lc: var(--pick-5); --lc-soft: var(--pick-5-soft); --lc-ink: var(--gold-dark); }

.dare-choice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  background: var(--bg);
  color: var(--ink);
  position: relative;
}

/* Round tick on the left, filled with the level color once picked */
.dare-choice::before {
  content: '';
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #d9d4e3;
  background: var(--bg);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  transition: inherit;
}

.dare-choice:hover {
  border-color: var(--lc, var(--pick-1));
  background: var(--bg-soft);
}

.dare-choice.selected,
.dare-choice.done {
  border-color: var(--lc, var(--pick-1));
  background: var(--lc-soft, var(--pick-1-soft));
  box-shadow: var(--shadow-sm);
}

.dare-choice.selected::before,
.dare-choice.done::before {
  content: '✓';
  border-color: var(--lc, var(--pick-1));
  background: var(--lc, var(--pick-1));
}

/* Classe .done réservée pour les dares complétés dans le jeu (pas utilisée pour la sélection) */
.dare-choice.done {
  cursor: not-allowed;
  opacity: 0.7;
}

.dare-choice.done::after { content: none; }

/* Special level cards (read-only): no tick */
.special-choice::before { content: none; }

.dare-choice input[type="checkbox"] {
  position: absolute;
  opacity: 0;
}

.dare-choice .dare-text {
  flex: 1;
  line-height: 1.4;
}

.dare-choice .rated-badge {
  white-space: nowrap;
  margin-right: 0.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--gold-dark);
  background: var(--gold-soft);
}

.dare-choice .timer-badge { color: var(--violet); background: var(--violet-soft); }

.dare-choice .pts {
  white-space: nowrap;
  font-weight: 700;
  color: var(--lc-ink, var(--violet));
  padding: 0.25rem 0.7rem;
  background: var(--lc-soft, var(--violet-soft));
  border-radius: 12px;
  font-size: 0.85rem;
}

.dare-choice.selected .pts { background: var(--bg); }

/* ============================================================================
   PLAYER DARES LIST (My challenges modal)
   ============================================================================ */

.player-dare {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5em 0;
  border-bottom: 1px solid #eee;
}

.player-dare .dare-text {
  flex: 1;
  margin-right: 1em;
}

.player-dare .pts {
  white-space: nowrap;
  font-weight: bold;
}

.player-dare.done {
  opacity: 0.5;
  text-decoration: line-through;
}

.player-dare-total {
  margin-top: 1em;
  font-weight: bold;
  text-align: right;
  padding-top: 0.5em;
  border-top: 2px solid #ccc;
}

/* ============================================================================
   MODAL FOOTER
   ============================================================================ */

.modal-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 0 0;
  padding: 1rem 0 0 0;
  border-top: 1px solid var(--line);
}

.modal-footer .expected-points {
  flex: 2;
  max-width: 66%;
}

/* Compact expected points display (positioned below description) */
.expected-points-compact {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-dark);
  background: var(--gold-soft);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  margin: 0.75rem 0 1rem 0;
  border: 1px solid #f3dfae;
}

.modal-footer .btn {
  flex: 1;
  max-width: 33%;
  min-width: auto;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 25px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.modal-footer .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 125, 221, 0.4);
}

/* ============================================================================
   MODAL CONTENT IMPROVEMENTS
   ============================================================================ */

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: var(--ink);
  font-size: 1.8rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}

/* Description style */
.description {
  font-style: italic;
  color: var(--blue);
  font-weight: normal;
  margin-bottom: 1rem;
}

/* ============================================================================
   ALERTS & BANNERS
   ============================================================================ */

#alertBanner {
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%;
  padding: .7rem; 
  text-align: center; 
  font-weight: 700;
  background: #ff0; 
  color: #000; 
  z-index: 9999;
  animation: flash 1s infinite;
}

@keyframes flash {
  50% { 
    background:#f00; 
    color:#fff; 
  }
}

/* ============================================================================
   ANIMATION COLLECTIVE
   ============================================================================ */

.collective-dare {
  background-color: rgba(61, 186, 209, 0.1);
  padding: 1.5rem;
  border-radius: 15px;
  margin-top: 1rem;
  border: 2px dashed var(--blue);
  animation: pulse 1.5s infinite;
}

.collective-title {
  font-family: var(--font);
  color: var(--blue);
  margin-bottom: 1rem;
}

.collective-players {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.collective-player {
  font-weight: bold;
  color: #c47ddd;
}

/* ============================================================================
   UTILITAIRES
   ============================================================================ */

.hidden {
  display: none !important;
}

.loading-spinner {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.fun-btn { 
  align-self: center; 
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  .levels-tabs {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .level-tab {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  #expectedPts {
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
  }

  .modal-content {
    padding: 1rem;
  }

  .dares-categories {
    max-height: 50vh;
  }

  .modal-footer {
    flex-direction: column;
    gap: 0.75rem;
  }

  .modal-footer .expected-points,
  .modal-footer .btn {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .modal-footer .btn {
    padding: 0.75rem 1.5rem;
  }
}

@media (max-width: 767px) {
  .admin-panel {
    width: 100%;
  }
  
  .game-header h1 {
    font-size: 2rem;
  }
  
  .revealed-player,
  .revealed-dare {
    font-size: 1.8rem;
  }
  
  .voting-buttons {
    flex-direction: column;
  }
  
  .vote-btn, .bonus-btn {
    width: 100%;
  }
  
  .admin-panel-toggle {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #c47ddd;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 950;
    cursor: pointer;
  }
}

/* ========================================
   Quick Pick Modal Styles
   ======================================== */

.quick-pick-content {
  max-width: 700px;
  text-align: center;
  padding: 2rem;
}

.quick-pick-title {
  font-size: 2.5rem;
  color: #ff6b6b;
  margin-bottom: 1rem;
  animation: pulse 1s ease-in-out infinite;
}

.quick-pick-player {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

#quickPickPlayerName {
  color: #c47ddd;
}

.quick-pick-instruction {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.quick-pick-countdown {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.countdown-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  animation: ringPulse 1s ease-in-out infinite;
}

#quickPickTimer, #juryTimer {
  font-size: 3rem;
  font-weight: bold;
  color: white;
}

@keyframes ringPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
  }
}

.quick-pick-choices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#quickPickModal .dare-choice, #juryModal .dare-choice {
  background: var(--gradient);
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

#quickPickModal .dare-choice:hover, #juryModal .dare-choice:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(118, 75, 162, 0.4);
}

#quickPickModal .dare-choice::before, #juryModal .dare-choice::before { content: none; }

#quickPickModal .dare-choice:active, #juryModal .dare-choice:active {
  transform: translateY(-1px);
}

#quickPickModal .dare-choice .level-badge, #juryModal .dare-choice .level-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

#quickPickModal .dare-choice .dare-text, #juryModal .dare-choice .dare-text {
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0;
}

#quickPickModal .dare-choice.selected, #juryModal .dare-choice.selected {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  box-shadow: 0 8px 25px rgba(56, 239, 125, 0.5);
}

#quickPickModal .dare-choice.disabled, #juryModal .dare-choice.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Jury: votes count on each challenge, the drawn player only watches */
#juryModal .jury-count {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  min-width: 2rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.35);
  font-weight: bold;
  text-align: center;
}

#juryModal .dare-choice:disabled {
  cursor: default;
  transform: none;
  box-shadow: none;
}

.jury-voters {
  min-height: 1.4em;
  margin-top: 1rem;
  color: var(--text);
}

/* Quick Pick Spectator Modal
   ======================================== */

.quick-pick-spectator-content {
  max-width: 700px;
  text-align: center;
  padding: 2rem;
}

.quick-pick-spectator-message {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.quick-pick-spectator-instruction {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}

.quick-pick-spectator-choices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dare-option-spectator {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  color: white;
  text-align: left;
  position: relative;
  opacity: 0.8;
}

.dare-option-spectator .level-badge {
  background: rgba(255, 107, 107, 0.8);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 0.8rem;
}

.dare-option-spectator .dare-text {
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0;
}

.quick-pick-waiting {
  font-size: 1.2rem;
  color: var(--gold);
  font-style: italic;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .quick-pick-title {
    font-size: 2rem;
  }

  .quick-pick-content {
    padding: 1.5rem;
  }

  .countdown-ring {
    width: 80px;
    height: 80px;
  }

  #quickPickTimer, #juryTimer {
    font-size: 2.5rem;
  }

  #quickPickModal .dare-choice, #juryModal .dare-choice {
    padding: 1.2rem;
  }

  #quickPickModal .dare-choice .dare-text, #juryModal .dare-choice .dare-text {
    font-size: 1rem;
  }
}

/* ========================================
   Recap Screen - Between Rounds
   ======================================== */

.recap-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 1rem 0;
  animation: fadeIn 0.4s ease-out;
}

.recap-content {
  position: relative;
  text-align: center;
  padding: 2rem 2rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 460px;
  width: 92%;
  overflow: hidden;
  animation: scaleIn 0.4s ease-out;
}

/* Pastel glow behind the card content, like the home cards */
.recap-content::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 140px;
  background:
    radial-gradient(circle at 15% 0%, var(--pick-1-soft), transparent 60%),
    radial-gradient(circle at 85% 10%, var(--pick-2-soft), transparent 55%);
  pointer-events: none;
}
.recap-content > * { position: relative; }

.recap-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--muted);
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.recap-player {
  font-size: 2rem;
  font-weight: bold;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.75rem;
  overflow-wrap: anywhere;
  animation: fadeIn 0.6s ease-out 0.1s both;
}

.recap-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.recap-vote,
.recap-bonus {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: bold;
}

.recap-vote { color: var(--violet); background: var(--violet-soft); }
.recap-vote:empty { display: none; }
.recap-vote[data-result="success"] { color: var(--green); background: var(--green-soft); }
.recap-vote[data-result="fail"] { color: var(--pink); background: var(--pink-soft); }
.recap-vote[data-result="bonus"],
.recap-bonus { color: var(--gold-dark); background: var(--gold-soft); }
.recap-bonus.hidden { display: none; }

.recap-points {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.25rem;
  animation: bounceIn 0.7s ease-out 0.3s both;
}

#recapPointsValue {
  font-size: 3.5rem;
  font-weight: bold;
  line-height: 1.1;
  color: var(--violet);
}

/* Gold like the wheel when points are won */
#recapPointsValue.positive {
  background: linear-gradient(135deg, #e3b14f, #c38f2e 60%, #e3b14f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 10px rgba(227, 177, 79, 0.35));
}

#recapPointsValue.negative { color: var(--pink); }

.recap-points-label {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* Scores reminder */
.recap-scores {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-align: left;
  animation: fadeIn 0.5s ease-out both;
}
.recap-scores.hidden { display: none; }

.recap-scores__title {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
}

.recap-scores__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.recap-score {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
}

.recap-score.is-me {
  background: var(--pick-1-soft);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--pick-1);
}

/* Player outside the top 5: small gap above */
.recap-score.is-gap { margin-top: 0.5rem; }

.recap-score__rank { width: 1.6rem; text-align: center; font-weight: bold; color: var(--muted); }
.recap-score__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; }
.recap-score__pts { font-weight: bold; color: var(--ink); }
.recap-score__delta {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--gold-dark);
  background: var(--gold-soft);
}
.recap-score__delta.is-neg { color: var(--pink); background: var(--pink-soft); }

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pointsPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .recap-content {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .recap-player {
    font-size: 1.6rem;
  }

  #recapPointsValue {
    font-size: 2.75rem;
  }
}

/* ==================== GAME MODE SELECTOR ==================== */

.admin-game-mode {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 2px solid #dee2e6;
}

.admin-game-mode h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #495057;
  font-weight: 600;
}

.mode-selector {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font);
}

.mode-btn:hover {
  border-color: #c47ddd;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(196, 125, 221, 0.2);
}

.mode-btn.active {
  background: linear-gradient(135deg, #c47ddd, #9ecaed);
  border-color: #c47ddd;
  color: white;
  box-shadow: 0 4px 12px rgba(196, 125, 221, 0.4);
}

.mode-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.mode-icon {
  font-size: 2rem;
  filter: grayscale(50%);
  transition: filter 0.3s ease;
}

.mode-btn.active .mode-icon {
  filter: grayscale(0%) drop-shadow(0 2px 4px rgba(255, 255, 255, 0.3));
}

.mode-name {
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
}

.mode-btn.active .mode-name {
  color: white;
}

.mode-description {
  margin: 0;
  padding: 0.75rem;
  background: rgba(196, 125, 221, 0.1);
  border-radius: 6px;
  font-size: 0.9rem;
  color: #6c757d;
  text-align: center;
}

/* Dice mode specific UI: 2 glass pastel 3D dice per player (js/dare_game_multimode.js) */
.dice-round {
  width: 100%;
  text-align: center;
}

.dice-round h2 {
  font-family: var(--font);
  font-size: 1.9rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.dice-instructions {
  max-width: 460px;
  margin: 0 auto 1rem;
  font-size: 1rem;
  color: var(--text);
}

.dice-timer {
  display: inline-block;
  min-height: 1.2em;
  margin: 0.25rem 0;
  font-weight: bold;
  font-size: 1.15rem;
  color: var(--pink);
}
.dice-timer:empty { display: none; }

.dice-roll-action {
  margin: 1rem 0 1.25rem;
}

.dice-roll-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 2.4rem;
  border: none;
  border-radius: 999px;
  background: var(--gold-gradient);
  color: #5a3d0c;
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(185, 132, 39, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.dice-roll-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(185, 132, 39, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.dice-roll-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.dice-mat {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
  margin: 1rem 0;
}

/* One player: their 2 dice, the total and their name */
.dice-player {
  --dc: var(--pick-1);
  --dc-soft: var(--pick-1-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  min-width: 128px;
  padding: 1.1rem 0.9rem 0.8rem;
  background: linear-gradient(180deg, var(--dc-soft), #fff 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.dice-player[data-color="2"] { --dc: var(--pick-2); --dc-soft: var(--pick-2-soft); }
.dice-player[data-color="3"] { --dc: var(--pick-3); --dc-soft: var(--pick-3-soft); }
.dice-player[data-color="4"] { --dc: var(--pick-4); --dc-soft: var(--pick-4-soft); }
.dice-player[data-color="5"] { --dc: var(--pick-5); --dc-soft: var(--pick-5-soft); }

.dice-pair {
  display: flex;
  gap: 0.75rem;
  padding: 0.35rem 0.25rem 0.5rem;
  perspective: 500px;
}

.die-wrap {
  --die: 46px;
  width: var(--die);
  height: var(--die);
}
.die-wrap.is-rolling { animation: die-hop 1.15s cubic-bezier(0.3, 0.7, 0.4, 1); }
.die-wrap + .die-wrap.is-rolling { animation-delay: 0.08s; }

.die {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(25deg);
  transition: transform 1.15s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.die__face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 15%;
  border-radius: 22%;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.95), transparent 45%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), color-mix(in srgb, var(--dc) 70%, #fff));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--dc) 45%, transparent),
    inset -4px -5px 10px color-mix(in srgb, var(--dc) 55%, transparent);
  backface-visibility: hidden;
}
.die__face--1 { transform: translateZ(calc(var(--die) / 2)); }
.die__face--6 { transform: rotateY(180deg) translateZ(calc(var(--die) / 2)); }
.die__face--2 { transform: rotateY(90deg) translateZ(calc(var(--die) / 2)); }
.die__face--5 { transform: rotateY(-90deg) translateZ(calc(var(--die) / 2)); }
.die__face--3 { transform: rotateX(90deg) translateZ(calc(var(--die) / 2)); }
.die__face--4 { transform: rotateX(-90deg) translateZ(calc(var(--die) / 2)); }

.pip {
  width: 72%;
  height: 72%;
  place-self: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6b6380, var(--ink) 70%);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.7);
}
.pip--1 { grid-area: 1 / 1; } .pip--2 { grid-area: 1 / 2; } .pip--3 { grid-area: 1 / 3; }
.pip--4 { grid-area: 2 / 1; } .pip--5 { grid-area: 2 / 2; } .pip--6 { grid-area: 2 / 3; }
.pip--7 { grid-area: 3 / 1; } .pip--8 { grid-area: 3 / 2; } .pip--9 { grid-area: 3 / 3; }

/* Not rolled yet: frosted dice slowly turning */
.dice-player.is-waiting .die { animation: die-idle 6s linear infinite; transition: none; }
.dice-player.is-waiting .die-wrap + .die-wrap .die { animation-delay: -2.5s; }
.dice-player.is-waiting .die__face { opacity: 0.55; }
.dice-player.is-waiting .pip { opacity: 0.35; }

.dice-total {
  min-width: 2.4rem;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--dc) 60%, #fff);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: bold;
  line-height: 1.4;
}
.dice-player.is-waiting .dice-total { color: var(--muted); border-style: dashed; }
.dice-total.is-pop { animation: scaleIn 0.4s ease-out; }

.dice-player-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.dice-badge {
  position: absolute;
  top: -0.7rem;
  left: 0;
  right: 0;
  width: fit-content;
  margin: 0 auto;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
  animation: scaleIn 0.4s ease-out;
}

/* Highest roll: gold, like the wheel */
.dice-player.winner {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-soft), #fff 75%);
  box-shadow: 0 0 0 2px var(--gold), 0 14px 30px rgba(185, 132, 39, 0.25);
  transform: translateY(-4px);
}
.dice-player.winner .dice-total { background: var(--gold-gradient); border-color: var(--gold); color: #5a3d0c; }
.dice-player.winner .dice-badge { background: var(--gold-gradient); color: #5a3d0c; box-shadow: var(--shadow-sm); }

/* Lowest roll(s): loses a life */
.dice-player.loser {
  border-color: color-mix(in srgb, var(--red) 35%, #fff);
  background: linear-gradient(180deg, var(--red-soft), #fff 75%);
}
.dice-player.loser .dice-total { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, #fff); }
.dice-player.loser .dice-badge { background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 30%, #fff); }

.dice-result-text {
  margin: 0.5rem auto 0;
  max-width: 520px;
  font-size: 1.05rem;
  color: var(--text);
}
.dice-result-text:empty { display: none; }
.dice-result-text strong {
  display: block;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--violet-soft), var(--blue-soft));
  color: var(--ink);
  font-size: 1.15rem;
}

@keyframes die-hop {
  0% { transform: translateY(-38px); }
  35% { transform: translateY(0); }
  55% { transform: translateY(-12px); }
  75% { transform: translateY(0); }
  88% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

@keyframes die-idle {
  from { transform: rotateX(-20deg) rotateY(0deg); }
  to { transform: rotateX(-20deg) rotateY(360deg); }
}

@media (max-width: 480px) {
  .dice-player { min-width: 112px; padding: 1rem 0.6rem 0.7rem; }
  .die-wrap { --die: 38px; }
  .dice-pair { gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .die { transition: none; }
  .die-wrap.is-rolling, .dice-player.is-waiting .die { animation: none; }
}

/* Hide dares-specific UI in dice mode */
.game-mode-dices .dare-specific,
.game-mode-dices .admin-options,
.game-mode-dices .voting-section {
  display: none !important;
}

/* Hide dice-specific UI in dares mode */
.game-mode-dares .dice-specific {
  display: none !important;
}

/* ========================================
   Match Game Mode
   ======================================== */

/* Hide match-specific UI when not in match mode */
.game-mode-dares .match-specific,
.game-mode-dices .match-specific {
  display: none !important;
}

/* Match in-progress screen (inside #roundAnimation) */
.match-in-progress,
.match-calculating,
.match-results {
  width: 100%;
  text-align: center;
  padding: 1rem 0;
}

.match-phase-title {
  font-family: var(--font);
  font-size: 2.2rem;
  color: var(--pink);
  margin-bottom: 0.5rem;
}

.match-phase-sub {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.match-big-countdown {
  font-family: var(--font);
  font-size: 5rem;
  color: #c47ddd;
  animation: fadeInOut 1s infinite;
  line-height: 1;
}

/* Match results */
.match-results-title {
  font-family: var(--font);
  font-size: 2rem;
  color: var(--pink);
  margin-bottom: 1.5rem;
}

.match-results-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.match-pair {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font);
  font-size: 1.6rem;
  color: #c47ddd;
  animation: scaleIn 0.5s ease-out;
}

.match-heart { font-size: 1.8rem; }

.match-name { color: #c47ddd; }

.match-plus { color: var(--pink); font-size: 1.4rem; }

.no-match-msg {
  font-family: var(--font);
  font-size: 1.5rem;
  color: var(--muted);
  animation: scaleIn 0.5s ease-out;
}

/* ---- Match Modal ---- */
.match-modal-content {
  max-width: 540px;
  text-align: center;
  padding: 2rem;
}

.match-modal-title {
  font-family: var(--font);
  font-size: 2rem;
  color: var(--pink);
  margin-bottom: 0.5rem;
}

.match-modal-sub {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Reuse the same countdown-ring style from quick-pick, tinted pink */
.match-countdown-ring {
  background: conic-gradient(var(--pink) 0%, var(--surface-2) 0%);
  border-color: var(--pink);
}

.match-player-choices {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  text-align: left;
}

.match-player-choice-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #f9f9fb;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 1.05rem;
}

.match-player-choice-item:hover {
  background: rgba(255, 107, 157, 0.07);
  border-color: var(--pink);
}

.match-player-choice-item input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--pink);
  cursor: pointer;
  flex-shrink: 0;
}

.match-player-choice-item:has(input:checked) {
  background: rgba(255, 107, 157, 0.12);
  border-color: var(--pink);
}

.match-player-flag { font-size: 1.3rem; }

.match-player-name { font-weight: 600; color: var(--ink); }

.match-modal-footer { margin-top: 0.5rem; }

.match-submit-btn {
  background: linear-gradient(135deg, var(--pink), #c47ddd);
  color: #fff;
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.match-submit-btn:hover { opacity: 0.88; }
.match-submit-btn:disabled { opacity: 0.5; cursor: default; }

.match-submitted-msg {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: #28a745;
  font-style: italic;
}

@media (max-width: 768px) {
  .match-phase-title { font-size: 1.6rem; }
  .match-big-countdown { font-size: 3.5rem; }
  .match-pair { font-size: 1.2rem; }
  .match-modal-title { font-size: 1.5rem; }
}

/* ========================================
   Random rank Game Mode (js/rank_mode.js): dice cards of the dice mode, then the playing order
   ======================================== */

body:not(.game-mode-rank) .rank-specific {
  display: none !important;
}

.rank-round {
  width: 100%;
  text-align: center;
}

.rank-round h2 {
  font-family: var(--font);
  font-size: 1.9rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.rank-tiebreak {
  font-size: 0.75rem;
  color: var(--muted);
  animation: scaleIn 0.4s ease-out;
}

/* Playing order, read top to bottom */
.rank-order {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.6rem;
  max-width: 560px;
  margin: 0.5rem auto 0;
  padding: 0.85rem 1.1rem;
  list-style: none;
  counter-reset: rank;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  animation: scaleIn 0.4s ease-out;
}
.rank-order li {
  counter-increment: rank;
  font-weight: 600;
  color: var(--text);
}
.rank-order li::before {
  content: counter(rank) ". ";
  color: var(--gold-dark);
}
.rank-order li:not(:last-child)::after {
  content: " →";
  color: var(--muted);
  font-weight: normal;
}

/* ============================================================
   PICK MODAL (one level per step): header and footer fixed, only the list scrolls
   ============================================================ */
#setupModal .modal-content.pick-open {
  display: flex;
  flex-direction: column;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
}
.pick-open #step-dares,
.pick-open #daresForm {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.pick-head h2 { margin-bottom: 0.5rem; padding-right: 2rem; }
.pick-open .dares-categories {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  margin-top: 0.5rem;
}
.pick-open .dares-category { margin-bottom: 0; }
.pick-open .pick-foot {
  flex-shrink: 0;
  flex-direction: row;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}
.pick-open .pick-foot .btn {
  flex: 0 1 auto;
  max-width: none;
  width: auto;
  height: 46px;
  display: inline-flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}
.pick-open .pick-foot .pick-back { margin-right: auto; }

.pick-steps { display: flex; list-style: none; margin: 0.25rem 0 0.5rem; padding: 0; }
.pick-steps li { flex: 1; position: relative; }
.pick-steps li + li::before {
  content: '';
  position: absolute;
  top: 15px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.pick-step {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  border: 0;
  background: none;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.pick-step[disabled] { cursor: default; opacity: 0.6; }
.pick-step__dot {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
}
.pick-step__label { font-size: 0.8rem; }
.pick-step.current { color: var(--violet); font-weight: bold; }
.pick-step.current .pick-step__dot { background: var(--gradient); color: #fff; box-shadow: 0 0 0 4px var(--violet-soft); }
.pick-step.done { color: var(--blue); }
.pick-step.done .pick-step__dot { background: var(--pick-2-soft); color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--pick-2); }

.pick-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.pick-status .expected-points-compact { margin: 0; }
#pickCount { color: var(--pink); }
#pickCount.ok { color: var(--green); }

@media (max-width: 600px) {
  #setupModal .modal-content.pick-open {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding: 1rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  }
}

/* ============================================================
   COMMUNITY LINK + NUDGE (guests invited to join the host's community)
   ============================================================ */
.btn-community {
  text-decoration: none;
}
.community-nudge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: 900px;
  margin: 0 auto 1rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: #fbf5fd;
  border: 1px solid #e6cdef;
  color: #5c4d5c;
  font-size: 0.95rem;
}
.community-nudge.hidden { display: none; }
.community-nudge span { flex: 1; }
.btn-nudge { padding: 0.45rem 1rem; font-size: 0.9rem; white-space: nowrap; }
.community-nudge__close {
  background: none;
  border: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: #a08aa5;
  cursor: pointer;
}

/* Admin: end of the game */
.admin-end { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #eee; }
.btn-end-game { width: 100%; background: #fdecea; color: #b3261e; box-shadow: 0 2px 4px rgba(179, 38, 30, 0.15); }
.btn-end-game:hover { background: #b3261e; color: #fff; }
.admin-end__hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }

/* ============================================================
   INVITATION BUTTON (appears when host invites a player)
   ============================================================ */
.btn-invitation {
  background: linear-gradient(135deg, #f5a623 0%, var(--pink) 100%);
  color: #fff;
  box-shadow: 0 4px 6px rgba(232, 57, 125, 0.25);
}
.btn-invitation:hover {
  background: linear-gradient(135deg, #e8953a 0%, #d42c6f 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(232, 57, 125, 0.4);
  color: #fff;
}
.btn-invitation.hidden { display: none !important; }

@keyframes inviteAppear {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  65%  { transform: scale(1.25) rotate(6deg);  opacity: 1; }
  100% { transform: scale(1)    rotate(0deg);  opacity: 1; }
}
.invite-appear {
  animation: inviteAppear 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Admin: invited player highlight */
.admin-btn-invited {
  background: var(--pink) !important;
  color: #fff !important;
}

/* ============================================================
   INVITATION MODAL
   ============================================================ */
.invitation-modal-content {
  text-align: center;
  padding: 2rem 2rem 1.6rem;
  max-width: 480px;
}
.invitation-badge {
  font-size: 2.8rem;
  margin-bottom: 0.4rem;
  animation: inviteAppear 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.invitation-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 1.2rem;
}
.invitation-message-box {
  background: #fff5fb;
  border-left: 4px solid var(--pink);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  text-align: left;
  margin-bottom: 1.4rem;
}
.invitation-from {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.invitation-quote {
  font-style: italic;
  color: var(--ink);
  margin: 0;
  line-height: 1.65;
  border: none;
  padding: 0;
  background: none;
}
.invitation-url {
  word-break: break-all;
  color: #FF4500;
  font-style: normal;
  font-weight: 600;
  text-decoration: underline;
}
.invitation-url:hover { color: #d93c00; }
.btn-community-reply {
  border-radius: 24px;
}
.pick-status #expectedPts { font-size: 0.85rem; padding: 0.35rem 0.8rem; border-radius: 999px; color: var(--gold-dark); background: var(--gold-soft); border-color: #f3dfae; }
.dice-round--sudden h2 { color: var(--red); animation: pulse 1.2s ease-in-out infinite; }
.dice-round--sudden .dice-instructions { color: var(--red); font-weight: bold; }

/* Under the email fields: the host never sees the address */
.email-private { display: block; margin-top: 0.35rem; font-size: 0.8rem; color: #8b879a; }

/* New level announced to the whole room (js showLevelUp, 3 s) */
.level-up {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(43, 40, 56, 0.55);
  backdrop-filter: blur(4px);
  animation: levelUpFade 0.3s ease-out;
}
.level-up.leaving { opacity: 0; transition: opacity 0.45s ease-in; }
.level-up-card {
  min-width: min(320px, 100%);
  padding: 2rem 2.5rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 6px var(--gold-soft), var(--shadow);
  text-align: center;
  animation: levelUpPop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.level-up-kicker { color: var(--violet); font-weight: bold; text-transform: uppercase; letter-spacing: 2px; }
.level-up-title {
  font-size: clamp(2.6rem, 12vw, 4.5rem);
  font-weight: bold;
  line-height: 1.1;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.level-up-emoji { font-size: 3rem; animation: levelUpWiggle 0.8s ease-in-out 0.5s 2; }
.level-up-fire { font-size: 1.6rem; letter-spacing: 4px; }

@keyframes levelUpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes levelUpPop { 0% { transform: scale(0.3) rotate(-8deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes levelUpWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-15deg) scale(1.2); } 75% { transform: rotate(15deg) scale(1.2); } }

@media (prefers-reduced-motion: reduce) {
  .level-up, .level-up-card, .level-up-emoji { animation: none; }
}

/* Rank mode: never the dice-game instructions next to the rank ones */
.game-mode-rank .dice-specific { display: none !important; }
