:root {
  --bg-1: #1a1a2e;
  --bg-2: #16213e;
  --accent: #e94560;
  --accent-2: #f9a826;
  --ok: #22c55e;
  --err: #ef4444;
  --txt: #f1f5f9;
  --txt-muted: #94a3b8;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--txt);
  background: radial-gradient(circle at top, var(--bg-2), var(--bg-1) 60%);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden; 
}

body {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.escondida { display: none !important; }

/* ================= CONFIGURAÇÃO DO PC (INTOCADA) ================= */
.tela.jogo {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 720px;
  width: 100%;
  padding: 10px;
  margin: 0 auto;
}

.tela.menu {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  width: 100%;
  padding: 20px;
}
.card-menu { 
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 28px 22px; text-align: center; box-shadow: var(--shadow); backdrop-filter: blur(8px); 
  width: 100%; max-width: 400px;
}
.logo { max-width: 150px; height: auto; margin-bottom: 12px; }
.card-menu h1 { font-size: 1.9rem; margin-bottom: 6px; letter-spacing: 1px; }
.subtitulo { color: var(--txt-muted); margin-bottom: 22px; }
.botoes-modo { display: grid; gap: 14px; margin-bottom: 22px; }
.btn-modo { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 14px; border-radius: var(--radius); border: 2px solid transparent; cursor: pointer; font-size: 1rem; color: #fff; transition: transform 0.15s, box-shadow 0.15s; }
.btn-modo:hover { transform: translateY(-2px); box-shadow: var(--shadow); outline: none; }
.btn-facil { background: linear-gradient(135deg, #22c55e, #16a34a); }
.btn-dificil { background: linear-gradient(135deg, var(--accent), #b91c1c); }
.btn-modo .emoji { font-size: 1.8rem; }
.btn-modo .titulo { font-weight: 700; font-size: 1.15rem; }
.btn-modo .desc { font-size: 0.85rem; opacity: 0.9; }
.btn-link { background: none; border: none; color: var(--txt-muted); cursor: pointer; font-size: 0.9rem; text-decoration: underline; }

.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; margin-bottom: 6px; }
.status { display: flex; gap: 16px; font-size: 0.95rem; background: var(--card); border: 1px solid var(--card-border); padding: 8px 14px; border-radius: var(--radius); }
.status strong { color: var(--accent-2); }
.btn-icone { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--card-border); background: var(--card); color: var(--txt); font-size: 1.2rem; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;}

.timer-wrap { position: relative; height: 20px; background: rgba(0, 0, 0, 0.35); border-radius: 10px; overflow: hidden; border: 1px solid var(--card-border); flex-shrink: 0; margin-bottom: 6px; }
.timer-bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent-2), #fde047); transition: width 1s linear, background 0.3s; }
.timer-bar.alerta { background: linear-gradient(90deg, var(--err), #f97316); animation: pulse 1s infinite; }
.timer-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: #000; }

.dica { background: rgba(249, 168, 38, 0.12); border-left: 4px solid var(--accent-2); padding: 8px 12px; border-radius: 8px; font-size: 0.9rem; line-height: 1.3; flex-shrink: 0; margin-bottom: 6px; word-break: break-word; }

.area-boneco {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  margin-bottom: 6px;
}

#img-boneco {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease; 
}

.alma { 
  position: absolute; 
  bottom: 0; 
  left: 50%; 
  transform: translateX(-50%); 
  height: 60%; 
  z-index: 10; 
  pointer-events: none; 
  opacity: 0; 
  animation: sobeAlma 3.5s ease-in forwards; 
}
.alma img { height: 100%; width: auto; filter: drop-shadow(0 0 15px rgba(180, 220, 255, 0.6)); }
@keyframes sobeAlma { 0% { bottom: 0%; opacity: 0; transform: translateX(-50%) scale(0.7); } 15% { bottom: 5%; opacity: 1; transform: translateX(-50%) scale(0.95); } 70% { bottom: 80%; opacity: 0.8; transform: translateX(-50%) scale(1.0); } 100% { bottom: 150%; opacity: 0; transform: translateX(-50%) scale(1.1); } }

.palavra { 
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 4px; 
  min-height: 40px; padding: 0 0 10px 0; 
  font-family: "Courier New", monospace; font-size: clamp(1.2rem, 5vw, 2rem); font-weight: 700; text-align: center; letter-spacing: 2px; line-height: 1.2; flex-shrink: 0; 
}
.letra { color: var(--txt-muted); display: inline-block; min-width: 0.9em; text-align: center; border-bottom: 3px solid var(--txt-muted); padding-bottom: 2px; }
.letra.revelada { color: var(--accent-2); border-bottom-color: var(--accent-2); animation: pop 0.3s ease; }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 80% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }
.mensagem { text-align: center; min-height: 1.2em; color: var(--accent-2); font-weight: 600; flex-shrink: 0; font-size: 0.85rem; margin-bottom: 5px; }

.teclado { 
  display: grid; grid-template-columns: repeat(auto-fit, minmax(30px, 1fr)); gap: 4px; flex-shrink: 0; 
}
.tecla { aspect-ratio: 1 / 1; border-radius: 6px; border: 1px solid var(--card-border); background: var(--card); color: var(--txt); font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: background 0.15s, transform 0.1s; user-select: none; display: flex; align-items: center; justify-content: center;}
.tecla:active:not(.certa):not(.errada) { transform: scale(0.94); }
.tecla.certa { background: var(--ok); color: #003b14; border-color: transparent; cursor: default; }
.tecla.errada { background: rgba(239, 68, 68, 0.25); color: var(--err); text-decoration: line-through; border-color: transparent; cursor: default; }
.tecla.shake { animation: shake 0.4s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; animation: fadeIn 0.3s ease; }
.overlay-card { background: var(--bg-2); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 28px 22px; max-width: 400px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.overlay.vitoria .overlay-card { border-color: var(--ok); }
.overlay.derrota .overlay-card { border-color: var(--err); }
.overlay-card h2 { font-size: 1.5rem; margin-bottom: 10px; }
.overlay-card p { color: var(--txt-muted); margin-bottom: 20px; line-height: 1.4; font-size: 0.95rem;}
.overlay-card p strong { color: var(--accent-2); font-size: 1.1rem; }
.overlay-botoes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-principal, .btn-secundario { padding: 10px 20px; border-radius: var(--radius); border: none; font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: transform 0.15s; }
.btn-principal { background: linear-gradient(135deg, var(--accent), #b91c1c); color: #fff; }
.btn-secundario { background: var(--card); color: var(--txt); border: 1px solid var(--card-border); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }


/* ==================================================== */
/* REGRAS EXCLUSIVAS PARA CELULAR (SÓ A IMAGEM MUDA)    */
/* ==================================================== */
@media (max-width: 768px) {
  /* O teclado no celular continua igual (9 colunas) */
  .teclado { 
    grid-template-columns: repeat(9, 1fr); 
    gap: 3px; 
  }
  .tecla { 
    font-size: 0.75rem; 
  }
  
  /* Textos do celular continuam iguais */
  .dica { font-size: 0.8rem; padding: 6px 8px; margin-bottom: 4px; }
  .status { font-size: 0.8rem; padding: 6px; gap: 8px; }
  .topo, .timer-wrap { margin-bottom: 4px; }
  .palavra { font-size: 1.3rem; min-height: 35px; padding-bottom: 5px; }

  /* AQUI ESTÁ A ÚNICA MUDANÇA: A IMAGEM ENCOLHE 30% */
  #img-boneco {
    max-height: 35vh !important; /* Força a imagem a ter no máximo 35% da tela */
    width: auto !important;      /* Mantém a proporção */
    margin: 0 auto;              /* Centraliza */
  }

  /* Mantém a dica e teclado na frente da imagem */
  .topo, .timer-wrap, .dica, .palavra, .teclado {
    position: relative;
    z-index: 10;
  }
}