/* ═══════════════════════════════════════════════════════════════════
   ELORAN — game.css  v1.0
   Dark RPG theme · Mobile-first
   ═══════════════════════════════════════════════════════════════════ */

/* ── VARIABILI ──────────────────────────────────────────────────── */
:root {
  /* Sfondo */
  --bg:        #0a0a0f;
  --bg2:       #111118;
  --bg3:       #1a1a26;
  --bg4:       #22223a;
  --border:    #2e2e48;
  --border2:   #3d3d5c;

  /* Testo */
  --text:      #dde0f5;
  --text-dim:  #7a7a9a;
  --text-muted:#4a4a6a;

  /* Accento principale */
  --accent:    #7c3aed;
  --accent-lt: #a855f7;
  --accent-dk: #5b21b6;

  /* Stat */
  --hp-color:  #ef4444;
  --mp-color:  #3b82f6;
  --xp-color:  #10b981;
  --gold-color:#f59e0b;
  --gem-color: #a78bfa;

  /* Rarità */
  --r-common:    #9ca3af;
  --r-uncommon:  #4ade80;
  --r-rare:      #60a5fa;
  --r-epic:      #c084fc;
  --r-legendary: #f59e0b;
  --r-unique:    #ff2020;

  /* Socket (stile PoE) */
  --sock-red:   #ef4444;
  --sock-blue:  #3b82f6;
  --sock-green: #22c55e;
  --sock-white: #e2e8f0;

  /* Layout */
  --hdr-h:    52px;
  --nav-h:    56px;
  --radius:   10px;
  --radius-sm:6px;
}

/* ── RESET & BASE ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, select, textarea { font: inherit; color: inherit; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; }
a { color: var(--accent-lt); text-decoration: none; }

/* ── HEADER ─────────────────────────────────────────────────────── */
#hdr {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--hdr-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
  gap: 8px;
}

#hdr-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#hname {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-lt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

#hlv {
  font-size: 12px;
  color: var(--xp-color);
  white-space: nowrap;
}

#hdr-res {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.hchip {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.hchip-hp   { border-color: var(--hp-color);   color: var(--hp-color);   }
.hchip-mp   { border-color: var(--mp-color);   color: var(--mp-color);   }
.hchip-stam { border-color: #facc15;           color: #facc15;           }
.hchip-gold { border-color: var(--gold-color); color: var(--gold-color); }
.hchip-gem  { border-color: var(--gem-color);  color: var(--gem-color);  }

/* XP bar sottile sotto l'header */
#xp-bar-wrap {
  position: fixed;
  top: var(--hdr-h);
  left: 0; right: 0;
  height: 3px;
  background: var(--bg3);
  z-index: 99;
}
#xp-bar {
  height: 100%;
  background: var(--xp-color);
  transition: width .4s ease;
  width: 0%;
}

/* ── CONTENUTO PRINCIPALE ───────────────────────────────────────── */
#main {
  position: fixed;
  top: calc(var(--hdr-h) + 3px);
  left: 0; right: 0;
  bottom: var(--nav-h);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── NAVIGAZIONE INFERIORE ──────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-dim);
  padding: 4px 0;
  transition: color .15s, background .15s;
}
.nav-btn .nav-ico { font-size: 20px; line-height: 1; }
.nav-btn.active { color: var(--accent-lt); }
.nav-btn:active { background: var(--bg3); }

/* ── SCREEN BASE ────────────────────────────────────────────────── */
.screen { padding: 12px; padding-bottom: 8px; }

.screen-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

/* ── CARD ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

/* ── BARRE HP/MP/XP ─────────────────────────────────────────────── */
.bar-wrap {
  height: 10px;
  background: var(--bg4);
  border-radius: 10px;
  overflow: hidden;
  margin: 3px 0;
}
.bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width .3s ease;
}
.bar-hp   { background: var(--hp-color); }
.bar-mp   { background: var(--mp-color); }
.bar-xp   { background: var(--xp-color); }
.bar-fren { background: var(--accent-lt); }

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── HERO SCREEN ────────────────────────────────────────────────── */
#hero-portrait {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
  flex-shrink: 0;
}
#hero-portrait img { width: 100%; height: 100%; object-fit: cover; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.stat-label { color: var(--text-dim); font-size: 12px; }
.stat-value { font-weight: 700; font-size: 13px; }
.stat-btn {
  background: var(--accent-dk);
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.stat-btn.disabled {
  opacity: .35;
  pointer-events: none;
}
.stat-btn-sub {
  background: #374151;   /* grigio scuro — bottone rimuovi */
}
.stat-pts {
  font-size: 12px;
  color: var(--gold-color);
  margin-bottom: 6px;
}

/* ── EQUIPMENT GRID ─────────────────────────────────────────────── */
.eq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.eq-slot {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .15s;
  padding: 4px;
  position: relative;
  overflow: hidden;
}
.eq-slot:active { border-color: var(--accent); }
.eq-slot.filled { border-color: var(--border2); }
.eq-slot-ico  { font-size: 24px; line-height: 1; }
.eq-slot-name { font-size: 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; }
.eq-slot-label{ font-size: 9px; color: var(--text-muted); }

/* ── SOCKET DISPLAY (stile PoE) ─────────────────────────────────── */
.socket-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.socket {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  position: relative;
}
.socket-link {
  width: 8px; height: 4px;
  margin: 0 -2px;
  border-radius: 2px;
  flex-shrink: 0;
}
.socket[data-color="red"]   { border-color: var(--sock-red);   }
.socket[data-color="blue"]  { border-color: var(--sock-blue);  }
.socket[data-color="green"] { border-color: var(--sock-green); }
.socket[data-color="white"] { border-color: var(--sock-white); }
.socket.filled[data-color="red"]   { background: rgba(239,68,68,.25);  }
.socket.filled[data-color="blue"]  { background: rgba(59,130,246,.25); }
.socket.filled[data-color="green"] { background: rgba(34,197,94,.25);  }
.socket.filled[data-color="white"] { background: rgba(226,232,240,.15);}
.socket-link[data-color="red"]  { background: var(--sock-red);   }
.socket-link[data-color="blue"] { background: var(--sock-blue);  }
.socket-link[data-color="green"]{ background: var(--sock-green); }
.socket-link[data-color="white"]{ background: var(--sock-white); }

/* ── ITEM CARD ───────────────────────────────────────────────────── */
.item-list { display: flex; flex-direction: column; gap: 6px; }

.item-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.item-card:active { background: var(--bg3); }
.item-card.equipped { border-color: var(--accent); }

.item-ico {
  width: 40px; height: 40px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}
.item-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }

.item-info { flex: 1; min-width: 0; }
.item-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub  { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.item-qty  { font-size: 12px; color: var(--text-dim); }

/* Colori rarità */
.r-common    { color: var(--r-common);    }
.r-uncommon  { color: var(--r-uncommon);  }
.r-rare      { color: var(--r-rare);      }
.r-epic      { color: var(--r-epic);      }
.r-legendary { color: var(--r-legendary); }
.r-unique    { color: var(--r-unique);    }

/* ── INVENTARIO TAB ─────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--bg2);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.tab-btn {
  flex: 1;
  padding: 7px 4px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  transition: background .15s, color .15s;
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── DUNGEON SCREEN ─────────────────────────────────────────────── */
.zone-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
  position: relative;
  overflow: hidden;
}
.zone-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,.08) 0%, transparent 60%);
  pointer-events: none;
}
.zone-card:active { transform: scale(.98); }
.zone-card.locked { opacity: .45; cursor: default; }
.zone-card.active { border-color: var(--accent); }

.zone-name  { font-size: 16px; font-weight: 700; }
.zone-sub   { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.zone-prog  { font-size: 11px; color: var(--xp-color); margin-top: 6px; }

.floor-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-top: 10px;
}
.floor-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.floor-btn.done      { background: rgba(16,185,129,.12); border-color: var(--xp-color); }
.floor-btn.current   { border-color: var(--accent-lt); background: rgba(124,58,237,.18); }
.floor-btn.locked    { opacity: .3; cursor: default; }
.floor-btn.boss      { border-color: var(--r-legendary); }
.floor-stars         { font-size: 8px; color: var(--gold-color); letter-spacing: -1px; }
.floor-pet-hint      { font-size: 9px; line-height: 1; opacity: .6; }

/* ── COMBAT SCREEN ───────────────────────────────────────────────── */
#combat {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  padding: 10px;
  gap: 8px;
}

/* Nemici */
#combat-enemies {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 130px;
  align-items: flex-end;
}
.enemy-card {
  flex: 1;
  max-width: 140px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color .2s;
}
.enemy-card.targeted { border-color: var(--hp-color); }
.enemy-art {
  width: 64px; height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  line-height: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg3);
}
.enemy-art img { width: 100%; height: 100%; object-fit: contain; }
.enemy-name { font-size: 11px; font-weight: 600; text-align: center; }
.enemy-hp-bar { width: 100%; }

/* Log combattimento */
#combat-log {
  flex: 0 0 70px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  overflow-y: auto;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.log-entry-dmg     { color: var(--hp-color);   }
.log-entry-heal    { color: var(--xp-color);   }
.log-entry-status  { color: var(--r-epic);     }
.log-entry-system  { color: var(--gold-color); }
.log-entry-special { color: #a78bfa; font-weight: 600; }

/* Cattura Pet */
.capture-log-entry { padding: 2px 0; }
.text-red  { color: var(--hp-color); }
.text-green { color: var(--xp-color); }

/* Player area */
#combat-player {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.player-bars { display: flex; flex-direction: column; gap: 4px; }
.player-bar-row { display: flex; align-items: center; gap: 6px; }
.player-bar-ico  { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.player-bar-fill { flex: 1; }
.player-bar-val  { font-size: 11px; color: var(--text-dim); min-width: 60px; text-align: right; }

/* Skill bar in combat */
#skill-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.skill-btn {
  flex: 0 0 52px;
  height: 52px;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  position: relative;
  transition: border-color .15s, opacity .15s;
}
.skill-btn:active:not(.disabled) { background: var(--bg4); transform: scale(.96); }
.skill-btn.disabled { opacity: .35; cursor: default; }
.skill-btn.on-cd::after {
  content: attr(data-cd);
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.skill-ico    { font-size: 22px; line-height: 1; }
.skill-mp     { font-size: 9px;  color: var(--mp-color); }
.skill-name   { font-size: 8px;  max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Azioni combat */
#combat-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.action-btn {
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg3);
  border: 1px solid var(--border2);
  transition: background .15s;
  text-align: center;
}
.action-btn:active { background: var(--bg4); }
.action-btn.primary { background: var(--accent-dk); border-color: var(--accent); color: #fff; }
.action-btn.danger  { background: rgba(239,68,68,.15); border-color: var(--hp-color); color: var(--hp-color); }

/* Indicatore turno */
#turn-indicator {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 0;
}

/* ── SCHERMATA RISULTATI ─────────────────────────────────────────── */
#results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px 16px;
  gap: 16px;
  text-align: center;
}
.results-title {
  font-size: 32px;
  font-weight: 800;
}
.results-title.win  { color: var(--xp-color);  }
.results-title.lose { color: var(--hp-color);  }
.results-title.flee { color: var(--text-dim);  }

.results-rewards {
  width: 100%;
  max-width: 360px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reward-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.reward-label { color: var(--text-dim); }
.reward-value { font-weight: 700; }

/* ── STAR RESULT ─────────────────────────────────────────── */
.floor-star-result {
  width: 100%;
  max-width: 360px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.star-row {
  font-size: 28px;
  letter-spacing: 4px;
  color: var(--gold-color);
}
.badge-new {
  font-size: 11px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: middle;
  margin-left: 8px;
}
.star-bonus-list {
  width: 100%;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.text-gem { color: #818cf8; }

.loot-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 360px;
}

/* ── CREAZIONE PERSONAGGIO ───────────────────────────────────────── */
#char-creation {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 440px;
  margin: 0 auto;
}
.class-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.class-card {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex;
  gap: 12px;
  align-items: center;
}
.class-card.selected { border-color: var(--accent-lt); background: rgba(124,58,237,.12); }
.class-card-ico  { font-size: 40px; flex-shrink: 0; }
.class-card-info { flex: 1; }
.class-card-name { font-size: 16px; font-weight: 700; }
.class-card-desc { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.class-card-stats{ font-size: 11px; color: var(--accent-lt); margin-top: 5px; }

/* ── MODALE ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-close {
  font-size: 20px;
  color: var(--text-dim);
  line-height: 1;
}
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.modal-actions button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}

/* ── TOAST ───────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: calc(var(--hdr-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.toast {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  animation: fadeIn .2s ease, fadeOut .3s ease 2.2s forwards;
  white-space: nowrap;
}
.toast-warn    { border-color: var(--gold-color); color: var(--gold-color); }
.toast-error   { border-color: var(--hp-color);   color: var(--hp-color);   }
.toast-success { border-color: var(--xp-color);   color: var(--xp-color);   }

/* ── NUMERI DANNO ANIMATI ────────────────────────────────────────── */
.dmg-float {
  position: absolute;
  font-weight: 800;
  font-size: 18px;
  pointer-events: none;
  animation: floatUp .8s ease forwards;
  z-index: 50;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.dmg-float.physical { color: #fff; }
.dmg-float.fire     { color: #f97316; }
.dmg-float.ice      { color: #67e8f9; }
.dmg-float.lightning{ color: #facc15; }
.dmg-float.dark     { color: #a855f7; }
.dmg-float.holy     { color: #fef08a; }
.dmg-float.poison   { color: #84cc16; }
.dmg-float.heal     { color: var(--xp-color); }
.dmg-float.crit     { font-size: 24px; color: var(--r-legendary); }

/* ── SOCKET INTERATTIVI ──────────────────────────────────────────── */
.socket-row-interactive {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;           /* nessun gap: i connettori si incollano ai socket */
  padding: 10px 0;
}
/* Socket più grandi in modalità interattiva */
.socket-row-interactive .socket {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border-width: 2.5px;
  font-size: 20px;
  margin: 0 4px;
  flex-shrink: 0;
}
/* Link / connettore visibile tra socket collegati */
.socket-row-interactive .socket-link {
  width: 22px;
  height: 12px;
  margin: 0 -1px;   /* si sovrappone leggermente ai margin dei socket */
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
}
/* Etichetta del colore nel centro del connettore */
.socket-row-interactive .socket-link::after {
  content: '⛓';
  font-size: 9px;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  opacity: .6;
}
.socket.empty {
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.socket.empty:active  { transform: scale(.92); }
.socket.empty:hover   { box-shadow: 0 0 10px 3px var(--accent-lt); }
.socket-plus {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 700;
  line-height: 1;
}
.socket-remove-btn {
  background: rgba(239,68,68,.18);
  border: 1px solid var(--hp-color);
  color: var(--hp-color);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: -6px;
  margin-top: -16px;
  position: relative;
  z-index: 1;
}
.socket-remove-btn:active { transform: scale(.88); }

/* ── GEM SELECTOR ───────────────────────────────────────────────── */
.gem-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.gem-select-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.gem-select-row:hover  { background: var(--bg4); border-color: var(--accent); }
.gem-select-row:active { transform: scale(.98); }
.gem-ico  { font-size: 22px; flex-shrink: 0; }
.gem-name { font-weight: 600; font-size: 13px; }
.gem-info { display: flex; flex-direction: column; gap: 3px; }
.badge-active { font-size: 9px; background: rgba(239,68,68,.25); color: #f87171; border-radius: 3px; padding: 1px 5px; }
.badge-supp   { font-size: 9px; background: rgba(59,130,246,.25); color: #93c5fd; border-radius: 3px; padding: 1px 5px; }

/* ── BOTTEGA (SHOP) ─────────────────────────────────────────────── */
.gold-display {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-color);
  margin-bottom: 10px;
  padding: 6px 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.shop-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.shop-item-ico  { font-size: 26px; flex-shrink: 0; width: 32px; text-align: center; }
.shop-item-info { flex: 1; min-width: 0; }
.shop-item-name { font-size: 13px; font-weight: 600; }
.shop-item-buy  { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.shop-price     { font-size: 12px; color: var(--gold-color); font-weight: 700; }
.btn-shop {
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-shop.disabled         { background: var(--bg4); color: var(--text-muted); cursor: default; }
.btn-shop:not(.disabled):active { transform: scale(.95); }
.sock-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.3);
  vertical-align: middle;
}
.sock-dot[data-color="red"]   { background: var(--sock-red); }
.sock-dot[data-color="blue"]  { background: var(--sock-blue); }
.sock-dot[data-color="green"] { background: var(--sock-green); }
.sock-dot[data-color="white"] { background: var(--sock-white); }

/* ── PET SCREEN ─────────────────────────────────────────────────── */

/* Empty state */
.pet-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
}

/* Active pet card */
.pet-active-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

/* Banner (icon + name + XP) */
.pet-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.pet-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 34px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: var(--bg3);
  flex-shrink: 0;
}

.pet-banner-info {
  flex: 1;
  min-width: 0;
}

.pet-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-nature-badge {
  font-size: 10px;
  background: rgba(124,58,237,.3);
  color: var(--accent-lt);
  border-radius: 4px;
  padding: 2px 6px;
}

/* XP bar (reuse bar/bar-fill classes, add bar-xp color) */
.bar-xp { background: var(--xp-color); }

/* Stats grid (2-3 columns) */
.pet-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pet-stat-cell {
  background: var(--bg3);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pet-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* Passive / active skill rows */
.pet-skills-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--bg3);
  border-radius: 8px;
  margin-bottom: 10px;
}

.pet-passive-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pet-skill-ico {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1.2;
}

.pet-skill-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Evolution panel */
.pet-evo-panel {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(124,58,237,.12);
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 8px;
}

.pet-evo-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-lt);
  margin-bottom: 4px;
}

/* Stable list */
.pet-stable-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-stable-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.pet-stable-card:active { background: var(--bg3); }

.pet-active-border {
  border-color: var(--accent);
  background: rgba(124,58,237,.08);
}

/* Bounty cards */
.pet-bounty-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

.opacity-40 { opacity: .45; }

/* ── SCHERMATA BACK ROW ─────────────────────────────────────────── */
.screen-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.back-btn:hover { color: var(--text-primary); }

/* ── SCHERMATA MISSIONI ─────────────────────────────────────────── */
.quest-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.quest-card:last-child { margin-bottom: 0; }
.quest-card-done    { border-color: #34d399; }
.quest-card-claimed { opacity: .50; }

.quest-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.quest-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.quest-desc {
  font-size: 12px;
  margin: 0 0 8px;
  line-height: 1.4;
}
.quest-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.quest-badge.ready   { background: #064e3b; color: #34d399; }
.quest-badge.claimed { background: var(--bg2); color: var(--text-secondary); }
.quest-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
  vertical-align: middle;
  margin-left: 2px;
}
.quest-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.quest-rewards span {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg2);
}
.qrw-xp   { color: #86efac; }
.qrw-gold { color: var(--gold-color); }
.qrw-gem  { color: var(--gem-color); }
.qrw-mat  { color: var(--text-secondary); }
.quest-action  { display: flex; align-items: center; }
.quest-prog-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.quest-prog-label { font-size: 11px; white-space: nowrap; }
.bar-quest { background: var(--accent-lt); }

/* ── SCHERMATA TALENTI ──────────────────────────────────────────── */
.tal-pts-card {
  text-align: center;
  padding: 12px;
}
.tal-pts-avail {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-lt);
}
.talent-tier {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.tt-locked { opacity: .60; }
.tt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.tt-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-lt);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tt-pts { font-size: 12px; }
.talent-nodes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.talent-node {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.tn-max    { border-color: #f5c518; }
.tn-locked { opacity: .50; }
.tn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.tn-name {
  font-weight: 700;
  font-size: 14px;
}
.tn-lvl {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.tn-lvl-max { color: #f5c518; }
.tn-desc {
  font-size: 12px;
  margin: 0 0 6px;
  line-height: 1.4;
}
.tn-bar { height: 6px; margin-bottom: 8px; }
.bar-talent { background: #a78bfa; }
.tn-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tn-eff {
  font-size: 11px;
  line-height: 1.3;
  flex: 1;
}
.tn-badge-max {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #713f12;
  color: #f5c518;
  font-weight: 700;
}

/* ── GILDA ─────────────────────────────────────────────────────── */
.guild-no-guild {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 16px;
}
.guild-info-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.guild-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.guild-icon { font-size: 36px; line-height: 1; }
.guild-name { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.guild-desc { margin-top: 8px; line-height: 1.5; }

.guild-members-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.guild-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.guild-member-row:last-child { border-bottom: none; }
.guild-member-name { font-weight: 600; font-size: 13px; }

/* Rank badges */
.guild-rank-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.rank-leader  { background: rgba(245,197,24,.15); color: #f5c518; }
.rank-officer { background: rgba(96,165,250,.15);  color: #60a5fa; }
.rank-member  { background: var(--bg3);            color: var(--text-dim); }

/* Search results */
.guild-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.guild-search-row:last-child { border-bottom: none; }

/* Danger button */
.btn-danger {
  background: rgba(239,68,68,.15);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  width: 100%;
  transition: background .15s;
}
.btn-danger:active { background: rgba(239,68,68,.3); }

/* Text input per modali */
.text-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s;
}
.text-input:focus { border-color: var(--accent); }

/* ── ARENA PVP ──────────────────────────────────────────────────── */
.arena-tk-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.text-accent { color: var(--accent-lt); }

.arena-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 16px;
}
.arena-opp-list { display: flex; flex-direction: column; gap: 8px; }
.arena-opp-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  gap: 10px;
}
.arena-opp-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.arena-opp-icon { font-size: 28px; }
.arena-opp-name { font-weight: 700; font-size: 14px; }

/* ── ANIMAZIONI ─────────────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut   { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp   { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes floatUp   { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-50px); } }
@keyframes pop       { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }

/* ── UTILITY ─────────────────────────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-4        { gap: 4px; }
.mt-4         { margin-top: 4px; }
.mt-8         { margin-top: 8px; }
.mt-12        { margin-top: 12px; }
.text-dim     { color: var(--text-dim); }
.text-gold    { color: var(--gold-color); }
.text-green   { color: var(--xp-color); }
.text-red     { color: var(--hp-color); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.bold         { font-weight: 700; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  width: 100%;
  transition: background .15s;
}
.btn-primary:active { background: var(--accent-lt); }
.btn-secondary {
  background: var(--bg3);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  transition: background .15s;
}
.btn-secondary:active { background: var(--bg2); }

/* Pulsanti compatti (sm) */
.btn-sm {
  padding: 5px 12px !important;
  font-size: 12px !important;
  width: auto !important;
  min-width: 0 !important;
}

/* Input generico (usato in Forgia, Amici, …) */
.forge-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
}
.forge-input:focus { border-color: var(--accent); }

/* ── FORGIA ─────────────────────────────────────────────────────── */
.forge-screen { display: flex; flex-direction: column; gap: 10px; }
.recipe-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recipe-card-header { display: flex; align-items: center; gap: 8px; }
.recipe-card-name   { font-weight: 700; font-size: 14px; }
.recipe-mats        { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11px; color: var(--text-dim); }
.recipe-mat-ok      { color: var(--xp-color); }
.recipe-mat-bad     { color: var(--hp-color); }

.enh-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.enh-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.enh-bar-wrap { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.enh-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.enh-costs    { font-size: 11px; color: var(--text-dim); display: flex; gap: 10px; flex-wrap: wrap; }

.smelt-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.smelt-info { flex: 1; min-width: 0; }
.smelt-value { color: var(--gold-color); font-weight: 700; font-size: 13px; }


/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 480px)
   Ottimizzazioni per browser mobile: font più grandi, touch target adeguati,
   layout adattato a schermi piccoli.
   ══════════════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════════════
   MOBILE — ≤ 480px  (phone piccolo / standard)
   Touch target minimo: 48px  |  Font base: 16px
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* ── Base ── */
  html, body { font-size: 16px; }

  /* ── Header ── */
  #hdr { padding: 0 8px; gap: 4px; }
  #hname { font-size: 13px; max-width: 72px; }
  .hchip { padding: 4px 7px; font-size: 12px; gap: 2px; }
  #hdr-res { gap: 4px; }

  /* ── Bottom Nav ── */
  #bottom-nav { height: 62px; }
  :root { --nav-h: 62px; }
  .nav-btn { font-size: 11px; padding: 6px 2px; min-width: 48px; }
  .nav-btn .nav-ico { font-size: 24px; }

  /* ── Screen padding ── */
  .screen { padding: 12px 10px 14px; }
  .screen-title { font-size: 18px; margin-bottom: 14px; }

  /* ── Card ── */
  .card { padding: 14px 12px; }

  /* ── Stat grid ── */
  .stat-grid { gap: 6px; }
  .stat-row { padding: 10px 12px; min-height: 48px; }
  .stat-label { font-size: 13px; }
  .stat-value { font-size: 15px; }
  .stat-btn { width: 36px; height: 36px; font-size: 20px; }

  /* ── Bottoni universali — touch target 48px ── */
  .btn-primary, .btn-secondary {
    padding: 14px 20px;
    font-size: 15px;
    min-height: 48px;
  }
  .action-btn {
    min-height: 48px;
    font-size: 14px;
    padding: 13px 10px;
  }

  /* ── Dungeon — griglia piani: 3 colonne (bottoni più ampi) ── */
  .floor-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .floor-btn  { font-size: 13px; padding: 10px 4px; min-height: 52px; }
  .floor-stars { font-size: 10px; margin-top: 2px; }

  /* ── Combat ── */
  #combat { padding: 10px; gap: 8px; }
  #combat-enemies { min-height: 120px; gap: 8px; }
  .enemy-card { padding: 8px 6px; max-width: 130px; }
  .enemy-art  { width: 64px; height: 64px; font-size: 46px; }
  .enemy-name { font-size: 12px; }
  #combat-log {
    flex: 0 0 72px;
    font-size: 12px;
    padding: 6px 8px;
  }
  #combat-player { padding: 10px; }
  .player-bar-val { font-size: 12px; min-width: 58px; }

  /* ── Skill bar — bottoni grandi, facili da premere ── */
  #skill-bar { gap: 6px; padding: 6px 4px; }
  .skill-btn  { flex: 0 0 66px; height: 66px; }
  .skill-ico  { font-size: 26px; }
  .skill-name { font-size: 10px; }
  .skill-mp   { font-size: 10px; }

  /* ── Inventario / item ── */
  .item-row  { min-height: 58px; padding: 10px 12px; }
  .item-name { font-size: 14px; }
  .item-ico  { font-size: 28px; }

  /* ── Modali ── */
  .modal-box   { padding: 18px 14px; }
  .modal-title { font-size: 17px; }

  /* ── Tab bar (principale) ── */
  .tab-bar { gap: 3px; }
  .tab-btn {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 44px;
  }

  /* ── Sub-tab (gilda, arena, rune, ecc.) ── */
  .sub-tab-btn {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 44px;
  }

  /* ── Input, select ── */
  input, select, textarea {
    font-size: 16px;   /* ≥ 16px previene auto-zoom iOS su focus */
    padding: 12px 14px;
    min-height: 48px;
  }

  /* ── Forgia — slot potenziamento ── */
  .enh-slot-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* ── Rune equip grid ── */
  .rune-slot-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .rune-slot-btn  { min-height: 58px; font-size: 14px; }

  /* ── Shop items ── */
  .shop-item-row { min-height: 56px; padding: 12px; }

  /* ── Pulsanti icon-only ── */
  .btn-icon { width: 48px; height: 48px; font-size: 22px; }

  /* ── Stat pills (buff gilda, ecc.) ── */
  .stat-pill { font-size: 12px; padding: 4px 9px; }

  /* ── Arena card ── */
  .arcard { padding: 12px; }

  /* ── Floor result stars ── */
  .floor-star-result { font-size: 32px; gap: 6px; }

  /* ── Testo secondario / descrizioni ── */
  .item-desc, .skill-desc, .card-desc {
    font-size: 12px;
    line-height: 1.4;
  }

  /* ── Hero — sezione portrait + nome ── */
  #hportrait { width: 64px; height: 64px; font-size: 46px; }

  /* ── Endless — card risultato ── */
  .endless-summary { padding: 14px 12px; }
}

/* ══════════════════════════════════════════════════════════════════════
   MOBILE MEDIO — 481–640px  (phone grande / phablet)
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 481px) and (max-width: 640px) {
  html, body { font-size: 15px; }
  .floor-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .floor-btn  { min-height: 48px; }
  .btn-primary, .btn-secondary { min-height: 46px; }
  .action-btn { min-height: 46px; }
  input, select, textarea { font-size: 16px; }
  .skill-btn  { flex: 0 0 62px; height: 62px; }
  .tab-btn, .sub-tab-btn { min-height: 42px; font-size: 13px; }
  .item-row   { min-height: 54px; }
  .stat-btn   { width: 34px; height: 34px; }
}
