:root {
  --bg: #0b0d12;
  --card: #151924;
  --card-border: #262c3b;
  --text: #e8e6e3;
  --muted: #9aa3b5;
  --gold: #f0c674;
  --horde: #b30000;
  --alliance: #0070dd;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1c2130 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  padding: 0 16px 48px;
}

.site-header { text-align: center; padding: 48px 0 32px; }
.site-header h1 {
  font-family: Cinzel, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0;
  color: var(--gold);
  letter-spacing: .04em;
  text-shadow: 0 2px 12px rgba(240, 198, 116, .25);
}
.subtitle { color: var(--muted); margin: 8px 0 0; }
.subtitle strong { color: var(--text); }

.toolbar {
  max-width: 1320px;
  margin: 0 auto 20px;
  display: flex;
  justify-content: flex-end;
}
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}
.view-toggle button {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
}
.view-toggle button.active { background: var(--gold); color: #1a1507; }

/* Vue liste */
.list { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1.2fr) minmax(0, .9fr) 70px 50px 70px 80px minmax(0, 1.6fr) minmax(0, 1.3fr) 100px;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: border-color .2s ease, transform .2s ease;
}
.row:hover, .row:focus-visible { border-color: var(--gold); transform: translateX(4px); outline: none; }
.row.head {
  background: none; border: 0; padding: 4px 16px;
  color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
}
.row.head:hover { transform: none; }
.row .avatar-sm { width: 56px; height: 56px; border-radius: 10px; border: 2px solid var(--card-border); object-fit: cover; }
.row .name { font-family: Cinzel, serif; font-weight: 700; font-size: 1.05rem; }
.row .name small { display: block; font-family: Inter, sans-serif; font-weight: 500; color: var(--gold); font-size: .72rem; }
.row .num { text-align: center; font-weight: 600; }
.row > * { min-width: 0; }
.row .rc { display: flex; flex-direction: column; line-height: 1.3; }
.row .rc .spec { color: var(--muted); font-size: .8rem; margin: 0; display: block; }
.row .cta { text-align: right; }
.row .cta { color: var(--gold); font-weight: 600; font-size: .8rem; white-space: nowrap; }
.row.error { color: var(--muted); }
@media (max-width: 900px) {
  .row { grid-template-columns: 48px 1fr auto; }
  .row .hide-sm, .row.head { display: none; }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1320px;
  margin: 0 auto;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--gold);
  outline: none;
}

.card-hero {
  position: relative;
  height: 420px;
  background-size: cover;
  background-position: center top;
}
.card-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(21, 25, 36, 0) 40%, var(--card) 100%);
}
.card-hero img.render {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 100%;
  max-width: none;
  transform: translateX(-50%);
  z-index: 1;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6));
}
.card-hero img.avatar {
  position: absolute;
  left: 50%; top: 50%;
  width: 120px; height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid var(--gold);
  z-index: 1;
}

.level-badge {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, .65);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: Cinzel, serif;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .9rem;
}
.faction-badge {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
}
.rank {
  position: absolute;
  bottom: 10px; left: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, .6);
  color: var(--gold);
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}
.subtitle a { color: var(--gold); text-decoration: none; }
.subtitle a:hover { text-decoration: underline; }
.faction-horde { background: var(--horde); }
.faction-alliance { background: var(--alliance); }

.card-body { padding: 18px 20px 20px; position: relative; z-index: 2; }
.card-name {
  font-family: Cinzel, serif;
  font-size: 1.35rem;
  margin: 0;
}
.card-name small { font-family: Inter, sans-serif; color: var(--muted); font-size: .85rem; font-weight: 500; margin-left: 6px; }
.card-class { margin: 4px 0 14px; font-weight: 500; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0 0 14px;
}
.stat {
  background: rgba(255, 255, 255, .04);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.stat .label { display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-weight: 600; font-size: 1.05rem; }
.stat .sub { display: block; color: var(--gold); font-size: .72rem; }
.muted { color: var(--muted) !important; }
.pos {
  position: absolute; bottom: 10px; right: 12px; z-index: 2;
  font-family: Cinzel, serif; font-weight: 700; font-size: 1.1rem; color: var(--gold);
  background: rgba(0, 0, 0, .6); padding: 2px 10px; border-radius: 999px;
}
.pos-cell { display: flex; align-items: center; gap: 8px; }
.pos-cell .pos { position: static; font-size: .9rem; padding: 2px 6px; background: none; }
.row .num small { display: block; color: var(--gold); font-size: .68rem; font-weight: 500; }
[title] { cursor: help; }
.card[title], .row[title] { cursor: pointer; }

.spec { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: .9rem; }
.spec img { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--card-border); }

.prof-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prof-title { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.none { color: var(--muted); font-size: .8rem; }
.profs { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.profs li { display: flex; align-items: center; gap: 7px; min-width: 0; }
.profs img, .profs .noicon { width: 24px; height: 24px; border-radius: 5px; border: 1px solid var(--card-border); flex: 0 0 auto; }
.prof-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prof-name { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar {
  position: relative;
  height: 14px;
  border-radius: 3px;
  background: #0d1017;
  border: 1px solid #2a3042;
  overflow: hidden;
}
.bar .fill {
  position: absolute; inset: 0; width: 0;
  background: linear-gradient(to bottom, #3b8be0, #1f5fb3);
  transition: width .4s ease;
}
.bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .66rem; font-weight: 600; color: #fff; text-shadow: 0 1px 2px #000;
  letter-spacing: .02em;
}
.prof-cols > div { min-width: 0; }

.card-footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  color: var(--muted);
}
.card-footer .cta { color: var(--gold); font-weight: 600; }

.card.error .card-hero { background: linear-gradient(135deg, #1d2130, #10131b); }
.card.error .card-body { text-align: center; }
.card.error .msg { color: var(--muted); margin: 10px 0 0; }

.site-footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 40px; }

/* Couleurs de classe WoW */
.class-warrior { color: #c69b6d; }
.class-paladin { color: #f48cba; }
.class-hunter { color: #aad372; }
.class-rogue { color: #fff468; }
.class-priest { color: #ffffff; }
.class-shaman { color: #0070dd; }
.class-mage { color: #3fc7eb; }
.class-warlock { color: #8788ee; }
.class-druid { color: #ff7c0a; }
