/* ==========================================================================
   PATISSERIE 2D SIMULATOR - Styles propres au jeu
   Se charge après turbonix.css (voir STYLE-TURBONIX.md).
   Règle d'or : jaune pour l'action, mauve pour la sélection.
   ========================================================================== */

/* ---------- Couleurs du jeu : beige (clair) et marron (sombre) ---------- */
/* Elles remplacent celles de turbonix.css. Le nom --mauve est garde pour
   l'accent, mais ici c'est le caramel de P2DS. */

:root, :root[data-theme="light"] {
  --bg: #FFF8F0;
  --panel: #F5E6D3;
  --surface: #FFF8F0;
  --surface-solid: #FFFFFF;
  --surface-2: #F5E6D3;
  --text: #2D1B10;
  --muted: #5D4037;
  --border: #E0C8B0;
  --mauve: #D4956B;
  --mauve-light: #E8A87C;
  --mauve-dark: #C4855B;
  --mauve-deep: #5D4037;
  --mauve-soft: rgba(212,149,107,.18);
  --yellow: #FFD700;
  --yellow-light: #FFE45C;
  --yellow-dark: #D4A017;
  --ink: #3E2723;
  --error: #C62828;
  --warn: #E65100;
  --success: #2E7D32;
  --btn-shadow: rgba(0,0,0,.18);
  --shadow: 0 1px 6px rgba(0,0,0,.1);
  --blob-1: rgba(232,168,124,.16);
  --blob-2: rgba(212,149,107,.14);
  --blob-3: rgba(245,230,211,.3);
  --header-bg: #D4956B;
  --footer-bg: #5D4037;
  --footer-text: #EFEBE9;
  --tab-bg: #F5E6D3;
  --toast-bg: #3E2723;
  --xp-empty: #C8E6C9;
  --craft-bar: #42A5F5;
  --space-bar: #AB47BC;
}

:root[data-theme="dark"] {
  --bg: #1A1210;
  --panel: #2F221B;
  --surface: #1A1210;
  --surface-solid: #2A201A;
  --surface-2: #3E2723;
  --text: #F5E6D3;
  --muted: #D7CCC8;
  --border: #4E342E;
  --mauve: #D4956B;
  --mauve-light: #E8A87C;
  --mauve-dark: #C4855B;
  --mauve-soft: rgba(212,149,107,.2);
  --error: #EF9A9A;
  --warn: #FFB74D;
  --success: #81C784;
  --btn-shadow: rgba(0,0,0,.4);
  --shadow: 0 1px 6px rgba(0,0,0,.3);
  --blob-1: rgba(212,149,107,.07);
  --blob-2: rgba(93,64,55,.18);
  --blob-3: rgba(62,39,35,.25);
  --header-bg: #3E2723;
  --footer-bg: #1A1210;
  --footer-text: #BCAAA4;
  --tab-bg: #3E2723;
  --toast-bg: #4E342E;
  --xp-empty: #33691E;
}


/* ---------- Écran de jeu ---------- */

html, body { height: 100%; }
body {
  height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Barres de défilement discrètes */
* { scrollbar-width: thin; scrollbar-color: var(--mauve-soft) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--mauve); }

.uii {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: -0.2em;
}

/* Icônes du jeu (Twemoji et dessins maison) */
.ico {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.28em;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

h2 { margin-bottom: 12px; }


/* ---------- Header ---------- */

#header { flex-shrink: 0; position: relative; z-index: 20; }
.site-header { position: relative; }
.game-header-inner {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  padding: 8px 16px;
}
.hdr-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.game-logo { display: block; width: 40px; height: 40px; flex-shrink: 0; transition: transform .4s var(--spring); filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.game-logo:hover { transform: rotate(-8deg) scale(1.08); }
.game-name {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px rgba(0,0,0,.2);
  white-space: nowrap;
}
.version-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border: 1.5px solid rgba(255,255,255,.75);
  border-radius: 8px;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.bakery-name {
  background: none;
  border: 1px solid transparent;
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  padding: 4px 8px;
  border-radius: 10px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color .2s, background .2s;
}
.bakery-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bakery-name .uii { color: rgba(255,255,255,.75); font-size: .8em; }
.bakery-name:hover { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.15); }

.hdr-stats { display: flex; align-items: center; gap: 12px; justify-content: center; }
.money-display {
  color: #FFD700;
  font-size: 1.4rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
  white-space: nowrap;
  display: inline-block;
}
.level-display {
  background: rgba(255,255,255,.2);
  color: #fff;
  border-radius: 999px;
  padding: 3px 11px;
  font-weight: 800;
  font-size: .82rem;
  white-space: nowrap;
  display: inline-block;
}
.xp-bar-container {
  position: relative;
  width: 190px;
  height: 20px;
  border-radius: 99px;
  background: var(--xp-empty);
  border: 2px solid rgba(255,255,255,.3);
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, #8BC34A, #AED581);
  transition: width .6s var(--ease);
}
.xp-bar-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.75);
  white-space: nowrap;
}
.header-right { justify-content: flex-end; }

/* Bandeaux sous le header */
.hdr-alerts { display: flex; flex-direction: column; }
.debt-warning, .event-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 12px;
  font-weight: 700;
  font-size: .85rem;
  text-align: center;
  animation: tx-rise .4s var(--ease) both;
}
.debt-warning { background: #C62828; color: #fff; }
.debt-pay-btn {
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 1px 10px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  font-size: .8rem;
  transition: transform .25s var(--spring);
}
.debt-pay-btn:hover { transform: translateY(-1px) scale(1.04); }
.event-banner { background: linear-gradient(90deg, #FFD700, #FFA000); color: #3E2723; }

#rebirth-banner { flex-shrink: 0; position: relative; z-index: 15; }
.rebirth-banner-inner {
  position: relative;
  overflow: hidden;
  padding: 6px 14px;
  text-align: center;
  font-weight: 800;
  font-size: .9rem;
  color: var(--ink);
  cursor: pointer;
  background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
}
.rebirth-banner-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.65) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: tx-shine 3.5s ease-in-out infinite;
}


/* ---------- Onglets : une pilule mauve glisse sous l'onglet choisi ---------- */

#tabs {
  flex-shrink: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--tabs, 6), 1fr);
  max-width: 1500px;
  width: calc(100% - 24px);
  margin: 12px auto 0;
  padding: 4px;
  border-radius: 16px;
  background: var(--tab-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.gtab-track { position: absolute; inset: 4px; pointer-events: none; }
.gtab-ind {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: calc(var(--i) * 100% / var(--tabs, 6));
  width: calc(100% / var(--tabs, 6));
  border-radius: 12px;
  background: var(--mauve);
  box-shadow: inset 0 -3px 0 #FFD700;
  transition: inset-inline-start .5s var(--spring);
}
.gtab {
  position: relative;
  border: none;
  background: none;
  padding: 7px 4px;
  font-weight: 700;
  font-size: .9rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  color: var(--text);
  transition: color .25s, transform .3s var(--spring);
}
.gtab > span:not(.applicant-badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtab:hover:not(.active) { color: var(--mauve); transform: translateY(-1px); }
.gtab:active { transform: scale(.96); }
.gtab.active { color: #fff; }
.applicant-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 99px;
  background: #F9B115;
  color: #3A2A00;
  font-size: .72rem;
  font-weight: 900;
  display: inline-grid;
  place-items: center;
  animation: badge-pop .5s var(--spring);
}
@keyframes badge-pop { from { transform: scale(0); } }


/* ---------- Zone de jeu ---------- */

#game-area {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1524px;
  margin: 0 auto;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(300px, 34%) minmax(0, 1fr);
  gap: 12px;
}
#ingredients, #main-panel {
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: tx-rise .6s var(--ease) both;
}
#main-panel { animation-delay: .08s; background: var(--panel); }
/* Bob se tient en bas a gauche : la liste peut defiler au-dessus de lui */
#ingredients { padding-bottom: 72px; }

/* Les listes entrent l'une après l'autre quand on change d'onglet */
.rec-card, .sell-card, .bld-card, .emp-card, .applicant-card, .ach-item, .stat-row {
  animation: tx-rise .35s var(--ease) both;
}
#main-panel > :nth-child(2), .emp-list > :nth-child(1), .ach-grid > :nth-child(1) { animation-delay: .02s; }
#main-panel > :nth-child(3), .emp-list > :nth-child(2), .ach-grid > :nth-child(2) { animation-delay: .05s; }
#main-panel > :nth-child(4), .emp-list > :nth-child(3), .ach-grid > :nth-child(3) { animation-delay: .08s; }
#main-panel > :nth-child(5), .emp-list > :nth-child(4), .ach-grid > :nth-child(4) { animation-delay: .11s; }
#main-panel > :nth-child(6), .emp-list > :nth-child(5), .ach-grid > :nth-child(5) { animation-delay: .14s; }
#main-panel > :nth-child(n+7), .emp-list > :nth-child(n+6), .ach-grid > :nth-child(n+6) { animation-delay: .17s; }


/* ---------- Ingrédients ---------- */

.ing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 8px;
}
.ing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px 8px;
  text-align: center;
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform .25s var(--spring), border-color .2s, box-shadow .25s;
}
.ing-card:hover { transform: translateY(-3px); border-color: var(--mauve); box-shadow: 0 8px 22px rgba(212,149,107,.22); }
.ing-card:active { transform: translateY(1px) scale(.95); transition-duration: .08s; }
.ing-card.cant-afford { filter: saturate(.55); opacity: .72; }
.ing-card.locked {
  cursor: default;
  justify-content: center;
  background: var(--surface-2);
  border-style: dashed;
  min-height: 120px;
  opacity: .75;
}
.ing-card.locked:hover { transform: none; border-color: var(--border); box-shadow: none; }
.ing-card.locked:hover .ing-emoji { animation: lock-wiggle .5s var(--ease); }
@keyframes lock-wiggle { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }

.ing-emoji { font-size: 1.75rem; line-height: 1; height: 2.3rem; display: grid; place-items: center; pointer-events: none; transition: transform .3s var(--spring); }
.ing-card:not(.locked):hover .ing-emoji { transform: scale(1.14) rotate(-6deg); }
.ing-name { font-size: .8rem; font-weight: 700; pointer-events: none; color: var(--text); margin-top: 2px; }
.ing-card.locked .ing-name { color: var(--muted); }
.ing-count { color: var(--mauve-dark); font-size: 1.2rem; font-weight: 900; font-variant-numeric: tabular-nums; pointer-events: none; }
.ing-info { font-size: .7rem; color: var(--muted); pointer-events: none; }
.ing-auto {
  font-size: .68rem;
  font-weight: 800;
  color: var(--success);
  background: rgba(46,125,50,.12);
  border-radius: 99px;
  padding: 0 7px;
  margin-top: 1px;
  pointer-events: none;
}
.ing-cost { font-size: .74rem; font-weight: 700; color: var(--warn); margin-top: 2px; pointer-events: none; }
.ing-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 6px; width: 100%; }

.btn-tiny {
  padding: 3px 7px;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: transform .25s var(--spring), border-color .2s, background .2s, opacity .2s;
  white-space: nowrap;
}
.btn-tiny:hover { border-color: var(--mauve); background: var(--mauve-soft); transform: translateY(-1px); }
.btn-tiny:active { transform: scale(.94); }
.btn-tiny.ghosted { visibility: hidden; }
.btn-craft { border-color: var(--mauve); color: var(--mauve); }


/* ---------- Cartes de la colonne principale ---------- */

.rec-card, .sell-card, .bld-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  transition: transform .25s var(--spring), border-color .2s, box-shadow .25s, opacity .2s;
}
.rec-card:not(.locked):hover, .sell-card:hover, .bld-card:not(.locked):hover {
  transform: translateY(-2px);
  border-color: var(--mauve);
  box-shadow: 0 8px 22px rgba(212,149,107,.18);
}
.rec-card.locked, .bld-card.locked {
  background: var(--surface-2);
  border-style: dashed;
  color: var(--muted);
  font-weight: 600;
  padding-block: 8px;
}
.rec-card.disabled .rec-emoji { filter: saturate(.5); opacity: .75; }

.rec-emoji, .sell-emoji, .bld-emoji {
  font-size: 1.85rem;
  line-height: 1;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-2);
  transition: transform .35s var(--spring);
}
.rec-card.locked .rec-emoji { width: 34px; height: 34px; font-size: 1.1rem; background: none; }
.rec-card:not(.locked):hover .rec-emoji, .sell-card:hover .sell-emoji, .bld-card:not(.locked):hover .bld-emoji { transform: scale(1.1) rotate(-5deg); }

.rec-info, .sell-info, .bld-info { flex: 1; min-width: 0; }
.rec-name, .sell-name, .bld-name { font-weight: 800; margin-bottom: 3px; }

.rec-req { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; font-size: .78rem; font-weight: 700; }
.rec-req > span { padding: 1px 7px 1px 5px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.rec-req .has { background: rgba(46,125,50,.12); color: var(--success); }
.rec-req .missing { background: rgba(232,51,111,.12); color: var(--error); }

.rec-details { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .75rem; color: var(--muted); font-weight: 600; }
.rec-details > span { display: inline-flex; align-items: center; gap: 3px; }
.rec-xp { color: #558B2F; font-weight: 800; }
:root[data-theme="dark"] .rec-xp { color: #AED581; }
.rec-time { color: #1E88E5; }
.rec-space { color: #8E24AA; }
:root[data-theme="dark"] .rec-time { color: #64B5F6; }
:root[data-theme="dark"] .rec-space { color: #CE93D8; }
.rec-price {
  color: var(--ink);
  background: linear-gradient(135deg, var(--yellow-light), var(--yellow));
  padding: 0 7px;
  border-radius: 8px;
  font-weight: 800;
}

.sell-stock { font-size: .84rem; color: var(--muted); }
.sell-price { font-size: .92rem; font-weight: 800; color: #D4A017; }
.sell-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.infl-up { color: var(--success); font-size: .85em; font-weight: 800; }
.infl-down { color: var(--error); font-size: .85em; font-weight: 800; }

.bld-qty {
  background: var(--mauve);
  color: #fff;
  border-radius: 8px;
  padding: 0 7px;
  font-size: .82em;
  font-weight: 900;
  margin-inline-start: 4px;
}
.bld-prod { font-size: .84rem; color: var(--success); font-weight: 600; }
.bld-cost { font-size: .86rem; font-weight: 800; color: var(--warn); }


/* ---------- Boutons adaptés au jeu ---------- */
/* Le jeu a beaucoup d'actions à l'écran : le bouton jaune est plus petit,
   et son reflet ne passe qu'au survol. */

.btn {
  padding: 8px 16px;
  font-size: .9rem;
  color: var(--text);
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-solid);
}
.btn:hover:not(:disabled) { background: var(--mauve); border-color: var(--mauve); color: #fff; }
.btn-primary {
  min-width: 0;
  width: auto;
  font-size: .92rem;
  padding: 8px 16px;
  background: var(--mauve);
  border: 1px solid var(--mauve);
  color: #fff;
  box-shadow: 0 2px 4px var(--btn-shadow);
}
.btn-primary::after { animation: none; }
.btn-primary:hover:not(:disabled)::after { animation: tx-shine 1.6s ease-in-out infinite; }
.btn-primary:hover:not(:disabled) { background: var(--mauve-dark); border-color: var(--mauve-dark); box-shadow: 0 4px 10px var(--btn-shadow); }
.btn-primary:active:not(:disabled) { box-shadow: 0 1px 2px var(--btn-shadow); }
.btn-primary:disabled { box-shadow: none; opacity: .5; }
.btn-small { padding: 6px 12px; font-size: .84rem; }
.btn-small:hover:not(:disabled) { background: var(--mauve); border-color: var(--mauve); color: #fff; }
.btn-small.btn-primary { padding: 6px 12px; font-size: .84rem; }
.btn-danger { color: #fff; background: #C62828; border-color: #C62828; }
.btn-danger:hover:not(:disabled) { background: #B71C1C !important; border-color: #B71C1C !important; color: #fff; }
.rec-btn { flex-shrink: 0; }
.btn-sell-all { display: block; width: 100%; margin-bottom: 12px; font-size: 1.02rem; padding: 10px; }
.btn-sell-all::after { animation: tx-shine 3.5s ease-in-out infinite; }


/* ---------- Employés ---------- */

.emp-total-salary {
  display: inline-block;
  padding: 3px 12px;
  margin-bottom: 10px;
  font-weight: 800;
  font-size: .88rem;
  border-radius: 99px;
  background: var(--warn);
  color: #fff;
}
.no-applicants { color: var(--muted); font-style: italic; margin-bottom: 10px; font-size: .9rem; }
.applicants-section {
  background: rgba(255,214,10,.1);
  border-left: 4px solid var(--yellow);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.applicants-section h4 { margin-bottom: 8px; }
.applicant-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  border-radius: 12px;
}
.app-name { font-weight: 800; }
.app-type { font-size: .82rem; color: var(--muted); }
.app-skill { font-size: .8rem; font-weight: 700; color: var(--mauve-dark); }
.app-cost { font-size: .84rem; font-weight: 800; }
.app-timer { font-size: .78rem; font-weight: 700; color: var(--error); margin-inline-end: auto; font-variant-numeric: tabular-nums; }

.emp-list { display: flex; flex-direction: column; gap: 8px; }
.emp-card {
  padding: 10px 12px;
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: transform .25s var(--spring), border-color .2s, box-shadow .25s;
}
.emp-card:hover { transform: translateY(-2px); border-color: var(--mauve); box-shadow: 0 8px 22px rgba(212,149,107,.18); }
.emp-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.emp-name { font-weight: 800; }
.emp-type { font-size: .82rem; color: var(--muted); }
.emp-status, .emp-skill-badge { padding: 1px 9px; border-radius: 99px; font-size: .72rem; font-weight: 800; }
.status-good { background: var(--success); color: #fff; }
.status-warn { background: var(--warn); color: #fff; }
.status-bad { background: var(--error); color: #fff; }
.emp-skill-badge { background: #42A5F5; color: #fff; }
.emp-morale-bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.emp-morale-fill { height: 100%; border-radius: 99px; transition: width .6s var(--ease), background .4s; }
.morale-good { background: #43A047; }
.morale-mid { background: #FB8C00; }
.morale-bad { background: #E53935; }
.emp-assign select, .birthday-select select, .music-controls select {
  margin-top: 6px;
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 600;
  font-size: .84rem;
}
.emp-assign select option, .music-controls select option, .birthday-select select option { background: var(--surface-solid); color: var(--text); }
.emp-info-modal p { margin-bottom: 6px; }
.emp-info-modal button { margin: 6px 6px 0 0; }


/* ---------- Succès et stats ---------- */

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.ach-item {
  padding: 10px 6px;
  text-align: center;
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  transition: transform .3s var(--spring), box-shadow .25s;
}
.ach-item.locked { background: var(--surface-2); border-style: dashed; opacity: .6; }
.ach-item.unlocked { border-color: var(--yellow); box-shadow: 0 0 14px rgba(255,214,10,.28); }
.ach-item.unlocked:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 0 24px rgba(255,214,10,.5); }
.ach-icon { font-size: 1.7rem; line-height: 1.25; }
.ach-name { font-size: .72rem; font-weight: 700; margin-top: 3px; }

.stats-grid { background: var(--surface-solid); border: 1.5px solid var(--border); border-radius: 16px; padding: 4px 14px; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.stat-row:last-child { border-bottom: none; }
.stat-row span:first-child { color: var(--muted); font-weight: 600; }
.stat-row span:last-child { color: var(--mauve-dark); font-weight: 900; font-variant-numeric: tabular-nums; }


/* ---------- Barre du bas : espace + préparations ---------- */
/* Hauteur fixe, pour que l'écran ne saute pas quand une préparation démarre. */

#dock {
  flex-shrink: 0;
  width: calc(100% - 24px);
  max-width: 1500px;
  margin: 0 auto 10px;
  min-height: 54px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline-start: 92px; /* la place de Bob */
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
#space-bar { flex-shrink: 0; }
.space-row { display: flex; align-items: center; gap: 12px; }
.space-usage-wrap { display: flex; flex-direction: column; gap: 3px; }
.space-usage-wrap > span { font-size: .78rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.space-bar-bg { width: 170px; height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.space-bar-fill { height: 100%; border-radius: 99px; background: var(--space-bar); transition: width .5s var(--ease); }
.space-rent { font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }

#crafting-bar { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; justify-content: flex-end; }
.craft-item {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 1 220px;
  min-width: 150px;
  padding: 3px 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: tx-reveal .4s var(--spring) both;
}
.craft-emoji { font-size: 1.15rem; line-height: 1; animation: craft-bob 1s ease-in-out infinite; }
@keyframes craft-bob { 50% { transform: translateY(-2px) rotate(-5deg); } }
.craft-progress-wrap { position: relative; flex: 1; height: 22px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.craft-progress {
  height: 100%;
  border-radius: 99px;
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,.26) 0 8px, transparent 8px 16px),
    linear-gradient(90deg, var(--craft-bar), var(--craft-bar));
  background-size: 200% 100%, 100% 100%;
  transition: width .28s linear;
  animation: craft-stripes 1.1s linear infinite;
}
@keyframes craft-stripes { to { background-position: -36px 0, 0 0; } }
.craft-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  color: var(--text);
}


/* ---------- Notifications, en bas, au-dessus de la barre ---------- */

#toast-area {
  position: fixed;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  width: min(460px, calc(100vw - 24px));
}
.notif {
  padding: 8px 16px;
  border-radius: 14px;
  background: var(--toast-bg);
  color: #fff;
  font-weight: 600;
  font-size: .88rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  animation: notif-in .45s var(--spring) both;
}
.notif.fade-out { animation: notif-out .35s var(--ease) forwards; }
@keyframes notif-in { from { opacity: 0; transform: translateY(18px) scale(.92); } }
@keyframes notif-out { to { opacity: 0; transform: translateY(-8px) scale(.96); } }
.toast-count {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 0 7px;
  border-radius: 99px;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-weight: 900;
  font-size: .78em;
}


/* ---------- Effets ---------- */

.float-money {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  color: #FFD700;
  font-size: 1.3rem;
  font-weight: 900;
  transform: translateX(-50%);
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
  animation: float-up 1.2s var(--ease) forwards;
}
.float-plus {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  color: var(--mauve-dark);
  font-size: 1.05rem;
  font-weight: 900;
  text-shadow: 0 1px 6px var(--surface-solid);
  transform: translateX(-50%);
  animation: float-up .75s var(--ease) forwards;
}
@keyframes float-up {
  0% { opacity: 0; translate: 0 8px; scale: .7; }
  20% { opacity: 1; translate: 0 0; scale: 1.1; }
  100% { opacity: 0; translate: 0 -64px; scale: .9; }
}
.fx-particle { position: fixed; z-index: 2999; pointer-events: none; border-radius: 50%; }
.fx-particle.star { border-radius: 0; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

body.reduced-particles .float-money,
body.reduced-particles .float-plus,
body.reduced-particles .fx-particle { display: none !important; }
body.reduced-particles .bg-blobs span { animation: none; }


/* ---------- Fenêtres ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8,7,12,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlay-in .2s ease both;
}
.modal-overlay.closing { animation: overlay-out .16s ease forwards; }
.modal-overlay.closing .modal { animation: modal-out .16s ease forwards; }
@keyframes overlay-in { from { opacity: 0; } }
@keyframes overlay-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: scale(.96); } }

.modal {
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: tx-pop .4s var(--spring);
}
.modal p { margin-bottom: 10px; line-height: 1.5; }
.modal .warning { color: var(--error); font-weight: 700; }
.modal > input, .modal input:not([type="range"]) {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 600;
}
.modal-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.birthday-select { display: flex; gap: 16px; justify-content: center; margin: 14px 0; }
.birthday-select label { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; }
.bakery-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px; margin-bottom: 6px;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 12px;
}
.bakery-card.current { border-color: var(--yellow); }
.bakery-card-name { font-weight: 800; flex: 1; }
.bakery-current-tag { background: var(--yellow); color: var(--ink); padding: 1px 8px; border-radius: 8px; font-size: .75rem; font-weight: 800; }
.bakery-new { text-align: center; margin-top: 10px; }


/* ---------- Console de commandes ---------- */
/* La fenêtre elle-même devient le terminal : plus aucun cadre clair autour. */

.modal.modal-console {
  width: min(640px, 100%);
  padding: 0;
  overflow: hidden;
  background: #0d0c12;
  border: 1.5px solid var(--mauve);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 40px rgba(212,149,107,.3);
  color: #f3f1f8;
  transition: width .35s var(--ease);
}
.modal.modal-console.guide-open { width: min(1040px, 100%); }
.console-modal { display: flex; max-height: calc(100dvh - 32px); font-family: var(--mono); }
.console-left { flex: 1 1 0; min-width: 0; padding: 18px 20px 20px; display: flex; flex-direction: column; }
.console-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.console-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; color: #fff; font-family: var(--font); font-size: 1.25rem; }
.console-head .uii { color: var(--yellow); }
.console-head .icon-btn { color: #d5d2e0; border-color: rgba(255,255,255,.2); }
.console-output {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px;
  margin-bottom: 10px;
  background: #16141f;
  border: 1px solid rgba(212,149,107,.25);
  border-radius: 12px;
  color: #f3f1f8;
  font-size: .84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.cmd-ok { color: #5fd6a0; }
.cmd-err { color: #ff6b9a; }
.cmd-info { color: var(--yellow); }
.console-autocomplete { max-height: 150px; overflow-y: auto; margin-bottom: 8px; background: #16141f; border: 1px solid rgba(212,149,107,.25); border-radius: 10px; }
.console-autocomplete-item { padding: 4px 12px; color: #ffd9a8; font-size: .84rem; cursor: pointer; transition: background .15s; }
.console-autocomplete-item:hover { background: rgba(212,149,107,.2); }
.console-input-row { display: flex; gap: 8px; }
.modal.modal-console .console-input-row input {
  flex: 1;
  width: auto;
  min-width: 0;
  margin: 0;
  background: #16141f;
  border-color: rgba(212,149,107,.3);
  color: var(--yellow);
  font-family: var(--mono);
}
.console-input-row .btn { background: linear-gradient(135deg, var(--yellow-light), var(--yellow)); border-color: var(--yellow); color: var(--ink); }

#console-btn-wrap { position: fixed; right: 18px; bottom: 76px; z-index: 1500; }
.console-float-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #0d0c12;
  border: 1.5px solid var(--mauve);
  color: var(--yellow);
  box-shadow: 0 6px 20px rgba(212,149,107,.4);
  transition: transform .3s var(--spring), box-shadow .25s;
}
.console-float-btn:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 10px 28px rgba(212,149,107,.6); }

.admin-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 3000;
  padding: 22px;
  width: min(320px, calc(100vw - 32px));
  text-align: center;
  background: #0d0c12;
  border: 1.5px solid var(--mauve);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: tx-pop .4s var(--spring);
}
.admin-popup h3 { color: #fff; margin: 0 0 12px; }
.admin-popup input {
  width: 100%;
  margin-bottom: 12px;
  padding: 9px 12px;
  background: #16141f;
  border: 1.5px solid rgba(212,149,107,.3);
  border-radius: 12px;
  color: var(--yellow);
  font-family: var(--mono);
}
.admin-popup button { margin: 0 4px; padding: 6px 16px; border-radius: 10px; border: 1.5px solid var(--yellow); background: var(--yellow); color: var(--ink); font-weight: 800; }
.admin-popup button.cancel-btn { background: transparent; border-color: rgba(255,255,255,.25); color: #f3f1f8; }


/* ---------- Grands moments ---------- */

.ban-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 5000;
  padding: 20px 36px;
  border-radius: 22px;
  background: #e8336f;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
  animation: tx-pop .4s var(--spring);
}
.lvl1000-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,7,12,.85);
  animation: overlay-in .4s ease both;
}
.lvl1000-content { text-align: center; padding: 20px; animation: tx-reveal .7s var(--spring); }
.lvl1000-content h1 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 900;
  margin-bottom: 14px;
  background: linear-gradient(90deg, var(--yellow), #fff, var(--mauve), var(--yellow));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: tx-shimmer 1.2s linear infinite;
}
.lvl1000-content p { color: #fff; font-size: 1.1rem; margin-bottom: 18px; }


/* ---------- Footer ---------- */

#game-footer { flex-shrink: 0; padding: 4px 12px; font-size: .72rem; background: var(--footer-bg); color: var(--footer-text); border-top: none; box-shadow: none; }
#game-footer a { color: inherit; }


/* ---------- Droite à gauche (arabe) ---------- */

[dir="rtl"] h2::before { margin-right: 0; margin-left: 10px; }
[dir="rtl"] .emp-info-modal button { margin: 6px 0 0 6px; }


/* ---------- Tablette et téléphone ---------- */

@media (max-width: 1080px) {
  .xp-bar-container { width: 140px; }
  .hdr-stats { gap: 8px; }
  .space-bar-bg { width: 120px; }
  .bakery-name { max-width: 150px; }
}

@media (max-width: 899px) {
  #game-area {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 40%) minmax(0, 1fr);
    gap: 8px;
    padding: 8px 12px;
  }
  #ingredients, #main-panel { padding: 10px; }
  #tabs { margin-top: 8px; }
  .gtab { flex-direction: column; gap: 1px; font-size: .68rem; padding: 5px 2px; position: relative; }
  .gtab .uii { font-size: 1.2rem; }
  .gtab .applicant-badge { position: absolute; top: 0; inset-inline-end: 2px; }
  .ing-grid { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 6px; }
  .ing-info { display: none; }
  .ing-card { padding: 6px 4px; }
  .ing-card.locked { min-height: 84px; }
  .btn-tiny { padding: 2px 5px; font-size: .64rem; white-space: normal; }
  h2 { font-size: 1.05rem; margin-bottom: 8px; }
  #dock { flex-wrap: wrap; gap: 4px 10px; margin-bottom: 6px; padding: 5px 10px; min-height: 74px; align-content: flex-start; }
  #space-bar { width: 100%; }
  .space-row { justify-content: space-between; }
  #crafting-bar { flex-basis: 100%; justify-content: flex-start; min-height: 34px; scrollbar-width: none; padding-bottom: 1px; }
  #crafting-bar::-webkit-scrollbar { display: none; }
  #toast-area { bottom: 122px; }
  #console-btn-wrap { bottom: 124px; right: 12px; }
}

@media (max-width: 720px) {
  .game-header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 7px 10px; }
  .hdr-stats { grid-column: 1 / -1; grid-row: 2; }
  .xp-bar-container { flex: 1; width: auto; min-width: 0; }
  .game-name { font-size: 1.15rem; }
  .game-logo { width: 32px; height: 32px; }
  .money-display { font-size: 1.15rem; }
  .bakery-name { font-size: .8rem; padding: 2px 4px; }
  .rec-card, .sell-card, .bld-card { gap: 8px; padding: 8px; }
  .rec-emoji, .sell-emoji, .bld-emoji { width: 40px; height: 40px; font-size: 1.4rem; border-radius: 10px; }
  .rec-req { font-size: .72rem; }
  .btn { padding: 7px 11px; font-size: .82rem; }
  .sell-btns { flex-direction: column; }
  .modal { padding: 18px 14px; }
  .space-usage-wrap > span { font-size: .72rem; }
  .space-bar-bg { width: 92px; }
  .space-rent { font-size: .7rem; }
  #space-bar .btn-small { padding: 4px 8px; font-size: .72rem; box-shadow: 2px 2px 0 var(--btn-shadow); }
  #game-footer { font-size: .62rem; padding: 2px 8px; }
}

@media (max-width: 420px) {
  .version-badge { font-size: .62rem; padding: 1px 5px; }
  .hdr-brand { gap: 5px; }
  .header-right { gap: 4px; }
  .hbtn { width: 29px; height: 29px; border-radius: 9px; }
  .hbtn svg { width: 15px; height: 15px; }
  .theme-toggle { width: 44px; height: 26px; }
  .theme-toggle::after { width: 16px; height: 16px; top: 3px; left: 3px; }
  :root[data-theme="dark"] .theme-toggle::after { transform: translateX(18px); }
  .bakery-name .uii { display: none; }
}


/* ---------- Boutons du header sur le caramel ---------- */

.site-header {
  background: var(--header-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.hbtn { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.15); }
.hbtn:hover { border-color: #fff; background: rgba(255,255,255,.3); }
.hbtn.off { color: rgba(255,255,255,.55); }
.theme-toggle { border-color: rgba(255,255,255,.7); background: rgba(0,0,0,.2); }
.theme-toggle::after { box-shadow: 0 0 6px rgba(255,215,0,.6); }
:root[data-theme="dark"] .theme-toggle::after { background: #D4956B; box-shadow: none; }


/* ---------- Bob, chef patissier ---------- */

#bob {
  position: fixed;
  z-index: 1400;
  left: max(20px, calc(50vw - 742px));
  bottom: 24px;
  width: 76px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: filter .3s;
}
#bob svg { display: block; width: 100%; overflow: visible; }
#bob * { transform-box: view-box; }
#bob:focus-visible { outline: 2px solid var(--mauve); outline-offset: 2px; border-radius: 12px; }

.bob-rig { transform-origin: 80px 150px; animation: bob-float 3.2s ease-in-out infinite; }
.bob-shadow { fill: rgba(0,0,0,.25); }
.bob-jet { fill: url(#bobJetFill); transform-origin: 80px 150px; animation: bob-jet .16s linear infinite alternate; }
.bob-body, .bob-face { fill: url(#bobShell); stroke: url(#bobRim); stroke-width: 4; }
.bob-apron { fill: #fff; stroke: #ddd5ca; stroke-width: 1.5; }
.bob-apron-pocket { fill: #f3ede4; stroke: #ddd5ca; stroke-width: 1.2; }
.bob-apron-heart { fill: #ff85ac; }
.bob-kerchief { fill: #d81b3c; stroke: #a31330; stroke-width: 1; }
.bob-ear { fill: #6f45d9; stroke: #c4a8ff; stroke-width: 1.5; }
.bob-gloss { fill: rgba(255,255,255,.32); }
.bob-visor { fill: url(#bobVisor); stroke: rgba(0,0,0,.6); stroke-width: 2; transition: fill .4s; }
.bob-cheek { fill: #ff6b9a; opacity: .45; filter: blur(1.5px); transition: opacity .4s, fill .4s; }
.bob-head { transform-origin: 80px 106px; transition: transform .35s var(--ease); }
.bob-toque { fill: url(#bobToque); stroke: #d8d0c5; stroke-width: 2; }
.bob-toque-fold { fill: none; stroke: #e0d9ce; stroke-width: 2; stroke-linecap: round; }
.bob-toque-band { fill: #fff; stroke: #d8d0c5; stroke-width: 2; }
.bob-limb { fill: none; stroke: url(#bobRim); stroke-width: 9; stroke-linecap: round; }
.bob-hand { fill: url(#bobShell); stroke: url(#bobRim); stroke-width: 3.5; }
.bob-arm { transition: transform .45s var(--spring); }
.bob-arm-l { transform-origin: 52px 116px; }
.bob-arm-r { transform-origin: 108px 116px; animation: bob-whisking 1.6s ease-in-out infinite; }
.bob-whisk-handle { fill: none; stroke: #8d6e63; stroke-width: 6; stroke-linecap: round; }
.bob-whisk-wire { fill: none; stroke: #b9c3cc; stroke-width: 2.5; }
.bob-eye ellipse { fill: var(--eye); filter: drop-shadow(0 0 6px var(--eye)); transition: fill .4s; }
.bob-shine { fill: #fff; }
.bob-eye-open { transform-origin: 80px 62px; animation: bob-blink 4.8s linear infinite; transition: transform .3s var(--spring); }
.bob-brow { fill: none; stroke: var(--eye); stroke-width: 4.5; stroke-linecap: round; opacity: .85; transition: transform .35s var(--spring), stroke .4s; }
.bob-brow-l { transform-origin: 60px 47px; }
.bob-brow-r { transform-origin: 100px 47px; }

/* La bouche */
.m { display: none; fill: none; stroke: var(--eye); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.m-happy, .m-talk { fill: var(--eye); }
.m-sour { stroke-width: 5; }
.m-talk { transform-origin: 80px 83px; animation: bob-talk .2s linear infinite alternate; }

.bob-sweat { opacity: 0; transition: opacity .4s; pointer-events: none; }
.bob-sweat { fill: #7fe3ff; }

/* 1 : agace, il fronce les sourcils */
.bob-fig[data-anger="1"] { --eye: #ffb300; }
.bob-fig[data-anger="1"] .bob-brow-l { transform: rotate(8deg); }
.bob-fig[data-anger="1"] .bob-brow-r { transform: rotate(-8deg); }
.bob-fig[data-anger="1"] .bob-arm-r { animation-duration: 1s; }

/* 2 : enerve, il transpire et tremble un peu */
.bob-fig[data-anger="2"] { --eye: #ff8a1f; }
.bob-fig[data-anger="2"] .bob-rig { animation: bob-shake .4s linear infinite; }
.bob-fig[data-anger="2"] .bob-brow-l { transform: rotate(16deg) translateY(3px); }
.bob-fig[data-anger="2"] .bob-brow-r { transform: rotate(-16deg) translateY(3px); }
.bob-fig[data-anger="2"] .bob-cheek { opacity: .9; fill: #ff3b30; }
.bob-fig[data-anger="2"] .bob-sweat { opacity: 1; animation: bob-sweat .9s ease-in infinite; }
.bob-fig[data-anger="2"] .bob-arm-r { animation-duration: .5s; }

/* 3 : furieux, visiere rouge */
.bob-fig[data-anger="3"] { --eye: #ff4a2d; filter: drop-shadow(0 0 6px rgba(255,74,45,.6)); }
.bob-fig[data-anger="3"] .bob-rig { animation: bob-shake .18s linear infinite; }
.bob-fig[data-anger="3"] .bob-visor { fill: #2e0a0a; }
.bob-fig[data-anger="3"] .bob-brow-l { transform: rotate(24deg) translateY(5px); }
.bob-fig[data-anger="3"] .bob-brow-r { transform: rotate(-24deg) translateY(5px); }
.bob-fig[data-anger="3"] .bob-cheek { opacity: 1; fill: #ff1f1f; }
.bob-fig[data-anger="3"] .bob-sweat { opacity: 1; animation: bob-sweat .5s ease-in infinite; }
.bob-fig[data-anger="3"] .bob-arm-r { animation-duration: .25s; }
.bob-fig[data-anger="3"] .bob-arm-l { transform: rotate(40deg); }

/* 4 : fou de rage, il prend feu */
.bob-fig[data-anger="4"] { --eye: #ff0000; filter: drop-shadow(0 0 12px rgba(255,30,0,.9)); }
.bob-fig[data-anger="4"] .bob-rig { animation: bob-shake .08s linear infinite; }
.bob-fig[data-anger="4"] .bob-visor { fill: #520808; }
.bob-fig[data-anger="4"] .bob-eye-open { animation: none; transform: scale(1.15); }
.bob-fig[data-anger="4"] .bob-brow-l { transform: rotate(30deg) translateY(6px); }
.bob-fig[data-anger="4"] .bob-brow-r { transform: rotate(-30deg) translateY(6px); }
.bob-fig[data-anger="4"] .bob-cheek { opacity: 1; fill: #ff0000; }
.bob-fig[data-anger="4"] .bob-flames { opacity: 1; animation: bob-flame .18s linear infinite alternate; }
.bob-fig[data-anger="4"] .bob-arm-r { animation-duration: .12s; }
.bob-fig[data-anger="4"] .bob-arm-l { animation: bob-whisking .12s linear infinite; }
.bob-fig[data-anger="4"] .bob-toque, .bob-fig[data-anger="4"] .bob-toque-band, .bob-fig[data-anger="4"] .bob-toque-fold { transform: translateY(-5px) rotate(4deg); transform-origin: 80px 30px; }

/* 5 : aigri, pour toujours. Tete basse, moue, couleurs ternes. */
.bob-fig[data-anger="5"] { --eye: #a8ad6a; filter: saturate(.55); }
.bob-fig[data-anger="5"] .bob-rig { animation: bob-float 7s ease-in-out infinite; }
.bob-fig[data-anger="5"] .bob-jet { opacity: .25; }
.bob-fig[data-anger="5"] .bob-head { transform: rotate(-6deg) translateY(5px); }
.bob-fig[data-anger="5"] .bob-arm-l { transform: rotate(-14deg); }
.bob-fig[data-anger="5"] .bob-arm-r { animation: none; transform: rotate(16deg); }
.bob-fig[data-anger="5"] .bob-eye-open { transform: scaleY(.42); animation: none; }
.bob-fig[data-anger="5"] .bob-shine { opacity: 0; }
.bob-fig[data-anger="5"] .bob-brow-l { transform: rotate(14deg) translateY(7px); }
.bob-fig[data-anger="5"] .bob-brow-r { transform: rotate(-4deg) translateY(4px); }
.bob-fig[data-anger="5"] .bob-cheek { opacity: 0; }
.bob-fig[data-anger="5"] .bob-toque { fill: #cfc8bb; }

.bob-flames { opacity: 0; transition: opacity .4s; pointer-events: none; }
.bob-flames { fill: #ff7a00; stroke: #ffd600; stroke-width: 2; transform-origin: 80px 40px; }
.bob-spring { display: none; fill: none; stroke: url(#bobRim); stroke-width: 3.5; stroke-linecap: round; }
.bob-tip { display: none; fill: #ffd60a; filter: drop-shadow(0 0 6px #ffd60a); animation: bob-tip 1.8s ease-in-out infinite; }

@keyframes bob-flame { from { transform: scale(1); } to { transform: scale(1.08, 1.14); } }
@keyframes bob-tip { 50% { opacity: .55; } }
@keyframes bob-wave { from { transform: rotate(-105deg); } to { transform: rotate(-65deg); } }
@keyframes bob-float { 50% { transform: translateY(-5px); } }
@keyframes bob-jet { to { transform: scaleY(.72); } }
@keyframes bob-blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.08); } }
@keyframes bob-talk { from { transform: scale(1, .5); } to { transform: scale(.85, 1.15); } }
@keyframes bob-whisking { 50% { transform: rotate(-12deg); } }
@keyframes bob-shake { 25% { transform: translate(-1.5px, 1px); } 75% { transform: translate(1.5px, -1px); } }
@keyframes bob-sweat { from { transform: translateY(0); opacity: 1; } to { transform: translateY(26px); opacity: 0; } }

/* Sa bulle */
#bob-bubble {
  position: fixed;
  z-index: 1450;
  left: calc(max(20px, calc(50vw - 742px)) + 82px);
  bottom: 74px;
  width: min(340px, calc(100vw - 130px));
  padding: 14px 16px 12px;
  background: var(--surface-solid);
  color: var(--text);
  border: 2px solid var(--mauve);
  border-radius: 16px;
  box-shadow: 0 6px 22px rgba(0,0,0,.22);
}
#bob-bubble::before {
  content: "";
  position: absolute;
  left: -13px;
  bottom: 14px;
  width: 13px;
  height: 18px;
  background: var(--mauve);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.bob-bubble-name {
  position: absolute;
  top: -11px;
  left: 12px;
  padding: 0 9px;
  border-radius: 99px;
  background: var(--mauve);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
}
#bob-bubble p { font-weight: 600; font-size: .92rem; line-height: 1.35; }
#bob-bubble .btn { margin-top: 8px; }

@media (max-width: 899px) {
  #bob { width: 58px; left: 10px; bottom: 20px; }
  #dock { padding-inline-start: 66px; }
  #bob-bubble { left: 12px; bottom: 136px; width: calc(100vw - 24px); }
  #bob-bubble::before { left: 18px; bottom: -13px; width: 18px; height: 13px; clip-path: polygon(0 0, 100% 0, 0 100%); }
  #ingredients { padding-bottom: 10px; }
  .space-row { flex-wrap: wrap; gap: 3px 8px; }
}
@media (max-width: 720px) {
  #bob { bottom: 16px; }
}
@media (max-width: 480px) {
  /* Le nom de la patisserie passe sur sa propre ligne */
  .hdr-brand { flex-wrap: wrap; row-gap: 0; }
  .bakery-name { order: 3; flex-basis: 100%; max-width: none; justify-content: flex-start; padding: 0 2px; }
}


/* ---------- Intro : Bob en grand, sans sa tenue ---------- */

/* visibility et pas display : le grand Bob utilise les couleurs du petit */
body.in-intro #bob { visibility: hidden; }
body.in-intro #bob-bubble { display: none !important; }
#intro {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 20px;
  flex-wrap: wrap;
  background: radial-gradient(circle at 50% 35%, var(--surface-solid), var(--panel));
  overflow-y: auto;
}
.bob-fig { --eye: #ffd60a; }
#intro-bob { --eye: #ffd60a; width: min(300px, 62vw); flex-shrink: 0; }
#intro-bob svg { display: block; width: 100%; overflow: visible; }
#intro-bob * { transform-box: view-box; }
#intro-bob .bob-toque, #intro-bob .bob-toque-fold, #intro-bob .bob-toque-band,
#intro-bob .bob-apron, #intro-bob .bob-apron-pocket, #intro-bob .bob-apron-heart,
#intro-bob .bob-kerchief, #intro-bob .bob-whisk { display: none; }
#intro-bob .bob-spring, #intro-bob .bob-tip { display: block; }
#intro-bob .m-happy { display: block; }
#intro-bob .bob-arm-r { animation: bob-wave .7s ease-in-out infinite alternate; }
#intro-bob.talking .m { display: none; }
#intro-bob.talking .m-talk { display: block; }
#intro-speech {
  position: relative;
  width: min(440px, 100%);
  padding: 22px;
  background: var(--surface-solid);
  border: 3px solid var(--mauve);
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,.2);
}
#intro-speech p { font-size: 1.2rem; font-weight: 600; line-height: 1.4; margin-bottom: 14px; }
#intro-speech input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-size: 1.1rem;
  font-weight: 700;
}
#intro-speech .btn { font-size: 1.05rem; padding: 10px 22px; }


/* ---------- Thèmes de saison et d'anniversaire ---------- */

:root[data-theme="spring"] {
  --bg: #EFF8E6; --panel: #DDEFCB; --surface: #F5FBEE; --surface-solid: #fff; --surface-2: #E6F4D8;
  --text: #1E3A17; --muted: #41633A; --border: #B5D79C;
  --mauve: #3F8F2B; --mauve-light: #6DB54F; --mauve-dark: #2F7420; --mauve-soft: rgba(63,143,43,.16);
  --header-bg: #4A9A32; --footer-bg: #2B5A20; --footer-text: #DDEFCB; --tab-bg: #DDEFCB; --toast-bg: #2B5A20;
  --blob-1: rgba(255,183,208,.25); --blob-2: rgba(109,189,75,.18); --blob-3: rgba(255,255,255,.4);
  --success: #2E7D32; --error: #C62828; --warn: #B85400; --craft-bar: #EC6FA0; --space-bar: #3F8F2B; --xp-empty: #C9E6B5;
}
:root[data-theme="summer"] {
  --bg: #FFF9D6; --panel: #FFF0A3; --surface: #FFFBE6; --surface-solid: #fff; --surface-2: #FFF4BF;
  --text: #15304F; --muted: #35577C; --border: #F2D765;
  --mauve: #1976D2; --mauve-light: #4FA3E8; --mauve-dark: #125EA8; --mauve-soft: rgba(25,118,210,.14);
  --header-bg: #FFC91F; --footer-bg: #0F4C81; --footer-text: #FFF4BF; --tab-bg: #FFF0A3; --toast-bg: #0F4C81;
  --blob-1: rgba(255,213,79,.3); --blob-2: rgba(41,182,246,.16); --blob-3: rgba(255,255,255,.4);
  --success: #2E7D32; --error: #C62828; --warn: #B85400; --craft-bar: #1E88E5; --space-bar: #29B6F6; --xp-empty: #FFF4BF;
}
:root[data-theme="fall"] {
  --bg: #FFEBD0; --panel: #FFD9A6; --surface: #FFF3E0; --surface-solid: #FFFBF5; --surface-2: #FFE8C8;
  --text: #3F1D0B; --muted: #6E3B1B; --border: #F3B36B;
  --mauve: #D2450F; --mauve-light: #F27A2E; --mauve-dark: #A8320A; --mauve-soft: rgba(210,69,15,.15);
  --header-bg: #C1341A; --footer-bg: #4A1D0A; --footer-text: #FFD9A6; --tab-bg: #FFD9A6; --toast-bg: #4A1D0A;
  --blob-1: rgba(249,177,21,.25); --blob-2: rgba(198,40,40,.12); --blob-3: rgba(255,255,255,.3);
  --success: #4E7A16; --error: #B3261E; --warn: #A8320A; --craft-bar: #E8590C; --space-bar: #B3261E; --xp-empty: #FFE8C8;
}
:root[data-theme="winter"] {
  --bg: #CFE5F7; --panel: #BBD9F2; --surface: #DCEDFA; --surface-solid: #F7FBFF; --surface-2: #E3F0FB;
  --text: #0F2F4F; --muted: #2F5478; --border: #9CC6E8;
  --mauve: #1C74C4; --mauve-light: #57A5E6; --mauve-dark: #155C9E; --mauve-soft: rgba(28,116,196,.15);
  --header-bg: #1B6CB5; --footer-bg: #0F3F6E; --footer-text: #D6E9F8; --tab-bg: #BBD9F2; --toast-bg: #0F3F6E;
  --blob-1: rgba(255,255,255,.5); --blob-2: rgba(87,165,230,.2); --blob-3: rgba(255,255,255,.4);
  --success: #2E7D32; --error: #C62828; --warn: #B85400; --craft-bar: #2F8FE0; --space-bar: #5C7FD6; --xp-empty: #D6E9F8;
}
:root[data-theme="birthday"] {
  --bg: #FFF3E0; --panel: #FCE4EC; --surface: #FFF3E0; --surface-solid: #fff; --surface-2: #FCE4EC;
  --text: #4E342E; --muted: #6D4C41; --border: #F8BBD0;
  --mauve: #E91E63; --mauve-light: #FF4081; --mauve-dark: #C2185B; --mauve-soft: rgba(233,30,99,.14);
  --header-bg: #E91E63; --footer-bg: #880E4F; --footer-text: #F8BBD0; --tab-bg: #FCE4EC; --toast-bg: #880E4F;
  --blob-1: rgba(255,214,10,.3); --blob-2: rgba(233,30,99,.18); --blob-3: rgba(66,165,245,.2);
  --success: #2E7D32; --error: #C62828; --warn: #E65100; --craft-bar: #AB47BC; --space-bar: #7B1FA2; --xp-empty: #FCE4EC;
}


/* ---------- Listes, filtres, quantités ---------- */

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h2 { margin-bottom: 0; }
.bulk-chips { display: flex; gap: 3px; }
.chip { color: var(--text); background: var(--surface-solid); }
.chip:disabled { opacity: .55; cursor: not-allowed; transform: none; border-color: var(--border); }
.chip small { display: block; font-weight: 500; font-size: .68rem; color: var(--muted); }
.chip.active { background: var(--mauve); border-color: var(--mauve); color: #fff; box-shadow: none; }
.chip .uii { margin-inline-end: 3px; }
.bulk-chips .chip { padding: 2px 8px; font-size: .74rem; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.list-tools .chip { padding: 4px 10px; font-size: .8rem; }
.panel-search {
  flex: 1 1 150px;
  min-width: 0;
  width: 100%;
  padding: 5px 10px;
  margin-bottom: 6px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  font-size: .84rem;
}
.list-tools .panel-search { margin-bottom: 0; }
.sort-select { padding: 4px 8px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface-solid); font-size: .8rem; font-weight: 600; }
.sort-select option { background: var(--surface-solid); color: var(--text); }
.empty-note { color: var(--muted); font-style: italic; font-size: .88rem; text-align: center; padding: 8px; }
.hint-note { color: var(--muted); font-size: .8rem; margin: 4px 0 8px; }

.fav-btn { border: none; background: none; padding: 0 4px 0 0; color: var(--border); transition: color .2s, transform .3s var(--spring); vertical-align: -2px; }
.fav-btn:hover { color: #FFB300; transform: scale(1.2); }
.fav-btn.on { color: #FFB300; }
.fav-btn.on .uii { fill: #FFB300; }

.rec-actions { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; align-items: stretch; }
.rec-actions .btn-small { display: inline-flex; justify-content: center; align-items: center; gap: 4px; padding: 3px 8px; font-size: .74rem; }
.rec-money { color: var(--warn); }
.rec-profit { color: var(--success); font-weight: 800; }
.rec-reason { color: var(--error); font-size: .74rem; font-weight: 700; margin-top: 3px; }
.rec-card.disabled { background: var(--surface-solid); }

.oven-card { border-color: var(--mauve); }
.oven-count { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: .76rem; font-weight: 800; color: var(--muted); align-self: center; white-space: nowrap; }

.recruit-section { margin-bottom: 12px; }
.recruit-section h4 { margin-bottom: 6px; }
.recruit-row { display: flex; flex-wrap: wrap; gap: 6px; }

.ach-bonus { font-size: .84rem; font-weight: 700; color: var(--success); margin-bottom: 8px; }
.ach-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.ach-desc { font-size: .66rem; color: var(--muted); margin-top: 2px; line-height: 1.2; }
.ach-item.locked { opacity: .72; }
.ach-item.locked .ach-icon { filter: grayscale(.9); opacity: .55; }

.birthday-select { align-items: flex-end; flex-wrap: wrap; justify-content: flex-start; }
.offline-list { margin: 0 0 10px 18px; line-height: 1.6; font-size: .92rem; }

:focus-visible { outline: 2px solid var(--mauve-dark); outline-offset: 2px; }

@media (max-width: 720px) {
  .rec-actions .btn-small { font-size: .68rem; }
  .ach-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  #intro { gap: 10px; align-content: center; }
  #intro-bob { width: min(190px, 48vw); }
  #intro-speech p { font-size: 1rem; }
  .oven-count { font-size: .68rem; }
}

/* ---------- Bêta 1.1 : décors des saisons ---------- */

#decor-layer { position: fixed; inset: 0; z-index: 8; overflow: hidden; pointer-events: none; }
.dp {
  position: absolute;
  top: 0;
  left: var(--x, 0);
  width: var(--sz);
  height: var(--sz);
  background: center / contain no-repeat;
  will-change: transform;
}
.dp-fall, .dp-snow, .dp-leaf { animation: dp-fall var(--d) linear var(--dl) infinite; }
.dp-snow { filter: drop-shadow(0 0 1.5px rgba(21,92,158,.55)); animation-name: dp-snow; }
.dp-leaf { animation-name: dp-leaf; filter: drop-shadow(0 1px 1px rgba(63,29,11,.25)); }
.dp-fall { filter: drop-shadow(0 1px 1px rgba(136,14,79,.2)); }
@keyframes dp-fall {
  0% { transform: translate3d(0, -6vh, 0) rotate(0); }
  25% { transform: translate3d(var(--sw), 22vh, 0) rotate(calc(var(--sp) * .25)); }
  50% { transform: translate3d(calc(var(--sw) * -.4), 50vh, 0) rotate(calc(var(--sp) * .5)); }
  75% { transform: translate3d(var(--sw), 78vh, 0) rotate(calc(var(--sp) * .75)); }
  100% { transform: translate3d(0, 106vh, 0) rotate(var(--sp)); }
}
@keyframes dp-snow {
  0% { transform: translate3d(0, -4vh, 0) rotate(0); }
  50% { transform: translate3d(var(--sw), 50vh, 0) rotate(calc(var(--sp) * .5)); }
  100% { transform: translate3d(calc(var(--sw) * -.5), 104vh, 0) rotate(var(--sp)); }
}
@keyframes dp-leaf {
  0% { transform: translate3d(0, -6vh, 0) rotate(0) rotateY(0); }
  20% { transform: translate3d(var(--sw), 16vh, 0) rotate(calc(var(--sp) * .2)) rotateY(70deg); }
  40% { transform: translate3d(calc(var(--sw) * -.6), 38vh, 0) rotate(calc(var(--sp) * .4)) rotateY(180deg); }
  60% { transform: translate3d(var(--sw), 60vh, 0) rotate(calc(var(--sp) * .6)) rotateY(250deg); }
  80% { transform: translate3d(calc(var(--sw) * -.4), 82vh, 0) rotate(calc(var(--sp) * .8)) rotateY(320deg); }
  100% { transform: translate3d(0, 106vh, 0) rotate(var(--sp)) rotateY(360deg); }
}
.dp-fly { left: 0; top: var(--y); height: calc(var(--sz) * .45); opacity: .85; animation: dp-fly var(--d) linear var(--dl) infinite; }
@keyframes dp-fly {
  from { transform: translate3d(-12vw, 0, 0); }
  50% { transform: translate3d(50vw, -2vh, 0); }
  to { transform: translate3d(112vw, 0, 0); }
}
/* Sans animations : quelques decors immobiles */
body.reduced-particles .dp { animation: none; top: var(--y); transform: none; }
body.reduced-particles .dp:nth-child(n+7) { display: none; }
body.reduced-particles .dp-fly { left: var(--y); }
@media (prefers-reduced-motion: reduce) {
  .dp { animation: none; top: var(--y); transform: none; }
  .dp:nth-child(n+7) { display: none; }
  .dp-fly { left: var(--y); }
}

/* Guirlande sous l'en-tete */
:root[data-decor] #tabs::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  bottom: 100%;
  height: 24px;
  background: var(--decor-strip) repeat-x left top;
  pointer-events: none;
  z-index: 5;
}
:root[data-decor] #tabs { margin-top: 24px; }
:root[data-decor] #dock { position: relative; }
:root[data-decor] #dock::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 100%;
  height: 22px;
  background: var(--decor-ground) repeat-x left bottom;
  pointer-events: none;
  z-index: 3;
}
:root[data-decor] #game-area { padding-bottom: 24px; }

/* Dessins dans le fond des panneaux : ils restent en place, les cartes passent devant */
:root[data-decor] #main-panel {
  background-image: var(--decor-corner), var(--decor-top), var(--decor-tile);
  background-repeat: no-repeat, no-repeat, repeat;
  background-position: right 6px bottom 0, right 8px top 8px, 0 0;
}
:root[data-decor] #ingredients {
  background-image: var(--decor-corner2, none), var(--decor-tile);
  background-repeat: no-repeat, repeat;
  background-position: right 4px bottom 0, 0 0;
}
:root[data-decor="spring"] #ingredients { --decor-corner2: var(--decor-top); background-position: right 6px top 8px, 0 0; }
:root[data-decor] .rec-card:not(.locked), :root[data-decor] .sell-card, :root[data-decor] .bld-card:not(.locked), :root[data-decor] .emp-card, :root[data-decor] .ing-card:not(.locked) {
  background-image: var(--decor-card);
  background-repeat: no-repeat;
  background-position: right -8px bottom -10px;
}
:root[data-decor] .rec-card:not(.locked), :root[data-decor] .bld-card:not(.locked), :root[data-decor] .sell-card {
  background-position: left -10px bottom -12px;
}
:root[data-decor] #main-panel .panel-head h2::before,
:root[data-decor] #ingredients .panel-head h2::before,
:root[data-decor] .modal > h2:first-child::before {
  content: "";
  display: inline-block;
  width: 24px; height: 24px;
  margin-inline-end: 8px;
  vertical-align: -5px;
  background: var(--decor-mark) center / contain no-repeat;
}
:root[data-decor] .modal { border-top: 4px solid var(--mauve); }
:root[data-decor] .modal-console { border-top-width: 1.5px; }
:root[data-theme="fall"] .site-header { background: linear-gradient(90deg, #A81E14, #D9480F 55%, #EFA00B); }
:root[data-theme="winter"] .site-header { background: linear-gradient(90deg, #15599A, #1B6CB5 60%, #2F8FE0); }
:root[data-theme="spring"] .site-header { background: linear-gradient(90deg, #3E8A28, #4A9A32 60%, #66B044); }

/* L'ete a un en-tete jaune : le texte passe en bleu nuit */
:root[data-theme="summer"] .site-header { background: linear-gradient(90deg, #FFC91F, #FFD84D 60%, #FFE27A); }
:root[data-theme="summer"] .game-name,
:root[data-theme="summer"] .bakery-name,
:root[data-theme="summer"] .bakery-name .uii,
:root[data-theme="summer"] .money-display,
:root[data-theme="summer"] .level-display,
:root[data-theme="summer"] .version-badge,
:root[data-theme="summer"] .hbtn { color: #0F3A66; text-shadow: none; }
:root[data-theme="summer"] .version-badge { border-color: #0F3A66; }
:root[data-theme="summer"] .level-display { background: rgba(15,76,129,.14); }
:root[data-theme="summer"] .hbtn { border-color: rgba(15,76,129,.5); background: rgba(255,255,255,.35); }
:root[data-theme="summer"] .bakery-name:hover { border-color: #0F3A66; background: rgba(255,255,255,.35); }
:root[data-theme="summer"] .xp-bar-text { color: #0F3A66; text-shadow: none; }
:root[data-theme="summer"] .xp-bar-container { border-color: rgba(15,76,129,.45); }
:root[data-theme="summer"] .xp-bar-fill { background: linear-gradient(90deg, #7CC8F2, #4FA3E8); }
:root[data-theme="summer"] .gtab-ind { box-shadow: inset 0 -3px 0 #FFC91F; }


/* ---------- Boutons communs des menus ---------- */

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: transform .25s var(--spring), border-color .2s, color .2s;
}
/* Seule l'icone tourne : si le bouton lui-meme tournait, la souris sortait du bouton en plein mouvement et tout clignotait */
.icon-btn svg { transition: transform .25s var(--spring); }
.icon-btn:hover { border-color: var(--mauve); color: var(--mauve); }
.icon-btn:hover svg { transform: rotate(90deg); }


/* ---------- Réglages ---------- */

.modal.modal-settings { width: min(920px, 100%); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.set-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.set-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.35rem; }
.set-head h2 .uii { color: var(--mauve); }
.set-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 0; flex: 1; }
.set-nav { display: flex; flex-direction: column; gap: 4px; padding: 14px 10px; background: var(--surface-2); border-inline-end: 1px solid var(--border); }
.set-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--text);
  font-weight: 700;
  font-size: .92rem;
  text-align: start;
  transition: background .2s, color .2s, transform .25s var(--spring);
}
.set-tab:hover:not(.active) { background: var(--mauve-soft); transform: translateX(2px); }
.set-tab.active { background: var(--mauve); color: #fff; }
.set-pane { padding: 16px 18px; overflow-y: auto; min-height: 460px; max-height: calc(100dvh - 110px); }
.set-card { padding: 4px 14px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.set-card h3 { margin: 10px 0 6px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.set-card > .btn { margin: 0 0 12px; }
.set-card.danger { border-color: var(--error); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; }
.set-row + .set-row { border-top: 1px solid var(--border); }
.set-label { min-width: 0; }
.set-label b { display: block; font-weight: 700; font-size: .95rem; }
.set-label small, .set-help { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.set-help { margin: 0 0 9px !important; }
.set-ctl { flex-shrink: 0; display: flex; align-items: center; }
.set-value { font-weight: 700; font-size: .88rem; }
.set-select { max-width: 220px; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface-solid); color: var(--text); font-weight: 600; font-size: .86rem; }
.set-select option { background: var(--surface-solid); color: var(--text); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button { padding: 5px 12px; border: none; border-radius: 9px; background: none; color: var(--text); font-weight: 700; font-size: .84rem; transition: background .2s, color .2s; }
.segmented button.active { background: var(--mauve); color: #fff; }
.switch { position: relative; width: 48px; height: 28px; padding: 0; border: none; border-radius: 99px; background: var(--border); transition: background .25s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: transform .3s var(--spring); }
.switch.on { background: var(--success); }
.switch.on span { transform: translateX(20px); }
.volume-row { display: flex; align-items: center; gap: 10px; }
.volume-row input { width: 150px; accent-color: var(--mauve); }
.volume-row span { min-width: 44px; text-align: end; font-weight: 700; font-size: .86rem; font-variant-numeric: tabular-nums; }
.birthday-pick { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.birthday-pick .set-select { width: auto; }
.set-code { display: block; width: 100%; min-height: 62px; padding: 8px 10px; margin-bottom: 8px; font-family: var(--mono); font-size: .74rem; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface-solid); color: var(--text); resize: vertical; }
.set-version { margin: 6px 0 0 !important; text-align: center; font-size: .76rem; color: var(--muted); }

.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; padding-bottom: 12px; }
.theme-card { display: flex; flex-direction: column; gap: 3px; padding: 7px; text-align: start; border: 2px solid var(--border); border-radius: 14px; background: var(--surface-solid); color: var(--text); transition: transform .25s var(--spring), border-color .2s, box-shadow .2s; }
.theme-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--mauve-light); }
.theme-card.active { border-color: var(--mauve); box-shadow: 0 0 0 2px var(--mauve-soft); }
.theme-card.locked { cursor: not-allowed; }
.theme-card.locked .theme-prev { filter: grayscale(.75); opacity: .65; }
.theme-name { font-weight: 800; font-size: .86rem; }
.theme-card small { color: var(--muted); font-size: .68rem; line-height: 1.2; }
.theme-prev { position: relative; display: block; height: 58px; border-radius: 9px; overflow: hidden; background: var(--p-bg); margin-bottom: 3px; }
.theme-prev i { position: absolute; display: block; }
.theme-prev i:nth-child(1) { inset: 0 0 auto 0; height: 15px; background: var(--p-head); }
.theme-prev i:nth-child(2) { left: 8px; top: 23px; width: 42%; height: 8px; border-radius: 4px; background: var(--p-accent); }
.theme-prev i:nth-child(3) { left: 8px; top: 36px; width: 60%; height: 12px; border-radius: 5px; background: var(--p-card); }
.theme-mark { position: absolute; right: 5px; bottom: 4px; width: 26px; height: 26px; }
.tp-light { --p-bg: #F5E6D3; --p-head: #D4956B; --p-accent: #C4855B; --p-card: #FFFFFF; }
.tp-dark { --p-bg: #2F221B; --p-head: #3E2723; --p-accent: #D4956B; --p-card: #1A1210; }
.tp-spring { --p-bg: #DDEFCB; --p-head: #4A9A32; --p-accent: #3F8F2B; --p-card: #FFFFFF; }
.tp-summer { --p-bg: #FFF0A3; --p-head: #FFC91F; --p-accent: #1976D2; --p-card: #FFFFFF; }
.tp-fall { --p-bg: #FFD9A6; --p-head: linear-gradient(90deg, #A81E14, #D9480F, #EFA00B); --p-accent: #D2450F; --p-card: #FFFBF5; }
.tp-winter { --p-bg: #BBD9F2; --p-head: #1B6CB5; --p-accent: #1C74C4; --p-card: #F7FBFF; }
.tp-birthday { --p-bg: #FCE4EC; --p-head: #E91E63; --p-accent: #FFC107; --p-card: #FFFFFF; }

@media (max-width: 720px) {
  .set-body { grid-template-columns: 1fr; }
  .set-nav { flex-direction: row; overflow-x: auto; padding: 8px; border-inline-end: none; border-bottom: 1px solid var(--border); }
  .set-tab { flex: 1 0 auto; padding: 8px 10px; font-size: .82rem; gap: 6px; }
  .set-pane { min-height: 0; max-height: calc(100dvh - 170px); padding: 12px; }
  .set-row { flex-wrap: wrap; gap: 8px; }
  .set-ctl { max-width: 100%; }
  .volume-row input { width: 130px; }
}


/* ---------- Pause ---------- */

.modal.modal-pause { width: min(520px, 100%); padding: 22px; background: var(--surface-solid); }
.pause-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pause-top .bob-talk-figure { width: 82px; flex-shrink: 0; }
.pause-title { min-width: 0; }
.pause-title h2 { margin: 2px 0; font-size: 2rem; line-height: 1.05; }
.pause-title p { margin: 0 !important; color: var(--muted); font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.pause-kicker { display: inline-flex; align-items: center; gap: 5px; color: var(--mauve-dark); font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pause-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.pause-tile { padding: 8px 10px; min-width: 0; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pause-tile span { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); }
.pause-tile b { display: block; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pause-tip { padding: 9px 12px; margin-bottom: 14px !important; border-inline-start: 4px solid var(--mauve); border-radius: 0 10px 10px 0; background: var(--mauve-soft); font-size: .88rem; }
.pause-resume { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; font-size: 1.1rem; }
.pause-resume kbd { margin-inline-start: 4px; padding: 0 7px; border: 1px solid currentColor; border-radius: 6px; font: 700 .72rem var(--font); opacity: .75; }
.pause-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pause-actions .btn { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 6px; font-size: .86rem; min-width: 0; }
@media (max-width: 480px) { .pause-tiles { grid-template-columns: 1fr 1fr; } }


/* ---------- Bob qui parle en grand ---------- */

.bob-talk-figure { --eye: #ffd60a; width: 170px; flex-shrink: 0; }
.bob-talk-figure svg { display: block; width: 100%; overflow: visible; }
.bob-talk-figure * { transform-box: view-box; }
.bob-talk-figure .m-happy { display: block; }
.bob-talk-figure[data-anger="5"] { --eye: #a8ad6a; filter: saturate(.55); }
.bob-talk-figure[data-anger="5"] .m-happy { display: none; }
.bob-talk-figure[data-anger="5"] .m-sour { display: block; }
.bob-talk-figure[data-anger="5"] .bob-eye-open { transform: scaleY(.42); animation: none; }
.bob-talk-figure[data-anger="5"] .bob-shine { opacity: 0; }
.modal.modal-bob { width: min(680px, 100%); }
.bob-talk { display: flex; align-items: center; gap: 22px; }
.bob-talk-speech { position: relative; flex: 1; min-width: 0; padding: 18px; border: 2px solid var(--mauve); border-radius: 18px; background: var(--surface); }
.bob-talk-speech p { margin: 0 0 14px !important; font-size: 1.05rem; font-weight: 600; line-height: 1.42; }
.bob-talk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bob-talk-steps { color: var(--muted); font-size: .8rem; font-weight: 700; }
@media (max-width: 560px) {
  .bob-talk { flex-direction: column; gap: 8px; }
  .modal-bob .bob-talk-figure { width: 110px; }
}


/* ---------- Banque ---------- */

.bank-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 14px; }
.bank-tile { padding: 10px 12px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border); min-width: 0; }
.bank-tile span { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; }
.bank-tile b { display: block; font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bank-tile.alert { border-color: var(--error); }
.bank-tile.alert b { color: var(--error); }
.bank-h { margin: 12px 0 8px; font-size: .98rem; font-weight: 800; }
.loan-active-list { display: flex; flex-direction: column; gap: 8px; }
.loan-active { padding: 10px 12px; border-radius: 12px; background: var(--surface-solid); border: 1.5px solid var(--border); }
.loan-active.late { border-color: var(--error); }
.loan-active.late .loan-active-foot span { color: var(--error); font-weight: 700; }
.loan-active-top, .loan-active-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: .86rem; }
.loan-active-foot span { color: var(--muted); font-size: .8rem; }
.loan-bar { height: 8px; margin: 7px 0; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.loan-bar > div { height: 100%; border-radius: 99px; background: var(--success); transition: width .6s var(--ease); }
.loan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.loan-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-solid); border: 1.5px solid var(--border); transition: transform .25s var(--spring), border-color .2s; animation: tx-rise .35s var(--ease) both; }
.loan-card:hover:not(.taken) { transform: translateY(-2px); border-color: var(--mauve); }
.loan-card.taken { opacity: .68; }
.loan-amount { font-size: 1.4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.loan-card dl { display: grid; gap: 2px; margin: 0; font-size: .8rem; }
.loan-card dl > div { display: flex; justify-content: space-between; gap: 6px; }
.loan-card dt { color: var(--muted); }
.loan-card dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }


/* ---------- Statistiques et graphiques ---------- */

:root { --chart-1: #2a78d6; --chart-2: #eb6834; }
:root[data-theme="dark"] { --chart-1: #3987e5; --chart-2: #d95926; }
.stats-teaser { display: flex; align-items: center; gap: 9px; padding: 10px 12px; margin: 10px 0; border: 1.5px dashed var(--mauve); border-radius: 12px; font-weight: 600; font-size: .88rem; }
.stats-teaser .uii { color: var(--mauve); font-size: 1.2rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi { padding: 10px 12px; min-width: 0; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border); }
.kpi-label { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; }
.kpi-value { display: block; font-size: 1.28rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi small { display: block; color: var(--muted); font-size: .68rem; line-height: 1.25; margin-top: 1px; }
.chart-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.chart-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-card { margin: 0; padding: 12px 13px; min-width: 0; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); }
.chart-card figcaption { margin-bottom: 8px; }
.chart-card figcaption b { display: block; font-size: .95rem; font-weight: 800; }
.chart-card figcaption span { color: var(--muted); font-size: .76rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.c-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-inline-end: 5px; vertical-align: middle; }
.chart-legend .c-key { margin: 0; }
.c-key.s1 { background: var(--chart-1); }
.c-key.s2 { background: var(--chart-2); }
.chart-plot { touch-action: pan-y; }
.chart-svg { display: block; max-width: 100%; overflow: visible; }
.c-grid { stroke: var(--border); stroke-width: 1; opacity: .7; }
.c-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.c-end { fill: var(--text); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-line.s1 { stroke: var(--chart-1); }
.c-line.s2 { stroke: var(--chart-2); }
.c-area { opacity: .1; stroke: none; }
.c-area.s1 { fill: var(--chart-1); }
.c-dot { stroke: var(--surface-solid); stroke-width: 2; }
.c-dot.s1 { fill: var(--chart-1); }
.c-dot.s2 { fill: var(--chart-2); }
.hbars { display: grid; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 34%) minmax(30px, 1fr) auto; align-items: center; gap: 8px; font-size: .8rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar-track { display: block; height: 14px; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; transition: width .5s var(--ease); }
.hbar-fill.s1 { background: var(--chart-1); }
.hbar-fill.s2 { background: var(--chart-2); }
.hbar-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-tip {
  display: none;
  position: fixed;
  z-index: 2600;
  max-width: 260px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--toast-bg);
  color: #fff;
  font-size: .8rem;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.chart-tip strong { font-variant-numeric: tabular-nums; }
.chart-cross { display: none; position: fixed; z-index: 2590; width: 1px; background: var(--muted); pointer-events: none; }
.chart-table-toggle { margin-bottom: 10px; padding: 4px 10px; font-size: .8rem; }
.table-wrap { overflow-x: auto; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-solid); }
.chart-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.chart-table th, .chart-table td { padding: 6px 10px; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-table th:first-child, .chart-table td:first-child { text-align: start; }
.chart-table th { color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--border); }
.chart-table tr + tr td { border-top: 1px solid var(--border); }
.chart-table tr.current td { font-weight: 700; }
.chart-table em { font-style: normal; font-size: .7rem; padding: 0 6px; border-radius: 6px; background: var(--mauve-soft); }
.all-ach { padding: 10px 13px; margin-bottom: 12px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); }
.all-ach-top { display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; }
.all-ach .hint-note { margin: 0; }


/* ---------- Guide des commandes ---------- */

.console-help-btn { display: inline-flex; align-items: center; gap: 5px; background: transparent !important; color: #fff !important; border-color: rgba(255,255,255,.35) !important; }
.console-guide { flex: 1.15 1 0; min-width: 0; flex-direction: column; padding: 18px; border-inline-start: 1px solid rgba(212,149,107,.3); background: #12101a; font-family: var(--font); animation: tx-rise .3s var(--ease) both; }
.cg-head h3 { color: #fff; margin: 0; font-size: 1.1rem; }
.cg-head p { margin: 2px 0 10px !important; color: #b9b5c9; font-size: .8rem; }
.cg-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; margin-bottom: 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: #1b1826; color: #b9b5c9; }
.modal.modal-console .cg-search input { flex: 1; width: auto; min-width: 0; margin: 0; padding: 8px 0; border: none; border-radius: 0; background: none; color: #fff; font-weight: 500; }
.modal.modal-console .cg-search input:focus { outline: none; }
.cg-search:focus-within { border-color: var(--mauve-light); }
.cg-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.cg-cat { padding: 3px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 99px; background: none; color: #d5d2e0; font-size: .76rem; font-weight: 700; transition: background .2s, color .2s; }
.cg-cat:hover { border-color: var(--mauve-light); }
.cg-cat.active { background: var(--mauve-light); border-color: var(--mauve-light); color: #1a1210; }
.cg-list { flex: 1; min-height: 0; overflow-y: auto; padding-inline-end: 6px; max-height: calc(100dvh - 230px); }
.cg-list h4 { margin: 12px 0 6px; color: var(--mauve-light); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cg-list h4:first-child { margin-top: 0; }
.cg-card { padding: 9px 11px; margin-bottom: 6px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: #1b1826; }
.cg-card.danger { border-color: rgba(255,107,154,.55); }
.cg-usage code { display: block; padding: 0; background: none; border: none; color: #ffd60a; font-family: var(--mono); font-size: .8rem; font-weight: 600; word-break: break-word; }
.cg-arg { color: #7fd8ff; font-style: normal; }
.cg-opt { color: #b9b5c9; font-style: normal; }
.cg-or { color: #8d889e; padding: 0 1px; }
.cg-card p { margin: 4px 0 6px !important; color: #e0deea; font-size: .82rem; line-height: 1.35; }
.cg-warn { display: block; margin-bottom: 6px; color: #ff8fb1; font-size: .74rem; font-weight: 700; }
.cg-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cg-ex > span { color: #8d889e; font-size: .72rem; font-weight: 700; margin-inline-end: 2px; }
.cg-ex button { padding: 2px 8px; border: 1px solid rgba(255,214,10,.3); border-radius: 7px; background: rgba(255,214,10,.08); color: #ffe88a; font-family: var(--mono); font-size: .72rem; transition: background .2s, transform .2s var(--spring); }
.cg-ex button:hover { background: rgba(255,214,10,.22); transform: translateY(-1px); }
.cg-empty { color: #b9b5c9; font-size: .86rem; text-align: center; padding: 20px 0; }
@media (max-width: 820px) {
  .console-modal { flex-direction: column; overflow-y: auto; }
  .console-guide { border-inline-start: none; border-top: 1px solid rgba(212,149,107,.3); }
  .cg-list { max-height: none; }
  .console-output { min-height: 110px; max-height: 180px; }
  .console-input-row { flex-wrap: wrap; }
}

/* Le petit point de turbonix.css devant les titres n'a pas sa place dans ces menus */
.set-head h2::before, .console-head h2::before, .pause-title h2::before, .cg-head h3::before { display: none !important; }

@media (max-width: 480px) {
  .gtab { font-size: .6rem; }
  /* Sur telephone, le panneau des ingredients est trop petit pour un grand dessin */
  :root[data-decor] #ingredients { background-image: var(--decor-tile); background-repeat: repeat; background-position: 0 0; }
}

/* ---------- Bêta 1.2 ---------- */

/* Themes speciaux : l'espace et la fete */
:root[data-theme="space"] {
  color-scheme: dark;
  --bg: #0B1437; --panel: #111C4A; --surface: #0E1840; --surface-solid: #17235A; --surface-2: #1F2D6E;
  --text: #EAF0FF; --muted: #B6C2EE; --border: #2E3E8C;
  --mauve: #5C6BFF; --mauve-light: #8B97FF; --mauve-dark: #4250D8; --mauve-deep: #B6C2EE; --mauve-soft: rgba(92,107,255,.22);
  --header-bg: #0A1030; --footer-bg: #070B22; --footer-text: #B6C2EE; --tab-bg: #111C4A; --toast-bg: #1F2D6E;
  --blob-1: rgba(92,107,255,.2); --blob-2: rgba(179,136,255,.15); --blob-3: rgba(79,195,247,.1);
  --success: #7CE0A8; --error: #FF9A9A; --warn: #FFC66B; --craft-bar: #5CC8FF; --space-bar: #B388FF; --xp-empty: #1F2D6E;
  --shadow: 0 2px 12px rgba(0,0,0,.45); --btn-shadow: rgba(0,0,0,.4);
  --chart-1: #6FA8FF; --chart-2: #FF8A5C;
}
:root[data-theme="party"] {
  color-scheme: dark;
  --bg: #1B0B33; --panel: #2A1150; --surface: #22103F; --surface-solid: #321A5C; --surface-2: #3E2270;
  --text: #FDF3FF; --muted: #D9C2F0; --border: #5B3A8F;
  --mauve: #C22BDE; --mauve-light: #F48FFF; --mauve-dark: #9A1DB3; --mauve-deep: #D9C2F0; --mauve-soft: rgba(224,64,251,.22);
  --header-bg: #2A0F55; --footer-bg: #12072A; --footer-text: #D9C2F0; --tab-bg: #2A1150; --toast-bg: #4A1E86;
  --blob-1: rgba(224,64,251,.2); --blob-2: rgba(0,229,255,.14); --blob-3: rgba(255,215,64,.1);
  --success: #69F0AE; --error: #FF8A80; --warn: #FFD740; --craft-bar: #00E5FF; --space-bar: #FF4081; --xp-empty: #3E2270;
  --shadow: 0 2px 14px rgba(0,0,0,.45); --btn-shadow: rgba(0,0,0,.4);
  --chart-1: #5FD8FF; --chart-2: #FF7BB5;
}
:root[data-theme="space"] .rec-xp, :root[data-theme="party"] .rec-xp, :root[data-theme="horror"] .rec-xp { color: #AED581; }
:root[data-theme="space"] .rec-time, :root[data-theme="party"] .rec-time, :root[data-theme="horror"] .rec-time { color: #64B5F6; }
:root[data-theme="space"] .rec-space, :root[data-theme="party"] .rec-space, :root[data-theme="horror"] .rec-space { color: #CE93D8; }
:root[data-theme="space"] .site-header { background: linear-gradient(90deg, #070B22, #0F1A4A 55%, #1A2A70); }
:root[data-theme="party"] .site-header { background: linear-gradient(90deg, #5A12A8, #C2188F 40%, #1C5BD9 75%, #00A7C4); background-size: 220% 100%; animation: party-head 9s ease-in-out infinite alternate; }
@keyframes party-head { to { background-position: 100% 0; } }
.tp-space { --p-bg: #111C4A; --p-head: #070B22; --p-accent: #8B97FF; --p-card: #1F2D6E; }
.tp-party { --p-bg: #2A1150; --p-head: linear-gradient(90deg, #5A12A8, #C2188F, #00A7C4); --p-accent: #FFD740; --p-card: #3E2270; }

.dp-twinkle { left: var(--x); top: var(--y); animation: dp-twinkle var(--d) ease-in-out var(--dl) infinite; }
@keyframes dp-twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.1); } }
.dp-comet { position: absolute; top: 14vh; left: -12vw; width: 110px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #fff); transform: rotate(14deg); animation: dp-comet 17s linear infinite; }
@keyframes dp-comet { 0%, 80% { transform: translate3d(0, 0, 0) rotate(14deg); opacity: 0; } 82% { opacity: 1; } 96% { opacity: 1; } 100% { transform: translate3d(130vw, 34vw, 0) rotate(14deg); opacity: 0; } }
.disco-ball { position: absolute; top: -14px; left: 76%; width: 50px; margin-left: -25px; animation: disco-sway 5s ease-in-out infinite; transform-origin: 50% -20px; filter: drop-shadow(0 0 16px rgba(255,255,255,.55)); }
.disco-ball img { display: block; width: 100%; }
@keyframes disco-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.disco-beams {
  position: absolute;
  left: 76%; top: 30px;
  opacity: .6;
  width: 240vmax; height: 240vmax;
  margin: -120vmax 0 0 -120vmax;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,64,129,.14) 0 7deg, transparent 7deg 26deg, rgba(0,229,255,.12) 26deg 33deg, transparent 33deg 52deg, rgba(255,215,64,.12) 52deg 59deg, transparent 59deg 78deg);
  animation: disco-spin 24s linear infinite;
  mix-blend-mode: screen;
}
@keyframes disco-spin { to { transform: rotate(360deg); } }
body.reduced-particles .disco-beams, body.reduced-particles .dp-comet, body.reduced-particles .disco-ball { animation: none; }
body.reduced-particles .dp-comet { display: none; }
@media (prefers-reduced-motion: reduce) { .disco-beams, .disco-ball, .dp-comet, :root[data-theme="party"] .site-header { animation: none; } .dp-comet { display: none; } }
@media (max-width: 900px) { .disco-ball { display: none; } .disco-beams { left: 50%; } }

/* Theme : pour toutes les patisseries, ou seulement celle-ci */
.theme-scope { margin-bottom: 10px; }
.theme-own-note { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; font-size: .8rem; font-weight: 600; }
.set-card > .btn.btn-danger, .birthday-edit { flex-wrap: wrap; }

/* Icone des patisseries dans l'en-tete, avec leur nombre */
.hbtn { position: relative; }
.hbtn-count { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 3px; display: grid; place-items: center; border-radius: 99px; background: #FFD700; color: #3E2723; font-size: .62rem; font-weight: 900; }

/* Onglets : avec 8 onglets ou plus, un telephone n'affiche que les icones */
@media (max-width: 480px) {
  #tabs.many .gtab > span:not(.applicant-badge) { display: none; }
  #tabs.many .gtab { padding: 8px 2px; }
}

/* Loyer en retard */
.rent-late { background: #E65100; color: #fff; }

/* Defi de Bob */
.challenge-banner { background: var(--mauve-dark); color: #fff; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 4px 12px; font-weight: 700; font-size: .85rem; }
.challenge-bar { width: 110px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.3); overflow: hidden; }
.challenge-bar i { display: block; height: 100%; border-radius: 99px; background: #FFD700; }

/* Commandes */
.order-done-count { color: var(--muted); font-size: .84rem; font-weight: 700; }
.order-butler { display: flex; align-items: center; gap: 6px; padding: 6px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--mauve-soft); font-size: .84rem; font-weight: 600; }
.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.order-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-solid); border: 1.5px solid var(--border); animation: tx-rise .35s var(--ease) both; }
.order-card.ready { border-color: var(--success); }
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-level { flex-shrink: 0; padding: 1px 8px; border-radius: 99px; font-size: .7rem; font-weight: 800; background: var(--surface-2); }
.order-level.lv2 { background: #BBDEFB; color: #0F3A66; }
.order-level.lv3 { background: #FFE082; color: #5D3A00; }
.order-level.lv4 { background: #EF9A9A; color: #5B0F0F; }
.order-items { list-style: none; display: grid; gap: 3px; font-size: .84rem; }
.order-items li { display: flex; align-items: center; gap: 6px; }
.order-items li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-items li b { font-variant-numeric: tabular-nums; }
.order-items li.has b { color: var(--success); }
.order-items li.missing b { color: var(--error); }
.order-bar { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.order-bar > div { height: 100%; background: var(--mauve); transition: width .25s linear; }
.order-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .84rem; font-weight: 600; }
.order-foot > span:first-child { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.order-reward { font-weight: 800; text-align: end; }
.order-reward small { display: block; color: var(--success); font-size: .7rem; font-weight: 700; }

/* Machines */
.mach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.mach-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-solid); border: 1.5px solid var(--border); animation: tx-rise .35s var(--ease) both; }
.mach-card.maxed { border-color: var(--success); }
.mach-top { display: flex; gap: 10px; align-items: center; }
.mach-icon { font-size: 1.7rem; line-height: 1; }
.mach-top b { display: block; font-size: .95rem; }
.mach-top small { color: var(--muted); font-size: .78rem; line-height: 1.25; display: block; }
.mach-pips { display: flex; gap: 4px; }
.mach-pips i { flex: 1; height: 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }
.mach-pips i.on { background: var(--mauve); border-color: var(--mauve); }
.mach-now { margin: 0; color: var(--success); font-size: .78rem; font-weight: 700; }
.mach-card .btn { margin-top: auto; }

/* Pret */
.loan-saving { color: var(--success); font-weight: 700; }
.loan-lock { font-size: .8rem; font-weight: 700; color: var(--muted); text-align: center; padding: 5px 0; }
.loan-card.locked { opacity: .6; }

/* Patisseries */
.bakery-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; width: 100%; font-size: .8rem; color: var(--muted); font-weight: 600; }
.bakery-stats .debt { color: var(--error); }
.sell-lines { list-style: none; display: grid; gap: 4px; margin: 8px 0 12px; font-size: .9rem; }
.sell-lines li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.sell-lines li.total { font-weight: 800; font-size: 1.02rem; border: none; }

/* Console : tes commandes favorites */
.console-autocomplete-title { padding: 5px 12px 2px; color: #b9b5c9; font-size: .7rem; font-weight: 700; font-family: var(--font); }
.console-autocomplete-item small { float: right; color: #8d889e; }

/* Bob : ses visages */
.bob-fig * { transform-box: view-box; }
.bob-look { transform: translate(var(--look-x, 0), var(--look-y, 0)); transition: transform .18s ease-out; }
.bob-lid { fill: var(--lid, #120e1f); opacity: 0; transition: opacity .3s, transform .35s var(--spring); }
.bob-lid-l { transform-origin: 60px 45px; }
.bob-lid-r { transform-origin: 100px 45px; }
.bob-eye-joy { display: none; fill: none; stroke: var(--eye); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 5px var(--eye)); }
.bob-tear { fill: #7fd8ff; opacity: 0; }
.m-tongue { fill: #ff7aa2 !important; stroke: none !important; }
.m-teeth { fill: #fff !important; stroke: none !important; }
.m-wow { fill: var(--eye) !important; }
.bob-fig[data-anger="1"] .bob-lid { opacity: 1; transform: translateY(-2px); }
.bob-fig[data-anger="2"] .bob-lid { opacity: 1; }
.bob-fig[data-anger="2"] .bob-lid-l { transform: rotate(9deg); }
.bob-fig[data-anger="2"] .bob-lid-r { transform: rotate(-9deg); }
.bob-fig[data-anger="3"] { --lid: #2e0a0a; }
.bob-fig[data-anger="3"] .bob-lid { opacity: 1; }
.bob-fig[data-anger="3"] .bob-lid-l { transform: rotate(16deg) translateY(2px); }
.bob-fig[data-anger="3"] .bob-lid-r { transform: rotate(-16deg) translateY(2px); }
.bob-fig[data-anger="4"] { --lid: #520808; }
.bob-fig[data-anger="4"] .bob-lid { opacity: 1; }
.bob-fig[data-anger="4"] .bob-lid-l { transform: rotate(24deg) translateY(3px); }
.bob-fig[data-anger="4"] .bob-lid-r { transform: rotate(-24deg) translateY(3px); }
.bob-fig[data-anger="5"] .bob-lid { opacity: 1; }
.bob-fig[data-anger="5"] .bob-lid-l { transform: rotate(-10deg) translateY(7px); }
.bob-fig[data-anger="5"] .bob-lid-r { transform: rotate(10deg) translateY(7px); }
.bob-fig[data-anger="5"] .bob-tear { opacity: 1; animation: bob-tear 2.8s ease-in infinite; }
@keyframes bob-tear { 0% { transform: translateY(-4px) scale(.5); opacity: 0; } 25% { opacity: 1; transform: none; } 100% { transform: translateY(20px); opacity: 0; } }
.bob-fig[data-anger="0"] .m-happy, .bob-fig[data-anger="1"] .m-neutral, .bob-fig[data-anger="2"] .m-sad,
.bob-fig[data-anger="3"] .m-grit, .bob-fig[data-anger="4"] .m-grit, .bob-fig[data-anger="5"] .m-sour { display: block; }
/* Une humeur passagere passe avant tout le reste */
.bob-fig[data-mood] .m { display: none !important; }
.bob-fig[data-mood] .bob-lid { opacity: 0; }
.bob-fig[data-mood] .bob-tear { opacity: 0; animation: none; }
.bob-fig[data-mood="joy"] .bob-eye-open { display: none; }
.bob-fig[data-mood="joy"] .bob-eye-joy { display: block; }
.bob-fig[data-mood="joy"] .m-joy { display: block !important; }
.bob-fig[data-mood="joy"] .bob-cheek { opacity: .9; fill: #ff6b9a; }
.bob-fig[data-mood="joy"] .bob-rig { animation: bob-hop .5s ease-in-out infinite; }
.bob-fig[data-mood="wow"] .bob-eye-open { transform: scale(1.14); }
.bob-fig[data-mood="wow"] .m-wow { display: block !important; }
.bob-fig[data-mood="wow"] .bob-brow { transform: translateY(-5px); }
@keyframes bob-hop { 50% { transform: translateY(-9px); } }
.bob-fig.talking[data-anger="0"]:not([data-mood]) .m { display: none; }
.bob-fig.talking[data-anger="0"]:not([data-mood]) .m-talk { display: block; }
.bob-aside { display: block; margin-top: 6px; font-size: .72em; font-weight: 500; opacity: .62; font-style: italic; }

/* Bob : ses tenues */
.bob-acc { display: none; }
#intro-bob .bob-acc { display: none !important; }
:root[data-theme="spring"] .bob-acc-spring, :root[data-theme="summer"] .bob-acc-summer, :root[data-theme="fall"] .bob-acc-fall,
:root[data-theme="winter"] .bob-acc-winter, :root[data-theme="birthday"] .bob-acc-birthday, :root[data-theme="space"] .bob-acc-space, :root[data-theme="party"] .bob-acc-party { display: inline; }
:root[data-theme="spring"] .bob-apron-heart, :root[data-theme="summer"] .bob-apron-heart, :root[data-theme="fall"] .bob-apron-heart, :root[data-theme="winter"] .bob-apron-heart,
:root[data-theme="birthday"] .bob-apron-heart, :root[data-theme="space"] .bob-apron-heart, :root[data-theme="party"] .bob-apron-heart { display: none; }
:root[data-theme="spring"] .bob-apron { fill: #E8F5D8; stroke: #A5D38A; }
:root[data-theme="spring"] .bob-apron-pocket { fill: #D6ECBF; stroke: #A5D38A; }
:root[data-theme="spring"] .bob-kerchief { fill: #EC6FA0; stroke: #C94C80; }
:root[data-theme="spring"] .bob-toque-band { fill: #A5D38A; stroke: #6DB54F; }
:root[data-theme="summer"] .bob-apron { fill: #DCEFFF; stroke: #8EC5F2; }
:root[data-theme="summer"] .bob-apron-pocket { fill: #BBDEFB; stroke: #8EC5F2; }
:root[data-theme="summer"] .bob-kerchief { fill: #FFC91F; stroke: #D9A200; }
:root[data-theme="summer"] .bob-toque-band { fill: #1E88E5; stroke: #125EA8; }
:root[data-theme="fall"] .bob-apron { fill: #FFE7C4; stroke: #E8A15C; }
:root[data-theme="fall"] .bob-apron-pocket { fill: #FFD59A; stroke: #E8A15C; }
:root[data-theme="fall"] .bob-kerchief { fill: #C1341A; stroke: #8E220F; }
:root[data-theme="fall"] .bob-toque-band { fill: #E8590C; stroke: #A8320A; }
:root[data-theme="winter"] .bob-apron { fill: #EAF5FE; stroke: #9CC6E8; }
:root[data-theme="winter"] .bob-apron-pocket { fill: #D2E7F7; stroke: #9CC6E8; }
:root[data-theme="winter"] .bob-kerchief { fill: #1C74C4; stroke: #155C9E; }
:root[data-theme="winter"] .bob-toque-band { fill: #1C74C4; stroke: #155C9E; }
:root[data-theme="birthday"] .bob-apron { fill: #FDE7EF; stroke: #F48FB1; }
:root[data-theme="birthday"] .bob-apron-pocket { fill: #F8BBD0; stroke: #F48FB1; }
:root[data-theme="birthday"] .bob-kerchief { fill: #E91E63; stroke: #AD1457; }
:root[data-theme="birthday"] .bob-toque-band { fill: #FFC107; stroke: #D39E00; }
:root[data-theme="space"] .bob-apron { fill: #1F2D6E; stroke: #8B97FF; }
:root[data-theme="space"] .bob-apron-pocket { fill: #2C3D8F; stroke: #8B97FF; }
:root[data-theme="space"] .bob-kerchief { fill: #7E57C2; stroke: #5B3AA3; }
:root[data-theme="space"] .bob-toque-band { fill: #FFD54F; stroke: #C9A227; }
:root[data-theme="party"] .bob-apron { fill: #FFD54F; stroke: #FF4081; }
:root[data-theme="party"] .bob-apron-pocket { fill: #FFB300; stroke: #FF4081; }
:root[data-theme="party"] .bob-kerchief { fill: #E040FB; stroke: #9A1DB3; }
:root[data-theme="party"] .bob-toque-band { fill: #00E5FF; stroke: #00A7C4; }

/* Le sucre qu'on glisse sur Bob */
@keyframes sugar-wiggle { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-12deg); } 92% { transform: rotate(12deg); } }
.sugar-ghost { position: fixed; z-index: 3000; font-size: 2rem; pointer-events: none; transform: translate(-50%, -50%) rotate(-8deg); filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
#bob.wants-sugar { filter: drop-shadow(0 0 10px #ffd60a); }
body.dragging-sugar, body.dragging-sugar * { cursor: grabbing !important; user-select: none; }


/* ---------- Bêta 1.2, suite ---------- */

/* Bob se remet : de moins en moins triste */
.bob-fig[data-anger="s3"] { --eye: #bcc27f; filter: saturate(.75); }
.bob-fig[data-anger="s3"] .bob-head { transform: rotate(-4deg) translateY(4px); }
.bob-fig[data-anger="s3"] .bob-rig { animation-duration: 6s; }
.bob-fig[data-anger="s3"] .bob-lid { opacity: 1; }
.bob-fig[data-anger="s3"] .bob-lid-l { transform: rotate(-9deg) translateY(5px); }
.bob-fig[data-anger="s3"] .bob-lid-r { transform: rotate(9deg) translateY(5px); }
.bob-fig[data-anger="s3"] .m-sad { display: block; }
.bob-fig[data-anger="s3"] .bob-tear { opacity: 1; animation: bob-tear 4s ease-in infinite; }
.bob-fig[data-anger="s2"] { --eye: #dcd15e; filter: saturate(.9); }
.bob-fig[data-anger="s2"] .bob-head { transform: rotate(-2deg) translateY(2px); }
.bob-fig[data-anger="s2"] .bob-lid { opacity: 1; }
.bob-fig[data-anger="s2"] .bob-lid-l { transform: rotate(-6deg) translateY(2px); }
.bob-fig[data-anger="s2"] .bob-lid-r { transform: rotate(6deg) translateY(2px); }
.bob-fig[data-anger="s2"] .m-sad { display: block; }
.bob-fig[data-anger="s1"] { --eye: #f2dc3a; }
.bob-fig[data-anger="s1"] .bob-lid { opacity: 1; }
.bob-fig[data-anger="s1"] .bob-lid-l { transform: rotate(-3deg) translateY(-2px); }
.bob-fig[data-anger="s1"] .bob-lid-r { transform: rotate(3deg) translateY(-2px); }
.bob-fig[data-anger="s1"] .m-neutral { display: block; }

#bob { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* Succes et stats dans les reglages */
.ach-head { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; font-size: .95rem; }
.modal-settings .loan-bar { margin: 8px 0; }
.modal-settings .ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.modal-settings .ach-item { padding: 9px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-align: center; min-width: 0; }
.modal-settings .ach-item.unlocked { border-color: var(--success); }
.modal-settings .ach-icon { font-size: 1.5rem; line-height: 1.2; }
.modal-settings .ach-name { font-size: .78rem; font-weight: 800; line-height: 1.2; margin-top: 3px; overflow-wrap: anywhere; }
.stat-rows .set-row { padding: 8px 0; }
.stat-rows .set-label b { font-weight: 600; font-size: .9rem; }
.stat-rows .set-value { font-variant-numeric: tabular-nums; font-weight: 800; }
.modal-settings .kpi-label { text-transform: none; letter-spacing: 0; }
.modal-settings .kpi { text-align: start; }
.modal-settings .list-tools { margin-bottom: 12px; }
@media (max-width: 720px) {
  .set-nav { scrollbar-width: none; }
  .modal-settings .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Barre du bas : bouton des fours */
#space-bar .btn .uii { margin-inline-end: 3px; }

/* Transporteur */
.carrier-assign { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.carrier-assign label { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; }

/* ---------- Bêta 1.4 ---------- */

/* Telephone : taper vite ne doit ni zoomer ni recharger la page */
html, body {
  overscroll-behavior: none;
  touch-action: manipulation;
}
body { position: fixed; inset: 0; width: 100%; }
button, .ing-card, .rec-card, .emp-card { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#ingredients, #main-panel, .set-pane, .modal, .cg-list { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* Favori : bien visible */
.fav-btn {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  padding: 0;
  margin-inline-end: 6px;
  border: 1.5px solid #D4A017;
  border-radius: 9px;
  background: #FFF8DC;
  color: #B8860B;
  vertical-align: -6px;
}
.fav-btn .uii { width: 17px; height: 17px; }
.fav-btn:hover { background: #FFE9A8; color: #8A6500; }
.fav-btn.on { background: #FFC107; border-color: #B8860B; color: #5D4300; }
.fav-btn.on .uii { fill: #5D4300; }

/* Debloquer */
.can-unlock { cursor: pointer; border: 2px dashed var(--mauve) !important; animation: unlock-pulse 2s ease-in-out infinite; }
button.rec-card.can-unlock { display: flex; align-items: center; gap: 8px; width: 100%; text-align: start; color: var(--text); background-color: var(--surface-solid); font-weight: 600; }
@keyframes unlock-pulse { 50% { box-shadow: 0 0 0 4px var(--mauve-soft); } }
.unlock-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--mauve-dark); font-size: .74rem; font-weight: 800; }
.researching { opacity: .85; font-weight: 600; }
.researching .ing-info { display: block !important; color: var(--mauve-dark); font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .can-unlock { animation: none; } }

/* Les tetes des employes */
.emp-face { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--surface-2); overflow: visible; }
.recruit-row .btn { display: inline-flex; align-items: center; gap: 6px; }
.recruit-row .emp-face { width: 24px; height: 24px; }
.search-going { opacity: .7; }
.applicant-card, .emp-header { align-items: center; }
.emp-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.emp-sheet-head .emp-face { width: 60px; height: 60px; }
.emp-sheet-head h2 { margin: 0; }
.emp-sheet-head p { margin: 0 !important; color: var(--muted); font-weight: 600; }
.emp-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; font-size: .84rem; font-weight: 700; color: var(--muted); }
.emp-config { margin-top: 8px; padding-bottom: 10px; }
.cfg-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 8px; font-size: .86rem; font-weight: 700; }
.cfg-row .set-select { max-width: none; width: 100%; }
.modal .cfg-row input[type="number"] { margin: 0; }
.emp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chef-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; max-height: 220px; overflow-y: auto; }
.chef-rec { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface-solid); color: var(--text); font-size: .78rem; font-weight: 600; text-align: start; min-width: 0; }
.chef-rec span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chef-rec.on { border-color: var(--mauve); background: var(--mauve-soft); }
.chef-rec b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--mauve); color: #fff; font-size: .68rem; }
.mach-card.locked { opacity: .6; }

/* Guide : menus depliants */
.cg-card summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; cursor: pointer; list-style: none; padding-inline-end: 18px; position: relative; }
.cg-card summary::-webkit-details-marker { display: none; }
.cg-card summary::after { content: "▸"; position: absolute; right: 0; top: 0; color: #b9b5c9; transition: transform .2s; }
.cg-card[open] summary::after { transform: rotate(90deg); }
.cg-card summary code { padding: 0; background: none; border: none; color: #ffd60a; font-family: var(--mono); font-size: .86rem; font-weight: 700; }
.cg-card summary span { color: #e0deea; font-size: .8rem; line-height: 1.3; }
.cg-case { margin-top: 8px; padding: 7px 9px; border-radius: 8px; background: #12101a; }
.cg-case code { display: block; padding: 0; background: none; border: none; color: #ffe88a; font-family: var(--mono); font-size: .78rem; word-break: break-word; }
.cg-case p { margin: 3px 0 5px !important; color: #d5d2e0; font-size: .78rem; line-height: 1.3; }
.cg-case button { padding: 2px 8px; border: 1px solid rgba(255,214,10,.3); border-radius: 7px; background: rgba(255,214,10,.08); color: #ffe88a; font-family: var(--mono); font-size: .72rem; }
.cg-case button:hover { background: rgba(255,214,10,.22); }

/* Barre du bas : les ventes */
.sale-item .craft-progress { background: var(--success); }


/* ---------- Petit ecran ---------- */
@media (max-width: 899px) {
  body > * { order: 1; }
  #header { order: -6; }
  #rebirth-banner { order: -5; }
  #game-area { display: contents; }
  #ingredients { order: -4; flex: 0 0 26dvh; min-height: 0; margin: 8px 12px 0; }
  #tabs { order: -3; }
  /* Bob parle au-dessus de la liste, il ne cache plus rien */
  #bob-bubble { position: static; order: -2; width: auto; flex-shrink: 0; margin: 12px 12px 0; padding: 10px 12px 8px; }
  #bob-bubble::before { display: none; }
  #bob-bubble p { font-size: .84rem; }
  #main-panel { order: -1; flex: 1 1 0; min-height: 0; margin: 8px 12px; }
  #game-footer { order: 2; font-size: .62rem; padding: 2px 8px; }
  /* Barre du bas : le temps de preparation et les boutons toujours visibles */
  #dock { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 4px; min-height: 76px; padding: 6px 10px 6px 70px; margin-bottom: 4px; }
  #space-bar { width: 100%; }
  .space-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; align-items: center; }
  .space-usage-wrap { min-width: 0; }
  .space-bar-bg { width: 100%; }
  .space-rent { font-size: .7rem; text-align: end; }
  .space-row .btn { grid-column: 1 / -1; padding: 4px 8px; font-size: .74rem; }
  #crafting-bar { width: 100%; min-height: 0; flex-basis: auto; display: flex; gap: 6px; overflow-x: auto; }
  #crafting-bar:empty { display: none; }
  .craft-item { flex: 0 0 auto; min-width: 150px; }
  .oven-count { display: none; }
  #bob { bottom: 26px; }
  #console-btn-wrap { top: 8px; bottom: auto; right: auto; left: 50%; margin-left: -18px; }
  .console-float-btn { width: 36px; height: 36px; border-radius: 10px; }
  #toast-area { bottom: 130px; }
}
@media (max-width: 720px) {
  #console-btn-wrap { top: 44px; left: auto; right: 10px; margin: 0; }
}
.emp-sheet-head h2::before { display: none !important; }

/* ---------- Bêta 1.5 ---------- */

/* Thème Boulangerie : la mie, la croûte et le blé */
:root[data-theme="bakery"] {
  --bg: #F6E7C8; --panel: #FBF1DC; --surface: #FFF8EA; --surface-solid: #FFF8EA; --surface-2: #F1DFBC;
  --text: #43280F; --muted: #7A5A36; --border: #DDBF8C;
  --mauve: #A05A22; --mauve-light: #D9963F; --mauve-dark: #7E4517; --mauve-deep: #7E4517; --mauve-soft: rgba(217,150,63,.22);
  --header-bg: #8A4F1E; --footer-bg: #5C3413; --footer-text: #F6E7C8; --tab-bg: #FBF1DC; --toast-bg: #5C3413;
  --blob-1: rgba(217,150,63,.2); --blob-2: rgba(230,185,74,.16); --blob-3: rgba(160,90,34,.1);
  --craft-bar: #D9963F; --space-bar: #A05A22; --xp-empty: #EAD6AE;
  --chart-1: #A05A22; --chart-2: #D9A93B;
}
:root[data-theme="bakery"] .site-header { background: linear-gradient(90deg, #5C3413, #8A4F1E 55%, #C9822F); }


.tp-bakery { --p-bg: #F6E7C8; --p-head: linear-gradient(90deg, #5C3413, #C9822F); --p-accent: #A05A22; --p-card: #FFF8EA; }

/* Bob en boulanger */
:root[data-theme="bakery"] .bob-acc-bakery { display: inline; }
:root[data-theme="bakery"] .bob-apron-heart { display: none; }
:root[data-theme="bakery"] .bob-apron { fill: #FBF3E3; stroke: #D9C7A8; }
:root[data-theme="bakery"] .bob-apron-pocket { fill: #EFE3CB; stroke: #D9C7A8; }
:root[data-theme="bakery"] .bob-kerchief { fill: #A05A22; stroke: #7E4517; }
:root[data-theme="bakery"] .bob-toque-band { fill: #D9963F; stroke: #A05A22; }

/* Cinq langues : elles passent à la ligne sur petit écran */
.lang-choice { flex-wrap: wrap; max-width: 100%; }

/* ---------- Bêta 1.6 ---------- */

/* Le sucre : pas de bouton ni d'indice. Quand Bob en veut, la carte du sucre se glisse aussi au doigt. */
body.bob-wants-sugar .ing-card[data-ing="sucre"] { touch-action: none; }

/* ---------- Bêta 1.6.1 ---------- */

/* Survol : un élément qui monte ne doit plus clignoter quand la souris est sur son bord.
   Une bande invisible le prolonge vers le bas pendant le survol. */
:where(.btn, .chip, .btn-tiny, .emp-card, .ach-item, .theme-card, .loan-card, .debt-pay-btn, .cg-ex button, .set-tab) { position: relative; }
.btn:hover:not(:disabled)::before, .hbtn:hover::before, .chip:hover::before, .gtab:hover:not(.active)::before, .ing-card:not(.locked):hover::before,
.btn-tiny:hover::before, .emp-card:hover::before, .ach-item.unlocked:hover::before, .console-float-btn:hover::before, .theme-card:hover:not(:disabled)::before,
.loan-card:hover:not(.taken)::before, .debt-pay-btn:hover::before, .cg-ex button:hover::before {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 6px;
}
.set-tab:hover:not(.active)::before { content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: 6px; }
[dir="rtl"] .set-tab:hover:not(.active) { transform: translateX(-2px); }
[dir="rtl"] .set-tab:hover:not(.active)::before { right: auto; left: 100%; }
/* Le reflet des boutons jaunes reste dedans sans couper la bande invisible */
.btn-primary { overflow: visible; }
.btn-primary::after { transform: none; border-radius: inherit; background: linear-gradient(110deg, transparent 42%, rgba(255,255,255,.65) 50%, transparent 58%) no-repeat; background-size: 300% 100%; animation-name: p2ds-shine; }
.btn-primary:hover:not(:disabled)::after { animation-name: p2ds-shine; }
.btn-sell-all::after { animation-name: p2ds-shine; }
@keyframes p2ds-shine { 0%, 60% { background-position: 120% 0; } 100% { background-position: -20% 0; } }

/* Arabe et chinois : des polices qui ont ces lettres */
:root[lang="ar"] { --font: "Outfit", "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", sans-serif; }
:root[lang="zh-Hans"] { --font: "Outfit", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", sans-serif; }

/* Sept langues : leurs boutons passent sous le titre, sur toute la largeur */
.set-row:has(.lang-choice) { flex-wrap: wrap; }
.set-row:has(.lang-choice) .set-ctl { flex: 1 1 100%; max-width: 100%; }
.lang-choice { display: flex; width: 100%; }

/* En arabe, l'en-tête est retourné : sur téléphone, le bouton de la console passe à gauche, sous les icônes */
@media (max-width: 720px) {
  [dir="rtl"] #console-btn-wrap { right: auto; left: 10px; }
}

/* ---------- Bêta 1.7 ---------- */

/* Tableau de bord des employés */
.emp-dash { margin: 10px 0 14px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); }
.emp-dash h4 { margin: 0 0 8px; }
.emp-dash h5 { margin: 12px 0 6px; font-size: .85rem; color: var(--muted); }
.dash-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-tile { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: .82rem; }
.dash-tile .emp-face { width: 26px; height: 26px; }
.dash-tile b { font-size: 1.05rem; }
.dash-total { background: var(--mauve); color: #fff; }
.dash-states { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .8rem; font-weight: 700; }
.dash-coll { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-coll-item { padding: 4px 9px; border-radius: 99px; background: var(--surface-2); font-size: .8rem; }
.dash-coll-item small { color: var(--muted); }

/* Les employés rangés par métier */
.emp-group { margin-top: 12px; border-radius: 12px; transition: opacity .2s, box-shadow .2s; }
.emp-group-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 10px; background: var(--surface-2); cursor: grab; touch-action: none; user-select: none; }
.emp-group-head .emp-face { width: 26px; height: 26px; }
.emp-group-head b { flex: 1; }
.emp-group-handle { color: var(--muted); font-size: 1.1rem; }
.emp-group-count { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--mauve); color: #fff; font-size: .75rem; font-weight: 800; text-align: center; }
.emp-group .emp-list { margin-top: 6px; }
.emp-group.dragging { opacity: .5; }
.emp-group.drop-before { box-shadow: 0 -3px 0 var(--mauve); }

/* Recette trop préparée */
.rec-tired { display: block; color: var(--warn, #E08A00); font-size: .76rem; font-weight: 700; }

/* Ce que le transporteur a sur la route */
.carry-road { margin: 4px 0 0; padding-inline-start: 18px; font-size: .82rem; }

/* ---------- Bêta 1.8 ---------- */

/* Thème Horreur : noir et orange, seulement en octobre */
:root[data-theme="horror"] {
  color-scheme: dark;
  --bg: #120B08; --panel: #1E1410; --surface: #1A110D; --surface-solid: #241812; --surface-2: #33221A;
  --text: #FFEBD6; --muted: #D9B79A; --border: #4A2F20;
  --mauve: #C2410C; --mauve-light: #FF8C1A; --mauve-dark: #9A3412; --mauve-deep: #FFB070; --mauve-soft: rgba(232,101,10,.22);
  --header-bg: #0D0806; --footer-bg: #0A0604; --footer-text: #D9B79A; --tab-bg: #1E1410; --toast-bg: #33221A;
  --blob-1: rgba(232,101,10,.18); --blob-2: rgba(120,40,10,.16); --blob-3: rgba(255,140,26,.08);
  --success: #8BD17C; --error: #FF8A80; --warn: #FFB74D; --craft-bar: #FF8C1A; --space-bar: #C2410C; --xp-empty: #33221A;
  --shadow: 0 2px 14px rgba(0,0,0,.55); --btn-shadow: rgba(0,0,0,.45);
  --chart-1: #FF8C1A; --chart-2: #E8E0D4;
}
:root[data-theme="horror"] .site-header { background: linear-gradient(90deg, #0A0604, #2B1208 50%, #C2410C); }
.tp-horror { --p-bg: #1E1410; --p-head: linear-gradient(90deg, #0A0604, #C2410C); --p-accent: #FF8C1A; --p-card: #33221A; }
:root[data-theme="horror"] .bob-acc-horror { display: inline; }
:root[data-theme="horror"] .bob-apron-heart { display: none; }
:root[data-theme="horror"] .bob-apron { fill: #2B2B30; stroke: #E8650A; }
:root[data-theme="horror"] .bob-apron-pocket { fill: #3A3A42; stroke: #E8650A; }
:root[data-theme="horror"] .bob-kerchief { fill: #E8650A; stroke: #9A3412; }
:root[data-theme="horror"] .bob-toque-band { fill: #1A0F0A; stroke: #E8650A; }

/* Pannes */
.broke-tag { display: inline-block; margin: 4px 0; padding: 2px 8px; border-radius: 99px; background: var(--error); color: #2B0A0A; font-size: .74rem; font-weight: 800; }
.mach-card.broken { border-color: var(--error); }
.mach-card.broken .mach-icon { filter: grayscale(1); opacity: .6; }

/* Recette oubliée : elle se vend plus cher */
.rec-rested { display: block; color: var(--success); font-size: .76rem; font-weight: 700; }

/* Sauvegarde dans un fichier */
.file-pick { position: relative; overflow: hidden; cursor: pointer; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Le tableau de bord contient la recherche d'employés */
.emp-dash .recruit-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.emp-dash .emp-total-salary { margin-top: 10px; }

/* ---------- Bêta 1.8.1 ---------- */
/* Japonais et coréen : des polices qui ont ces lettres */
:root[lang="ja"] { --font: "Outfit", "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif; }
:root[lang="ko"] { --font: "Outfit", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }

/* ---------- Bêta 1.9 ---------- */

/* Le temps de préparation et de vente, à côté de la barre : toujours visible, même sur téléphone */
.craft-left { flex-shrink: 0; min-width: 2.4em; font-size: .72rem; font-weight: 800; color: var(--text); text-align: end; font-variant-numeric: tabular-nums; }

/* Tableau de bord : le texte prend la couleur, sans surlignage */
.dash-good { color: var(--success); }
.dash-warn { color: var(--warn); }
.dash-bad { color: var(--error); }

/* Le changelog, en cliquant sur la version */
/* Le badge de version reste comme avant : seulement cliquable */
button.version-badge { cursor: pointer; appearance: none; -webkit-appearance: none; margin: 0; background: transparent; font-family: inherit; line-height: inherit; letter-spacing: inherit; color: #fff; }
.modal-changelog { max-width: 640px; }
.changelog { max-height: 62vh; overflow-y: auto; padding-inline-end: 6px; font-size: .9rem; line-height: 1.45; }
.changelog h3 { margin: 16px 0 6px; font-size: 1rem; color: var(--mauve-deep); }
.changelog h3:first-child { margin-top: 0; }
.changelog ul { margin: 4px 0 8px; padding-inline-start: 20px; }
.changelog p { margin: 4px 0; }

body.bob-can-wasabi .ing-card[data-ing="wasabi"], body.bob-can-gold .ing-card[data-ing="orfeuille"], body.bob-can-milk .ing-card[data-ing="lait"] { touch-action: none; }

/* Sur téléphone : annonces plus petites, et la console passe dans les réglages */
.only-phone { display: none; }
@media (max-width: 899px) {
  .debt-warning, .event-banner { padding: 3px 10px; font-size: .68rem; line-height: 1.25; }
  .hdr-alerts { max-height: 3.4em; overflow: hidden; }
  #console-btn-wrap { display: none !important; }
  .only-phone { display: block; }
}

/* ---------- Release 1.0 ---------- */

/* Bob en or : seulement ce qui est mauve devient doré, petit à petit */
#bob[data-gold="1"] .rim-a { stop-color: #D0B7EE; } #bob[data-gold="1"] .rim-b { stop-color: #AF7FD8; } #bob[data-gold="1"] .rim-c { stop-color: #8153B0; }
#bob[data-gold="1"] .bob-ear { fill: #8456B3; stroke: #D0B4E8; }
#bob[data-gold="2"] .rim-a { stop-color: #DCC5DC; } #bob[data-gold="2"] .rim-b { stop-color: #C392B1; } #bob[data-gold="2"] .rim-c { stop-color: #936188; }
#bob[data-gold="2"] .bob-ear { fill: #99678D; stroke: #DCC0D0; }
#bob[data-gold="3"] .rim-a { stop-color: #E7D4CB; } #bob[data-gold="3"] .rim-b { stop-color: #D7A48A; } #bob[data-gold="3"] .rim-c { stop-color: #A56E5F; }
#bob[data-gold="3"] .bob-ear { fill: #AF7866; stroke: #E7CBB9; }
#bob[data-gold="4"] .rim-a { stop-color: #F3E2B9; } #bob[data-gold="4"] .rim-b { stop-color: #EBB763; } #bob[data-gold="4"] .rim-c { stop-color: #B77C37; }
#bob[data-gold="4"] .bob-ear { fill: #C48940; stroke: #F3D7A1; }
#bob[data-gold="5"] .rim-a { stop-color: #FFF1A8; } #bob[data-gold="5"] .rim-b { stop-color: #FFC93C; } #bob[data-gold="5"] .rim-c { stop-color: #C98A0E; }
#bob[data-gold="5"] .bob-ear { fill: #D99A1A; stroke: #FFE38A; }
#bob[data-gold="5"] .bob-tip { fill: #FFF1A8; }

/* Bob et le wasabi : joues rouges, sueur, puis yeux en croix, bouche ouverte et larmes */
.bob-eye-x { display: none; fill: none; stroke: var(--eye); stroke-width: 4.5; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--eye)); }
#bob[data-choke="1"] .bob-cheek, #bob[data-choke="2"] .bob-cheek, #bob[data-choke="3"] .bob-cheek { opacity: 1; fill: #ff4d4d; }
#bob[data-choke="1"] .bob-sweat, #bob[data-choke="2"] .bob-sweat, #bob[data-choke="3"] .bob-sweat { opacity: 1; animation: bob-sweat .7s ease-in infinite; }
#bob[data-choke="1"] svg { animation: bob-cough .5s ease-in-out 2; }
#bob[data-choke="2"] .bob-eye-open, #bob[data-choke="3"] .bob-eye-open, #bob[data-choke="2"] .bob-eye-joy, #bob[data-choke="3"] .bob-eye-joy { display: none !important; }
#bob[data-choke="2"] .bob-eye-x, #bob[data-choke="3"] .bob-eye-x { display: inline; }
#bob[data-choke="2"] .m, #bob[data-choke="3"] .m { display: none !important; }
#bob[data-choke="2"] .m-cough, #bob[data-choke="3"] .m-cough { display: inline !important; }
#bob[data-choke="2"] .bob-tear, #bob[data-choke="3"] .bob-tear { opacity: 1; animation: bob-tear 1.6s ease-in infinite; }
#bob[data-choke="2"] svg { animation: bob-cough .45s ease-in-out infinite; }
#bob[data-choke="3"] svg { animation: bob-cough .28s ease-in-out infinite; }
#bob[data-choke="3"] .bob-visor { fill: #0f2a12; }
@keyframes bob-cough { 0%, 100% { transform: none; } 30% { transform: translateX(-2px) rotate(-3deg); } 60% { transform: translateX(2px) rotate(3deg) scale(1.03); } }
/* Le sucre l'apaise : un petit soupir doux, rien à voir avec la toux */
#bob.soothe svg { animation: bob-soothe 1.5s ease-in-out !important; }
@keyframes bob-soothe { 0% { transform: none; } 35% { transform: translateY(-6px) scale(1.04); filter: drop-shadow(0 0 10px #ffd6e8); } 70% { transform: translateY(1px) scale(.99); } 100% { transform: none; } }

/* L'éternuement : du wasabi plein l'écran, qui s'efface tout seul */
#wasabi-splash { position: fixed; inset: 0; z-index: 2500; pointer-events: none; transition: opacity 1.4s ease; }
#wasabi-splash.fade { opacity: 0; }
#wasabi-splash i { position: absolute; width: var(--s); height: calc(var(--s) * .8); transform: rotate(var(--rot)) scale(0);
  background: radial-gradient(circle at 35% 35%, #c7f08a, #7fbf3a 45%, #4f8f22 75%, transparent 76%);
  border-radius: 48% 52% 60% 40% / 55% 45% 55% 45%; animation: wasabi-pop .35s cubic-bezier(.34,1.56,.64,1) var(--d) forwards; opacity: .92; }
@keyframes wasabi-pop { to { transform: rotate(var(--rot)) scale(1); } }

/* Désactiver la console */
.console-off { margin-inline-start: auto; margin-inline-end: 8px; }

/* Candidatures : on peut cliquer, et les rares brillent */
.applicant-card { cursor: pointer; }
.applicant-card.rare { box-shadow: 0 0 0 2px #FFD54F, 0 0 14px rgba(255,213,79,.45); }

/* Thème Cookie */
:root[data-theme="cookie"] {
  --bg: #F3E3CC; --panel: #FBF2E4; --surface: #FFF9F0; --surface-solid: #FFF9F0; --surface-2: #F0DEC2;
  --text: #3B2412; --muted: #7A5A3A; --border: #DDBE92;
  --mauve: #8B5A2B; --mauve-light: #B97C35; --mauve-dark: #6B4220; --mauve-deep: #6B4220; --mauve-soft: rgba(185,124,53,.22);
  --header-bg: #6B4220; --footer-bg: #4A2E16; --footer-text: #F3E3CC; --tab-bg: #FBF2E4; --toast-bg: #4A2E16;
  --blob-1: rgba(185,124,53,.2); --blob-2: rgba(74,37,17,.12); --blob-3: rgba(255,255,255,.3);
  --craft-bar: #B97C35; --space-bar: #8B5A2B; --xp-empty: #EAD3B2;
  --chart-1: #8B5A2B; --chart-2: #D9A35B;
}
:root[data-theme="cookie"] .site-header { background: linear-gradient(90deg, #4A2511, #8B5A2B 55%, #D9A35B); }
.tp-cookie { --p-bg: #F3E3CC; --p-head: linear-gradient(90deg, #4A2511, #D9A35B); --p-accent: #8B5A2B; --p-card: #FFF9F0; }

/* Thèmes Tech et Tech doré */
:root[data-theme="tech"], :root[data-theme="techgold"] { color-scheme: dark; --shadow: 0 2px 14px rgba(0,0,0,.55); --btn-shadow: rgba(0,0,0,.45); }
:root[data-theme="tech"] {
  --bg: #070D18; --panel: #0C1626; --surface: #0A1322; --surface-solid: #101D31; --surface-2: #16263F;
  --text: #E3F6FF; --muted: #9FC3D6; --border: #1E3A57;
  --mauve: #0E7490; --mauve-light: #22D3EE; --mauve-dark: #155E75; --mauve-deep: #67E8F9; --mauve-soft: rgba(34,211,238,.18);
  --header-bg: #050A14; --footer-bg: #04080F; --footer-text: #9FC3D6; --tab-bg: #0C1626; --toast-bg: #16263F;
  --blob-1: rgba(34,211,238,.14); --blob-2: rgba(167,139,250,.12); --blob-3: rgba(34,211,238,.06);
  --success: #5EEAD4; --error: #FB7185; --warn: #FBBF24; --craft-bar: #22D3EE; --space-bar: #A78BFA; --xp-empty: #16263F;
  --chart-1: #22D3EE; --chart-2: #A78BFA; --acc-line: #22D3EE; --acc-chip: #0F1B2E;
}
:root[data-theme="techgold"] {
  --bg: #0E0B05; --panel: #17130A; --surface: #13100A; --surface-solid: #1E1A0D; --surface-2: #2A2410;
  --text: #FFF6D6; --muted: #D9C68A; --border: #4A3D16;
  --mauve: #A16207; --mauve-light: #FACC15; --mauve-dark: #854D0E; --mauve-deep: #FDE68A; --mauve-soft: rgba(250,204,21,.18);
  --header-bg: #0A0803; --footer-bg: #070502; --footer-text: #D9C68A; --tab-bg: #17130A; --toast-bg: #2A2410;
  --blob-1: rgba(250,204,21,.14); --blob-2: rgba(245,158,11,.12); --blob-3: rgba(250,204,21,.06);
  --success: #A3E635; --error: #FB7185; --warn: #FBBF24; --craft-bar: #FACC15; --space-bar: #F59E0B; --xp-empty: #2A2410;
  --chart-1: #FACC15; --chart-2: #F59E0B; --acc-line: #FACC15; --acc-chip: #1F1A0B;
}
:root[data-theme="tech"] .site-header { background: linear-gradient(90deg, #050A14, #0B2A3F 55%, #0E7490); }
:root[data-theme="techgold"] .site-header { background: linear-gradient(90deg, #0A0803, #3D2E07 55%, #A16207); }
:root[data-theme="tech"] .rec-xp, :root[data-theme="techgold"] .rec-xp { color: #AED581; }
:root[data-theme="tech"] .rec-time, :root[data-theme="techgold"] .rec-time { color: #64B5F6; }
:root[data-theme="tech"] .rec-space, :root[data-theme="techgold"] .rec-space { color: #CE93D8; }
.tp-tech { --p-bg: #0C1626; --p-head: linear-gradient(90deg, #050A14, #0E7490); --p-accent: #22D3EE; --p-card: #16263F; }
.tp-techgold { --p-bg: #17130A; --p-head: linear-gradient(90deg, #0A0803, #A16207); --p-accent: #FACC15; --p-card: #2A2410; }

/* Bob dans ces thèmes */
:root[data-theme="cookie"] .bob-acc-cookie, :root[data-theme="tech"] .bob-acc-tech, :root[data-theme="techgold"] .bob-acc-techgold { display: inline; }
:root[data-theme="cookie"] .bob-apron-heart, :root[data-theme="tech"] .bob-apron-heart, :root[data-theme="techgold"] .bob-apron-heart { display: none; }
:root[data-theme="cookie"] .bob-apron { fill: #FFF9F0; stroke: #D9A35B; }
:root[data-theme="cookie"] .bob-apron-pocket { fill: #F0DEC2; stroke: #D9A35B; }
:root[data-theme="cookie"] .bob-kerchief { fill: #8B5A2B; stroke: #6B4220; }
:root[data-theme="cookie"] .bob-toque-band { fill: #D9A35B; stroke: #8B5A2B; }
:root[data-theme="tech"] .bob-apron { fill: #16263F; stroke: #22D3EE; }
:root[data-theme="tech"] .bob-apron-pocket { fill: #1E3A57; stroke: #22D3EE; }
:root[data-theme="tech"] .bob-kerchief { fill: #22D3EE; stroke: #0E7490; }
:root[data-theme="tech"] .bob-toque-band { fill: #0E7490; stroke: #22D3EE; }
:root[data-theme="techgold"] .bob-apron { fill: #2A2410; stroke: #FACC15; }
:root[data-theme="techgold"] .bob-apron-pocket { fill: #3A3214; stroke: #FACC15; }
:root[data-theme="techgold"] .bob-kerchief { fill: #FACC15; stroke: #A16207; }
:root[data-theme="techgold"] .bob-toque-band { fill: #A16207; stroke: #FACC15; }

/* ---------- Version 1.1 ---------- */

/* Une préparation gelée : plus de place. Un clic permet de la jeter. */
.craft-item { cursor: pointer; }
.craft-item.frozen { border-color: #7FD3FF; }
.craft-item.frozen .craft-progress { filter: grayscale(.4) hue-rotate(160deg) brightness(1.15); animation: none; }
.craft-item.frozen .craft-emoji { animation: none; filter: drop-shadow(0 0 4px #7FD3FF); }
.craft-x { font-size: .72em; font-weight: 700; opacity: .85; }
.move-item { border-color: var(--mauve-light); }
.rec-reason { display: flex; flex-wrap: wrap; gap: 2px 10px; }

/* Sur téléphone, la barre du bas est collée en bas de l'écran, toujours visible */
@media (max-width: 899px) {
  #dock {
    position: fixed !important; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    width: auto; margin: 0; z-index: 900;
  }
  #main-panel { margin-bottom: calc(var(--dock-h, 90px) + 30px); }
  #toast-area { bottom: calc(var(--dock-h, 90px) + 40px); }
}

/* Employés : niveau or, perte, spécialiste, métiers du touche-à-tout */
.emp-skill-badge.gold { background: linear-gradient(135deg, #FFE58A, #E0A800); color: #4A3300; border-color: #B8860B; box-shadow: 0 0 8px rgba(255,200,40,.6); font-weight: 800; }
.applicant-card.gold { box-shadow: 0 0 0 2px #FFD54F, 0 0 18px rgba(255,200,40,.7); background-image: linear-gradient(135deg, rgba(255,229,138,.18), transparent 60%); }
.emp-loss-badge, .emp-spec-badge, .emp-job-chip { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: .68rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.emp-spec-badge { background: var(--mauve-soft); }
.recruit-section .search-go { margin-top: 8px; }
.cfg-sub { margin: 10px 0 4px; font-size: .85rem; color: var(--mauve-deep); }
.cfg-pair { display: inline-flex; align-items: center; gap: 6px; }
.cfg-row input[type="number"] { width: 130px; }
.emp-face { filter: drop-shadow(0 1px 1px rgba(0,0,0,.18)); }

/* Retour en haut des ingrédients, barres de déblocage */
.ing-top { display: block; visibility: hidden; opacity: 0; transition: opacity .2s; position: sticky; bottom: 8px; margin: 10px auto 0; padding: 7px 16px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,.2)); font: inherit; font-weight: 700; cursor: pointer; color: var(--text); z-index: 3; }
#ingredients.at-bottom .ing-top { visibility: visible; opacity: 1; }
.unlock-item .craft-progress { background: linear-gradient(90deg, #7E57C2, #B39DDB); }

/* Les réglages et la console : une entrée et une sortie bien à eux */
.modal.modal-settings { animation: set-in .46s var(--spring) both; transform-origin: 50% 40%; }
.modal-overlay.closing .modal.modal-settings { animation: set-out .2s ease forwards; }
@keyframes set-in { 0% { opacity: 0; transform: translateY(24px) scale(.92) rotateX(8deg); filter: blur(6px); } 60% { filter: blur(0); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes set-out { to { opacity: 0; transform: translateY(18px) scale(.94); filter: blur(4px); } }
.modal.modal-console { animation: console-in .42s cubic-bezier(.2,.9,.25,1) both; transform-origin: 50% 0; }
.modal-overlay.closing .modal.modal-console { animation: console-out .2s ease-in forwards; }
@keyframes console-in { 0% { opacity: 0; transform: translateY(-42px) scaleY(.6); clip-path: inset(0 0 100% 0); } 55% { opacity: 1; clip-path: inset(0 0 0 0); } 100% { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
@keyframes console-out { to { opacity: 0; transform: translateY(-36px) scaleY(.5); } }
@media (prefers-reduced-motion: reduce) { .modal.modal-settings, .modal.modal-console, .modal-overlay.closing .modal { animation-duration: .01s; } }

/* Pause douce (/pause) */
#soft-pause { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1900; padding: 6px 16px; border-radius: 99px; border: 2px solid var(--mauve); background: var(--surface-solid); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 6px 22px rgba(0,0,0,.3); animation: soft-pulse 2s ease-in-out infinite; }
@keyframes soft-pulse { 50% { box-shadow: 0 6px 22px rgba(0,0,0,.3), 0 0 0 6px rgba(150,110,220,.22); } }
body.soft-paused #main-panel, body.soft-paused #dock { filter: saturate(.55); }

.save-area { width: 100%; margin: 6px 0 8px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: .75rem/1.3 ui-monospace, Consolas, monospace; resize: vertical; }

/* Une mise à jour est disponible */
.version-badge.has-update { background: #2E7D32; color: #fff; animation: soft-pulse 2s ease-in-out infinite; }
.version-badge.has-update::after { content: ' ↑'; }
.update-box { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; border: 2px solid #2E7D32; background: rgba(46,125,50,.1); }
.update-box p { margin: 4px 0 10px; font-size: .9rem; }

/* Onglets déplaçables (niveau 450) */
#tabs.tabs-custom .gtab { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
#tabs.tabs-custom .gtab.dragging { cursor: grabbing; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.28); transform: scale(1.06); }

/* Barre du bas sur téléphone : on peut la faire défiler pour voir toutes les jauges, et elle ne cache plus rien */
@media (max-width: 899px) {
  #crafting-bar { justify-content: flex-start !important; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x; scroll-snap-type: x proximity; scrollbar-width: thin; padding-bottom: 3px; }
  #crafting-bar .craft-item { scroll-snap-align: start; }
}

/* ---------- Page d'accueil ---------- */
.home { position: fixed; inset: 0; z-index: 1500; display: none; flex-direction: column; background: var(--bg, #FFF6EC); overflow-y: auto; padding: 12px 16px 70px; }
.home::before { content: ''; position: fixed; inset: 0; background: radial-gradient(circle at 30% 10%, rgba(212,149,107,.25), transparent 55%), radial-gradient(circle at 80% 80%, rgba(180,140,220,.18), transparent 50%); pointer-events: none; z-index: -1; }
body.home-open > #header, body.home-open > #tabs, body.home-open > #game-area, body.home-open > #dock, body.home-open > #game-footer { visibility: hidden; }
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.home-profiles { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; max-width: 460px; }
.hp-track { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 4px 2px; flex: 1; min-width: 0; }
.hp-track::-webkit-scrollbar { display: none; }
.hp-arrow { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.1rem; cursor: pointer; flex: none; }
.hp-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; scroll-snap-align: start; padding: 6px 12px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.hp-pill.active { background: var(--mauve, #D4956B); border-color: var(--mauve, #D4956B); color: #fff; }
.hp-pill .uii { font-size: 1rem; }
.home-top-right { display: flex; gap: 8px; align-items: center; flex: none; }
.home-center { width: min(720px, 100%); margin: 2vh auto 0; display: flex; flex-direction: column; align-items: center; }
.home-logo { filter: drop-shadow(0 6px 14px rgba(0,0,0,.2)); animation: tx-rise .6s var(--ease, ease) both; }
.home-name { font-size: 2.6rem; margin: 6px 0 0; letter-spacing: .04em; }
.home-sub { margin: 2px 0 14px; opacity: .75; text-align: center; }
.home-tabs { display: flex; gap: 6px; margin-bottom: 12px; padding: 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
.home-tabs button { padding: 7px 20px; border: none; border-radius: 99px; background: none; color: var(--text); font: inherit; font-weight: 800; cursor: pointer; }
.home-tabs button.active { background: var(--mauve, #D4956B); color: #fff; }
.home-panel { width: 100%; }
.home-count { text-align: center; font-weight: 800; margin: 0 0 8px; }
.home-empty, .home-info { text-align: center; opacity: .8; font-size: .9rem; }
.home-limit { text-align: center; color: #C62828; font-weight: 800; margin: 8px 0; }
.home-note { min-height: 1.2em; font-size: .85rem; text-align: center; }
.home-note.ok { color: #2E7D32; } .home-note.warn { color: #C77700; }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.inst-card { padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.inst-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.inst-type { font-size: .68rem; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: var(--mauve-soft, #EFE3FA); }
.inst-meta { font-size: .8rem; opacity: .75; margin: 2px 0 8px; }
.inst-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.home-new { margin-top: 14px; padding: 12px; border-radius: 16px; border: 1px dashed var(--border); background: var(--surface); }
.home-new h3 { margin: 0 0 8px; font-size: .95rem; }
.home-new-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.home-new-row input { flex: 1; min-width: 140px; }
.home-new .btn:disabled, .home-new .file-pick.disabled { opacity: .45; pointer-events: none; }
.home-bottom { position: fixed; left: 14px; bottom: 12px; display: flex; align-items: center; gap: 8px; z-index: 1501; }
.home-bottom-text { font-size: .8rem; opacity: .7; }
.acc-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0; }
.install-btn { background: var(--mauve-soft, #EFE3FA); }
.in-app .install-btn { display: none !important; }

.home .hbtn { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.home .hbtn .uii { color: var(--text); }
.home .version-badge { background: var(--mauve, #D4956B); color: #fff; border: none; }
.home { padding-bottom: 90px; }

/* Les pastilles des onglets sont jaunes ; seules les pannes sont en rouge */
.applicant-badge.red { background: #C62828; color: #fff; }

/* ---------- Accueil : version simplifiee ---------- */
.home { align-items: stretch; }
.home-top { justify-content: space-between; }
.home-profile { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 14px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.inst-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.inst-slot { min-height: 150px; padding: 14px 10px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.inst-slot.empty { border: 2px dashed var(--border); background: transparent; box-shadow: none; color: var(--mauve-deep, #8E6A3E); font: inherit; cursor: pointer; }
.inst-slot.empty span { font-size: 2.6rem; font-weight: 300; line-height: 1; }
.inst-slot.empty:hover { background: var(--surface); border-color: var(--mauve, #D4956B); }
.inst-name { font-size: 1.05rem; max-width: 100%; overflow-wrap: anywhere; }
.inst-slot .inst-meta { margin: 0; }
.inst-slot .inst-actions { justify-content: center; }
.inst-type.none { visibility: hidden; }
.btn.icon-only { padding: 5px 8px; display: inline-flex; align-items: center; justify-content: center; }
.btn.icon-only .uii { font-size: 1rem; }
.home-footer { margin-top: auto; padding: 18px 0 4px; text-align: center; font-size: .78rem; opacity: .65; letter-spacing: .04em; }
.home-bottom { display: none; }
.acc-list { display: grid; gap: 6px; margin-bottom: 10px; }
.acc-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px; }
.acc-row span { flex: 1; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.acc-row.current { border-color: var(--mauve, #D4956B); }
.acc-modes { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.acc-modes button { flex: 1; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.acc-modes button.active { background: var(--mauve, #D4956B); border-color: var(--mauve, #D4956B); color: #fff; }
.acc-modes .google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #fff; color: #3c4043; border-color: #dadce0; }
.google-logo { flex: none; }

.home-center { width: min(940px, 100%); }
.home .home-name { color: var(--mauve-deep, #8E5A33); text-shadow: 0 2px 0 rgba(255,255,255,.6); }
@media (max-width: 640px) { .inst-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Accueil : snapshot 3 ---------- */
.inst-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 190px)); justify-content: center; }
.inst-slot:not(.empty) { cursor: pointer; transition: transform .2s var(--spring, ease), box-shadow .2s; }
.inst-slot:not(.empty):hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.home { padding-bottom: 44px; }
.home-footer { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 4px 12px; font-size: .72rem; text-align: center; opacity: 1; letter-spacing: 0; background: var(--footer-bg); color: var(--footer-text); z-index: 1501; }
.home-footer a { color: inherit; }
@media (max-width: 899px) { .home-footer { font-size: .62rem; padding: 2px 8px; } }
.modal.modal-home-settings { width: min(460px, 100%); }
.hs-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hs-head h2 { margin: 0; }
.hs-card { margin-top: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2, rgba(128,128,128,.08)); }
.hs-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .95rem; }
.hs-langs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.hs-lang { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s, border-color .15s; }
.hs-lang:hover { transform: translateY(-1px); border-color: var(--mauve, #D4956B); }
.hs-lang.active { background: var(--mauve, #D4956B); border-color: var(--mauve, #D4956B); color: #fff; }
.hs-flag { font-size: 1.25rem; line-height: 1; }
.hs-themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hs-theme { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 10px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.hs-theme.active { border-color: var(--mauve, #D4956B); box-shadow: 0 0 0 3px rgba(212,149,107,.25); }
.hs-swatch { display: flex; width: 100%; height: 44px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(0,0,0,.15); }
.hs-swatch i { flex: 1; }
.hs-theme.tp-light .hs-swatch i:nth-child(1) { background: #FFF6EC; } .hs-theme.tp-light .hs-swatch i:nth-child(2) { background: #D4956B; } .hs-theme.tp-light .hs-swatch i:nth-child(3) { background: #5D4037; }
.hs-theme.tp-dark .hs-swatch i:nth-child(1) { background: #1E1B26; } .hs-theme.tp-dark .hs-swatch i:nth-child(2) { background: #9B6DFF; } .hs-theme.tp-dark .hs-swatch i:nth-child(3) { background: #F5F3FF; }

/* ---------- Accueil : snapshot 4 ---------- */
.home-center { margin: auto; padding: 4vh 0 3vh; }
.home-logo { margin-bottom: 4px; }
.home-name { margin-bottom: clamp(26px, 6vh, 56px); }
.inst-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; max-width: 912px; }
.inst-slot { flex: 0 0 168px; width: 168px; }
@media (max-width: 640px) { .inst-slot { flex-basis: calc(50% - 6px); width: calc(50% - 6px); } }
.create-wrap { display: flex; justify-content: center; margin: 22px 0 10px; }
.create-big { display: inline-flex; align-items: center; gap: 10px; padding: 18px 42px; border: none; border-radius: 22px; background: linear-gradient(135deg, var(--mauve, #D4956B), #E8A56F); color: #fff; font: inherit; font-size: 1.5rem; font-weight: 900; cursor: pointer; box-shadow: 0 8px 22px rgba(212,149,107,.55); animation: create-bounce 1.6s ease-in-out infinite; }
.create-big:hover { filter: brightness(1.08); }
.create-big:active { transform: scale(.96); animation: none; }
.create-plus { font-size: 2rem; line-height: 1; font-weight: 300; }
@keyframes create-bounce { 0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 8px 22px rgba(212,149,107,.55); } 50% { transform: translateY(-5px) scale(1.05); box-shadow: 0 16px 30px rgba(212,149,107,.45), 0 0 0 8px rgba(212,149,107,.15); } }
@media (prefers-reduced-motion: reduce) { .create-big { animation: none; } }
.hs-themes.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hs-themes .theme-card { padding: 6px; }
.tp-auto { --p-bg: #F5E6D3; background: linear-gradient(110deg, #F5E6D3 0 50%, #2F221B 50% 100%); }
.tp-auto i:nth-child(1) { background: linear-gradient(110deg, #D4956B 0 50%, #3E2723 50% 100%); }
.tp-auto i:nth-child(2) { background: #D4956B; }
.tp-auto i:nth-child(3) { background: linear-gradient(110deg, #FFFFFF 0 50%, #1A1210 50% 100%); }

/* Version 1.2.1 */
.mgr-gap { margin-top: 18px; }
:root[data-theme="dark"] .home .home-name { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.acc-modes button { transition: transform .2s var(--spring, ease), box-shadow .2s, border-color .2s, background .2s, filter .2s; }
.acc-modes button:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.18); }
.acc-modes button:active { transform: translateY(0) scale(.97); }
.acc-modes .google-btn:hover { border-color: #4285F4; box-shadow: 0 6px 16px rgba(66,133,244,.3); }
.acc-modes .google-btn .google-logo { transition: transform .35s var(--spring, ease); }
.acc-modes .google-btn:hover .google-logo { transform: rotate(360deg) scale(1.15); }

/* ---------- Panneau administrateur ---------- */
.adm-home { width: min(1040px, 100%); padding-top: 1vh; }
.home-logo.small { width: 64px; height: 64px; }
.adm-badge { display: inline-block; vertical-align: middle; margin-inline-start: 8px; padding: 3px 12px; border-radius: 99px; background: linear-gradient(135deg, #7E57C2, #B39DDB); color: #fff; font-size: .8rem; letter-spacing: .12em; -webkit-text-fill-color: #fff; text-shadow: none; box-shadow: 0 4px 12px rgba(126,87,194,.45); }
.adm-tabs { display: inline-flex; gap: 6px; margin: 4px 0 18px; padding: 5px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.adm-tabs button { padding: 9px 24px; border: none; border-radius: 99px; background: none; color: var(--text); font: inherit; font-weight: 800; cursor: pointer; transition: background .2s, color .2s, transform .2s var(--spring, ease); }
.adm-tabs button:hover { transform: translateY(-1px); }
.adm-tabs button.active { background: linear-gradient(135deg, #7E57C2, #9B6DFF); color: #fff; box-shadow: 0 6px 16px rgba(126,87,194,.4); }
.adm-box, .adm-db { width: 100%; text-align: start; }
.adm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.adm-stat { position: relative; padding: 16px 14px; border-radius: 18px; background: linear-gradient(145deg, var(--surface), var(--surface-2, var(--surface))); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; gap: 2px; overflow: hidden; }
.adm-stat b { font-size: 2rem; line-height: 1; }
.adm-stat small { opacity: .7; font-weight: 700; }
.adm-stat-ico { position: absolute; top: 10px; inset-inline-end: 12px; font-size: 1.4rem; opacity: .85; }
.adm-stat.playing b { color: #2E9E57; }
.adm-stat.open b { color: #D69A00; }
.adm-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.adm-search { flex: 1; min-width: 180px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; }
.adm-chip { padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; transition: transform .2s var(--spring, ease), background .2s; }
.adm-chip:hover { transform: translateY(-1px); }
.adm-chip.active { background: #7E57C2; border-color: #7E57C2; color: #fff; }
.adm-live { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; color: #2E9E57; }
.adm-live i { width: 9px; height: 9px; border-radius: 50%; background: #2E9E57; animation: adm-pulse 1.6s ease-out infinite; }
@keyframes adm-pulse { 0% { box-shadow: 0 0 0 0 rgba(46,158,87,.6); } 100% { box-shadow: 0 0 0 10px rgba(46,158,87,0); } }
.adm-table { display: grid; gap: 8px; }
.adm-th, .adm-tr { display: grid; grid-template-columns: 2.2fr 1.1fr 1.8fr .9fr .6fr; gap: 10px; align-items: center; padding: 10px 14px; }
.adm-th { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding-top: 0; padding-bottom: 0; }
.adm-tr { text-align: start; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: transform .2s var(--spring, ease), box-shadow .2s, border-color .2s; }
.adm-tr:hover { transform: translateY(-2px); border-color: #9B6DFF; box-shadow: 0 10px 24px rgba(126,87,194,.2); }
.adm-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-who > span { display: grid; min-width: 0; }
.adm-who b, .adm-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-who small, .adm-game small, .adm-muted { opacity: .65; font-size: .78rem; }
.adm-avatar { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #7E57C2, #E8A56F); color: #fff; font-style: normal; font-weight: 900; }
.adm-avatar.big { width: 64px; height: 64px; font-size: 1.7rem; }
.adm-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 99px; font-size: .78rem; font-weight: 800; font-style: normal; background: rgba(128,128,128,.15); }
.adm-pill i { width: 9px; height: 9px; border-radius: 50%; background: #9E9E9E; }
.adm-pill.playing { background: rgba(46,158,87,.16); color: #1F7A42; }
.adm-pill.playing i { background: #2E9E57; animation: adm-pulse 1.4s ease-out infinite; }
.adm-pill.open { background: rgba(214,154,0,.16); color: #A67700; }
.adm-pill.open i { background: #D69A00; }
:root[data-theme="dark"] .adm-pill.playing { color: #6FE3A0; } :root[data-theme="dark"] .adm-pill.open { color: #FFD166; }
.adm-seen, .adm-n { font-weight: 700; }
.adm-note { margin-top: 14px; text-align: center; font-size: .8rem; opacity: .7; }
.adm-back { margin-bottom: 12px; padding: 7px 16px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; }
.adm-card { padding: 14px 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.adm-profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.adm-profile h3 { margin: 0; font-size: 1.3rem; }
.adm-profile p { margin: 2px 0; }
.adm-profile-state { margin-inline-start: auto; display: grid; gap: 4px; justify-items: end; }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.adm-h4 { margin: 18px 0 8px; }
.adm-insts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.adm-inst-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.adm-inst-head small { opacity: .65; }
.adm-inst .save-area { margin: 8px 0 0; }
#adm-modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(8,7,12,.7); backdrop-filter: blur(4px); }
.adm-modal-card { width: min(420px, 92vw); padding: 24px; border-radius: 20px; background: var(--surface-solid, #fff); color: var(--text); border: 2px solid #C62828; box-shadow: 0 24px 60px rgba(0,0,0,.5); animation: tx-pop .3s var(--spring, ease); }
@media (max-width: 760px) {
  .adm-stats { grid-template-columns: repeat(2, 1fr); }
  .adm-th { display: none; }
  .adm-tr { grid-template-columns: 1fr auto; row-gap: 6px; }
  .adm-tr .adm-game, .adm-tr .adm-seen, .adm-tr .adm-n { grid-column: auto; }
}

/* Version 1.2.1.1 */
.adm-badge { display: block; margin: -4px auto 12px; width: max-content; }
.adm-home .home-name { margin-bottom: 6px; }

/* Stats : menus deroulants des ingredients et recettes prepares */
.stat-more > summary { list-style: none; cursor: pointer; }
.stat-more > summary::-webkit-details-marker { display: none; }
.stat-more > summary .set-value::after { content: ' \25BE'; opacity: .6; }
.stat-more[open] > summary .set-value::after { content: ' \25B4'; }
.stat-list { padding: 4px 12px 10px; display: grid; gap: 2px; max-height: 240px; overflow: auto; }
.stat-item { display: flex; justify-content: space-between; gap: 12px; font-size: .9em; padding: 2px 0; border-bottom: 1px dashed rgba(128,128,128,.25); }

/* Pas de wifi : la partie n'est pas sauvegardee */
#offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 9000; padding: 6px 12px; text-align: center; font-size: .85rem; font-weight: 600; background: #b3261e; color: #fff; }

/* Pas de wifi : la partie n'est pas sauvegardee */
#offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 9000; padding: 6px 12px; text-align: center; font-size: .85rem; font-weight: 600; background: #b3261e; color: #fff; }

/* Panneau admin : parties en deux moities, fiche d'une partie, Bob */
.adm-sec { margin: 14px 0 8px; font-size: 1.05rem; text-align: center; }
.adm-split { border: 0; border-top: 2px dashed rgba(128,128,128,.4); margin: 22px auto 6px; width: min(720px, 92%); }
.adm-others-grid { justify-content: center; }
.adm-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; cursor: pointer; }
.adm-slot small { opacity: .7; font-size: .75rem; }
.adm-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.adm-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 12px; }
.adm-overlay-card { background: var(--surface-solid, #fff); color: var(--text, #333); border-radius: 18px; width: min(760px, 100%); max-height: 92vh; overflow-y: auto; padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.adm-game-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.adm-game-head h3 { margin: 0; }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.adm-kpi { display: flex; flex-direction: column; align-items: center; padding: 8px; border-radius: 12px; background: rgba(128,128,128,.12); text-align: center; }
.adm-kpi b { font-size: 1.05rem; word-break: break-word; }
.adm-kpi small { opacity: .7; }
.adm-det { margin: 6px 0; border: 1px solid rgba(128,128,128,.3); border-radius: 10px; padding: 4px 10px; }
.adm-det > summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
#adm-bob-wrap { position: fixed; right: 14px; bottom: 10px; z-index: 2000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
#adm-bob-wrap > * { pointer-events: auto; }
#adm-bob { width: 76px; padding: 0; border: none; background: none; cursor: pointer; }
#adm-bob svg { display: block; width: 100%; overflow: visible; }
#adm-bob * { transform-box: view-box; }
.adm-bob-emoji { font-size: 3rem; }
#adm-bob-bubble { position: relative; max-width: min(320px, 80vw); padding: 12px 14px 10px; background: var(--surface-solid, #fff); color: var(--text, #333); border: 2px solid var(--mauve, #9b6dff); border-radius: 16px; box-shadow: 0 6px 22px rgba(0,0,0,.22); }
#adm-bob-bubble p { font-weight: 600; font-size: .9rem; line-height: 1.35; margin: 0; }

/* Panneau admin : grilles de 5 par ligne, centrees ; barre de la partie */
.adm-home .inst-grid, .adm-others .inst-grid { margin: 0 auto; justify-content: center; }
.adm-home { align-items: center; }
.adm-others { width: 100%; }
.adm-overlay { z-index: 4000; }
#adm-modal { z-index: 5000; }
.adm-game-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid rgba(128,128,128,.3); position: sticky; top: -18px; background: var(--surface-solid, #fff); z-index: 2; padding-top: 6px; }
.adm-game-title { display: flex; flex-direction: column; min-width: 0; }
.adm-game-title b { font-size: 1.15rem; }
.adm-game-title small { opacity: .7; }
.adm-game-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adm-bak-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.adm-bak-bar select { flex: 1; min-width: 0; padding: 8px; border-radius: 10px; font: inherit; }
.adm-broken { color: #c62828; font-style: normal; font-size: .8em; font-weight: 700; }

/* Page des succes : recherche, filtres, barre de la categorie */
.ach-tools { align-items: center; }
.ach-search { flex: 1 1 160px; min-width: 0; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.ach-cat-bar { margin: 6px 0 10px; }
.ach-grid .home-empty { grid-column: 1 / -1; text-align: center; opacity: .7; }

/* 1.3 : Bob un peu plus haut, au-dessus du pied de page ; badge administrateur */
#adm-bob-wrap { bottom: 40px; }
.adm-admin-tag { font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; background: #ffd60a; color: #3a2a00; vertical-align: middle; margin-left: 4px; }

/* 1.3 Snapshot 1 : titres du changelog lisibles en theme sombre, lien vers l'ancienne version, sauvegarde auto */
:root[data-theme="dark"] .changelog h3 { color: #fff; }
.changelog h3 .ver-link { font-size: .72rem; font-weight: 600; margin-inline-start: 8px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; text-decoration: none; opacity: .85; white-space: nowrap; }
.changelog h3 .ver-link:hover { opacity: 1; }
.set-select { padding: 6px 8px; border-radius: 10px; font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
