/* ============================================================
   JOGO DO CHAPEU - STYLES
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---- Dark theme (default) ---- */
:root,
[data-theme="dark"] {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface2: #1e2d50;
  --primary: #e94560;
  --primary-dark: #c23152;
  --accent: #0f3460;
  --accent2: #1a4a80;
  --text: #eee;
  --text-muted: #8899aa;
  --success: #4ecca3;
  --warning: #f0a500;
  --danger: #e94560;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* ---- Light theme ---- */
[data-theme="light"] {
  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface2: #e8edf8;
  --primary: #d63050;
  --primary-dark: #b02040;
  --accent: #c6d4f0;
  --accent2: #a0b8e0;
  --text: #1a1a2e;
  --text-muted: #556688;
  --success: #229977;
  --warning: #c07800;
  --danger: #d63050;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
}

.screen {
  display: none;
  min-height: 100dvh;
  padding: 24px 20px;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  text-align: center;
}

h1 {
  font-size: 64px;
  margin-bottom: 8px;
}

h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

h3 {
  font-size: 18px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.highlight {
  color: var(--primary);
  font-size: 28px;
}

/* ============================================================
   SCREEN HEADER
   ============================================================ */

.screen-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 20px;
}

.btn-back {
  position: absolute;
  left: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  -webkit-tap-highlight-color: transparent;
}

.btn-back:hover {
  color: var(--text);
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */

.theme-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface2);
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) 25%, transparent);
}

.theme-toggle:active {
  transform: scale(0.9);
}

.theme-icon {
  font-size: 20px;
  line-height: 1;
  display: block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle:hover .theme-icon {
  transform: rotate(35deg) scale(1.1);
}

.btn-icon {
  background: var(--surface);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: var(--surface2);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 14px 32px;
  transition: transform 0.1s, opacity 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
  margin-top: 16px;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--accent);
  width: 100%;
  margin-top: 12px;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
  width: 100%;
  margin-top: 12px;
  font-size: 14px;
  padding: 10px 24px;
}

.btn-small {
  background: var(--primary);
  color: white;
  width: 48px;
  height: 48px;
  font-size: 24px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

.btn-correct {
  background: var(--success);
  color: var(--bg);
  flex: 1;
  font-size: 18px;
}

.btn-skip {
  background: var(--accent);
  color: var(--text);
  flex: 1;
  font-size: 18px;
}

/* ============================================================
   PLAYERS SCREEN
   ============================================================ */

.mode-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mode-label {
  font-size: 14px;
  color: var(--text-muted);
}

.mode-toggle {
  display: flex;
  background: var(--surface);
  border-radius: 24px;
  padding: 4px;
  gap: 4px;
  border: 2px solid var(--accent);
}

.mode-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mode-btn.active {
  background: var(--primary);
  color: white;
}

.add-player-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

#input-player {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

#input-player:focus {
  border-color: var(--primary);
}

#players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}

.player-tag {
  background: var(--accent);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-tag .remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

.player-tag .remove:hover {
  opacity: 1;
}

.info-text {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.error-text {
  color: var(--primary);
  font-size: 13px;
  margin-bottom: 8px;
  min-height: 20px;
}

/* ============================================================
   THEMES SCREEN
   ============================================================ */

.themes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.theme-chip {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.theme-chip .theme-emoji {
  font-size: 22px;
}

.theme-chip.selected {
  border-color: var(--primary);
  background: rgba(233, 69, 96, 0.15);
  color: var(--primary);
}

/* Full-width for "Livre" chip */
.theme-chip.full-width {
  grid-column: 1 / -1;
}

/* ============================================================
   WORDS SCREEN
   ============================================================ */

.words-theme-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}

.words-theme-hint .theme-badge {
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.rules-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.rules-mini span {
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

#words-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

#words-inputs input {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  outline: none;
  text-align: center;
}

#words-inputs input:focus {
  border-color: var(--primary);
}

/* ============================================================
   TEAMS SCREEN
   ============================================================ */

#teams-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.team-card {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}

.team-card .team-name {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.team-card .team-players {
  font-size: 18px;
}

.swap-hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.swap-players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.swap-chip {
  background: var(--accent);
  color: var(--text);
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.swap-chip.selected {
  border-color: var(--primary);
  background: rgba(255, 90, 101, 0.2);
  color: var(--primary);
}

/* ============================================================
   TURN INTRO SCREEN
   ============================================================ */

.round-badge {
  display: inline-block;
  background: var(--primary);
  padding: 6px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.round-desc {
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 400;
}

.round-rules {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  text-align: left;
}

.round-rules-col {
  flex: 1;
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
}

.round-rules-col.can  { border-color: rgba(72, 199, 142, 0.3); }
.round-rules-col.cannot { border-color: rgba(255, 90, 101, 0.3); }

.rules-col-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.rules-item {
  font-size: 12px;
  color: var(--text);
  padding: 2px 0;
  line-height: 1.4;
}

.turn-spotlight {
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
}

.turn-spotlight-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.turn-role-info {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.turn-role-info strong {
  color: var(--text);
}

/* Upcoming teams queue */
.upcoming-teams {
  margin-bottom: 16px;
}

.upcoming-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.upcoming-list {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.upcoming-team-pill {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.scoreboard-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 14px;
}

.score-row .score-val {
  font-weight: 700;
  color: var(--warning);
}

.score-row.active-team {
  border: 2px solid var(--primary);
}

.words-remaining-badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--accent);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 8px;
}

/* ============================================================
   PLAYING SCREEN
   ============================================================ */

.playing-container {
  display: flex;
  flex-direction: column;
  height: 90dvh;
  justify-content: space-between;
}

.playing-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.playing-round-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.playing-round-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
}

.playing-team-label {
  font-size: 12px;
  color: var(--text-muted);
}

.playing-theme-badge {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 4px;
  text-align: center;
}

.streak-display {
  font-size: 14px;
  font-weight: 700;
  color: var(--warning);
  background: rgba(240, 165, 0, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--warning);
}

.timer-bar {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.timer-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.1s linear, background-color 0.3s;
  width: 100%;
}

.timer-fill.warning {
  background: var(--warning);
}

.timer-fill.danger {
  background: var(--primary);
}

.timer-text {
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.word-card {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 40px 24px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.current-word {
  font-size: 32px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: none;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================================
   TURN END SCREEN
   ============================================================ */

#turn-results {
  margin-bottom: 16px;
}

.turn-results-header {
  margin-bottom: 16px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 14px;
}

.result-item.correct {
  background: rgba(78, 204, 163, 0.15);
  color: var(--success);
}

.result-item.skipped {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* ============================================================
   ROUND END + GAME OVER
   ============================================================ */

#round-scores,
#final-scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.final-team-score {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid transparent;
}

.final-team-score.winner {
  border-color: var(--warning);
}

.final-team-score .team-label {
  font-weight: 600;
}

.final-team-score .score-total {
  font-size: 28px;
  font-weight: 700;
  color: var(--warning);
}

.final-team-score .score-breakdown {
  font-size: 12px;
  color: var(--text-muted);
}

/* Ajuste manual de pontos (− / +) */
.score-adjust {
  display: flex;
  align-items: center;
  gap: 10px;
}
.score-adjust-val {
  text-align: center;
  min-width: 46px;
}
.adj-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  background: var(--surface2);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.adj-btn:active {
  transform: scale(0.9);
  background: var(--accent2);
}
.manual-points {
  justify-content: space-between;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px dashed color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: var(--radius);
}
.manual-points-label {
  font-size: 13px;
  color: var(--text-muted);
}
.manual-points-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}
.manual-points .adj-val {
  min-width: 28px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

/* ============================================================
   GAME STATS
   ============================================================ */

.game-stats {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  text-align: left;
}

.game-stats-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--accent);
  font-size: 13px;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  font-weight: 700;
  color: var(--text);
}

/* ============================================================
   HISTORY SCREEN
   ============================================================ */

#history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  max-height: 60dvh;
  overflow-y: auto;
}

.history-entry {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
}

.history-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-date {
  font-size: 12px;
  color: var(--text-muted);
}

.history-winner {
  font-size: 13px;
  font-weight: 700;
  color: var(--warning);
}

.history-teams {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-team-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.history-team-name {
  color: var(--text-muted);
}

.history-team-score {
  font-weight: 700;
}

.history-team-row.is-winner .history-team-name,
.history-team-row.is-winner .history-team-score {
  color: var(--warning);
}

.history-themes {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.history-theme-tag {
  background: var(--accent);
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
}

.history-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

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

.screen.active .container {
  animation: fadeIn 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.word-card.pop {
  animation: pop 0.2s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-120%); opacity: 0; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

.word-exit-correct {
  animation: slideOutLeft 0.25s ease forwards;
}

.word-exit-skip {
  animation: slideOutRight 0.25s ease forwards;
}

.word-enter {
  animation: slideInRight 0.2s ease forwards;
}

/* Pulse for countdown beeps */
@keyframes timerPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); color: var(--primary); }
  100% { transform: scale(1); }
}

.timer-text.pulse {
  animation: timerPulse 0.2s ease;
}

/* ============================================================
   MODO FÍSICO — display de acertos e botão cartas acabaram
   ============================================================ */

.fisico-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  padding: 20px 0;
}

.fisico-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fisico-counter span:first-child {
  font-size: 80px;
  font-weight: 900;
  line-height: 1;
  color: var(--success);
}

.fisico-counter-label {
  font-size: 16px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 16px;
  opacity: 0.7;
}

.btn-text-link:hover {
  opacity: 1;
  color: var(--danger);
}

.fisico-card-hint {
  background: var(--surface-2, rgba(108, 71, 255, 0.12));
  border: 1px solid var(--primary-dim, rgba(108, 71, 255, 0.3));
  border-radius: 12px;
  padding: 14px 16px;
  margin: 8px 0 4px;
}

.fisico-card-hint-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fisico-card-hint-main {
  font-size: 15px;
  color: var(--text);
}

.fisico-card-hint-rule {
  font-size: 12px;
  color: var(--text-secondary);
}

.fisico-card-hint-variants {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.fisico-reshuffle-hint {
  background: var(--surface-2, rgba(108, 71, 255, 0.1));
  border: 1px solid var(--primary-dim, rgba(108, 71, 255, 0.25));
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  text-align: center;
  margin: 12px 0;
  line-height: 1.5;
}

.btn-cards-empty-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 12px;
  opacity: 0.5;
  margin-top: 4px;
  display: block;
  width: 100%;
  text-align: center;
}

.btn-cards-empty-link:hover {
  opacity: 0.9;
  color: var(--danger);
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */

@media (max-height: 700px) {
  .playing-container {
    height: 95dvh;
  }

  .timer-text {
    font-size: 36px;
  }

  .word-card {
    padding: 24px;
    min-height: 120px;
  }

  .current-word {
    font-size: 26px;
  }
}

/* ============================================================
   HELPERS — classes novas usadas pelo index.html
   ============================================================ */

.info-text-sub {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 8px 0 16px;
  opacity: 0.8;
}

.theme-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 8px 0 16px;
}

.theme-badge {
  background: var(--surface2);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.words-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px;
}

.words-inputs input {
  background: var(--surface);
  border: 2px solid var(--surface2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.words-inputs input:focus {
  border-color: var(--primary);
}

.turn-team-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}

.turn-team-block h2 {
  margin: 4px 0 8px;
  color: var(--primary);
}

.playing-buttons {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.playing-buttons .btn {
  flex: 1;
  padding: 18px 12px;
  font-size: 17px;
  font-weight: 700;
}

/* ============================================================
   MODAL — "Como jogar"
   Paleta da marca: coral, mostarda, sage, papel, tinta
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 23, 38, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: #F5F0E6;
  color: #0E1726;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  animation: modal-in 0.22s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (min-height: 720px) {
  .modal-panel {
    margin: 24px auto;
    border-radius: 18px;
    max-height: calc(100dvh - 48px);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 12px;
  border-bottom: 2px solid rgba(14, 23, 38, 0.08);
  background: #EDE6D6;
  border-radius: 18px 18px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  color: #0E1726;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: #0E1726;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(14, 23, 38, 0.08);
}

.modal-body {
  overflow-y: auto;
  padding: 20px 22px 28px;
  -webkit-overflow-scrolling: touch;
}

/* ---- Conteúdo do manual dentro do modal (estilo livreto) ---- */

.manual {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #2b2b2b;
  line-height: 1.5;
  font-size: 15px;
}

.manual b,
.manual strong { font-weight: 800; color: #1a1a2e; }

/* Capa */
.manual-hero {
  text-align: center;
  background: linear-gradient(135deg, #fdeef6 0%, #eef1fc 50%, #eafaf1 100%);
  border-radius: 16px;
  padding: 28px 18px;
  margin-bottom: 24px;
}
.manual-hero .manual-logo { font-size: 46px; line-height: 1; }
.manual-hero h3 {
  font-family: 'Patrick Hand', cursive;
  font-size: 36px;
  color: #1a1a2e;
  margin: 6px 0 0;
  letter-spacing: 0.5px;
}
.manual-hero .manual-tagline {
  font-family: 'Patrick Hand', cursive;
  font-size: 20px;
  color: #555;
  margin: 0 0 10px;
}
.manual-hero p { color: #5a5a5a; font-size: 14px; margin: 0; }

/* Seção */
.manual-block { margin-bottom: 28px; }
.manual-block > h3 {
  font-family: 'Patrick Hand', cursive;
  font-size: 27px;
  color: #1a1a2e;
  margin: 0 0 6px;
}
.manual-lead { color: #555; font-size: 14.5px; margin: 0 0 14px; }

/* Grades de cards */
.manual-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 440px) {
  .manual-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .manual-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
}
.manual-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.manual-card .ic { font-size: 24px; line-height: 1; }
.manual-card h4 { font-size: 15px; font-weight: 800; color: #1a1a2e; margin: 7px 0 4px; }
.manual-card p { font-size: 13.5px; color: #5a5a5a; margin: 0; }

/* Passos numerados */
.manual-steps { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 440px) { .manual-steps { grid-template-columns: 1fr 1fr; } }
.manual-step { border-top: 2px solid rgba(0,0,0,0.12); padding-top: 8px; }
.manual-step .num { font-family: 'Patrick Hand', cursive; font-size: 22px; color: #9a9a9a; }
.manual-step h4 { font-size: 15px; font-weight: 800; margin: 2px 0 3px; color: #1a1a2e; }
.manual-step p { font-size: 13.5px; color: #5a5a5a; margin: 0; }

/* Fluxo de 4 passos */
.manual-flow {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  margin: 8px 0 16px; text-align: center;
}
.manual-flow .node { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.manual-flow .circle {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid #d8dee9; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.manual-flow .lbl { font-size: 11px; color: #5a5a5a; line-height: 1.2; }

/* Pontuação — números grandes */
.manual-score {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  text-align: center; margin: 6px 0 4px;
}
.manual-score .big { font-family: 'Patrick Hand', cursive; font-size: 42px; color: #1a1a2e; line-height: 1; }
.manual-score h4 { font-size: 13.5px; margin: 8px 0 2px; color: #1a1a2e; font-weight: 800; }
.manual-score p { font-size: 12px; color: #6a6a6a; margin: 0; }

/* Card de rodada */
.manual-round {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-top: 5px solid var(--rc, #999);
  border-radius: 14px;
  padding: 16px;
  margin: 0 0 14px;
}
.manual-round .badge {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--rc, #999) 16%, transparent);
  color: color-mix(in srgb, var(--rc, #999) 72%, #1a1a2e);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 8px;
}
.manual-round h4 { font-family: 'Patrick Hand', cursive; font-size: 25px; color: #1a1a2e; margin: 0 0 6px; }
.manual-round .desc { font-size: 13.5px; color: #5a5a5a; margin: 0 0 12px; }

/* Colunas Pode / Não pode */
.podenao { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 440px) { .podenao { grid-template-columns: 1fr 1fr; } }
.podenao .col { border-radius: 10px; padding: 10px 12px; }
.podenao .col.pode { background: rgba(46, 204, 113, 0.12); }
.podenao .col.nao  { background: rgba(233, 69, 96, 0.10); }
.podenao .col .h { font-weight: 800; font-size: 13.5px; margin-bottom: 6px; color: #1a1a2e; }
.podenao .col ul { margin: 0; padding-left: 18px; }
.podenao .col li { font-size: 13px; color: #444; margin-bottom: 3px; }

/* Notas / dicas */
.manual-note {
  background: rgba(59, 130, 246, 0.10);
  border-radius: 10px; padding: 12px 14px;
  font-size: 13.5px; color: #1a1a2e;
  margin: 14px 0 0; display: flex; gap: 8px; align-items: flex-start;
}
.manual-note .ic { font-size: 18px; line-height: 1.2; }

/* Lista simples */
.manual ul.plain { margin: 0; padding-left: 18px; }
.manual ul.plain li { font-size: 14px; margin-bottom: 5px; color: #444; }
