/* ── Jeu de la Vérité — OseDire ────────────────────────────── */
:root {
  --jv-yellow:   #F5C800;
  --jv-purple:   #7c3aed;
  --jv-purple-l: #a855f7;
  --jv-dark:     #1a1a2e;
  --jv-white:    #ffffff;
  --jv-orange:   #FF4500;
  --jv-radius:   1.5rem;
  --jv-shadow:   8px 8px 0 0 var(--jv-dark);
  --jv-shadow-sm:4px 4px 0 0 var(--jv-dark);
  --jv-border:   3px solid var(--jv-dark);
  --jv-font:     system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ── App wrapper ── */
#jv-app {
  font-family: var(--jv-font);
  background: var(--jv-yellow);
  min-height: 700px;
  width: 100%;
  position: relative;
  overflow: hidden;
  color: var(--jv-dark);
  box-sizing: border-box;
}

#jv-app *, #jv-app *::before, #jv-app *::after {
  box-sizing: border-box;
}

/* ── Screens ── */
.jv-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.25rem;
  min-height: 700px;
  animation: jv-fade-in 0.3s ease;
}

.jv-screen.jv-active {
  display: flex;
}

@keyframes jv-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Utility ── */
.jv-hidden { display: none !important; }

.jv-logo {
  height: 44px;
  width: auto;
  display: block;
  margin: 0 auto 0.5rem;
}

.jv-title {
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 900;
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: -1px;
  text-align: center;
  margin: 0 0 0.25rem;
  line-height: 1;
  color: var(--jv-dark);
}

.jv-subtitle {
  text-align: center;
  font-weight: 600;
  color: rgba(26,26,46,0.65);
  margin: 0 0 2rem;
  font-size: 1rem;
}

/* ── Panel card ── */
.jv-panel {
  background: rgba(255,255,255,0.45);
  border: var(--jv-border);
  border-radius: var(--jv-radius);
  box-shadow: var(--jv-shadow);
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  margin-bottom: 1.25rem;
}

.jv-panel-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 1rem;
}

/* ── Players input ── */
.jv-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.jv-input {
  min-width: 0;
  width: 100%;
  border: 2px solid var(--jv-dark);
  border-radius: 0.6rem;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  font-family: var(--jv-font);
  background: var(--jv-white);
  color: var(--jv-dark);
  outline: none;
  transition: box-shadow 0.15s;
}

.jv-input:focus {
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}

.jv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: var(--jv-border);
  border-radius: 0.6rem;
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--jv-font);
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 0.4px;
}

.jv-btn:active { transform: translate(2px, 2px); }

.jv-btn-icon {
  background: var(--jv-purple);
  color: var(--jv-white);
  box-shadow: var(--jv-shadow-sm);
  padding: 0.65rem 0.9rem;
  font-size: 1.2rem;
  line-height: 1;
}

.jv-btn-icon:hover { background: var(--jv-purple-l); }

.jv-btn-primary {
  background: var(--jv-purple);
  color: var(--jv-white);
  box-shadow: var(--jv-shadow);
  width: 100%;
  max-width: 480px;
  font-size: 1.2rem;
  padding: 1rem;
  border-radius: var(--jv-radius);
}

.jv-btn-primary:hover:not(:disabled) { background: var(--jv-purple-l); }
.jv-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.jv-btn-ghost {
  background: var(--jv-white);
  color: var(--jv-dark);
  box-shadow: var(--jv-shadow-sm);
  flex: 1;
}

.jv-btn-ghost:hover { background: rgba(255,255,255,0.8); }

.jv-btn-answer {
  background: var(--jv-purple);
  color: var(--jv-white);
  box-shadow: var(--jv-shadow-sm);
  flex: 2;
}

.jv-btn-answer:hover { background: var(--jv-purple-l); }

.jv-btn-defi {
  background: var(--jv-orange);
  color: var(--jv-white);
  box-shadow: var(--jv-shadow-sm);
  width: 100%;
  margin-top: 0.5rem;
}

.jv-btn-defi:hover { background: #e03d00; }

.jv-btn-dare-done {
  background: var(--jv-orange);
  color: var(--jv-white);
  box-shadow: var(--jv-shadow);
  width: 100%;
  max-width: 480px;
  font-size: 1.1rem;
  padding: 1rem;
  border-radius: var(--jv-radius);
  margin-top: 1rem;
}

.jv-btn-dare-done:hover { background: #e03d00; }

.jv-btn-replay {
  background: var(--jv-purple);
  color: var(--jv-white);
  box-shadow: var(--jv-shadow);
  width: 100%;
  max-width: 480px;
  font-size: 1.1rem;
  padding: 1rem;
  border-radius: var(--jv-radius);
  margin-bottom: 0.75rem;
}

.jv-btn-replay:hover { background: var(--jv-purple-l); }

.jv-btn-newgame {
  background: var(--jv-white);
  color: var(--jv-dark);
  box-shadow: var(--jv-shadow-sm);
  width: 100%;
  max-width: 480px;
  font-size: 1rem;
  padding: 0.9rem;
  border-radius: var(--jv-radius);
}

/* ── Players list ── */
.jv-players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
}

.jv-player-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--jv-white);
  border: 2px solid var(--jv-dark);
  border-radius: 99px;
  padding: 0.3rem 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.jv-remove-player {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: rgba(26,26,46,0.45);
  padding: 0;
  line-height: 1;
  font-family: inherit;
}

.jv-remove-player:hover { color: #dc2626; }

.jv-empty-msg {
  font-size: 0.85rem;
  color: rgba(26,26,46,0.5);
  font-style: italic;
  padding: 0.5rem 0;
}

/* ── Category buttons ── */
.jv-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.jv-cat-btn {
  background: var(--jv-white);
  color: var(--jv-dark);
  border: 2px solid rgba(26,26,46,0.25);
  border-radius: 99px;
  padding: 0.4rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--jv-font);
  cursor: pointer;
  transition: all 0.15s;
}

.jv-cat-btn.jv-cat-active {
  background: var(--jv-dark);
  color: var(--jv-white);
  border-color: var(--jv-dark);
  box-shadow: 2px 2px 0 0 rgba(255,255,255,0.5);
}

/* ── Progress bar ── */
.jv-progress-wrap {
  width: 100%;
  max-width: 480px;
  margin-bottom: 0.75rem;
}

.jv-progress-bar {
  height: 10px;
  background: rgba(26,26,46,0.15);
  border: 2px solid var(--jv-dark);
  border-radius: 99px;
  overflow: hidden;
}

.jv-progress-fill {
  height: 100%;
  background: var(--jv-purple);
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}

.jv-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.4rem;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.jv-player-badge {
  background: var(--jv-white);
  border: 2px solid var(--jv-dark);
  border-radius: 99px;
  padding: 0.25rem 0.75rem;
  font-size: 0.82rem;
}

.jv-player-badge span {
  color: var(--jv-purple);
  font-weight: 800;
}

/* ── Timer ── */
.jv-timer {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.jv-timer-svg {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.jv-timer-track {
  fill: none;
  stroke: rgba(26,26,46,0.1);
  stroke-width: 4;
}

.jv-timer-ring {
  fill: none;
  stroke: var(--jv-purple);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 150.8;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s linear, stroke 0.3s ease;
}

.jv-timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--jv-dark);
  line-height: 1;
  pointer-events: none;
}

/* Urgency: 10–6 s → orange ring */
.jv-timer--urgent .jv-timer-ring { stroke: #f97316; }
.jv-timer--urgent .jv-timer-num  { color: #f97316; }

/* Critical: 5 s and below → red + pulse */
.jv-timer--critical .jv-timer-ring { stroke: #ef4444; }
.jv-timer--critical .jv-timer-num  { color: #ef4444; }
.jv-timer--critical {
  animation: jv-pulse 0.6s ease-in-out infinite alternate;
}

/* Timeout flash */
.jv-timer--timeout {
  animation: jv-flash 0.3s ease 2;
}

@keyframes jv-pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}

@keyframes jv-flash {
  0%   { opacity: 1; }
  50%  { opacity: 0.2; }
  100% { opacity: 1; }
}

/* ── Question card ── */
.jv-card-wrap {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 4;
  max-height: 54vh;
  perspective: 1200px;
  cursor: pointer;
  margin: 0.5rem 0 1rem;
  flex-shrink: 0;
}

.jv-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.jv-card.jv-flipped {
  transform: rotateY(180deg);
}

.jv-card-front,
.jv-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 5px solid var(--jv-dark);
  border-radius: 1.75rem;
  box-shadow: var(--jv-shadow);
  background: var(--jv-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow: hidden;
}

.jv-card-back {
  transform: rotateY(180deg);
}

.jv-card-front:hover {
  transform: scale(1.02);
}

.jv-card.jv-flipped .jv-card-front {
  transform: none;
}

.jv-card-icon {
  width: 72px;
  height: 72px;
  background: var(--jv-purple);
  border: 4px solid var(--jv-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--jv-white);
  margin-bottom: 1rem;
  line-height: 1;
}

.jv-card-label {
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

.jv-cat-badge {
  position: absolute;
  top: 1.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border: 2px solid var(--jv-dark);
  border-radius: 99px;
  letter-spacing: 0.4px;
}

.jv-cat-Hot     { background: #ef4444; color: #fff; }
.jv-cat-Genant  { background: #f97316; color: #fff; }
.jv-cat-Secrets { background: #3b82f6; color: #fff; }
.jv-cat-Fun     { background: #22c55e; color: #fff; }
.jv-cat-Piments { background: #9333ea; color: #fff; }

.jv-question-text {
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.45;
  margin: 0;
  color: var(--jv-dark);
}

.jv-card-watermark {
  position: absolute;
  bottom: 1.25rem;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  text-transform: uppercase;
  color: rgba(124,58,237,0.12);
  letter-spacing: -2px;
  pointer-events: none;
  user-select: none;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Game actions ── */
.jv-game-actions {
  width: 100%;
  max-width: 480px;
}

.jv-actions-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.jv-reveal-hint {
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: rgba(26,26,46,0.4);
  padding: 0.75rem 0;
  letter-spacing: 0.5px;
}

/* ── Dare overlay ── */
.jv-dare-overlay {
  position: absolute;
  inset: 0;
  background: var(--jv-yellow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  animation: jv-fade-in 0.3s ease;
  z-index: 10;
}

.jv-dare-card {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 4;
  max-height: 54vh;
  background: var(--jv-orange);
  border: 5px solid var(--jv-dark);
  border-radius: 1.75rem;
  box-shadow: var(--jv-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
  animation: jv-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes jv-pop-in {
  from { opacity: 0; transform: scale(0.82) rotate(-3deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.jv-dare-badge {
  position: absolute;
  top: 1.25rem;
  background: rgba(255,255,255,0.25);
  color: var(--jv-white);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  letter-spacing: 0.5px;
}

.jv-dare-icon {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.jv-dare-text {
  font-size: clamp(1.1rem, 3.5vw, 1.45rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.4;
  color: var(--jv-white);
  margin: 0;
}

/* ── End screen ── */
.jv-end-card {
  background: var(--jv-white);
  border: 5px solid var(--jv-dark);
  border-radius: var(--jv-radius);
  box-shadow: 12px 12px 0 0 var(--jv-dark);
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  margin-bottom: 1.5rem;
}

.jv-end-section-title {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.6px;
  color: rgba(26,26,46,0.45);
  margin: 0 0 0.75rem;
}

.jv-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.jv-stat {
  background: rgba(124,58,237,0.08);
  border: 2px solid var(--jv-dark);
  border-radius: 1rem;
  padding: 0.85rem 0.5rem;
  text-align: center;
}

.jv-stat-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--jv-purple);
  line-height: 1;
  display: block;
}

.jv-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  display: block;
  margin-top: 0.3rem;
  color: var(--jv-dark);
}

.jv-stat.jv-stat-defi .jv-stat-num { color: var(--jv-orange); }
.jv-stat.jv-stat-pass .jv-stat-num { color: rgba(26,26,46,0.35); }

/* ── Scoreboard ── */
.jv-scoreboard {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.jv-score-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(26,26,46,0.03);
  border: 2px solid rgba(26,26,46,0.1);
  border-radius: 0.85rem;
  padding: 0.65rem 0.75rem;
  transition: border-color 0.15s;
}

.jv-score-row--winner {
  background: rgba(245,200,0,0.18);
  border-color: var(--jv-yellow);
  box-shadow: 3px 3px 0 0 var(--jv-dark);
}

.jv-score-rank {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  width: 1.8rem;
  text-align: center;
}

.jv-score-info {
  flex: 1;
  min-width: 0;
}

.jv-score-name {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jv-score-bar-wrap {
  height: 6px;
  background: rgba(26,26,46,0.1);
  border-radius: 99px;
  overflow: hidden;
}

.jv-score-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--jv-purple), var(--jv-purple-l));
  border-radius: 99px;
  transition: width 0.6s ease;
  min-width: 4px;
}

.jv-score-stats {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
}

.jv-score-pill {
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 99px;
  padding: 0.15rem 0.5rem;
  display: inline-block;
  text-align: center;
  min-width: 2.8rem;
}

.jv-score-pill--ans { background: rgba(124,58,237,0.12); color: var(--jv-purple); }
.jv-score-pill--def { background: rgba(255,69,0,0.12);  color: var(--jv-orange); }
.jv-score-pill--skp { background: rgba(26,26,46,0.07);  color: rgba(26,26,46,0.5); }

.jv-score-legend {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 2px solid rgba(26,26,46,0.06);
  flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .jv-panel { padding: 1.1rem; }
  .jv-card-wrap { max-height: 48vh; }
  .jv-dare-card { max-height: 48vh; }
  .jv-title { font-size: 2rem; }
}
