/* ==========================================================================
   STYLE PAPIER CRAFT CHILL & BUREAU SCOLAIRE VIRTUEL
   Conçu pour la détente, le travail et la discrétion face aux pare-feux
   ========================================================================== */

:root {
  /* Couleurs de base - Papiers et cartons clairs */
  --bg-desk: #f5efe6;
  --paper-cream: #fdfbf7;
  --paper-kraft: #ebdccb;
  --paper-kraft-dark: #d8c2aa;
  --paper-edge: #e6dac8;
  --ink-primary: #3d3a37;
  --ink-secondary: #6e675f;
  --ink-faint: #9c9489;
  
  /* Couleurs pastel chill */
  --pastel-yellow: #fef08a;
  --pastel-yellow-dark: #ca8a04;
  --pastel-green: #bbf7d0;
  --pastel-green-dark: #15803d;
  --pastel-blue: #bae6fd;
  --pastel-blue-dark: #0284c7;
  --pastel-pink: #fbcfe8;
  --pastel-pink-dark: #be185d;
  --pastel-orange: #fed7aa;
  --pastel-orange-dark: #c2410c;
  --pastel-purple: #e9d5ff;
  --pastel-purple-dark: #7e22ce;

  /* Ombres réalistes de feuilles de papier */
  --shadow-paper: 0 4px 15px rgba(60, 45, 30, 0.07), 0 1px 3px rgba(60, 45, 30, 0.05);
  --shadow-lifted: 0 12px 28px rgba(60, 45, 30, 0.12), 0 3px 8px rgba(60, 45, 30, 0.06);
  --shadow-sticky: 2px 8px 16px rgba(160, 130, 80, 0.15), 0 2px 4px rgba(160, 130, 80, 0.08);

  /* Polices */
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hand: 'Patrick Hand', cursive, sans-serif;
  --font-cursive: 'Caveat', cursive, sans-serif;
  --font-mono: 'Consolas', 'Courier New', 'Fira Code', 'Cascadia Code', monospace;
}

/* ---------------- RESET & BASE ---------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-desk);
  color: var(--ink-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-size: 15px;
}

/* Texture de fond bureau craft en dégradé discret */
body.paper-texture {
  background-color: #f7f2ea;
  background-image: 
    radial-gradient(#e3d7c3 0.85px, transparent 0.85px),
    radial-gradient(#e3d7c3 0.85px, #f7f2ea 0.85px);
  background-size: 34px 34px;
  background-position: 0 0, 17px 17px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------------- BANDEAU SUPÉRIEUR & CAMOUFLAGE ---------------- */
.top-desk-tape {
  background-color: rgba(254, 252, 248, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 2px dashed #dacbb6;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.stealth-mode-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stealth-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.pill-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #d4c5b1;
  background: #ffffff;
  color: var(--ink-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
  background: #fdfaf3;
}

.pill-btn.reset {
  background: #f0e6d6;
  border-color: #c9b69e;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.green { background-color: #22c55e; }
.dot.blue { background-color: #3b82f6; }
.dot.yellow { background-color: #eab308; }

.quick-panic-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panic-hint {
  font-size: 12px;
  color: var(--ink-secondary);
}

kbd {
  background-color: #e8ded0;
  border: 1px solid #c9bcae;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 11px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.panic-btn {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #f87171;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.15);
}

.panic-btn:hover {
  background-color: #fecaca;
  transform: scale(1.03);
}

/* ---------------- CONTENEUR GLOBAL ---------------- */
.desk-container {
  max-width: 1100px;
  margin: 30px auto 60px auto;
  padding: 0 16px;
}

/* ---------------- EFFETS PAPIER & CARDS ---------------- */
.card {
  background-color: var(--paper-cream);
  border-radius: 12px;
  box-shadow: var(--shadow-paper);
  position: relative;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lifted);
}

/* Découpe papier artisanal (bords très légèrement organiques) */
.paper-sheet {
  border: 1px solid var(--paper-edge);
  border-radius: 16px 14px 18px 12px / 12px 18px 14px 16px;
  padding: 30px;
  background-color: #fefdfa;
}

.paper-card {
  border: 1px solid var(--paper-edge);
  padding: 22px;
  border-radius: 14px 12px 15px 11px / 11px 15px 12px 14px;
}

/* Papier ligné pour révisions */
.lined-paper {
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    #ebdccb 28px
  );
  background-color: #fefcf7;
}

/* Papier quadrillé / millimétré pour maths et jeux */
.graph-paper {
  background-color: #fefdf9;
  background-image: 
    linear-gradient(#f0e4d4 1px, transparent 1px),
    linear-gradient(90deg, #f0e4d4 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Papier Kraft plus texturé */
.kraft-paper {
  background-color: #f9f3ea;
  border: 1px solid #dfcfbc;
}

/* Ruban adhésif décoratif (Washi Tape) */
.washi-tape {
  position: absolute;
  width: 90px;
  height: 24px;
  background-color: rgba(235, 215, 185, 0.65);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transform: rotate(-3deg);
  pointer-events: none;
  z-index: 5;
  clip-path: polygon(4% 0%, 96% 0%, 100% 100%, 0% 100%);
}

.washi-tape.top-center-tape {
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(1deg);
}

.washi-tape.tape-corner-left {
  top: -10px;
  left: 20px;
  transform: rotate(-12deg);
}

.washi-tape.tape-corner-right {
  top: -10px;
  right: 20px;
  transform: rotate(10deg);
}

.washi-tape.mini-tape {
  width: 60px;
  height: 18px;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
}

.washi-tape.pastel-green { background-color: rgba(187, 247, 208, 0.7); }
.washi-tape.pastel-orange { background-color: rgba(254, 215, 170, 0.7); }
.washi-tape.pastel-pink { background-color: rgba(251, 207, 232, 0.7); }
.washi-tape.pastel-blue { background-color: rgba(186, 230, 253, 0.7); }
.washi-tape.pastel-yellow { background-color: rgba(254, 240, 138, 0.7); }

/* Punaise de bureau (Pin) */
.pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  top: 14px;
  right: 18px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 10;
}
.pin::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
}
.red-pin { background-color: #ef4444; }
.blue-pin { background-color: #3b82f6; }
.yellow-pin { background-color: #f59e0b; }

/* ---------------- EN-TÊTE NOTEBOOK ---------------- */
.notebook-header {
  margin-bottom: 25px;
  position: relative;
  text-align: center;
}

.handwritten-title {
  font-family: var(--font-cursive);
  font-size: 2.8rem;
  font-weight: 700;
  color: #2e2a25;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 15px;
  color: var(--ink-secondary);
  font-style: italic;
  margin-bottom: 20px;
}

.header-search-box {
  max-width: 600px;
  margin: 0 auto 25px auto;
}

.paper-input-group {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1.5px solid #d5c8b5;
  border-radius: 25px;
  padding: 4px 8px 4px 16px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.search-icon {
  margin-right: 8px;
  opacity: 0.6;
}

.paper-input-group input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-primary);
}

/* ---------------- ONGLETS INTERCALAIRES (BINDER TABS) ---------------- */
.binder-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1.5px dashed #e2d4c0;
  padding-top: 20px;
  margin-top: 10px;
}

.tab-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 18px;
  border: 1.5px solid #d8cab7;
  border-bottom: 3px solid #c4b39e;
  border-radius: 12px 12px 6px 6px;
  background-color: #f7f1e6;
  color: var(--ink-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background-color: #fdfaf4;
  color: var(--ink-primary);
  transform: translateY(-2px);
}

.tab-btn.active {
  background-color: #ffffff;
  color: #1f1d1a;
  border-color: #b5a48e;
  border-bottom: 3px solid #22c55e;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

/* ---------------- GESTION DES PANNEAUX ---------------- */
.tab-pane {
  display: none;
  animation: fadeInPaper 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-pane.active {
  display: block;
}

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

/* ---------------- GRILLE OUTILS SCOLAIRES ---------------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 22px;
}

.wide-card {
  grid-column: 1 / -1;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e6dac8;
}

.card-head h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2b2723;
}

/* Badges & Tags */
.tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
}

.green-tag { background: #dcfce7; color: #166534; }
.orange-tag { background: #ffedd5; color: #9a3412; }
.pink-tag { background: #fce7f3; color: #9d174d; }
.gray-tag { background: #e5e7eb; color: #374151; }

/* ---------------- POST-IT YELLOW (PENSE-BÊTE) ---------------- */
.post-it {
  background-color: #fff9c4;
  border: 1px solid #fef08a;
  border-radius: 4px 4px 18px 4px;
  padding: 20px;
  box-shadow: var(--shadow-sticky);
  position: relative;
  transform: rotate(-1.5deg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.post-it:hover {
  transform: rotate(0deg) scale(1.01);
  box-shadow: 0 10px 24px rgba(180, 150, 80, 0.25);
}

.post-it-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(1deg);
  width: 70px;
  height: 20px;
  background-color: rgba(254, 240, 138, 0.75);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.post-it-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.post-it-header h3 {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: #713f12;
}

.icon-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.icon-action-btn:hover { opacity: 1; }

.post-it textarea {
  width: 100%;
  flex: 1;
  min-height: 140px;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1.4;
  color: #422006;
  resize: vertical;
}

.post-it-footer {
  margin-top: 8px;
  text-align: right;
  font-size: 11px;
  color: #854d0e;
  font-weight: 600;
}

/* ---------------- POMODORO CHILL ---------------- */
.pomodoro-display {
  text-align: center;
  padding: 16px 0;
}

#timer-display {
  font-family: var(--font-cursive);
  font-size: 3.5rem;
  font-weight: 700;
  color: #1e3a1e;
  display: block;
  line-height: 1;
}

.timer-mode {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-top: 6px;
}

.pomodoro-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

/* ---------------- CALCULATRICE RAPIDE ---------------- */
.calc-box input {
  width: 100%;
  padding: 10px;
  font-family: monospace;
  font-size: 1.1rem;
  background: #ffffff;
  border: 1.5px solid #d8cab7;
  border-radius: 8px;
  outline: none;
  margin-bottom: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
}

.calc-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 8px;
  background-color: #faf6ef;
  border: 1px solid #d8cbba;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.calc-btn:hover {
  background-color: #ffffff;
  transform: translateY(-1px);
}

.calc-btn.op {
  background-color: #fed7aa;
  border-color: #fdba74;
  color: #9a3412;
}

.calc-btn.clear {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.calc-result {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fdfaf3;
  border-left: 3px solid #f97316;
  font-weight: 700;
  font-size: 14px;
  color: #7c2d12;
}

/* ---------------- MOYENNE & CITATION ---------------- */
.tool-desc {
  font-size: 13px;
  color: var(--ink-secondary);
  margin-bottom: 8px;
}

.paper-input {
  padding: 9px 12px;
  border: 1.5px solid #d8cbba;
  border-radius: 8px;
  background-color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}

.paper-input.full-width { width: 100%; }

.grades-summary {
  display: flex;
  gap: 10px;
}

.summary-pill {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e2d3be;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  text-align: center;
}

.study-tips {
  background-color: #fcf6e8;
  border: 1px dashed #d5be9b;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-style: italic;
  color: #5c4423;
  display: flex;
  gap: 6px;
  align-items: center;
}

.badge-tip {
  font-style: normal;
  font-weight: 700;
  color: #b45309;
}

/* ---------------- RACCOURCIS SCOLAIRES ---------------- */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.paper-link-card {
  background-color: #ffffff;
  border: 1.5px solid #e0d2c0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.paper-link-card:hover {
  transform: translateY(-2px);
  border-color: #84cc16;
  box-shadow: 0 5px 12px rgba(132, 204, 22, 0.15);
}

.link-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.link-title {
  font-weight: 700;
  font-size: 13px;
  color: #2b2723;
}

.link-domain {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* ---------------- ESPACE JEUX (TAB 2) ---------------- */
.chill-banner {
  margin-bottom: 25px;
  text-align: center;
  padding: 20px;
}

.chill-banner h2 {
  font-family: var(--font-cursive);
  font-size: 2.3rem;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.chill-banner p {
  color: var(--ink-secondary);
  max-width: 750px;
  margin: 0 auto;
}

/* Jeu principal Paper Snake */
.game-main-card {
  margin-bottom: 30px;
  position: relative;
}

.game-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.game-meta {
  display: flex;
  gap: 12px;
}

.score-box {
  background: #ffffff;
  border: 1px solid #d5c7b3;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border: 2px solid #3d3a37;
  border-radius: 10px;
  background-color: #fbfaf5;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.06);
  overflow: hidden;
}

#paper-snake-canvas {
  display: block;
  width: 100%;
  height: auto;
  background-color: #fbfaf5;
}

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(250, 246, 238, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  transition: opacity 0.2s ease;
}

.game-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card h4 {
  font-family: var(--font-cursive);
  font-size: 2.2rem;
  color: #1e293b;
  margin-bottom: 8px;
}

.overlay-card p {
  font-size: 14px;
  color: var(--ink-secondary);
  margin-bottom: 18px;
  max-width: 420px;
}

.game-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.controls-hint {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.sound-toggle {
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}
.sound-toggle:hover { text-decoration: underline; }

/* Screen Shake (Malus séisme) */
@keyframes screenShakeAnim {
  0% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-5px, -3px) rotate(-1deg); }
  30% { transform: translate(5px, 3px) rotate(1deg); }
  45% { transform: translate(-4px, 4px) rotate(-0.5deg); }
  60% { transform: translate(4px, -3px) rotate(0.8deg); }
  75% { transform: translate(-3px, -2px) rotate(-0.5deg); }
  90% { transform: translate(3px, 2px) rotate(0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.screen-shake {
  animation: screenShakeAnim 0.12s infinite linear;
  box-shadow: 0 0 25px rgba(220, 38, 38, 0.45), inset 0 0 15px rgba(220, 38, 38, 0.25) !important;
  border-color: #ef4444 !important;
}

/* Bandeau des effets / bonus / malus actifs */
.snake-effects-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  margin-bottom: 10px;
  background-color: #fcf8ee;
  border: 1.5px dashed #decbb6;
  border-radius: 8px;
  min-height: 38px;
}

.snake-effects-bar.hidden {
  display: none;
}

.effect-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid;
  animation: pulsePill 1.5s infinite;
}

@keyframes pulsePill {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.effect-pill.bonus {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.effect-pill.malus {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.effect-pill.neutral {
  background: #fefce8;
  border-color: #fde047;
  color: #854d0e;
}

.effect-timer {
  background: rgba(0,0,0,0.1);
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Barre de thème / Skin du serpent */
.snake-theme-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  background-color: #fdfaf4;
  border: 1.5px solid #e5d7c3;
  border-radius: 10px;
  flex-wrap: wrap;
}

.theme-bar-label {
  font-size: 13px;
  font-weight: 800;
  color: #78350f;
  white-space: nowrap;
}

.snake-theme-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.snake-theme-btn {
  background: #ffffff;
  border: 1.5px solid #d4c4af;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #4a3e31;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.snake-theme-btn:hover {
  background: #fcf4e8;
  border-color: #bfa88f;
  transform: translateY(-1px);
}

.snake-theme-btn.active {
  background: #fff7ed;
  border-color: #ea580c;
  color: #9a3412;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.2);
}

.theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.15);
}

.swatch-rainbow {
  background: linear-gradient(135deg, #ef4444, #f59e0b, #10b981, #06b6d4, #8b5cf6);
}
.swatch-classic { background: #22c55e; }
.swatch-neon    { background: linear-gradient(135deg, #06b6d4, #d946ef); }
.swatch-sketch  { background: #475569; }
.swatch-gold    { background: linear-gradient(135deg, #fbbf24, #b45309); }
.swatch-sakura  { background: #f472b6; }

/* Guide / Légende des Bonus & Malus */
.snake-legend-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background-color: #f7efe4;
  border: 1px dashed #d6c6b3;
  border-radius: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.legend-title {
  font-weight: 800;
  color: #574d3f;
  white-space: nowrap;
}

.legend-items {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #d4c8b8;
  color: #4a3e31;
}

.legend-badge.bonus  { border-color: #86efac; color: #166534; }
.legend-badge.malus  { border-color: #fca5a5; color: #991b1b; }
.legend-badge.neutral{ border-color: #fde047; color: #854d0e; }

.pause-hint {
  font-size: 11.5px;
  color: #8c8275;
}

/* Grille de jeux supplémentaires */
.games-directory-header {
  margin-bottom: 16px;
}

.games-directory-header h3 {
  font-size: 1.4rem;
  color: var(--ink-primary);
}

.games-directory-header p {
  font-size: 14px;
  color: var(--ink-secondary);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  position: relative;
}

.game-card-icon {
  font-size: 2.2rem;
  background: #fdf6ec;
  border: 1px solid #e8dbcc;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card-info {
  flex: 1;
}

.game-card-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.game-card-info p {
  font-size: 12px;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.tag-cat {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.green-cat { background: #dcfce7; color: #166534; }
.blue-cat { background: #dbeafe; color: #1e40af; }
.purple-cat { background: #f3e8ff; color: #6b21a8; }
.orange-cat { background: #ffedd5; color: #9a3412; }

/* Pastilles de statut des sous-domaines (Actif / Inactif) */
.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.status-pill-ok {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.status-pill-bad {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* ---------------- ONGLET SOUS-DOMAINES (TAB 3) ---------------- */
.network-config-card h2 {
  font-family: var(--font-cursive);
  font-size: 2.4rem;
  color: #9a3412;
  margin-bottom: 6px;
}

.domain-setup-box {
  background-color: #faf3e8;
  border: 1.5px solid #ded0be;
  border-radius: 12px;
  padding: 18px;
  margin-top: 15px;
}

.domain-input-inline {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  max-width: 500px;
}

.hint-text {
  display: block;
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 12px;
}

.table-container {
  overflow-x: auto;
}

.craft-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.craft-table th,
.craft-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #ede3d4;
  font-size: 13.5px;
}

.craft-table th {
  background-color: #f7efe4;
  font-weight: 700;
  color: #443c35;
}

.craft-table tr:hover {
  background-color: #fdfaf6;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.status-badge.ok { background: #dcfce7; color: #166534; }
.status-badge.alert { background: #fee2e2; color: #991b1b; }

.add-subdomain-form {
  background: #fbf7ee;
  border: 1.5px dashed #d9cbba;
  border-radius: 10px;
  padding: 18px;
}

.add-subdomain-form h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--ink-primary);
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.paper-select {
  padding: 9px 12px;
  border: 1.5px solid #d8cbba;
  border-radius: 8px;
  background-color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

/* ---------------- ONGLET GUIDE CONTOURNEMENT (TAB 4) ---------------- */
.guide-card h2 {
  font-family: var(--font-cursive);
  font-size: 2.4rem;
  color: #166534;
  margin-bottom: 6px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.guide-item {
  display: flex;
  gap: 14px;
  background-color: #ffffff;
  border: 1px solid #e5d8c6;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.guide-num {
  width: 32px;
  height: 32px;
  background-color: #dcfce7;
  color: #166534;
  font-weight: 800;
  font-size: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-body h4 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #1f1d1a;
}

.guide-body p {
  font-size: 13px;
  color: var(--ink-secondary);
}

.note-box {
  background-color: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 6px 10px;
  margin-top: 8px;
  font-size: 12px;
  color: #92400e;
}

.bullet-list {
  margin-top: 6px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.paper-callout {
  background-color: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #166534;
  font-size: 14px;
}

.callout-icon {
  font-size: 1.6rem;
}

/* ---------------- BOUTONS DE STYLE PAPIER ---------------- */
.paper-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.paper-btn:active {
  transform: translateY(1px);
}

.paper-btn.primary {
  background-color: #84cc16;
  color: #ffffff;
  border-color: #65a30d;
  box-shadow: 0 2px 4px rgba(101, 163, 13, 0.25);
}

.paper-btn.primary:hover {
  background-color: #65a30d;
  box-shadow: 0 4px 8px rgba(101, 163, 13, 0.35);
}

.paper-btn.secondary {
  background-color: #f7efe4;
  color: var(--ink-primary);
  border-color: #d6c6b3;
}

.paper-btn.secondary:hover {
  background-color: #ffffff;
}

.paper-btn.ghost {
  background-color: transparent;
  color: var(--ink-secondary);
  border-color: transparent;
}

.paper-btn.ghost:hover {
  background-color: rgba(0,0,0,0.04);
}

.paper-btn.small {
  padding: 5px 10px;
  font-size: 12px;
}

/* ---------------- FAUX DOCUMENT DE COURS (MODE PANIQUE) ---------------- */
.panic-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #f8fafc;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 20px;
}

.panic-overlay.hidden {
  display: none;
}

.panic-screen {
  background-color: #ffffff;
  max-width: 820px;
  width: 100%;
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border-radius: 4px;
}

.fake-doc-header {
  background-color: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
}

.fake-tabs {
  display: flex;
  gap: 8px;
}

.fake-tab {
  background: #e2e8f0;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  color: #475569;
}

.fake-tab.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  border-bottom: none;
}

.fake-doc-body {
  padding: 40px 50px;
  font-family: 'Times New Roman', Times, serif;
  color: #0f172a;
  line-height: 1.7;
}

.fake-doc-body h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.fake-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
}

.fake-doc-body hr {
  margin: 20px 0;
  border: none;
  border-top: 1px solid #e2e8f0;
}

.fake-doc-body h2 {
  font-size: 1.3rem;
  margin: 20px 0 10px 0;
}

.fake-formula-box {
  background: #f8fafc;
  border-left: 4px solid #3b82f6;
  padding: 12px;
  margin: 16px 0;
  font-family: monospace;
}

/* ---------------- PIED DE PAGE ---------------- */
.desk-footer {
  text-align: center;
  margin-top: 50px;
  padding: 20px;
}

.footer-paper-tag {
  display: inline-block;
  background-color: #ffffff;
  border: 1px dashed #d5c7b3;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--ink-secondary);
}

/* ---------------- ESPACE ADMIN SÉCURISÉ ---------------- */
.admin-login-card {
  max-width: 550px;
  margin: 30px auto;
  text-align: center;
  border: 1.5px solid #e2d2be;
  box-shadow: var(--shadow-lifted);
}

.lock-big-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
}

.admin-login-card h2 {
  font-family: var(--font-cursive);
  font-size: 2.2rem;
  color: #9a3412;
  margin-bottom: 8px;
}

.input-password-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
}

.input-password-row input {
  max-width: 280px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 2px;
}

.error-callout {
  background-color: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  color: #991b1b;
  font-size: 13px;
  font-weight: 700;
}

.admin-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fefcf9;
  border: 1.5px dashed #c8b59e;
  padding: 12px 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #1f1d1a;
}

.tab-btn.admin-tab {
  border-bottom: 3px solid #f97316;
}

/* ---------------- BENTO GRID DU LABO INFORMATIQUE ---------------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 22px;
  margin-top: 10px;
}

.bento-col-12 { grid-column: span 12; }
.bento-col-6  { grid-column: span 6; }
.bento-col-4  { grid-column: span 4; }

.bento-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bento-card .card-head {
  margin-bottom: 12px;
}

/* Éléments avec bouton copier intégré */
.input-with-copy {
  display: flex;
  align-items: center;
  position: relative;
  background-color: #ffffff;
  border: 1.5px solid #d8cbba;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
  width: 100%;
}

.input-with-copy .paper-input {
  border: none;
  box-shadow: none;
  background: transparent;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
}

.copy-btn {
  background: #f7efe4;
  border: none;
  border-left: 1px solid #e0d2c0;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  user-select: none;
}

.copy-btn:hover {
  background: #ede1d1;
  transform: scale(1.05);
}

.copy-btn.copied {
  background: #dcfce7;
  color: #166534;
}

.mono {
  font-family: 'Consolas', 'Courier New', Courier, monospace !important;
  font-size: 13px;
}

/* 1. Multibase Grid */
.multibase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.base-field label {
  font-size: 12px;
  color: var(--ink-secondary);
  display: block;
  margin-bottom: 4px;
}

.bit-breakdown {
  background-color: #fdfaf3;
  border: 1px dashed #d5c3aa;
  border-radius: 8px;
  padding: 10px 12px;
}

.bit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mono-badge {
  background: #ffffff;
  border: 1px solid #d8caa7;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 1px;
  color: #c2410c;
}

.quick-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.preset-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
}

/* 2. Terminal Git */
.terminal-preview-box {
  background-color: #262422;
  border: 2px solid #1a1816;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.terminal-bar {
  background-color: #383430;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.term-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.term-dot.red    { background: #ef4444; }
.term-dot.yellow { background: #f59e0b; }
.term-dot.green  { background: #10b981; }

.term-title {
  font-family: monospace;
  font-size: 11px;
  color: #a8a29e;
  margin-left: 6px;
  flex: 1;
}

.copy-terminal-btn {
  background: #524d47;
  color: #f5f5f4;
  border: 1px solid #6b655e;
  border-radius: 4px;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
}
.copy-terminal-btn:hover {
  background: #10b981;
  border-color: #059669;
}

.terminal-code {
  padding: 12px 14px;
  color: #86efac;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.git-dynamic-box {
  background: #fbf7ef;
  border: 1px dashed #d6c6b3;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

/* 3. Chmod Table */
.chmod-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 13px;
}

.chmod-table th,
.chmod-table td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid #e8dbcc;
}

.chmod-table th {
  background-color: #f7efe4;
  font-size: 12px;
  color: var(--ink-secondary);
}

.chmod-table td:first-child {
  text-align: left;
}

.chmod-summary {
  display: flex;
  gap: 8px;
}

.chmod-pill {
  flex: 1;
  background: #ffffff;
  border: 1px solid #dfd1be;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  text-align: center;
}

/* 4. Encodage Base64 */
.encoding-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 5. Subnet CIDR & Bento-col-4 Headers */
.bento-col-4 .card-head h3 {
  font-size: 1.15rem;
  letter-spacing: -0.3px;
}
.bento-col-4 .card-head .tag {
  font-size: 10px;
  padding: 2px 7px;
  white-space: nowrap;
}

.subnet-card {
  background-color: #fefcf7;
}

.subnet-inputs {
  margin-bottom: 8px;
}

.subnet-details {
  margin-top: 6px;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    #ebdccb 28px
  );
  background-position: 0 0;
  border-top: 1px solid #ebdccb;
  border-bottom: 1px solid #ebdccb;
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
}

.subnet-stat {
  height: 28px;
  line-height: 28px;
  padding: 0 8px;
  margin: 0;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.subnet-stat span {
  font-family: var(--font-hand);
  font-size: 18px;
  font-weight: 700;
  color: #78350f;
  display: flex;
  align-items: center;
  line-height: 1;
}

.subnet-stat strong {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #0f172a;
  display: flex;
  align-items: center;
  line-height: 1;
}

/* 6. Mémo Express Multi-OS (Linux / Windows / Mac) */
.memo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.memo-os-switch-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.memo-switch-label {
  font-size: 13px;
  font-weight: 700;
  color: #78350f;
}

.memo-os-tabs {
  display: inline-flex;
  background: #f4ede3;
  border: 1.5px solid #dcd0bf;
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.memo-tab-btn {
  background: transparent;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #574d3f;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.memo-tab-btn:hover {
  background: #ebdcc9;
  color: #1f1d1a;
}

.memo-tab-btn.active {
  background: #ffffff;
  color: #c2410c;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.memo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 15px;
}

.memo-item {
  background: #ffffff;
  border: 1.5px solid #e2d2be;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.memo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}

.memo-item-title {
  font-weight: 800;
  font-size: 13.5px;
  color: #1e293b;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.memo-item-desc {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.35;
}

.memo-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fdf6ec;
  border: 1px solid #e7dac9;
  border-radius: 6px;
  padding: 5px 8px;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.memo-code-box:hover {
  background: #fbeee0;
}

.memo-code-box code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #c2410c;
  word-break: break-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memo-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  opacity: 0.7;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.memo-copy-btn:hover {
  opacity: 1;
}

/* ---------------- UTILITAIRES ---------------- */
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }

/* Boutons inactifs / désactivés */
.paper-btn.disabled-btn,
span.paper-btn.disabled-btn {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  background: #eee8df;
  border-color: #d8cdbe;
  color: #8c8275;
}

.game-card-inactive {
  opacity: 0.75;
}

.game-card-inactive:hover {
  opacity: 0.95;
}

@media (max-width: 1100px) {
  .bento-col-4 {
    grid-column: span 6;
  }
  .bento-col-4.subnet-card {
    grid-column: span 12;
  }
}

@media (max-width: 900px) {
  .bento-col-6,
  .bento-col-4,
  .bento-col-4.subnet-card {
    grid-column: span 12;
  }
  .multibase-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .handwritten-title {
    font-size: 2.1rem;
  }
  
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-panic-container {
    width: 100%;
    justify-content: flex-end;
  }

  .paper-sheet {
    padding: 18px 14px;
  }

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

  .fake-doc-body {
    padding: 20px;
  }

  .washi-tape.tape-corner-left,
  .washi-tape.tape-corner-right {
    display: none;
  }
}
