/* ============================================
   BRAWL PICK - STYLE
   Dark theme + orange accents
   ============================================ */

:root {
  --bg:           #0a0a0d;
  --bg-card:      #15151c;
  --bg-elevated: #1d1d27;
  --bg-hover:    #25252f;
  --orange:       #ff7a00;
  --orange-dark:  #cc5f00;
  --orange-glow:  rgba(255,122,0,0.35);
  --text:         #ffffff;
  --text-dim:     #a4a4b0;
  --text-mute:    #6a6a78;
  --border:       #2a2a35;
  --red:          #ff4d4d;
  --yellow:       #ffd84d;
  --orange-mid:   #ff944d;
  --green:        #4dd97a;
  --blue:         #4d8eff;
  --radius:       12px;
  --radius-sm:    8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px; /* space for bottom nav */
}

/* ============== HEADER ============== */
.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.logo {
  width: 42px;
  height: 42px;
  position: relative;
  flex-shrink: 0;
}
.logo svg { width: 100%; height: 100%; }
.app-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.app-title .accent { color: var(--orange); }
.app-subtitle {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
}

/* ============== PAGES ============== */
.page { display: none; padding: 16px 14px; }
.page.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  margin: 18px 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  background: var(--orange);
  border-radius: 2px;
}

/* ============== HOME PAGE ============== */
.player-search {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--orange); }
.btn {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.1s, background 0.15s;
}
.btn:hover { background: var(--orange-dark); }
.btn:active { transform: scale(0.97); }
.btn.secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--bg-hover); }
.btn.danger { background: #c0392b; }
.btn.danger:hover { background: #962d22; }

.profile-card {
  background: linear-gradient(135deg, #1c1c26 0%, #15151c 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.profile-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle, var(--orange-glow) 0%, transparent 70%);
  pointer-events: none;
}
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head-info { flex: 1; min-width: 0; }
.profile-avatar {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange) 0%, #ff4d00 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
  border: 3px solid #1d1d27;
  box-shadow: 0 0 20px var(--orange-glow);
}
.profile-name { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-tag { color: var(--text-mute); font-size: 13px; margin-top: 2px; }
.profile-club { font-size: 12px; color: var(--orange); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.stat {
  background: var(--bg-elevated);
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border);
}
.stat-val { font-size: 16px; font-weight: 800; color: var(--green); line-height: 1.2; }
.stat-lbl { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px; }

/* Sub-stats pills */
.profile-sub-stats { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sub-stat-pill {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px; font-size: 12px; color: var(--text-dim);
  font-weight: 600;
}

/* Rang classé bloc */
.profile-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-mute); margin: 14px 0 6px;
}
.profile-ranked-block {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.ranked-current { flex: 0 0 auto; }
.ranked-name { font-size: 18px; font-weight: 800; }
.ranked-elo { font-size: 12px; color: var(--orange); font-weight: 700; margin-top: 3px; }
.ranked-records { flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.profile-record { text-align: right; }
.rec-label { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; }
.rec-elo { font-size: 11px; color: var(--text-mute); }

/* Victoires */
.profile-victories-row { display: flex; gap: 8px; margin-bottom: 4px; }
.victory-chip {
  flex: 1; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 4px; text-align: center;
}
.vic-val { font-size: 15px; font-weight: 800; color: var(--green); }
.vic-lbl { font-size: 10px; color: var(--text-mute); text-transform: uppercase; margin-top: 2px; }

/* Avatar avec image */
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Top brawlers */
.top-brawler-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); padding: 10px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}

.fav-list {
  display: flex; flex-direction: column;
  gap: 8px;
}
.fav-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.fav-portrait {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 2px solid var(--orange);
}
.fav-info { flex: 1; }
.fav-name { font-weight: 700; font-size: 15px; }
.fav-meta { font-size: 12px; color: var(--text-mute); }
.fav-winrate { font-weight: 800; color: var(--green); }

/* ============== RANKED PAGE ============== */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mute);
  margin-bottom: 4px;
  display: block;
}
.select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ff7a00' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.select:focus { border-color: var(--orange); }

.side-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.side-toggle button {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}
.side-toggle button.active.blue { background: var(--blue); color: #fff; }
.side-toggle button.active.red  { background: var(--red);  color: #fff; }

/* Comp recommendations */
.comp-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.comp-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.comp-title .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.comp-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-items: start;
}
.comp-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.comp-card.score-very-high { border-color: var(--green); box-shadow: 0 0 10px rgba(77,217,122,0.15); }
.comp-card.score-high      { border-color: var(--orange-mid); }
.comp-card.score-mid       { border-color: var(--yellow); }
.comp-card.score-low       { border-color: var(--red); opacity: 0.7; }
.comp-portrait {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--bg-card);
  margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  border: 2px solid var(--orange);
}
.comp-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.comp-score-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* Draft area */
.draft-zone {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.draft-row { margin-bottom: 14px; }
.draft-row:last-child { margin-bottom: 0; }
.draft-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.draft-row-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.draft-row-title.bans  { color: var(--red); }
.draft-row-title.allies { color: var(--blue); }
.draft-row-title.enemies { color: var(--red); }
.slot-count {
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 600;
}
.slot-row {
  display: flex;
  gap: 8px;
}
.slot {
  flex: 1;
  max-width: 64px;
  min-height: 64px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 2px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--text-mute);
  position: relative;
  font-weight: 600;
  overflow: hidden;
}
.slot.filled {
  border-style: solid;
  background: var(--bg-card);
  padding: 5px 3px 3px;
  gap: 3px;
}
.slot.filled.ban   { border-color: var(--red);   background: rgba(255,77,77,0.08);  opacity: 0.75; }
.slot.filled.ally  { border-color: var(--blue);  background: rgba(77,142,255,0.10); }
.slot.filled.enemy { border-color: var(--red);   background: rgba(255,77,77,0.10);  }
.slot-portrait {
  width: 42px; height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.slot-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ban-portrait   { border-color: rgba(255,77,77,0.5); filter: grayscale(40%); }
.ally-portrait  { border-color: rgba(77,142,255,0.6); }
.enemy-portrait { border-color: rgba(255,77,77,0.6); }
.slot-name {
  font-size: 8.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 58px;
  text-align: center;
  color: var(--text-dim);
}
.slot.filled.ban .slot-name { color: var(--red); opacity: 0.8; }
.slot.filled.ally .slot-name { color: #7ab4ff; }
.slot.filled.enemy .slot-name { color: #ff8888; }
.slot.next {
  border-color: var(--orange);
  animation: nextPulse 1.4s ease-in-out infinite;
}
@keyframes nextPulse {
  0%,100% { box-shadow: 0 0 0 0 var(--orange-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}
.slot.next {
  border-color: var(--orange);
  animation: nextPulse 1.4s ease-in-out infinite;
}
@keyframes nextPulse {
  0%,100% { box-shadow: 0 0 0 0 var(--orange-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.draft-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.draft-controls .btn { flex: 1; }

.phase-banner {
  background: linear-gradient(90deg, var(--orange), var(--orange-dark));
  color: #fff;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.5px;
}
.phase-banner.bans { background: linear-gradient(90deg, #c0392b, #962d22); }

/* ============== BRAWLER GRID ============== */
.brawler-tools {
  display: flex;
  gap: 8px;
  margin: 12px 0 10px;
}
.brawler-tools .input { flex: 2; }
.brawler-tools .select { flex: 1; }
.brawler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.brawler-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 4px 6px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
  position: relative;
}
.brawler-tile:hover { background: var(--bg-hover); border-color: var(--orange); transform: translateY(-2px); }
.brawler-tile.unavailable {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(80%);
}
.brawler-tile.preferred::after {
  content: "★";
  position: absolute;
  top: 4px; right: 6px;
  color: var(--orange);
  font-size: 12px;
}
.brawler-portrait {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  border: 2px solid var(--border);
  margin: 0 auto 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.brawler-tile-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.score-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
}
.score-very-high { color: var(--green); }
.score-high      { color: var(--orange-mid); }
.score-mid       { color: var(--yellow); }
.score-low       { color: var(--red); }

/* ============== MAPS PAGE ============== */
.mode-section { margin-bottom: 22px; }
.mode-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.mode-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.mode-name {
  font-size: 16px;
  font-weight: 800;
}
.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.map-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.map-card:hover { border-color: var(--orange); transform: translateY(-2px); }
.map-card-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.map-card-type {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.map-card-type.open   { color: #f1c40f; }
.map-card-type.closed { color: #9b59b6; }
.map-card-type.mixed  { color: #4d8eff; }

/* ============== BOTTOM NAV ============== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding: 8px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}
.nav-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-mute);
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.nav-btn .nav-icon { font-size: 22px; line-height: 1; }
.nav-btn.active {
  color: var(--orange);
  background: rgba(255,122,0,0.1);
}

/* ============== BRAWLER IMAGES ============== */
.brawler-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.emoji-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
}
.fav-portrait, .comp-portrait, .upgrade-portrait, .tip-portrait, .brawler-portrait {
  overflow: hidden;
}
.fav-portrait img, .comp-portrait img, .upgrade-portrait img,
.tip-portrait img, .brawler-portrait img {
  background: var(--bg-elevated);
}

/* ============== MAP IMAGES ============== */
.map-img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  background: var(--bg-elevated);
}
.map-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.map-card.with-img {
  padding: 0;
  overflow: hidden;
}
.map-card.with-img .map-img-wrap {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #0d0d12;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-card.with-img .map-img-wrap .map-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.map-card.with-img .map-info {
  padding: 8px 10px;
}

/* Compo card "locked" (allié déjà pické) */
.comp-card.locked {
  background: linear-gradient(135deg, rgba(77,142,255,0.18), var(--bg-elevated));
  border-color: var(--blue) !important;
}
/* Compo card cliquable (Push tab) */
.comp-card.clickable {
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.comp-card.clickable:hover {
  transform: translateY(-2px);
}
.comp-card.selected {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 2px var(--orange-glow), 0 0 14px var(--orange-glow);
  background: linear-gradient(135deg, rgba(255,122,0,0.18), var(--bg-elevated));
}
.comp-card.selected::before {
  content: "📌";
  position: absolute;
  top: -8px; right: -6px;
  background: var(--orange);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  z-index: 2;
}
.comp-card { position: relative; }

/* ============== MAP DETAIL ============== */
.map-detail-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.map-detail-img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  display: block;
  background: #0d0d12;
}
.map-detail-info {
  padding: 12px 14px;
}
.map-detail-name { font-size: 18px; font-weight: 800; }
.map-detail-meta { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}
.back-btn:hover { background: var(--bg-hover); }

/* ============== TIER LIST ============== */
.tier-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 8px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.tier-label {
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.tier-A .tier-label { background: linear-gradient(135deg, #4dd97a, #2ecc71); color: #1a1a1f; }
.tier-B .tier-label { background: linear-gradient(135deg, #ffd84d, #f1b500); color: #1a1a1f; }
.tier-C .tier-label { background: linear-gradient(135deg, #ff944d, #e67e22); }
.tier-D .tier-label { background: linear-gradient(135deg, #ff3030, #c0392b); }
.tier-content {
  flex: 1;
  padding: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tier-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.tier-pill .pill-icon { font-size: 14px; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.tier-pill .pill-icon img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.tier-pill-lvl {
  font-size: 9px; font-weight: 800;
  background: var(--orange); color: #fff;
  padding: 1px 5px; border-radius: 999px;
  margin-left: 2px;
}

/* ============== UPGRADE RECOS ============== */
.upgrade-list { display: flex; flex-direction: column; gap: 8px; }
.upgrade-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.upgrade-card.priority-high { border-left: 4px solid var(--red); }
.upgrade-card.priority-mid  { border-left: 4px solid var(--orange); }
.upgrade-card.priority-low  { border-left: 4px solid var(--yellow); }
.upgrade-portrait {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 2px solid var(--orange);
  flex-shrink: 0;
}
.upgrade-info { flex: 1; min-width: 0; }
.upgrade-name { font-weight: 700; font-size: 14px; }
.upgrade-meta { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.upgrade-tier {
  display: inline-block;
  font-size: 10px; font-weight: 800;
  padding: 1px 6px; border-radius: 4px;
  margin-right: 6px;
}
.upgrade-tier.tier-A { background: #4dd97a; color: #1a1a1f; }
.upgrade-tier.tier-B { background: #ffd84d; color: #1a1a1f; }
.upgrade-tier.tier-C { background: #ff944d; color: #fff; }
.upgrade-tier.tier-D { background: #ff3030; color: #fff; }
.upgrade-gain {
  font-weight: 800;
  color: var(--green);
  font-size: 14px;
  white-space: nowrap;
}

/* ============== POWER LEVEL BADGE ============== */
.power-badge {
  position: absolute;
  top: 4px; left: 6px;
  background: var(--bg);
  border: 1.5px solid var(--orange);
  border-radius: 999px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 800;
  color: var(--orange);
  line-height: 1.2;
  z-index: 2;
}
.power-badge.p11 { background: var(--orange); color: #fff; border-color: var(--orange); }
.power-badge.unowned { border-color: var(--text-mute); color: var(--text-mute); background: var(--bg); }

/* ============== TACTICAL TIPS ============== */
.tip-card {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--orange);
  margin-bottom: 8px;
}
.tip-card:last-child { margin-bottom: 0; }
.tip-portrait {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  border: 2px solid var(--blue);
  flex-shrink: 0;
}
.tip-content { flex: 1; min-width: 0; }
.tip-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.tip-text { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.tip-text .counter-target { color: var(--green); font-weight: 600; }
.tip-text .danger-target  { color: var(--red);   font-weight: 600; }

/* ============== MODE FILTER BUTTONS (Ranked page) ============== */
.mode-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.mode-filter-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-filter-btn img {
  width: 18px; height: 18px;
  object-fit: contain;
  border-radius: 4px;
}
.mode-filter-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.mode-filter-btn:hover:not(.active) { border-color: var(--orange); color: var(--text); }

/* ============== RANK BADGE ICON ============== */
.rank-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px;
  vertical-align: middle;
  margin-right: 4px;
}

/* ============== BRAWLER DETAIL VIEW ============== */
.clickable-detail { cursor: pointer; }
.clickable-detail:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,122,0,0.15); }
.tier-pill.clickable-detail:hover { border-color: var(--orange); }

.brawler-detail-header {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.brawler-detail-portrait {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--orange);
  overflow: hidden;
  flex-shrink: 0;
}
.brawler-detail-portrait img { width: 100%; height: 100%; object-fit: cover; }
.brawler-detail-name { font-size: 22px; font-weight: 900; }
.detail-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.detail-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 8px;
  margin-top: 4px;
}
.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.detail-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}
.detail-stat-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}
.detail-stat-val.p11 { color: var(--orange); }
.detail-stat-lbl {
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.counter-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.counter-chip.good { background: rgba(77,217,122,0.12); color: var(--green); border: 1px solid rgba(77,217,122,0.3); }
.counter-chip.bad  { background: rgba(255,77,77,0.12); color: var(--red); border: 1px solid rgba(255,77,77,0.3); }
.tip-text-block {
  background: var(--bg-elevated);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ============== BRAWLIFY DETAIL ============== */
.brawlify-loading { color: var(--text-mute); font-size: 13px; padding: 8px 0; }
.rarity-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.brawlify-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: 0 0 12px; }
.ability-group { margin-bottom: 12px; }
.ability-group-title { font-size: 12px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.ability-item { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; background: var(--bg-elevated); border-radius: 10px; padding: 8px 10px; }
.ability-img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; flex-shrink: 0; }
.ability-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.ability-desc { font-size: 11px; color: var(--text-mute); line-height: 1.4; }

/* ============== EVENT ROTATION ============== */
.event-rotation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.event-card { background: var(--bg-card); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.event-card.active { border-color: var(--orange); }
.event-map-img { width: 100%; height: 80px; object-fit: cover; display: block; }
.event-info { padding: 8px 10px 10px; }
.event-mode { font-size: 11px; font-weight: 700; margin-bottom: 2px; }
.event-map-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.event-time { font-size: 11px; color: var(--text-mute); }
.event-time.active { color: var(--orange); font-weight: 700; }

/* ============== HELPERS ============== */
.empty-state {
  text-align: center;
  padding: 30px 14px;
  color: var(--text-mute);
  font-size: 14px;
}
.hidden { display: none !important; }

/* ============== RESPONSIVE ============== */
/* Mobile first — tout ce qui précède est déjà mobile */
@media (max-width: 380px) {
  .profile-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-val { font-size: 14px; }
  .stat-val-rank { font-size: 12px; }
  .app-title { font-size: 17px; }
  .brawler-card { min-width: 70px; }
}

@media (min-width: 768px) {
  body { max-width: 880px; margin: 0 auto; box-shadow: 0 0 60px rgba(0,0,0,0.6); min-height: 100vh; }
  .bottom-nav { max-width: 880px; left: 50%; transform: translateX(-50%); }
  .brawler-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .profile-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stat-val { font-size: 20px; }
  .stat-val-rank { font-size: 15px; }
}
