/* ═══════════════════════════════════════════════════════════════
   ASHBOUND — Global CSS
   Variabili, reset, tipografia, utilità condivise
═══════════════════════════════════════════════════════════════ */

:root {
  --bg:       #070912;
  --panel:    #111726;
  --panel2:   #182135;
  --line:     #303d59;
  --text:     #f5f7ff;
  --muted:    #9aa8c2;
  --violet:   #7a5cff;
  --green:    #37d79c;
  --red:      #ff5c72;
  --orange:   #ffad4f;
  --gold:     #ffd166;
  --blue:     #5fc8ff;
  --pink:     #ff73d1;
  --kf-hero-img : url("../images/index/kfheroimg.png");
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, "Segoe UI Emoji", "Apple Color Emoji",
               "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
  color: var(--text);
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

button { font: inherit; cursor: pointer; }

img { display: block; max-width: 100%; }

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--blue); }

/* ── Rarità ── */
.rarity-common        { color: #dbe2ef; }
.rarity-uncommon      { color: #65e89d; }
.rarity-rare          { color: #5fc8ff; }
.rarity-epic          { color: #c178ff; }
.rarity-legendary     { color: #ffd166; }
.rarity-unique        { color: #ff8f5f; }
.rarity-mythical      { color: #ff73d1; }
.rarity-divine        { color: #fff3a3; text-shadow: 0 0 12px #ffe66d; }
.rarity-absolute      { color: #fff; text-shadow: 0 0 8px #fff, 0 0 20px #9d88ff; }
.rarity-absolute-goddness {
  color: #fff;
  text-shadow: 0 0 8px #fff, 0 0 30px #ff73d1, 0 0 60px #7a5cff;
  animation: agPulse 2s ease-in-out infinite;
}

@keyframes agPulse {
  0%,100% { text-shadow: 0 0 8px #fff, 0 0 30px #ff73d1, 0 0 60px #7a5cff; }
  50%      { text-shadow: 0 0 12px #fff, 0 0 50px #ff73d1, 0 0 90px #7a5cff, 0 0 120px #37d79c; }
}

/* ── Barre HP generiche ── */
.bar-shell {
  padding: 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, #05070d, #1b2436);
  border: 1px solid #475778;
  box-shadow: inset 0 2px 8px #000;
}
.bar {
  height: 15px;
  border-radius: 6px;
  overflow: hidden;
  background: repeating-linear-gradient(135deg, #151b29 0 8px, #101522 8px 16px);
}
.bar > div { height: 100%; transition: width .25s; }
.hpbar    { background: linear-gradient(90deg, #1ead70, #57eaa8); }
.atkbar   { background: linear-gradient(90deg, #ffb347, #ff526c); width: 0; }

.bar-caption {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin: 5px 2px 10px;
}

/* ── Mini bar (stat card) ── */
.mini-bar  { height: 6px; background: #05070e; border: 1px solid #33405a; border-radius: 99px; overflow: hidden; margin-top: 7px; }
.mini-fill { height: 100%; background: var(--green); transition: width .25s; }

/* ── Btn generici ── */
.btn {
  border: 1px solid var(--line);
  background: #202a40;
  color: #fff;
  padding: 6px 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
}
.btn:hover { border-color: #8e75ff; }
.btn.buy   { background: var(--violet); border: 0; }
.btn.sell  { color: #ff9aa7; border-color: #ff5c7266; }
.btn.sell:disabled { opacity: .35; cursor: not-allowed; color: #9aa8c2; border-color: #44506a; }
.btn.equipped   { color: var(--green); border-color: #37d79c77; }
.btn.danger-btn { background: #7e2538 !important; border-color: #c14a63 !important; }
.btn.sell-all   { background: linear-gradient(135deg, #c73d58, #8b263c); border-color: #e85d75; color: #fff; font-weight: 900; }
.btn.sell-all:disabled { opacity: .4; cursor: not-allowed; }

/* ── Modal ── */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  inset: 0;
  background: #02040bd9;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal.on { display: flex; }

.modal-card {
  width: min(100%, 700px);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #53648d;
  border-radius: 18px;
  background: linear-gradient(180deg, #151e32, #090e19);
  padding: 16px;
  box-shadow: 0 25px 80px #000;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.modal-head h2 { margin: 0; }
.close-btn {
  border: 1px solid var(--line);
  background: #202a40;
  color: #fff;
  border-radius: 9px;
  padding: 7px 10px;
  cursor: pointer;
}

/* ── Float text ── */
.float {
  position: absolute;
  z-index: 15;
  font-size: 24px;
  font-weight: 1000;
  text-shadow: 0 3px 7px #000;
  pointer-events: none;
  animation: floatUp .9s forwards;
}
@keyframes floatUp {
  to { transform: translateY(-75px); opacity: 0; }
}

/* ── Utility ── */
.good   { color: var(--green); }
.bad    { color: #ff8795; }
.magic  { color: var(--blue); }
.crit   { color: var(--gold); }
.sys    { color: var(--muted); }
.desc   { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 4px; }
.panel  { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 13px; min-height: 220px; }

/* ── Active buffs ── */
.active-buffs-panel   { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.active-buff-chip     { min-width: 150px; padding: 8px 10px; border: 1px solid #7654c7; border-radius: 10px; background: linear-gradient(180deg, #241942, #130d27); box-shadow: 0 0 12px #6f4fd133; }
.active-buff-chip strong { display: block; color: #f1e8ff; font-size: 13px; }
.active-buff-chip small  { display: block; margin-top: 3px; color: #cbbce8; font-size: 11px; }
.active-buff-time     { color: #ffd86a !important; font-weight: 900; }
.active-buffs-empty   { color: #817990; font-size: 12px; }