/**
 * LexiBlade - CSS de Combat Dark Fantasy & Touches Simultanées (Chords)
 * Lisibilité maximale, jauges agressives et feedback de parade runique
 */

.combat-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(15px, 2.5vh, 30px) clamp(20px, 3vw, 40px);
  pointer-events: none;
  overflow: hidden;
}

/* TOP : ENNEMI & HÉROS */
.combat-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.enemy-hud-box {
  background: radial-gradient(circle, rgba(24, 24, 27, 0.92) 0%, rgba(9, 9, 11, 0.95) 100%);
  border: 2px solid #854d0e;
  border-radius: 8px;
  padding: 14px 20px;
  width: clamp(280px, 28vw, 400px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9), 0 6px 20px rgba(0, 0, 0, 0.8);
}

.enemy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.enemy-name {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(0.95rem, 1.3vw, 1.25rem);
  letter-spacing: 2px;
  color: #f87171;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.enemy-shield-badge {
  background: linear-gradient(90deg, #1e3a8a, #3b82f6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #60a5fa;
}

/* Barres de vie et de jauge */
.bar-track {
  width: 100%;
  height: 15px;
  background: #09090b;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #991b1b, #ef4444);
  width: 100%;
  transition: width 0.15s ease-out;
}

.bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.72rem;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* JAUGE D'ATTAQUE ENNEMIE AGRESSIVE */
.gauge-track {
  height: 12px;
  background: #09090b;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #ca8a04, #facc15);
  width: 0%;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.8);
  transition: width 0.04s linear, background 0.2s;
}

.gauge-fill.gauge-danger {
  background: linear-gradient(90deg, #dc2626, #ef4444) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.95) !important;
  animation: dangerPulse 0.3s infinite alternate;
}

@keyframes dangerPulse {
  0% { filter: brightness(1.0); }
  100% { filter: brightness(1.5); }
}

.gauge-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.gauge-label {
  font-size: 0.68rem;
  color: #d4af37;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 1px;
}

.danger-warning-text {
  font-size: 0.72rem;
  color: #ef4444;
  font-weight: 900;
  letter-spacing: 1px;
  animation: blinkWarning 0.25s infinite alternate;
}

@keyframes blinkWarning {
  0% { opacity: 0.3; }
  100% { opacity: 1.0; }
}

.enrage-badge {
  background: linear-gradient(90deg, #dc2626, #ea580c);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.8);
  animation: enrageShake 0.4s infinite;
}

@keyframes enrageShake {
  0%, 100% { transform: scale(1.0); }
  50% { transform: scale(1.08); }
}

/* HÉROS HUD (CŒURS & COMBO) */
.hero-hud-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.hearts-container {
  display: flex;
  gap: 6px;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6));
}

.combo-badge {
  background: radial-gradient(circle, rgba(24, 24, 27, 0.9) 0%, rgba(9, 9, 11, 0.95) 100%);
  border: 1px solid var(--gold-primary);
  padding: 6px 16px;
  border-radius: 6px;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 2px;
  color: #facc15;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.3);
}

.combo-badge.combo-fire {
  border-color: #ea580c;
  color: #fb923c;
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.7);
}

.combo-badge.combo-mega {
  border-color: #ef4444;
  color: #fef08a;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.9);
  transform: scale(1.08);
}

/* CENTRE : ZONE DE FRAPPE ET ACCORDS RUNIES (CHORDS) */
.combat-center-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* BANNIÈRE DE TOUCHES SIMULTANÉES (CHORD RUNIQUE) */
.chord-banner {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%);
  border: 2px solid #fef08a;
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  letter-spacing: 2px;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.9), inset 0 0 15px rgba(254, 240, 138, 0.4);
  animation: chordPulse 0.35s infinite alternate;
}

@keyframes chordPulse {
  0% { transform: scale(0.98); }
  100% { transform: scale(1.03); }
}

.chord-key-badge {
  background: #000;
  color: #facc15;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #facc15;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
}

.onboarding-hint-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #38bdf8;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e0f2fe;
}

.critical-banner {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 2px;
  padding: 5px 18px;
  border-radius: 6px;
  text-transform: uppercase;
}

.critical-banner.critical-active {
  background: linear-gradient(90deg, #d97706, #facc15);
  color: #000;
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.9);
}

.critical-banner.finisher-active {
  background: linear-gradient(90deg, #991b1b, #e11d48);
  color: #fff;
  box-shadow: 0 0 35px rgba(225, 29, 72, 0.9);
}

/* ZONE DE MOT À ÉCRIRE */
.word-prompt-container {
  background: radial-gradient(circle, rgba(17, 24, 39, 0.95) 0%, rgba(9, 9, 11, 0.98) 100%);
  border: 2px solid #854d0e;
  padding: clamp(14px, 2.2vh, 22px) clamp(24px, 4vw, 45px);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(212, 175, 55, 0.2);
}

.word-letters {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}

.char-validated {
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.9);
}

.char-cursor {
  color: #facc15;
  background: rgba(250, 204, 21, 0.25);
  border-bottom: 4px solid #facc15;
  padding: 0 3px;
  animation: cursorPulse 0.8s infinite;
  text-shadow: 0 0 18px rgba(250, 204, 21, 0.95);
}

.char-error {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.4) !important;
  border-color: #ef4444 !important;
}

.char-remaining {
  color: #f8fafc;
  opacity: 0.85;
}

@keyframes cursorPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.word-shake-error {
  animation: wordShake 0.2s ease-in-out;
}

@keyframes wordShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* POPUP DE RATING */
.rating-popup-overlay {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 25;
}

.rating-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2.5rem, 4vw, 3.8rem);
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 0 0 30px currentColor;
}

.rating-damage {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: #ffffff;
  margin-top: 4px;
}

.rating-perfect { color: #facc15; }
.rating-great { color: #38bdf8; }
.rating-good { color: #4ade80; }
.rating-late { color: #f97316; }

.rating-anim {
  animation: ratingPop 0.55s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes ratingPop {
  0% { transform: scale(0.3) translateY(20px); opacity: 0; }
  40% { transform: scale(1.15) translateY(-10px); opacity: 1; }
  80% { transform: scale(1.0) translateY(0); opacity: 1; }
  100% { transform: scale(1.05) translateY(-20px); opacity: 0; }
}

/* BAS : CLAVIER VIRTUEL DISCRET */
.combat-bottom-bar {
  display: flex;
  justify-content: center;
  width: 100%;
}

.vk-wrapper {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.25);
  padding: 8px 16px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.vk-hint-badge {
  font-size: 0.75rem;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: #a8a29e;
  display: flex;
  gap: 8px;
}

.finger-name {
  color: #facc15;
  font-weight: 900;
}

.vk-keys-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vk-row {
  display: flex;
  gap: 3px;
  justify-content: center;
}

.vk-key {
  width: 28px;
  height: 28px;
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #d4d4d8;
  transition: all 0.1s;
}

.vk-key.space-key {
  width: 120px;
}

.vk-key.active-target {
  background: #facc15;
  color: #000000;
  font-weight: 900;
  border-color: #fef08a;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.9);
  transform: translateY(-2px);
}

.vk-key.active-error {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.9);
}
