/* ================================================================
   BARJO PROJECT — style.css
   Univers théâtral, fun, immersif — Responsive desktop + tablette
   ================================================================ */

/*
  Polices chargées via CDN jsDelivr (fonctionne en local ET en ligne).
  Si pas d'internet : fallback sur Georgia / cursive / serif natifs.
*/
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;600;700&family=Special+Elite&family=Caveat:wght@400;600;700&display=swap');

/* ═══════════════════════════════════════════
   1. VARIABLES & RESET
═══════════════════════════════════════════ */
:root {
  --gold:        #D4AF37;
  --gold-light:  #F0D060;
  --gold-dark:   #9A7B20;
  --crimson:     #8B1A1A;
  --crimson-dark:#5C0A0A;
  --ink:         #150E05;
  --parchment:   #F5E6C8;
  --parchment-dk:#C8AF88;
  --glass:       rgba(140,210,255,0.15);
  --glass-border:rgba(180,230,255,0.4);
  --shadow-deep: 0 20px 60px rgba(0,0,0,0.8);
  --shadow-gold: 0 0 40px rgba(212,175,55,0.5);
  --font-title:  'Cinzel Decorative', 'Palatino Linotype', Georgia, serif;
  --font-head:   'Cinzel', 'Palatino Linotype', Georgia, serif;
  --font-body:   'Special Elite', 'Courier New', Courier, monospace;
  --font-chalk:  'Caveat', 'Comic Sans MS', cursive;
  --ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t:           0.4s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--parchment);
  min-height: 100vh;
  overflow-x: hidden;
}
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
input, textarea, select { font-family: var(--font-body); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
a { text-decoration: none; color: inherit; }

/* ═══════════════════════════════════════════
   2. NAVIGATION
═══════════════════════════════════════════ */
.nav-main {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 62px;
  background: linear-gradient(180deg, rgba(10,6,0,0.98) 0%, rgba(15,9,0,0.92) 100%);
  border-bottom: 1px solid rgba(212,175,55,0.35);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(212,175,55,0.7);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: flex-end;
}

.nav-links a {
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--parchment-dk);
  padding: 0.35rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: all var(--t) var(--ease);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold);
  border-color: rgba(212,175,55,0.4);
  background: rgba(212,175,55,0.08);
  text-shadow: 0 0 12px var(--gold);
}

/* ═══════════════════════════════════════════
   3. PAGE WRAPPER & TITLES
═══════════════════════════════════════════ */
.page-wrap { padding-top: 62px; min-height: 100vh; }

.page-title {
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  color: var(--gold);
  text-align: center;
  text-shadow: 0 0 50px rgba(212,175,55,0.7), 0 4px 12px rgba(0,0,0,0.9);
  letter-spacing: 3px;
  padding: 1.5rem 1rem 0.3rem;
  line-height: 1.2;
}
.page-subtitle {
  font-family: var(--font-head);
  font-size: 0.75rem;
  color: var(--parchment-dk);
  text-align: center;
  letter-spacing: 5px;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.8rem;
}

/* ═══════════════════════════════════════════
   4. BOCAL COMPONENT
═══════════════════════════════════════════ */
.jar-wrap {
  display: flex; flex-direction: column; align-items: center;
  position: relative;
}

/* Conteneur bocal PNG — garde la grande taille comme hiérarchie */
.jar-img-holder {
  position: relative;
  display: inline-block;
  overflow: hidden;
}
.jar-png {
  width: 600px;
  height: auto;
  display: block;
}
.jar-svg { transition: filter 0.3s, transform 0.3s; }
.jar-svg:hover { filter: drop-shadow(0 0 18px rgba(140,210,255,0.5)); }

.jar-label {
  font-family: var(--font-head);
  font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--gold); margin-top: 0.4rem; opacity: 0.8;
}
.jar-count {
  font-family: var(--font-title);
  font-size: 1.4rem; color: var(--gold-light);
  text-shadow: 0 0 15px var(--gold);
}

/* Shake animation */
@keyframes jarShake {
  0%,100% { transform: rotate(0deg); }
  20%      { transform: rotate(-4deg) translateX(-3px); }
  40%      { transform: rotate(4deg) translateX(3px); }
  60%      { transform: rotate(-3deg); }
  80%      { transform: rotate(2deg); }
}
.jar-shake .jar-svg,
.jar-shake .jar-img-holder { animation: jarShake 0.55s ease; }

/* Animation mélange bocal */
@keyframes jarMix {
  0%   { transform: rotate(0deg) translateY(0); }
  15%  { transform: rotate(-8deg) translateX(-5px); }
  30%  { transform: rotate(8deg)  translateX(5px) translateY(-4px); }
  45%  { transform: rotate(-6deg) translateX(-4px) translateY(-2px); }
  60%  { transform: rotate(6deg)  translateX(4px); }
  75%  { transform: rotate(-3deg) translateX(-2px); }
  88%  { transform: rotate(2deg)  translateX(1px); }
  100% { transform: rotate(0deg) translateY(0); }
}
.jar-mixing { animation: jarMix 0.75s cubic-bezier(0.36,0.07,0.19,0.97) both; }

@keyframes ballFloat {
  0%   { transform: var(--ball-base-transform) translateY(0); }
  25%  { transform: var(--ball-base-transform) translateY(-180px) rotate(40deg); }
  50%  { transform: var(--ball-base-transform) translateY(-80px) rotate(-25deg); }
  70%  { transform: var(--ball-base-transform) translateY(-40px) rotate(15deg); }
  85%  { transform: var(--ball-base-transform) translateY(-20px) rotate(-8deg); }
  100% { transform: var(--ball-base-transform) translateY(0); }
}
.mini-paper.mixing {
  animation: ballFloat 0.75s cubic-bezier(0.36,0.07,0.19,0.97) both;
}

/* Papers in jar — calibré sur bocal PNG 600px */
.jar-papers-preview {
  position: absolute;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  width: 235px;
  height: 250px;
  overflow: visible;
  clip-path: inset(0% 0% 0% 0% round 60px 60px 50px 50px);
  pointer-events: none;
}
.mini-paper {
  position: absolute;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   5. BUTTONS
═══════════════════════════════════════════ */
.btn {
  font-family: var(--font-head);
  font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase;
  padding: 0.55rem 1.3rem;
  border-radius: 4px;
  border: 1px solid;
  transition: all var(--t) var(--ease);
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.06);
  opacity: 0; transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }

.btn-gold {
  background: linear-gradient(135deg, rgba(212,175,55,0.25), rgba(160,128,30,0.2));
  border-color: var(--gold-dark);
  color: var(--gold-light);
}
.btn-gold:hover {
  background: linear-gradient(135deg, rgba(212,175,55,0.4), rgba(160,128,30,0.35));
  box-shadow: 0 0 20px rgba(212,175,55,0.4);
  transform: translateY(-1px);
}

.btn-draw {
  background: linear-gradient(135deg, rgba(139,26,26,0.5), rgba(92,10,10,0.4));
  border-color: var(--crimson);
  color: #FFB8B8;
  font-size: 0.85rem; letter-spacing: 2px;
  padding: 0.7rem 1.8rem;
}
.btn-draw:hover {
  background: linear-gradient(135deg, rgba(180,30,30,0.6), rgba(120,10,10,0.5));
  box-shadow: 0 0 25px rgba(180,30,30,0.5);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(139,26,26,0.3);
  border-color: rgba(139,26,26,0.6);
  color: #FF9999;
}
.btn-danger:hover {
  background: rgba(139,26,26,0.5);
  box-shadow: 0 0 15px rgba(180,30,30,0.4);
}

.btn-sm {
  font-size: 0.65rem; letter-spacing: 1px; padding: 0.3rem 0.7rem;
}

/* ═══════════════════════════════════════════
   6. RESULT OVERLAY
═══════════════════════════════════════════ */
.result-overlay {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,4,0,0.88);
  backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s;
}
.result-overlay.show { opacity: 1; pointer-events: all; }

.result-card {
  background: linear-gradient(145deg, #FFFBE8, #F5E6C0);
  color: #1A0E00;
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  line-height: 1.5;
  max-width: min(600px, 90vw);
  width: 100%;
  padding: 3rem 3.5rem;
  border-radius: 6px;
  box-shadow: var(--shadow-deep), 0 0 60px rgba(212,175,55,0.4);
  text-align: center;
  position: relative;
  animation: resultAppear 0.5s var(--ease);
}

@keyframes resultAppear {
  from { transform: scale(0.7) rotate(-3deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.result-card::before {
  content: '📜';
  font-size: 2.5rem;
  display: block; margin-bottom: 1rem;
}

.result-card .result-label {
  font-family: var(--font-head);
  font-size: 0.7rem; letter-spacing: 4px; text-transform: uppercase;
  color: var(--gold-dark); margin-bottom: 0.8rem; opacity: 0.8;
}

.result-card .result-text {
  font-size: clamp(1.1rem, 2.5vw, 1.7rem);
  color: #1A0E00; font-weight: bold;
}

.result-card .result-hint {
  font-family: var(--font-head);
  font-size: 0.65rem; color: var(--gold-dark);
  opacity: 0.6; margin-top: 1.5rem; letter-spacing: 2px;
}

/* ═══════════════════════════════════════════
   7. PANEL D'ADMINISTRATION
═══════════════════════════════════════════ */
.admin-panel {
  background: rgba(20,12,0,0.85);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 6px;
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.admin-title {
  font-family: var(--font-head);
  font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--gold); opacity: 0.75; margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212,175,55,0.2);
}

.paper-list {
  display: flex; flex-direction: column; gap: 0.4rem;
  max-height: 280px; overflow-y: auto;
  padding-right: 0.3rem;
}

.paper-list::-webkit-scrollbar { width: 4px; }
.paper-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
.paper-list::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.4); border-radius: 2px; }

.paper-item {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px; padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}

.paper-item span { flex: 1; color: var(--parchment); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-item .btn-icon { font-size: 0.9rem; padding: 0.2rem 0.3rem; opacity: 0.6; transition: opacity 0.2s; }
.paper-item .btn-icon:hover { opacity: 1; }

.input-row {
  display: flex; gap: 0.5rem; margin-top: 0.8rem;
}

.barjo-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 4px;
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 0.45rem 0.7rem;
  transition: border-color 0.2s;
}
.barjo-input:focus { outline: none; border-color: var(--gold-dark); }
.barjo-input::placeholder { opacity: 0.4; }

/* ═══════════════════════════════════════════
   8. TOAST
═══════════════════════════════════════════ */
.barjo-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 2000;
  font-family: var(--font-head);
  font-size: 0.75rem; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 0.7rem 1.4rem;
  border-radius: 4px; border: 1px solid;
  transform: translateY(20px); opacity: 0;
  transition: all 0.3s var(--ease);
  pointer-events: none;
}
.barjo-toast.show { transform: translateY(0); opacity: 1; }
.barjo-toast.info  { background: rgba(30,60,90,0.95); border-color: rgba(100,170,220,0.5); color: #B0D4F0; }
.barjo-toast.ok    { background: rgba(20,70,30,0.95); border-color: rgba(80,180,80,0.5);  color: #A0E0A0; }
.barjo-toast.error { background: rgba(80,10,10,0.95); border-color: rgba(200,60,60,0.5);  color: #FFB0B0; }

/* ═══════════════════════════════════════════
   9. INDEX PAGE
═══════════════════════════════════════════ */
.home-bg {
  min-height: auto;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139,26,26,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(212,175,55,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(40,40,80,0.2) 0%, transparent 60%),
    linear-gradient(160deg, #150E05 0%, #0A0600 40%, #110900 100%);
}

.home-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: calc(100vh - 62px);
  padding: 2rem;
  gap: clamp(1rem, 3vw, 3rem); /* adaptatif automatique */
  text-align: center;
}

.home-badge {
  font-family: var(--font-head);
  font-size: 0.7rem; letter-spacing: 8px; text-transform: uppercase;
  color: var(--gold); opacity: 0.6; margin-bottom: 1.5rem;
}

.home-title {
  font-family: var(--font-title);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  color: var(--gold);
  text-shadow: 0 0 80px rgba(212,175,55,0.6), 0 0 30px rgba(212,175,55,0.3);
  letter-spacing: 4px; line-height: 1.1; margin-bottom: 0.5rem;
}

.home-crown { margin-bottom: 0; display: block; animation: crownFloat 3s ease-in-out infinite; }
/* ── Taille image accueil — modifiez --home-img-size dans config.js ou ici ── */
:root { --home-img-size: clamp(140px, 18vw, 260px); }   /* adaptatif automatique */
.home-crown img {
  width: var(--home-img-size);
  height: auto;
  display: block;
  margin: 0 auto;
}
@keyframes crownFloat { 0%,100%{ transform: translateY(0) rotate(-2deg); } 50%{ transform: translateY(-8px) rotate(2deg); } }

.home-desc {
  font-family: var(--font-body); font-size: 1rem; color: var(--parchment-dk);
  max-width: 480px; line-height: 1.7; margin: 1rem 0 2.5rem;
  opacity: 0.75;
}

.home-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.8rem, 2vw, 1.5rem); max-width: 900px; width: 100%;
  align-self: center;
  margin: 0 auto;
}

.home-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 8px;
  padding: clamp(1rem, 2vw, 2rem) clamp(0.8rem, 1.5vw, 1.5rem);
  text-align: center;
  transition: all var(--t) var(--ease);
  position: relative;
  align-self: start;
}
.home-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.04), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.home-card:hover { border-color: rgba(212,175,55,0.5); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(212,175,55,0.1); }
.home-card:hover::before { opacity: 1; }

.card-icon { font-size: 2.8rem; margin-bottom: 0.8rem; display: block; }
.card-img { display: block; margin: 0 auto 0.8rem; }
.card-img img { width: clamp(80px, 12vw, 180px); height: auto; display: block; margin: 0 auto; }
.card-title { font-family: var(--font-title); font-size: clamp(0.7rem, 1.2vw, 0.9rem); color: var(--gold); letter-spacing: 2px; margin-bottom: 0.5rem; }
.card-desc  { font-size: 0.8rem; color: var(--parchment-dk); opacity: 0.7; line-height: 1.5; margin-bottom: 1.2rem; }

/* ═══════════════════════════════════════════
   10. PAGE TRIBUNAL
═══════════════════════════════════════════ */
.tribunal-bg {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(139,26,26,0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 20%, rgba(212,175,55,0.07) 0%, transparent 50%),
    linear-gradient(180deg, #120A02 0%, #0A0500 60%, #150800 100%);
  min-height: 100vh;
}

/* Balance SVG déco en fond */
.balance-bg {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(700px, 90vw); opacity: 3;
  pointer-events: none; z-index: 0;
}

.tribunal-layout {
  display: grid;
  grid-template-columns: 1fr 320px 1fr;
  gap: 1.5rem;
  padding: 1rem 1.5rem 2rem;
  max-width: 1400px; margin: 0 auto;
  position: relative; z-index: 1;
  align-items: start;
}

/* Colonne gauche : bocal */
.trib-jar-col {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}

/* Centre : timer */
.trib-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1rem 0;
}
/* Timer plus grand au centre */
.trib-center .timer-display {
  font-size: clamp(4.5rem, 9vw, 7rem);
}

/* Timer */
.timer-display {
  font-family: var(--font-title);
  font-size: clamp(4rem, 10vw, 8rem);
  color: var(--gold);
  text-shadow: 0 0 40px rgba(212,175,55,0.5);
  line-height: 1;
  transition: color 0.5s, text-shadow 0.5s;
  min-width: 220px; text-align: center;
}
.timer-display.warning {
  color: #FF3333;
  text-shadow: 0 0 50px rgba(255,50,50,0.8), 0 0 20px rgba(255,0,0,0.5);
  animation: timerPulse 0.5s ease-in-out infinite;
}
@keyframes timerPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

.timer-controls { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.timer-input {
  width: 70px; text-align: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 4px; color: var(--gold);
  font-family: var(--font-title); font-size: 1rem;
  padding: 0.3rem;
}
.timer-input:focus { outline: none; border-color: var(--gold); }

/* Marteau de juge */
.marteau-wrap {
  position: relative; width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.marteau-emoji {
  font-size: 4rem;
  transform-origin: bottom right;
  display: inline-block;
  transition: transform 0.1s;
  user-select: none;
}
@keyframes marteauFrappe {
  0%   { transform: rotate(-40deg) translateY(-12px); }
  10%  { transform: rotate(-45deg) translateY(-16px); }
  40%  { transform: rotate(20deg)  translateY(8px); }
  55%  { transform: rotate(15deg)  translateY(6px); }
  70%  { transform: rotate(-10deg) translateY(-4px); }
  85%  { transform: rotate(-5deg)  translateY(-2px); }
  100% { transform: rotate(0deg)   translateY(0); }
}
.marteau-wrap.striking .marteau-emoji { animation: marteauFrappe 0.55s cubic-bezier(0.4,0,0.2,1); }

/* Zone résultat tirage */
.draw-result-zone {
  min-height: 100px; width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(212,175,55,0.2);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  text-align: center;
}
.draw-result-zone.active {
  background: rgba(255,245,200,0.06);
  border-color: rgba(212,175,55,0.5);
  box-shadow: 0 0 30px rgba(212,175,55,0.15);
}
.draw-result-text {
  font-family: var(--font-body); font-size: 1.1rem; color: var(--parchment);
  line-height: 1.5;
}

/* Vote POUR / CONTRE */
.vote-section {
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem; width: 100%;
}
.vote-label { font-family: var(--font-head); font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase; color: var(--parchment-dk); opacity: 0.6; }
.vote-btns  { display: flex; gap: 1rem; }

.btn-pour, .btn-contre {
  font-family: var(--font-title); font-size: 1.1rem; letter-spacing: 2px;
  padding: 0.8rem 2rem; border-radius: 5px; border: 2px solid;
  transition: all 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.btn-pour {
  background: rgba(30,100,40,0.3);
  border-color: rgba(60,180,70,0.5);
  color: #90E880;
}
.btn-pour:hover, .btn-pour.active {
  background: rgba(40,150,50,0.5);
  box-shadow: 0 0 30px rgba(60,200,70,0.5);
  transform: scale(1.05);
}
.btn-contre {
  background: rgba(120,15,15,0.3);
  border-color: rgba(220,60,60,0.5);
  color: #FF8888;
}
.btn-contre:hover, .btn-contre.active {
  background: rgba(160,20,20,0.5);
  box-shadow: 0 0 30px rgba(220,60,60,0.5);
  transform: scale(1.05);
}

/* Verdict final */
.verdict-banner {
  width: 100%; padding: 1rem 2rem;
  border-radius: 6px; text-align: center;
  font-family: var(--font-title); font-size: 1.5rem; letter-spacing: 3px;
  display: none; animation: verdictAppear 0.6s var(--ease);
}
@keyframes verdictAppear {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.verdict-banner.pour {
  display: block;
  background: rgba(30,100,40,0.4);
  border: 2px solid rgba(60,200,70,0.5);
  color: #A0FF90;
  box-shadow: 0 0 40px rgba(60,200,70,0.3);
}
.verdict-banner.contre {
  display: block;
  background: rgba(120,15,15,0.4);
  border: 2px solid rgba(220,60,60,0.5);
  color: #FFB0B0;
  box-shadow: 0 0 40px rgba(220,60,60,0.3);
}

/* Colonne droite : admin */
.trib-admin-col .admin-panel { width: 100%; }

/* ═══════════════════════════════════════════
   11. PAGE HISTOIRE
═══════════════════════════════════════════ */
.histoire-bg {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(60,80,40,0.2) 0%, transparent 50%),
    linear-gradient(180deg, #0C1008 0%, #08100A 100%);
  min-height: 100vh;
}

.histoire-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  padding: 1rem 1.5rem 2rem;
  max-width: 1400px; margin: 0 auto;
  align-items: start;
}

/* Tableau vert d'école */
.blackboard {
  background: linear-gradient(160deg, #2C5228 0%, #1E3D1A 30%, #243D20 70%, #2A4E25 100%);
  border: 8px solid #5A3A1A;
  border-radius: 4px;
  min-height: 500px;
  position: relative;
  padding: 1.5rem;
  box-shadow:
    inset 0 0 60px rgba(0,0,0,0.4),
    inset 0 0 20px rgba(0,0,0,0.3),
    0 8px 40px rgba(0,0,0,0.7),
    8px 8px 0 rgba(40,20,5,0.5);
  overflow: hidden;
}
.blackboard::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; opacity: 0.5;
}

.board-tray {
  position: absolute; bottom: 0; left: 0; right: 0; height: 14px;
  background: linear-gradient(180deg, #6B4520 0%, #4A2E10 100%);
  border-top: 2px solid rgba(255,255,255,0.1);
}

.board-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  min-height: 200px;
  padding-bottom: 1rem;
}

.board-item {
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 0.8rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  animation: chalkAppear 0.6s var(--ease);
  position: relative;
}
@keyframes chalkAppear {
  from { opacity: 0; transform: scale(0.8) rotate(-2deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}

.board-item img {
  width: 100%; max-height: 130px;
  object-fit: cover; border-radius: 3px;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: zoom-in;
}
.board-item .board-text {
  font-family: var(--font-chalk);
  font-size: 1rem; color: rgba(255,255,255,0.85);
  text-align: center; line-height: 1.4;
}
.board-item .board-num {
  position: absolute; top: 4px; right: 6px;
  font-family: var(--font-chalk); font-size: 0.8rem; color: rgba(255,255,255,0.4);
}
.board-empty {
  font-family: var(--font-chalk); font-size: 1.1rem;
  color: rgba(255,255,255,0.25); text-align: center;
  grid-column: 1/-1; padding: 3rem;
}

/* Chalk decoration lines */
.board-header {
  font-family: var(--font-chalk); font-size: 1.3rem;
  color: rgba(255,255,255,0.4); text-align: center;
  margin-bottom: 1rem; border-bottom: 1px dashed rgba(255,255,255,0.15);
  padding-bottom: 0.5rem;
}

/* Zone texte live */
.live-text-zone {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(255,255,240,0.1);
  border: 1px dashed rgba(255,255,200,0.3);
  border-radius: 4px; padding: 0.6rem 1rem;
  max-width: 200px;
  font-family: var(--font-chalk); font-size: 1.1rem;
  color: #FFFDE0; display: none;
}
.live-text-zone.visible { display: block; animation: chalkAppear 0.4s var(--ease); }

/* Histoire gauche */
.hist-left { display: flex; flex-direction: column; align-items: center; gap: 1rem; }

/* ═══════════════════════════════════════════
   12. PAGE HIÉRARCHIE
═══════════════════════════════════════════ */
.hierarchie-bg {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(100,70,180,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(212,175,55,0.08) 0%, transparent 50%),
    linear-gradient(160deg, #0C0A14 0%, #080610 100%);
  min-height: 100vh;
}

.hier-layout {
  display: grid;
  grid-template-columns: 1fr 320px 1fr;
  gap: 1.5rem;
  padding: 1rem 1.5rem 2rem;
  max-width: 1400px; margin: 0 auto;
  align-items: start;
  position: relative; z-index: 1;
}

/* Zone catégorie active */
.active-category-zone {
  background: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 8px; padding: 1.2rem;
  min-height: 120px;
}
.active-cat-label {
  font-family: var(--font-head); font-size: 0.65rem; letter-spacing: 4px;
  text-transform: uppercase; color: var(--gold); opacity: 0.6; margin-bottom: 0.5rem;
}
.active-cat-name {
  font-family: var(--font-title); font-size: 1.4rem; color: var(--gold);
  text-shadow: 0 0 20px rgba(212,175,55,0.4); margin-bottom: 0.8rem;
}
.active-cat-list {
  display: flex; flex-direction: column; gap: 0.35rem;
}
.active-cat-list li {
  font-size: 0.85rem; color: var(--parchment-dk);
  padding: 0.3rem 0.6rem;
  background: rgba(255,255,255,0.04);
  border-left: 2px solid rgba(212,175,55,0.3);
  border-radius: 0 3px 3px 0;
}

/* Tirages en cours */
.draw-history {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.draw-history-item {
  background: rgba(100,70,180,0.1);
  border: 1px solid rgba(150,120,220,0.2);
  border-radius: 5px; padding: 0.6rem 0.8rem;
  display: flex; align-items: center; gap: 0.6rem;
  animation: chalkAppear 0.4s var(--ease);
}
.draw-history-item .draw-num {
  font-family: var(--font-title); font-size: 1rem; color: rgba(150,120,220,0.7);
  min-width: 24px;
}
.draw-history-item .draw-val {
  font-size: 0.85rem; color: var(--parchment); flex: 1;
}

/* Centre hiérarchie */
.hier-center { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }

/* Colonne droite */
.hier-right { display: flex; flex-direction: column; gap: 1rem; }

/* ═══════════════════════════════════════════
   13. MODAL GÉNÉRIQUE
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(5,3,0,0.85); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal-box {
  background: linear-gradient(145deg, rgba(25,15,5,0.98), rgba(15,8,0,0.98));
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 8px; padding: 2rem;
  width: min(480px, 92vw);
  box-shadow: var(--shadow-deep);
  animation: resultAppear 0.4s var(--ease);
}
.modal-title { font-family: var(--font-title); font-size: 1rem; color: var(--gold); letter-spacing: 2px; margin-bottom: 1.2rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.2rem; }

/* ═══════════════════════════════════════════
   14. SEPARATEURS & DÉCO
═══════════════════════════════════════════ */
.divider {
  border: none;
  border-top: 1px solid rgba(212,175,55,0.15);
  margin: 0.8rem 0;
}

.section-label {
  font-family: var(--font-head); font-size: 0.65rem; letter-spacing: 4px;
  text-transform: uppercase; color: var(--gold); opacity: 0.55;
  margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════
   15. RESPONSIVE TABLETTE
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .tribunal-layout { grid-template-columns: 1fr; }
  .trib-jar-col { order: 1; }
  .trib-center  { order: 2; }
  .trib-admin-col { order: 3; }

  .histoire-layout { grid-template-columns: 1fr; }
  .hist-left { flex-direction: row; flex-wrap: wrap; justify-content: center; }

  .hier-layout { grid-template-columns: 1fr; }
  .hier-center  { order: -1; }

  .home-cards { grid-template-columns: 1fr; max-width: 400px; }
  .nav-logo { display: none; }

  .home-hero { gap: clamp(0.5rem, 2vw, 1rem); }

}

@media (max-width: 600px) {
  .nav-links a { padding: 0.3rem 0.5rem; font-size: 0.65rem; letter-spacing: 1px; }
  .page-title { font-size: 1.3rem; }
}

/* ═══════════════════════════════════════════
   16. ANIMATIONS GLOBALES
═══════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes glow {
  0%,100% { box-shadow: 0 0 20px rgba(212,175,55,0.3); }
  50%      { box-shadow: 0 0 40px rgba(212,175,55,0.6); }
}
@keyframes floatPaper {
  0%   { transform: rotate(-5deg) translateY(0); }
  50%  { transform: rotate(3deg) translateY(-12px); }
  100% { transform: rotate(-5deg) translateY(0); }
}

.animate-in { animation: fadeInUp 0.6s var(--ease) both; }
.animate-in-2 { animation: fadeInUp 0.6s 0.15s var(--ease) both; }
.animate-in-3 { animation: fadeInUp 0.6s 0.3s var(--ease) both; }

/* Étincelles / particules de tirage */
.spark {
  position: fixed; pointer-events: none; z-index: 600;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: sparkFly 0.8s ease forwards;
}
@keyframes sparkFly {
  0%   { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

/* ═══════════════════════════════════════════
   ASSETS — Surcharges visuelles
   Appliquées dynamiquement par common.js
   quand des fichiers sont présents dans assets/
═══════════════════════════════════════════ */

/* Quand un fond custom est chargé, on assombrit légèrement
   pour garder la lisibilité du texte */
body[style*="background-image"] .page-title,
body[style*="background-image"] .page-subtitle {
  text-shadow: 0 0 40px rgba(212,175,55,0.8), 0 2px 20px rgba(0,0,0,1), 0 0 60px rgba(212,175,55,0.4);
}

/* Overlay sombre sur les fonds custom pour lisibilité */
body[style*="background-image"]::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

/* Le contenu reste au-dessus de l'overlay */
.page-wrap, nav { position: relative; z-index: 1; }

/* Image marteau custom */
#marteau-img {
  width: 70px; height: 70px;
  object-fit: contain;
  transform-origin: bottom right;
  transition: filter 0.2s;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.marteau-wrap.striking #marteau-img {
  animation: marteauFrappe 0.55s cubic-bezier(0.4,0,0.2,1);
}

/* Image balance custom */
#balance-img {
  width: 100%;
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
}

/* ═══════════════════════════════════════════
   PAGE GESTION
═══════════════════════════════════════════ */
.gestion-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.gestion-tab {
  font-family: var(--font-head);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  border: 1px solid rgba(212,175,55,0.3);
  background: rgba(255,255,255,0.04);
  color: var(--parchment-dk);
  cursor: pointer;
  transition: all 0.25s;
}
.gestion-tab:hover { border-color: rgba(212,175,55,0.6); color: var(--parchment); }
.gestion-tab.active {
  background: rgba(212,175,55,0.15);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 20px rgba(212,175,55,0.2);
}
.gestion-panel { display: none; animation: fadeInUp 0.3s ease; }
.gestion-panel.active { display: block; }

.gestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.gestion-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: 8px;
  padding: 1.2rem;
}
.gestion-section-title {
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212,175,55,0.2);
}

/* ═══════════════════════════════════════════
   TABLEAU CRAIE
═══════════════════════════════════════════ */
#chalk-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 4px;
  pointer-events: none;  /* activé/désactivé par JS */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Crect x='8' y='2' width='5' height='13' rx='2' fill='%23FFFDE0' stroke='%23888' stroke-width='1'/%3E%3Cpolygon points='8,15 13,15 10.5,19' fill='%23FFFDE0'/%3E%3C/svg%3E") 10 18, crosshair;
}
#chalk-canvas.chalk-active {
  pointer-events: all;
}

.chalk-color-btn {
  padding: 0.3rem 0.6rem !important;
  font-size: 0.65rem !important;
  opacity: 0.6;
  transition: opacity 0.2s, box-shadow 0.2s;
}
.chalk-color-btn.active {
  opacity: 1;
  box-shadow: 0 0 10px rgba(212,175,55,0.5);
}

#btn-chalk-mode {
  transition: all 0.2s;
}
#btn-chalk-mode.active {
  background: rgba(212,175,55,0.25);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 15px rgba(212,175,55,0.3);
}

/* Animation brosse d'effacement */
@keyframes brushWipe {
  0%   { left: -150px; }
  100% { left: calc(100% + 150px); }
}

/* ═══════════════════════════════════════════
   DOUBLE TABLEAU HISTOIRE
═══════════════════════════════════════════ */
.hist-boards-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blackboard-chalk {
  min-height: 280px;
  cursor: crosshair;
}
.blackboard-chalk.chalk-active {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Crect x='8' y='2' width='5' height='13' rx='2' fill='%23FFFDE0' stroke='%23888' stroke-width='1'/%3E%3Cpolygon points='8,15 13,15 10.5,19' fill='%23FFFDE0'/%3E%3C/svg%3E") 10 18, crosshair;
}

/* Overlays brosse génériques */
.eraser-overlay-wrap {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 4px;
  display: none;
}
.eraser-overlay-wrap.active { display: block; }

.eraser-brush-el {
  position: absolute;
  top: 0; bottom: 0; left: -140px;
  width: 140px;
  background: linear-gradient(90deg, transparent, rgba(55,88,48,0.88) 40%, rgba(75,115,58,0.95));
  filter: blur(7px);
}
.eraser-brush-el.wiping {
  animation: brushWipe 1.1s cubic-bezier(0.4,0,0.2,1) forwards;
}

/* ═══════════════════════════════════════════
   TABLEAU 2 — CLAVIER + BROSSE PAR TABLEAU
═══════════════════════════════════════════ */

/* Tableau clavier auto-grandissant */
.blackboard-keyboard {
  min-height: 200px;
  height: auto !important;
}

.board-keyboard-area {
  padding: 0.5rem 0.5rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* Textarea effet craie */
.chalk-textarea {
  width: 100%;
  min-height: 120px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow: hidden;         /* pas de scrollbar — on grandit */
  font-family: var(--font-chalk);
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(255, 255, 230, 0.88);
  caret-color: rgba(255,255,200,0.9);
  text-shadow:
    0 0 8px rgba(255,255,200,0.25),
    1px 1px 2px rgba(0,0,0,0.6);
  letter-spacing: 0.03em;
  padding: 0.4rem 0.6rem;
}
.chalk-textarea::placeholder {
  color: rgba(255,255,255,0.2);
  font-style: italic;
}
.chalk-textarea:focus {
  box-shadow: none;
}

/* Bouton brosse positionné en bas à droite de chaque tableau */
.board-eraser-btn {
  position: absolute;
  bottom: 20px;
  right: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  font-size: 1.4rem;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.15s;
  line-height: 1;
}
.board-eraser-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.15);
}
.board-eraser-btn:active {
  transform: scale(0.95);
}

/* ── Boulettes : rebond au clic bocal ── */
@keyframes ballBounce {
  0%   { transform: var(--ball-base-transform) translateY(0); }
  20%  { transform: var(--ball-base-transform) translateY(-18px) scale(1.08,0.92); }
  45%  { transform: var(--ball-base-transform) translateY(-8px)  scale(0.95,1.05); }
  65%  { transform: var(--ball-base-transform) translateY(-3px)  scale(1.03,0.97); }
  80%  { transform: var(--ball-base-transform) translateY(0)     scale(0.98,1.02); }
  100% { transform: var(--ball-base-transform) translateY(0); }
}
.mini-paper.bouncing {
  animation: ballBounce 0.7s cubic-bezier(0.36,0.07,0.19,0.97) both;
}

/* ── Bouton ✕ suppression item tableau ── */
.board-item-close {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(180,30,30,0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
  transition: background 0.15s, transform 0.1s;
}
.board-item-close:hover {
  background: rgba(220,20,20,0.95);
  transform: scale(1.2);
}

/* ── Lightbox image ── */
#img-lightbox {
  display: -webkit-flex;
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.88);
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  -webkit-transition: opacity 0.18s ease, visibility 0.18s ease;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
#img-lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
#img-lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  object-fit: contain;
  -webkit-transform: scale(1);
  transform: scale(1);
}
#img-lightbox-close {
  position: absolute;
  top: 18px; right: 22px;
  font-size: 2rem;
  color: rgba(255,255,255,0.8);
  background: none; border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}
#img-lightbox-close:hover {
  color: #fff;
  transform: scale(1.2);
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lbZoomIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}