/* =====================================================================
   FORGE DES ÂGES · Thème Refonte (surcharge styles.css)
   Dark fantasy · parchemin & forge · glow doré · glassmorphism subtil
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=IM+Fell+English:ital@0;1&family=Inter:wght@400;500;600&display=swap');

:root {
  --gold: #e6b958;
  --gold-bright: #ffd986;
  --gold-deep: #8a6018;
  --ember: #ff7a3c;
  --ember-glow: rgba(255, 122, 60, 0.45);
  --parchment: #f3e6c8;
  --parchment-dim: #c9b68a;
  --ink: #1a1209;
  --bg-0: #0d0805;
  --bg-1: #1a120a;
  --bg-2: #261a10;
  --bg-3: #33241730;
  --border-soft: rgba(230, 185, 88, 0.18);
  --border-mid:  rgba(230, 185, 88, 0.35);
  --border-strong: rgba(230, 185, 88, 0.65);
  --shadow-deep: 0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 24px rgba(230, 185, 88, 0.18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* ---------- Fond global animé : forge + parchemin ---------- */
html, body {
  background: var(--bg-0);
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--parchment);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 122, 60, 0.12), transparent 60%),
    radial-gradient(900px 700px at 100% 100%, rgba(230, 185, 88, 0.07), transparent 60%),
    radial-gradient(700px 500px at 0% 80%, rgba(255, 122, 60, 0.05), transparent 60%),
    linear-gradient(180deg, #0d0805 0%, #1a120a 60%, #0d0805 100%);
  background-attachment: fixed;
  position: relative;
  padding: 18px 14px 24px;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.75  0 0 0 0 0.45  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ---------- En-tête : logo + titre stylisé ---------- */
body > div:first-of-type {
  margin-top: 4px !important;
  margin-bottom: 4px !important;
}
body > div:first-of-type img {
  width: 140px !important;
  filter: drop-shadow(0 0 18px rgba(230, 185, 88, 0.35)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
  transition: transform 0.4s ease, filter 0.4s ease;
}
body > div:first-of-type img:hover {
  transform: scale(1.04) rotate(-1deg);
  filter: drop-shadow(0 0 28px rgba(255, 217, 134, 0.55)) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}
/* Titre retire : deja present dans le logo */

/* ---------- Bouton bascule mobile : discret en haut ---------- */
#toggleMobileViewBtn {
  background: transparent;
  color: var(--parchment-dim);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.25s ease;
}
#toggleMobileViewBtn:hover { color: var(--gold-bright); border-color: var(--border-mid); }

/* ---------- Onglets principaux ---------- */
#tabs {
  background: transparent;
  border: none;
  padding: 0;
  margin: 18px auto 22px;
  display: inline-flex;
  gap: 4px;
  background: rgba(13, 8, 5, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 4px;
}
.tab-button {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.12em;
  font-size: 13px;
  padding: 8px 22px;
  border-radius: 999px;
  background: transparent;
  color: var(--parchment-dim);
  border: none;
  transition: all 0.25s ease;
  text-transform: uppercase;
}
.tab-button:hover { color: var(--gold-bright); background: rgba(230, 185, 88, 0.06); }
.tab-button.active {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--ink);
  box-shadow: 0 0 18px rgba(230, 185, 88, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ---------- Bannière saison + âge + exploration ---------- */
#seasonDisplay, #techBanner, #explorationDisplay {
  background: rgba(26, 18, 10, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.06em;
  color: var(--parchment);
  box-shadow: var(--shadow-deep);
}
#seasonDisplay .icon, #explorationDisplay .icon { filter: drop-shadow(0 0 6px rgba(255, 217, 134, 0.4)); }
#techBanner {
  background: linear-gradient(135deg, rgba(230, 185, 88, 0.12), rgba(255, 122, 60, 0.08));
  border-color: var(--border-mid);
  font-style: normal;
}
#currentAgeDisplay {
  font-family: 'Cinzel', serif;
  color: var(--gold-bright);
  text-shadow: 0 0 8px rgba(230, 185, 88, 0.4);
  font-size: 16px;
}

.progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.progress {
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 12px rgba(230, 185, 88, 0.6);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.exploration-progress-bar {
  height: 5px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}
.exploration-progress {
  background: linear-gradient(90deg, #4CAF50, #8BE78B);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

/* ---------- Narration : parchemin ---------- */
#narrative {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 17px;
  color: #120a02;
  background:
    linear-gradient(180deg, rgba(255, 235, 180, 0.98), rgba(240, 215, 160, 0.96));
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius-md);
  padding: 16px 26px;
  max-width: 640px;
  box-shadow:
    var(--shadow-deep),
    0 0 24px rgba(230, 185, 88, 0.25),
    inset 0 0 30px rgba(138, 96, 24, 0.22),
    inset 0 0 0 1px rgba(255, 250, 230, 0.7);
  position: relative;
  line-height: 1.55;
  text-shadow: 0 1px 0 rgba(255, 250, 230, 0.5);
  letter-spacing: 0.01em;
}
#narrative::before, #narrative::after {
  content: "❧";
  color: var(--gold-deep);
  margin: 0 6px;
  font-size: 14px;
}

/* ---------- Ressources ---------- */
#resources {
  background: rgba(13, 8, 5, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-deep);
  max-width: 1100px;
}
.resource {
  background: linear-gradient(180deg, rgba(38, 26, 16, 0.85), rgba(26, 18, 10, 0.85));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.resource::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120px 60px at 50% 0%, rgba(230, 185, 88, 0.18), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.resource:hover { border-color: var(--border-mid); transform: translateY(-2px); }
.resource:hover::before { opacity: 1; }
.resource p {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--parchment);
}
.resource .icon {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(255, 217, 134, 0.35));
}

/* Boutons de recolte en masse +5 / +50 / +500 */
.bulk-btn {
  display: inline-block;
  margin: 2px 1px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, rgba(255, 217, 134, 0.18), rgba(13, 8, 5, 0.5));
  color: var(--gold-bright);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.18s ease;
}
.bulk-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: var(--ink);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(230, 185, 88, 0.4);
  transform: translateY(-1px);
}
.bulk-btn[hidden] { display: none !important; }
.bulk-btn.bulk-unlock-flash {
  animation: bulkUnlock 1.6s ease;
}
@keyframes bulkUnlock {
  0%   { transform: scale(0.8); box-shadow: 0 0 0 rgba(255, 217, 134, 0); }
  30%  { transform: scale(1.15); box-shadow: 0 0 24px 6px rgba(255, 217, 134, 0.7); background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--ink); }
  100% { transform: scale(1);   box-shadow: none; }
}

/* ---------- Boutons généraux ---------- */
button {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  color: var(--ink);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 18px rgba(230, 185, 88, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.5);
  filter: brightness(1.08);
}
button:active:not(:disabled) { transform: translateY(0); filter: brightness(0.95); }
button:disabled {
  background: linear-gradient(180deg, #4a3f2e, #2b2218);
  color: rgba(243, 230, 200, 0.4);
  border-color: rgba(230, 185, 88, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-shadow: none;
  cursor: not-allowed;
}

/* ---------- Tooltips ---------- */
.tooltip {
  font-size: 11px;
  font-style: italic;
  color: var(--parchment-dim);
  margin-top: 4px;
  line-height: 1.4;
}

/* ---------- Sections (Fabrication, Bâtiments, Main-d'œuvre, Indices, Reliques) ---------- */
.columns {
  gap: 16px;
  max-width: 1200px;
}
.section {
  background: rgba(13, 8, 5, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-deep);
  max-width: 320px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.section:hover { border-color: var(--border-mid); box-shadow: var(--shadow-deep), var(--shadow-glow); }
.section h2 {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
  text-shadow: 0 0 8px rgba(230, 185, 88, 0.3);
}

.craft, .worker, .relic {
  background: linear-gradient(180deg, rgba(38, 26, 16, 0.8), rgba(26, 18, 10, 0.6));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 10px;
  margin: 8px 0;
  transition: all 0.25s ease;
  cursor: grab;
}
.craft:hover, .worker:hover, .relic:hover {
  border-color: var(--border-mid);
  background: linear-gradient(180deg, rgba(48, 33, 20, 0.9), rgba(36, 25, 14, 0.8));
}
.craft:active { cursor: grabbing; }
.craft p, .worker p, .relic p {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--parchment);
}

/* ---------- Section Indices : mise en avant ---------- */
#hintSection {
  background: linear-gradient(180deg, rgba(255, 122, 60, 0.08), rgba(13, 8, 5, 0.6));
  border-color: rgba(255, 122, 60, 0.25);
  position: relative;
}
#hintSection::before {
  content: "💡";
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid var(--bg-1);
  box-shadow: 0 0 16px rgba(255, 217, 134, 0.5);
  animation: hintPulse 2.4s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 217, 134, 0.4); }
  50%      { box-shadow: 0 0 22px rgba(255, 217, 134, 0.7); }
}
#noHintMessage {
  color: var(--parchment-dim);
  font-style: italic;
  font-size: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  margin: 8px 0;
}
#hintCost {
  color: var(--ember);
  font-size: 11px;
  font-weight: 600;
  margin: 6px 0;
}
#purchasedHintsList {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
#purchasedHintsList li {
  background: linear-gradient(135deg, rgba(255, 240, 200, 0.98), rgba(245, 222, 172, 0.95));
  color: #14090a;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.5;
  padding: 14px 20px 14px 22px;
  margin: 10px 0;
  border-radius: var(--radius-md);
  border-left: 5px solid var(--gold);
  box-shadow:
    inset 0 0 26px rgba(138, 96, 24, 0.22),
    inset 0 0 0 1px rgba(255, 250, 230, 0.6),
    0 4px 14px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 0 rgba(255, 250, 230, 0.5);
  position: relative;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#purchasedHintsList li:hover {
  transform: translateX(2px);
  box-shadow:
    inset 0 0 26px rgba(138, 96, 24, 0.22),
    inset 0 0 0 1px rgba(255, 250, 230, 0.6),
    0 6px 18px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(230, 185, 88, 0.25);
}
#purchasedHintsList li::before {
  content: "✦";
  color: var(--gold-deep);
  margin-right: 10px;
  font-weight: bold;
  font-size: 16px;
  text-shadow: 0 0 4px rgba(230, 185, 88, 0.4);
}
#purchasedHintsList li.hint-fresh {
  animation: hintFresh 1.6s ease;
}
@keyframes hintFresh {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 217, 134, 0.9); }
  30%  { transform: scale(1.03); box-shadow: 0 0 30px 4px rgba(255, 217, 134, 0.6); }
  100% { transform: scale(1);    box-shadow: inset 0 0 20px rgba(138, 96, 24, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4); }
}

/* ---------- Villages ---------- */
#villagesDisplay {
  background: rgba(13, 8, 5, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-deep);
  max-width: 460px;
}
#villagesDisplay h2 {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-bright);
  font-size: 14px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
#villagesList li {
  background: linear-gradient(90deg, rgba(38, 26, 16, 0.8), rgba(26, 18, 10, 0.6));
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 4px 0;
  font-size: 12px;
}
#totalPopulation {
  color: var(--gold-bright);
  text-shadow: 0 0 8px rgba(230, 185, 88, 0.4);
}

/* ---------- Sauvegarde ---------- */
#saveLoadSection {
  background: rgba(13, 8, 5, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin: 24px auto;
  max-width: 560px;
}
#saveLoadSection h2 {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  margin: 0 0 10px;
}
#saveLoadSection button {
  background: transparent;
  color: var(--parchment);
  border: 1px solid var(--border-mid);
  text-shadow: none;
  box-shadow: none;
  font-size: 12px;
}
#saveLoadSection button:hover {
  background: rgba(230, 185, 88, 0.1);
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(230, 185, 88, 0.25);
}

/* ---------- Alerte ---------- */
#alert {
  background: linear-gradient(135deg, #c0392b, #8b1e10);
  border: 1px solid #ff6b5a;
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 18px;
  font-weight: 600;
  font-size: 14px;
  color: #ffe8e3;
  box-shadow: 0 8px 24px rgba(192, 57, 43, 0.45), 0 0 20px rgba(255, 107, 90, 0.3);
  animation: alertSlide 0.35s ease;
  z-index: 2000;
  display: none;
  align-items: center;
  gap: 14px;
  max-width: 90%;
  line-height: 1.4;
}
#alert .alert-text { flex: 1; }
#alert .alert-close {
  background: rgba(0, 0, 0, 0.25);
  color: #ffe8e3;
  border: 1px solid rgba(255, 232, 227, 0.3);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  text-shadow: none;
  box-shadow: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
#alert .alert-close:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #fff;
  color: #fff;
  transform: rotate(90deg);
}
@keyframes alertSlide {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to   { transform: translate(-50%, 0);     opacity: 1; }
}

/* ---------- Audio : toggle moderne ---------- */
.sidebar-toggle {
  background: rgba(13, 8, 5, 0.75);
  color: var(--gold-bright);
  border: 1px solid var(--border-mid);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
  position: relative;
}
.sidebar-toggle:hover {
  background: rgba(230, 185, 88, 0.15);
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(230, 185, 88, 0.4);
  transform: scale(1.05);
}
.sidebar-toggle.muted { color: var(--parchment-dim); opacity: 0.7; }
.sidebar-toggle.muted::after {
  content: "";
  position: absolute;
  width: 28px; height: 2px;
  background: var(--ember);
  transform: rotate(-45deg);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255, 122, 60, 0.6);
}

#audioSidebar { top: 60px; }
.sidebar-content {
  background: rgba(13, 8, 5, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.sidebar-content.open {
  border: 1px solid var(--border-mid);
  border-right: none;
  box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.5);
}
.audio-control-btn {
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid var(--border-mid);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-shadow: none;
  box-shadow: none;
}
.audio-control-btn:hover {
  background: rgba(230, 185, 88, 0.15);
  box-shadow: 0 0 12px rgba(230, 185, 88, 0.4);
}
#volumeSlider {
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  height: 4px;
  opacity: 1;
}
#volumeSlider::-webkit-slider-thumb {
  width: 14px; height: 14px;
  background: var(--gold-bright);
  border: 2px solid var(--bg-1);
  box-shadow: 0 0 8px rgba(230, 185, 88, 0.6);
}
.volume-percentage { color: var(--gold-bright); font-weight: 600; }

/* ---------- Carte ---------- */
#mapSection {
  background: rgba(13, 8, 5, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  max-width: 720px;
  box-shadow: var(--shadow-deep);
}
#mapSection h2 {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-bright);
  font-size: 14px;
}
#gameMap {
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}
#mapLegend {
  background: rgba(26, 18, 10, 0.85);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px;
}
#mapLegend h3 {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.legend-color { border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.2); }

/* ---------- Footer ---------- */
footer {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6));
  border-top: 1px solid var(--border-soft);
  color: var(--parchment-dim);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 14px 22px;
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* ---------- Bouton Arcade FM (footer droite) ---------- */
#backToArcade {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 14px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(38, 26, 16, 0.9), rgba(13, 8, 5, 0.9));
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 0 0 0 rgba(230, 185, 88, 0);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
#backToArcade i {
  font-size: 11px;
  transition: transform 0.3s ease;
  color: var(--gold);
}
#backToArcade strong {
  color: var(--ember);
  text-shadow: 0 0 8px rgba(255, 122, 60, 0.5);
  margin-left: 2px;
  font-weight: 700;
}
#backToArcade::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 217, 134, 0.18), transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
#backToArcade:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 6px 18px rgba(0, 0, 0, 0.6),
    0 0 22px rgba(230, 185, 88, 0.4);
  transform: translateY(-2px);
}
#backToArcade:hover i { transform: translateX(-3px); }
#backToArcade:hover::before { transform: translateX(100%); }
#backToArcade:active { transform: translateY(0); }

@media (max-width: 600px) {
  footer { flex-direction: column; gap: 10px; text-align: center; }
  #backToArcade { padding: 8px 16px; font-size: 11px; }
}
.changelog-link {
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-mid);
  transition: all 0.2s ease;
}
.changelog-link:hover { color: var(--gold-bright); border-bottom-color: var(--gold); text-shadow: 0 0 8px rgba(230, 185, 88, 0.4); }

/* ---------- Onglets discrets bas-droite ---------- */
#hiddenTabs {
  background: rgba(13, 8, 5, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 12px;
}

/* ---------- Animations apparition ---------- */
.section, .resource, #seasonDisplay, #techBanner, #narrative {
  animation: fadeUp 0.5s ease backwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive : mobile ---------- */
@media (max-width: 600px) {
  body { padding: 12px 8px; }
  body > div:first-of-type img { width: 100px !important; }
  body > div:first-of-type::after { font-size: 18px; letter-spacing: 0.12em; }
  .tab-button { padding: 6px 14px; font-size: 11px; }
  #narrative { font-size: 14px; padding: 12px 16px; }
  .section { max-width: 100%; padding: 12px; }
  .resource { padding: 10px 8px; }
  .resource .icon { font-size: 18px; }
  #hintSection::before { width: 28px; height: 28px; font-size: 14px; }
}

/* =========================================================
   OBJECTIF ACTUEL (en haut, mise en avant)
   ========================================================= */
#currentObjective {
  max-width: 520px;
  margin: 16px auto;
  background: linear-gradient(135deg, rgba(255, 122, 60, 0.14), rgba(13, 8, 5, 0.85));
  border: 1px solid rgba(255, 122, 60, 0.4);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-deep), 0 0 22px rgba(255, 122, 60, 0.15);
  position: relative;
  overflow: hidden;
}
#currentObjective::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(400px 100px at 50% 0%, rgba(255, 217, 134, 0.18), transparent 70%);
  pointer-events: none;
}
.objective-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.objective-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(255, 122, 60, 0.6));
  animation: objIconPulse 2s ease-in-out infinite;
}
@keyframes objIconPulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.12); }
}
.objective-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 0 8px rgba(230, 185, 88, 0.4);
}
.objective-message {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--parchment);
  line-height: 1.4;
}
.objective-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.objective-progress-bar {
  flex: 1;
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
}
.objective-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ember), var(--gold-bright));
  box-shadow: 0 0 12px rgba(255, 122, 60, 0.6);
  transition: width 0.5s ease;
  border-radius: 999px;
}
.objective-progress-text {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--gold-bright);
  font-weight: 700;
  min-width: 70px;
  text-align: right;
}
.objective-claim[hidden] { display: none !important; }
.objective-progress-wrapper[hidden] { display: none !important; }
.objective-claim {
  display: block;
  margin: 6px auto 0;
  background: linear-gradient(180deg, var(--ember), #b54422);
  color: #fff8ee;
  border: 1px solid #ff9966;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 8px 22px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 18px rgba(255, 122, 60, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: claimPulse 1.6s ease-in-out infinite;
}
@keyframes claimPulse {
  0%,100% { box-shadow: 0 0 18px rgba(255, 122, 60, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
  50%     { box-shadow: 0 0 30px rgba(255, 217, 134, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
}
#currentObjective.objective-ready {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(230, 185, 88, 0.22), rgba(255, 122, 60, 0.18));
}
/* Bulle d'aide 'bug en cours' sous l'objectif */
.claim-help-bubble {
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 11px;
  font-style: italic;
  color: var(--parchment-dim);
  background: rgba(255, 122, 60, 0.08);
  border: 1px dashed rgba(255, 122, 60, 0.3);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.claim-help-bubble b { color: var(--ember); font-style: normal; }

#currentObjective.objective-flash { animation: objFlash 1s ease; }
@keyframes objFlash {
  0%   { box-shadow: 0 0 0 0 rgba(255, 217, 134, 0.8); transform: scale(1); }
  40%  { box-shadow: 0 0 50px 8px rgba(255, 217, 134, 0.5); transform: scale(1.02); }
  100% { box-shadow: var(--shadow-deep); transform: scale(1); }
}

/* =========================================================
   PASSAGE D'AGE : overlay plein ecran
   ========================================================= */
.age-unlock-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 122, 60, 0.35), rgba(13, 8, 5, 0.92));
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.age-unlock-overlay.show { opacity: 1; }
.age-unlock-content {
  text-align: center;
  transform: scale(0.85);
  transition: transform 0.6s cubic-bezier(.2, .9, .3, 1.3);
  padding: 40px 60px;
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(38, 26, 16, 0.95), rgba(13, 8, 5, 0.95));
  box-shadow: 0 0 80px rgba(255, 217, 134, 0.4), inset 0 0 40px rgba(255, 122, 60, 0.15);
  animation: ageGlow 2.5s ease-in-out infinite;
}
.age-unlock-overlay.show .age-unlock-content { transform: scale(1); }
@keyframes ageGlow {
  0%,100% { box-shadow: 0 0 60px rgba(255, 217, 134, 0.3), inset 0 0 30px rgba(255, 122, 60, 0.1); }
  50%     { box-shadow: 0 0 100px rgba(255, 217, 134, 0.6), inset 0 0 50px rgba(255, 122, 60, 0.25); }
}
.age-unlock-label {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 16px;
  text-shadow: 0 0 12px rgba(255, 122, 60, 0.6);
}
.age-unlock-name {
  font-family: 'Cinzel', serif;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  text-shadow: 0 0 20px rgba(255, 217, 134, 0.7), 0 4px 8px rgba(0, 0, 0, 0.8);
}
.age-unlock-hint {
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  opacity: 0.7;
}

/* =========================================================
   ONGLET SAGESSES (indices acquis)
   ========================================================= */
#hintsWrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px;
  text-align: center;
}
.hints-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(230, 185, 88, 0.4);
  margin: 0 0 6px;
}
.hints-intro {
  color: var(--parchment-dim);
  font-style: italic;
  font-size: 13px;
  margin: 0 auto 24px;
  max-width: 540px;
  line-height: 1.5;
}
#hintsWrapper #hintSection {
  background: rgba(13, 8, 5, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: left;
  box-shadow: var(--shadow-deep);
  max-width: none;
  margin: 0 auto;
}
#hintsWrapper #purchasedHintsList:empty::after {
  content: "Aucune sagesse n'a encore été révélée. Atteins le prochain Objectif pour en débloquer une.";
  display: block;
  color: var(--parchment-dim);
  font-style: italic;
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

/* =========================================================
   ARBRE DES AGES (remplace l'ancienne carte cosmetique)
   ========================================================= */
#techTreeWrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}
.tech-tree-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(230, 185, 88, 0.4);
  margin: 0 0 6px;
}
.tech-tree-intro {
  color: var(--parchment-dim);
  font-style: italic;
  font-size: 13px;
  max-width: 640px;
  margin: 0 auto 24px;
  line-height: 1.5;
}
#techTreeColumns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  align-items: stretch;
  position: relative;
}
/* Chemins pointilles entre colonnes (visible uniquement >= 2 colonnes par ligne) */
.tech-col { position: relative; }
.tech-col:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -22px;
  width: 18px;
  height: 0;
  border-top: 2px dashed rgba(230, 185, 88, 0.45);
  transform: translateY(-50%);
  pointer-events: none;
}
.tech-col:not(:last-child)::before {
  content: "❯";
  position: absolute;
  top: 50%;
  right: -10px;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 14px;
  text-shadow: 0 0 6px rgba(230, 185, 88, 0.5);
  pointer-events: none;
  z-index: 1;
}
.tech-col.future:not(:last-child)::after,
.tech-col.future:not(:last-child)::before {
  opacity: 0.3;
}
@media (max-width: 720px) {
  /* En mobile (1 col par ligne), les chemins horizontaux n'ont pas de sens */
  .tech-col:not(:last-child)::after,
  .tech-col:not(:last-child)::before { display: none; }
}
.tech-col {
  background: rgba(13, 8, 5, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  text-align: left;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-deep);
}
.tech-col.locked { opacity: 0.55; }
.tech-col.next { opacity: 0.7; filter: grayscale(0.4); }
.tech-col.next .tech-col-age { color: var(--parchment-dim); }
.tech-col.future { opacity: 0.4; filter: grayscale(0.85) blur(0.3px); }
.tech-col.future .tech-col-age { color: var(--parchment-dim); font-style: italic; }
.tech-item.locked-item { color: var(--parchment-dim); font-style: italic; opacity: 0.7; }
.tech-item.locked-deep { text-align: center; justify-content: center; }

/* Colonne teaser '...' */
.tech-col-teaser {
  background: linear-gradient(135deg, rgba(255, 122, 60, 0.05), rgba(13, 8, 5, 0.4));
  border: 1px dashed rgba(230, 185, 88, 0.25);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 16px;
  transition: all 0.3s ease;
}
.tech-col-teaser:hover {
  border-color: rgba(230, 185, 88, 0.5);
  background: linear-gradient(135deg, rgba(255, 122, 60, 0.1), rgba(13, 8, 5, 0.5));
}
.tech-teaser-content { text-align: center; }
.tech-teaser-dots {
  font-family: 'Cinzel', serif;
  font-size: 48px;
  color: var(--gold);
  letter-spacing: 0.3em;
  text-shadow: 0 0 16px rgba(230, 185, 88, 0.5);
  animation: dotsBreathe 2.5s ease-in-out infinite;
  margin-bottom: 12px;
}
@keyframes dotsBreathe {
  0%,100% { opacity: 0.5; transform: scale(1); }
  50%     { opacity: 1;   transform: scale(1.05); }
}
.tech-teaser-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  font-style: italic;
}
.tech-col.reached { border-color: var(--border-mid); }
.tech-col.current {
  border-color: var(--gold);
  box-shadow: var(--shadow-deep), 0 0 30px rgba(230, 185, 88, 0.35);
}
.tech-col.current::before {
  content: "EN COURS";
  position: absolute;
  top: -10px; right: 14px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--ink);
  font-family: 'Cinzel', serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(230, 185, 88, 0.6);
}
.tech-col-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
}
.tech-col-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  color: var(--ink);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(230, 185, 88, 0.4);
}
.tech-col.locked .tech-col-num {
  background: linear-gradient(180deg, #4a3f2e, #2b2218);
  color: rgba(243, 230, 200, 0.4);
  box-shadow: none;
}
.tech-col-age {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.tech-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tech-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 4px 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--parchment-dim);
  transition: all 0.25s ease;
}
.tech-item.done {
  background: linear-gradient(90deg, rgba(76, 175, 80, 0.18), rgba(13, 8, 5, 0.4));
  border-color: rgba(76, 175, 80, 0.4);
  color: var(--parchment);
}
.tech-item.done .ti-check {
  color: #8be78b;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}
.ti-icon { font-size: 18px; flex-shrink: 0; }
.ti-label { flex: 1; }
.ti-check { font-family: 'Cinzel', serif; font-size: 14px; }

@media (max-width: 600px) {
  .objective-message { font-size: 14px; }
  #techTreeColumns { grid-template-columns: 1fr; }
  .age-unlock-content { padding: 30px 24px; }
}

/* =========================================================
   BOUTON SAUVEGARDE (top-right) + MODAL SLOTS
   ========================================================= */
.save-menu-toggle {
  position: fixed;
  top: 10px;
  right: 64px; /* a cote du bouton musique */
  z-index: 1001;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(13, 8, 5, 0.75);
  color: var(--gold-bright);
  border: 1px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
  cursor: pointer;
  text-shadow: none;
}
.save-menu-toggle:hover {
  background: rgba(230, 185, 88, 0.15);
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(230, 185, 88, 0.4);
  transform: scale(1.05);
}

#saveMenuOverlay {
  position: fixed; inset: 0;
  z-index: 4000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 70px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#saveMenuOverlay.open { opacity: 1; pointer-events: auto; }

.save-menu-card {
  width: min(620px, 92vw);
  background: linear-gradient(180deg, rgba(38, 26, 16, 0.97), rgba(13, 8, 5, 0.97));
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgba(230, 185, 88, 0.25), 0 20px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: translateY(-12px);
  transition: transform 0.3s cubic-bezier(.2, .9, .3, 1.2);
}
#saveMenuOverlay.open .save-menu-card { transform: translateY(0); }

.save-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(90deg, rgba(230, 185, 88, 0.08), transparent);
}
.save-menu-close {
  background: transparent;
  border: none;
  color: var(--parchment-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  text-shadow: none;
  box-shadow: none;
}
.save-menu-close:hover { color: var(--gold-bright); background: transparent; box-shadow: none; transform: rotate(90deg); }

.save-slots {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.save-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(48, 33, 20, 0.7), rgba(26, 18, 10, 0.7));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}
.save-slot:hover { border-color: var(--border-mid); }
.save-slot.empty { opacity: 0.7; }
.slot-info { flex: 1; text-align: left; min-width: 0; }
.slot-num {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--parchment-dim);
}
.slot-age {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-bright);
  margin: 2px 0 4px;
  text-shadow: 0 0 6px rgba(230, 185, 88, 0.3);
}
.slot-meta { font-size: 12px; color: var(--parchment-dim); }
.slot-empty-label {
  color: var(--parchment-dim);
  font-style: italic;
  font-size: 13px;
  margin-top: 4px;
}
.slot-actions { display: flex; gap: 6px; flex-shrink: 0; }
.slot-btn {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--parchment);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: none;
  box-shadow: none;
  transition: all 0.2s ease;
}
.slot-btn:hover {
  background: rgba(230, 185, 88, 0.15);
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(230, 185, 88, 0.3);
}
.slot-btn.primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  color: var(--ink);
  border-color: var(--gold-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.slot-btn.primary:hover { filter: brightness(1.08); }
.slot-delete {
  width: 28px; padding: 6px 0;
  color: var(--parchment-dim);
  border-color: transparent;
  font-size: 16px;
  line-height: 1;
}
.slot-delete:hover {
  color: #ff6b5a;
  border-color: #ff6b5a;
  background: rgba(255, 107, 90, 0.08);
  box-shadow: none;
}
.save-menu-warning {
  padding: 10px 18px;
  background: rgba(255, 122, 60, 0.08);
  border-top: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--parchment-dim);
  text-align: center;
}
.save-menu-debug {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px dashed rgba(255, 122, 60, 0.3);
  background: rgba(255, 122, 60, 0.05);
}
.save-menu-debug[hidden] { display: none; }
.save-debug-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember);
}
.save-debug-btn {
  background: transparent;
  border: 1px solid rgba(255, 122, 60, 0.4);
  color: var(--ember);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
}
.save-debug-btn:hover { background: rgba(255, 122, 60, 0.15); color: var(--gold-bright); box-shadow: none; }

@media (max-width: 600px) {
  .save-slot { flex-direction: column; align-items: stretch; gap: 10px; }
  .slot-actions { justify-content: flex-end; }
}

/* =========================================================
   PANNEAU DEBUG (Ctrl+Shift+D)
   ========================================================= */
#debugPanel {
  position: fixed;
  bottom: 16px; left: 16px;
  z-index: 9999;
  width: 260px;
  background: rgba(13, 8, 5, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--ember);
  border-radius: var(--radius-md);
  box-shadow: 0 0 30px rgba(255, 122, 60, 0.35), 0 12px 40px rgba(0, 0, 0, 0.6);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--parchment);
  transform: translateX(-280px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
#debugPanel.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(255, 122, 60, 0.25), transparent);
  border-bottom: 1px solid rgba(255, 122, 60, 0.3);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  text-shadow: 0 0 8px rgba(255, 122, 60, 0.5);
}
#debugClose {
  background: transparent;
  border: none;
  color: var(--parchment-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  text-shadow: none;
  box-shadow: none;
}
#debugClose:hover { color: var(--ember); background: transparent; box-shadow: none; transform: none; }
.debug-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
}
.debug-btn {
  background: rgba(255, 122, 60, 0.12);
  color: var(--parchment);
  border: 1px solid rgba(255, 122, 60, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 11px;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.debug-btn:hover {
  background: rgba(255, 122, 60, 0.25);
  border-color: var(--ember);
  color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(255, 122, 60, 0.3);
  transform: none;
}
#debugLog {
  padding: 8px 12px 12px;
  font-size: 10px;
  font-family: ui-monospace, 'Courier New', monospace;
  color: var(--parchment-dim);
  max-height: 120px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 122, 60, 0.2);
}
#debugLog div { padding: 2px 0; line-height: 1.3; }
#debugLog div:first-child { color: var(--gold-bright); }

/* ---------- Réduction des animations si l'utilisateur préfère ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Conseils contextuels sous les sections ---------- */
.section-ctx-tip {
  margin: 10px 12px 4px;
  padding: 7px 12px;
  background: rgba(255, 180, 50, 0.07);
  border-left: 3px solid var(--ember);
  border-radius: 4px;
  color: var(--gold-muted);
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
}
.section-ctx-tip[hidden] { display: none !important; }

/* ==============================================================
   RESSOURCES - Plaques forgees (Design Claude)
   Remplace le glassmorphism par des plaques solides forgees.
   ============================================================== */

#resources {
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.resources-frame {
  max-width: 1100px;
  margin: 0 auto 24px;
  background: linear-gradient(180deg, rgba(42,29,16,0.6), rgba(20,13,6,0.85));
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  padding: 20px 18px 16px;
  box-shadow: var(--shadow-deep),
    inset 0 1px 0 rgba(255,217,134,0.06),
    inset 0 0 60px rgba(0,0,0,0.4);
  position: relative;
}
.resources-frame::before,
.resources-frame::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-bright), var(--gold-deep) 55%, var(--ink) 100%);
  box-shadow: 0 0 4px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(0,0,0,0.5);
  pointer-events: none;
}
.resources-frame::before { top: 10px; left: 10px; }
.resources-frame::after { bottom: 10px; left: 10px; }
.bolt-tr, .bolt-br {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-bright), var(--gold-deep) 55%, var(--ink) 100%);
  box-shadow: 0 0 4px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(0,0,0,0.5);
  pointer-events: none;
}
.bolt-tr { top: 10px; right: 10px; }
.bolt-br { bottom: 10px; right: 10px; }

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

.res {
  position: relative;
  background: linear-gradient(180deg, #3a2816 0%, #251810 55%, #180f07 100%);
  border: 1px solid #5a3e10;
  border-radius: 10px;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255,217,134,0.14),
    inset 0 0 0 1px rgba(0,0,0,0.4),
    inset 0 -2px 0 rgba(0,0,0,0.55),
    0 6px 18px rgba(0,0,0,0.55);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  overflow: hidden;
}
.res::after {
  content: "";
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,217,134,0.45), transparent);
  pointer-events: none;
}
.res:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255,217,134,0.22),
    inset 0 0 0 1px rgba(0,0,0,0.4),
    0 10px 24px rgba(0,0,0,0.65),
    0 0 22px rgba(201,168,76,0.25);
}

.res-seal {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1;
  background: radial-gradient(circle at 30% 25%, #4a3320 0%, #1b1108 70%, #0d0805 100%);
  border: 1px solid #5a3e10;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,217,134,0.25),
    inset 0 -8px 12px rgba(0,0,0,0.5),
    0 0 14px rgba(201,168,76,0.18);
  position: relative;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.res-seal::before {
  content: "";
  position: absolute; inset: 3px;
  border-radius: 50%;
  border: 1px dashed rgba(201,168,76,0.35);
  pointer-events: none;
}
.res:hover .res-seal {
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,217,134,0.35),
    inset 0 -8px 12px rgba(0,0,0,0.5),
    0 0 22px rgba(255,122,60,0.35);
}

.res[data-res="baies"]  .res-seal { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,217,134,0.25), inset 0 -8px 12px rgba(0,0,0,0.5), 0 0 14px rgba(230,80,120,0.22); }
.res[data-res="bois"]   .res-seal { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,217,134,0.25), inset 0 -8px 12px rgba(0,0,0,0.5), 0 0 14px rgba(120,200,120,0.20); }
.res[data-res="pierre"] .res-seal { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,217,134,0.25), inset 0 -8px 12px rgba(0,0,0,0.5), 0 0 14px rgba(200,200,220,0.18); }
.res[data-res="eau"]    .res-seal { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,217,134,0.25), inset 0 -8px 12px rgba(0,0,0,0.5), 0 0 14px rgba(80,160,220,0.28); }
.res[data-res="viande"] .res-seal { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,217,134,0.25), inset 0 -8px 12px rgba(0,0,0,0.5), 0 0 14px rgba(255,122,60,0.30); }

.res-name {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  margin: 0 0 4px;
}
.res-count {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1;
  margin: 0 0 10px;
  text-shadow: 0 0 12px rgba(255,217,134,0.4), 0 2px 0 rgba(0,0,0,0.6);
  font-variant-numeric: tabular-nums;
  transition: color .2s ease;
}
.res-count.pop { animation: resPop .35s ease; }
@keyframes resPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); color: #fff6cf; text-shadow: 0 0 18px rgba(255,217,134,0.8); }
  100% { transform: scale(1); }
}
.res-max {
  font-size: 10px;
  color: var(--parchment-dim);
  margin: -7px 0 7px;
  font-family: 'Inter', sans-serif;
}

.res-btn {
  width: 100%;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(180deg, #ffd986 0%, #c9a84c 45%, #8a6018 100%);
  border: 1px solid #5a3e10;
  border-radius: 6px;
  padding: 9px 0;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 3px 6px rgba(0,0,0,0.5);
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
  transition: all .18s ease;
  position: relative;
  overflow: hidden;
}
.res-btn::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transition: left .5s ease;
}
.res-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 0 18px rgba(201,168,76,0.55), 0 5px 10px rgba(0,0,0,0.55); }
.res-btn:hover::before { left: 120%; }
.res-btn:active { transform: translateY(0); filter: brightness(0.95); }
.res-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }

.res-bulk {
  display: flex;
  gap: 4px;
  width: 100%;
  margin: 5px 0 0;
}
.res-bulk button {
  flex: 1;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--gold-bright);
  background: rgba(201,168,76,0.10);
  border: 1px solid var(--border-mid);
  border-radius: 5px;
  padding: 5px 0;
  cursor: pointer;
  transition: all .18s ease;
  box-shadow: none;
  text-shadow: none;
  transform: none;
}
.res-bulk button:hover {
  background: rgba(201,168,76,0.22);
  border-color: var(--gold);
  transform: none;
  box-shadow: none;
}

.res-tooltip {
  margin-top: 8px;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 10px;
  line-height: 1.35;
  color: var(--parchment-dim);
  opacity: 0.75;
  padding: 0 2px;
}

.section-ctx-tip[hidden] { display: none !important; }

@media (max-width: 900px) { .resources-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .resources-grid { grid-template-columns: repeat(2, 1fr); } .res-count { font-size: 20px; } }
