/* ────────────────────────────────────────────────────────────────
   Styles — Tracker Aura Kingdom
   ──────────────────────────────────────────────────────────────── */

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

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0d0d1a;
  color: #e0e0e0;
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Header / Horloges ────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 2rem 1rem;
  text-align: center;
  border-bottom: 2px solid #e94560;
}

header h1 {
  font-size: 1.8rem;
  color: #e94560;
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.clocks-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.clock-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(233, 69, 96, 0.3);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  min-width: 200px;
  backdrop-filter: blur(10px);
}

.clock-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 0.3rem;
}

.clock-card .time {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.clock-card .date {
  font-size: 1rem;
  color: #aaa;
}

/* ── Section Instances ────────────────────────────────────────── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

main h2 {
  text-align: center;
  font-size: 1.5rem;
  color: #e94560;
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}

.instances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ── Carte Instance ────────────────────────────────────────────── */
.instance-card {
  background: linear-gradient(145deg, #1e1e30, #16162a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.instance-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(233, 69, 96, 0.15);
}

.instance-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
  background: rgba(0,0,0,0.3);
}

.instance-card h3 {
  padding: 0.8rem 1rem 0.2rem;
  font-size: 1.1rem;
  color: #fff;
}

.instance-card small.instance-zone {
  display: block;
  padding: 0 1rem 0.4rem;
  font-size: 0.8rem;
  color: #7dd3fc;
  font-style: italic;
}

.instance-card p {
  padding: 0.1rem 1rem 0.6rem;
  font-size: 0.85rem;
  color: #aaa;
}

.instance-status {
  font-weight: 600;
  font-size: 0.9rem;
}

.instance-status.available {
  color: #4ade80;
}

.instance-status.pending {
  color: #facc15;
}

.instance-next-reset {
  color: #7dd3fc;
  font-size: 0.85rem;
}

.instance-countdown {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: #e94560;
  text-align: center;
  padding: 0.4rem 1rem 0.8rem;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.3rem;
  }

  .clocks-grid {
    flex-direction: column;
    align-items: center;
  }

  .clock-card .time {
    font-size: 1.6rem;
  }

  .instances-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  header {
    padding: 1rem 0.5rem;
  }

  .clock-card {
    min-width: 160px;
    padding: 0.7rem 1rem;
  }
}

/* ────────────────────────────────────────────────────────────────
   Styles — Poissons-rois
   ──────────────────────────────────────────────────────────────── */

/* ── Section Poissons-rois ─────────────────────────────────────── */
main h2.fish-section-title {
  margin-top: 3rem;
}

.fish-kings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ── Carte Poisson-roi ─────────────────────────────────────────── */
.fish-king-card {
  background: linear-gradient(145deg, #1e1e30, #16162a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fish-king-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(233, 69, 96, 0.15);
}

/* ── Mode : En cours (pendant 30 min après le spawn) ───────────── */
.fish-king-card-en-cours {
  border-color: rgba(250, 204, 21, 0.5);
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.15), inset 0 0 30px rgba(250, 204, 21, 0.03);
  animation: pulse-en-cours 2s ease-in-out infinite;
}

.fish-king-card-en-cours .fish-king-name {
  color: #facc15;
}

@keyframes pulse-en-cours {
  0%, 100% { box-shadow: 0 0 25px rgba(250, 204, 21, 0.15); }
  50% { box-shadow: 0 0 40px rgba(250, 204, 21, 0.3); }
}

.en-cours-badge {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(250, 204, 21, 0.3);
}

/* ── Mode : Prochain (à venir) ─────────────────────────────────── */
.fish-king-card-prochain {
  border-color: rgba(74, 222, 128, 0.4);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.1);
}

.fish-king-card-prochain .fish-king-name {
  color: #4ade80;
}

/* Prochain badge icon — small icon only, no overlap */
.fish-king-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1;
  color: #4ade80;
  cursor: default;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.fish-king-card-prochain .fish-king-badge-icon.prochain-badge {
  color: #4ade80;
}

/* ── Mode : Passé ──────────────────────────────────────────────── */
.fish-king-card-passe {
  opacity: 0.55;
  border-color: rgba(255, 255, 255, 0.03);
}

.passe-badge {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(150, 150, 150, 0.15);
  color: #999;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(150, 150, 150, 0.3);
}

.fish-king-name {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
}

/* Title row: flex container for title + icon — no overlap ever */
.fish-king-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
}

.fish-king-title-row .fish-king-name {
  flex: 1 1 auto;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.fish-king-map {
  font-size: 0.85rem;
  color: #7dd3fc;
  font-style: italic;
  margin: 0;
}

.fish-king-bait {
  font-size: 0.85rem;
  color: #aaa;
  margin: 0;
}

.bait-icon {
  margin-right: 0.3rem;
}

.fish-king-hours {
  font-size: 0.9rem;
  color: #e94560;
  font-weight: 600;
  font-family: "Courier New", Courier, monospace;
  margin: 0;
}

/* ── Section countdown prochain spawn ──────────────────────────── */
.fish-king-countdown-section {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid rgba(233, 69, 96, 0.3);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.next-spawn-name {
  color: #4ade80;
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  text-align: center;
  width: 100%;
}

.countdown-values-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.next-spawn-hour {
  color: #e94560;
  font-weight: 700;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.2rem;
  margin: 0;
  white-space: nowrap;
}

.next-spawn-countdown {
  color: #fff;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  min-width: 120px;
}

/* Message si tous les spawns sont passés */
.all-spawns-passed {
  grid-column: 1 / -1;
  text-align: center;
  color: #aaa;
  font-style: italic;
  padding: 1.5rem;
  font-size: 1rem;
}

/* Message si aucune donnée */
.no-data {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 2rem;
  font-size: 1rem;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .fish-kings-grid {
    grid-template-columns: 1fr;
  }

  .fish-king-countdown-section {
    gap: 0.6rem;
  }

  .fish-king-card-en-cours {
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.1);
  }
}

@media (max-width: 480px) {
  .fish-king-card {
    padding: 1rem;
  }

  .fish-king-countdown-section {
    padding: 0.8rem 1rem;
  }

  .next-spawn-countdown {
    font-size: 1.2rem;
  }
}

/* ────────────────────────────────────────────────────────────────
   Styles — Navigation tabs
   ──────────────────────────────────────────────────────────────── */

.content-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem auto 1.5rem;
  max-width: 400px;
}

.nav-tab {
  flex: 1;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid rgba(233, 69, 96, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.nav-tab:hover {
  background: rgba(233, 69, 96, 0.1);
  color: #e0e0e0;
  border-color: rgba(233, 69, 96, 0.5);
}

.nav-tab.active {
  background: rgba(233, 69, 96, 0.15);
  color: #e94560;
  border-color: #e94560;
  box-shadow: 0 0 15px rgba(233, 69, 96, 0.1);
}

/* ────────────────────────────────────────────────────────────────
   Styles — Archéologie cartes
   ──────────────────────────────────────────────────────────────── */

.archeologie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.archeo-card {
  background: linear-gradient(145deg, #1e1e30, #16162a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.archeo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(233, 69, 96, 0.15);
}

.archeo-card .fish-king-name {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
}

.archeo-card .fish-king-map {
  font-size: 0.85rem;
  color: #7dd3fc;
  font-style: italic;
  margin: 0;
}

.archeo-card .fish-king-hours {
  font-size: 0.9rem;
  color: #e94560;
  font-weight: 600;
  margin: 0;
}

/* Categories row: Bleu, Rouge, Jaune */
.archeo-categories-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.archeo-category {
  display: flex;
  flex-direction: column;
  border: 1px solid;
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  gap: 0.2rem;
}

.archeo-cat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

.archeo-item-badge {
  display: block;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .content-nav {
    max-width: 100%;
    padding: 0 1rem;
  }

  .nav-tab {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
  }

  .archeologie-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .content-nav {
    gap: 0.3rem;
  }

  .nav-tab {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .archeo-item-badge {
    font-size: 0.65rem;
    max-width: 120px;
  }
}

/* ────────────────────────────────────────────────────────────────
   Styles — ✨ Souhaits Eido
   ──────────────────────────────────────────────────────────────── */

.eidolon-section-title {
  margin-top: 3rem;
}

/* Layout: list left, detail right on desktop; stacked on mobile */
.eidolon-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.eidolon-list-wrap {
  flex: 1 1 45%;
  min-width: 0;
}

.eidolon-detail-area {
  flex: 1 1 45%;
  min-width: 0;
}

/* Search */
.eidolon-search-wrap {
  margin-bottom: 1rem;
}

.eidolon-search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 2px solid rgba(233, 69, 96, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  outline: none;
  transition: border-color 0.2s ease;
}

.eidolon-search-input::placeholder {
  color: #888;
}

.eidolon-search-input:focus {
  border-color: #e94560;
  box-shadow: 0 0 12px rgba(233, 69, 96, 0.15);
}

/* List grid */
.eidolon-list-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* List card */
.eidolon-list-card {
  background: linear-gradient(145deg, #1e1e30, #16162a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.2s ease;
}

.eidolon-list-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(233, 69, 96, 0.12);
  border-color: rgba(233, 69, 96, 0.35);
}

.eidolon-list-card-active {
  border-color: #e94560;
  box-shadow: 0 0 18px rgba(233, 69, 96, 0.2);
}

.eidolon-title-row {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.eidolon-name {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
}

/* No results */
.eidolon-no-results {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 1.5rem;
  font-size: 0.95rem;
}

/* Detail card */
.eidolon-detail-card {
  background: linear-gradient(145deg, #1e1e30, #16162a);
  border: 1px solid rgba(233, 69, 96, 0.25);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.eidolon-detail-name {
  font-size: 1.3rem;
  color: #e94560;
  font-weight: 700;
}

.eidolon-detail-msg {
  font-size: 0.95rem;
  color: #aaa;
  font-style: italic;
}

.eidolon-detail-link {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e94560;
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid rgba(233, 69, 96, 0.4);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.eidolon-detail-link:hover {
  background: rgba(233, 69, 96, 0.2);
  color: #fff;
}

/* ── Responsive: stack on mobile ─────────────────────────────── */
@media (max-width: 768px) {
  .eidolon-layout {
    flex-direction: column;
  }

  .eidolon-list-wrap,
  .eidolon-detail-area {
    flex: 1 1 100%;
  }
}

/* ── Wishes rendering ────────────────────────────────────────── */

.eidolon-detail-name {
  font-size: 1.3rem;
  color: #e94560;
  font-weight: 700;
}

.eidolon-detail-link {
  display: inline-block;
  margin: 0.4rem 0 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e94560;
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid rgba(233, 69, 96, 0.4);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.eidolon-detail-link:hover {
  background: rgba(233, 69, 96, 0.2);
  color: #fff;
}

.eidolon-detail-msg {
  font-size: 0.95rem;
  color: #aaa;
  font-style: italic;
}

/* Wishes list */
.eidolon-wishes-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Single wish card */
.eidolon-wish-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(233, 69, 96, 0.15);
  border-radius: 12px;
  overflow: hidden;
}

.eidolon-wish-header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.6rem 1rem;
  background: rgba(233, 69, 96, 0.08);
  border-bottom: 1px solid rgba(233, 69, 96, 0.15);
}

.eidolon-wish-level {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e94560;
}

.eidolon-wish-levelreq {
  font-size: 0.8rem;
  color: #7dd3fc;
  font-style: italic;
}

.eidolon-wish-items {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.3rem;
}

.eidolon-wish-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  border-radius: 8px;
  transition: background 0.15s ease;
  min-width: 0;
  flex-wrap: wrap;
}

.eidolon-wish-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.eidolon-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
}

.eidolon-item-name {
  font-size: 0.88rem;
  color: #e0e0e0;
  text-decoration: none;
  border-bottom: 1px dashed rgba(233, 69, 96, 0.3);
  flex: 1 1 auto;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.eidolon-item-name:hover {
  color: #e94560;
  border-color: #e94560;
}

.eidolon-item-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: #facc15;
  font-family: "Courier New", Courier, monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Sources d'obtention sous les objets ───────────────────── */
.eidolon-item-sources {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  margin-top: 0.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(233, 69, 96, 0.2);
}

.eidolon-item-source {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #b0b0b0;
}

.eidolon-source-method {
  font-weight: 700;
  color: #e94560;
  white-space: nowrap;
  flex-shrink: 0;
}

.eidolon-source-name a {
  color: #7dd3fc;
  text-decoration: none;
  border-bottom: 1px dashed rgba(125, 211, 252, 0.3);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.eidolon-source-name a:hover {
  color: #e94560;
  border-color: #e94560;
}

.eidolon-source-zone {
  color: #a78bfa;
  font-style: italic;
  white-space: nowrap;
  flex-shrink: 0;
}

.eidolon-source-coords {
  color: #facc15;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.eidolon-item-obtention-note {
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
  margin-left: 0.5rem;
}

/* ── Responsive mobile ─────────────────────────────────────── */
@media (max-width: 600px) {
  .eidolon-item-source {
    font-size: 0.72rem;
    gap: 0.25rem;
  }

  .eidolon-source-coords {
    font-size: 0.7rem;
  }
}

/* ── Fabrication (craft) ───────────────────────────────────── */
.eidolon-source-craft {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding-left: 0.75rem;
}

.eidolon-craft-ingredients {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  margin-left: 0.5rem;
}

.eidolon-craft-label {
  font-weight: 600;
  color: #c0c0c0;
}

.eidolon-craft-ing a {
  color: #7dd3fc;
  text-decoration: none;
  border-bottom: 1px dashed rgba(125, 211, 252, 0.3);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.eidolon-craft-ing a:hover {
  color: #e94560;
  border-color: #e94560;
}

.eidolon-craft-costs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.74rem;
  margin-left: 0.5rem;
}

.eidolon-craft-cost {
  color: #facc15;
  font-family: "Courier New", Courier, monospace;
}

/* ── Responsive mobile ─────────────────────────────────────── */
@media (max-width: 600px) {
  .eidolon-item-source {
    font-size: 0.72rem;
    gap: 0.25rem;
  }

  .eidolon-source-coords {
    font-size: 0.7rem;
  }

  .eidolon-craft-ingredients,
  .eidolon-craft-costs {
    font-size: 0.7rem;
    margin-left: 0.3rem;
  }
}

/* ── Result count under search ───────────────────────────────── */
.eidolon-result-count {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.4rem;
}

/* ────────────────────────────────────────────────────────────────

/* ────────────────────────────────────────────────────────────────
   Styles — ✨ Souhaits Eido : sticky corrigé
   ──────────────────────────────────────────────────────────────── */

/* Le <main> ne doit pas clipper le sticky */
main {
  overflow: visible;
}

/* ── Section wrapper : conteneur de défilement unique ─────────── */
#eidolon-souhaits-section {
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Layout flex dans le section ──────────────────────────────── */
.eidolon-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  min-height: 0; /* permet au flex de calculer correctement */
}

/* ── Côté gauche : recherche + liste ──────────────────────────── */
.eidolon-list-wrap {
  flex: 1 1 45%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* Pas de max-height ici — le parent #section gère le scroll */
}

/* Recherche et compteur restent fixes au-dessus de la liste */
.eidolon-search-wrap,
.eidolon-result-count {
  flex-shrink: 0;
}

/* La grille de liste défile indépendamment dans son wrap */
.eidolon-list-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 0.5rem;
}

/* ── Côté droit : fiche détaillée (sticky) ───────────────────── */
.eidolon-detail-area {
  flex: 1 1 45%;
  min-width: 0;
  position: sticky;
  top: 16px;
  align-self: flex-start;
}

/* La fiche défile intérieurement si le contenu dépasse */
.eidolon-detail-card {
  background: linear-gradient(145deg, #1e1e30, #16162a);
  border: 1px solid rgba(233, 69, 96, 0.25);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

/* Scrollbars stylées */
.eidolon-list-grid::-webkit-scrollbar,
.eidolon-detail-card::-webkit-scrollbar {
  width: 6px;
}

.eidolon-list-grid::-webkit-scrollbar-track,
.eidolon-detail-card::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.eidolon-list-grid::-webkit-scrollbar-thumb,
.eidolon-detail-card::-webkit-scrollbar-thumb {
  background: rgba(233, 69, 96, 0.4);
  border-radius: 3px;
}

.eidolon-list-grid::-webkit-scrollbar-thumb:hover,
.eidolon-detail-card::-webkit-scrollbar-thumb:hover {
  background: rgba(233, 69, 96, 0.7);
}

/* ── Responsive mobile : empilement naturel ──────────────────── */
@media (max-width: 768px) {
  #eidolon-souhaits-section {
    height: auto;
    max-height: none;
    overflow-y: visible;
  }

  .eidolon-layout {
    flex-direction: column;
  }

  .eidolon-list-wrap {
    max-height: none;
  }

  .eidolon-list-grid {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .eidolon-detail-card {
    max-height: none;
    overflow-y: visible;
  }

  .eidolon-detail-area {
    position: static;
  }
}
