/* ═══════════════════════════════════════════════════════════
   IMPOSTOR.CSS — Stile modalità Impostore
   ═══════════════════════════════════════════════════════════ */

#screen-impostor-setup {
  flex-direction: column;
  background: #0d1117;
  overflow-y: auto;
}

.imp-header {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  height: 56px;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(10px);
  margin: 0;
}

.imp-header-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.btn-info {
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3);
  color: var(--c-accent);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.btn-info:hover { background: rgba(0,212,255,0.2); }

.imp-setup-body {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center;
  padding: 28px 20px;
  gap: 20px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.imp-setup-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 3px;
  color: var(--c-white);
  text-align: center;
}

#playerInputs {
  width: 100%;
  display: flex; flex-direction: column;
  gap: 10px;
}

.player-input-row {
  display: flex; gap: 8px; align-items: center;
}

.player-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--c-white);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 700;
  padding: 12px 16px;
  outline: none;
  letter-spacing: 1px;
  transition: border-color 0.2s;
}
.player-input:focus { border-color: var(--c-accent); background: rgba(0,212,255,0.06); }
.player-input::placeholder { color: rgba(255,255,255,0.2); font-size: 14px; font-weight: 400; }

.btn-remove-player {
  background: rgba(255,71,87,0.1);
  border: 1px solid rgba(255,71,87,0.3);
  color: #ff4757;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 14px; cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.btn-remove-player:hover { background: rgba(255,71,87,0.2); }

.btn-add-player {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1.5px dashed rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.4);
  border-radius: 10px;
  padding: 12px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-add-player:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.25); color: var(--c-white); }

.imp-error {
  display: none;
  color: #ff4757;
  font-size: 13px;
  text-align: center;
}

.btn-start-impostor {
  width: 100%;
  background: linear-gradient(135deg, #6a0dad, #9b30ff);
  border: none; cursor: pointer; color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(155,48,255,0.4);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-start-impostor:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(155,48,255,0.55); }
.btn-start-impostor:active { transform: scale(0.98); }

/* ─── CARDS SCREEN ─── */
#screen-impostor-cards {
  flex-direction: column;
  background: #0d1117;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px;
}

.card-counter {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.imp-card-wrap {
  width: 100%;
  max-width: 360px;
  height: 340px;
  perspective: 1000px;
  cursor: pointer;
}

.imp-card {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}
.imp-card.flipped { transform: rotateY(180deg); }

.card-front, .card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  padding: 24px 20px;
}

.card-front {
  background: #161b22;
  border: 1px solid rgba(255,255,255,0.1);
}

.card-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  background: #0d1117;
  overflow: hidden;
  flex-shrink: 0;
}
.card-avatar img {
  width: 100%; height: 100%;
  display: block;
}

.card-person-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(20px, 4vw, 28px);
  letter-spacing: 2px;
  color: #f5f5f0;
  text-align: center;
  line-height: 1.1;
}

.card-tap-hint {
  font-size: 10px;
  text-transform: uppercase; letter-spacing: 2px;
  color: rgba(255,255,255,0.2);
}

.card-back {
  background: #12081e;
  border: 1px solid rgba(155,48,255,0.3);
  transform: rotateY(180deg);
  justify-content: center;
  gap: 16px;
}

.card-role-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 3px;
  color: rgba(255,255,255,0.25);
}

.card-role {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(26px, 5vw, 38px);
  letter-spacing: 2px;
  color: #2ecc71;
  text-align: center;
  line-height: 1;
}
.card-role.impostor { color: #ff4757; }

.card-hint {
  display: none;
  font-size: 13px;
  color: rgba(255,200,0,0.9);
  text-align: center;
  font-style: italic;
  background: rgba(255,200,0,0.07);
  border: 1px solid rgba(255,200,0,0.2);
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.5;
  width: 100%;
}

.btn-next-card {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: #f5f5f0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 12px 40px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-next-card:hover { background: rgba(255,255,255,0.1); }

/* ─── GAME SCREEN ─── */
#screen-impostor-game {
  flex-direction: column;
  background: #0d1117;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px;
}

.imp-game-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(20px, 3.5vw, 28px);
  letter-spacing: 3px;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

.imp-timer-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(64px, 15vw, 100px);
  letter-spacing: 4px;
  color: var(--c-white);
  line-height: 1;
}

.imp-timer-bar-bg {
  width: 100%; max-width: 400px;
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  overflow: hidden;
}

.imp-timer-fill {
  height: 100%; width: 100%;
  border-radius: 10px;
  background: #9b30ff;
  transition: width 1s linear, background 0.5s;
}
.imp-timer-fill.warning { background: #f5c518; }
.imp-timer-fill.danger  { background: #ff4757; animation: timerPulse 0.6s ease infinite; }

.imp-vote-section {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column;
  gap: 10px;
}

.imp-vote-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
  color: rgba(255,255,255,0.35);
  text-align: center;
}

.imp-vote-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--c-white);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px; font-weight: 700;
  padding: 13px 16px;
  outline: none;
  text-align: center; letter-spacing: 2px;
  transition: border-color 0.2s;
}
.imp-vote-input:focus { border-color: #ff4757; background: rgba(255,71,87,0.06); }
.imp-vote-input::placeholder { color: rgba(255,255,255,0.2); font-size: 14px; font-weight: 400; }

.btn-vote {
  width: 100%;
  background: linear-gradient(135deg, #8b0000, #ff4757);
  border: none; cursor: pointer; color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(255,71,87,0.3);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-vote:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,71,87,0.45); }

.btn-end-early {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.3);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-end-early:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.6); }

/* ─── RESULT SCREEN ─── */
#screen-impostor-result {
  flex-direction: column;
  background: #0d1117;
  overflow: hidden;
  align-items: stretch;
}
.imp-result-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 8vw, 60px);
  letter-spacing: 3px;
  text-align: center;
}
.imp-result-title.team-wins     { color: var(--c-grass); }
.imp-result-title.impostor-wins { color: #ff4757; }

.imp-result-desc {
  font-size: 16px;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

.imp-result-reveal {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px 28px;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  width: 100%; max-width: 360px;
}

.imp-result-player-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
  color: rgba(255,255,255,0.3);
}

.imp-result-player-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: 2px;
  color: var(--c-accent);
}

.imp-result-who {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

.imp-result-btns {
  display: flex; flex-direction: column;
  gap: 10px; width: 100%; max-width: 360px;
}

.btn-play-again-imp {
  width: 100%;
  background: linear-gradient(135deg, #6a0dad, #9b30ff);
  border: none; cursor: pointer; color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(155,48,255,0.3);
  transition: transform 0.15s;
}
.btn-play-again-imp:hover { transform: translateY(-2px); }

.btn-home-imp {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-home-imp:hover { background: rgba(255,255,255,0.09); color: var(--c-white); }

/* ─── ANIMAZIONI RISULTATO ─── */

/* Flash rosso — impostore vince */
.red-flash {
  position: absolute; inset: 0;
  background: rgba(255,71,87,0.15);
  animation: flashFade 0.6s ease forwards;
}

/* Flash verde — squadra vince */
.green-flash {
  position: absolute; inset: 0;
  background: rgba(46,204,113,0.15);
  animation: flashFade 0.6s ease forwards;
}

/* Flash bianco — reveal */
.reveal-flash {
  position: absolute; inset: 0;
  background: rgba(0,212,255,0.2);
  animation: flashFade 0.8s ease forwards;
}

@keyframes flashFade {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Spia che scappa */
.spy-run {
  position: absolute;
  bottom: 20%;
  left: -80px;
  font-size: 64px;
  animation: spyEscape 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes spyEscape {
  0%   { left: -80px; transform: scaleX(1); opacity: 1; }
  60%  { left: 60%;   transform: scaleX(1); opacity: 1; }
  80%  { left: 80%;   transform: scaleX(-1); opacity: 1; }
  100% { left: 110%;  transform: scaleX(-1); opacity: 0; }
}

/* Nuvole di fumo */
.smoke {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  animation: smokeUp 2s ease forwards;
}
.smoke-1 { width: 60px; height: 60px; bottom: 22%; left: 30%; animation-delay: 0.3s; }
.smoke-2 { width: 40px; height: 40px; bottom: 25%; left: 38%; animation-delay: 0.5s; }
.smoke-3 { width: 80px; height: 80px; bottom: 20%; left: 24%; animation-delay: 0.7s; }

@keyframes smokeUp {
  0%   { opacity: 0; transform: scale(0) translateY(0); }
  30%  { opacity: 0.6; }
  100% { opacity: 0; transform: scale(3) translateY(-80px); }
}

/* Coriandoli */
.confetto {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { top: -20px; opacity: 1; transform: rotate(0deg) translateX(0); }
  100% { top: 110vh; opacity: 0.3; transform: rotate(720deg) translateX(40px); }
}

/* Trofeo */
.trophy-pop {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 80px;
  animation: trophyBounce 0.7s 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
  filter: drop-shadow(0 0 30px rgba(245,197,24,0.6));
}

@keyframes trophyBounce {
  from { transform: translate(-50%, -50%) scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

/* Rimuovi trofeo dopo un po' */
.trophy-pop { animation: trophyBounce 0.7s 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards, trophyFade 0.5s 2.5s ease forwards; }

@keyframes trophyFade {
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* ─── RESULT SCREEN senza padding top ─── */
#screen-impostor-result {
  flex-direction: column;
  background: #0d1117;
  overflow: hidden;
}