:root {
  --white: #ffffff;
  --off-white: #fafafa;
  --accent: #8b6914;
  --accent-light: #c4a44a;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-blur: blur(20px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --top-bar-height: 64px;
}

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

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f5f5f3;
  font-family: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#container {
  position: relative;
  height: 100%;
  width: 100%;
}

#sidebar {
  position: fixed;
  top: var(--top-bar-height);
  left: 0;
  bottom: 0;
  width: 380px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 0;
  box-shadow: 1px 0 12px rgba(0, 0, 0, 0.06);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(-100%);
  pointer-events: none;
  transition: transform 0.35s var(--ease-out);
}

#sidebar.open {
  transform: translateX(0);
  pointer-events: auto;
}

#sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 24px;
}

#sidebar img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 8px;
}

#sidebar .empty {
  color: #999;
  font-style: italic;
  font-size: 0.9rem;
}

/* Conteneur HRE */
#hre-container {
  display: none;
  position: fixed;
  top: var(--top-bar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: #f8f5ee;
  overflow: auto;
  z-index: 1;
}

#hre-container svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 100%;
}

/* Onglets */
#tabs-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tab {
  flex: 0 0 auto;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 100px;
  color: #666;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  transition: all 0.25s ease;
  text-align: center;
  letter-spacing: 0.01em;
}

.tab:hover {
  background: rgba(139, 105, 20, 0.06);
  border-color: rgba(139, 105, 20, 0.25);
  color: #1a1a1a;
}

.tab.active {
  color: #fff;
  font-weight: 500;
  background: #1a1a1a;
  border-color: #1a1a1a;
}

/* Modal donation */
.modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  background: white;
  margin: 8% auto;
  padding: 40px;
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #333;
}

.modal-content h3 {
  margin-top: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: #1a1a1a;
  font-size: 1.6em;
  font-weight: 500;
  margin-bottom: 28px;
  text-align: center;
}

.donation-option {
  margin: 20px 0;
  padding: 24px;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.donation-option:hover {
  border-color: rgba(139, 105, 20, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.donation-option h4 {
  margin-top: 0;
  color: #1a1a1a;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.donation-option p {
  color: #666;
  font-size: 13px;
  margin: 8px 0;
}

.donation-link-btn {
  display: inline-block;
  background: #1a1a1a;
  color: white;
  padding: 12px 28px;
  border-radius: 100px;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.3s;
  margin-top: 8px;
}

.donation-link-btn:hover {
  background: #333;
}

.usdt-address-container {
  margin: 15px 0;
}

.usdt-address {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  background: #fafafa;
  color: #333;
  margin-bottom: 10px;
}

.copy-btn {
  background: #1a1a1a;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 100px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.3s;
  width: 100%;
}

.copy-btn:hover {
  background: #333;
}

.copy-btn.copied {
  background: #2d8a4e;
}

/* Roadmap modal */
.roadmap-section {
  margin: 20px 0;
}

.roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 16px;
  margin: 10px 0;
  border-radius: 12px;
  border-left: 3px solid #e0e0e0;
  background: #fafafa;
  transition: all 0.25s ease;
}

.roadmap-item:hover {
  background: #f5f5f3;
  transform: translateX(2px);
}

.roadmap-item.completed {
  border-left-color: #2d8a4e;
  background: #f0f8f3;
}

.roadmap-item.in-progress {
  border-left-color: #8b6914;
  background: #fdf8ef;
}

.roadmap-item.planned {
  border-left-color: #5a7ca5;
  background: #f3f6fa;
}

.roadmap-item.future {
  border-left-color: #ccc;
  background: #fafafa;
}

.roadmap-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.roadmap-details h4 {
  margin: 0 0 5px 0;
  color: #1a1a1a;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
}

.roadmap-details p {
  margin: 0;
  color: #666;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* Boutons */
.btn {
  background: #1a1a1a;
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 100px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.25s;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  background: #333;
}

.btn:disabled {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
}

#reset-btn {
  display: none;
  margin-bottom: 12px;
  width: auto;
  font-size: 0.8rem;
  padding: 8px 18px;
}


/* Contenu blason */
.blason-image-container {
  margin: 20px 0;
  position: relative;
}

.blason-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b6914;
  margin-bottom: 6px;
}

.blason-image {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: zoom-in;
  transition: opacity 0.2s, transform 0.3s;
}

.blason-image:hover {
  opacity: 0.92;
  transform: scale(1.01);
}

/* Modal image zoom */
#image-modal {
  display: none;
  position: fixed;
  z-index: 4000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

#image-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

#image-modal-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 4001;
  transition: color 0.2s;
}

#image-modal-close:hover {
  color: #ccc;
}

.image-unavailable {
  display: none;
  color: #999;
  font-size: 0.82rem;
  font-style: italic;
  padding: 20px;
  text-align: center;
  background: #fafafa;
  border-radius: 10px;
}

/* Map */
#map {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  transition: opacity 0.3s ease;
}

/* Masquer la carte pendant le routing initial si hash présent */
#map.map-loading {
  opacity: 0;
}

/* Responsive */
@media (max-width: 768px) {
  #top-bar {
    padding: 0 12px;
    gap: 8px;
  }

  .top-bar-logo {
    font-size: 1rem;
  }

  #top-bar #tabs-container {
    justify-content: flex-start;
  }

  #sidebar {
    width: 300px;
  }
}

@media (max-width: 480px) {
  .top-bar-actions .top-bar-btn {
    display: none;
  }
}

/* Marqueurs Odysseus */
.odysseus-marker {
  width: 30px;
  height: 30px;
  background: #8B4513;
  color: white;
  border: 2px solid #F5E6C8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.2s;
}

.odysseus-marker:hover {
  transform: scale(1.2);
}

.odysseus-path {
  stroke: #8B4513;
  stroke-width: 2;
  stroke-dasharray: 8, 6;
  fill: none;
}

/* Marqueurs capitales Japon */
.japan-capital-marker {
  width: 14px;
  height: 14px;
  background: #BC002D;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.2s;
}

.japan-capital-marker:hover {
  transform: scale(1.4);
}

/* ─── TOP BAR ─── */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  height: var(--top-bar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.top-bar-logo {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

#top-bar #tabs-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: visible;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Tab groups with dropdown */
.tab-group {
  position: relative;
}

.tab-category {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 100px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.tab-category:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: white;
}

/* Highlight category when one of its children is active */
.tab-group.has-active .tab-category {
  color: var(--accent);
  border-color: var(--accent);
}

.tab-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 8px;
  padding-top: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 2001;
  min-width: 160px;
  animation: fadeUp 0.2s var(--ease-out);
}

.tab-dropdown::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.tab-group:hover .tab-dropdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab-dropdown .tab {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.tab-dropdown .tab:hover {
  background: rgba(139, 105, 20, 0.08);
  color: var(--accent);
  border: none;
}

.tab-dropdown .tab.active {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  border: none;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.top-bar-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.top-bar-btn:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: white;
}

.top-bar-menu-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.top-bar-menu-btn:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: white;
}

.top-bar-dropdown {
  position: absolute;
  top: calc(var(--top-bar-height) + 8px);
  right: 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 14px;
  padding: 12px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  z-index: 2001;
}

.top-bar-dropdown a,
.top-bar-dropdown span {
  display: block;
  padding: 10px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.85rem;
  transition: background 0.2s;
}

.top-bar-dropdown a:hover {
  background: rgba(0, 0, 0, 0.04);
}

.top-bar-dropdown span {
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 4px;
  padding-top: 12px;
}

/* ─── OVERLAY CLOSE ─── */
#overlay-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
  line-height: 1;
  padding: 4px;
}

#overlay-close:hover {
  color: var(--text-primary);
}

/* ─── BREADCRUMB ─── */
#breadcrumb {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: none;
}

#breadcrumb span {
  cursor: pointer;
  transition: color 0.2s;
}

#breadcrumb span:hover {
  color: var(--text-primary);
}

#breadcrumb .breadcrumb-sep {
  color: var(--accent);
  margin: 0 6px;
  cursor: default;
}

#breadcrumb .breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
  cursor: default;
}

#breadcrumb .breadcrumb-current:hover {
  color: var(--text-primary);
}
