/* ═══════════════════════════════════════════════════════════
   SICOOB CREDIPEU — Design System v5
   Pixel-perfect match com os mockups das 9 telas
   ═══════════════════════════════════════════════════════════ */

/* ─── TOKENS ───────────────────────────────────────────────── */
:root {
  --teal:      #00ae9d;
  --lime:      #c5d400;   /* amarelo-limão do botão e "da" */
  --yellow:    #c5d400;   /* mesmo tom usado em textos de prêmio */
  --navy:      #003641;
  --white:     #ffffff;
  --w70:       rgba(255,255,255,0.70);
  --w40:       rgba(255,255,255,0.40);
  --w15:       rgba(255,255,255,0.15);
  --font:      'Nunito', sans-serif;
  --font-title: 'Fredoka One', 'Nunito', sans-serif;
  --lime-btn:    #aad219;   /* tom verde-limão clássico do print */
  --lime-btn-dk: #8bab15;
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--teal);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-text-size-adjust: 100%;
}
img { display: block; }

/* ─── OVERLAYS ──────────────────────────────────────────────── */
#bg-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
#confetti-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
}
#transition-overlay {
  position: fixed; inset: 0;
  background: var(--teal);
  pointer-events: none; z-index: 998;
  opacity: 0; transition: opacity .3s ease;
}
#transition-overlay.fade-in  { opacity: 1; pointer-events: all; }
#transition-overlay.fade-out { opacity: 0; }

/* ─── SOM ───────────────────────────────────────────────────── */
#sound-toggle {
  position: fixed;
  top: clamp(10px,2vw,18px); right: clamp(10px,2.5vw,18px);
  z-index: 100;
  background: var(--w15); border: none; border-radius: 50%;
  width: clamp(34px,6vw,46px); height: clamp(34px,6vw,46px);
  font-size: clamp(15px,3vw,20px);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
#sound-toggle:hover { background: var(--w40); }

/* ═══════════════════════════════════════════════════════════
   SCREENS
   ═══════════════════════════════════════════════════════════ */
.screen {
  position: fixed; inset: 0;
  display: none; flex-direction: column;
  background: transparent;
  overflow: hidden;
}
.screen.active { display: flex; }

/* Base scrollable body styling with hidden scrollbars for native kiosk feel */
.screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;  /* IE/Edge */
  scrollbar-width: none;  /* Firefox */
}
.screen-body::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

/* ─── FOOTER (todas as telas) ───────────────────────────────── */
.screen-footer {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(14px,3vh,26px) clamp(20px,5vw,48px);
  /* Seamless footer without border line matching artboard designs */
}
.footer-logo {
  height: clamp(44px,9vh,72px);
  max-width: clamp(200px,60vw,340px);
  object-fit: contain;
}

/* ═══════════════════════════════════════════════════════════
   TELA 01 — IDLE  (centrado)
   ═══════════════════════════════════════════════════════════ */
#screen-idle .screen-body {
  /* Centered home screen layout */
  align-items: center; justify-content: flex-start;
  padding: clamp(20px, 5vh, 80px) clamp(28px, 7vw, 64px) clamp(14px, 3vh, 40px);
  gap: 0;
  text-align: center;
}

/* Título grande restaurado (limpo, moderno e centrado) */
.idle-title {
  font-family: var(--font-title);
  font-size: clamp(52px, 13vw, 120px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: clamp(20px, 4vh, 44px);
  text-align: center;
  text-shadow:
    3px  3px 0 var(--navy),
    -2px -2px 0 var(--navy),
     2px -2px 0 var(--navy),
    -2px  2px 0 var(--navy);
}
.idle-title .t-white  { color: var(--white); }
.idle-title .t-lime   { color: var(--lime); }

/* Subtítulo restaurado (limpo, moderno e centrado) */
.idle-subtitle {
  font-size: clamp(16px, 4vw, 28px);
  font-weight: 400;
  line-height: 1.6;
  color: var(--white);
  /* margin-bottom: auto distributes vertical spacing beautifully for vertical kiosk layout */
  margin-bottom: auto;
  max-width: 520px;
  text-align: center;
}
.idle-subtitle strong { font-weight: 800; }

/* ─── BOTÕES PRINCIPAIS (ESTILO 3D RETRO PREMIUM) ────────── */
.btn-iniciar,
.btn-confirmar,
.btn-finalizar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--lime-btn);
  color: var(--navy);
  border: 4px solid var(--navy);
  border-radius: 50px;
  font-family: var(--font-title);
  font-size: clamp(20px, 4.5vw, 36px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--navy), 0 10px 28px rgba(0,0,0,0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
  width: 100%;
  box-sizing: border-box;
}

.btn-iniciar:hover,
.btn-confirmar:hover,
.btn-finalizar:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 var(--navy), 0 12px 32px rgba(0,0,0,0.22);
}

.btn-iniciar:active,
.btn-confirmar:active,
.btn-finalizar:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--navy), 0 4px 12px rgba(0,0,0,0.15);
}

.btn-iniciar {
  max-width: clamp(240px, 80vw, 480px);
  padding: clamp(14px, 3vh, 22px) 0;
  margin-bottom: clamp(12px, 3vh, 32px);
  animation: pulse-glow-btn 2.2s infinite;
}
.btn-iniciar:active {
  animation: none;
}

/* ─── SPARKLE ──────────────────────────────────────────────── */
.sparkle {
  font-size: 0.85em;
  display: inline-flex;
  animation: sparkle-spin 3s linear infinite;
  color: var(--navy);
}

@keyframes sparkle-spin {
  0%   { transform: scale(1) rotate(0deg); }
  50%  { transform: scale(1.25) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   TELA 02 — REGISTER  (left-aligned, top-start)
   ═══════════════════════════════════════════════════════════ */
/* Screen-level scrolling removed so footer is pinned at the bottom */
#screen-register .screen-body {
  align-items: center; justify-content: flex-start;
  padding: clamp(12px, 2.5vh, 64px) clamp(28px, 7vw, 64px) clamp(8px, 1.5vh, 24px);
  gap: 0;
  text-align: center;
}

/* Título cadastro */
.reg-title {
  font-family: var(--font-title);
  font-size: clamp(32px, 8vw, 84px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-top: clamp(10px, 2.5vh, 50px);
  margin-bottom: clamp(12px, 3vh, 60px);
  text-align: center;
  width: 100%;
  text-shadow:
    3px  3px 0 var(--navy),
    -2px -2px 0 var(--navy),
     2px -2px 0 var(--navy),
    -2px  2px 0 var(--navy);
}
.reg-title .t-white { color: var(--white); }
.reg-title .t-lime  { color: var(--lime); }

/* Campo de conta */
.conta-field-wrap {
  width: 100%;
  max-width: clamp(220px, 80vw, 480px);
  margin-top: 0;
  margin-bottom: clamp(12px, 2vh, 20px);
}
.conta-field {
  width: 100%;
  background: #eef7f6;
  border: 3.5px solid var(--navy);
  border-radius: 50px;
  padding: clamp(10px,1.8vh,16px) clamp(22px,5vw,32px);
  font-family: var(--font);
  font-size: clamp(20px,4.5vw,28px);
  font-weight: 800;
  color: var(--navy);
  outline: none;
  letter-spacing: 0.06em;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.conta-field::placeholder { color: #b0bcba; font-weight: 400; }
.conta-field.error-state  { animation: shake .4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%,75%  { transform: translateX(-7px); }
  50%      { transform: translateX(7px); }
}

/* Nome do cooperado */
.member-name {
  font-size: clamp(18px,4.5vw,32px);
  font-weight: 700;
  color: var(--white);
  text-decoration: underline;
  min-height: 1.2em;
  margin-bottom: clamp(12px, 2vh, 20px);
  opacity: 0; transform: translateY(5px);
  transition: opacity .25s, transform .25s;
}
.member-name.visible { opacity: 1; transform: translateY(0); }

/* Erro */
.error-msg {
  color: #ffe066;
  font-size: clamp(12px,3vw,17px);
  font-weight: 600;
  min-height: 1.2em;
  margin-bottom: 6px;
}

/* Botão confirmar */
.btn-confirmar {
  max-width: clamp(220px, 80vw, 480px);
  padding: clamp(10px, 1.8vh, 16px) 0;
  margin-top: clamp(12px, 2vh, 20px);
  margin-bottom: clamp(8px, 1.5vh, 12px);
}

/* NUMPAD */
.numpad-wrap {
  width: 100%;
  max-width: clamp(220px, 80vw, 480px);
  margin-top: 0;
}
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1.5vw, 10px);
}

.np-key {
  background: #eef7f6;
  border: 3.5px solid var(--navy);
  border-radius: clamp(12px,2.2vw,18px);
  color: var(--navy);
  font-family: var(--font-title);
  font-size: clamp(22px,5.5vw,34px);
  font-weight: 900;
  padding: clamp(10px,1.8vh,16px) 0;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 var(--navy);
}
.np-key:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--navy);
}
.np-key:hover {
  background: #ffffff;
}
.np-key.del {
  background: transparent;
  border-color: #d32f2f;
  color: #d32f2f;
  box-shadow: 0 5px 0 var(--navy);
}
.np-key.del:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--navy);
}
.np-key.ok {
  background: var(--lime-btn);
  border-color: var(--navy);
  color: var(--navy);
  box-shadow: 0 5px 0 var(--navy);
}
.np-key.ok:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--navy);
}

.back-link {
  color: var(--w70);
  font-size: clamp(13px,3vw,18px);
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  transition: color .2s;
  margin-top: clamp(6px,1vh,12px);
}
.back-link:hover { color: var(--white); }

/* ═══════════════════════════════════════════════════════════
   TELA 03 — GAME  (centrado)
   ═══════════════════════════════════════════════════════════ */
#screen-game { overflow: hidden; }

.game-header {
  flex-shrink: 0;
  text-align: center;
  padding: clamp(10px,2.5vh,22px) clamp(16px,4vw,32px) clamp(4px,1vh,10px);
}

/* Título do jogo — GRANDE como no mockup */
.game-main-title {
  font-family: var(--font-title);
  font-size: clamp(38px,10vw,90px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  text-shadow:
    3px  3px 0 var(--navy),
    -2px -2px 0 var(--navy),
     2px -2px 0 var(--navy),
    -2px  2px 0 var(--navy);
}
.game-main-title .t-white { color: var(--white); }
.game-main-title .t-lime  { color: var(--lime); }

/* Timer — "Tempo restante – 00:20" */
.timer-row {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(4px,1vw,10px);
  margin-top: clamp(4px,1vh,10px);
  flex-wrap: nowrap;
}
.timer-label {
  font-size: clamp(13px,3vw,22px);
  font-weight: 400;
  color: var(--white);
  white-space: nowrap;
}
.timer-value {
  font-size: clamp(13px,3vw,22px);
  font-weight: 900;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color .3s;
}
.timer-value.warning { color: #f0a500; }
.timer-value.danger  { color: #ff3333; animation: pdanger .8s ease infinite; }
@keyframes pdanger { 0%,100% { opacity:1; } 50% { opacity:.5; } }

/* Progress bar */
.game-progress-wrap {
  flex-shrink: 0;
  height: 5px;
  background: var(--w15);
  margin: clamp(4px,1vh,8px) clamp(14px,4vw,28px);
  border-radius: 3px; overflow: hidden;
}
.game-progress-fill {
  height: 100%; background: var(--lime);
  border-radius: 3px; transition: width .4s ease;
}

/* Card area */
.game-area {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0 clamp(10px,2.5vw,20px) clamp(4px,1vh,10px);
  min-height: 0; overflow: hidden;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(5px, 1.5vmin, 11px);
  width: 100%;
  /* 3 cols × 4 rows — limitado por largura E por altura disponível (proporção 3:4) */
  max-width: min(90vw, calc((100vh - 260px) * 0.72));
}
@supports (height: 1svh) {
  .card-grid {
    max-width: min(90vw, calc((100svh - 260px) * 0.72));
  }
}

/* ─── CARTAS ─────────────────────────────────────────────── */
.memory-card {
  aspect-ratio: 1;
  perspective: 900px;
  cursor: pointer;
  border-radius: clamp(12px,2.5vw,22px);
  touch-action: manipulation;
}
.card-inner {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .42s cubic-bezier(.4,0,.2,1);
  border-radius: inherit;
}
.memory-card.flipped .card-inner { transform: rotateY(180deg); }

.card-face {
  position: absolute; inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
}

/* VERSO (frente para o jogador inicialmente) */
.card-back {
  background: var(--white);
}
.card-back img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* FRENTE (produto) */
.card-front {
  transform: rotateY(180deg);
  background: var(--white);
  padding: clamp(5px,1.2vw,10px);
  gap: clamp(2px,.5vh,6px);
}
.card-front img {
  width: 65%; height: 65%;
  object-fit: contain; flex-shrink: 0;
}
.card-label {
  font-size: clamp(9px,1.8vw,14px);
  font-weight: 800;
  color: var(--navy);
  text-align: center; line-height: 1.15;
  width: 100%;
}

/* Estados das cartas */
.memory-card.matched .card-inner { box-shadow: 0 0 0 3px var(--lime) inset; }
.memory-card.wrong   .card-inner { animation: wrong-shake .4s ease; }
@keyframes wrong-shake {
  0%,100% { transform: rotateY(180deg) translateX(0); }
  25%,75%  { transform: rotateY(180deg) translateX(-5px); }
  50%      { transform: rotateY(180deg) translateX(5px); }
}
@keyframes card-match-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.09); }
  100% { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════
   TELA 04-09 — BRINDE / WIN / LOSE  (centrado)
   ═══════════════════════════════════════════════════════════ */
/* Screen-level scrolling removed so footer is pinned at the bottom */
#screen-win .screen-body {
  align-items: center; justify-content: flex-start;
  padding: clamp(24px,5vh,52px) clamp(20px,5vw,48px) clamp(16px,3vh,32px);
  gap: 0;
  text-align: center;
}

/* "Jogo da memória" — grande, centrado */
.win-main-title {
  font-family: var(--font-title);
  font-size: clamp(40px,10vw,90px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: clamp(20px,4vh,44px);
  text-shadow:
    3px  3px 0 var(--navy),
    -2px -2px 0 var(--navy),
     2px -2px 0 var(--navy),
    -2px  2px 0 var(--navy);
}
.win-main-title .t-white { color: var(--white); }
.win-main-title .t-lime  { color: var(--lime); }

/* Headline de pares/derrota — amarela */
.win-headline {
  font-size: clamp(18px,4.5vw,34px);
  font-weight: 800;
  color: var(--lime);
  line-height: 1.4;
  margin-bottom: clamp(2px,0.5vh,6px);
}
/* "e acaba de ganhar" — branca, peso normal */
.win-subline {
  font-size: clamp(16px,4vw,28px);
  font-weight: 400;
  color: var(--white);
  margin-bottom: clamp(2px,0.5vh,6px);
}
/* "1 chapéu" — amarela, grande */
.win-prize-name {
  font-size: clamp(22px,5.5vw,44px);
  font-weight: 800;
  color: var(--lime);
  line-height: 1.1;
  margin-bottom: clamp(14px,3vh,32px);
}

/* Imagem do brinde */
.prize-img-wrap {
  width: clamp(160px,48vw,320px);
  height: clamp(160px,48vw,320px);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  /* Center the prize image vertically inside remaining space on tall screens */
  margin-top: auto;
  margin-bottom: auto;
}
.prize-img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.22));
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* "Parabéns!" */
.parabens {
  font-size: clamp(36px,9vw,80px);
  font-weight: 900;
  color: var(--lime);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: clamp(14px,2.5vh,28px);
}

/* Código de resgate — discreto abaixo */
.prize-code-box {
  background: var(--w15);
  border-radius: 14px;
  padding: clamp(8px,1.5vh,14px) clamp(18px,4vw,32px);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 100%; max-width: clamp(240px,75vw,400px);
  margin-bottom: clamp(12px,2vh,24px);
}
.prize-code-label { font-size: clamp(10px,2vw,14px); font-weight: 600; color: var(--w70); }
.prize-code       { font-size: clamp(20px,5vw,32px); font-weight: 900; letter-spacing: .15em; }

/* Botão finalizar */
.btn-finalizar {
  max-width: clamp(220px, 80vw, 480px);
  padding: clamp(12px, 2.5vh, 20px) 0;
  margin-top: clamp(12px, 2vh, 24px);
}

/* ═══════════════════════════════════════════════════════════
   TELA TEMPO ESGOTADO
   ═══════════════════════════════════════════════════════════ */
#screen-timeup .screen-body {
  align-items: center; justify-content: flex-start;
  padding: clamp(24px,5vh,52px) clamp(20px,5vw,48px) clamp(16px,3vh,32px);
  gap: 0;
  text-align: center;
}
.timeup-headline {
  font-size: clamp(26px, 6.5vw, 56px);
  font-weight: 900;
  color: var(--lime);
  margin-bottom: clamp(10px, 2vh, 20px);
  letter-spacing: -0.01em;
}
.timeup-subline {
  font-size: clamp(14px, 2.5vw, 19px);
  font-weight: 500;
  color: var(--white);
  line-height: 1.35;
  max-width: 440px;
  margin-bottom: clamp(10px, 2vh, 18px);
}
.timeup-visual-wrap {
  display: flex; align-items: center; justify-content: center;
  margin-top: auto;
  margin-bottom: auto;
  padding: 10px 0;
}
.timeup-badge {
  background: var(--navy);
  border: 4px solid var(--lime);
  border-radius: 50%;
  width: clamp(140px, 32vw, 220px);
  height: clamp(140px, 32vw, 220px);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 25px rgba(197, 212, 0, 0.4), inset 0 0 15px rgba(0, 0, 0, 0.5);
  animation: pulse-badge 2s ease-in-out infinite;
}
.timeup-badge-emoji {
  font-size: clamp(60px, 15vw, 100px);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}
.timeup-comfort-msg {
  font-size: clamp(14px, 3.5vw, 20px);
  font-weight: 600;
  color: var(--w70);
  line-height: 1.4;
  max-width: 440px;
  margin-top: clamp(6px, 1vh, 12px);
  margin-bottom: clamp(12px, 2vh, 24px);
  text-align: center;
}
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(197, 212, 0, 0.4), inset 0 0 15px rgba(0, 0, 0, 0.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 45px rgba(197, 212, 0, 0.75), inset 0 0 20px rgba(0, 0, 0, 0.6); }
}

/* ═══════════════════════════════════════════════════════════
   TELA ADMIN
   ═══════════════════════════════════════════════════════════ */
.screen-admin {
  background: #f0f4f8; color: #1a2332;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.admin-panel {
  max-width: 1100px; margin: 0 auto;
  padding: clamp(16px,4vw,32px) clamp(12px,4vw,24px) 60px;
}
.admin-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap;
  gap: 14px; margin-bottom: 20px;
}
.admin-title   { font-size: clamp(20px,5vw,28px); font-weight: 900; color: var(--navy); }
.admin-subtitle { font-size: 14px; color: #666; margin-top: 4px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-btn {
  border: none; border-radius: 10px;
  padding: 10px 16px; font-family: var(--font);
  font-size: clamp(12px,2.5vw,14px); font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: opacity .2s;
}
.admin-btn:hover   { opacity: .85; }
.admin-btn.export  { background: var(--teal); color: var(--white); }
.admin-btn.clear   { background: #e53e3e;      color: var(--white); }
.admin-btn.back    { background: var(--navy);  color: var(--white); }
.admin-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: 14px; box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--white); font-size: clamp(12px,1.8vw,14px);
}
.admin-table th {
  background: var(--navy); color: var(--white);
  text-align: left;
  padding: clamp(10px,2vw,14px) clamp(10px,2vw,16px);
  font-weight: 800; font-size: clamp(10px,1.5vw,13px);
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.admin-table td {
  padding: clamp(8px,1.5vw,12px) clamp(10px,2vw,16px);
  border-bottom: 1px solid #eef0f4; color: #2d3748; vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td     { background: #f7fafc; }
.admin-table code {
  background: #eef0f4; border-radius: 6px;
  padding: 2px 8px; font-weight: 700; color: var(--navy);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — TOTEM PORTRAIT
   ═══════════════════════════════════════════════════════════ */

/* Mobile estreito < 375px */
@media (max-width: 374px) {
  .idle-title, .reg-title  { font-size: 38px; }
  .game-main-title, .win-main-title { font-size: 32px; }
  .btn-iniciar, .btn-confirmar, .btn-finalizar { font-size: 18px; width: 88vw; }
  .conta-field-wrap, .numpad-wrap { width: 88vw; }
  .prize-img-wrap { width: 130px; height: 130px; }
  .parabens { font-size: 32px; }
  .footer-logo { height: 38px; }
}

/* ── Compressão leve: altura < 740px ─────────────────────────── */
@media (max-height: 740px) {
  .screen-footer          { padding: clamp(8px, 1.6vh, 18px) clamp(20px, 5vw, 48px); }
  .footer-logo            { height: clamp(36px, 6.5vh, 56px); }
  .idle-cards-preview     { height: clamp(100px, 17vh, 170px);
                            margin-top: clamp(8px, 1.5vh, 18px);
                            margin-bottom: clamp(8px, 1.5vh, 18px); }
  .idle-title             { margin-bottom: clamp(10px, 1.8vh, 24px); }
  /* Cadastro — reduz margens do título para telas 660-740px */
  #screen-register .screen-body { padding-top: clamp(10px, 2vh, 40px); }
  .reg-title              { margin-top: clamp(8px, 1.8vh, 30px); margin-bottom: clamp(10px, 2vh, 36px); }
  .conta-field-wrap       { margin-bottom: clamp(8px, 1.5vh, 16px); }
  .member-name            { margin-bottom: clamp(8px, 1.5vh, 16px); }
  .btn-confirmar          { margin-top: clamp(8px, 1.5vh, 16px); margin-bottom: clamp(4px, 1vh, 10px); }
}

/* ── Compressão média: altura < 660px ───────────────────────── */
@media (max-height: 660px) {
  #screen-idle .screen-body,
  #screen-register .screen-body     { padding-top: clamp(12px, 2.5vh, 28px);
                                      padding-bottom: clamp(6px, 1.2vh, 14px); }

  /* Títulos */
  .idle-title, .reg-title           { font-size: clamp(26px, 8vw, 50px); margin-bottom: 8px; }
  .idle-subtitle                    { font-size: clamp(12px, 3vw, 17px); margin-bottom: 8px; }
  .idle-cards-preview               { height: clamp(80px, 14vh, 128px); margin-top: 6px; margin-bottom: 6px; }

  /* Tela do jogo */
  .game-header                      { padding: clamp(6px, 1.4vh, 14px) clamp(12px, 3vw, 24px) clamp(2px, 0.5vh, 6px); }
  .game-main-title                  { font-size: clamp(22px, 6.5vw, 44px); }
  .game-area                        { padding: 0 clamp(8px, 2vw, 16px) 2px; }

  /* Telas de brinde */
  .win-main-title                   { font-size: clamp(22px, 6.5vw, 44px); margin-bottom: 6px; }
  .prize-img-wrap                   { width: clamp(80px, 20vh, 148px); height: clamp(80px, 20vh, 148px); }
  .parabens                         { font-size: clamp(22px, 5.5vw, 40px); margin-bottom: 8px; }
  .win-headline                     { font-size: clamp(13px, 3vw, 20px); }
  .win-prize-name                   { font-size: clamp(15px, 3.8vw, 26px); margin-bottom: 6px; }
  #screen-win .screen-body,
  #screen-timeup .screen-body       { padding-top: 10px; padding-bottom: 8px; }
  .timeup-headline                  { font-size: clamp(20px, 5vw, 40px); margin-bottom: 8px; }

  /* Rodapé */
  .screen-footer                    { padding: 5px 16px; }
  .footer-logo                      { height: clamp(24px, 4vh, 38px); }

  /* Tela de cadastro */
  .reg-title                        { margin-top: 6px; margin-bottom: 10px; }
  .np-key                           { padding: clamp(7px, 1.2vh, 11px) 0;
                                      font-size: clamp(18px, 4.5vw, 28px); }
  .numpad-wrap                      { margin-top: 0; }
  .btn-confirmar                    { margin-top: 6px; padding: clamp(7px, 1.2vh, 11px) 0; }
  .btn-iniciar                      { padding: 10px 0; margin-bottom: 6px; }
}

/* ── Compressão máxima: altura < 568px ─────────────────────── */
@media (max-height: 568px) {
  .game-main-title                  { display: none; }
  .game-header                      { padding: 5px 12px 2px; }
  .idle-title                       { font-size: clamp(22px, 7vw, 36px); margin-bottom: 4px; }
  .idle-subtitle                    { font-size: clamp(11px, 2.8vw, 15px); margin-bottom: 4px; }
  .idle-cards-preview               { height: clamp(58px, 12vh, 90px); margin: 2px 0; }
  .win-main-title                   { font-size: clamp(18px, 5.5vw, 32px); margin-bottom: 4px; }
  .parabens                         { font-size: clamp(18px, 4.5vw, 30px); margin-bottom: 4px; }
  .prize-img-wrap                   { width: clamp(60px, 16vh, 100px); height: clamp(60px, 16vh, 100px); }
  .footer-logo                      { height: clamp(20px, 3.5vh, 30px); }
  .screen-footer                    { padding: 3px 12px; }
  .np-key                           { padding: 5px 0; font-size: clamp(16px, 4vw, 22px); }
}

/* Totem Full HD — 900px+ portrait */
@media (min-width: 900px) and (orientation: portrait) {
  #screen-idle .screen-body, #screen-register .screen-body {
    /* Padding adaptativo: abre em telas altas, comprime em tablets ~900×1200 */
    padding: clamp(28px, 6vh, 110px) clamp(60px, 10vw, 120px) clamp(20px, 3vh, 40px);
  }
  .idle-title    { font-size: clamp(80px,11vw,130px); margin-bottom: clamp(20px, 4vh, 56px); }
  .idle-subtitle { font-size: clamp(22px,3vw,32px); }
  .btn-iniciar   { font-size: clamp(30px,4vw,50px); width: 100%; max-width: clamp(480px, 82vw, 840px); padding: clamp(18px,3.5vh,36px) 0; }

  .reg-title     { font-size: clamp(70px,10vw,120px); margin-bottom: clamp(16px, 3vh, 48px); margin-top: clamp(12px, 2.5vh, 40px); }
  .conta-field-wrap, .numpad-wrap { width: 100%; max-width: clamp(480px, 82vw, 840px); }
  .conta-field   { font-size: clamp(22px,3vw,32px); padding: 20px 36px; }
  .member-name   { font-size: clamp(24px,3.2vw,38px); }
  .btn-confirmar { font-size: clamp(28px,3.8vw,46px); width: 100%; max-width: clamp(480px, 82vw, 840px); padding: clamp(10px,1.8vh,22px) 0; }
  .np-key        { font-size: clamp(26px,3.5vw,40px); padding: clamp(10px,1.6vh,18px) 0; }

  .game-main-title  { font-size: clamp(60px,8vw,100px); }
  .timer-label, .timer-value { font-size: clamp(22px,2.8vw,34px); }
  .card-grid        { max-width: min(86vw, calc((100vh - 340px) * 0.72)); gap: 16px; }
  .card-label       { font-size: clamp(14px,1.6vw,20px); }

  .win-main-title  { font-size: clamp(60px,8vw,100px); margin-bottom: clamp(16px,3.5vh,48px); }
  .win-headline    { font-size: clamp(26px,3.5vw,44px); }
  .win-subline     { font-size: clamp(22px,3vw,36px); }
  .win-prize-name  { font-size: clamp(32px,4.5vw,58px); margin-bottom: clamp(14px,3vh,44px); }
  .prize-img-wrap  { width: clamp(200px,30vw,380px); height: clamp(200px,30vw,380px); margin-top: auto; margin-bottom: auto; }
  .parabens        { font-size: clamp(60px,8vw,100px); margin-bottom: clamp(14px,3vh,40px); }
  .btn-finalizar   { font-size: clamp(26px,3.5vw,42px); width: 100%; max-width: clamp(480px, 82vw, 840px); }
  .footer-logo     { height: clamp(48px,7vh,88px); }
}
@supports (height: 1svh) {
  @media (min-width: 900px) and (orientation: portrait) {
    .card-grid { max-width: min(86vw, calc((100svh - 340px) * 0.72)); }
  }
}

/* Totem 4K — 1800px+ portrait */
@media (min-width: 1800px) and (orientation: portrait) {
  .idle-title     { font-size: 180px; }
  .idle-subtitle  { font-size: 40px; }
  .btn-iniciar    { font-size: 60px; width: 100%; max-width: 1400px; padding: 44px 0; }
  .reg-title      { font-size: 160px; }
  .btn-confirmar  { font-size: 56px; width: 100%; max-width: 1400px; }
  .conta-field    { font-size: 44px; }
  .np-key         { font-size: 54px; padding: 32px 0; }
  .game-main-title, .win-main-title { font-size: 140px; }
  .parabens       { font-size: 140px; }
  .prize-img-wrap { width: 520px; height: 520px; }
  .footer-logo    { height: 110px; }
}

/* ─── FLOATING CARDS PREVIEW (TELA IDLE) ─────────────────── */
.idle-cards-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(15px, 3vw, 30px);
  margin-top: clamp(10px, 2vh, 36px);
  margin-bottom: clamp(10px, 2vh, 36px);
  position: relative;
  height: clamp(110px, 20vh, 210px);
  width: 100%;
  overflow: visible; /* garante que ícones flutuantes não sejam cortados */
}
.idle-preview-card {
  width: min(clamp(90px, 20vw, 140px), 55vh);
  aspect-ratio: 1;
  background: var(--white);
  border-radius: clamp(12px, 2.5vw, 20px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.8vw, 14px);
  position: absolute;
}
.idle-preview-card img {
  width: 75%;
  height: 75%;
  object-fit: contain;
}
.idle-preview-card.card-left {
  transform: rotate(-14deg) translateX(-45px);
  z-index: 2;
  animation: float-left 4s ease-in-out infinite;
}
.idle-preview-card.card-right {
  transform: rotate(14deg) translateX(45px);
  z-index: 3;
  animation: float-right 4s ease-in-out infinite;
}

@keyframes float-left {
  0%, 100% { transform: rotate(-14deg) translateX(-45px) translateY(0); }
  50% { transform: rotate(-11deg) translateX(-45px) translateY(-12px); }
}
@keyframes float-right {
  0%, 100% { transform: rotate(14deg) translateX(45px) translateY(0); }
  50% { transform: rotate(17deg) translateX(45px) translateY(-14px); }
}

/* ─── FLOATING DECORATIVE ICONS (PÁGINA INICIAL) ────────── */
.idle-floating-icon {
  position: absolute;
  font-size: clamp(24px, 5vw, 44px);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18));
  user-select: none;
  pointer-events: none;
}
.icon-pig {
  top: 10%;
  left: 10%;
  animation: float-icon-slow 5s ease-in-out infinite alternate;
}
.icon-coin {
  top: 15%;
  right: 12%;
  animation: float-icon-fast 3.5s ease-in-out infinite alternate;
}
.icon-heart {
  bottom: 8%;
  left: 14%;
  animation: float-icon-fast 4s ease-in-out infinite alternate;
}
.icon-sprout {
  bottom: 12%;
  right: 10%;
  animation: float-icon-slow 4.5s ease-in-out infinite alternate;
}

@keyframes float-icon-slow {
  0% { transform: translateY(0) rotate(-5deg); }
  100% { transform: translateY(-16px) rotate(8deg); }
}
@keyframes float-icon-fast {
  0% { transform: translateY(0) rotate(5deg); }
  100% { transform: translateY(-12px) rotate(-8deg); }
}

/* ─── RADIAL GLOW & BUTTON PULSE (TELA IDLE) ──────────────── */
.idle-cards-glow {
  position: absolute;
  width: clamp(260px, 50vw, 420px);
  height: clamp(260px, 50vw, 420px);
  background: radial-gradient(circle, rgba(197, 212, 0, 0.28) 0%, rgba(0, 174, 157, 0) 70%);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  animation: pulse-glow-bg 3s ease-in-out infinite alternate;
}

@keyframes pulse-glow-bg {
  0% { transform: scale(0.9); opacity: 0.65; }
  100% { transform: scale(1.1); opacity: 1.0; }
}

@keyframes pulse-glow-btn {
  0% {
    box-shadow: 0 6px 0 var(--navy), 0 10px 28px rgba(0,0,0,0.18), 0 0 0 0 rgba(170, 210, 25, 0.55);
  }
  70% {
    box-shadow: 0 6px 0 var(--navy), 0 10px 28px rgba(0,0,0,0.18), 0 0 0 20px rgba(170, 210, 25, 0);
  }
  100% {
    box-shadow: 0 6px 0 var(--navy), 0 10px 28px rgba(0,0,0,0.18), 0 0 0 0 rgba(170, 210, 25, 0);
  }
}

/* ═══════════════════════════════════════════════════════════
   LANDSCAPE PC / TABLET — layout adaptado para tela wide
   ═══════════════════════════════════════════════════════════ */
@media (orientation: landscape) and (min-height: 500px) {

  /* ── Cabeçalho do jogo: fonte menor, padding mínimo ── */
  .game-main-title {
    font-size: clamp(22px, 3.5vw, 48px);
    line-height: 1.1;
  }
  .game-header { padding: 6px clamp(16px, 4vw, 32px) 3px; }
  .timer-label,
  .timer-value  { font-size: clamp(13px, 2vw, 20px); }

  /* ── Rodapé: mais compacto ── */
  .screen-footer { padding: 5px clamp(20px, 5vw, 48px); }
  .footer-logo   { height: clamp(26px, 4.5vh, 50px); }

  /* ── Grade de cartas: limitada por 42 vh (3 cols × 4 rows) ── */
  .card-grid { max-width: min(48vw, 42vh); }

  /* ── Tela idle em landscape ── */
  .idle-cards-preview { height: clamp(80px, 28vh, 170px); }
  .idle-preview-card  { width: min(clamp(70px, 14vw, 120px), 26vh); }

  /* ──────────────────────────────────────────────────────────
     Telas de BRINDE (win) e CONSOLAÇÃO (timeup)
     Em landscape 1366×768 o conteúdo empilhado chega a ~950px —
     reduzir título + imagem + parabéns resolve o overflow.
     ────────────────────────────────────────────────────────── */
  #screen-win .screen-body,
  #screen-timeup .screen-body {
    padding: clamp(6px, 1.2vh, 16px) clamp(20px, 5vw, 48px) clamp(4px, 0.8vh, 10px);
    justify-content: center; /* centraliza verticalmente em vez de flex-start */
    gap: clamp(2px, 0.6vh, 8px);
  }

  /* Título "Jogo da memória" nas telas de brinde */
  .win-main-title {
    font-size: clamp(24px, 3.8vw, 50px);
    margin-bottom: clamp(4px, 0.8vh, 12px);
  }

  /* "Você encontrou X pares" */
  .win-headline {
    font-size: clamp(13px, 1.8vw, 22px);
    margin-bottom: 2px;
  }

  /* "e acaba de ganhar" */
  .win-subline {
    font-size: clamp(12px, 1.6vw, 18px);
    margin-bottom: 2px;
  }

  /* "1 chapéu" */
  .win-prize-name {
    font-size: clamp(15px, 2.2vw, 28px);
    margin-bottom: clamp(4px, 0.8vh, 12px);
  }

  /* Imagem do brinde — sem margin:auto (evita que suce espaço extra) */
  .prize-img-wrap {
    width: clamp(70px, 20vh, 180px);
    height: clamp(70px, 20vh, 180px);
    margin-top: 0;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  /* "Parabéns!" */
  .parabens {
    font-size: clamp(24px, 3.8vw, 52px);
    margin-bottom: clamp(4px, 0.8vh, 12px);
  }

  /* Botão Finalizar */
  .btn-finalizar {
    padding: clamp(7px, 1.1vh, 14px) 0;
    margin-top: clamp(4px, 0.8vh, 10px);
    font-size: clamp(16px, 2.5vw, 28px);
  }

  /* Tela de consolação (timeup) */
  .timeup-headline {
    font-size: clamp(20px, 3vw, 40px);
    margin-bottom: clamp(4px, 0.8vh, 10px);
  }
  .timeup-subline {
    font-size: clamp(12px, 1.6vw, 17px);
    margin-bottom: clamp(4px, 0.8vh, 10px);
  }

  /* ── Tela de cadastro em landscape ── */
  #screen-register .screen-body {
    padding: clamp(6px, 1.2vh, 20px) clamp(28px, 7vw, 64px) clamp(4px, 0.8vh, 12px);
  }
  .reg-title   { font-size: clamp(28px, 5vw, 64px); margin-top: 4px; margin-bottom: clamp(6px, 1.2vh, 20px); }
  .np-key      { padding: clamp(6px, 1vh, 10px) 0; }
  .btn-confirmar { padding: clamp(6px, 1vh, 12px) 0; margin-top: clamp(16px, 3vh, 32px); }
  .back-link   { margin-top: 2px; padding: 2px 0; }
}
@supports (height: 1svh) {
  @media (orientation: landscape) and (min-height: 500px) {
    .card-grid { max-width: min(48vw, 42svh); }
    .prize-img-wrap { width: clamp(70px, 20svh, 180px); height: clamp(70px, 20svh, 180px); }
  }
}

/* ═══════════════════════════════════════════════════════════
   LANDSCAPE — aviso de rotação em dispositivos pequenos
   ═══════════════════════════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 500px) {
  body::after {
    content: '📱  Gire o dispositivo para o modo retrato';
    position: fixed;
    inset: 0;
    background: var(--teal);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: var(--font);
    font-size: clamp(16px, 3vh, 22px);
    font-weight: 700;
    color: var(--white);
    padding: 24px;
    pointer-events: all;
  }
  /* Esconde tudo por trás do aviso */
  .screen.active,
  #sound-toggle { visibility: hidden; }
}
