/* ============================================
   SHINSEKAI — thème "Planche Manga"
   Encre noire, rouge shônen, halftone et bordures
   façon cases de manga. Aucun logo ni personnage
   officiel utilisé dans le design lui-même.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Bungee&family=Rubik:wght@400;500;600;700&display=swap');

:root {
  --void: #0a0a0c;
  --void-2: #131316;
  --orange: #e8382a;      /* rouge shônen (accent principal) */
  --orange-deep: #a8221a;
  --blue: #2f6fe0;        /* bleu encre froide */
  --gold: #ffd447;        /* jaune énergie / burst */
  --red: #ff2d78;         /* alerte, distinct de l'accent principal */
  --text: #f5f1e8;
  --text-dim: #a89c8b;
  --border: #2c2620;
  --ink: #050506;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--text);
  font-family: 'Rubik', sans-serif;
  min-height: 100vh;
}

/* Fond façon trame de manga (halftone) + lueurs diffuses */
body {
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(232,56,42,0.16) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 15%, rgba(47,111,224,0.14) 0%, transparent 45%),
    radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1.2px);
  background-color: var(--void);
  background-size: auto, auto, 14px 14px;
  background-attachment: fixed;
}

h1, h2, h3, .pixel {
  font-family: 'Bungee', 'Rubik', sans-serif;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

a { color: inherit; }

/* -------- Header -------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 3px solid var(--ink);
  flex-wrap: wrap;
  gap: 0.8rem;
  background: linear-gradient(180deg, rgba(232,56,42,0.08), transparent);
}

.site-header .logo {
  font-size: 1rem;
  color: var(--orange);
  text-shadow: 0 0 12px rgba(232,56,42,0.7);
  text-decoration: none;
  letter-spacing: 1px;
}

.site-header nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 1.2rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.site-header nav a:hover { color: var(--gold); }

/* -------- Barre de recherche globale -------- */
.global-search-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
}
#global-search-input {
  width: 100%;
  background: #100e0a;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  color: var(--text);
  font-size: 0.85rem;
}
#global-search-input:focus { outline: none; border-color: var(--orange); }
#global-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #100e0a;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.global-search-group-title { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; padding: 0.5rem 0.8rem 0.2rem; }
.global-search-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
  border-top: 1px dashed var(--border);
}
.global-search-result:hover { background: rgba(232,56,42,0.1); }
.global-search-empty { padding: 0.6rem 0.8rem; font-size: 0.8rem; color: var(--text-dim); }

/* -------- Bande d'annonce (ticker) -------- */
.ticker-wrap {
  overflow: hidden;
  background: #0f0d12;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
  white-space: nowrap;
}

.ticker {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-scroll 22s linear infinite;
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 0.5px;
  font-weight: 600;
}

.ticker span { margin-right: 3rem; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* -------- Page d'accueil -------- */
.hero {
  text-align: center;
  padding: 3.5rem 1.5rem 1.5rem;
  position: relative;
}

.hero h1 {
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 0.8rem;
  text-shadow: 0 0 18px rgba(232,56,42,0.35);
}
.hero h1 .accent {
  color: var(--orange);
  text-shadow: 0 0 16px rgba(232,56,42,0.8), 0 0 32px rgba(255,212,71,0.4);
}

.hero p {
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* Aura pulsante derrière le titre : le "signature element" de la page */
.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 320px; height: 320px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255,120,90,0.22) 0%, transparent 70%);
  animation: aura-pulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

@keyframes aura-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.12); }
}

.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  max-width: 820px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

/* -------- Carte "featured" (Shinsekai en avant sur l'accueil) -------- */
.featured-game { max-width: 700px; margin: 2rem auto 0; padding: 0 1.5rem; }

.featured-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(120deg, #23150f, #100e0a);
  border: 3px solid var(--orange);
  border-radius: 6px;
  padding: 1.8rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.featured-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--orange-deep);
}

.featured-icon {
  font-size: 3.2rem;
  filter: drop-shadow(0 0 14px rgba(232,56,42,.6));
  flex-shrink: 0;
}

.featured-badge {
  display: inline-block;
  background: var(--gold);
  color: #1a1408;
  font-family: 'Bungee', sans-serif;
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
}

.featured-content h2 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  color: var(--orange);
}
.featured-content p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

@media (max-width: 520px) {
  .featured-card { flex-direction: column; text-align: center; }
}

.cabinet {
  background: linear-gradient(180deg, #1a1610, #100e0a);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 1.6rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 4px 4px 0 var(--ink);
}

.cabinet:hover {
  transform: translate(-2px, -2px);
  border-color: var(--orange);
  box-shadow: 6px 6px 0 var(--orange-deep);
}

.cabinet .icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 10px rgba(255,120,90,.55));
}

.cabinet .name {
  font-family: 'Bungee', sans-serif;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text);
}

.cabinet .desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

.cabinet .best {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
}

/* -------- Pages de jeu -------- */
.game-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
}

.game-wrap h1 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  color: var(--orange);
  text-shadow: 0 0 14px rgba(232,56,42,0.45);
}

.game-frame {
  background: #100e0a;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
  margin: 1.2rem 0;
  display: flex;
  justify-content: center;
}

canvas {
  background: #05050a;
  border-radius: 6px;
  max-width: 100%;
  touch-action: none;
}

.score-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.score-bar span.value { color: var(--gold); font-weight: 700; }

.btn {
  font-family: 'Bungee', sans-serif;
  font-size: 0.75rem;
  background: var(--orange);
  color: #17110a;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.3rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px -6px rgba(232,56,42,.6); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn:active { transform: translateY(0); }

.btn.secondary {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
}

.mobile-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.mobile-controls button {
  width: 64px;
  height: 64px;
  font-size: 1.4rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #1a1610;
  color: var(--orange);
}

/* -------- Classement -------- */
.leaderboard {
  background: #100e0a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-top: 1.5rem;
  text-align: left;
}

.leaderboard h2 {
  font-size: 0.85rem;
  color: var(--orange);
  margin-top: 0;
}

.lb-toggle {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.6rem;
}
.lb-toggle-btn { font-size: 0.7rem; padding: 0.5rem 0.9rem; }
.lb-toggle-btn.active { border-color: var(--gold); color: var(--gold); }
.lb-reward-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--gold);
  margin: 0 0 1rem;
}

.leaderboard ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}

.leaderboard li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}
.leaderboard li:last-child { border-bottom: none; }

/* Le rang est présenté comme une petite orbe d'énergie numérotée */
.leaderboard li .rank {
  color: var(--void);
  background: var(--text-dim);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 0.5rem;
}
.leaderboard li:nth-child(1) .rank { background: var(--gold); box-shadow: 0 0 10px rgba(255,212,71,0.7); }
.leaderboard li:nth-child(2) .rank { background: #d8d8d8; }
.leaderboard li:nth-child(3) .rank { background: var(--orange-deep); }

.leaderboard li .score { color: var(--gold); font-weight: 700; }

.leaderboard .empty, .leaderboard .loading {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

/* -------- Formulaire de score -------- */
.score-form {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.score-form input {
  flex: 1;
  min-width: 160px;
  background: #100e0a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-family: 'Rubik', sans-serif;
  font-size: 0.9rem;
}
.score-form input:focus {
  outline: none;
  border-color: var(--orange);
}

/* -------- Simon -------- */
.simon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  width: 280px;
  height: 280px;
  margin: 0 auto;
}

.simon-pad {
  border: none;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.1s ease, transform 0.1s ease;
  filter: saturate(0.7);
}
.simon-pad:disabled { cursor: default; }

.simon-pad.active {
  opacity: 1;
  filter: saturate(1.4) brightness(1.25);
  transform: scale(0.97);
}

.simon-pad.orange { background: var(--orange); border-radius: 100% 8px 8px 8px; }
.simon-pad.blue   { background: var(--blue);   border-radius: 8px 100% 8px 8px; }
.simon-pad.gold   { background: var(--gold);   border-radius: 8px 8px 8px 100%; }
.simon-pad.red    { background: var(--red);    border-radius: 8px 8px 100% 8px; }

.simon-pad.orange.active { box-shadow: 0 0 30px 6px rgba(232,56,42,0.8); }
.simon-pad.blue.active   { box-shadow: 0 0 30px 6px rgba(46,111,224,0.8); }
.simon-pad.gold.active   { box-shadow: 0 0 30px 6px rgba(255,212,71,0.8); }
.simon-pad.red.active    { box-shadow: 0 0 30px 6px rgba(230,57,70,0.8); }

/* -------- Multijoueur : lobby -------- */
.turn-indicator {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0.6rem 0;
  min-height: 1.4rem;
}
.turn-indicator.my-turn { color: var(--gold); font-weight: 700; }

.mp-result {
  font-family: 'Bungee', sans-serif;
  font-size: 1rem;
  margin: 0.8rem 0;
}
.mp-result.win { color: var(--gold); }
.mp-result.lose { color: var(--red); }
.mp-result.draw { color: var(--blue); }

/* -------- Multijoueur : lobby (nom + liste des parties) -------- */
.name-entry {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.name-entry input {
  background: #100e0a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-family: 'Rubik', sans-serif;
  font-size: 0.9rem;
  min-width: 160px;
}
.name-entry input:focus { outline: none; border-color: var(--orange); }

.lobby-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  text-align: left;
  max-width: 420px;
  margin-inline: auto;
}
.lobby-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #100e0a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.6rem;
}
.lobby-item .who { font-size: 0.9rem; }
.lobby-item .who b { color: var(--gold); }
.lobby-item-podium {
  border-width: 2px;
  box-shadow: 0 0 12px rgba(255, 212, 71, 0.15);
}
.lobby-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem 0;
  list-style: none;
}

/* -------- Bataille navale : grilles -------- */
.battle-grids {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.battle-block h3 {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 0.5rem;
  font-family: 'Bungee', sans-serif;
}
.battle-grid {
  display: grid;
  grid-template-columns: repeat(6, 32px);
  grid-template-rows: repeat(6, 32px);
  gap: 3px;
}
.battle-cell {
  width: 32px; height: 32px;
  border-radius: 4px;
  background: #0d3a6e;
  border: none;
}
.battle-cell.clickable { cursor: pointer; }
.battle-cell.clickable:hover { background: #1a5a9e; }
.battle-cell.ship { background: var(--text-dim); }
.battle-cell.hit { background: var(--red); }
.battle-cell.miss { background: #05050a; border: 1px solid var(--border); }

/* -------- Chasse aux artefacts -------- */
.collector-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
  background: #100e0a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  margin: 1rem 0;
}
.collector-stats > div { display: flex; flex-direction: column; }
.collector-stats .label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.collector-stats .value { font-size: 1.1rem; font-weight: 700; color: var(--gold); font-family: 'Bungee', sans-serif; }

.daily-summary-bar {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0.4rem 0 1rem;
  padding: 0.4rem;
  background: #100e0a;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.daily-summary-bar b { color: var(--text); }
.daily-summary-bar .done { color: var(--gold); }

.collector-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.collector-result {
  min-height: 1.4rem;
  font-size: 0.9rem;
  margin: 0.8rem 0;
}

.collector-quests, .collector-album {
  text-align: left;
  background: #100e0a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
}
.collector-quests h2, .collector-album h2 {
  font-size: 0.85rem;
  color: var(--orange);
  margin-top: 0;
}
.collector-quests ul { list-style: none; margin: 0; padding: 0; }
.collector-quests li {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.collector-quests li:last-child { border-bottom: none; }
.collector-quests li.done { color: var(--text); }
.collector-quests li .reward { color: var(--gold); font-size: 0.8rem; }

.collector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.collector-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  background: #0d0b08;
}
.collector-item .icon { font-size: 1.3rem; }
.collector-item .name { font-size: 0.72rem; line-height: 1.2; }
.collector-item .fuse-btn { font-size: 0.62rem; padding: 0.4rem 0.5rem; margin-top: 0.2rem; }
.collector-item .rarity { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; }
.collector-item.locked { opacity: 0.45; }
.collector-item.locked .name { color: var(--text-dim); }

/* -------- Onglets --------- */
.collector-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.2rem 0 0.5rem;
}
.tab-btn, .inv-tab-btn, .album-group-btn, .ranking-sort-btn, .hist-tab-btn, .pvp-tab-btn, .trade-tab-btn, .combat-tab-btn, .chat-tab-btn, .rules-tab-btn, .tourn-tab-btn, .market-post-tab-btn, .admin-tab-btn, .pt-sub-tab-btn, .collection-tab-btn, .pvpclasse-view-btn, .achievement-tab-btn, .minigame-tab-btn, .shop-tab-btn, .expedition-resource-btn {
  background: #100e0a;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'Rubik', sans-serif;
}
.tab-btn.active, .inv-tab-btn.active, .album-group-btn.active, .ranking-sort-btn.active, .hist-tab-btn.active, .pvp-tab-btn.active, .trade-tab-btn.active, .combat-tab-btn.active, .chat-tab-btn.active, .rules-tab-btn.active, .tourn-tab-btn.active, .market-post-tab-btn.active, .admin-tab-btn.active, .pt-sub-tab-btn.active, .collection-tab-btn.active, .pvpclasse-view-btn.active, .achievement-tab-btn.active, .minigame-tab-btn.active, .shop-tab-btn.active, .expedition-resource-btn.active {
  border-color: var(--orange);
  color: var(--orange);
  font-weight: 700;
}

/* -------- Boutique -------- */
.collector-shop { text-align: left; }
.shop-sell-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.8rem 0 1.2rem;
}
.sell-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0d0b08;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.sell-row .sell-name { font-size: 0.85rem; }
.sell-btn { font-size: 0.7rem; padding: 0.5rem 0.8rem; white-space: nowrap; }

.shop-char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
  width: 100%;
}
.formation-board {
  background: linear-gradient(160deg, #1a140c 0%, #100e0a 55%, #150c0c 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.4), 0 4px 18px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}
.formation-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(255,180,60,0.08), transparent 60%);
  pointer-events: none;
}
.formation-title {
  margin: 0 0 0.2rem;
  text-align: center;
  color: var(--gold);
  font-family: 'Bungee', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(255,212,71,0.35);
}
.formation-row-wrap { margin: 0.7rem 0; position: relative; z-index: 1; }
.formation-row-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  justify-content: center;
}
.formation-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: #0d0b08;
  border: 1px solid var(--border);
  font-size: 1rem;
}
.formation-row-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.formation-row-text small {
  display: block;
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.65rem;
  margin-top: 0.1rem;
}
.formation-row-front .formation-row-icon { border-color: #e8382a; color: #e8382a; }
.formation-row-back .formation-row-icon { border-color: #3aa0ff; color: #3aa0ff; }

.formation-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
}
.formation-row-front .formation-row { background: radial-gradient(ellipse at center, rgba(232,56,42,0.05), transparent 70%); border-radius: 10px; padding: 0.3rem; }
.formation-row-back .formation-row { background: radial-gradient(ellipse at center, rgba(58,160,255,0.05), transparent 70%); border-radius: 10px; padding: 0.3rem; }

.formation-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 0.9rem 0;
  color: var(--text-dim);
  font-size: 0.65rem;
  letter-spacing: 2px;
  font-family: 'Bungee', sans-serif;
}
.formation-divider::before, .formation-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.formation-divider span { padding: 0 0.8rem; white-space: nowrap; }

.formation-slot {
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  position: relative;
  padding: 0.5rem 0.3rem 0.6rem;
}
.formation-slot-filled {
  border: 2px solid var(--slot-color, var(--gold));
  background: #0d0b08;
  background: linear-gradient(160deg, color-mix(in srgb, var(--slot-color, var(--gold)) 18%, #0d0b08) 0%, #0d0b08 75%);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 0 10px rgba(255,212,71,0.35);
  box-shadow: 0 0 10px color-mix(in srgb, var(--slot-color, var(--gold)) 35%, transparent);
}
.formation-slot-filled:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 4px 16px rgba(255,212,71,0.5);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--slot-color, var(--gold)) 55%, transparent);
  z-index: 2;
}
.formation-slot-rarity {
  position: absolute;
  top: 3px;
  left: 3px;
  font-size: 0.5rem;
  font-weight: 800;
  color: #0e0c08;
  padding: 0.05rem 0.3rem;
  border-radius: 10px;
  font-family: 'Bungee', sans-serif;
}
.formation-slot-emoji { font-size: 1.5rem; line-height: 1; }
.formation-slot-name {
  font-size: 0.6rem;
  line-height: 1.1;
  margin-top: 0.15rem;
  padding: 0 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--text);
}
.formation-slot-stats {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
  white-space: nowrap;
}
.formation-slot-artifacts {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.4rem;
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.3rem;
}
.formation-slot-artifact {
  font-size: 0.55rem;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.formation-slot-artifact-empty {
  color: var(--text-dim);
  font-style: italic;
}
@media (max-width: 480px) {
  .formation-slot-emoji { font-size: 1.3rem; }
}

.char-card {
  background: #0d0b08;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
  min-width: 0;
  overflow-wrap: break-word;
  position: relative;
}
.char-card button { white-space: normal; word-break: break-word; }
.char-card.owned { border-color: var(--gold); }
.char-card .char-rarity-badge {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  color: #0e0c08;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  font-family: 'Bungee', sans-serif;
}
.char-card .char-name { font-size: 0.85rem; font-weight: 700; }
.char-card .char-emoji { font-size: 1.4rem; }
.char-card .char-title { font-size: 0.7rem; color: var(--text-dim); font-style: italic; }
.char-card .artifact-effect { font-size: 0.68rem; color: var(--gold); }
.char-card .char-franchise { font-size: 0.7rem; color: var(--text-dim); }
.char-card .char-stats-line { font-size: 0.65rem; color: var(--text-dim); letter-spacing: 0.2px; }
.char-card button { font-size: 0.7rem; padding: 0.55rem 0.8rem; }

/* -------- Bannière bêta -------- */
/* -------- Album (groupes) -------- */
.album-group { margin-bottom: 1.8rem; text-align: left; }
.album-group h3 {
  font-family: 'Bungee', sans-serif;
  font-size: 0.85rem;
  color: var(--orange);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.8rem;
}
.album-subheading {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0.8rem 0 0.5rem;
}
.char-card.not-owned { opacity: 0.5; }
.char-card.not-owned .char-emoji, .char-card.not-owned .char-name { filter: grayscale(1); }
.char-card.in-team { box-shadow: 0 0 0 2px var(--gold); }

.album-sort-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  margin: 0.8rem 0;
  flex-wrap: wrap;
}

.shop-details summary {
  cursor: pointer;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 0.8rem;
}
.shop-details summary h3 { color: var(--orange); }
.shop-details[open] summary { margin-bottom: 0.8rem; }

.notif-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  margin-left: 0.35rem;
  vertical-align: super;
}

.battle-board {
  background: linear-gradient(160deg, #1a140c 0%, #100e0a 55%, #150c0c 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 0.8rem;
  margin-bottom: 0.8rem;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.4), 0 4px 18px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}
.battle-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(255,180,60,0.08), transparent 60%);
  pointer-events: none;
}
.battle-arena {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  z-index: 1;
}
.battle-team { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.battle-vs {
  font-family: 'Bungee', sans-serif;
  color: var(--orange);
  font-size: 1.3rem;
  padding: 0 0.4rem;
  text-shadow: 0 0 14px rgba(255,140,40,0.6);
}
.battle-unit {
  background: #0d0b08;
  background: linear-gradient(160deg, color-mix(in srgb, var(--slot-color, var(--gold)) 15%, #0d0b08) 0%, #0d0b08 80%);
  border: 2px solid var(--slot-color, var(--border));
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  position: relative;
  box-shadow: 0 0 8px color-mix(in srgb, var(--slot-color, var(--gold)) 30%, transparent);
  transition: opacity 0.3s ease;
}
.battle-unit-rarity {
  position: absolute;
  top: 3px;
  left: 3px;
  font-size: 0.5rem;
  font-weight: 800;
  color: #0e0c08;
  padding: 0.05rem 0.3rem;
  border-radius: 10px;
  font-family: 'Bungee', sans-serif;
}
.battle-unit-emoji { font-size: 1.3rem; display: block; }
.battle-unit-name { display: block; font-weight: 700; margin: 0.15rem 0; }
.battle-hp-bar {
  width: 100%;
  height: 8px;
  background: #1a1610;
  border-radius: 20px;
  overflow: hidden;
  margin: 0.2rem 0;
}
.battle-hp-fill { height: 100%; transition: width 0.3s ease; }
.battle-hp-text { font-size: 0.65rem; color: var(--text-dim); }
.battle-log {
  text-align: left;
  min-height: 90px;
  max-height: 130px;
  overflow-y: auto;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: #0d0b08;
  padding: 0.6rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
}
.battle-log p { margin: 0.2rem 0; }

/* -------- Taux de drop -------- */
.drop-rate-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.8rem 0 1.2rem;
}
.drop-rate-list { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.drop-rate-chip {
  border: 1px solid;
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
}

/* -------- Objet vendu (visible mais quantité 0) -------- */
.collector-item.sold-out { opacity: 0.55; }
.collector-item.sold-out .name { color: var(--text-dim); }

.beta-banner {
  background: #2a1a08;
  border: 1px dashed var(--orange);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  color: var(--text);
  text-align: left;
}

/* -------- Changelog -------- */
.changelog { list-style: none; margin: 1.5rem 0; padding: 0; text-align: left; }
.changelog > li {
  background: #100e0a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.changelog-date { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.changelog h3 { font-size: 0.9rem; color: var(--orange); margin: 0.3rem 0 0.6rem; }
.changelog ul { margin: 0; padding-left: 1.2rem; font-size: 0.85rem; color: var(--text-dim); }
.changelog ul li { margin-bottom: 0.3rem; }
.changelog-wipe { color: var(--red); font-size: 0.8rem; margin: 0.6rem 0 0; }
/* Neutralise le display:flex hérité de .collector-quests/.collector-album li (prévu pour des
   listes simples "libellé ... récompense"), qui décale tout texte suivant un <b> hors du champ
   visible une fois le changelog imbriqué dans un onglet du jeu (ex. News). */
.collector-quests .changelog li, .collector-album .changelog li {
  display: block;
  border-bottom: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.collector-quests .changelog > li, .collector-album .changelog > li {
  padding: 1rem 1.2rem;
}

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 2rem 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .ticker { animation: none; }
  .hero::before { animation: none; }
  .cabinet:hover { transform: none; }
}

/* -------- Barre de recherche (Album / Boutique) -------- */
.search-input {
  width: 100%;
  background: #100e0a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-family: 'Rubik', sans-serif;
  font-size: 0.85rem;
  margin: 0.8rem 0;
}
.search-input:focus { outline: none; border-color: var(--orange); }

/* -------- Cartes cliquables (biographie) -------- */
.char-card-clickable { cursor: pointer; transition: transform 0.15s ease; }
.char-card-clickable:hover { transform: translateY(-3px); }

/* -------- Modale générique (biographie, etc.) -------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,6,0.85);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-box {
  background: linear-gradient(180deg, #1a1610, #100e0a);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 1.8rem;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  position: relative;
  box-shadow: 6px 6px 0 var(--ink);
}
.modal-box.modal-box-wide { max-width: 600px; }
.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
}
.modal-close:hover { color: var(--red); }

.bio-emoji { font-size: 3rem; margin: 0.5rem 0; }
.bio-title { color: var(--text-dim); font-style: italic; font-size: 0.85rem; margin: 0 0 0.3rem; }
.bio-meta { color: var(--gold); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 1rem; }
.bio-text { font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; }
.bio-status { font-size: 0.8rem; color: var(--text-dim); }

/* -------- Animation d'ouverture de coffre -------- */
.chest-animation-box { text-align: center; }
.chest-emoji { font-size: 4rem; }
.chest-emoji.shaking { animation: chest-shake 0.35s ease-in-out infinite; }
@keyframes chest-shake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-12deg) scale(1.05); }
  75% { transform: rotate(12deg) scale(1.05); }
}

@keyframes portal-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* -------- Liste de souhaits -------- */
.wish-progress {
  width: 100%;
  height: 8px;
  background: #0d0b08;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.wish-progress-bar { height: 100%; transition: width 0.3s ease; }

/* -------- Succès -------- */
.achievement-progress {
  width: 100%;
  height: 6px;
  background: #0d0b08;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 0.25rem;
}
.achievement-progress-bar { height: 100%; transition: width 0.3s ease; background: var(--orange); }
.achievement-progress-bar.done { background: var(--gold); }
.achievement-progress-label { font-size: 0.65rem; color: var(--text-dim); margin-top: 0.15rem; }
.wish-btn { margin-top: 0.3rem; }
.wish-btn.pinned { background: var(--gold); border-color: var(--gold); color: #141010; }
.team-position-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  background: var(--gold);
  color: #141010;
  font-weight: bold;
  font-size: 0.85rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  z-index: 2;
}

/* -------- Hub de sélection de jeux (page d'accueil du site) -------- */
.game-hub-main {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  box-sizing: border-box;
}
.game-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}
.game-hub-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, #1a1610, #100e0a);
  border: 2px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: 4px 4px 0 var(--ink);
}
.game-hub-tile:not(.disabled):hover {
  transform: translate(-2px, -2px);
  border-color: var(--gold);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
}
.game-hub-tile.disabled {
  opacity: 0.45;
  cursor: default;
}
.game-hub-emoji { font-size: 2.8rem; }
.game-hub-name { font-weight: bold; font-size: 1.1rem; color: var(--gold); }
.game-hub-desc { font-size: 0.8rem; color: var(--text-dim); }

/* -------- Thèmes de fond cosmétiques -------- */
body.bgtheme-default {
  background-image: none;
  background-color: var(--void);
}
body.bgtheme-red {
  background-image: none;
  background-color: #1a0808;
}
body.bgtheme-blue {
  background-image: none;
  background-color: #05101f;
}
body.bgtheme-green {
  background-image: none;
  background-color: #05170d;
}
body.bgtheme-purple {
  background-image: none;
  background-color: #150a1f;
}
body.bgtheme-gold {
  background-image: none;
  background-color: #1a1608;
}
body.bgtheme-halloween {
  background-color: #140a1f;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><text x='10' y='35' font-size='30' opacity='0.14'>🎃</text><text x='90' y='90' font-size='26' opacity='0.12'>🦇</text><text x='40' y='115' font-size='24' opacity='0.10'>🕷️</text></svg>");
  background-repeat: repeat;
}
/* Petites touches de design supplementaires, proposees pour renforcer l'ambiance pendant
   l'evenement sans denaturer l'identite visuelle existante (le bouton .btn utilise deja
   l'orange par defaut, donc pas de changement de couleur de base — juste un accent au survol). */
body.bgtheme-halloween .btn:hover { box-shadow: 0 8px 22px -6px rgba(139,47,217,.7); }
body.bgtheme-halloween .char-card,
body.bgtheme-halloween .formation-slot-filled { border-color: rgba(255,140,26,0.35); }

/* Thème Halloween des mini-jeux : applique a TOUS les joueurs pendant l'evenement (contrairement
   au theme de fond general, reserve a ceux sur le theme par defaut) — simple filtre de teinte sur
   le cadre de jeu, sans toucher a la logique de dessin interne de chaque mini-jeu (canvas, DOM). */
body.event-halloween-active .game-frame {
  filter: hue-rotate(-45deg) saturate(1.3);
}

.silhouette-emoji {
  font-size: 100px;
  filter: brightness(0);
  -webkit-filter: brightness(0);
  user-select: none;
  transition: filter 0.4s ease;
}
.silhouette-emoji.revealed {
  filter: none;
  -webkit-filter: none;
}
.silhouette-choice-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0.4rem auto;
  padding: 0.7rem;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.silhouette-choice-btn:hover:not(:disabled) {
  border-color: var(--gold);
}
.silhouette-choice-btn.correct { border-color: #3ecf6e; background: rgba(62,207,110,0.15); }
.silhouette-choice-btn.wrong { border-color: var(--red); background: rgba(232,56,42,0.15); }
.silhouette-choice-btn:disabled { cursor: default; opacity: 0.85; }

.memory-grid {
  display: grid;
  gap: 8px;
  justify-content: center;
  margin: 0 auto;
  max-width: 480px;
}
.memory-card {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  user-select: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.memory-card:not(.revealed):not(.matched):hover {
  border-color: var(--gold);
}
.memory-card.revealed, .memory-card.matched {
  background: rgba(255,255,255,0.08);
}
.memory-card.matched {
  border-color: #3ecf6e;
  background: rgba(62,207,110,0.12);
  cursor: default;
}
.memory-card.hidden-face {
  color: transparent;
}
