/*
 * 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%); }

/* 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);
}

.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;
  max-width: 480px;
  margin: 0 auto;
  background: #1f2937;
  padding: 2px;
  border-radius: 8px;
}
.mg-q-cell, .mg-z-cell, .mg-s-cell {
  aspect-ratio: 1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.2rem, 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;
}
.mg-t-cell:hover  { transform: scale(1.04); }
.mg-t-cell:active { transform: scale(0.95); }
.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 — sobreposição entre células */
.mg-t-constraint {
  position: absolute;
  z-index: 2;
  background: #1f2937;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.mg-t-c-h { right: -10px; top: 50%; transform: translateY(-50%); }
.mg-t-c-v { bottom: -10px; left: 50%; transform: translateX(-50%); }

/* ── Caça-Palavras ────────────────────────────────────────────── */
.mg-w-grid {
  display: grid;
  gap: 2px;
  max-width: 520px;
  margin: 0 auto;
  background: #cbd5e1;
  padding: 2px;
  border-radius: 8px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mg-w-cell {
  aspect-ratio: 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: clamp(0.9rem, 3.5vw, 1.4rem);
  color: #0f172a;
  cursor: pointer;
  border-radius: 4px;
  transition: background 80ms ease, transform 60ms ease;
  user-select: none;
}
.mg-w-cell.mg-w-selecting { background: #fde68a; color: #78350f; transform: scale(1.04); }
.mg-w-cell.mg-w-found     { background: #fecaca; color: #7f1d1d; }
.mg-w-cell.mg-w-found.mg-w-selecting { background: #fca5a5; }
.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: #fee2e2;
  color: #7f1d1d;
  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); }
}
.mg-c-grid {
  display: grid;
  gap: 1px;
  background: #0f172a;
  padding: 2px;
  border-radius: 8px;
  max-width: 540px;
}
.mg-c-cell {
  position: relative;
  aspect-ratio: 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: clamp(0.8rem, 2.6vw, 1.1rem);
  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; }
.mg-c-revealed { color: #6b7280; font-style: italic; background: #f1f5f9; }
.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; }
/* 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; }
