/* styles.css - Design System Arcade & Party Game para Lean Six Sigma Green Belt */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Fredoka', 'Outfit', sans-serif;
  --font-arcade: 'Fredoka', cursive, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Cores Temáticas de Lean Six Sigma Vibrantes */
  --color-hypothesis: #3b82f6;   /* Azul Royal Elétrico - Série T */
  --color-lean: #f97316;         /* Laranja Pop / Tangerina - Série L */
  --color-control: #10b981;      /* Verde Menta / Esmeralda - Série C */
  --color-define: #f59e0b;       /* Dourado Solar / Sol - Série D */

  /* Paleta Arcade Alto-Astral & Convidativa */
  --bg-primary: #12102b;
  --bg-secondary: #1c1844;
  --bg-tertiary: #28225e;
  --bg-card: rgba(28, 24, 68, 0.88);
  --bg-card-hover: rgba(45, 38, 105, 0.95);

  --text-main: #ffffff;
  --text-muted: #a5b4fc;
  --text-dim: #818cf8;

  --border-subtle: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.28);
  --border-glow: rgba(99, 102, 241, 0.6);

  --accent-cyan: #22d3ee;
  --accent-gold: #fbbf24;
  --accent-pink: #f43f5e;
  --accent-purple: #a855f7;
  --accent-success: #34d399;
  --accent-danger: #f87171;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.5);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(99, 102, 241, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(244, 63, 94, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.15) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Estrutura Raiz */
.app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

/* Header Global */
.global-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand-badge {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #2563EB, #06b6d4);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
  letter-spacing: 0.05em;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #9333EA);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
}

/* Área Principal e Rotas */
.main-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.view-screen {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  padding: 20px 16px;
  flex: 1;
}

.view-screen.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}

/* Utilitários Visuais */
.hidden {
  display: none !important;
}

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

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-accent {
  background: linear-gradient(135deg, #EA580C, #C2410C);
  color: white;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.4);
}
.btn-accent:hover {
  background: linear-gradient(135deg, #F97316, #EA580C);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.btn-danger-outline {
  background: transparent;
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-block {
  width: 100%;
}

.btn-large {
  padding: 16px 28px;
  font-size: 1.05rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

.icon-btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.icon-btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

/* Formulários & Inputs */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-group input, 
.input-group select,
.select-wrapper select,
.fallback-input-row input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: border-color var(--transition-fast);
}

.input-group input:focus,
.select-wrapper select:focus,
.fallback-input-row input:focus {
  outline: none;
  border-color: var(--color-hypothesis);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* 1. e 2. TELAS DE AUTH E SIGNUP */
#view-auth, #view-signup {
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 100px);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-hero {
  margin-bottom: 24px;
}

.game-icon-glow {
  font-size: 2.8rem;
  margin-bottom: 8px;
  display: inline-block;
  filter: drop-shadow(0 0 16px rgba(37, 99, 235, 0.6));
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.auth-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.auth-divider span {
  padding: 0 12px;
}

.auth-footer {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.text-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}
.text-link:hover {
  text-decoration: underline;
}

/* 3. TELA DE LOBBY */
.lobby-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.view-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
}

.view-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.quick-join-box {
  padding: 20px;
  margin-bottom: 24px;
}

.quick-join-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
  min-width: 160px;
}

.rooms-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rooms-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rooms-section-title h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.live-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-normal);
}
.room-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.room-title {
  font-weight: 700;
  font-size: 1rem;
}

.room-code-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
}

.room-details {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 4. SETUP DA PARTIDA */
.setup-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 28px;
  width: 100%;
}

.setup-header {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-back {
  align-self: flex-start;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.btn-back:hover {
  color: white;
}

.setup-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.setup-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.player-count-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.btn-count-opt {
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-count-opt.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--color-hypothesis);
  color: white;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.3);
}

.group-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.deck-tip {
  font-size: 0.78rem;
  color: var(--accent-gold);
}

.deck-selectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.deck-check-card {
  position: relative;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 4px solid var(--deck-accent);
}

.deck-check-card input {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  accent-color: var(--deck-accent);
}

.deck-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-right: 28px;
}

.deck-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
}

.deck-count {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.deck-card-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.deck-card-content p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.setup-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* 5. SALA DE ESPERA (WAITING ROOM) */
.waiting-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px;
  width: 100%;
}

.waiting-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.room-pill {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 8px;
}

.waiting-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .waiting-grid {
    grid-template-columns: 1fr;
  }
}

.qr-share-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.qr-box {
  background: white;
  padding: 12px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.qr-instruction {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.code-big {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
}

.copy-feedback-msg {
  font-size: 0.75rem;
  color: var(--accent-success);
  margin-top: 4px;
}

.players-connected-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.connected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.connected-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.live-dot-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-success);
  box-shadow: 0 0 10px var(--accent-success);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.waiting-players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.waiting-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.player-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-badge-role {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.status-badge-ready {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-success);
}

.status-badge-waiting {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.waiting-actions-footer {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* 6. MESA DE JOGO (GAME TABLE) */
#view-game {
  padding: 8px 12px 16px 12px;
}

.game-table-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 84px);
  height: auto;
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 24px;
}

.game-action-toolbar {
  position: relative;
  z-index: 20;
}

.select-wrapper {
  position: relative;
  z-index: 22;
}

.select-wrapper select {
  cursor: pointer;
  background-color: #1e293b !important;
}

/* Oponentes no topo */
.opponents-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.opponent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.opponent-card.is-active-turn {
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
  background: rgba(30, 41, 59, 0.9);
}

.opponent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.opponent-info {
  display: flex;
  flex-direction: column;
}

.opponent-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.opponent-cards-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.opponent-color-pills {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Centro da mesa */
.board-center-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.turn-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  align-self: center;
}

.turn-avatar {
  font-size: 1.2rem;
}

.turn-text-info {
  display: flex;
  flex-direction: column;
}

.turn-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.turn-player-name {
  font-size: 0.92rem;
  color: var(--accent-gold);
}

.turn-timer {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  padding: 4px 8px;
  border-radius: 6px;
}

.board-deck-area {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-height: 100px;
}

@media (max-width: 640px) {
  .board-deck-area {
    flex-direction: column;
    align-items: stretch;
  }
}

.deck-pile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  align-self: flex-start;
}
.deck-pile:hover {
  border-color: var(--color-hypothesis);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.deck-pile-cards {
  position: relative;
  width: 50px;
  height: 70px;
}

.card-back-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.card-back-layer.l3 { top: -4px; left: -4px; }
.card-back-layer.l2 { top: -2px; left: -2px; }
.card-back-layer.l1 {
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.deck-brand {
  font-size: 0.65rem;
  font-weight: 800;
  color: #60a5fa;
}

.deck-pile-info {
  display: flex;
  flex-direction: column;
}

.deck-draw-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.deck-count-num {
  font-size: 1.2rem;
  font-family: var(--font-heading);
}

.deck-action-hint {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.game-log-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s ease;
  min-width: 240px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
}

.game-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.game-log-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.game-log-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
}

.game-log-badge {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.btn-toggle-log {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-toggle-log:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-cyan);
  color: #38bdf8;
  transform: translateY(-1px);
}

.game-log-feed {
  flex: 1;
  height: 90px;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 5px;
  transition: all 0.25s ease;
  background: rgba(15, 23, 42, 0.6);
}

.game-log-container.is-collapsed {
  flex: 0 0 auto;
}

.game-log-container.is-collapsed .game-log-feed {
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
}

.log-entry {
  color: #cbd5e1;
  line-height: 1.4;
}

.log-entry.system-log {
  color: var(--accent-cyan);
}

.log-entry.success-log {
  color: var(--accent-success);
}

.log-entry.fail-log {
  color: #f87171;
}

.player-color-counter-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.color-progress-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  border: 1px solid var(--border-subtle);
}

/* Painel de Ações / Toolbar de Pedido */
.game-action-toolbar {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.request-builder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.select-wrapper label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.quick-turn-actions {
  display: flex;
  gap: 8px;
}

/* Mão do Jogador (Cards Hand) */
.player-hand-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hand-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 4px;
}

.hand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hand-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
}

.hand-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hand-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.cards-hand-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px 16px 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* DESIGN DAS CARTAS LEAN SIX SIGMA (IDÊNTICO ÀS FOTOS REAIS) */
.game-card-view {
  flex: 0 0 162px;
  height: 254px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
  user-select: none;
}

.game-card-view:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

/* Header superior da carta física */
.card-header-bar {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
}

.card-badge-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.card-title-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Corpo da carta */
.card-body-content {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  background: #f8fafc;
}

.card-stat-box {
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 4px;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.2;
}

.card-practical-box {
  background: #f1f5f9;
  border-left: 3px solid #2563EB;
  padding: 4px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
}

/* Diagramas Ilustrativos CSS */
.card-diagram-preview {
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  padding: 4px;
}

/* Diagrama T18 & T19 (Pirâmides de dados) */
.pyramids-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pyramid-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pyr-row {
  display: flex;
  gap: 2px;
}

.brick {
  width: 6px;
  height: 6px;
  border-radius: 1px;
}
.brick.orange { background: #ea580c; }
.brick.green { background: #059669; }
.brick.red { background: #dc2626; }

.vs-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
}

/* Diagrama L12 (SMED Before/After) */
.smed-preview-diagram {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.smed-row-preview {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.smed-box {
  font-size: 0.52rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 2px;
  color: white;
}
.smed-box.internal { background: #1e3a8a; }
.smed-box.external { background: #ea580c; }

/* Diagrama T21 (ANOVA curvas) */
.anova-curves-svg {
  width: 100%;
  height: 100%;
}

/* Rodapé da carta */
.card-mini-formula {
  background: #e2e8f0;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-align: center;
  color: #0f172a;
  font-weight: 600;
}

/* CARTA EXPANDIDA (INSPECTOR DIDÁTICO) */
.card-inspector-card {
  width: 100%;
  max-width: 480px;
  padding: 0;
  overflow: hidden;
  background: white;
  color: #0f172a;
}

.inspector-card-full {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow-y: auto;
}

.inspector-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
}

.inspector-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: white;
  color: #0f172a;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.inspector-titles {
  display: flex;
  flex-direction: column;
}

.inspector-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
}

.inspector-tag {
  font-size: 0.78rem;
  opacity: 0.9;
}

.inspector-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
}

.inspector-stat-box {
  background: #1e293b;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.inspector-practical-box {
  background: #f8fafc;
  border-left: 4px solid #2563EB;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
}
.inspector-practical-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}
.inspector-practical-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin-top: 2px;
}

.inspector-summary {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #334155;
}

.inspector-formula-box {
  background: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}

.inspector-bullets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 18px;
  font-size: 0.85rem;
  color: #334155;
}

/* 7. RESULTADO DA RODADA */
#view-round-result {
  align-items: center;
  justify-content: center;
}

.result-modal-container {
  max-width: 520px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.result-badge-icon {
  font-size: 3.5rem;
  line-height: 1;
}

.result-status-tag {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.result-status-tag.success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.result-status-tag.failure {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.result-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: white;
  margin-top: 6px;
}

.pedagogical-explanation {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #cbd5e1;
}
.pedagogical-explanation strong {
  color: var(--accent-gold);
  display: block;
  margin-bottom: 4px;
}

/* 8. VENCEDOR (WINNER) */
#view-winner {
  align-items: center;
  justify-content: center;
}

.winner-modal-container {
  max-width: 540px;
  width: 100%;
  padding: 40px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.winner-crown {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.6));
}

.winner-subtitle {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.winner-name {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #fef08a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.winner-quartet-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  width: 100%;
}

.winner-color-tag {
  display: inline-block;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.winner-congrats-text {
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.winner-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

/* MODAIS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.btn-close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 20;
}
.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* MODAL DE QUIZ / PERGUNTA TÉCNICA */
.quiz-challenge-card {
  max-width: 560px;
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.quiz-card-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-hypothesis);
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.quiz-title-area {
  flex: 1;
}

.quiz-sub {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  font-weight: 700;
}

.quiz-tool-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.quiz-timer {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
}

.quiz-question-body {
  margin-bottom: 18px;
}

.quiz-question-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #f1f5f9;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-option-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--border-strong);
}

.quiz-option-btn.selected {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--color-hypothesis);
  color: white;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.3);
}

.option-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* MODAL DE QR CODE CAMERA SCANNER */
.camera-viewport-box {
  position: relative;
  width: 100%;
  height: 260px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-aim-frame {
  position: absolute;
  width: 180px;
  height: 180px;
  pointer-events: none;
}

.aim-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--accent-cyan);
}

.aim-corner.tl { top: 0; left: 0; border-top: 3px solid; border-left: 3px solid; }
.aim-corner.tr { top: 0; right: 0; border-top: 3px solid; border-right: 3px solid; }
.aim-corner.bl { bottom: 0; left: 0; border-bottom: 3px solid; border-left: 3px solid; }
.aim-corner.br { bottom: 0; right: 0; border-bottom: 3px solid; border-right: 3px solid; }

.aim-laser {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent-cyan), transparent);
  animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
  0% { top: 0; opacity: 0.2; }
  50% { top: 100%; opacity: 1; }
  100% { top: 0; opacity: 0.2; }
}

.manual-code-fallback {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.fallback-input-row {
  display: flex;
  gap: 8px;
}

/* MODAL DE QR CODE PREVIEW */
.qr-preview-modal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.qr-canvas-wrapper {
  background: white;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.qr-modal-code-tag {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.12em;
}

/* ============================================================
   ESTILOS ARCADE & PARTY GAME (VIBE KAHOOT + FALL GUYS)
   ============================================================ */

/* 1. Canvas de Confetes Fullscreen */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* 2. Badges e Emojis Festivos */
.party-badge {
  background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
  color: #ffffff !important;
  font-family: var(--font-arcade) !important;
  font-weight: 700 !important;
  border-radius: var(--radius-full) !important;
  padding: 6px 12px !important;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.45) !important;
  letter-spacing: 0.5px;
}

.game-icon-bounce {
  font-size: 3.2rem;
  margin-bottom: 8px;
  display: inline-block;
  animation: floatBounce 2.5s infinite ease-in-out;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

.bounce-loop {
  animation: bounceLoop 2s infinite ease-in-out;
}

@keyframes bounceLoop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(3deg); }
}

/* 3. Caixas e Painéis Arcade */
.arcade-box {
  background: rgba(30, 26, 70, 0.92) !important;
  border: 3px solid rgba(139, 92, 246, 0.35) !important;
  border-radius: 24px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(20px) !important;
}

.arcade-panel {
  background: rgba(33, 28, 77, 0.94) !important;
  border: 2px solid rgba(167, 139, 250, 0.3) !important;
  border-radius: 20px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45) !important;
}

/* 4. Botões 3D Táteis estilo Arcade ("Chiclete") */
.btn-arcade-primary {
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  font-family: var(--font-arcade) !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  padding: 14px 24px !important;
  border-radius: var(--radius-full) !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 6px 0 #3730a3, 0 12px 24px rgba(79, 70, 229, 0.45) !important;
  transition: all 0.12s ease !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-arcade-primary:hover {
  background: linear-gradient(180deg, #818cf8 0%, #6366f1 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #3730a3, 0 16px 28px rgba(79, 70, 229, 0.5) !important;
}

.btn-arcade-primary:active {
  transform: translateY(4px) !important;
  box-shadow: 0 2px 0 #3730a3, 0 4px 12px rgba(79, 70, 229, 0.3) !important;
}

.btn-arcade-secondary {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: #1e1b4b !important;
  font-family: var(--font-arcade) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  padding: 12px 20px !important;
  border-radius: var(--radius-full) !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 6px 0 #b45309, 0 10px 20px rgba(245, 158, 11, 0.35) !important;
  transition: all 0.12s ease !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-arcade-secondary:hover {
  background: linear-gradient(180deg, #fcd34d 0%, #fbbf24 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #b45309, 0 14px 24px rgba(245, 158, 11, 0.45) !important;
}

.btn-arcade-secondary:active {
  transform: translateY(4px) !important;
  box-shadow: 0 2px 0 #b45309, 0 4px 10px rgba(245, 158, 11, 0.3) !important;
}

.btn-arcade-ghost {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e0e7ff !important;
  font-family: var(--font-arcade) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: var(--radius-full) !important;
  padding: 10px 18px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3) !important;
  transition: all 0.12s ease !important;
}

.btn-arcade-ghost:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: #a78bfa !important;
  transform: translateY(-1px);
}

.btn-arcade-ghost:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3) !important;
}

/* 5. Seletor de Avatares Arcade */
.avatar-picker-section {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 20px;
  border: 1px dashed rgba(167, 139, 250, 0.4);
}

.picker-label {
  display: block;
  font-family: var(--font-arcade);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 10px;
  text-align: center;
}

.avatar-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  justify-items: center;
}

.avatar-opt-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid transparent;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.avatar-opt-btn:hover {
  transform: scale(1.18) rotate(5deg);
  background: rgba(255, 255, 255, 0.2);
}

.avatar-opt-btn.selected {
  border-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.25);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.7);
  transform: scale(1.15);
}

/* 6. Barra de Reações / Floating Emotes */
.reactions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(20, 16, 48, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  margin: 12px auto 6px;
  max-width: 500px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.reactions-title {
  font-family: var(--font-arcade);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-gold);
  white-space: nowrap;
}

.reactions-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-emote {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-emote:hover {
  transform: scale(1.25) translateY(-3px);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.btn-emote:active {
  transform: scale(0.95);
}

/* Camada onde os emojis sobem voando */
.floating-emotes-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.floating-emote-item {
  position: absolute;
  font-size: 3.5rem;
  user-select: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
  animation: floatEmoteUp 2.8s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes floatEmoteUp {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0.6) rotate(0deg);
  }
  15% {
    opacity: 1;
    transform: translateY(75vh) scale(1.2) rotate(-8deg);
  }
  50% {
    transform: translateY(40vh) scale(1.05) rotate(12deg);
  }
  85% {
    opacity: 1;
    transform: translateY(15vh) scale(0.95) rotate(-6deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-5vh) scale(0.7) rotate(15deg);
  }
}

/* 7. Efeito Holográfico Brilhante nas Cartas (Rainbow Foil) */
.game-card-view {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease !important;
}

.game-card-view:hover {
  transform: translateY(-12px) scale(1.05) rotate(1.5deg) !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6), 0 0 24px var(--card-color, rgba(59, 130, 246, 0.5)) !important;
  z-index: 10;
}

.game-card-view::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 255, 255, 0.15) 30%,
    rgba(251, 191, 36, 0.25) 45%,
    rgba(236, 72, 153, 0.25) 55%,
    rgba(34, 211, 238, 0.25) 65%,
    transparent 80%
  );
  transform: rotate(25deg) translateY(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
  opacity: 0;
}

.game-card-view:hover::after {
  opacity: 1;
  transform: rotate(25deg) translateY(100%);
}

/* 8. Barra de Tempo Animada do Quiz */
.quiz-timer-bubble {
  font-family: var(--font-arcade);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #f97316);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  animation: pulseGlow 1.2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.quiz-timer-bar-wrap {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 16px;
}

.quiz-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  border-radius: var(--radius-full);
  transition: width 1s linear;
}

/* 9. Tipografia e Títulos no Estilo Kahoot */
h1, h2, h3, .view-title, .auth-title, .result-title, .winner-name {
  font-family: var(--font-arcade) !important;
  letter-spacing: -0.01em;
}

.view-title {
  font-size: 1.85rem;
  background: linear-gradient(135deg, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 10. Botão Danger Arcade & Modal de Zerar */
.btn-arcade-danger {
  background: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%) !important;
  color: #ffffff !important;
  font-family: var(--font-arcade) !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  padding: 10px 18px !important;
  border-radius: var(--radius-full) !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 5px 0 #9f1239, 0 10px 20px rgba(225, 29, 72, 0.4) !important;
  transition: all 0.12s ease !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-arcade-danger:hover {
  background: linear-gradient(180deg, #fb7185 0%, #f43f5e 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #9f1239, 0 14px 24px rgba(225, 29, 72, 0.5) !important;
}

.btn-arcade-danger:active {
  transform: translateY(3px) !important;
  box-shadow: 0 2px 0 #9f1239, 0 4px 10px rgba(225, 29, 72, 0.3) !important;
}

.restart-modal {
  text-align: center;
  max-width: 440px;
  padding: 32px 24px !important;
}

.restart-modal-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  display: inline-block;
}

.restart-modal .modal-title {
  font-size: 1.55rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.restart-modal .modal-subtitle {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 24px;
}

.restart-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================================
   ESTILOS DAS 61 CARTAS FÍSICAS REAIS NO JOGO
   ============================================================ */

/* Miniatura da Carta Física na Mão do Jogador */
.card-photo-body {
  padding: 6px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: calc(100% - 38px) !important;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%) !important;
  gap: 4px !important;
}

.card-thumb-wrapper {
  width: 100%;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-thumb-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.25s ease;
}

.game-card-view:hover .card-thumb-preview-img {
  transform: scale(1.08);
}

.card-practical-desc {
  font-size: 0.62rem;
  line-height: 1.25;
  color: #1e293b;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 6px;
  border-radius: 6px;
  border-left: 3px solid var(--card-color, #2563eb);
  width: 100%;
  text-align: left;
}

.card-tag-pill {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 9999px;
  border: 1.5px solid currentColor;
  background: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.5px;
  max-width: 95%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-mini-action {
  font-size: 0.68rem;
  font-weight: 700;
  color: #3b82f6;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Abas de Inspeção da Carta */
.card-inspector-card {
  max-width: 540px !important;
  border-radius: 20px !important;
}

.inspector-tab-nav {
  display: flex;
  background: #f1f5f9;
  padding: 6px;
  gap: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.btn-insp-tab {
  flex: 1;
  padding: 10px 14px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-insp-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-insp-tab.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.inspector-tab-panel {
  padding: 16px;
  max-height: 72vh;
  overflow-y: auto;
}

.inspector-tab-panel.hidden {
  display: none !important;
}

/* Imagem da Carta Física em Alta Resolução */
.inspector-real-photo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0f172a;
  padding: 16px;
  border-radius: 16px;
}

.inspector-real-card-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Pílula de Vitória */
.winner-pill {
  animation: pulse-border 1.5s infinite alternate;
  background: #fef08a !important;
  color: #854d0e !important;
  font-weight: 800 !important;
}

@keyframes pulse-border {
  from { box-shadow: 0 0 0 2px #eab308; }
  to { box-shadow: 0 0 0 5px #ca8a04; }
}

/* ============================================================
   RESPONSIVIDADE E EXPERIÊNCIA MOBILE DEDICADA (SMARTPHONES E TABLETS)
   ============================================================ */

/* Touch-action e prevenções no mobile */
button, select, input, .game-card-view, .btn-emote {
  touch-action: manipulation;
}

/* Suporte a Safe Area (iPhone X até linha atual 15/16 com notch/ilha dinâmica) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .global-header {
    padding-top: max(8px, env(safe-area-inset-top));
  }
  .app-root {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* BREAKPOINT TABLET / TELAS MÉDIAS (<= 768px) */
@media (max-width: 768px) {
  /* Evita auto-zoom incômodo do iOS em inputs/selects */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Header compacto */
  .global-header {
    height: 56px;
    padding: 0 12px;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .brand-subtitle {
    display: none; /* Reduz poluição visual no topo */
  }
  .user-name {
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Mesa de Jogo fluida */
  #view-game {
    padding: 8px 8px 24px 8px;
  }

  .game-table-container {
    height: auto;
    min-height: calc(100dvh - 72px);
    gap: 8px;
  }

  /* Oponentes mais compactos em linha */
  .opponents-bar {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .opponents-bar::-webkit-scrollbar {
    display: none;
  }

  .opponent-card {
    padding: 6px 10px;
    gap: 8px;
    flex-shrink: 0;
  }
  .opponent-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  .opponent-name {
    font-size: 0.78rem;
  }
  .opponent-cards-count {
    font-size: 0.7rem;
  }

  /* Barra de turno compacta */
  .turn-banner {
    padding: 6px 12px;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
  }
  .turn-player-name {
    font-size: 0.85rem;
  }
  .turn-timer {
    font-size: 0.85rem;
    padding: 2px 8px;
  }

  /* Monte e Feed de Logs */
  .board-deck-area {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: stretch;
  }

  .deck-pile {
    flex: 0 0 auto;
    padding: 8px 12px;
    gap: 10px;
  }
  .deck-pile-cards {
    width: 34px;
    height: 48px;
  }
  .deck-count-num {
    font-size: 1rem;
  }
  .deck-action-hint {
    font-size: 0.65rem;
  }

  .game-log-feed {
    height: 72px;
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  /* Toolbar de Ações - Layout amigável para polegar */
  .game-action-toolbar {
    padding: 10px 12px;
    flex-direction: column;
    gap: 10px;
  }

  .request-builder-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .request-builder-row .select-wrapper {
    min-width: unset;
  }

  .request-builder-row #btn-send-request {
    grid-column: 1 / -1;
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    justify-content: center;
  }

  .quick-turn-actions {
    display: flex;
    width: 100%;
    gap: 6px;
  }

  .quick-turn-actions .btn {
    flex: 1;
    padding: 9px 6px;
    font-size: 0.76rem;
    justify-content: center;
    white-space: nowrap;
  }

  /* Barra de Reações / Emotes */
  .reactions-bar {
    padding: 6px 10px;
    gap: 6px;
  }
  .reactions-title {
    display: none; /* Foca nos ícones */
  }
  .reactions-buttons {
    width: 100%;
    justify-content: space-around;
  }
  .btn-emote {
    font-size: 1.3rem;
    padding: 4px 6px;
  }

  /* Mão de Cartas - Carrossel com Snap para folhear no toque */
  .cards-hand-container {
    scroll-snap-type: x mandatory;
    padding: 8px 4px 14px 4px;
    gap: 10px;
  }

  .game-card-view {
    flex: 0 0 150px;
    height: 246px;
    scroll-snap-align: start;
    border-radius: 12px;
  }

  .card-thumb-wrapper {
    height: 90px;
  }

  /* Modais no Mobile */
  .modal-overlay {
    padding: 10px;
  }

  .modal-box {
    padding: 18px 14px;
    max-height: 90dvh;
    overflow-y: auto;
    border-radius: 18px;
  }

  /* Modal do Quiz */
  .quiz-challenge-card {
    max-width: 100%;
  }
  .quiz-header {
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
  .quiz-card-badge {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  .quiz-tool-name {
    font-size: 1.1rem;
  }
  .quiz-question-text {
    font-size: 0.88rem;
    line-height: 1.4;
  }
  .quiz-option-btn {
    padding: 10px 12px;
    font-size: 0.82rem;
    min-height: 48px; /* Touch target acessível */
  }

  /* Modal de Inspeção da Carta */
  .card-inspector-card {
    max-width: 100% !important;
  }
  .inspector-tab-panel {
    padding: 12px;
    max-height: 65dvh;
  }
  .inspector-real-card-img {
    max-height: 52dvh;
  }
  .btn-insp-tab {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  /* Telas de Setup e Lobby */
  .setup-container {
    padding: 16px 12px;
  }
  .quick-join-form {
    flex-direction: column;
    align-items: stretch;
  }
  .quick-join-form .btn {
    width: 100%;
  }
}

/* BREAKPOINT SMARTPHONES PEQUENOS (<= 480px) */
@media (max-width: 480px) {
  .game-card-view {
    flex: 0 0 142px;
    height: 240px;
  }
  .card-thumb-wrapper {
    height: 84px;
  }
  .card-title-text {
    font-size: 0.78rem;
  }
  .card-badge-circle {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }
  .card-tag-pill {
    font-size: 0.58rem;
    padding: 2px 6px;
  }
  .card-mini-action {
    font-size: 0.65rem;
  }
  
  .turn-player-name {
    font-size: 0.78rem;
  }
  .turn-avatar {
    font-size: 1rem;
  }

  .quick-turn-actions .btn span:not(.btn-icon) {
    font-size: 0.72rem;
  }
}


