/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
@import "tailwindcss";

/* Classes dinâmicas de cor de plano ficam listadas em
   app/views/shared/_tailwind_safelist.html.erb pra Tailwind 4 detectar. */

/* Confirm modal animation */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Mobile sidebar ────────────────────────────────────────── */
/* Overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s;
}
.mobile-overlay.is-open {
  opacity: 1;
}

/* Mobile-only rules: hide sidebar, show hamburger */
@media (max-width: 767px) {
  .mobile-sidebar {
    position: fixed !important;
    top: 57px;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
  }
  .mobile-sidebar.is-open {
    transform: translateX(0);
  }
  .mobile-hamburger { display: flex !important; }
}

/* Desktop: hamburger is always hidden */
@media (min-width: 768px) {
  .mobile-hamburger { display: none !important; }
  .mobile-overlay { display: none !important; }
}

/* ── Print seletivo do Resultado da Avaliação ─────────────── */
/* Ativado via body class por print_section_controller.js. Usa @media print
   para não afetar visualização normal. Modo "full" não oculta nada. */
@media print {
  body.print-mode-scores .js-section-belle,
  body.print-mode-scores .js-section-pdi { display: none !important; }
  body.print-mode-belle  .js-section-scores,
  body.print-mode-belle  .js-section-pdi { display: none !important; }

  /* Mantém o bloco do radar numa página só — evita o título na pág 1 e gráfico
     cortado na pág 2. */
  .js-radar-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .js-radar-block canvas {
    /* Largura maior que o container comprime as labels. Dá folga vertical
       pra elas respirarem sem cortar. */
    max-height: 680px !important;
    width: 100% !important;
    height: auto !important;
  }
}

/* ── Belle skeleton loader (shimmer com gradient) ──────────────────
   Usado quando Belle está gerando conteúdo (CV, análise, relatório).
   role="status" + aria-label invisível anunciam pra screen readers. */
@keyframes belle-shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position:  1000px 0; }
}

.belle-skeleton {
  background-image: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
  background-size: 1000px 100%;
  background-repeat: no-repeat;
  animation-name: belle-shimmer;
  animation-duration: 1.6s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  border-radius: 0.5rem;
}

.belle-skeleton-line {
  height: 0.875rem; /* equivale ao text-sm */
  margin-bottom: 0.5rem;
}
.belle-skeleton-line:last-child { margin-bottom: 0; }

/* Reduz movimento conforme preferência do usuário (a11y WCAG 2.3.3).
   Mantém o gradient visível (estático) — só desliga a animação. */
@media (prefers-reduced-motion: reduce) {
  .belle-skeleton { animation-name: none; }
}

/* ── Minijogos — identidade visual (ícones + cores temáticas) ──── */
/* Tile com gradiente por jogo. Usar com helper `minigame_icon_tile`. */
.mg-tile {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.mg-tile::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}
.mg-tile-rose    { background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%); }
.mg-tile-yellow  { background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%); }
.mg-tile-violet  { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.mg-tile-cyan    { background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%); }
.mg-tile-pink    { background: linear-gradient(135deg, #ec4899 0%, #be185d 100%); }
.mg-tile-orange  { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }
.mg-tile-indigo  { background: linear-gradient(135deg, #6366f1 0%, #3730a3 100%); }
.mg-tile-emerald { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.mg-tile-amber   { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); }
.mg-tile-teal    { background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%); }
.mg-tile-red     { background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%); }

/* Banner de header de card por accent — mais visual e escaneável */
.mg-card-header-rose    { background: linear-gradient(120deg, #fff1f2 0%, #ffe4e6 100%); }
.mg-card-header-yellow  { background: linear-gradient(120deg, #fefce8 0%, #fef9c3 100%); }
.mg-card-header-violet  { background: linear-gradient(120deg, #f5f3ff 0%, #ede9fe 100%); }
.mg-card-header-cyan    { background: linear-gradient(120deg, #ecfeff 0%, #cffafe 100%); }
.mg-card-header-pink    { background: linear-gradient(120deg, #fdf2f8 0%, #fce7f3 100%); }
.mg-card-header-orange  { background: linear-gradient(120deg, #fff7ed 0%, #ffedd5 100%); }
.mg-card-header-indigo  { background: linear-gradient(120deg, #eef2ff 0%, #e0e7ff 100%); }
.mg-card-header-emerald { background: linear-gradient(120deg, #ecfdf5 0%, #d1fae5 100%); }
.mg-card-header-amber   { background: linear-gradient(120deg, #fffbeb 0%, #fef3c7 100%); }
.mg-card-header-teal    { background: linear-gradient(120deg, #f0fdfa 0%, #ccfbf1 100%); }
.mg-card-header-red     { background: linear-gradient(120deg, #fef2f2 0%, #fecaca 100%); }

/* Background tematico do hub minijogos + telas de jogo. Camada visual
   atras do conteudo: gradiente diagonal claro + 2 halos sutis que dao
   profundidade sem distrair. Aplicado via div fixed inset-0 -z-10.
   Variantes por accent dao tema visual a cada jogo (CSS custom props).
   Default (sem modifier) usa cores marca: laranja + teal. */
.mg-hub-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  --bg-from: #f8fafc;
  --bg-to: #e0f2f1;
  --halo1: rgba(251, 146, 60, 0.18);
  --halo2: rgba(20, 184, 166, 0.18);
  background:
    radial-gradient(circle at 18% 28%, var(--halo1) 0%, transparent 45%),
    radial-gradient(circle at 82% 72%, var(--halo2) 0%, transparent 45%),
    linear-gradient(135deg, var(--bg-from) 0%, var(--bg-to) 100%);
}
/* Tema por accent. Cada jogo escolhe sua paleta complementar. Cores
   suaves (rgba 0.14-0.18) pra nao competir com cards/conteudo. */
.mg-hub-bg-rose    { --bg-from: #fff1f2; --bg-to: #ffe4e6; --halo1: rgba(244, 63, 94, .18);  --halo2: rgba(251, 146, 60, .14); }
.mg-hub-bg-yellow  { --bg-from: #fefce8; --bg-to: #fef9c3; --halo1: rgba(234, 179, 8, .18);  --halo2: rgba(20, 184, 166, .12); }
.mg-hub-bg-violet  { --bg-from: #faf5ff; --bg-to: #ede9fe; --halo1: rgba(139, 92, 246, .18); --halo2: rgba(6, 182, 212, .14);  }
.mg-hub-bg-cyan    { --bg-from: #ecfeff; --bg-to: #cffafe; --halo1: rgba(6, 182, 212, .18);  --halo2: rgba(251, 146, 60, .12); }
.mg-hub-bg-pink    { --bg-from: #fdf2f8; --bg-to: #fce7f3; --halo1: rgba(236, 72, 153, .18); --halo2: rgba(245, 158, 11, .12); }
.mg-hub-bg-orange  { --bg-from: #fff7ed; --bg-to: #ffedd5; --halo1: rgba(249, 115, 22, .18); --halo2: rgba(20, 184, 166, .14); }
.mg-hub-bg-amber   { --bg-from: #fffbeb; --bg-to: #fef3c7; --halo1: rgba(245, 158, 11, .18); --halo2: rgba(139, 92, 246, .12); }
.mg-hub-bg-indigo  { --bg-from: #eef2ff; --bg-to: #e0e7ff; --halo1: rgba(99, 102, 241, .18); --halo2: rgba(245, 158, 11, .12); }
.mg-hub-bg-red     { --bg-from: #fef2f2; --bg-to: #fee2e2; --halo1: rgba(239, 68, 68, .16);  --halo2: rgba(20, 184, 166, .14); }
.mg-hub-bg-emerald { --bg-from: #ecfdf5; --bg-to: #d1fae5; --halo1: rgba(16, 185, 129, .18); --halo2: rgba(245, 158, 11, .12); }
.mg-hub-bg-teal    { --bg-from: #f0fdfa; --bg-to: #ccfbf1; --halo1: rgba(20, 184, 166, .18); --halo2: rgba(251, 146, 60, .14); }

/* Botão "?" de instruções nos jogos. Design tech, gradient sutil, ring
   externo que pulsa no foco, touch target generoso (44px) para PWA. */
.mg-help-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(20, 184, 166, 0.25);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95) 0%, rgba(240, 253, 250, 0.85) 60%, rgba(204, 251, 241, 0.6) 100%);
  color: #0f766e;
  font-weight: 800;
  font-size: 1.25rem;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", monospace;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 0 0 1px rgba(20, 184, 166, 0.08),
    0 4px 12px -3px rgba(20, 184, 166, 0.2);
  transition: transform 140ms ease, box-shadow 140ms ease, color 120ms ease, border-color 120ms ease;
}
.mg-help-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 17px;
  border: 1px solid rgba(20, 184, 166, 0.2);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}
.mg-help-btn:hover {
  transform: translateY(-1px);
  color: #134e4a;
  border-color: rgba(20, 184, 166, 0.5);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 0 0 1px rgba(20, 184, 166, 0.18),
    0 8px 18px -4px rgba(20, 184, 166, 0.35);
}
.mg-help-btn:hover::after { opacity: 1; transform: scale(1.05); }
.mg-help-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 2px 4px -1px rgba(20, 184, 166, 0.2); }
.mg-help-btn:focus-visible { outline: 2px solid #14b8a6; outline-offset: 2px; }

/* Modal de "Por que temos jogos" — usa Stimulus controller "modal" */
.mg-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: mg-modal-fade 180ms ease-out;
}
/* `hidden` (utility do Tailwind) vence por especificidade igual mas declaração
   posterior — então força aqui pra garantir que modal não vaze no primeiro paint. */
.mg-modal-backdrop.hidden { display: none !important; }
.mg-modal-panel {
  background: white;
  border-radius: 1rem;
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  animation: mg-modal-pop 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes mg-modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mg-modal-pop  { from { opacity: 0; transform: scale(0.92) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ── Minijogos (facilita.carreira) ────────────────────────────── */
/* Alavanca 2: shake elegante em erro (200ms, sem modal). */
@keyframes mg-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.mg-shake { animation: mg-shake 200ms ease-in-out; }

.mg-board {
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
  border: 1px solid #99f6e4;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px -10px rgba(20, 184, 166, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
/* Mobile: padding menor pra dar mais espaco pro grid (queens hard 8x8
   e palavras cruzadas 11x11 cortavam a ultima coluna no celular). */
@media (max-width: 480px) {
  .mg-board { padding: 0.75rem; border-radius: 1rem; }
}

.mg-prompt {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  padding: 1.5rem 0;
  letter-spacing: -0.02em;
  /* Alavanca 1: feedback rápido via transform, sem rerender. */
  transition: transform 60ms ease-out;
}

.mg-timer-bar {
  height: 6px;
  background: #0d9488;
  border-radius: 3px;
  transform-origin: left center;
}

.mg-option, .mg-icon-btn {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  padding: 0.75rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 3px 0 -1px rgba(15, 23, 42, 0.08),
    0 2px 6px -1px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 90ms ease, box-shadow 90ms ease, border-color 90ms ease;
}
.mg-option:hover, .mg-icon-btn:hover {
  transform: translateY(-1px);
  border-color: #14b8a6;
  box-shadow:
    0 5px 0 -1px rgba(13, 148, 136, 0.15),
    0 4px 10px -2px rgba(13, 148, 136, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}
.mg-option:active, .mg-icon-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 -1px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.mg-icon-btn {
  font-size: 2rem;
  min-width: 64px;
  min-height: 64px;
}

.mg-plate {
  position: relative;
  height: 180px;
  border: 2px solid #cbd5e1;
  border-radius: 0.75rem;
  background: white;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 100ms ease;
}
.mg-plate-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #5eead4 0%, #0d9488 100%);
  transition: height 160ms ease-out;
  height: 100%;
  pointer-events: none;
}
.mg-plate.danger { border-color: #ef4444; }
.mg-plate.danger .mg-plate-fill { background: linear-gradient(180deg, #fca5a5 0%, #ef4444 100%); }
.mg-plate-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  z-index: 1;
  pointer-events: none;
}

.mg-canvas {
  width: 100%;
  height: 420px;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  touch-action: none;
}

.mg-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.25rem;
}
.mg-bar-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.mg-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d9488 0%, #14b8a6 100%);
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .mg-shake, .mg-prompt, .mg-option, .mg-icon-btn, .mg-plate::after { animation: none !important; transition: none !important; }
}

/* ── Puzzles diários (Queens / Zip / Sudoku) ─────────────────── */
.mg-q-grid, .mg-z-grid, .mg-s-grid {
  display: grid;
  gap: 2px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #1f2937;
  padding: 2px;
  border-radius: 8px;
  box-sizing: border-box;
}
.mg-q-cell, .mg-z-cell, .mg-s-cell, .mg-t-cell, .mg-w-cell {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "ss01", "cv11";
}
.mg-q-cell, .mg-z-cell, .mg-s-cell {
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.75rem, 4vw, 1.8rem);
  font-weight: 700;
  background: white;
  transition: transform 60ms ease, background 60ms ease;
}
.mg-q-cell:hover, .mg-z-cell:hover, .mg-s-cell:hover { transform: scale(1.02); }
.mg-q-cell:active, .mg-z-cell:active, .mg-s-cell:active { transform: scale(0.96); }
.mg-q-cell {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.mg-q-queen { color: #0f172a; font-size: 1.6em; }
.mg-q-auto { opacity: 0.5; font-weight: 400; }
.mg-q-hint {
  animation: mg-q-hint-pulse 1.5s ease-out;
  box-shadow: 0 0 0 4px #f59e0b inset;
}
@keyframes mg-q-hint-pulse {
  0%   { box-shadow: 0 0 0 0 #f59e0b inset; }
  30%  { box-shadow: 0 0 0 8px #f59e0b inset; }
  100% { box-shadow: 0 0 0 4px #f59e0b inset; }
}
.mg-q-wrong {
  animation: mg-q-wrong-pulse 2s ease-out;
  box-shadow: 0 0 0 4px #dc2626 inset;
}
@keyframes mg-q-wrong-pulse {
  0%, 100% { box-shadow: 0 0 0 4px #dc2626 inset; background-color: #fecaca !important; }
  50%      { box-shadow: 0 0 0 8px #dc2626 inset; background-color: #fca5a5 !important; }
}

.mg-z-checkpoint { background: #0f172a !important; color: white; }
.mg-z-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60%; height: 60%;
  background: white; color: #0f172a; border-radius: 50%;
  font-weight: 800;
}
.mg-z-visited { background: #5eead4 !important; }
.mg-z-checkpoint.mg-z-visited { background: #14b8a6 !important; }
.mg-z-cell {
  /* Bloqueia gestos nativos: text-selection, callout, etc. Pointer events
     ficam livres pro drag. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.mg-z-hint {
  animation: mg-z-hint-pulse 1.5s ease-out;
  outline: 3px solid #f59e0b;
  outline-offset: -3px;
}
@keyframes mg-z-hint-pulse {
  0%, 100% { outline-color: #f59e0b; }
  50%      { outline-color: #fbbf24; }
}

/* ── Tango ────────────────────────────────────────────────────── */
.mg-t-grid {
  display: grid;
  gap: 2px;
  max-width: 480px;
  margin: 0 auto;
  background: #1f2937;
  padding: 2px;
  border-radius: 8px;
}
.mg-t-cell {
  position: relative;
  aspect-ratio: 1;
  border: none;
  cursor: pointer;
  background: white;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 60ms ease, background 60ms ease;
  /* Touch responsivo em mobile + bloqueia selection acidental no toque
     proximo aos badges = e × (que sao filhos absolute desta celula). */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
/* No Tango as células têm badges = e × como filhos absolute. Aplicar
   scale no hover bagunçava a posição. Mantém só feedback de cor +
   active scale leve (sem badge sofrendo). */
.mg-t-cell:hover  { background: #f8fafc; }
.mg-t-cell:active { background: #f1f5f9; }
.mg-t-sun:hover,  .mg-t-given.mg-t-sun:hover  { background: #fef3c7; }
.mg-t-moon:hover, .mg-t-given.mg-t-moon:hover { background: #e0e7ff; }
.mg-t-sun  { color: #f59e0b; background: #fef3c7; }
.mg-t-moon { color: #4338ca; background: #e0e7ff; }
.mg-t-given { background: #f1f5f9; cursor: default; }
.mg-t-given.mg-t-sun  { background: #fde68a; }
.mg-t-given.mg-t-moon { background: #c7d2fe; }
.mg-t-conflict { background: #fecaca !important; }
.mg-t-hint {
  animation: mg-t-hint-pulse 1.5s ease-out;
  box-shadow: 0 0 0 3px #f59e0b inset;
}
@keyframes mg-t-hint-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #f59e0b inset; }
  50%      { box-shadow: 0 0 0 6px #f59e0b inset; }
}

/* Badges de constraints estilo "ponte" — minimalistas, sentadinhos no
   gap entre células sem invadir muito a area clicavel. Pointer-events:
   none deixa o clique passar pra a celula atras, mas se o badge for
   grande demais cobre visualmente onde o usuario tenta tocar, gerando
   sensacao de "nao consigo clicar". 22px e o sweet spot pra mobile. */
.mg-t-constraint {
  position: absolute;
  z-index: 4;
  background: #475569;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25), 0 0 0 1.5px white;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1;
  letter-spacing: -0.02em;
}
/* Offset reduzido (-11 em vez de -15): mantém o badge centrado no gap
   visualmente, mas invadindo apenas 10px de cada celula vizinha em vez
   de 13. Em telas pequenas, libera area clicavel sem perder legibilidade. */
.mg-t-c-h { right: -11px; top: 50%; transform: translateY(-50%); }
.mg-t-c-v { bottom: -11px; left: 50%; transform: translateX(-50%); }

/* ── Patches ──────────────────────────────────────────────────
   Grid 6x6 com pecas coloridas. Cada celula e button (cursor pointer).
   Sementes (mg-p-seed) tem numero visivel; demais celulas da peca
   compartilham cor mas sem numero. Bordas entre celulas da mesma
   peca somem (mg-p-no-top/bot/left/right) pra dar visual de bloco. */
.mg-p-grid {
  display: grid;
  gap: 0;
  max-width: 480px;
  margin: 0 auto;
  background: #cbd5e1;
  padding: 3px;
  border-radius: 12px;
  border: 3px solid #cbd5e1;
}
.mg-p-cell {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(0.95rem, 4vw, 1.4rem);
  color: #0f172a;
  transition: transform 60ms ease, filter 80ms ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.mg-p-cell:hover  { filter: brightness(1.05); }
.mg-p-cell:active { transform: scale(0.96); }

/* Quando celula faz parte de uma peca (pid >= 0), as bordas internas
   contra vizinhos da mesma peca somem pra dar bloco solido. */
.mg-p-no-top    { border-top-color: transparent !important; }
.mg-p-no-bot    { border-bottom-color: transparent !important; }
.mg-p-no-left   { border-left-color: transparent !important; }
.mg-p-no-right  { border-right-color: transparent !important; }

/* Sementes tem borda mais grossa pra destacar como nucleo fixo. */
.mg-p-seed { box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.35) inset; }

/* Badge da seed: o NÚMERO vive dentro de um "quadro" cuja FORMA indica
   o tipo da peça (square / vrect / hrect / free). Visual estilo LinkedIn
   Patches — jogador identifica o formato olhando só pra esse quadro.
   - square: quadrado pequeno (1:1)
   - hrect:  retângulo horizontal achatado (2.4:1)
   - vrect:  retângulo vertical alongado (1:2.4)
   - free:   pílula arredondada com borda TRACEJADA (sinaliza "forma livre")
   Borda sólida sutil + fundo branco translúcido pra contrastar com a cor
   da peça (pastel) embaixo. */
.mg-p-seed-num {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv11";
  font-weight: 800;
  line-height: 1;
  color: rgba(15, 23, 42, 0.92);
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(15, 23, 42, 0.45);
  pointer-events: none;
  user-select: none;
}
/* Square: quadrado clássico. Padding equilibrado. */
.mg-p-seed-shape-square {
  width: 1.55em;
  height: 1.55em;
  border-radius: 4px;
}
/* Retângulo horizontal: largura > altura. */
.mg-p-seed-shape-hrect {
  min-width: 2.2em;
  height: 1.1em;
  padding: 0 0.35em;
  border-radius: 4px;
}
/* Retângulo vertical: altura > largura. */
.mg-p-seed-shape-vrect {
  width: 1.1em;
  min-height: 2.2em;
  padding: 0.35em 0;
  border-radius: 4px;
}
/* Forma livre: pílula arredondada + borda tracejada. */
.mg-p-seed-shape-free {
  min-width: 1.55em;
  height: 1.55em;
  padding: 0 0.45em;
  border-radius: 999px;
  border-style: dashed;
}

/* Paleta de 8 cores: cada peca pega uma. Tons calibrados pra contraste
   bom com texto preto + serem distinguiveis entre si. */
.mg-p-color-0 { background: #fde68a; }  /* ambar */
.mg-p-color-1 { background: #bbf7d0; }  /* verde-claro */
.mg-p-color-2 { background: #bae6fd; }  /* azul-claro */
.mg-p-color-3 { background: #fbcfe8; }  /* rosa-claro */
.mg-p-color-4 { background: #ddd6fe; }  /* lilas */
.mg-p-color-5 { background: #fed7aa; }  /* laranja-claro */
.mg-p-color-6 { background: #99f6e4; }  /* turquesa */
.mg-p-color-7 { background: #fecaca; }  /* vermelho-claro */

/* Legenda da regra. */
.mg-p-legend-seed { background: #fde68a; box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.35) inset; color: #0f172a; }
.mg-p-legend-cell { background: #f8fafc; border: 1px solid #cbd5e1; }

/* Pulse breve quando a Dica revela uma célula. */
@keyframes mg-p-hint-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(245, 158, 11, 0.85) inset; }
  50%  { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.85) inset; }
  100% { box-shadow: 0 0 0 0   rgba(245, 158, 11, 0) inset; }
}
.mg-p-hint { animation: mg-p-hint-pulse 1.6s ease-out; }

/* ── Caça-Palavras ──────────────────────────────────────────────
   Layering: wrap (bg slate-50, padding, border-radius)
              └─ pills SVG (z=0, absolute dentro do wrap)
              └─ grid (z=1, transparente)
                  └─ células (bg white normal, transparent quando found)
   A pílula SVG fica entre o bg do wrap e as células, então quando a célula
   vira transparent (found), revela a pílula. */
.mg-w-wrap {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
  background: #f8fafc;
  padding: 10px;
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}
.mg-w-pills {
  position: absolute;
  inset: 10px;             /* respeita padding do wrap pra alinhar com grid */
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  pointer-events: none;
  z-index: 0;
}
.mg-w-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;                  /* sem gap — centros das células alinham com a viewBox N×N do SVG das pílulas. Espaço entre circulos vem do border-radius 50% */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: transparent;
}
.mg-w-cell {
  aspect-ratio: 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(1rem, 4vw, 1.6rem);
  letter-spacing: 0.04em;
  color: #1e293b;
  cursor: pointer;
  border-radius: 50%;        /* círculo — combina com a capsule SVG */
  transition: background 80ms ease, transform 60ms ease;
  user-select: none;
}
/* Selecting: amarelo circular sólido, escala leve. Visual de "bolinhas
   sendo pintadas" durante o drag. */
.mg-w-cell.mg-w-selecting {
  background: #fbbf24;
  color: #422006;
  transform: scale(1.06);
  box-shadow: 0 2px 6px -1px rgba(251, 191, 36, 0.5);
}
/* Found: célula totalmente transparente — a pílula SVG sólida por baixo
   é quem mostra a cor. Letra fica branca pra contrastar sobre o teal
   da capsule. Estilo highlighter clássico de caça-palavras. */
.mg-w-cell.mg-w-found     { background: transparent; color: #ffffff; font-weight: 900; }
.mg-w-cell.mg-w-found.mg-w-selecting { background: #fbbf24; color: #422006; }
.mg-w-word {
  display: inline-block;
  background: #f1f5f9;
  color: #334155;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mg-w-word-done {
  background: #dcfce7;
  color: #166534;
  text-decoration: line-through;
}

/* ── Palavras Cruzadas ────────────────────────────────────────── */
.mg-c-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 768px) {
  .mg-c-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
}
/* Mobile: esconde a lista de clues lateral, mantém só a faixa amarela
   ativa pra economizar espaço (estilo G1). Lista volta no desktop. */
@media (max-width: 767px) {
  .mg-c-clues { display: none; }
}

/* Faixa da clue ativa — desktop: uma linha pill compacta (← · [pill nº +
   dir] · clue text · →). Mobile portrait: vira card arredondado e a clue
   quebra em até 2 linhas. Altura FIXA pra evitar oscilacao quando muda de
   palavra (clue curta -> longa fazia o tabuleiro pular antes). */
.mg-c-clue-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem auto 1.25rem;
  max-width: 540px;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 18px;
  padding: 0.5rem 0.7rem;
  box-shadow: 0 1px 3px rgba(202, 138, 4, 0.12);
  /* Altura mobile: 3 linhas de clue + linha do pill/direção + padding.
     Antes era 4.5rem e cortava clues longas. Em desktop esse valor é
     sobrescrito no @media (min-width: 640px) abaixo pra voltar ao pill
     compacto de 1 linha. */
  min-height: 5.5rem;
  max-height: 5.5rem;
  overflow: hidden;
}
.mg-c-clue-active {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #422006;
  font-weight: 600;
  height: 100%;
  line-height: 1.3;
  flex-wrap: wrap;
  min-width: 0;
}
.mg-c-clue-arrow {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: white;
  color: #b45309;
  font-weight: 700;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(146, 64, 14, 0.15);
}
.mg-c-clue-arrow:hover { background: #fbbf24; color: #ffffff; }
.mg-c-clue-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fbbf24;
  color: #422006;
  font-weight: 800;
  font-size: 0.9rem;
  min-width: 1.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.1;
  box-shadow: 0 1px 2px rgba(146, 64, 14, 0.2);
}
/* Indicador de direção da clue ativa (horizontal/vertical) — chip discreto
   ao lado do número, indica eixo da palavra. */
.mg-c-clue-dir {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  flex-shrink: 0;
  align-self: center;
}
.mg-c-clue-text {
  flex: 1 1 100%;
  min-width: 0;
  /* Mobile: ate 3 linhas com ellipsis se clue for muito longa. Conjugado
     com altura fixa do .mg-c-clue-card (5.5rem), garante zero oscilacao
     entre palavras (faixa nunca cresce ou encolhe ao mudar de clue).
     Mantém também a ordem visual: texto da clue em cima, número/direção
     embaixo (placement controlado pelo controller via replaceChildren). */
  order: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  hyphens: auto;
}
@media (min-width: 640px) {
  /* Desktop: pill compacto de 1 linha como antes. Tira a altura fixa
     mobile pra deixar o pill respirar normalmente. */
  .mg-c-clue-card {
    border-radius: 999px;
    padding: 0.4rem 0.6rem;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }
  .mg-c-clue-active { flex-wrap: nowrap; height: auto; }
  .mg-c-clue-text {
    flex: 1 1 auto;
    -webkit-line-clamp: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    word-break: normal;
    hyphens: manual;
  }
}
.mg-c-grid {
  display: grid;
  gap: 1px;
  background: #0f172a;
  padding: 2px;
  border-radius: 8px;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  box-sizing: border-box;
}
.mg-c-cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  font-size: clamp(0.6rem, 2.8vw, 1.2rem);
  font-feature-settings: "ss01", "cv11";
  color: #0f172a;
  user-select: none;
  -webkit-user-select: none;
  transition: background 80ms ease;
}
.mg-c-blocked  { background: #0f172a !important; cursor: default; }
.mg-c-active   { background: #fef9c3; }
.mg-c-current  { background: #fde68a !important; outline: 3px solid #ca8a04; outline-offset: -3px; z-index: 1; }
.mg-c-wrong    { background: #fecaca !important; color: #7f1d1d; }
.mg-c-right    { background: #d1fae5 !important; color: #065f46; }
.mg-c-right.mg-c-current { background: #6ee7b7 !important; }
.mg-c-wrong.mg-c-current { background: #fca5a5 !important; }
/* Letra revelada por dica: cor mais clara + dot decorativo (em vez de
   italic que ficava esquisito). Mantem indicacao visual sem prejudicar
   leitura. */
.mg-c-revealed {
  color: #475569;
  background: #f1f5f9;
  font-weight: 600;
}
.mg-c-revealed::after {
  content: "";
  position: absolute;
  bottom: 4px; right: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #f59e0b;
}
.mg-c-revealed.mg-c-active { background: #fef9c3; }
.mg-c-revealed.mg-c-current { background: #fde68a !important; }
.mg-c-num {
  position: absolute;
  top: 1px; left: 3px;
  font-size: 0.55em;
  font-weight: 700;
  color: #64748b;
  line-height: 1;
}
.mg-c-letter { line-height: 1; }
.mg-c-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.mg-c-clues {
  max-height: 540px;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.875rem;
}
.mg-c-clue-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0.5rem 0 0.25rem;
}
.mg-c-clue-heading:first-child { margin-top: 0; }
.mg-c-clue {
  display: block;
  text-align: left;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #334155;
  line-height: 1.3;
}
.mg-c-clue:hover { background: #e2e8f0; }
.mg-c-clue-active {
  background: #fde68a !important;
  color: #78350f;
  font-weight: 600;
}

/* Botão "Verificar" do palavras cruzadas. Off cinza claro, on verde. */
.mg-c-check-btn {
  background: #e2e8f0;
  color: #334155;
  border: 2px solid transparent;
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.mg-c-check-btn:hover { background: #cbd5e1; }
.mg-c-check-btn.mg-c-check-on {
  background: #10b981;
  color: white;
  border-color: #047857;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.mg-c-check-btn.mg-c-check-on:hover { background: #059669; }

/* SVG trail overlay — desenha por cima do grid sem interceptar cliques */
.mg-z-wrap { position: relative; max-width: 480px; margin: 0 auto; }
.mg-z-wrap .mg-z-grid { max-width: 100%; }
.mg-z-trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}
.mg-z-trail-line {
  fill: none;
  stroke: #0d9488;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.mg-s-cell { color: #0d9488; font-size: clamp(1.4rem, 5vw, 2rem); }
/* Grid 9×9 usa células menores pra caber em telas pequenas */
.mg-s-grid.mg-s-9 .mg-s-cell { font-size: clamp(1rem, 4vw, 1.5rem); }
.mg-s-grid.mg-s-9 { max-width: 520px; }

/* Container do keypad: grid de 5 colunas para ficar sempre em 2 linhas.
   No 9×9 fica 5+5 (1-5, 6-9+⌫). No 6×6 fica 5+2 (1-5, 6+⌫). Mobile friendly. */
.mg-s-keypad {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.625rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* Keypad customizado do sudoku (separado de mg-icon-btn para novos estados).
   Cantos generosos + sombra dupla (superior interna pra leveza, inferior pra
   profundidade), efeito de pressionar com translateY. */
.mg-s-key {
  background: linear-gradient(180deg, #f0fdff 0%, #cffafe 100%);
  color: #0d9488;
  border: 1px solid #a5f3fc;
  border-radius: 1rem;
  padding: 0.85rem 0;
  min-width: 56px;
  min-height: 56px;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 4px 0 -1px rgba(13, 148, 136, 0.15),
    0 2px 6px -1px rgba(13, 148, 136, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 90ms ease, box-shadow 90ms ease, background 90ms ease, border-color 90ms ease, opacity 120ms ease;
}
.mg-s-key:hover {
  transform: translateY(-1px);
  border-color: #14b8a6;
  box-shadow:
    0 6px 0 -1px rgba(13, 148, 136, 0.18),
    0 4px 12px -2px rgba(13, 148, 136, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.mg-s-key:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 -1px rgba(13, 148, 136, 0.12),
    0 1px 2px -1px rgba(13, 148, 136, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.mg-s-key-active {
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%) !important;
  color: white !important;
  border-color: #0f766e;
}
.mg-s-key-done {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%) !important;
  color: #94a3b8 !important;
  border-color: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.65;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: none;
}
.mg-s-key-done:hover { transform: none; }
.mg-s-key-done::after {
  content: "✓";
  position: absolute;
  top: 2px; right: 6px;
  font-size: 0.75rem;
  color: #10b981;
}
.mg-s-given { color: #1e293b; background: #f1f5f9; cursor: default; font-weight: 800; }
.mg-s-selected { background: #fef3c7 !important; outline: 3px solid #f59e0b; outline-offset: -3px; z-index: 1; }
.mg-s-peer { background: #fef9c3 !important; }
.mg-s-conflict { background: #fecaca !important; color: #7f1d1d; }
.mg-s-has-notes { color: #94a3b8; font-size: 0.7em; font-weight: 500; }
.mg-s-notes {
  display: inline-flex; flex-wrap: wrap; gap: 1px; line-height: 1;
  justify-content: center; max-width: 90%;
}
.mg-s-note-active { background: #14b8a6 !important; color: white !important; }
/* Destaques temporários da dica: célula sugerida pulsa amarelo;
   célula com valor errado pulsa vermelho. Removidos via setTimeout. */
.mg-s-hint {
  animation: mg-s-hint-pulse 1.5s ease-out;
  box-shadow: 0 0 0 4px #f59e0b inset;
}
@keyframes mg-s-hint-pulse {
  0%   { box-shadow: 0 0 0 0 #f59e0b inset; }
  30%  { box-shadow: 0 0 0 8px #f59e0b inset; }
  100% { box-shadow: 0 0 0 4px #f59e0b inset; }
}
.mg-s-wrong {
  animation: mg-s-wrong-pulse 2s ease-out;
  box-shadow: 0 0 0 4px #dc2626 inset;
}
@keyframes mg-s-wrong-pulse {
  0%, 100% { box-shadow: 0 0 0 4px #dc2626 inset; background-color: #fecaca !important; }
  50%      { box-shadow: 0 0 0 8px #dc2626 inset; background-color: #fca5a5 !important; }
}
/* Bordas mais fortes pras regiões 2×3 do sudoku */
.mg-s-border-r { box-shadow: inset -2px 0 0 0 #1f2937; }
.mg-s-border-b { box-shadow: inset 0 -2px 0 0 #1f2937; }
.mg-s-border-r.mg-s-border-b { box-shadow: inset -2px 0 0 0 #1f2937, inset 0 -2px 0 0 #1f2937; }

/* ─── facilita.carreira design system: botões arredondados ───────────
   Padrão moderno (Puzzled/LinkedIn). Aplicar onde fizer sentido em vez
   de links de texto pequenos. 2 variantes:
     .fc-btn-icon — círculo 44x44 com ícone só
     .fc-btn-card — card com ícone + label + chevron, links de navegação */
.fc-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 0;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 60ms ease, box-shadow 150ms ease;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.fc-btn-icon:hover  { background: #e2e8f0; color: #0f172a; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }
.fc-btn-icon:active { transform: scale(0.95); }
.fc-btn-icon.fc-btn-primary {
  background: #0f766e; color: white;
}
.fc-btn-icon.fc-btn-primary:hover { background: #115e59; }

.fc-btn-card {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: white;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1rem 0.55rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 60ms ease;
  text-decoration: none;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.fc-btn-card:hover  { border-color: #0f766e; background: #f0fdfa; box-shadow: 0 2px 8px rgba(15, 118, 110, 0.1); }
.fc-btn-card:active { transform: scale(0.97); }
.fc-btn-card .fc-btn-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
  flex-shrink: 0;
}
.fc-btn-card:hover .fc-btn-card-icon { background: #0f766e; color: white; }

/* Toolbar dos jogos: botões secundários (Desfazer, Reiniciar). Mesma altura
   do botão Dica pra alinhar no rodapé. */
.mg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 0;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 60ms ease;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.mg-action-btn:not(:disabled):hover  { background: #e2e8f0; color: #1f2937; }
.mg-action-btn:not(:disabled):active { transform: scale(0.97); }
.mg-action-btn:disabled              { opacity: 0.4; cursor: not-allowed; }

/* Botão Dica unificado dos jogos. Cooldown indicado por "fill horizontal":
   botão começa cinza claro (vazio) e se enche de amarelo da esquerda pra
   direita ao longo do cooldown, até ficar 100% amarelo (pronto). Sem texto
   numérico. --hint-progress vai de 0 (recém-usado) a 1 (pronto). */
.mg-hint-btn {
  --hint-progress: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background:
    linear-gradient(to right, #f59e0b 0%, #f59e0b 100%) no-repeat left center,
    #f1f5f9;
  background-size: calc(var(--hint-progress) * 100%) 100%, 100% 100%;
  color: #1f2937;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 0;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: background-size 250ms linear, transform 60ms ease, box-shadow 150ms ease;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.mg-hint-btn:not(:disabled):hover  { box-shadow: 0 4px 12px -2px rgba(245, 158, 11, 0.45); }
.mg-hint-btn:not(:disabled):active { transform: scale(0.97); }
.mg-hint-btn:disabled              { cursor: wait; }

/* Variante só-ícone: botão quadrado/redondo sem texto, ideal pra toolbar
   compacta. Mantém o gradiente do cooldown (no caso do hint). */
.mg-action-btn--icon,
.mg-hint-btn--icon {
  padding: 0;
  width: 2.5rem;
  height: 2.5rem;
  justify-content: center;
  gap: 0;
}

/* Variante de texto branco do botão Dica — usada quando o botão tem texto
   curto ao lado do ícone (ex: "Letra"/"Palavra" das cruzadas) e o slate
   default fica com contraste baixo no amarelo. */
.mg-hint-btn--light {
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(146, 64, 14, 0.35);
}

/* Sudoku — pulse sutil quando o jogador completa linha/coluna/quadrante. */
.mg-s-complete { animation: mg-s-complete-pulse 600ms ease-out; }
@keyframes mg-s-complete-pulse {
  0%   { background: #fef9c3; transform: scale(1); }
  35%  { background: #d1fae5; transform: scale(1.04); }
  100% { background: transparent; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .mg-s-complete { animation: none; }
}
