/* ==========================================================================
   PANIC CANVAS — PINDEREST EDITION
   ========================================================================== */

:root {
  --primary: #E60023;
  --primary-hover: #AD001A;
  --primary-glow: rgba(230, 0, 35, 0.35);

  --bg-dark: #0F1117;
  --bg-card: rgba(26, 30, 42, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.1);
  --bg-glass: rgba(255, 255, 255, 0.05);

  --text-main: #F5F6FA;
  --text-muted: #A0A5B5;

  --accent-easy: #00B894;
  --accent-medium: #FDCB6E;
  --accent-hard: #FF7675;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html { height: -webkit-fill-available; }

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(230, 0, 35, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(108, 92, 247, 0.12) 0%, transparent 40%);
  background-attachment: fixed;
}

.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 28px;
}

@media (min-width: 768px) {
  .app-container { max-width: 620px; padding: 20px; }
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* Ritmo vertical único do app. Tudo que empilha usa o MESMO gap; blocos
   aninhados herdam o ritmo em vez de inventar margens próprias. */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > #joinPrivateBlock,
.stack > #joinPublicBlock,
.public-rooms { display: flex; flex-direction: column; gap: 14px; }

/* Zera margens avulsas que quebravam o ritmo. */
.stack > p,
.stack > .hint,
.stack > .form-error,
.quick-play-hint { margin: 0; }

/* ---------- Header ---------- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-logo-img {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 4px 14px var(--primary-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.1;
  color: #FFF;
}

.badge {
  font-size: 10px; font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: var(--transition-fast);
}
.icon-btn:active { transform: scale(0.92); }

.conn-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.conn-badge.ok { color: #55E6C1; background: rgba(85, 230, 193, 0.12); }
.conn-badge.warn { color: #FFD043; background: rgba(255, 208, 67, 0.12); }
.conn-badge.bad { color: #FF7675; background: rgba(255, 118, 117, 0.14); }

/* ---------- Estruturas ---------- */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.screen { display: none; flex-direction: column; gap: 16px; animation: fadeIn 0.3s ease; }
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-banner { text-align: center; padding: 10px; }
.hero-banner h2 {
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 800;
  margin-bottom: 6px; color: #FFF;
}
.hero-banner p { font-size: 13px; color: var(--text-muted); }

.panel-title {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 800;
  display: flex; align-items: center; gap: 8px;
}

.muted-label { font-size: 12px; color: var(--text-muted); }
.hint { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.form-error { font-size: 13px; font-weight: 700; color: #FF7675; min-height: 18px; text-align: center; }
.form-error.info { color: var(--text-muted); font-weight: 600; }

.chip {
  font-size: 11px; font-weight: 800;
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.host-chip { color: var(--primary); border-color: var(--primary); }

.divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: 11px; text-transform: uppercase;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--bg-card-border);
}

/* ---------- Formulários ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.form-group { display: flex; flex-direction: column; }

.text-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  color: #FFF;
  font-family: var(--font-family);
  font-size: 15px; font-weight: 600;
  user-select: text;
}
.text-input:focus { outline: none; border-color: var(--primary); }

.code-input {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 24px; font-weight: 900;
  letter-spacing: 8px;
  text-transform: uppercase;
}

.join-form { display: flex; gap: 8px; }
.join-form .code-input { flex: 1; }

/* ---------- Contador de gente online ---------- */
.online-pill {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(0, 184, 148, 0.14);
  border: 1px solid rgba(0, 184, 148, 0.45);
  font-size: 12px; font-weight: 700;
  color: #7BE8D5;
}
.online-pill strong {
  font-family: var(--font-heading);
  font-size: 15px; font-weight: 900;
  color: #FFF;
}
.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #00E5A0;
  box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.7);
  animation: pulsoOnline 2s infinite;
}
@keyframes pulsoOnline {
  0%   { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 229, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0); }
}
@media (prefers-reduced-motion: reduce) { .online-dot { animation: none; } }

/* ---------- Salas públicas ---------- */
.public-rooms { display: flex; flex-direction: column; gap: 10px; }
.rooms-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }

.room-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.room-row.cheia { opacity: 0.55; }

.room-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.room-name {
  font-family: var(--font-heading);
  font-size: 15px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.room-count {
  font-size: 11px; font-weight: 900;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 184, 148, 0.18);
  color: #55E6C1;
  border: 1px solid rgba(0, 184, 148, 0.5);
}
.room-count.cheia { background: rgba(255, 118, 117, 0.18); color: #FF9F9E; border-color: rgba(255, 118, 117, 0.5); }

.room-tag {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 180, 0, 0.15);
  color: #FFD043;
  border: 1px solid rgba(255, 180, 0, 0.45);
}
.room-tag.vaga { background: rgba(108, 92, 231, 0.18); color: #B7ADFF; border-color: rgba(108, 92, 231, 0.5); }

.avatar-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-choice {
  width: 46px; height: 46px; padding: 0;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background: transparent; cursor: pointer;
  transition: var(--transition-fast);
  opacity: 0.5;
}
.avatar-choice img { width: 100%; height: 100%; border-radius: var(--radius-full); display: block; }
.avatar-choice.active { border-color: var(--primary); opacity: 1; transform: scale(1.06); }

.score-selector { display: flex; gap: 8px; }
.score-chip {
  flex: 1;
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 10px 6px;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-weight: 700; font-size: 14px;
  cursor: pointer; transition: var(--transition-fast);
}
.score-chip small { display: block; font-size: 10px; font-weight: 500; color: var(--text-muted); }
.score-chip.active { background: var(--primary); border-color: var(--primary); box-shadow: 0 4px 14px var(--primary-glow); }
.score-chip.active small { color: rgba(255, 255, 255, 0.85); }

/* ---------- Botões ---------- */
.btn {
  font-family: var(--font-family);
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 20px; font-size: 14px;
  transition: var(--transition-fast);
  color: #FFF;
}
.btn-primary { background: var(--primary); box-shadow: 0 6px 18px var(--primary-glow); }
.btn-primary:active { transform: scale(0.97); background: var(--primary-hover); }
.btn-secondary { background: rgba(255, 255, 255, 0.1); border: 1px solid var(--bg-card-border); }
.btn-ghost { background: transparent; border: 1px solid var(--bg-card-border); color: var(--text-muted); }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-lg { padding: 15px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn:disabled.pulse, .btn.disabled.pulse { animation: none; }

.pulse { animation: pulseBtn 2s infinite; }
@keyframes pulseBtn {
  0% { box-shadow: 0 0 0 0 rgba(230, 0, 35, 0.6); }
  70% { box-shadow: 0 0 0 14px rgba(230, 0, 35, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 0, 35, 0); }
}

/* ---------- Sala / lobby ---------- */
.room-code {
  font-family: var(--font-heading);
  font-size: 46px; font-weight: 900;
  letter-spacing: 10px;
  color: #FFF;
  text-shadow: 0 6px 24px var(--primary-glow);
  user-select: text;
}

.lobby-players { display: flex; flex-direction: column; gap: 8px; }
.lobby-player {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-weight: 600; font-size: 14px;
}
.lobby-player img { width: 32px; height: 32px; border-radius: var(--radius-full); }
.lobby-player.is-me { border-color: var(--primary); background: rgba(230, 0, 35, 0.1); }
.lobby-player .chip { margin-left: auto; }

.lobby-teams { display: flex; flex-direction: column; gap: 8px; }
.lobby-team {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.lobby-team strong { font-family: var(--font-heading); font-size: 15px; }
.lobby-team span { font-size: 12px; color: var(--text-muted); }

.player-avatar-small { width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; }

/* ---------- Vez da dupla ---------- */
.team-badge-large { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.team-avatar-lg {
  width: 88px; height: 88px;
  border-radius: var(--radius-full);
  border: 4px solid var(--primary);
  box-shadow: 0 8px 24px var(--primary-glow);
  object-fit: cover;
}

.turn-duo-info { display: flex; align-items: center; justify-content: space-around; width: 100%; gap: 12px; }
.player-role-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.avatar-wrapper { position: relative; }
.avatar-wrapper img {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-card-border);
  object-fit: cover;
}
.role-badge {
  position: absolute; bottom: -8px; left: 50%;
  transform: translateX(-50%);
  background: var(--primary); color: #FFF;
  font-size: 10px; font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.player-role-card h4 { font-size: 14px; }
.versus-icon { font-size: 22px; color: var(--text-muted); font-weight: 900; }

.callout {
  background: var(--bg-glass);
  border: 1px dashed var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px; line-height: 1.45;
  color: var(--text-muted);
}
.callout.warn { background: rgba(255, 180, 0, 0.1); border-color: #FFB400; color: #FFD043; }
.callout.go { background: rgba(0, 184, 148, 0.12); border-color: var(--accent-easy); color: #55E6C1; font-weight: 700; }

/* ---------- Sorteio ---------- */
.spin-card {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 26px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: var(--transition-normal);
}
.spin-emoji { font-size: 46px; line-height: 1; }
.spin-label { font-family: var(--font-heading); font-size: 24px; font-weight: 900; }
.spin-meta { font-size: 13px; color: var(--text-muted); font-weight: 700; }

.spin-card.landed { transform: scale(1.05); }
.spin-card.landed.easy { border-color: var(--accent-easy); background: rgba(0, 184, 148, 0.12); }
.spin-card.landed.medium { border-color: var(--accent-medium); background: rgba(253, 203, 110, 0.12); }
.spin-card.landed.hard { border-color: var(--accent-hard); background: rgba(255, 118, 117, 0.12); }

.spin-word-box {
  background: #FFF; color: #111;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.spin-word-box .muted-label { color: #777; }
.spin-word {
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 900;
  color: #111; margin-top: 4px;
}

/* ---------- HUD e canvas ---------- */
.game-hud {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.hud-team { display: flex; align-items: center; gap: 10px; }
.hud-team img { width: 36px; height: 36px; border-radius: var(--radius-full); object-fit: cover; }
.hud-team-title { font-size: 13px; font-weight: 700; }
.hud-score-wrapper { font-size: 11px; color: var(--text-muted); }

.hud-timer {
  background: rgba(230, 0, 35, 0.15);
  border: 1px solid var(--primary);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-heading);
  font-weight: 900; font-size: 16px;
  color: var(--primary);
}
.hud-timer.panic { animation: panicFlash 0.5s infinite alternate; }
@keyframes panicFlash {
  from { background: var(--primary); color: #FFF; }
  to { background: #FF7675; color: #FFF; }
}

.prompt-banner {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.prompt-label { font-size: 11px; color: var(--text-muted); }
.prompt-word {
  font-family: var(--font-heading);
  font-size: 18px; font-weight: 900;
  letter-spacing: 1px; color: #FFF;
  user-select: none;
}
.prompt-word.masked { letter-spacing: 4px; color: var(--text-muted); }
.points-badge {
  font-size: 12px; font-weight: 800;
  background: var(--primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #FFF;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#drawingCanvas {
  display: block;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: crosshair;
  background: #FFF;
}

/* Fica ACIMA do quadro branco, alinhado ao ritmo do resto da tela. */
.canvas-lock {
  align-self: center;
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  font-size: 12px; font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  pointer-events: none;
  max-width: 100%;
  text-align: center;
}

.canvas-toolbar {
  position: absolute; bottom: 10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 19, 24, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--bg-card-border);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  max-width: calc(100% - 20px);
}

.color-palette { display: flex; gap: 6px; }
.color-btn {
  width: 24px; height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0;
}
.color-btn.active { transform: scale(1.25); border-color: #FFF; }

.tool-controls {
  display: flex; gap: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 10px;
}
.tool-btn {
  background: transparent; border: none;
  font-size: 16px; cursor: pointer; opacity: 0.75;
  transition: var(--transition-fast);
  padding: 2px;
}
.tool-btn.active { opacity: 1; transform: scale(1.15); }
.tool-btn:active { transform: scale(0.9); opacity: 1; }

/* ---------- Palpites ---------- */
.guessing-section { padding: 14px; }
.guesser-banner { font-size: 12px; color: var(--text-muted); }
.guess-form { display: flex; gap: 8px; }
.guess-form input {
  flex: 1; min-width: 0;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-full);
  padding: 12px 18px;
  color: #FFF;
  font-family: var(--font-family);
  font-size: 14px; font-weight: 600;
  user-select: text;
}
.guess-form input:focus { outline: none; border-color: var(--primary); }

.btn-foul {
  align-self: center;
  background: rgba(255, 118, 117, 0.12);
  border: 1px solid rgba(255, 118, 117, 0.6);
  color: #FF9F9E;
  font-size: 12px; font-weight: 700;
  padding: 8px 16px;
}
.btn-foul:active { background: rgba(255, 118, 117, 0.25); transform: scale(0.96); }

/* Quando o sistema suspeita de escrita, o botão chama atenção — mas quem
   decide continua sendo gente. */
.btn-foul.alerta {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
  animation: pulseBtn 1.6s infinite;
}

.write-warn {
  position: absolute;
  left: 50%; bottom: 62px;
  transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px);
  background: rgba(230, 0, 35, 0.95);
  color: #FFF;
  font-size: 12px; font-weight: 800;
  text-align: center;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  animation: toastIn 0.2s ease;
}

.result-header.void h2 { color: #FFD043; }

.guess-feed { display: flex; flex-direction: column; gap: 5px; }
.guess-row {
  font-size: 13px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  animation: fadeIn 0.2s ease;
}
.guess-row.wrong { color: #FF9F9E; }
.guess-row.correct { color: #55E6C1; font-weight: 800; }

/* ---------- Resultado / pin ---------- */
.result-header { text-align: center; padding: 6px 0; }
.result-header h2 { font-family: var(--font-heading); font-size: 22px; font-weight: 900; }
.result-header p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.result-header.success h2 { color: #55E6C1; }
.result-header.fail h2 { color: #FF7675; }

.pinterest-pin-preview {
  background: #FFF; color: #111;
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex; flex-direction: column; gap: 10px;
}
.pin-header { display: flex; align-items: center; gap: 10px; }
.pin-head-text { min-width: 0; }
.pin-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); object-fit: cover; }
.pin-header h4 { font-size: 14px; font-weight: 800; }
.pin-tag { font-size: 11px; color: var(--primary); font-weight: 700; word-break: break-word; }
.pin-score {
  margin-left: auto;
  background: var(--primary); color: #FFF;
  font-weight: 900; font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
/* A palavra da rodada é a informação mais importante do card — antes ficava
   como uma tag minúscula e passava despercebida. */
.pin-word-hero {
  background: linear-gradient(135deg, #E60023, #FF7675);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
  box-shadow: 0 6px 18px var(--primary-glow);
}
.pin-word-label {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
}
.pin-word-hero strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 30px; font-weight: 900;
  line-height: 1.15;
  color: #FFF;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  word-break: break-word;
  animation: wordPop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.pin-word-hero.success { background: linear-gradient(135deg, #00B894, #55E6C1); }
.pin-word-hero.success strong { color: #05261F; text-shadow: none; }
.pin-word-hero.success .pin-word-label { color: rgba(5, 38, 31, 0.75); }

@keyframes wordPop {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.pin-image-wrapper {
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden; background: #F0F0F0;
}
.pin-image-wrapper img { width: 100%; height: 100%; object-fit: contain; }
.pin-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.pin-authors { color: #555; }
.btn-like {
  background: #FFEAA7; border: none;
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-family: var(--font-family);
  font-weight: 800; font-size: 13px;
  cursor: pointer; white-space: nowrap;
  transition: var(--transition-fast);
}
.btn-like:active { transform: scale(0.92); }
.btn-like.liked { background: #FFD5D4; cursor: default; opacity: 0.85; }
.btn-like.liked:active { transform: none; }

.mini-leaderboard { display: flex; flex-direction: column; gap: 8px; }
.leaderboard-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}
.leaderboard-row.highlight { border-color: var(--primary); background: rgba(230, 0, 35, 0.1); }
.leaderboard-row .team-info { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; min-width: 0; }
.leaderboard-row .score { font-family: var(--font-heading); font-weight: 900; color: var(--primary); white-space: nowrap; font-size: 13px; }

/* ---------- Vitória ---------- */
.crown-icon { font-size: 52px; }
.victory-title {
  font-family: var(--font-heading);
  font-size: 34px; font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #FFD043, #E60023);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.winning-team-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.winner-avatar {
  width: 96px; height: 96px;
  border-radius: var(--radius-full);
  border: 4px solid #FFD043;
  box-shadow: 0 8px 30px rgba(255, 208, 67, 0.4);
  object-fit: cover;
}
.winning-score { font-family: var(--font-heading); font-size: 24px; font-weight: 900; color: var(--primary); }

.pinterest-board-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}
.board-pin-item {
  background: #FFF;
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.board-pin-item img { width: 100%; border-radius: var(--radius-sm); display: block; }
.board-pin-item .pin-caption { font-size: 11px; font-weight: 800; color: #111; margin-top: 4px; word-break: break-word; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 999;
}
.modal-content { max-width: 440px; width: 100%; max-height: 80vh; overflow-y: auto; }
/* Título centralizado de verdade: o X fica absoluto para não puxar o texto. */
.modal-header {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  min-height: 32px;
}
.modal-header h3 { text-align: center; font-size: 18px; }
.modal-header .close-btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.close-btn { background: transparent; border: none; color: #FFF; font-size: 26px; line-height: 1; cursor: pointer; }
.modal-body ol { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.45; }
.modal-sub {
  list-style: none;
  padding: 8px 0 0;
  margin: 0;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--text-muted);
}
.modal-sub strong { color: var(--text-main); }

/* ---------- Dicas (categoria / dificuldade) ---------- */
.prompt-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.prompt-hints { display: flex; flex-wrap: wrap; gap: 6px; }

.hint-chip {
  font-size: 11px; font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--bg-card-border);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.hint-chip.cat { background: rgba(0, 166, 153, 0.18); border-color: var(--accent-easy); color: #7BE8D5; }

.spin-category {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(0, 166, 153, 0.14);
  border: 1px solid var(--accent-easy);
  border-radius: var(--radius-md);
  padding: 10px 16px;
}
.spin-category strong { font-family: var(--font-heading); font-size: 18px; color: #7BE8D5; }

.icon-btn.danger { border-color: rgba(255, 118, 117, 0.5); }

/* ---------- Reações ---------- */
.reaction-dock {
  position: fixed;
  right: 14px; bottom: 18px;
  z-index: 900;
  display: flex; align-items: center; gap: 8px;
}

.reaction-toggle {
  width: 50px; height: 50px;
  border-radius: var(--radius-full);
  border: 1px solid var(--bg-card-border);
  background: rgba(17, 19, 24, 0.94);
  font-size: 22px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  transition: var(--transition-fast);
}
.reaction-toggle:active { transform: scale(0.9); }

/* Em espera: mostra os segundos que faltam em vez do emoji. */
.reaction-toggle.esperando {
  font-family: var(--font-heading);
  font-size: 18px; font-weight: 900;
  color: var(--text-muted);
  background: rgba(17, 19, 24, 0.7);
  cursor: not-allowed;
  opacity: 0.7;
}
.reaction-toggle.esperando:active { transform: none; }

.reaction-bar {
  display: flex; gap: 4px;
  background: rgba(17, 19, 24, 0.96);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-full);
  padding: 6px 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.18s ease;
  max-width: calc(100vw - 90px);
  overflow-x: auto;
}

.reaction-btn {
  background: transparent; border: none;
  font-size: 22px; cursor: pointer;
  padding: 2px 4px; line-height: 1;
  transition: var(--transition-fast);
}
.reaction-btn:active { transform: scale(1.35); }

.emoji-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 950;
  overflow: hidden;
}

.float-emoji {
  position: absolute;
  bottom: 80px;
  font-size: 38px;
  animation: floatUp 2.4s ease-out forwards;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}
.float-emoji .who {
  display: block;
  font-size: 11px; font-weight: 800;
  color: #FFF;
  text-align: center;
  margin-top: -4px;
}

@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  15%  { opacity: 1; transform: translateY(-30px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-55vh) scale(0.9); }
}

/* ---------- Partida pausada ---------- */
.paused-icon { font-size: 46px; }
.panel-title.center { justify-content: center; }

/* ---------- Avisos flutuantes ---------- */
.toast-area {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 998;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  background: rgba(17, 19, 24, 0.96);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px; font-weight: 700;
  color: #FFF;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Confete ---------- */
.confetti-bit {
  position: fixed; top: -12px;
  width: 8px; height: 14px;
  z-index: 9999; pointer-events: none;
  border-radius: 2px;
  transition: transform 2.5s ease-out, top 2.5s ease-out, opacity 2.5s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .pulse, .hud-timer.panic { animation: none; }
  .screen, .guess-row { animation: none; }
  .confetti-bit { display: none; }
}
