/* ======================================================
   STYLE GLOBAL
   ====================================================== */

/* Desktop par défaut */
#app {
  transform-origin: top center;
  padding: 10px;
  width: 100%;
}

#wrapper {
  width: 100%;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
}

/* Masquer la scrollbar globale sans casser le scroll */
html, body {
  overflow-y: scroll;           /* force un espace réservé */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge legacy */
  scrollbar-gutter: stable;     /* évite le décalage */
}

/* Chrome / WebKit */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

@import url('https://fonts.googleapis.com/css2?family=Alegreya+SC:ital,wght@0,400;0,500;0,700;0,800;0,900;1,400;1,500;1,700;1,800;1,900&family=Cinzel:wght@400..900&family=IM+Fell+English:ital@0;1&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Press+Start+2P&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

* {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: #000;
  color: #fff;
  font-family: 'Cinzel', serif;
}

.screen {
  padding: 10px;
}

img {
  image-rendering: pixelated;
  pointer-events: none;
  size: 150%;
}

/* ======================================================
   TITRES & SECTIONS
   ====================================================== */

h1, h2, h3 {
  margin: 5px 0;
  font-weight: bold;
  letter-spacing: 1px;
}

.screen-title {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 20px;
  text-align: center;
}

.section-title {
  font-weight: bold;
  margin-bottom: 8px;
  margin-top: 15px;
}

/* ======================================================
   ZONES (ÉCRAN MONDE)
   ====================================================== */

.zone-block {
  margin-bottom: 25px;
  padding-bottom: 10px;
}

.zone-name {
  font-weight: bold;
  margin-bottom: 4px;
}

.zone-desc {
  color: #ccc;
  margin-bottom: 8px;
}

/* ======================================================
   PNJ
   ====================================================== */

.dialogue-line {
  margin-bottom: 6px;
  color: #ddd;
  font-style: italic;
  text-align: center;
}

/* ======================================================
   EXPLORATION
   ====================================================== */

.explore-text {
  margin-bottom: 15px;
  color: #eee;
  line-height: 1.4;
}

/* ======================================================
   FORMULAIRES & BOUTONS
   ====================================================== */

label {
  display: block;
  margin: 5px 0;
}

.spell-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ======================================================
   BOUTONS WoW — Deluxe, sombre, élégant
   ====================================================== */

button,
.spell-btn,
.btn-wow {
  font-family: 'IM Fell English', serif;
  font-weight: bold;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;

  /* Couleur texte : doré chaud, pas blanc */
  color: #e8d27a;

  /* Nouveau background : sombre, propre, premium */
  background: linear-gradient(180deg, #1c1a17 0%, #0f0e0c 100%);

  /* Bordure dorée plus fine et plus classe */
  border: 1px solid #a88c4a;

  /* Relief subtil */
  text-shadow: 0 0 2px #000;
  box-shadow:
    inset 0 0 4px #000,
    0 0 4px rgba(168, 140, 74, 0.25);

  transition:
    transform 0.08s ease-out,
    background 0.15s ease-out,
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    color 0.15s ease-out;
}

/* Hover : doré plus lumineux mais pas blanc */
button:hover,
.spell-btn:hover,
.btn-wow:hover {
  background: linear-gradient(180deg, #2a2723 0%, #14120f 100%);
  border-color: #e8d27a;
  color: #f5e7a4;

  box-shadow:
    inset 0 0 4px #000,
    0 0 10px rgba(232, 210, 122, 0.35);
}

/* Clic : enfoncement propre */
button:active,
.spell-btn:active,
.btn-wow:active {
  transform: scale(0.94);
  background: linear-gradient(180deg, #14120f 0%, #000 100%);
  border-color: #8c7440;

  box-shadow:
    inset 0 0 10px #000,
    0 0 4px rgba(232, 210, 122, 0.2);
}

/* Désactivé */
button:disabled,
.spell-btn.on-cd,
.btn-wow:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: #5e4d2a;
  color: #b8a56a;
  background: #0f0e0c;
  box-shadow: inset 0 0 4px #000;
  transform: none;
}

/* ======================================================
   GRILLE DES SORTS
   ====================================================== */

.spell-btn {
  flex: 1 1 calc(25% - 10px);
  min-width: 120px;
}

@media (max-width: 600px) {
  .spell-btn {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
  }
}

/* ======================================================
   ICONES DE CLASSE
   ====================================================== */

.class-icon {
  border: 2px solid #444;
  padding: 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.class-icon:hover {
  border-color: #ffd100;
  box-shadow: 0 0 6px #ffd10055;
}

.class-icon.selected {
  border-color: #ffd100;
  box-shadow: 0 0 10px #ffd10088;
}

/* ======================================================
   BARRES (PV / PM / XP)
   ====================================================== */

.bar-container {
  border: 1px solid #555;
  width: 120px;
  height: 6px;
  margin: 3px 0 8px;
  overflow: hidden;
  border-radius: 3px;
}

.bar-fill {
  height: 100%;
  transition: width 0.2s linear;
}

.bar-hp { background: #c33; }
.bar-mp { background: #36c; }
.bar-xp { background: #ffea75; }

/* ======================================================
   BARRE D’INCANTATION
   ====================================================== */

.cast-progress {
  width: 100%;
  height: 6px;
  border: 1px solid #444;
  margin-top: 4px;
  position: relative;
}

.cast-progress-fill {
  height: 100%;
  width: 0%;
  background: #55aaff;
}

/* ======================================================
   PANELS & LAYOUT
   ====================================================== */

.flex-row {
  display: flex;
  gap: 20px;
}

.panel {
  flex: 1;
  padding: 8px;
}

.small-text {
  font-size: 12px;
  color: #aaa;
}

/* ======================================================
   INFO BAR
   ====================================================== */

.info-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  user-select: none;
}

.info-block {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.08);
  color: #ffea75;
  white-space: nowrap;
  border: 1px solid rgba(255, 234, 117, 0.25);
  text-shadow: 0 0 4px #000;
  box-shadow: inset 0 0 4px #000;
}

.char-info {
  display: inline-block;
  width: auto;
  align-self: flex-start;
  margin-bottom: 6px;
}

/* Couleurs */
.info-block.name { color: #ffffff; background: rgba(255,255,255,0.15); }
.info-block.class { color: #c8b6ff; }
.info-block.level { color: #ffd27f; }
.info-block.hp { color: #ff6b6b; }
.info-block.mp { color: #6bb6ff; }
.info-block.xp { color: #9aff9a; }
.info-block.gold { color: #ffdd55; }
.info-block.ilvl { color: #aaaaff; }

/* ======================================================
   GLOBAL BANNER
   ====================================================== */

#global-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: calc(100% - 40px);
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 234, 117, 0.35);
  border-radius: 6px;
  color: #ffea75;
  font-size: 14px;
  text-align: center;
  white-space: normal;
  box-shadow:
    0 0 12px rgba(255, 234, 117, 0.25),
    0 0 6px rgba(0, 0, 0, 0.8);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform-origin: center;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

#global-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* ======================================================
   MESSAGES
   ====================================================== */

.message {
  margin-top: 5px;
  color: #6c6;
  font-size: 12px;
}

/* ======================================================
   COMBAT LOG
   ====================================================== */

.combat-log {
  margin-bottom: 15px;
  height: 80px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #333;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.combat-log {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.combat-log::-webkit-scrollbar {
  display: none;
}

/* ======================================================
   BARRE DE SORTS
   ====================================================== */

.spell-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 14px;
}

.spell-key {
  padding: 2px 6px;
  border: 1px solid #666;
  border-radius: 4px;
  font-size: 12px;
  color: #ddd;
}

.spell-icon {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  border: 1px solid #444;
}

.spell-cd {
  margin-left: auto;
  font-size: 12px;
  font-weight: bold;
}

.spell-progress {
  width: 60px;
  height: 8px;
  border: 1px solid #444;
  margin-left: 4px;
  position: relative;
}

.spell-progress-fill {
  height: 100%;
  background: #55ff55;
}

.spell-progress-fill.on-cd {
  background: #ff5555;
}

/* ======================================================
   TABS
   ====================================================== */

.tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.tabs button {
  align-items: center;
  white-space: nowrap;
  padding: 8px 16px;
  font-weight: bold;
}

.tabs .active-tab {
  border-color: #ffea75;
  background: rgba(255,234,117,0.15);
  box-shadow: 0 0 10px #ffea75aa;
}

@media (max-width: 600px) {
  .tabs button {
    flex: 1 1 calc(50% - 12px);
  }
}

/* ======================================================
   ANIMATIONS
   ====================================================== */

@keyframes deathFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
