/* --- RESET E BASES --- */
:root {
  --bg-color: #232136; --card-bg: #2a2744; --accent-pink: #ea9a97; --accent-orange: #f6c177;
  --text-color: #e0def4; --font-title: 'Fredoka', cursive; --font-body: 'Nunito', sans-serif;
}
body {
  font-family: var(--font-body); background: url('imagens/background.jpg') no-repeat center center fixed; 
  background-size: cover; background-color: var(--bg-color); color: var(--text-color); margin: 0; padding: 10px;
  text-align: center; overflow-x: hidden; min-height: 100vh; box-sizing: border-box; display: flex; align-items: center; flex-direction: column;
}
h1, h2, h3 { font-family: var(--font-title); letter-spacing: 1px; }
h1 { margin: 10px 0; color: var(--accent-orange); text-shadow: 2px 2px 0 #000; }
h3 { margin: 15px 0 5px; color: var(--accent-pink); border-bottom: 1px dashed rgba(255,255,255,0.2); padding-bottom: 5px; font-size: 1.1rem; }
.game-logo { max-width: 100%; height: auto; max-height: 70px; margin-bottom: 5px; filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.5)); }
.game-container { max-width: 600px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; }

/* --- VISUAL STAGE --- */
.visual-stage {
  display: flex;
  justify-content: space-between;
  align-items: flex-end; /* Alinha tudo por baixo */
  margin-bottom: 15px; /* Um pouco mais de espaço antes do HUD */
  gap: 20px;
  /* Altura ajustada para ficar compacta, perto da altura das cartas (80px) + textos */
  height: 100px; 
}

.enemy-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
}
.enemy-zone small { font-size: 0.7rem; color: #aaa; margin-left: 5px; margin-bottom: 2px;}
.enemy-hand-area { display: flex; align-items: center; gap: -20px; }

/* VERSO DA CARTA */
.card-back {
  width: 50px; height: 80px;
  background-color: #b71c1c;
  /* Certifique-se que sua imagem de verso chama 'card_back.png' */
  background-image: url('imagens/card_back.png');
  background-size: cover; background-position: center;
  border: 2px solid #fff; border-radius: 6px; box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
  margin-right: -20px; transition: transform 0.2s;
}
.card-back:hover { transform: translateY(-5px); z-index: 10; }

/* ZONA DA BATALHA (Sem bordas agora!) */
.battle-zone {
  flex: 1.5;
  /* Altura fixa para alinhar visualmente com as cartas de 80px */
  height: 90px; 
  position: relative;
  /* Removidos background e borders para ficar transparente */
  display: flex; align-items: flex-end; justify-content: center;
}

.battle-img {
  /* contain garante que a imagem inteira apareça sem cortes */
  width: auto; height: 100%; max-width: 100%; object-fit: contain;
  opacity: 1.0; /* Opacidade total para a arte brilhar */
  /* Sombra na silhueta da imagem transparente para dar profundidade */
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.4));
}

.battle-fx { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: bold; text-shadow: 0 0 10px black, 0 0 20px var(--accent-orange); pointer-events: none; white-space: nowrap; z-index: 20;}

/* --- HUD --- */
.top-hud { display: flex; flex-direction: column; gap: 5px; margin-bottom: 5px; z-index: 10; }
.character-card { background: rgba(30, 30, 46, 0.95); padding: 5px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 4px 6px rgba(0,0,0,0.3); display: flex; flex-direction: column; position: relative; }
.taunt-bubble { position: absolute; top: -15px; right: 10px; background: white; color: #333; padding: 3px 8px; border-radius: 10px; border-bottom-left-radius: 0; font-size: 0.75rem; font-weight: bold; box-shadow: 2px 2px 5px rgba(0,0,0,0.3); z-index: 20; max-width: 150px; }
.char-header { display: flex; align-items: center; gap: 10px; }
.char-info { flex-grow: 1; text-align: left; }
.char-status { display: flex; gap: 8px; margin-top: 2px; justify-content: flex-start; padding-left: 55px; align-items: center; min-height: 20px;}
.avatar { font-size: 1.8rem; width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; border: 2px solid var(--accent-pink); flex-shrink: 0; }
.hp-bar-container { width: 100%; height: 16px; background-color: #111; border-radius: 8px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,0.3); }
.hp-bar-fill { height: 100%; transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1); }
.player-fill { background: linear-gradient(90deg, #9ccfd8, #31748f); }
.enemy-fill { background: linear-gradient(90deg, #eb6f92, #c43e00); }
.hp-text { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: bold; text-shadow: 1px 1px 1px black; z-index: 2; }
.badge { background: rgba(0,0,0,0.4); padding: 1px 6px; border-radius: 6px; font-size: 0.75rem; font-weight: bold; border: 1px solid rgba(255,255,255,0.1); }
.intent-box { font-size: 0.8rem; font-weight: bold; background: rgba(0, 0, 0, 0.6); padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); }

/* --- CARTAS --- */
#hand { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 180px; padding: 5px 0; margin-bottom: 5px; }
.card { background: #e0def4; color: #232136; border: none; border-radius: 10px; width: 120px; height: 190px; cursor: pointer; transition: transform 0.2s; display: flex; flex-direction: column; position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.4); overflow: hidden; }
.card:hover { transform: translateY(-10px) rotate(1deg); z-index: 10; }
.card-img-placeholder { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #ccc; }
.card-content { padding: 6px; display: flex; flex-direction: column; flex-grow: 1; justify-content: space-between; }
.card strong { font-family: var(--font-title); font-size: 0.85rem; color: #907aa9; line-height: 1.1;}
.card small { font-size: 0.65rem; line-height: 1.1; color: #555; }
.card-cost { position: absolute; top: 2px; left: 2px; background: var(--accent-orange); color: #232136; width: 22px; height: 22px; border-radius: 50%; font-weight: bold; font-family: var(--font-title); display: flex; align-items: center; justify-content: center; box-shadow: 1px 1px 2px rgba(0,0,0,0.3); z-index: 2; }

/* LIXEIRA MAIS ESCURA */
.discard-btn { position: absolute; top: 2px; right: 2px; background: #c62828; color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; cursor: pointer; border: 1px solid rgba(255,255,255,0.5); z-index: 20; transition: transform 0.2s; box-shadow: 1px 1px 3px rgba(0,0,0,0.3); }
.discard-btn:hover { transform: scale(1.2) rotate(10deg); background: #b71c1c; }

/* CONTROLES */
.btn-turn { background: var(--accent-orange); color: #232136; border: none; padding: 10px 30px; font-family: var(--font-title); font-size: 1.1rem; border-radius: 50px; cursor: pointer; box-shadow: 0 4px 0 #dba665; transition: all 0.1s; width: 100%; max-width: 300px; align-self: center; margin-bottom: 5px; }
.btn-turn:active { transform: translateY(4px); box-shadow: none; }
.bottom-controls { display: flex; justify-content: center; gap: 15px; width: 100%; max-width: 300px; align-self: center; margin-top: 5px; }
.secondary-btn { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.3); padding: 8px 15px; border-radius: 20px; color: #e0def4; font-family: var(--font-title); font-size: 0.9rem; cursor: pointer; transition: all 0.2s; flex-grow: 1; }
.secondary-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--accent-orange); color: var(--accent-orange); }

/* UTILITÁRIOS & TUTORIAL ESTILIZADO */
.hidden { display: none !important; }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.tutorial-box, .modal-box { background: #2a2744; color: #e0def4; padding: 20px; border-radius: 20px; text-align: center; width: 90%; max-width: 450px; border: 4px solid var(--accent-orange); box-shadow: 0 10px 40px rgba(0,0,0,0.8); max-height: 85vh; overflow-y: auto; }
.play-btn, .modal-box button { background: var(--accent-orange); color: #232136; border: none; padding: 10px 20px; border-radius: 20px; font-weight: bold; cursor: pointer; margin-top: 15px; width: 100%; font-size: 1.1rem; animation: pulse 1.5s infinite; }

/* Estilos do novo tutorial */
.intro-text { font-style: italic; margin-bottom: 15px; }
.tutorial-list { list-style: none; padding: 0; margin: 0 0 15px 0; text-align: left; }
.tutorial-list li { margin-bottom: 8px; font-size: 0.9rem; }
.tutorial-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px;}
.t-item { background: rgba(0,0,0,0.3); padding: 6px; border-radius: 8px; font-size: 0.85rem; }
.t-item small { display: block; color: #aaa; margin-top: 1px; line-height: 1.1; }
.icon-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; text-align: center; }
.icon-grid div { background: rgba(255,255,255,0.1); padding: 5px; border-radius: 5px; font-size: 1.1rem; }
.icon-grid small { display: block; font-size: 0.7rem; margin-top: 3px; }
.credits { text-align: center; font-size: 0.7rem; color: #666; margin-top: 15px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; }

/* ANIMAÇÕES */
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes shake { 0% { transform: translate(1px, 1px) rotate(0deg); } 25% { transform: translate(-3px, 0px) rotate(1deg); } 50% { transform: translate(-1px, 2px) rotate(-1deg); } 75% { transform: translate(3px, 1px) rotate(0deg); } 100% { transform: translate(0, 0) rotate(0deg); } }
.shake-effect { animation: shake 0.4s; }
.shield-anim { box-shadow: 0 0 15px var(--accent-orange); transition: 0.2s; }
.heal-anim { filter: brightness(1.3) hue-rotate(-20deg); }
.poison-anim { animation: poisonGlow 0.6s ease-out; }
@keyframes poisonGlow { 0% { filter: brightness(1); } 50% { filter: brightness(1.2) sepia(1) hue-rotate(80deg) saturate(5); } 100% { filter: brightness(1); } }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(20px); } 20% { opacity: 1; transform: translateY(0); } 80% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-20px); } }
.float-text { animation: floatUp 1.5s forwards; color: #fff; text-shadow: 0 0 5px #ff5252; }