:root {
  --red:          #E3350D;
  --red-dark:     #B02A0A;
  --red-light:    #FFF0EC;
  --cream:        #F7F2EB;
  --dark:         #151515;
  --muted:        #8A8A8A;
  --border:       #E4DDD4;
  --card-bg:      #FFFFFF;
  --accept:       #2D9B6A;
  --accept-light: #EAF6F0;
  --bg:           #F7F2EB;
  --text:         #151515;
}

[data-theme="dark"] {
  --cream:        #1A1A1A;
  --bg:           #1A1A1A;
  --dark:         #F0EBE3;
  --text:         #F0EBE3;
  --muted:        #888888;
  --border:       #2E2E2E;
  --card-bg:      #242424;
  --red-light:    #2A1510;
  --accept-light: #0E2A1C;
}

/* Overlay hors-ligne */
.offline-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  text-align: center;
  padding: 2rem;
}
.offline-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}
.offline-overlay-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.offline-overlay-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text);
}
.offline-overlay-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Space Mono', monospace;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  letter-spacing: -1px;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.theme-toggle:hover { transform: scale(1.1); border-color: var(--dark); }

.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  max-width: 780px;
  padding: 3rem 1.5rem calc(4rem + 58px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.35s ease-out forwards;
}

@media (max-width: 500px) { .screen { padding: 2rem 0.75rem calc(2rem + 58px); } }

.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

#screen-intro { text-align: center; gap: 1.5rem; }

.logo {
  font-size: clamp(1.8rem, 8vw, 6.5rem);
  line-height: 1;
  letter-spacing: -3px;
  color: var(--text);
  letter-spacing: clamp(-1px, -0.5vw, -3px);
  display: inline-block;
}

.logo::after {
  content: '';
  display: block;
  width: 2.2ch;
  height: 5px;
  background: var(--red);
  border-radius: 2px;
  margin: 0.3rem auto 0;
}

.intro-tagline {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.8;
  max-width: 320px;
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--card-bg);
  border-top: 1.5px solid var(--border);
  display: flex;
  height: 58px;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.52rem;
  padding: 0;
  transition: color 0.15s;
  letter-spacing: 0;
}

.nav-tab svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-tab--active { color: var(--red); }

.nav-tab--locked {
  opacity: 0.4;
  cursor: pointer;
}

.btn-primary {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  padding: 1rem 2.8rem;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(227,53,13,0.28);
}

.btn-primary:hover  { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(227,53,13,0.38); }
.btn-primary:active { transform: scale(0.97); box-shadow: none; }

.btn-secondary {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.btn-secondary:hover { color: var(--text); }

.header-top { width: 100%; text-align: center; margin-bottom: 2.5rem; }

.date-label {
  font-size: 0.7rem;
  color: var(--red);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.header-top h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.header-sub { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }

.grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

@media (max-width: 500px) { .grid-2x2 { gap: 0.6rem; } }

.poke-card {
  background: var(--card-bg);
  border-radius: 24px;
  border: 2px solid var(--border);
  padding: 2rem 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.3s;
  position: relative;
  overflow: hidden;
  user-select: none;
}

@media (max-width: 500px) { .poke-card { padding: 1rem 0.5rem 0.8rem; border-radius: 16px; } }

.poke-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,0.09); border-color: var(--text); }
.poke-card.selected { border-color: var(--accept); background: var(--accept-light); }
.poke-card.selected::after { content: '✓'; position: absolute; top: 12px; right: 16px; font-size: 1.2rem; color: var(--accept); }
.poke-card.selected--loading::after { content: ''; width: 14px; height: 14px; border: 2px solid var(--accept); border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; top: 14px; right: 14px; }

.poke-card .ripple {
  position: absolute; border-radius: 50%;
  background: rgba(0,0,0,0.07); transform: scale(0);
  animation: ripple-anim 0.5s linear; pointer-events: none;
}

@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

.poke-img-wrap { width: 110px; height: 110px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; position: relative; }
@media (max-width: 500px) { .poke-img-wrap { width: 72px; height: 72px; margin-bottom: 0.5rem; } }

.poke-img-wrap img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s; }
.poke-card:hover .poke-img-wrap img { transform: scale(1.1) translateY(-4px); }

.poke-number { font-size: 0.68rem; color: var(--muted); letter-spacing: 1px; margin-bottom: 0.3rem; }

.poke-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.15rem;
  text-transform: capitalize;
  text-align: center;
  word-break: break-word;
}

.poke-form {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  text-transform: capitalize;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

@media (max-width: 500px) {
  .poke-number { font-size: 0.55rem; margin-bottom: 0.2rem; }
  .poke-name   { font-size: 0.82rem; margin-bottom: 0.4rem; }
}

.type-badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }

.type-badge {
  font-size: 0.62rem; padding: 3px 10px; border-radius: 100px;
  background: var(--dark); color: var(--cream);
  text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px;
}

@media (max-width: 500px) { .type-badge { font-size: 0.52rem; padding: 2px 7px; } }

.type-feu      { background: #FF6B35; color: #fff; }
.type-eau      { background: #4A9EFF; color: #fff; }
.type-plante   { background: #56C450; color: #fff; }
.type-électrik { background: #F4D03F; color: #333; }
.type-glace    { background: #74D7EC; color: #333; }
.type-psy      { background: #FF8FA3; color: #fff; }
.type-dragon   { background: #7463D8; color: #fff; }
.type-ténèbres { background: #3D2B1F; color: #fff; }
.type-fée      { background: #F9A8C9; color: #333; }
.type-combat   { background: #CC4A1A; color: #fff; }
.type-poison   { background: #9B59B6; color: #fff; }
.type-sol      { background: #D4B483; color: #333; }
.type-vol      { background: #8EA8C3; color: #fff; }
.type-insecte  { background: #7DB840; color: #fff; }
.type-roche    { background: #B0A080; color: #fff; }
.type-spectre  { background: #6558A0; color: #fff; }
.type-acier    { background: #8FA3B8; color: #fff; }
.type-normal   { background: #A8A878; color: #fff; }

.loader {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 3rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

#screen-voted { text-align: center; gap: 1.5rem; }

.voted-icon {
  width: 80px; height: 80px;
  background: var(--accept-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; margin: 0 auto;
}

.voted-pokemon-info {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.voted-pokemon-info strong {
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  text-transform: capitalize;
  display: block;
  margin-top: 0.3rem;
}

.voted-rank {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  min-height: 1.2em;
  text-align: center;
}
.voted-rank strong { color: var(--text); font-size: 0.95rem; }

.voted-msg { text-align: center; color: var(--muted); font-size: 0.83rem; max-width: 300px; line-height: 1.7; }

.voted-countdown {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  min-height: 1.2em;
}

.voted-lineup-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-top: 0.5rem;
}

.voted-lineup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
  max-width: 320px;
}

.lineup-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 0.6rem 0.6rem;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}

.lineup-item--voted {
  border-color: var(--accept);
  background: var(--accept-light);
  opacity: 1;
  transform: translateY(-3px);
}

.lineup-item img { width: 56px; height: 56px; object-fit: contain; }

.lineup-item span {
  font-size: 0.65rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  text-transform: capitalize;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
}
.voted-lineup:has(.lineup-item--realtime) { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }

.lineup-item--realtime {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  opacity: 1;
}
.lineup-item--realtime img { width: 44px; height: 44px; flex-shrink: 0; object-fit: contain; }
.lineup-rt-rank { font-size: 1rem; width: 1.6rem; text-align: center; flex-shrink: 0; }
.lineup-rt-info { display: flex; flex-direction: column; flex: 1; gap: 0.15rem; min-width: 0; }
.lineup-rt-name { font-size: 0.75rem; font-family: 'Syne', sans-serif; font-weight: 700; text-transform: capitalize; }
.lineup-rt-form { font-size: 0.65rem; font-family: 'Space Mono', monospace; font-weight: 400; color: var(--muted); }
.lineup-form { font-size: 0.55rem; font-family: 'Space Mono', monospace; color: var(--muted); text-align: center; text-transform: capitalize; line-height: 1.2; word-break: break-word; }
.lineup-rt-bar-bg { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; }
.lineup-rt-bar { height: 100%; background: var(--accent, #e63946); border-radius: 4px; transition: width 0.4s ease; }
.lineup-rt-meta { font-size: 0.65rem; font-family: 'Space Mono', monospace; color: var(--muted); }

.lineup-friend-count {
  font-size: 0.58rem;
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  opacity: 0.85;
}
.lineup-friend-names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
}
.lineup-friend-chip {
  font-size: 0.6rem;
  font-family: 'Space Mono', monospace;
  color: var(--muted);
  background: var(--surface2);
  border-radius: 100px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}
.lineup-friend-chip--more {
  opacity: 0.6;
}
.result-friend-section { margin-top: 0.2rem; }
.result-friend-toggle {
  font-size: 0.7rem;
  font-family: 'Space Mono', monospace;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.result-friend-toggle::after { content: ' ▾'; }
.result-friend-toggle--open::after { content: ' ▴'; }
.result-friend-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0;
  margin-left: 4em;
  padding-left: 0.6rem;
  border-left: 2px solid var(--border);
}
.result-friend-list[hidden] { display: none; }
.result-friend-name {
  font-size: 0.7rem;
  font-family: 'Space Mono', monospace;
  color: var(--muted);
}
.result-friend-count {
  font-size: 0.7rem;
  font-family: 'Space Mono', monospace;
  color: var(--muted);
}

.winner-card {
  width: 100%; background: var(--accept-light);
  border: 2px solid var(--accept); border-radius: 24px;
  padding: 2rem; text-align: center; margin-bottom: 2rem;
}

.winner-label { font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase; color: var(--accept); font-weight: 700; margin-bottom: 0.5rem; }

.winner-name {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  font-weight: 800; color: var(--accept);
  text-transform: capitalize; word-break: break-word; text-align: center;
}

.winner-pokedex { font-size: 0.7rem; color: var(--accept); opacity: 0.7; font-family: 'Space Mono', monospace; margin-top: 0.15rem; }
.winner-types   { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 0.6rem 0 0.2rem; }
.winner-pct     { font-size: 0.9rem; color: var(--muted); margin-top: 0.3rem; }
.winner-total   { font-size: 0.72rem; color: var(--muted); margin-top: 0.5rem; opacity: 0.7; }

.tie-card { width: 100%; background: var(--card-bg); border: 2px solid var(--border); border-radius: 24px; padding: 2rem; text-align: center; margin-bottom: 2rem; }
.tie-label { font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 800; margin-bottom: 0.5rem; }
.tie-sub { font-size: 0.82rem; color: var(--muted); }

.results-list { width: 100%; display: flex; flex-direction: column; gap: 0.75rem; }

.result-row {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 0.75rem 1rem;
}

.result-rank { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--border); width: 22px; flex-shrink: 0; text-align: center; }
.result-rank.first { color: #F0B429; }
.result-sprite { width: 48px; height: 48px; flex-shrink: 0; object-fit: contain; }
.result-info { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.result-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.result-name { font-family: 'Syne', sans-serif; font-size: 0.88rem; font-weight: 700; text-transform: capitalize; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-pct-value { font-size: 0.88rem; font-weight: 700; color: var(--text); flex-shrink: 0; }
.result-bar-bg { width: 100%; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.result-bar-fill { height: 100%; background: var(--text); border-radius: 3px; width: 0%; transition: width 1.2s cubic-bezier(0.22,1,0.36,1); }
.result-bar-fill.first { background: var(--accept); }
.result-meta { font-size: 0.7rem; font-family: 'Space Mono', monospace; color: var(--muted); }

.personal-msg {
  margin-top: 1.5rem; padding: 1.2rem 1.5rem;
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 16px; font-size: 0.82rem; text-align: center;
  width: 100%; line-height: 1.7; color: var(--muted);
}

.personal-msg strong { color: var(--text); text-transform: capitalize; }


#screen-archives { justify-content: flex-start; padding-top: 3rem; }
#screen-results  { justify-content: flex-start; padding-top: 3rem; }
#screen-compagnon { padding: 0; justify-content: flex-start; overflow: hidden; height: calc(100dvh - 58px); min-height: 0; }
#profile-tab-compagnon { width: 100%; flex: 1; min-height: 0; display: flex; flex-direction: column; }

.btn-back {
  align-self: flex-start;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
  transition: color 0.15s;
}
.btn-back:hover { color: var(--text); }

.archive-grid { display: flex; flex-direction: column; width: 100%; margin-bottom: 2rem; }

/* Calendrier archives */
.cal-month { width: 100%; margin-bottom: 2rem; }

.cal-month-header {
  font-size: 0.65rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.cal-day-header {
  text-align: center;
  font-size: 0.58rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--border);
  position: relative;
}

.cal-cell.cal-has-vote {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.cal-cell.cal-has-vote:hover {
  border-color: var(--text);
  transform: scale(1.12);
  box-shadow: 0 3px 10px rgba(0,0,0,0.09);
}

.cal-cell.cal-voted {
  background: var(--accept-light);
  border-color: var(--accept) !important;
  color: var(--accept);
}

/* Archive search */
.archive-search-wrap { width: 100%; margin-bottom: 1rem; }

.archive-search-input {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 0.6rem 1.2rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.archive-search-input:focus  { border-color: var(--text); }
.archive-search-input::placeholder { color: var(--muted); }

.search-result-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  width: 100%;
  box-sizing: border-box;
}
.search-result-sprite { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.search-result-info   { flex: 1; min-width: 0; }
.search-result-header { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.search-result-name   { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.92rem; color: var(--text); }
.search-result-count  { font-family: 'Space Mono', monospace; font-size: 0.62rem; color: var(--muted); }
.search-result-dates  { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.search-result-date {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: var(--text);
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.search-result-date:hover { border-color: var(--text); }
.search-result-more { font-size: 0.62rem; color: var(--muted); }

.results-date-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 1.5rem;
  gap: 0.5rem;
}

.date-nav-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--text);
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}
.date-nav-btn:hover { border-color: var(--text); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.07); }

/* Badges */
.profile-badges { padding: 0.75rem 0; }

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 60px;
}

.badge-img-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.badge-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  object-fit: contain;
  pointer-events: none;
}
.badge-item--locked .badge-ring { display: none; }

.badge-img {
  width: 35px;
  height: 35px;
  object-fit: contain;
  image-rendering: pixelated;
}

.badge-category { width: 100%; }
.badge-category + .badge-category { margin-top: 1.5rem; }

.badge-category-title {
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 1rem;
  margin-left: 1.5em;
}

.badge-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.badge-item--locked .badge-img { filter: grayscale(1); opacity: 0.35; }
.badge-item--locked .badge-label { opacity: 0.4; }

.badge-progress {
  font-family: 'Space Mono', monospace;
  font-size: 0.5rem;
  color: var(--muted);
  opacity: 0.6;
}

.badge-category-empty {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: var(--muted);
  opacity: 0.4;
  padding: 0 1.5em;
  margin: 0;
}

.badge-tier-bar {
  width: 48px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1px;
}

.badge-tier-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.badge-tooltip-popup {
  position: fixed;
  z-index: 600;
  display: none;
  background: var(--dark);
  color: var(--cream);
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  line-height: 1.5;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  max-width: 190px;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.btp-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}
.btp-desc { color: var(--muted); }
.btp-progress {
  margin-top: 0.25rem;
  color: var(--red);
  font-size: 0.62rem;
}

/* Streak */
.streak-display {
  align-items: center;
  gap: 0.5rem;
  background: var(--red-light);
  border: 1.5px solid var(--red);
  border-radius: 100px;
  padding: 0.45rem 1.2rem;
  opacity: 0;
}
.streak-fire  { font-size: 1rem; line-height: 1; }
.pierre-feu-icon { width: 1.1em; height: 1.1em; object-fit: contain; vertical-align: middle; display: inline-block; }
.pierre-feu-icon--streak { width: 1.2rem; height: 1.2rem; }
.streak-count { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1rem; color: var(--red); }
.streak-label   { font-size: 0.72rem; color: var(--muted); }
.streak-glacons { font-size: 0.72rem; color: var(--muted); }

/* Résultats enrichis */
.result-pokedex { font-size: 0.62rem; color: var(--muted); font-family: 'Space Mono', monospace; font-weight: 400; }
.result-type-row { display: flex; gap: 4px; flex-wrap: wrap; margin: 0.2rem 0; }
.result-type-row .type-badge { font-size: 0.52rem; padding: 2px 7px; }

/* Export / Import */
.btn-action {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--text);
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s;
  text-decoration: none;
  display: inline-block;
  flex-shrink: 0;
}
.btn-action:hover { border-color: var(--text); }

.btn-google {
  display: inline-flex;
  align-items: center;
  border-color: #4285F4;
  color: #4285F4;
}
.btn-google:hover { border-color: #1a73e8; color: #1a73e8; }

.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-discord {
  display: inline-flex;
  align-items: center;
  border-color: #5865F2;
  color: #5865F2;
}
.btn-discord:hover { border-color: #4752c4; color: #4752c4; }

.btn-auth-provider {
  width: 100%;
  justify-content: center;
}

.auth-or-divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0.75rem 0;
  position: relative;
}
.auth-or-divider::before,
.auth-or-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}
.auth-or-divider::before { left: 0; }
.auth-or-divider::after  { right: 0; }

.auth-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'Syne', sans-serif;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.auth-input:focus { outline: none; border-color: var(--red); }

.auth-email-form-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.auth-toggle-link {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 0.3rem 0 0;
}
.auth-toggle-link a {
  color: var(--red);
  text-decoration: none;
  cursor: pointer;
}
.auth-toggle-link a:hover { text-decoration: underline; }

.locked-feature-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.75rem;
}

.identity-provider-label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.identity-linked-badge {
  font-size: 0.7rem;
  color: var(--accept);
  font-family: 'Space Mono', monospace;
  white-space: nowrap;
}

.auth-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

/* Bouton partager */
.btn-share {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text);
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 0.55rem 1.3rem;
  cursor: pointer;
  margin: 1.5rem auto 0;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}
.btn-share:hover { border-color: var(--text); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.07); }

.btn-change-vote {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  background: transparent;
  border: none;
  cursor: pointer;
  margin: 0.6rem auto 0;
  padding: 0.3rem 0.5rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.btn-change-vote:hover { opacity: 1; }

#screen-stats { justify-content: flex-start; padding-top: 3rem; }

/* Onglets stats */
.stats-tabs {
  display: flex;
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 4px;
}

.stats-tab {
  flex: 1;
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem;
  border: none;
  background: none;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.stats-tab.active {
  background: var(--text);
  color: var(--card-bg);
}

.stats-tab.tab--locked {
  opacity: 0.45;
}

.locked-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  text-align: center;
  gap: 0.4rem;
}
.locked-feature-icon { font-size: 1.6rem; }
.locked-feature-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}
.locked-feature-perks {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.5rem 0;
  text-align: left;
}
.locked-feature-perk {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.locked-feature-msg {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 240px;
  line-height: 1.5;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
}

.stat-card--accent { border-color: var(--red); background: var(--red-light); }
.stat-card--full   { grid-column: 1 / -1; }
.stat-card--poke   { gap: 0.5rem; }

.stat-label    { font-size: 0.62rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat-value    { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-value-md { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub      { font-size: 0.7rem; color: var(--muted); word-break: break-word; }
.stat-poke-name { font-family: 'Syne', sans-serif; font-size: 0.85rem; font-weight: 800; text-transform: capitalize; word-break: break-word; }
.stat-sprite   { width: 64px; height: 64px; object-fit: contain; }
.stat-top3 { display: flex; gap: 0.5rem; justify-content: center; align-items: flex-end; margin-top: 0.75rem; width: 100%; }
.stat-top3-item { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; flex: 1; }
.stat-top3-rank { font-size: 1.1rem; }
.stat-top3-sprite { width: 48px; height: 48px; object-fit: contain; }
.stat-top3-sprite--gold { width: 64px; height: 64px; }
.stat-top3-name { font-family: 'Syne', sans-serif; font-size: 0.72rem; font-weight: 800; text-transform: capitalize; text-align: center; color: var(--text); word-break: break-word; }

/* Stat section titles (in-grid separators) */
.stat-section-title {
  grid-column: 1 / -1;
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0.6rem 0.1rem 0.1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.1rem;
}

/* Cycling stat cards */
.stat-sprite, .stat-cycling-name, .stat-cycling-sub { transition: opacity 0.25s ease; }
.stat-card--fading .stat-sprite,
.stat-card--fading .stat-cycling-name,
.stat-card--fading .stat-cycling-sub { opacity: 0; }
.stat-cycling-dots { display: flex; gap: 4px; justify-content: center; margin-top: 0.3rem; }
.stat-cycling-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: 0.35; transition: opacity 0.2s, background 0.2s; }
.stat-cycling-dot--active { opacity: 1; background: var(--primary); }

/* Settings section hint */
.settings-section-hint { font-size: 0.72rem; color: var(--muted); margin: -0.25rem 0 0.5rem; padding: 0 0.1rem; line-height: 1.5; }

/* Quick copy code button */
.btn-copy-code { background: none; border: none; cursor: pointer; padding: 2px 4px; color: var(--muted); border-radius: 4px; display: inline-flex; align-items: center; transition: color 0.15s, background 0.15s; }
.btn-copy-code:hover { color: var(--text); background: var(--surface2); }

#screen-settings { justify-content: flex-start; padding-top: 4rem; gap: 0; }

.update-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--red);
  color: #fff;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 300;
}
.update-banner-text { font-family: 'Space Mono', monospace; font-size: 0.72rem; flex: 1; }
.update-banner-btn  { background: #fff; color: var(--red); border: none; border-radius: 8px; padding: 0.3rem 0.8rem; font-size: 0.72rem; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.update-banner-close { background: none; border: none; color: rgba(255,255,255,0.8); cursor: pointer; font-size: 1rem; padding: 0.2rem 0.4rem; flex-shrink: 0; }

.install-banner {
  position: fixed;
  bottom: -90px;
  left: 0; right: 0;
  background: var(--card-bg);
  border-top: 1.5px solid var(--border);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  z-index: 200;
  transition: bottom 0.3s ease;
}
.install-banner--visible { bottom: 0; }
.install-banner-text { font-family: 'Space Mono', monospace; font-size: 0.72rem; color: var(--text); flex: 1; line-height: 1.5; }
.install-banner-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0.2rem 0.4rem; flex-shrink: 0; }

.screen-msg {
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  line-height: 1.7;
}

.settings-section-label {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 1.4rem 0.2rem 0.5rem;
}

.settings-card {
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: clip;
  margin-bottom: 0.5rem;
  padding: 0 1.25rem;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child { border-bottom: none; }


.settings-row--auth {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.settings-label { font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700; }
.settings-sub   { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; line-height: 1.5; }

/* Amis */
.friend-code-display {
  font-family: 'Syne', sans-serif; font-size: 1.1rem;
  font-weight: 800; letter-spacing: 0.08em; color: var(--text);
}
/* ── Friend cards ──────────────────────────────────────────────────────────── */
/* Legacy friend-card styles (kept for backward compat with modal etc.) */
.friend-card-avatar-wrap { position: relative; flex-shrink: 0; }
.friend-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: contain; flex-shrink: 0; background: var(--bg);
}
.friend-avatar--initial {
  display: flex; align-items: center; justify-content: center;
  background: var(--red-light); color: var(--red);
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1rem;
}
.friend-avatar-scene {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; background: var(--bg);
  position: relative; display: flex; align-items: center; justify-content: center;
}
.friend-avatar-sprite { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.friend-voted-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accept); border: 2px solid var(--card-bg);
}
.friend-card-body { flex: 1; min-width: 0; }
.friend-card-companion-name { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.friend-card-meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.18rem; display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
/* ── Icon buttons ───────────────────────────────────────────────────────────── */
.icon-btn {
  background: none; border: none; cursor: pointer; flex-shrink: 0;
  color: var(--muted); padding: 0.3rem; border-radius: 6px; line-height: 0;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--border); }
.icon-btn--primary { color: var(--red); }
.icon-btn--primary:hover { color: var(--red); background: rgba(227,53,13,0.08); }

/* ── Friend identity / info rows ────────────────────────────────────────────── */
.friend-info-card { padding: 0 !important; overflow: hidden; }
.friend-info-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; min-width: 0; }
.friend-info-label { font-size: 0.75rem; color: var(--muted); flex-shrink: 0; min-width: 64px; }
.friend-info-value { flex: 1; font-size: 0.88rem; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-info-divider { border: none; border-top: 1px solid var(--border); margin: 0; }
.friend-identity-code { font-family: 'Space Mono', monospace; font-size: 0.8rem; letter-spacing: 0.08em; }
.friend-identity-edit { display: flex; gap: 0.4rem; padding: 0 1rem 0.5rem; align-items: center; }
.friend-add-input { flex: 1 !important; text-transform: uppercase !important; font-family: 'Space Mono', monospace !important; letter-spacing: 0.08em !important; }
.friend-info-card .friend-add-input {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  font-size: 0.88rem !important;
  box-shadow: none !important;
}

/* ── Friend detail modal ────────────────────────────────────────────────────── */
.friend-modal-hero {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.friend-modal-avatar {
  width: 80px; height: 80px; object-fit: contain;
  image-rendering: pixelated;
}
.friend-modal-avatar--initial {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--red-light); color: var(--red);
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 2rem;
}
.friend-modal-avatar--egg { image-rendering: auto; }
.friend-modal-companion-name { font-size: 0.82rem; color: var(--muted); font-family: 'Space Mono', monospace; }
.friend-modal-stats { display: flex; flex-direction: column; gap: 0.6rem; }
.friend-modal-divider { border: none; border-top: 1px solid var(--border); margin: 0.3rem 0; }
.friend-modal-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; gap: 0.5rem; }
.friend-modal-label { color: var(--muted); font-size: 0.78rem; flex-shrink: 0; }
.friend-modal-vote { display: flex; align-items: center; gap: 0.35rem; }
.friend-modal-vote-sprite { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.friend-modal-favs { display: flex; align-items: center; gap: 0.2rem; }
.friend-modal-fav-sprite { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; }

/* ── Friend modal companion scene ───────────────────────────────────────────── */
.friend-modal-scene {
  position: relative;
  width: 280px;
  height: 280px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* ── Friend gift ─────────────────────────────────────────────────────────── */
.friend-gift-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}
.friend-gift-btn {
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}
.friend-gift-btn:hover { background: var(--bg); }
.friend-gift-done {
  text-align: center;
  font-size: 0.82rem;
  color: var(--accept);
  font-family: 'Space Mono', monospace;
  padding: 0.5rem 0;
}
.friend-gift-empty,
.friend-gift-error {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.25rem 0;
}
.friend-gift-error { color: var(--red); }
.friend-gift-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.friend-gift-reward {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--gold, #ffd700);
  font-weight: 700;
  margin-left: 0.4rem;
}
.pdollar-inline {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: middle;
}
.friend-gift-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gift-items-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
}
.gift-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.25rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.gift-item:hover { border-color: var(--accent); background: var(--card-bg); }
.gift-item-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}
.gift-item-name {
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.friend-gift-confirm {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.25rem 0;
}
.friend-gift-confirm-text {
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.4;
}
.friend-gift-confirm-btns {
  display: flex;
  gap: 0.5rem;
}
.friend-gift-confirm-btns > * { flex: 1; }
.friend-gift-back {
  width: 100%;
}

/* ── Bounce animation ───────────────────────────────────────────────────────── */
@keyframes companion-bounce {
  0%, 100% { transform: translateY(0); }
  30%       { transform: translateY(-10px); }
  60%       { transform: translateY(-4px); }
}
.companion-bounce { animation: companion-bounce 0.45s ease; }

.settings-value { font-size: 0.8rem; color: var(--muted); }
.settings-link  { font-size: 0.8rem; color: var(--red); text-decoration: none; }
.settings-link:hover { text-decoration: underline; }
.settings-privacy-link { font-size: 0.65rem; color: var(--muted); text-decoration: underline; margin-top: 0.3rem; display: inline-block; opacity: 0.6; }
.settings-privacy-link:hover { opacity: 1; }

.toggle-switch { position: relative; width: 48px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 100px;
  cursor: pointer; transition: background 0.2s;
}

.toggle-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--accept); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

.toggle-switch--sm { width: 36px; height: 20px; }
.toggle-switch--sm .toggle-slider::before { width: 14px; height: 14px; }
.toggle-switch--sm input:checked + .toggle-slider::before { transform: translateX(16px); }

.notif-sub-prefs {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0 0.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.notif-sub-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
}
.notif-sub-label { font-size: 0.82rem; color: var(--text-secondary, var(--text)); opacity: 0.8; }
.notif-sub-item--disabled { opacity: 0.35; pointer-events: none; }

body.shiny img { filter: brightness(0); transition: filter 0.3s; }

/* ── Pokémon favoris ─────────────────────────────────── */
.favorites-slots {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.75rem 0 0.5rem;
}

.fav-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

.fav-sprite {
  width: 60px;
  height: 60px;
  image-rendering: pixelated;
  background: var(--red-light);
  border-radius: 12px;
  padding: 4px;
  border: 1.5px solid var(--border);
}

.fav-name {
  font-family: 'Space Mono', monospace;
  font-size: 0.52rem;
  color: var(--muted);
  text-align: center;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--cream);
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.fav-add {
  width: 60px;
  height: 60px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}
.fav-add:hover { border-color: var(--red); color: var(--red); }

.favorites-results {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
}

.fav-result-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 0.68rem;
  font-family: 'Space Mono', monospace;
  background: var(--card-bg);
  transition: border-color 0.15s, background 0.15s;
}
.fav-result-item:hover { border-color: var(--red); background: var(--red-light); }
.fav-result-item img { width: 32px; height: 32px; image-rendering: pixelated; }

/* Bannière favori (poll + résultats) */
.realtime-banner {
  width: 100%;
  max-width: 480px;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  text-align: center;
  letter-spacing: 0.03em;
  background: var(--accent, #e63946);
  color: #fff;
  margin: 0.5rem 0 0.75rem;
  animation: realtimePulse 2.5s ease-in-out infinite;
}
@keyframes realtimePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.72; }
}

.fav-banner {
  width: 100%;
  max-width: 480px;
  padding: 0.65rem 1.2rem;
  border-radius: 12px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
  background: linear-gradient(135deg, #ffe066 0%, #ffb700 100%);
  color: #5a3a00;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.4s ease-out;
}

/* ── Compagnon ───────────────────────────────────────────────────────────── */
.companion-locked-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  padding: 1.5rem;
  box-sizing: border-box;
}
/* ── Companion page layout ── */
.companion-arena {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background:
    radial-gradient(ellipse 90% 70% at 50% 20%, rgba(100,180,255,0.25) 0%, transparent 65%),
    linear-gradient(160deg, #b8d8f0 0%, #7fb4d8 100%);
  overflow: hidden;
  padding-bottom: 1.25rem;
}
[data-theme="dark"] .companion-arena {
  background:
    radial-gradient(ellipse 80% 60% at 50% 25%, rgba(30,70,130,0.55) 0%, transparent 65%),
    linear-gradient(160deg, #0e1f33 0%, #060d1a 100%);
}
[data-theme="dark"] .companion-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(1px 1px at 72% 12%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 38% 8%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 30%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 55%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 65%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 60% 75%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 85%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 88%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(2px 2px at 50% 5%, rgba(255,240,180,0.5) 0%, transparent 100%);
  animation: starsFloat 8s ease-in-out infinite alternate;
}
@keyframes starsFloat {
  from { opacity: 0.6; transform: translateY(0); }
  to   { opacity: 1;   transform: translateY(-3px); }
}
.companion-arena-topbar {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 5;
  padding: 0.6rem 0.75rem 0;
  box-sizing: border-box;
}
.companion-topbar-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.companion-collection-btn {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem 0.85rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  white-space: nowrap;
}
.companion-shop-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem 0.85rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.companion-edit-btn-sm {
  background: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 0.4rem 0.85rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: #333;
  cursor: pointer;
}
[data-theme="dark"] .companion-edit-btn-sm {
  background: rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.15);
  color: #ddd;
}
.companion-scene {
  position: relative;
  width: 240px;
  height: 240px;
  background: transparent;
  overflow: hidden;
  touch-action: none;
}
.companion-scene--editing {
  outline: 2px dashed var(--red);
  outline-offset: 6px;
}
.companion-main {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  pointer-events: none;
}
/* Egg: only stages 2-3 animate */
.companion-egg-sprite {
  width: 110px;
  height: 110px;
  object-fit: contain;
  image-rendering: pixelated;
}
.companion-egg-sprite--animated { animation: eggSway 2.4s ease-in-out infinite; }
.companion-egg-placeholder { font-size: 5.5rem; }
.companion-egg-desc {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: var(--muted);
  text-align: center;
  padding: 0 1rem;
  line-height: 1.5;
  margin-top: 0.3rem;
}
.companion-egg-countdown {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: var(--accent);
  text-align: center;
  margin-top: 0.4rem;
  opacity: 0.85;
}
@keyframes eggSway {
  0%, 100% { transform: rotate(-4deg) translateY(0);    }
  50%       { transform: rotate(4deg)  translateY(-4px); }
}

/* Pokémon: group walks left↔right, inner flips sprite + accessories together */
.companion-group {
  position: absolute;
  inset: 0;
  animation: companionWalk 10s ease-in-out infinite;
}
@keyframes companionWalk {
  0%   { transform: translateX(20px);  }
  50%  { transform: translateX(-20px); }
  100% { transform: translateX(20px);  }
}
.companion-group-inner {
  position: absolute;
  inset: 0;
  animation: companionFlip 10s linear infinite;
}
@keyframes companionFlip {
  0%   { transform: scaleX(1);  animation-timing-function: steps(1, end); }
  50%  { transform: scaleX(-1); animation-timing-function: steps(1, end); }
  100% { transform: scaleX(1);  }
}
.companion-pokemon-sprite {
  width: 130px;
  height: 130px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: auto;
  cursor: pointer;
}
.companion-emotion {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.companion-emotion--visible {
  opacity: 1;
}
.companion-emotion-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
@keyframes emotionPop {
  0%   { transform: scale(0.4) translateY(-8px); opacity: 0; }
  60%  { transform: scale(1.15) translateY(0);   opacity: 1; }
  100% { transform: scale(1) translateY(0);      opacity: 1; }
}
.companion-emotion--visible .companion-emotion-img {
  animation: emotionPop 0.35s ease forwards;
}

/* Freeze animations in edit mode so drag coordinates are accurate */
.companion-scene--editing .companion-group,
.companion-scene--editing .companion-group-inner {
  animation: none;
  transform: none;
}

/* Dim particles in edit mode so items are easier to see */
.companion-scene--editing .companion-particles-layer {
  opacity: 0.2;
  transition: opacity 0.2s;
}

/* Dimmed decor item when another is selected */
.companion-decor-item--dimmed { opacity: 0.3; }

/* Nickname card below the arena */
.companion-nickname-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0.75rem 0.5rem;
  padding: 0.55rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  text-align: center;
  color: var(--text);
  line-height: 1.3;
}
.companion-nickname-card .companion-species {
  display: block;
  margin-top: 0.1rem;
}
/* Legacy — kept for friend modal usage */
.companion-pokemon-label {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  text-align: center;
  color: var(--text);
  line-height: 1.3;
}
.companion-species {
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--muted);
}
.companion-accessory {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
}
.companion-accessory-content {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
}
.companion-accessory--editable {
  cursor: grab;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
  transition: filter 0.1s, opacity 0.15s;
}
.companion-accessory--dimmed {
  opacity: 0.35;
  pointer-events: none;
}
.companion-accessory--editable:active,
.companion-accessory.dragging {
  cursor: grabbing;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
  z-index: 10;
}
.companion-acc-img { width: 40px; height: 40px; object-fit: contain; display: block; }
.companion-acc-controls {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1px;
  background: rgba(15,15,15,0.78);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  padding: 3px;
  white-space: nowrap;
  pointer-events: auto;
  z-index: 5;
}
.companion-acc-ctrl-btn {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.1s;
}
.companion-acc-ctrl-btn:hover { background: rgba(255,255,255,0.18); }
.companion-acc-ctrl-btn--remove { color: #ff8080; }
.companion-hatch-btn {
  animation: hatchPulse 2s ease-in-out infinite;
}
@keyframes hatchPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.35); }
  50%       { box-shadow: 0 0 14px 5px rgba(220,38,38,0.15); }
}
.btn-action--secondary {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-action--sm {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
}

/* ── Accessories panel ── */
.companion-acc-panel {
  background: var(--card-bg);
  border-top: 1.5px solid var(--border);
  padding: 0.6rem 0.75rem 0.85rem;
  flex-shrink: 0;
}
.acc-tabs-row {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 0.5rem;
}
.acc-tabs-row::-webkit-scrollbar { display: none; }
.acc-tab {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
}
.acc-tab--active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 0.45rem;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: none;
}
.acc-grid::-webkit-scrollbar { display: none; }
.acc-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
  min-width: 0;
}
.acc-item--active {
  border-color: var(--accept);
  background: rgba(34,197,94,0.08);
}
.acc-item--locked {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.acc-item-img { width: 40px; height: 40px; object-fit: contain; }
.argent-icon { height: 1em; width: auto; vertical-align: middle; display: inline-block; }
.acc-item-check {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accept);
  color: #fff;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.acc-empty {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  text-align: center;
  padding: 0.5rem 0;
  grid-column: 1 / -1;
}

/* ── Shop modal ── */
#shop-modal { align-items: center; justify-content: center; }
.shop-modal-sheet {
  width: min(520px, 96vw);
  height: 90vh;
  background: var(--bg);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.22s ease-out;
}
.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.shop-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}
.shop-balance {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--text);
}
.shop-tabs-row {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.shop-tabs-row::-webkit-scrollbar { display: none; }
.shop-tab {
  flex-shrink: 0;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.15s;
}
.shop-tab--active {
  color: var(--text);
  border-bottom-color: var(--red);
}
.shop-tab--locked {
  opacity: 0.38;
  cursor: pointer;
}
.shop-body {
  overflow-y: auto;
  flex: 1;
}
.shop-body--sell    { padding: 0; }
.shop-body--objets  { padding: 0 0.75rem 1rem; }
.shop-locked-category {
  padding: 3rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
}
.shop-refresh-bar {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  padding: 0.55rem 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.shop-section-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 0.6rem 1rem 0.1rem;
}
.shop-section-label--minor {
  color: var(--muted);
  padding-top: 0.4rem;
}
.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.75rem;
}
.shop-item-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem 0.6rem;
  gap: 0.35rem;
  position: relative;
}
.shop-item-card--owned { border-color: var(--accept); background: rgba(34,197,94,0.05); }
.shop-item-card--promo { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.shop-promo-tag {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--accent);
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 0.52rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 0 13px 0 8px;
}
.shop-price-original {
  text-decoration: line-through;
  opacity: 0.55;
  margin-right: 0.25rem;
  font-size: 0.58rem;
}
.shop-item-card-img { width: 56px; height: 56px; object-fit: contain; }
.shop-item-card-name {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}
.shop-progression {
  padding: 0.75rem 1rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.shop-prog-header {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.shop-prog-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}
.shop-prog-row:last-child { border-bottom: none; }
.shop-prog-icon { font-size: 0.85rem; line-height: 1; }
.shop-prog-name { font-family: 'Syne', sans-serif; font-weight: 700; flex: 1; color: var(--muted); }
.shop-prog-row--done .shop-prog-name { color: var(--text); }
.shop-prog-info { font-family: 'Space Mono', monospace; font-size: 0.62rem; color: var(--muted); }
.shop-prog-row--done .shop-prog-info { color: var(--accept); }
.shop-item-badge {
  font-size: 0.62rem;
  font-family: 'Space Mono', monospace;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-top: auto;
}
.shop-item-badge--price { background: var(--border); color: var(--muted); }
.shop-item-badge--buy   { background: var(--red); color: #fff; cursor: pointer; }
.shop-item-badge--owned { background: var(--border); color: var(--muted); }
.shop-item-check {
  border-radius: 8px;
  background: var(--accept);
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  margin-top: auto;
  text-align: center;
  white-space: nowrap;
}
.shop-empty {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  text-align: center;
  grid-column: 1 / -1;
  padding: 2rem 0;
}

/* ── Debug panel (admin) ── */
.companion-debug-panel {
  background: rgba(0,0,0,0.85);
  color: #eee;
  padding: 0.75rem 1rem;
  flex-shrink: 0;
  border-top: 2px dashed #444;
}
.companion-debug-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.6rem;
}
.companion-debug-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.companion-debug-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: #777;
  width: 80px;
  flex-shrink: 0;
}
.companion-debug-btns { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.companion-debug-btn {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #444;
  background: #222;
  color: #ccc;
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  cursor: pointer;
  transition: background 0.1s;
}
.companion-debug-btn:hover { background: #333; }
.companion-debug-btn--active { background: #1a3a1a; border-color: #4a4; color: #8f8; }
.companion-debug-btn--danger { border-color: #633; color: #f88; }
.companion-debug-btn--danger:hover { background: #2a1010; }

/* Modale Pokédex */
#pokedex-modal { align-items: center; justify-content: center; }
#pokedex-modal .cl-sheet { width: min(400px, 92vw); border-radius: 20px; }
.pdx-body { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding-bottom: 1.25rem; }
.pdx-sprite-wrap { width: 140px; height: 140px; display: flex; align-items: center; justify-content: center; }
.pdx-img { width: 140px; height: 140px; object-fit: contain; image-rendering: auto; }
.pdx-number { font-size: 0.75rem; color: var(--muted); font-family: 'Space Mono', monospace; }
.pdx-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.3rem; }
.pdx-form { font-family: 'Space Mono', monospace; font-size: 0.75rem; color: var(--muted); text-transform: capitalize; margin-top: -0.25rem; }
.pdx-types { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.pdx-desc {
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--text);
  text-align: center;
  margin: 0.25rem 0 0.5rem;
  min-height: 3.5em;
}
.pdx-actions { display: flex; gap: 0.75rem; width: 100%; justify-content: center; flex-wrap: wrap; }
.pdx-actions .btn-action { flex: 1; min-width: 140px; }
.pdx-actions .btn-secondary { flex: 0 0 auto; }

/* Hatch modal - centré */
#companion-hatch-modal { align-items: center; justify-content: center; }
#companion-hatch-modal .cl-sheet { width: min(440px, 92vw); border-radius: 20px; max-height: 85vh; }
.hatch-search-results {
  max-height: 180px;
  overflow-y: auto;
  margin-top: 0.5rem;
}
.hatch-result-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.1s;
}
.hatch-result-row:hover,
.hatch-result-row:active { background: var(--bg); }
.hatch-result-row img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}
.hatch-result-row span {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: capitalize;
}
.hatch-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0;
}
.hatch-preview-sprite {
  width: 90px;
  height: 90px;
  object-fit: contain;
  image-rendering: pixelated;
  animation: hatchBounce 0.5s cubic-bezier(.22,1,.36,1);
}
.hatch-preview-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  text-transform: capitalize;
  text-align: center;
}
@keyframes hatchBounce {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}

/* Hatch animation overlay */
.hatch-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.hatch-overlay--visible { opacity: 1; }
.hatch-anim {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
  padding: 2rem;
}
.hatch-shine {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,220,80,0.28) 0%, transparent 68%);
  animation: shinePulse 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shinePulse {
  0%, 100% { transform: scale(0.85); opacity: 0.6; }
  50%       { transform: scale(1.2);  opacity: 1;   }
}
.hatch-sprite {
  width: 160px;
  height: 160px;
  object-fit: contain;
  image-rendering: pixelated;
  animation: hatchReveal 0.8s cubic-bezier(.22,1,.36,1);
  position: relative;
  z-index: 1;
}
@keyframes hatchReveal {
  0%   { transform: scale(0) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.12) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}
.hatch-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  color: #fff;
  text-transform: capitalize;
  position: relative;
  z-index: 1;
  line-height: 1.3;
}
.hatch-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  font-family: 'Space Mono', monospace;
  position: relative;
  z-index: 1;
}

/* ── Badge "non lu" nav ─────────────────────────────────────────────────── */
.nav-tab-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-unread-dot {
  position: absolute;
  top: -2px; right: -4px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--bg);
}

/* ── Badge "Nouveautés" (ligne paramètres) ───────────────────────────────── */
.cl-badge {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  margin-left: 0.4rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ── Modale Nouveautés ───────────────────────────────────────────────────── */
.cl-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.18s ease-out;
}
.cl-sheet {
  width: 100%;
  max-height: 100vh;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.22s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.cl-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cl-sheet-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}
.cl-sheet-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
}
.cl-sheet-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 600px) {
  .cl-overlay { align-items: center; justify-content: center; }
  .cl-sheet { width: 480px; border-radius: 20px; max-height: 80vh; }
}
.cl-entry {
  margin-bottom: 1.5rem;
}
.cl-entry:last-child { margin-bottom: 0; }
.cl-entry-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.6rem;
}
.cl-entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cl-entry-version {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
}
.cl-entry-date {
  font-size: 0.65rem;
  color: var(--muted);
}
.cl-entry-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.cl-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.cl-list li {
  font-size: 0.82rem;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}
.cl-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--muted);
}
.cl-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ── Onglet Administration (profil) ─────────────────────────────────────── */
#adm-form, .admin-card-body { padding: 0.85rem 0; }
.admin-field       { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.admin-field:last-child { margin-bottom: 0; }
.admin-field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.admin-label       { font-size: 0.68rem; color: var(--muted); font-family: 'Space Mono', monospace; }
.admin-input {
  width: 100%; box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
}
.admin-input:focus { outline: none; border-color: var(--red); }
.admin-rule-params { margin-bottom: 0.75rem; }
.admin-checkboxes  { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.3rem; }
.admin-checkboxes label {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; color: var(--text); cursor: pointer;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.2rem 0.5rem;
  font-family: 'Space Mono', monospace;
}
.admin-checkboxes input[type=checkbox] { width: auto; margin: 0; accent-color: var(--red); }
.admin-chips       { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; min-height: 0; }
.admin-chip {
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--red-light); border: 1px solid var(--red);
  border-radius: 100px; padding: 0.2rem 0.6rem;
  font-size: 0.7rem; font-family: 'Space Mono', monospace; color: var(--red);
}
.admin-chip img    { width: 24px; height: 24px; image-rendering: pixelated; }
.admin-chip-remove { background: none; border: none; color: var(--red); cursor: pointer; padding: 0; font-size: 0.9rem; line-height: 1; }
.admin-search-results {
  z-index: 1000;
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 8px; max-height: 180px; overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.admin-search-wrap { position: relative; }
.admin-search-result-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.7rem; cursor: pointer;
  font-size: 0.75rem; font-family: 'Space Mono', monospace;
  border-bottom: 1px solid var(--border);
}
.admin-search-result-item:last-child { border-bottom: none; }
.admin-search-result-item:hover { background: var(--red-light); }
.admin-search-result-item img { width: 32px; height: 32px; image-rendering: pixelated; }
.admin-btn-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; flex-wrap: wrap; }
.admin-btn {
  padding: 0.5rem 1rem; border: none; border-radius: 8px;
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 0.8rem; cursor: pointer; transition: opacity 0.15s;
}
.admin-btn:hover { opacity: 0.85; }
.admin-btn-primary   { background: var(--red); color: #fff; }
.admin-btn-secondary { background: var(--border); color: var(--text); }
.admin-btn-danger    { background: #dc2626; color: #fff; font-size: 0.72rem; padding: 0.3rem 0.65rem; }
.admin-btn-sm        { font-size: 0.72rem; padding: 0.3rem 0.65rem; }
.admin-form-msg      { font-size: 0.72rem; margin-left: auto; }
.admin-preview-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.75rem; }
.admin-preview-card  {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 0.4rem 0.65rem;
  font-family: 'Space Mono', monospace; font-size: 0.7rem;
}
.admin-preview-card img { width: 48px; height: 48px; image-rendering: pixelated; flex-shrink: 0; }
.admin-event-card {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0.8rem 1rem; margin-bottom: 0.6rem;
}
.admin-event-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.admin-event-info   { flex: 1; min-width: 0; }
.admin-event-name   { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.88rem; word-break: break-word; }
.admin-event-label  { font-size: 0.7rem; color: var(--muted); margin-top: 0.1rem; }
.admin-event-meta   { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.admin-event-tag    {
  font-size: 0.65rem; font-family: 'Space Mono', monospace;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.1rem 0.4rem; color: var(--muted);
}
.admin-event-tag--rec { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }
[data-theme="dark"] .admin-event-tag--rec { background: #2e1065; border-color: #7c3aed; color: #c4b5fd; }
.admin-event-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

/* Bannière événement */
.event-banner {
  width: 100%;
  max-width: 480px;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-family: 'Syne', sans-serif;
  text-align: left;
  background: var(--red-light);
  color: var(--text);
  margin-bottom: 0.75rem;
  animation: fadeIn 0.4s ease-out;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--red);
}
.event-banner-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
}
.event-banner-badge {
  display: inline-flex;
  align-self: flex-start;
  font-family: 'Syne', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  color: #fff;
  margin-bottom: 0.15rem;
}
.event-banner-badge--actif    { background: transparent; border: 1.5px solid var(--red); color: var(--red); }
.event-banner-badge--approche { background: var(--red); }
.event-banner-row {
  margin-bottom: 0.15rem;
}
.event-banner-when {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  margin-top: 0.25rem;
}
.event-banner-desc {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Toast badge débloqué */
.badge-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 500;
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 280px;
  border: 1.5px solid var(--border);
  animation: toastSlideIn 0.35s cubic-bezier(.22,1,.36,1);
}
.badge-toast-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.badge-toast-body { flex: 1; min-width: 0; }
.badge-toast-header {
  font-family: 'Syne', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.1rem;
}
.badge-toast-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-toast-desc {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
  line-height: 1.3;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(calc(100% + 1rem)); }
  to   { opacity: 1; transform: translateX(0); }
}
.badge-toast--glacon .badge-toast-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pierre-glace-icon {
  width: 1.1em;
  height: 1.1em;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
}
.pierre-glace-icon--toast {
  width: 2rem;
  height: 2rem;
}
.glacon-buy-btn {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
}
.glacon-buy-btn--disabled { background: var(--border); color: var(--muted); cursor: default; }
.glacon-max-msg {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}
.glacon-no-funds {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  font-family: 'Space Mono', monospace;
}

/* Streak strip (LinkedIn-style day row) */
.streak-strip {
  display: flex;
  align-items: flex-end;
  margin-top: 0.75rem;
  padding: 0 0.25rem;
  width: 100%;
  position: relative;
}
.streak-strip::before {
  content: '';
  position: absolute;
  bottom: 11px;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.streak-strip-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex: 1;
}
.streak-strip-letter {
  font-size: 0.58rem;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
}
.streak-strip-letter--today { color: var(--text); font-weight: 700; }
.streak-strip-letter--future { opacity: 0.35; }
.streak-strip-circle {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  opacity: 0.5;
}
.streak-strip-circle--voted  { background: rgba(255, 100, 0, 0.18); border-color: rgba(255, 100, 0, 0.7); opacity: 1; }
.streak-strip-circle--frozen { background: rgba(80, 180, 255, 0.18); border-color: rgba(80, 180, 255, 0.7); opacity: 1; }
.streak-strip-circle--today  { border-color: var(--red); border-style: dashed; opacity: 0.9; }
.streak-strip-circle--future { opacity: 1; border-style: dotted; }
.streak-strip-icon { width: 14px; height: 14px; object-fit: contain; }

/* Card favori */
.poke-card--favorite {
  border-color: #FFD700 !important;
  box-shadow: 0 0 0 2px #FFD700, 0 6px 24px rgba(255, 200, 0, 0.2);
}

.fav-star {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.85rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
  z-index: 1;
}

/* Screen poll avec favori */
.screen-poll--fav {
  background: linear-gradient(180deg, rgba(255,215,0,0.07) 0%, var(--bg) 20%);
}
.screen-results--fav {
  background: linear-gradient(180deg, rgba(255,215,0,0.07) 0%, var(--bg) 20%);
}

/* Cellule calendrier avec favori */
.cal-cell--fav.cal-has-vote {
  border-color: #FFD700 !important;
  box-shadow: 0 0 0 1px rgba(255,200,0,0.3);
}
/* Cellule calendrier non vue */
.cal-cell--new.cal-has-vote::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
}
.cal-fav-star {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.42rem;
  line-height: 1;
}

/* ── Profil Duolingo-style ─────────────────────────────────────────────────── */

/* Header companion / profil */
#screen-compagnon .header-top {
  display: flex;
  align-items: center;
}
#screen-compagnon .header-top h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin: 0; flex: 1; text-align: center; }

/* Header profil avec rouage */
#screen-profile .header-top {
  display: flex;
  align-items: center;
}
#screen-profile .header-top h2 { flex: 1; text-align: center; }
.profile-gear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.profile-gear-btn:hover { color: var(--text); }
.profile-gear-btn svg { width: 22px; height: 22px; }

/* ── Settings panneau droit ─────────────────────────────────────────────── */
#profile-settings-modal {
  justify-content: flex-end;
  align-items: stretch;
}
#profile-settings-modal .cl-sheet {
  width: min(360px, 100vw);
  height: 100%;
  max-height: 100vh;
  border-radius: 0;
  animation: slideFromRight 0.25s cubic-bezier(0.4,0,0.2,1);
}
@keyframes slideFromRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@media (min-width: 600px) {
  #profile-settings-modal { align-items: stretch; justify-content: flex-end; }
  #profile-settings-modal .cl-sheet { width: 360px; border-radius: 0; max-height: 100vh; }
}
.settings-menu-row {
  cursor: pointer;
}
.settings-menu-row:active { opacity: 0.55; }
.settings-menu-arrow {
  font-size: 1.2rem;
  color: var(--muted);
  line-height: 1;
}
.cl-sheet-back {
  background: none;
  border: none;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--red);
  cursor: pointer;
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
#profile-settings-modal .cl-sheet-body {
  flex: 1;
  min-height: 0;
}

/* ── Profil hero card ───────────────────────────────────────────────────── */
.profile-hero-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.profile-hero-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
}
.profile-hero-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-hero-avatar--guest {
  background: var(--border);
  color: var(--muted);
}
.profile-hero-identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.profile-hero-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-hero-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--accept);
  font-family: 'Space Mono', monospace;
}
.profile-hero-status--muted { color: var(--muted); }
.profile-hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accept);
  flex-shrink: 0;
}
.profile-hero-avatar--photo {
  object-fit: cover;
}
.profile-hero-avatar--companion {
  object-fit: contain;
  cursor: pointer;
  image-rendering: pixelated;
  background: var(--bg);
}
.profile-hero-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}
.profile-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 1rem;
}
.profile-hero-stats-label {
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.profile-hero-badge-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  border: none;
  cursor: default;
}
.profile-hero-badge--fire {
  background: rgba(255, 100, 0, 0.12);
  color: var(--text);
}
.profile-hero-badge--ice {
  background: rgba(80, 180, 255, 0.15);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.profile-hero-badge--ice:hover { background: rgba(80, 180, 255, 0.28); }

/* ── Recap elements (shared with hero) ─────────────────────────────────── */
.profile-recap-big {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--text);
}
.profile-recap-label {
  font-size: 0.82rem;
  color: var(--muted);
}
.profile-recap-glacons {
  align-self: flex-start;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-family: 'Space Mono', monospace;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
  margin-top: 0.1rem;
}
.profile-recap-glacons:hover { border-color: var(--text); }

/* ── Badge "+X" chip ────────────────────────────────────────────────────── */
.badge-item--more {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
}
.badge-item--more:hover { opacity: 1; }
.badge-more-count {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--border);
  border-radius: 12px;
  padding: 0.2rem 0.6rem;
}

/* ── Show all button ─────────────────────────────────────────────────────── */
.profile-show-all-btn {
  background: none;
  border: none;
  font-size: 0.72rem;
  color: var(--red);
  font-family: 'Space Mono', monospace;
  cursor: pointer;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Screen profil : scrollable, aligné en haut ─────────────────────────── */
#screen-profile {
  justify-content: flex-start;
  align-items: flex-start;
}
#profile-auth-bar,
#profile-recap,
#profile-badges-section,
#profile-amis-section,
#profile-favoris-section {
  width: 100%;
}

/* ── Companion: card-based layout ───────────────────────────────────────── */
.companion-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 2rem 0.75rem 2rem;
  gap: 0.75rem;
}
.companion-page::-webkit-scrollbar { display: none; }
.companion-page .header-top { margin-bottom: 1rem; }

.companion-settings-wrap { position: relative; }

.companion-settings-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  min-width: 170px;
  z-index: 100;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.companion-settings-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.companion-settings-item:hover { background: var(--surface2); }
.companion-settings-item--danger { color: var(--red); }

.companion-main-card { padding: 0; overflow: visible; }
.companion-expedition-card { overflow: visible; }

.companion-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  flex-wrap: wrap;
}

#companion-pokemon-label .companion-species {
  display: block;
  font-size: 0.75rem;
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* ── Scene layers ────────────────────────────────────────────────────────── */
.companion-scene-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  transition: background 0.4s ease;
}
.companion-decor-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.companion-scene--editing-decor .companion-decor-layer {
  pointer-events: auto;
  z-index: 3;
}
.companion-scene--editing-decor .companion-group {
  z-index: 2;
  opacity: 0.18;
  pointer-events: none;
}

/* Reset companion-group z-index (was implicit) */
.companion-group { z-index: 2; }

.companion-decor-item {
  position: absolute;
  transform: translate(-50%, -50%);
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
  cursor: default;
}
.companion-decor-item--editable {
  cursor: grab;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}
.companion-decor-item--editable:active,
.companion-decor-item.dragging {
  cursor: grabbing;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  z-index: 10;
}

/* ── Arrange panel tabs ──────────────────────────────────────────────────── */
.arrange-panel-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 0.5rem;
}
.arrange-panel-tabs::-webkit-scrollbar { display: none; }
.arrange-panel-tab {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 0.45rem 0.5rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -1.5px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.arrange-panel-tab--active {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* ── Decor panel content ─────────────────────────────────────────────────── */
.decor-panel-scroll {
  overflow-y: auto;
  scrollbar-width: none;
  max-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.decor-panel-scroll::-webkit-scrollbar { display: none; }
.decor-section-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
}
.decor-bg-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.2rem;
}
.decor-bg-row::-webkit-scrollbar { display: none; }
.decor-bg-btn {
  flex-shrink: 0;
  width: 40px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--muted);
  transition: border-color 0.15s;
}
.decor-bg-btn--active { border-color: var(--red); }
.decor-emoji-thumb {
  font-size: 1.7rem;
  display: block;
  line-height: 1;
}
.acc-item-count {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.55rem;
  font-family: 'Space Mono', monospace;
  color: var(--muted);
  pointer-events: none;
}
.acc-item-also {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.6;
  pointer-events: none;
}
.arrange-placement-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.arrange-placement-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.3rem 0.25rem;
  font-size: 0.72rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.arrange-placement-btn + .arrange-placement-btn {
  border-left: 1.5px solid var(--border);
}
.arrange-placement-btn--active {
  background: var(--text);
  color: var(--bg);
}
.acc-chips-tray {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.4rem;
}
.acc-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.4rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.acc-chip--selected {
  border-color: var(--red);
  background: var(--red-light);
}
.acc-chip-img { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.acc-chip-emoji { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.acc-chip-label { flex: 1; font-size: 0.75rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-chip-ctrl {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s;
}
.acc-chip-ctrl:hover { background: var(--border); }
.acc-chip-ctrl--del { color: var(--red); border-color: transparent; background: transparent; }
.acc-chip-ctrl--del:hover { background: var(--red-light); }

/* ── Companion section title ─────────────────────────────────────────────── */
.companion-section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text);
  letter-spacing: 0.03em;
}
.companion-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.6rem;
}
.companion-expedition-body {
  padding: 0 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Expedition slots ────────────────────────────────────────────────────── */
.expedition-slots {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.expedition-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}
.expedition-slot--done {
  opacity: 0.55;
}
.exped-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.exped-type-emoji {
  font-size: 1.5rem;
  line-height: 1;
}
.exped-type-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}
.exped-duration {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: var(--muted);
}
.exped-action { flex-shrink: 0; }
.exped-timer {
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  min-width: 3.5rem;
  text-align: right;
}
.exped-status {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
}
.exped-status--done { color: var(--accept); }
.exped-claim-btn {
  animation: hatchPulse 1.8s ease-in-out infinite;
}

/* ── Expedition active card ──────────────────────────────────────────────── */
.expedition-active-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem 1.25rem;
}
.exped-active-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.exped-active-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.expedition-active-card--done {
  border-color: var(--accept);
  background: rgba(74, 222, 128, 0.06);
}
.exped-pokemon-sprite {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  transform: scaleX(-1);
  flex-shrink: 0;
}
.exped-active-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.exped-active-type {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.exped-progress-wrap {
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}
.exped-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #a78bfa), #7c3aed);
  border-radius: 6px;
  transition: width 1s linear;
  min-width: 2%;
}
.exped-timer-text {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.exped-cancel-area {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.exped-cancel-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  align-self: flex-start;
  transition: border-color 0.15s, color 0.15s;
}
.exped-cancel-btn:hover {
  border-color: rgba(239,68,68,0.5);
  color: rgba(239,68,68,0.8);
}
.exped-cancel-warn {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: #f59e0b;
}
.exped-cancel-btns {
  display: flex;
  gap: 0.35rem;
}
.btn-action--danger {
  background: rgba(220,38,38,0.85) !important;
  border-color: rgba(220,38,38,0.6) !important;
}
.exped-reset-bar {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  padding: 0.35rem 0 0.5rem;
}
.exped-all-done {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

/* ── Expedition loot toast ───────────────────────────────────────────────── */
.exped-loot-toast {
  position: fixed;
  bottom: calc(58px + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--card-bg);
  border: 1.5px solid var(--accept);
  border-radius: 14px;
  padding: 0.75rem 1.1rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.6;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  text-align: center;
  white-space: nowrap;
}
.exped-loot-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Activity journal ───────────────────────────────────────────────────── */
.journal-date-group { margin-bottom: 1.1rem; }
.journal-date-group:last-child { margin-bottom: 0; }
.journal-date-group + .journal-date-group {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.journal-date-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding-bottom: 0.35rem;
  margin-bottom: 0.1rem;
  border-bottom: 1px solid var(--border);
}
.activity-entry {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-entry:last-child { border-bottom: none; }
.act-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.act-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.act-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.act-sub {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.5;
  border-left: 2px solid var(--border);
  padding-left: 0.5rem;
  margin-top: 0.3rem;
}
.exped-toast-new {
  display: inline-block;
  background: var(--accept, #27ae60);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.exped-loot-toast--gift { border-left: 3px solid #e91e8c; }
.exped-toast-converted { color: var(--muted); }
.exped-toast-pd {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--accept);
}

/* ── Collectibles encyclopédie ───────────────────────────────────────────── */
.collectible-ency-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.collectible-ency-tab {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.collectible-ency-tab--active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.collectible-ency-count {
  font-family: 'Space Mono', monospace;
  font-size: 0.65em;
  opacity: 0.8;
}
.collectible-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.coll-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
  padding: 0.75rem 0 0.25rem;
}
.collectible-tab-content {
  overflow-y: auto;
}
.coll-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.coll-accordion-item {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.coll-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--card-bg);
  border: none;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  text-align: left;
}
.coll-accordion-name { flex: 1; }
.coll-accordion-chevron {
  opacity: 0.5;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
}
.coll-accordion-chevron--open { transform: rotate(180deg); }
.coll-accordion-body {
  padding: 0.25rem 0.5rem 0.5rem;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}
.collectible-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.3rem;
  cursor: default;
}
.collectible-card--unowned {
  opacity: 0.45;
}
.collectible-emoji {
  font-size: 1.5rem;
  line-height: 1;
}
.collectible-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
}
.collectible-img--unowned,
.collectible-emoji--unowned {
  filter: grayscale(1);
}
.collectible-name {
  font-family: 'Space Mono', monospace;
  font-size: 0.52rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}
.collectible-count {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.76rem;
  color: var(--text);
}
.collectible-count--lock {
  font-size: 0.68rem;
}
.companion-acc-emoji {
  font-size: 1.8rem;
  line-height: 1;
  display: block;
}

/* ── Collection modal ────────────────────────────────────────────────────── */
.collection-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
}
.collection-modal-inner {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 75vh;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
  box-sizing: border-box;
}
.collection-modal-inner::-webkit-scrollbar { display: none; }
.collection-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.collection-modal-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

/* ── Boutique : onglets principaux ───────────────────────────────────────── */
.shop-main-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}
.shop-main-tab {
  flex: 1;
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  padding: 0.55rem 0.3rem;
  border: none;
  background: transparent;
  color: var(--text-muted, #888);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.15s, border-color 0.15s;
}
.shop-main-tab--active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 700;
}

/* ── Boutique d'objets : consommables ────────────────────────────────────── */
.consumable-section-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #888);
  margin: 1rem 0 0.5rem;
}
.consumable-list { display: flex; flex-direction: column; gap: 0.5rem; }
.consumable-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}
.consumable-emoji { font-size: 1.6rem; flex-shrink: 0; line-height: 1; }
.consumable-img   { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; image-rendering: pixelated; }
.consumable-info  { flex: 1; min-width: 0; }
.consumable-name  { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.82rem; }
.consumable-owned-count {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--accept, #27ae60);
  font-weight: 400;
}
.consumable-desc { font-size: 0.72rem; color: var(--text-muted, #888); margin-top: 0.15rem; line-height: 1.35; }
.consumable-buy-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border: 1.5px solid var(--text);
  border-radius: 100px;
  background: var(--text);
  color: var(--card-bg);
  cursor: pointer;
  transition: opacity 0.15s;
}
.consumable-buy-btn--disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent;
  color: var(--text-muted, #888);
  border-color: var(--border);
}

/* ── Boutique d'objets : vente ───────────────────────────────────────────── */
.sell-tab-intro {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  line-height: 1.4;
  padding: 0.75rem 0.75rem 0.5rem;
}
.sell-empty { font-size: 0.78rem; color: var(--text-muted, #888); padding: 0.5rem 0.75rem; }
.sell-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0 0.75rem;
  flex-wrap: wrap;
}
.sell-items-list { display: flex; flex-direction: column; gap: 0.4rem; padding: 0 0.5rem; }
.sell-type-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #888);
  margin: 0.6rem 0 0.2rem;
  padding: 0 0.25rem;
}
.sell-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  transition: border-color 0.12s;
}
.sell-item--selected { border-color: var(--accept, #27ae60); }
.sell-item-img   { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.sell-item-emoji { font-size: 1.3rem; flex-shrink: 0; }
.sell-item-details { flex: 1; min-width: 0; }
.sell-item-name { font-size: 0.8rem; font-weight: 600; }
.sell-item-meta {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted, #888);
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 0.1rem;
}
.sell-item-stepper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.sell-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: border-color 0.12s, background 0.12s;
}
.sell-qty-btn:disabled { opacity: 0.3; cursor: default; }
.sell-qty-btn:not(:disabled):hover { border-color: var(--text); }
.sell-qty-val {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 1.2rem;
  text-align: center;
}

/* ── Expédition : picker de consommable ─────────────────────────────────── */
.exped-picker-section {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.exped-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
}
.exped-picker-label {
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  white-space: nowrap;
}
.exped-picker-label--active { color: var(--accept, #27ae60); font-weight: 600; }
.exped-consumable-effect {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  padding: 0.4rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--hover-bg, rgba(0,0,0,0.03));
  line-height: 1.35;
}
.exped-active-consumable {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--accept, #27ae60);
  font-weight: 600;
  margin-top: 0.3rem;
}
.exped-active-cons-sep { color: var(--text-muted, #888); font-size: 0.65rem; margin: 0 0.15rem; }
.exped-consumable-btn--immediate {
  border-color: var(--accent, #E3350D);
}
.exped-permis-confirm {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: var(--card-bg);
  border: 1.5px solid var(--accent, #E3350D);
  border-radius: 10px;
  margin-top: 0.5rem;
}
.exped-permis-confirm-info {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.4;
}
.exped-permis-confirm-btns {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.exped-cancel-cons-warn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--red, #E3350D);
  margin-bottom: 0.4rem;
}
.exped-consumable-btns { display: flex; gap: 0.3rem; }
.exped-consumable-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 1rem;
  padding: 0.2rem 0.4rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.exped-consumable-btn--active {
  border-color: var(--accept, #27ae60);
  background: var(--accept-light, #e8f8ef);
}
.exped-consumable-count { font-family: 'Space Mono', monospace; font-size: 0.62rem; color: var(--text-muted, #888); }
.exped-consumable-img   { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }

/* ── Companion card wrapper ───────────────────────────────────────────────── */
.companion-card-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-self: center;
  border-radius: 20px;
  box-shadow: 0 14px 70px rgba(0,0,0,0.65);
}
.companion-card-wrapper .companion-scene {
  border-radius: 16px;
  width: min(310px, calc(100vw - 72px));
  height: min(310px, calc(100vw - 72px));
}

.friend-avatar--sprite, .friend-avatar--egg { background: var(--bg); }
.friend-card {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; cursor: pointer;
  transition: background 0.12s;
}
.friend-card:not(:last-child) { border-bottom: 1px solid var(--border); }
.friend-card:hover { background: var(--bg); }
.friend-card-name {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.9rem;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Companion particles layer ────────────────────────────────────────────── */
.companion-particles-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}
.companion-particles-layer canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ── Companion frame overlay ──────────────────────────────────────────────── */
.companion-frame-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  box-sizing: border-box;
}

/* ── Image-based frames ───────────────────────────────────────────────────── */
.companion-frame-test {
  border: 24px solid transparent;
  border-image: url('/frames/frame_test.png') 8 fill;
  image-rendering: pixelated;
}
/* frame = outer-dark 4px | separator 1px | main color 2px | highlight 1px | inner edge 1px */
.companion-frame-argent {
  box-shadow:
    inset 0 0 0 4px #6a7a8a,
    inset 0 0 0 5px rgba(0,0,0,0.5),
    inset 0 0 0 7px #c0ccd8,
    inset 0 0 0 8px rgba(255,255,255,0.7),
    inset 0 0 0 9px rgba(130,148,165,0.55);
}
.companion-frame-dore {
  box-shadow:
    inset 0 0 0 4px #705808,
    inset 0 0 0 5px rgba(0,0,0,0.5),
    inset 0 0 0 7px #d4a820,
    inset 0 0 0 8px rgba(255,235,80,0.75),
    inset 0 0 0 9px rgba(130,90,12,0.55);
}
.companion-frame-rubis {
  box-shadow:
    inset 0 0 0 4px #6e0c08,
    inset 0 0 0 5px rgba(0,0,0,0.55),
    inset 0 0 0 7px #c82018,
    inset 0 0 0 8px rgba(255,120,90,0.6),
    inset 0 0 0 9px rgba(95,8,6,0.55);
}
.companion-frame-saphir {
  box-shadow:
    inset 0 0 0 4px #062058,
    inset 0 0 0 5px rgba(0,0,0,0.55),
    inset 0 0 0 7px #1860b8,
    inset 0 0 0 8px rgba(110,185,255,0.6),
    inset 0 0 0 9px rgba(8,30,88,0.55);
}
.companion-frame-emeraude {
  box-shadow:
    inset 0 0 0 4px #06481e,
    inset 0 0 0 5px rgba(0,0,0,0.55),
    inset 0 0 0 7px #128040,
    inset 0 0 0 8px rgba(85,225,115,0.6),
    inset 0 0 0 9px rgba(6,55,22,0.55);
}
.companion-frame-arc_en_ciel {
  animation: rainbowBorderPulse 3s linear infinite;
}
@keyframes rainbowBorderPulse {
  0%   { box-shadow: inset 0 0 0 4px #8a0000, inset 0 0 0 5px rgba(0,0,0,0.45), inset 0 0 0 7px #ff2020, inset 0 0 0 8px rgba(255,150,130,0.6), inset 0 0 0 9px rgba(100,0,0,0.45); }
  17%  { box-shadow: inset 0 0 0 4px #884000, inset 0 0 0 5px rgba(0,0,0,0.45), inset 0 0 0 7px #ff8800, inset 0 0 0 8px rgba(255,200,110,0.6), inset 0 0 0 9px rgba(100,50,0,0.45); }
  33%  { box-shadow: inset 0 0 0 4px #888800, inset 0 0 0 5px rgba(0,0,0,0.45), inset 0 0 0 7px #dddd00, inset 0 0 0 8px rgba(255,255,130,0.6), inset 0 0 0 9px rgba(100,100,0,0.45); }
  50%  { box-shadow: inset 0 0 0 4px #006600, inset 0 0 0 5px rgba(0,0,0,0.45), inset 0 0 0 7px #22cc22, inset 0 0 0 8px rgba(130,255,140,0.6), inset 0 0 0 9px rgba(0,80,0,0.45); }
  67%  { box-shadow: inset 0 0 0 4px #003088, inset 0 0 0 5px rgba(0,0,0,0.45), inset 0 0 0 7px #2288ff, inset 0 0 0 8px rgba(130,200,255,0.6), inset 0 0 0 9px rgba(0,30,100,0.45); }
  83%  { box-shadow: inset 0 0 0 4px #500088, inset 0 0 0 5px rgba(0,0,0,0.45), inset 0 0 0 7px #aa22ff, inset 0 0 0 8px rgba(200,150,255,0.6), inset 0 0 0 9px rgba(60,0,100,0.45); }
  100% { box-shadow: inset 0 0 0 4px #8a0000, inset 0 0 0 5px rgba(0,0,0,0.45), inset 0 0 0 7px #ff2020, inset 0 0 0 8px rgba(255,150,130,0.6), inset 0 0 0 9px rgba(100,0,0,0.45); }
}
.companion-frame-pokeball {
  box-shadow:
    inset 0 0 0 4px #800e08,
    inset 0 0 0 5px rgba(0,0,0,0.55),
    inset 0 0 0 7px #d82818,
    inset 0 0 0 8px rgba(255,130,100,0.55),
    inset 0 0 0 9px rgba(95,8,5,0.5);
}
.companion-frame-pokeball::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px;
  top: calc(50% - 1px);
  height: 2px;
  background: rgba(8,8,8,0.8);
}
.companion-frame-pokeball::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(8,8,8,0.8);
  z-index: 1;
}
.companion-frame-nuit {
  box-shadow:
    inset 0 0 0 4px #0e1640,
    inset 0 0 0 5px rgba(0,0,10,0.6),
    inset 0 0 0 7px #1e2d70,
    inset 0 0 0 8px rgba(165,135,255,0.5),
    inset 0 0 0 9px rgba(14,12,50,0.55);
  background: radial-gradient(ellipse at 25% 20%, rgba(120,80,255,0.12) 0%, transparent 70%);
}

/* ── Decoration shop ──────────────────────────────────────────────────────── */
.shop-deco-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
  padding: 0 0.75rem;
}
.shop-deco-tab {
  flex: 1;
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.65rem 0.5rem;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
}
.shop-deco-tab--active {
  color: var(--text);
  border-bottom-color: var(--red);
}
.shop-deco-tab--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.deco-bg-preview {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  align-self: center;
  flex-shrink: 0;
}
.deco-frame-preview {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: var(--surface2);
  position: relative;
  align-self: center;
  flex-shrink: 0;
  overflow: hidden;
}
.deco-effect-preview {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  align-self: center;
  flex-shrink: 0;
}
.shop-item-check--active {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  background: var(--accept);
  color: #fff;
  text-align: center;
  margin-top: auto;
}
/* ── Mini-aperçu boutique décoration ─────────────────────────────────────── */
.deco-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.75rem 0.2rem;
}
.deco-preview-scene {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface2, #f0f0f0);
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.deco-preview-box--active .deco-preview-scene {
  outline: 2px solid var(--accent, #e3350d);
  outline-offset: 0px;
}
.deco-preview-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.deco-preview-particles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.deco-preview-particles-layer canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.deco-preview-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.deco-preview-box--active .deco-preview-label {
  color: var(--accent, #e3350d);
  font-weight: 700;
}

/* ── Retirer un item actif ────────────────────────────────────────────────── */
.shop-item-badge--remove {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--border);
  color: var(--muted);
  border: none;
  cursor: pointer;
  margin-top: auto;
  transition: background 0.15s, color 0.15s;
}
.shop-item-badge--remove:hover {
  background: var(--red);
  color: #fff;
}

.shop-deco-preview-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.shop-deco-preview-btn:hover { background: var(--surface2); }
.shop-deco-preview-btn--active {
  background: var(--accent, #e3350d);
  color: #fff;
  border-color: var(--accent, #e3350d);
}
.shop-item-card--previewing {
  border-color: var(--accent, #e3350d) !important;
  box-shadow: 0 0 0 2px rgba(227,53,13,0.18);
}
