/* =========================================================
   MEMÓRIA VIVA (MENTE FORTE) - ESTILOS VISUAIS E ACESSIBILIDADE
   Cores fiéis aos protótipos: Fundo escuro repousante, cartões verdes e toques menta/rosa
   ========================================================= */

:root {
  --bg-main: #0c1510;
  --bg-card: #13221a;
  --bg-card-hover: #182b21;
  --border-card: #1f372a;
  --border-card-active: #34d399;
  
  --color-primary: #52c79a;
  --color-primary-hover: #40b085;
  --color-accent-pink: #f43f5e;
  --color-card-back: #54bda2;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-highlight: #6ee7b7;
  
  --banner-bg: #2b2216;
  --banner-text: #fde68a;
  --banner-border: #45341c;
  
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px;
  user-select: none;
}

.app-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cabeçalho */
.app-header {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 8px;
  margin-bottom: 8px;
}

.app-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.app-logo-badge .brain-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Barra Superior com Voltar */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 4px;
}

.btn-back {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  transition: color 0.2s;
  text-decoration: none;
}

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

.sound-toggle-btn {
  background: #192d22;
  border: 1px solid var(--border-card);
  color: #a7f3d0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Títulos */
.page-title {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Banner de Instrução */
.instruction-banner {
  background-color: var(--banner-bg);
  border: 1px solid var(--banner-border);
  color: var(--banner-text);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 1.12rem;
  font-weight: 600;
  text-align: center;
  display: block;
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.3s ease;
  word-break: break-word;
}

.instruction-banner strong {
  color: #fef08a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Cartões de Ação na Home */
.menu-cards-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.action-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  cursor: pointer;
}

.action-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-card-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.12);
}

.action-card:active {
  transform: translateY(0);
}

.action-card-icon {
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(82, 199, 154, 0.12);
  flex-shrink: 0;
}

.action-card-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.action-card-body p {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Input do Nome do Jogador */
.player-input-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.player-input-card label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.player-input-wrapper {
  position: relative;
  width: 100%;
}

.player-input-field {
  width: 100%;
  background: #122119;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 1.25rem;
  color: #ffffff;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}

.player-input-field:focus {
  border-color: var(--color-primary);
  background: #14281e;
}

/* Jogo da Memória - Tabuleiro e Cartas */
.game-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.game-level-badge {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
}

.game-pairs-counter {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
}

.memory-grid {
  display: grid;
  gap: 14px;
  margin-top: 10px;
  width: 100%;
  perspective: 1000px;
}

/* Grids por nível */
.grid-easy {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 140px;
}

.grid-medium {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 130px;
}

.grid-hard {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 115px;
}

@media (max-width: 480px) {
  .grid-easy { grid-auto-rows: 120px; }
  .grid-medium { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 110px; }
  .grid-hard { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 95px; }
}

/* Efeito 3D da Carta */
.card-item {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  border-radius: var(--radius-lg);
}

.card-item.flipped, .card-item.matched {
  transform: rotateY(180deg);
}

.card-item.matched {
  cursor: default;
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Face verso (fechada) - Menta com ponto de interrogação rosa */
.card-back {
  background-color: var(--color-card-back);
  color: var(--color-accent-pink);
  font-size: 3rem;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Face frente (aberta) */
.card-front {
  background-color: var(--bg-card);
  border: 2px solid var(--border-card);
  transform: rotateY(180deg);
  padding: 8px;
  text-align: center;
}

.card-item.matched .card-front {
  border-color: #34d399;
  background-color: #173426;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.35);
}

.card-front-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.card-front-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #52c79a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.card-front-name {
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

/* Jogo "Quem é Quem" */
.quem-card-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

.quem-photo-frame {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid var(--color-primary);
  box-shadow: 0 8px 25px rgba(82, 199, 154, 0.25);
  background: #0f1c15;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quem-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quem-question-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.quem-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.quem-option-btn {
  background-color: #1a2e23;
  border: 1px solid #274535;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.quem-option-btn:hover {
  background-color: #203a2c;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.quem-option-btn.correct {
  background-color: #10462c !important;
  border-color: #34d399 !important;
  color: #a7f3d0 !important;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
}

.quem-option-btn.wrong {
  background-color: #3b1d1d !important;
  border-color: #7f1d1d !important;
  color: #fca5a5 !important;
  opacity: 0.7;
}

.quem-feedback-box {
  display: none;
  background: #143323;
  border: 1px solid #2a6345;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #d1fae5;
  text-align: center;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

/* Álbum de Família (Upload & Lista) */
.upload-card {
  background: var(--bg-card);
  border: 2px dashed #284435;
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: border-color 0.2s;
}

.upload-card:hover {
  border-color: var(--color-primary);
}

.upload-form-group {
  margin-bottom: 14px;
  text-align: left;
}

.upload-form-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.upload-input-text {
  width: 100%;
  background: #0f1c15;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #ffffff;
  font-size: 1.05rem;
  outline: none;
}

.upload-input-text:focus {
  border-color: var(--color-primary);
}

.btn-primary-action {
  background-color: var(--color-primary);
  color: #071f15;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 24px;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-primary-action:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.family-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.family-card-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-primary);
  margin-bottom: 10px;
}

.family-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}

.family-card-kin {
  font-size: 0.95rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.family-card-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.family-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* Painel de Progresso (Idêntico ao print 5) */
.progress-chart-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.progress-chart-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 18px;
}

.chart-bars-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 150px;
  padding: 10px 0;
  border-bottom: 1px solid #1f372a;
}

.chart-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-visual {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s ease;
  min-height: 8px;
}

.chart-bar-teal {
  background-color: #55baa0;
}

.chart-bar-yellow {
  background-color: #f59e0b;
}

.chart-bar-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Lista de Partidas no Histórico */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: #0f1c15;
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: #244233;
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

.history-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.history-card-details {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.history-card-score {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
}

/* Orientações Médicas */
.medical-box {
  background: #11261b;
  border: 1px solid #234d36;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.medical-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6ee7b7;
  font-weight: 700;
  font-size: 1.15rem;
}

.medical-text {
  font-size: 1rem;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Modais e Feedback de Vitória */
.victory-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.victory-card {
  background: #13271d;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.victory-icon {
  font-size: 4rem;
  margin-bottom: 12px;
}

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

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================================
   ESTILOS DO JOGO DO LABIRINTO (VISUOESPACIAL E ACESSIBILIDADE)
   ========================================================= */

.maze-screen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.maze-canvas-wrapper {
  background: var(--bg-card);
  border: 3px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  touch-action: none;
  max-width: 100%;
  box-sizing: border-box;
}

#mazeCanvas {
  border-radius: var(--radius-md);
  cursor: pointer;
  background: #0b1611;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

/* Legenda de Alto Contraste do Labirinto */
.maze-legend-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: #cbd5e1;
  background: rgba(19, 34, 26, 0.7);
  border: 1px solid #1f372a;
  padding: 6px 14px;
  border-radius: 9999px;
  margin-top: -4px;
}

.maze-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.maze-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dot-player {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  border: 1px solid #ffffff;
}

.dot-wall {
  background: #e2e8f0;
  border: 1.5px solid #94a3b8;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.dot-goal {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  border: 1px solid #ffffff;
}

/* D-Pad Virtual Grande para Idosos */
.dpad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  user-select: none;
}

.dpad-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.dpad-btn {
  background-color: #172c21;
  border: 2px solid #274b37;
  color: #a7f3d0;
  width: 68px;
  height: 64px;
  border-radius: 16px;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.12s ease;
}

.dpad-btn:hover {
  background-color: #1f3d2e;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.dpad-btn:active {
  background-color: var(--color-primary);
  color: #071f15;
  transform: translateY(2px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* =========================================================
   ESTILOS DO JOGO SEPARAR OS GRÃOS (TERAPIA OCUPACIONAL)
   ========================================================= */

.grains-game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

/* Mesa de Preparo */
.grains-table-area {
  width: 100%;
  height: 280px;
  background: radial-gradient(circle, #192a20 0%, #111e17 100%);
  border: 3px solid #284635;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 4px 20px rgba(0,0,0,0.5), 0 8px 30px rgba(0,0,0,0.4);
  touch-action: none;
}

/* Grãos */
.grain-item {
  position: absolute;
  width: 58px;
  height: 48px;
  border-radius: 45% 55% 55% 45% / 55% 45% 55% 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.3s;
  z-index: 10;
}

.grain-item:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 16px rgba(0,0,0,0.6);
}

.grain-item.selected {
  outline: 3px solid #52c79a;
  box-shadow: 0 0 20px rgba(82, 199, 154, 0.8);
  transform: scale(1.2) !important;
  z-index: 30;
}

.grain-item.dragging {
  opacity: 0.9;
  transform: scale(1.25) !important;
  z-index: 40;
}

.grain-item.deposited {
  transform: scale(0.2) !important;
  opacity: 0;
}

.grain-symbol {
  font-size: 1.8rem;
  line-height: 1;
}

/* Tipos de Grãos */
.grain-preto {
  background: radial-gradient(circle at 35% 35%, #3f3f46, #09090b);
  border: 2px solid #52525b;
}

.grain-carioca {
  background: radial-gradient(circle at 35% 35%, #fde68a, #b45309);
  border: 2px solid #78350f;
}

.grain-milho {
  background: radial-gradient(circle at 35% 35%, #fef08a, #ca8a04);
  border: 2px solid #a16207;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

/* Tigelas Receptoras */
.bowls-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

@media (max-width: 500px) {
  .bowls-container {
    gap: 8px;
  }
}

.bowl-item {
  background: #14241c;
  border: 2px solid #284635;
  border-radius: var(--radius-lg);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.bowl-item:hover {
  background: #1b3226;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.bowl-item:active {
  transform: translateY(0);
}

.bowl-preto {
  border-top: 4px solid #71717a;
}

.bowl-carioca {
  border-top: 4px solid #d97706;
}

.bowl-milho {
  border-top: 4px solid #eab308;
}

.bowl-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.bowl-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.bowl-counter-badge {
  background: rgba(0,0,0,0.4);
  border: 1px solid #284635;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #a7f3d0;
}

/* =========================================================
   ESTILOS DA FEIRA DA MEMÓRIA (FOTOS E NOMES)
   ========================================================= */

.feira-game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

/* Seção de Fotos */
.feira-section-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #a7f3d0;
  margin-bottom: 6px;
  align-self: flex-start;
}

.feira-photos-grid {
  display: grid;
  gap: 14px;
  width: 100%;
}

.photos-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.photos-grid-6 {
  grid-template-columns: repeat(3, 1fr);
}

.photos-grid-8 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 520px) {
  .photos-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
  .photos-grid-8 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feira-photo-card {
  background: var(--bg-card);
  border: 3px solid #274535;
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  position: relative;
  min-height: 120px;
}

.feira-photo-card:hover {
  background: #1b3226;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.feira-photo-card.selected {
  border-color: #52c79a;
  box-shadow: 0 0 18px rgba(82, 199, 154, 0.7);
  transform: scale(1.03);
}

.feira-photo-card.matched {
  border-color: #34d399;
  background: #133324;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}

.feira-photo-img-wrap {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feira-photo-icon {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.feira-photo-matched-label {
  display: none;
  margin-top: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 4px 10px;
  width: 100%;
  text-align: center;
}

/* Seção de Plaquinhas Laranjas de Nomes */
.feira-names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  width: 100%;
}

.feira-name-tile {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: 2px solid #fdba74;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
  transition: all 0.2s ease;
  user-select: none;
  touch-action: none;
}

.feira-name-tile:hover {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.5);
}

.feira-name-tile.selected {
  outline: 3px solid #ffffff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

.feira-name-tile.matched {
  opacity: 0.25;
  pointer-events: none;
  background: #334155;
  border-color: #475569;
  box-shadow: none;
}

.feira-name-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.feira-sound-mini-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  color: #ffffff;
}

.feira-sound-mini-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* =========================================================
   TELA DE ABERTURA / APRESENTAÇÃO RICORDA
   ========================================================= */

.abertura-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  gap: 16px;
  padding: 10px 0;
}

.abertura-logo-frame {
  width: 220px;
  height: 220px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(82, 199, 154, 0.25);
  border: 3px solid #274b37;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.6s ease;
}

.abertura-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.abertura-text-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.abertura-brand-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 2px;
}

.abertura-brand-subtitle {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.abertura-welcome-msg {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 6px auto 0;
  line-height: 1.4;
}

.abertura-player-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.abertura-player-card label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #a7f3d0;
}

/* =========================================================
   GUIA CLÍNICO PARA MÉDICOS E CUIDADORES
   ========================================================= */

.guia-clinico-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.btn-print {
  background: #173224;
  border: 1px solid #2e5941;
  color: #a7f3d0;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-print:hover {
  background: var(--color-primary);
  color: #071f15;
}

.guia-header-card {
  background: #122119;
  border: 1px solid #1f3d2d;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.guia-games-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guia-game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}

.guia-game-card:hover {
  border-color: #2e5941;
}

.guia-game-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid #1a3023;
  padding-bottom: 10px;
}

.guia-game-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.guia-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-memoria { background: #064e3b; color: #a7f3d0; border: 1px solid #059669; }
.badge-atencao { background: #1e3a8a; color: #bfdbfe; border: 1px solid #2563eb; }
.badge-autobio { background: #701a75; color: #f5d0fe; border: 1px solid #c026d3; }
.badge-afeto { background: #831843; color: #fbcfe8; border: 1px solid #db2777; }
.badge-reconhecimento { background: #134e4a; color: #99f6e4; border: 1px solid #0d9488; }
.badge-executiva { background: #78350f; color: #fde68a; border: 1px solid #d97706; }
.badge-visuoespacial { background: #312e81; color: #c7d2fe; border: 1px solid #4f46e5; }
.badge-planejamento { background: #1f2937; color: #e5e7eb; border: 1px solid #4b5563; }
.badge-logica { background: #14532d; color: #bbf7d0; border: 1px solid #16a34a; }
.badge-sensorial { background: #3b0764; color: #e9d5ff; border: 1px solid #9333ea; }
.badge-ocupacional { background: #854d0e; color: #fef08a; border: 1px solid #ca8a04; }
.badge-motora { background: #831843; color: #fce7f3; border: 1px solid #e11d48; }
.badge-procedural { background: #1e293b; color: #cbd5e1; border: 1px solid #334155; }
.badge-linguagem { background: #c2410c; color: #ffedd5; border: 1px solid #f97316; }
.badge-semantica { background: #0369a1; color: #e0f2fe; border: 1px solid #0284c7; }
.badge-anomia { background: #991b1b; color: #fee2e2; border: 1px solid #dc2626; }

.guia-body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guia-tip {
  background: #11231a;
  border-left: 3px solid var(--color-primary);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.guia-recommendations-card {
  background: #11241b;
  border: 1px solid #234d36;
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 10px;
}

/* Regras de Impressão para o Guia Clínico */
@media print {
  body {
    background: #ffffff !important;
    color: #111827 !important;
    padding: 0 !important;
  }
  .app-header, .top-nav, .btn-print, .btn-back {
    display: none !important;
  }
  .app-container {
    max-width: 100% !important;
  }
  .guia-header-card, .guia-game-card, .guia-recommendations-card {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    color: #111827 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .guia-game-title, .page-title {
    color: #111827 !important;
  }
  .badge-tag {
    border: 1px solid #9ca3af !important;
    color: #111827 !important;
    background: #f3f4f6 !important;
  }
  .guia-tip {
    background: #f9fafb !important;
    color: #374151 !important;
    border-left: 3px solid #059669 !important;
  }
}

/* =========================================================
   SISTEMA DE LOGIN, CADASTRO DO PACIENTE E ACESSIBILIDADE SÊNIOR
   Letras grandes, alto contraste e áreas de toque confortáveis
   ========================================================= */

.app-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
}

.app-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

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

.header-patient-bar, .header-patient-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #13221a;
  border: 1px solid #1f372a;
  padding: 6px 14px;
  border-radius: 9999px;
  width: 100%;
  box-sizing: border-box;
}

.header-patient-name {
  font-size: 1rem;
  color: #f8fafc;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-header-switch, .btn-header-login {
  background: rgba(82, 199, 154, 0.15);
  border: 1px solid rgba(82, 199, 154, 0.35);
  color: #6ee7b7;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-header-switch:hover, .btn-header-login:hover {
  background: #52c79a;
  color: #0c1510;
}

/* Hero Cards / Cabeçalhos */
.senior-hero-card {
  background: linear-gradient(135deg, #13271d 0%, #0e1c15 100%);
  border: 1px solid #274b37;
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.senior-page-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.25;
}

.senior-page-subtitle {
  font-size: 1.3rem;
  color: #a7f3d0;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto;
}

/* Alertas com Letras Grandes */
.senior-alert-error {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid #ef4444;
  color: #fca5a5;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.senior-alert-success {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #10b981;
  color: #a7f3d0;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  font-weight: 600;
}

.senior-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #11281e;
  border: 1.5px solid #2d6145;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 1.15rem;
  color: #d1fae5;
  line-height: 1.5;
}

/* Seções e Cards de Perfil */
.senior-section-card {
  background: #13221a;
  border: 1.5px solid #233e30;
  border-radius: var(--radius-lg);
  padding: 22px;
}

.senior-section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.senior-section-desc {
  font-size: 1.2rem;
  color: #94a3b8;
  margin-bottom: 16px;
  line-height: 1.4;
}

.senior-players-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.senior-player-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #172b20;
  border: 2px solid #285038;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.senior-player-card:hover, .senior-player-card:focus {
  background: #1c3829;
  border-color: #52c79a;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(82, 199, 154, 0.25);
}

.senior-player-avatar {
  font-size: 2.4rem;
  width: 58px;
  height: 58px;
  background: rgba(82, 199, 154, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.senior-player-info {
  flex: 1;
}

.senior-player-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.senior-player-detail {
  font-size: 1.15rem;
  color: #a7f3d0;
  margin-top: 4px;
}

.btn-play-quick {
  background: #52c79a;
  color: #0c1510;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Novo Paciente Box */
.senior-new-patient-box {
  background: #102117;
  border: 2px dashed #2d6145;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
}

.senior-btn-register {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #52c79a;
  color: #0c1510;
  font-size: 1.35rem;
  font-weight: 800;
  padding: 16px 28px;
  border-radius: var(--radius-md);
  text-decoration: none;
  min-height: 60px;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(82, 199, 154, 0.3);
}

.senior-btn-register:hover {
  background: #6ee7b7;
  transform: translateY(-2px);
}

/* Formulários de Alta Acessibilidade para Idosos */
.senior-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.senior-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.senior-form-row {
  display: flex;
  gap: 14px;
}

@media (max-width: 540px) {
  .senior-form-row {
    flex-direction: column;
    gap: 18px;
  }
}

.senior-label {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.required-mark {
  color: #f43f5e;
  font-weight: 900;
}

.senior-input {
  background: #112218;
  border: 2px solid #2a4c37;
  color: #ffffff;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 1.35rem;
  min-height: 58px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.senior-input:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
  background: #142a1e;
}

.senior-input::placeholder {
  color: #64748b;
  font-size: 1.15rem;
}

.senior-select {
  cursor: pointer;
}

.senior-help-text {
  font-size: 1.05rem;
  color: #94a3b8;
  margin-top: 2px;
}

.senior-btn-submit {
  background: #52c79a;
  color: #0c1510;
  border: none;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(82, 199, 154, 0.35);
}

.senior-btn-submit:hover {
  background: #6ee7b7;
  transform: translateY(-2px);
}

.senior-btn-cancel {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  display: block;
}

.senior-btn-cancel:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

/* Cartão do Paciente em Progresso e UUID */
.senior-patient-card {
  background: #13241b;
  border: 2px solid #274b37;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
}

.senior-patient-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.senior-patient-avatar {
  font-size: 2.8rem;
  width: 68px;
  height: 68px;
  background: rgba(82, 199, 154, 0.15);
  border: 2px solid #34d399;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.badge-active-patient {
  background: rgba(52, 211, 153, 0.2);
  border: 1px solid #34d399;
  color: #a7f3d0;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
}

/* Container do UUID */
.senior-uuid-container {
  background: #0d1a13;
  border: 1.5px solid #224231;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
}

.senior-uuid-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.senior-uuid-value-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.senior-uuid-code {
  background: #15291e;
  border: 1px solid #2a523a;
  color: #34d399;
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  word-break: break-all;
}

.btn-copy-uuid {
  background: #204030;
  border: 1px solid #336348;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-uuid:hover {
  background: #52c79a;
  color: #0c1510;
}

/* Detalhes Cadastrais */
.senior-details-box {
  background: #0f1e16;
  border: 1px solid #1f3a2b;
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.senior-details-summary {
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 700;
  color: #6ee7b7;
}

.senior-cadastral-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(82, 199, 154, 0.2);
}

@media (max-width: 600px) {
  .senior-cadastral-grid {
    grid-template-columns: 1fr;
  }
}

.cadastral-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cadastral-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #94a3b8;
}

.cadastral-val {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
}

/* =========================================================
   ESTILOS DO JOGO ORDEM DOS NÚMEROS (SEQUENCIAMENTO & COGNIÇÃO)
   ========================================================= */

.ordem-game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 14px;
}

.ordem-section-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #a7f3d0;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Fila de Slots de Destino */
.ordem-slots-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(6px, 1.8vw, 10px);
  width: 100%;
  background: rgba(15, 28, 21, 0.85);
  border: 2px solid #1f3b2d;
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  min-height: 84px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.ordem-slot {
  flex: 0 0 auto;
  width: clamp(44px, 12.5vw, 68px);
  height: clamp(56px, 15vw, 76px);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.ordem-slot.empty {
  border: 2px dashed #345e46;
  background: rgba(23, 44, 33, 0.5);
}

.ordem-slot.filled {
  border: 2.5px solid #fbbf24;
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.28);
  animation: slotPop 0.35s ease;
}

@keyframes slotPop {
  0% { transform: scale(0.7); opacity: 0.5; }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

.ordem-slot-pos {
  font-size: clamp(0.6rem, 1.8vw, 0.75rem);
  font-weight: 700;
  color: #94a3b8;
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  text-align: center;
}

.ordem-slot.filled .ordem-slot-pos {
  color: #fde68a;
}

.ordem-slot-val {
  font-size: clamp(1.4rem, 4.5vw, 2.1rem);
  font-weight: 900;
  color: #ffffff;
  margin-top: 8px;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Mesa de Cartões de Números para Escolha */
.ordem-cards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 2.2vw, 14px);
  width: 100%;
  padding: 8px 0;
  box-sizing: border-box;
}

.ordem-number-card {
  flex: 0 0 auto;
  min-width: clamp(56px, 15vw, 76px);
  height: clamp(66px, 18vw, 84px);
  background: linear-gradient(135deg, #193828 0%, #11241a 100%);
  border: 2.5px solid #34d399;
  border-radius: var(--radius-lg);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  touch-action: manipulation;
  padding: 4px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-sizing: border-box;
}

.ordem-number-card:hover {
  background: linear-gradient(135deg, #234c37 0%, #173727 100%);
  border-color: #6ee7b7;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(82, 199, 154, 0.3);
}

.ordem-number-card:active {
  transform: translateY(1px);
}

.ordem-card-num {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #f8fafc;
  line-height: 1;
}

.ordem-number-card.placed {
  opacity: 0.15;
  pointer-events: none;
  transform: scale(0.85);
  border-color: #1f372a;
}

.ordem-number-card.shake {
  animation: softShake 0.45s ease;
  border-color: #f87171 !important;
}

@keyframes softShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.ordem-number-card.hint-glow {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.8) !important;
  animation: hintPulse 0.6s infinite alternate;
}

@keyframes hintPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* ====================================================================
   SUÍTE COMPLETA DE RESPONSIVIDADE - RICORDA / MEMÓRIA VIVA
   Telas Médias (Tablets) e Telas Menores (Smartphones 320px - 480px)
   ==================================================================== */

/* --- TABLETS E TELAS INTERMEDIÁRIAS (<= 768px) --- */
@media (max-width: 768px) {
  body {
    padding: 18px 12px;
  }

  .app-container {
    gap: 16px;
    max-width: 100%;
  }

  .admin-wrapper {
    padding: 0 4px;
  }
}

/* --- SMARTPHONES E TELAS PEQUENAS (<= 480px) --- */
@media (max-width: 480px) {
  body {
    padding: 12px 10px;
  }

  .app-container {
    gap: 12px;
  }

  /* Cabeçalho */
  .app-header {
    width: 100%;
    margin-bottom: 6px;
    gap: 6px;
  }

  .app-header-top {
    width: 100%;
    justify-content: space-between;
  }

  .app-logo-badge {
    font-size: 1.2rem;
    gap: 6px;
  }

  .app-logo-badge img, .app-logo-img {
    height: 32px !important;
    width: 32px !important;
  }

  .header-patient-bar, .header-patient-badge {
    padding: 5px 12px;
    width: 100%;
    gap: 6px;
  }

  .header-patient-name {
    font-size: 0.92rem;
    max-width: 100%;
    white-space: normal;
  }

  .btn-header-switch, .btn-header-login {
    font-size: 0.88rem;
    padding: 4px 10px;
  }

  /* Títulos e Textos Principais */
  .page-title {
    font-size: 1.55rem;
    line-height: 1.2;
  }

  .page-subtitle {
    font-size: 0.92rem;
    margin-bottom: 8px;
  }

  .instruction-banner {
    padding: 10px 12px;
    font-size: 0.98rem;
    border-radius: var(--radius-sm);
  }

  .top-nav {
    margin-bottom: 2px;
  }

  .btn-back {
    font-size: 0.95rem;
  }

  .sound-toggle-btn {
    font-size: 0.82rem;
    padding: 4px 8px;
  }

  /* Cartões de Ação do Menu Principal */
  .menu-cards-list {
    gap: 10px;
  }

  .action-card {
    padding: 14px 14px;
    gap: 12px;
    border-radius: var(--radius-md);
  }

  .action-card-icon {
    width: 44px;
    height: 44px;
    font-size: 1.7rem;
    border-radius: 12px;
  }

  .action-card-body h3 {
    font-size: 1.12rem;
    margin-bottom: 2px;
  }

  .action-card-body p {
    font-size: 0.86rem;
    line-height: 1.3;
  }

  /* Jogo do Labirinto */
  .maze-screen-container {
    gap: 10px;
  }

  .maze-canvas-wrapper {
    padding: 8px;
    border-width: 2px;
    border-radius: var(--radius-md);
  }

  .maze-legend-row {
    font-size: 0.82rem;
    padding: 4px 10px;
    gap: 8px;
  }

  .dpad-container {
    gap: 6px;
    margin-top: 2px;
  }

  .dpad-row {
    gap: 8px;
  }

  .dpad-btn {
    width: 56px;
    height: 52px;
    font-size: 1.45rem;
    border-radius: 12px;
    touch-action: manipulation;
  }

  /* Jogo da Memória */
  .memory-grid {
    gap: 8px;
    margin-top: 6px;
  }

  .grid-easy {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 105px;
  }

  .grid-medium {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 92px;
  }

  .grid-hard {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 78px;
  }

  .card-face-back .card-symbol {
    font-size: 2.1rem;
  }

  /* Jogo Separar Grãos */
  .bowls-container {
    gap: 6px;
  }

  .bowl-item {
    padding: 8px 4px;
    border-radius: 12px;
  }

  .bowl-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
  }

  .bowl-title {
    font-size: 0.78rem;
    margin-bottom: 3px;
    line-height: 1.15;
  }

  .bowl-counter-badge {
    font-size: 0.74rem;
    padding: 2px 5px;
  }

  .grains-table-area {
    min-height: 190px;
  }

  /* Jogo Feira da Memória */
  .feira-photos-grid {
    gap: 8px;
  }

  .feira-photo-card {
    min-height: 95px;
    padding: 6px;
  }

  .feira-photo-img-wrap {
    height: 55px;
  }

  .feira-photo-icon {
    font-size: 2.2rem;
  }

  .feira-photo-matched-label {
    font-size: 0.8rem;
    padding: 2px 4px;
  }

  .feira-names-grid {
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 6px;
  }

  .feira-name-tile {
    padding: 8px 10px;
    border-radius: 10px;
  }

  .feira-name-text {
    font-size: 0.92rem;
  }

  .feira-sound-mini-btn {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  /* Jogo Ordem dos Números */
  .ordem-slots-container {
    gap: 6px;
    padding: 10px 6px;
    min-height: 72px;
  }

  .ordem-slot {
    width: clamp(42px, 12.5vw, 52px);
    height: clamp(52px, 15vw, 62px);
    border-radius: 8px;
  }

  .ordem-slot-pos {
    font-size: 0.65rem;
    top: 2px;
    left: 0;
    right: 0;
    text-align: center;
  }

  .ordem-slot-val {
    font-size: clamp(1.3rem, 4.2vw, 1.6rem);
    margin-top: 6px;
  }

  .ordem-cards-grid {
    gap: 8px;
    padding: 8px 4px;
  }

  .ordem-number-card {
    min-width: clamp(52px, 15vw, 64px);
    height: clamp(62px, 18vw, 72px);
    border-radius: 12px;
  }

  .ordem-card-num {
    font-size: clamp(1.6rem, 5vw, 1.9rem);
  }

  /* Jogo Quem é Quem */
  .quem-card-container {
    padding: 16px 12px;
    gap: 12px;
  }

  .quem-photo-frame {
    width: 140px;
    height: 140px;
    border-width: 4px;
  }

  .quem-question-text {
    font-size: 1.2rem;
  }

  .quem-option-btn {
    padding: 12px 14px;
    font-size: 1.05rem;
  }

  /* Formulários do Paciente (Cadastro e Login) */
  .senior-hero-card {
    padding: 16px 12px;
  }

  .senior-page-title {
    font-size: 1.45rem;
  }

  .senior-page-subtitle {
    font-size: 0.98rem;
  }

  .senior-section-card {
    padding: 14px 12px;
  }

  .senior-section-title {
    font-size: 1.25rem;
  }

  .senior-section-desc {
    font-size: 0.92rem;
  }

  .senior-label {
    font-size: 1.1rem;
  }

  .senior-input {
    font-size: 1.1rem;
    padding: 12px 14px;
    min-height: 48px;
    border-radius: 10px;
  }

  .senior-btn-submit, .senior-btn-register {
    font-size: 1.15rem;
    padding: 13px 16px;
    min-height: 48px;
  }

  .senior-patient-card {
    padding: 14px 12px;
  }

  .senior-uuid-container {
    padding: 10px 12px;
  }

  .senior-uuid-code {
    font-size: 0.88rem;
    padding: 4px 8px;
  }

  .btn-copy-uuid {
    font-size: 0.85rem;
    padding: 5px 10px;
  }

  .senior-details-box {
    padding: 10px 12px;
  }

  .senior-details-summary {
    font-size: 0.98rem;
  }

  .cadastral-label {
    font-size: 0.9rem;
  }

  .cadastral-val {
    font-size: 1.05rem;
  }

  /* Progresso e Gráficos */
  .progress-chart-card {
    padding: 14px 12px;
  }

  .chart-bars-container {
    height: 120px;
    gap: 6px;
  }

  .chart-bar-date {
    font-size: 0.72rem;
  }

  .history-card {
    padding: 12px 10px;
  }

  .history-card-title {
    font-size: 1.05rem;
  }

  .history-card-details {
    font-size: 0.88rem;
  }

  .history-card-score {
    font-size: 1.2rem;
  }

  .medical-box {
    padding: 14px 12px;
  }

  .medical-box-header {
    font-size: 1.15rem;
  }

  .medical-text {
    font-size: 1.02rem;
  }

  /* Galeria de Fotos da Família */
  .family-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .family-card {
    padding: 12px 8px;
    border-radius: 14px;
  }

  .family-card-img {
    width: 68px;
    height: 68px;
  }

  .family-card-name {
    font-size: 1.05rem;
  }

  .family-card-kin {
    font-size: 0.88rem;
  }

  .family-card-note {
    font-size: 0.78rem;
  }

  /* Modais de Conclusão / Vitória */
  .victory-modal {
    padding: 12px;
  }

  .victory-card {
    padding: 22px 14px;
    max-width: 95%;
    border-radius: 16px;
  }

  .victory-icon {
    font-size: 2.8rem;
  }

  .victory-card h2 {
    font-size: 1.45rem !important;
  }

  .victory-card p {
    font-size: 0.98rem !important;
  }

  .btn-primary-action {
    padding: 13px 16px;
    font-size: 1.05rem;
  }
}

/* --- TELAS EXTRA PEQUENAS (<= 360px) --- */
@media (max-width: 360px) {
  body {
    padding: 10px 6px;
  }

  .dpad-btn {
    width: 48px;
    height: 46px;
    font-size: 1.25rem;
    border-radius: 10px;
  }

  .dpad-row {
    gap: 6px;
  }

  .header-patient-name {
    font-size: 0.88rem;
    max-width: 100%;
    white-space: normal;
  }

  .grid-easy {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 95px;
  }

  .grid-medium {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 85px;
  }

  .grid-hard {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 72px;
  }

  /* Jogo Ordem dos Números (360px) */
  .ordem-slots-container {
    gap: 4px;
    padding: 8px 4px;
    min-height: 64px;
  }

  .ordem-slot {
    width: 38px;
    height: 48px;
    border-radius: 6px;
  }

  .ordem-slot-pos {
    font-size: 0.55rem;
    top: 2px;
    left: 0;
    right: 0;
    text-align: center;
  }

  .ordem-slot-val {
    font-size: 1.25rem;
    margin-top: 4px;
  }

  .ordem-cards-grid {
    gap: 6px;
  }

  .ordem-number-card {
    min-width: 46px;
    height: 56px;
    border-radius: 10px;
  }

  .ordem-card-num {
    font-size: 1.45rem;
  }
}





