/* Le Grenier — feuille de style v2 : le grenier de tante Odette à la lumière du soir.
   Noyer, papier jauni, laiton, ruban adhésif, photos instantanées ; le gros contour sépia des illustrations est
   repris partout pour que l'interface ait l'air dessinée dans le même style. Choix détaillés dans DESIGN.md. */
:root {
  --walnut: #3a2418; --walnut2: #5a3a26; --walnut3: #6e4a30;
  --paper: #f3e4c4; --paper2: #e6d0a6; --note: #fbf3e2; --tape: rgba(236, 222, 176, .82);
  --ink: #2e1d12; --ink2: #6b4a33; --muted: #8c7259; --line: #d4bc93;
  --brass: #e0a83a; --brass-hi: #ffe39a; --brass-lo: #a8721c;
  --green: #3d7a52; --green-lo: #2a5a3b; --green-hi: #62a876;
  --wine: #9b2c3a; --teal: #2f6f8f;
  --r0: #8d8f8a; --r1: #3d7a52; --r2: #2f6f8f; --r3: #8a4fc0; --r4: #d99a1e; --r5: #d6407a;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --marker: "Permanent Marker", "Comic Sans MS", cursive;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .36  0 0 0 0 .23  0 0 0 0 .1  0 0 0 .11 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --wood: repeating-linear-gradient(90deg, rgba(0, 0, 0, .09) 0 2px, transparent 2px 11px, rgba(255, 220, 170, .05) 11px 13px, transparent 13px 23px);
  --pop: 0 3px 0 var(--ink);
  font-family: var(--body); font-size: 17px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--walnut); }
body { -webkit-font-smoothing: antialiased; }
img { user-select: none; -webkit-user-drag: none; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.ok { color: var(--green); } .warn { color: var(--wine); }
.ic { width: 22px; height: 22px; vertical-align: -5px; }
/* Fraunces en version douce et un peu bancale : l'étiquette peinte à la main */
h2, h3, .money b, .bill-amount, .big-earn, .logo, .go b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; }

/* ----- Boutons : des autocollants épais ----- */
.btn { font-weight: 800; font-size: 1rem; color: var(--ink); background: linear-gradient(180deg, #fffaf0, #f1dfba); border: 2.5px solid var(--ink); border-radius: 12px; padding: 7px 16px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .85), var(--pop); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .07s, box-shadow .07s, filter .12s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .85), 0 4px 0 var(--ink); filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .85), 0 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.red { background: linear-gradient(180deg, var(--green-hi), var(--green) 55%, var(--green-lo)); color: #fff; text-shadow: 0 1.5px 0 var(--green-lo); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), var(--pop); }
.btn.gold { background: linear-gradient(180deg, var(--brass-hi), var(--brass) 60%); }
.btn.danger { color: var(--wine); }
.btn.big { font-size: 1.2rem; padding: 10px 24px; border-radius: 14px; }
.btn.small { font-size: .88rem; padding: 4px 10px; border-radius: 9px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), 0 2px 0 var(--ink); }
.btn.wide { width: 100%; }
/* une note scotchée */
.card { position: relative; background: var(--note) var(--grain); border: 2.5px solid var(--ink); border-radius: 6px; padding: 16px 16px 14px; box-shadow: 0 4px 0 rgba(46, 29, 18, .35), 0 10px 18px rgba(20, 10, 4, .25); }
.card::before { content: ''; position: absolute; top: -11px; left: 50%; width: 86px; height: 22px; margin-left: -43px; background: var(--tape); transform: rotate(-2deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); pointer-events: none; }

/* ----- Le carnet (hub) ----- */
#hub { position: fixed; inset: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: 72px minmax(0, 1fr) 150px;
  grid-template-areas: "top top" "side carnet" "bottom bottom";
  background: radial-gradient(ellipse at 60% 40%, rgba(255, 190, 110, .18), transparent 60%), var(--wood), linear-gradient(180deg, var(--walnut2), var(--walnut)); }
/* la poutre du haut */
#hub-top { grid-area: top; display: flex; align-items: center; gap: 18px; padding: 0 18px; background: var(--wood), linear-gradient(180deg, var(--walnut3), var(--walnut2) 60%, var(--walnut));
  border-bottom: 3px solid var(--ink); box-shadow: 0 6px 14px rgba(0, 0, 0, .35); position: relative; z-index: 3; color: var(--paper); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.9rem; letter-spacing: .01em; white-space: nowrap; color: var(--brass-hi);
  text-shadow: 0 2px 0 var(--ink), 0 0 18px rgba(255, 190, 90, .35); }
.logo img { width: 46px; height: 46px; transform: rotate(-8deg); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
/* l'argent : une plaque de laiton */
.money { display: flex; align-items: center; gap: 8px; background: linear-gradient(180deg, var(--brass-hi), var(--brass) 55%, var(--brass-lo)); border: 2.5px solid var(--ink); border-radius: 999px; padding: 2px 18px 2px 3px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 3px 0 var(--ink); color: var(--ink); }
.money img { width: 38px; height: 38px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }
.money b { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums lining-nums; min-width: 96px; line-height: 1.1; }
.money.tokens { padding-right: 14px; background: linear-gradient(180deg, #fff1c7, #e9c66a 60%, #b98a2a); }
.money.tokens b { min-width: 28px; }
.when { flex: 1; font-weight: 700; color: var(--paper2); }
.tools { display: flex; gap: 8px; }
.tool { position: relative; width: 46px; height: 46px; border-radius: 12px; border: 2.5px solid var(--ink); background: linear-gradient(180deg, #fffaf0, #ecd6aa); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), var(--pop);
  cursor: pointer; padding: 3px; display: flex; align-items: center; justify-content: center; gap: 2px; font-family: var(--display); font-weight: 900; color: var(--ink); transition: transform .07s; }
.tool img { width: 32px; height: 32px; }
.tool:hover { transform: translateY(-1px) rotate(-3deg); }
.tool.off img { filter: grayscale(1); opacity: .45; }
#btn-rep, .tool.wide { width: auto; padding: 3px 11px 3px 4px; font-size: 1.05rem; }
.tool.lang { font-size: 1rem; }
.tool.help { font-size: 1.6rem; color: var(--wine); }

#hub-side { grid-area: side; padding: 26px 18px 18px; display: flex; flex-direction: column; gap: 26px; overflow-y: auto; }
#hub-side .card:nth-child(1) { transform: rotate(-.6deg); }
#hub-side .card:nth-child(2) { transform: rotate(.5deg); }
#hub-side .card:nth-child(3) { transform: rotate(-.3deg); }
/* la facture */
.bill { border-top-width: 8px; border-top-color: var(--wine); }
.bill-top { display: flex; align-items: center; gap: 10px; }
.portrait { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--ink); object-fit: cover; background: var(--brass); flex: none; }
.portrait.big { width: 116px; height: 116px; display: block; margin: 0 auto 6px; box-shadow: 0 4px 0 var(--ink); }
.bill-top small { display: block; color: var(--muted); font-weight: 700; font-size: .85rem; }
.bill-top b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 1.25rem; line-height: 1.1; display: block; }
.bill-amount { font-size: 2.8rem; font-weight: 900; color: var(--wine); margin: 8px 0 0; font-variant-numeric: tabular-nums lining-nums; line-height: 1; }
.bill-carry { color: var(--wine); font-size: .88rem; font-weight: 800; }
.bill-bar { height: 12px; border-radius: 7px; background: var(--paper2); border: 2px solid var(--ink); overflow: hidden; margin: 10px 0 8px; }
.bill-bar i { display: block; height: 100%; background: linear-gradient(180deg, var(--green-hi), var(--green)); }
.bill-due { font-weight: 800; color: var(--ink2); margin-bottom: 10px; }
.bill-due.warn { color: var(--wine); animation: blink 1s ease-in-out infinite; }
.bill p { margin: 8px 0 0; }
.stamps { display: flex; gap: 3px; margin-top: 12px; justify-content: space-between; }
.st { width: 27px; height: 27px; flex: none; border-radius: 50%; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: .9rem; color: var(--muted); }
.st.paid { border: 2px solid var(--green); background: var(--green); color: #fff; transform: rotate(-10deg); }
.st.cur { border: 2.5px solid var(--wine); color: var(--wine); background: #fff; animation: pulse 1.4s ease-in-out infinite; }
.card-row { display: flex; gap: 10px; align-items: flex-start; }
.card-row .ci { width: 54px; height: 54px; flex: none; }
.card-row small, .talents small { color: var(--muted); font-weight: 700; font-size: .85rem; }
.card-row b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; display: block; font-size: 1.15rem; line-height: 1.15; }
.card-row p { margin: 3px 0 0; font-size: .93rem; color: var(--ink2); line-height: 1.4; }
.card-row + .card-row { margin-top: 12px; }
.card-row.rule { background: rgba(224, 168, 58, .16); border: 2px dashed var(--brass-lo); border-radius: 8px; padding: 8px; }
.talents { margin-top: 12px; }
.talents div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tal { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--ink); background: var(--paper); display: flex; align-items: center; justify-content: center; }
.tal img { width: 36px; height: 36px; }
/* l'objectif : la prochaine camionnette */
.goal { padding: 14px 14px 12px; }
.goal-top { display: flex; gap: 10px; align-items: center; }
.goal-top .gi { width: 50px; height: 50px; flex: none; }
.goal-top small { display: block; color: var(--green); font-weight: 800; font-size: .85rem; }
.goal-top b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 1.15rem; line-height: 1.15; }
.goal .bill-bar { margin: 8px 0 6px; }
.goal-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; font-weight: 800; font-size: .92rem; }

/* le carnet : un carnet de cuir ouvert sur une page quadrillée */
#carnet { grid-area: carnet; position: relative; overflow: hidden; margin: 16px 16px 0 0; border: 3px solid var(--ink); border-bottom: none; border-radius: 14px 14px 0 0;
  background-color: var(--paper); background-image: var(--grain),
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(120, 75, 25, .22)),
    linear-gradient(90deg, rgba(46, 29, 18, .28), transparent 34px),
    repeating-linear-gradient(0deg, rgba(110, 80, 40, .1) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(110, 80, 40, .1) 0 1px, transparent 1px 28px);
  box-shadow: inset 10px 0 0 #6b3a22, inset 13px 0 0 var(--ink), 0 -2px 18px rgba(0, 0, 0, .3); }
.carnet-title { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 16px 24px 32px; pointer-events: none;
  background: linear-gradient(180deg, var(--paper) 58%, rgba(243, 228, 196, 0)); }
.carnet-title img { width: 34px; height: 34px; }
.carnet-title b { font-family: var(--marker); font-weight: 400; font-size: 1.55rem; color: var(--ink); }
.carnet-title small { color: var(--muted); font-weight: 700; }
#tree-wrap { position: absolute; inset: 0; cursor: grab; touch-action: none; }
#tree-wrap.dragging { cursor: grabbing; }
#tree { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#tree.anim { transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.tree-lines { position: absolute; left: -1000px; top: -1000px; overflow: visible; pointer-events: none; }
.tree-lines line { stroke: rgba(107, 74, 51, .45); stroke-width: 4; stroke-dasharray: 6 8; stroke-linecap: round; }
.tree-lines line.open { stroke: var(--brass); }
.tree-lines line.on { stroke: var(--ink2); stroke-dasharray: none; stroke-width: 4.5; }
/* une vignette = un autocollant rond au contour épais */
.node { position: absolute; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 40% 30%, #fffdf6, var(--note) 55%, #ecdab4);
  box-shadow: inset 0 -4px 0 rgba(107, 74, 51, .15), 0 4px 0 var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; transition: transform .1s; }
.node img { width: 56px; height: 56px; pointer-events: none; filter: drop-shadow(0 2px 0 rgba(46, 29, 18, .18)); }
.node:hover { transform: scale(1.08) rotate(-4deg); z-index: 3; }
.node.big { width: 98px; height: 98px; margin: -49px 0 0 -49px; }
.node.big img { width: 72px; height: 72px; }
/* le niveau : une petite étiquette de prix */
.node .lv { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%) rotate(-3deg); background: var(--note); color: var(--ink); border: 2px solid var(--ink); font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 800; font-size: .8rem; padding: 0 7px; border-radius: 6px; white-space: nowrap; line-height: 1.35; }
.node .cap { position: absolute; top: -8px; right: -10px; width: 30px; height: 30px; border-radius: 50%; background: var(--note); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.node .cap img { width: 22px; height: 22px; }
.node .q { font-family: var(--display); font-weight: 900; font-size: 2rem; color: var(--muted); }
.node.locked { background: rgba(230, 208, 166, .55); border: 2.5px dashed rgba(107, 74, 51, .6); box-shadow: none; cursor: default; }
.node.open img { filter: saturate(.75); }
.node.owned { box-shadow: inset 0 0 0 3px var(--green), inset 0 -4px 0 rgba(107, 74, 51, .15), 0 4px 0 var(--ink); }
.node.buyable { box-shadow: 0 0 0 4px var(--brass), 0 4px 0 4px var(--brass-lo); animation: glow 1.6s ease-in-out infinite; }
.node.max { background: radial-gradient(circle at 40% 30%, var(--brass-hi), var(--brass) 60%, var(--brass-lo)); }
.node.max .lv { background: var(--brass-hi); }
.node.capped { border-color: var(--muted); }
.node.tok { background: radial-gradient(circle at 40% 30%, #fff8e0, #f3dfa8 60%, #dcbf74); }
.node.tok.locked { background: rgba(230, 208, 166, .55); }
.node.pop { animation: nodepop .45s; }
.node.nope { animation: nope .3s; }
#node-tip { position: absolute; z-index: 5; width: 270px; background: var(--note) var(--grain); border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: 0 4px 0 var(--ink), 0 12px 22px rgba(20, 10, 4, .25); padding: 10px 12px; pointer-events: none; }
#node-tip b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 1.12rem; }
#node-tip .lvl { color: var(--muted); font-weight: 800; font-size: .85rem; }
#node-tip p { margin: 6px 0 0; font-size: .95rem; line-height: 1.4; }
#node-tip p.next { color: var(--green); font-weight: 800; }
#node-tip .foot { margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--line); font-weight: 800; }
#node-tip .cost { font-family: var(--display); font-weight: 800; font-size: 1.2rem; }
#node-tip .cost.ko { color: var(--wine); }
.tree-btns { margin-left: auto; display: flex; gap: 8px; pointer-events: auto; }
.tbtn { display: inline-flex; align-items: center; gap: 4px; background: linear-gradient(180deg, #fffaf0, #f1dfba); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px 2px 4px; font-weight: 800; font-size: .9rem; color: var(--ink); cursor: pointer; box-shadow: 0 2px 0 var(--ink); }
.tbtn img { width: 26px; height: 26px; }
.tbtn:hover { transform: translateY(-1px); }
.tbtn.hot { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); animation: glow 1.6s ease-in-out infinite; }
.tree-label { position: absolute; transform: translate(-50%, -50%) rotate(-2deg); white-space: nowrap; display: flex; align-items: center; gap: 6px; font-family: var(--marker); font-size: 1.15rem; color: var(--ink);
  background: var(--tape); padding: 3px 16px 3px 6px; pointer-events: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.tree-label .ic { width: 26px; height: 26px; }

/* l'étagère : les lieux en photos instantanées, et le départ */
#hub-bottom { grid-area: bottom; display: flex; align-items: center; gap: 18px; padding: 10px 18px 14px; position: relative; z-index: 2;
  background: var(--wood), linear-gradient(180deg, var(--walnut3), var(--walnut2) 30%, var(--walnut)); border-top: 3px solid var(--ink); box-shadow: 0 -6px 14px rgba(0, 0, 0, .3); }
#zones { flex: 1; display: flex; gap: 14px; overflow-x: auto; padding: 10px 4px 6px; }
.zone { position: relative; flex: none; width: 138px; height: 118px; border: 7px solid var(--note); border-bottom-width: 30px; border-radius: 3px; background-size: cover; background-position: center; background-clip: padding-box;
  cursor: pointer; padding: 0; box-shadow: 0 0 0 2px var(--ink), 0 6px 12px rgba(0, 0, 0, .45); transform: rotate(-2deg); transition: transform .12s; }
.zone:nth-child(even) { transform: rotate(1.8deg); }
.zone:nth-child(3n) { transform: rotate(-.8deg); }
/* la légende, écrite au feutre sous la photo */
.zone span { position: absolute; left: -4px; right: -4px; bottom: -29px; height: 28px; display: flex; align-items: center; justify-content: center; font-family: var(--marker); font-size: .78rem; line-height: 1; color: var(--ink); text-align: center; overflow: hidden; }
.zone em { position: absolute; top: 4px; left: 4px; right: 4px; font-style: normal; font-size: .75rem; font-weight: 800; color: #fff; background: rgba(46, 29, 18, .8); border-radius: 6px; padding: 1px 6px 1px 2px; display: flex; align-items: center; gap: 4px; }
.zone em .ic { width: 18px; height: 18px; }
.zone.locked { filter: sepia(.6) grayscale(.6) brightness(.8); cursor: not-allowed; }
.zone.sel { transform: rotate(0) translateY(-6px) scale(1.04); box-shadow: 0 0 0 2px var(--ink), 0 0 0 6px var(--brass), 0 10px 16px rgba(0, 0, 0, .5); }
/* la punaise du lieu choisi */
.zone.sel::after { content: ''; position: absolute; top: -14px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8b7a, var(--wine) 60%, #5a1520); border: 2px solid var(--ink); }
.zone:not(.locked):not(.sel):hover { transform: rotate(0) translateY(-3px); }
/* « Partir chiner » : le gros bouton vert cerclé de laiton */
.go { flex: none; min-width: 250px; height: 104px; border-radius: 20px; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--green-hi), var(--green) 55%, var(--green-lo)); color: #fff; cursor: pointer;
  box-shadow: inset 0 0 0 4px rgba(255, 227, 154, .9), inset 0 3px 0 4px rgba(255, 255, 255, .25), 0 6px 0 var(--ink), 0 12px 20px rgba(0, 0, 0, .4); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .08s, box-shadow .08s; text-shadow: 0 2px 0 var(--green-lo); }
.go b { font-size: 2rem; font-weight: 900; line-height: 1.05; }
.go small { font-weight: 800; color: #e8f4ea; }
.go:hover { transform: translateY(-2px); filter: brightness(1.05); }
.go:active { transform: translateY(4px); box-shadow: inset 0 0 0 4px rgba(255, 227, 154, .9), 0 2px 0 var(--ink); }

/* ----- La journée ----- */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: none; touch-action: none; }
#day-hud { position: fixed; inset: 0; pointer-events: none; }
.dh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 18px; }
.dh-left { display: flex; align-items: center; gap: 12px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .55), 0 0 10px rgba(0, 0, 0, .45); min-width: 200px; }
.dh-left b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 1.45rem; display: block; line-height: 1.05; }
.dh-left small { font-weight: 700; opacity: .95; }
.dh-pause { pointer-events: auto; width: 46px; height: 46px; flex: none; border-radius: 14px; background: linear-gradient(180deg, #fffaf0, #ecd6aa); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), var(--pop); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.dh-pause:hover { transform: translateY(-1px); }
/* le café : une jauge dans un cadre de laiton */
.dh-energy { display: flex; align-items: center; gap: 8px; background: linear-gradient(180deg, var(--walnut3), var(--walnut)); border: 2.5px solid var(--ink); border-radius: 999px; padding: 4px 14px 4px 4px;
  box-shadow: inset 0 0 0 2px var(--brass), 0 3px 0 var(--ink), 0 6px 14px rgba(0, 0, 0, .35); }
.dh-energy img { width: 40px; height: 40px; margin: -8px 0 -8px -4px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .4)); }
.dh-bar { width: min(34vw, 380px); height: 16px; border-radius: 9px; background: rgba(0, 0, 0, .35); overflow: hidden; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .4); }
.dh-bar i { display: block; height: 100%; background: linear-gradient(180deg, var(--brass-hi), var(--brass) 60%, var(--brass-lo)); border-radius: 9px; transition: width .1s linear; }
.dh-bar i.low { background: linear-gradient(180deg, #ff9a8a, #c8414f); animation: blink .5s ease-in-out infinite; }
.dh-energy b { color: var(--brass-hi); font-family: var(--display); font-weight: 800; font-size: 1.2rem; min-width: 42px; text-align: right; font-variant-numeric: tabular-nums lining-nums; }
/* l'argent du jour : une plaque de laiton */
.dh-money { display: flex; align-items: center; gap: 6px; background: linear-gradient(180deg, var(--brass-hi), var(--brass) 55%, var(--brass-lo)); border: 2.5px solid var(--ink); border-radius: 16px; padding: 3px 16px 3px 5px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 4px 0 var(--ink), 0 8px 16px rgba(0, 0, 0, .35); min-width: 170px; }
.dh-money img { width: 44px; height: 44px; }
.dh-money b { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 900; font-size: 1.55rem; display: block; line-height: 1.05; font-variant-numeric: tabular-nums lining-nums; }
.dh-money small { color: var(--ink2); font-weight: 800; font-size: .78rem; }
.dh-money.bump { animation: bump .18s; }
.dh-tokens { position: absolute; top: 86px; right: 18px; display: flex; align-items: center; gap: 6px; background: linear-gradient(180deg, #fff1c7, #e9c66a 60%, #b98a2a); border: 2.5px solid var(--ink); border-radius: 999px; padding: 2px 14px 2px 3px; box-shadow: 0 3px 0 var(--ink); }
.dh-tokens img { width: 36px; height: 36px; }
.dh-tokens b { font-family: var(--display); font-weight: 900; font-size: 1.35rem; min-width: 24px; }
.dh-tokens.bump { animation: bump .18s; }
.dh-streak { position: absolute; top: 78px; left: 50%; transform: translateX(-50%) rotate(-2deg); background: var(--c, var(--wine)); color: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: 3px 16px; display: flex; gap: 10px; align-items: baseline;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 4px 0 var(--ink); animation: pop .2s; }
.dh-streak b { font-family: var(--marker); font-weight: 400; font-size: 1.15rem; }
.dh-streak span { font-family: var(--display); font-weight: 900; font-size: 1.45rem; }
.dh-talents { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 6px; }
.dh-talents span { width: 46px; height: 46px; border-radius: 12px; background: var(--note); border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 var(--ink); }
.dh-talents span.ev { background: #fff1c7; }
.dh-talents img { width: 36px; height: 36px; }
.dh-hint { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%) rotate(-1deg); display: flex; align-items: center; gap: 10px; background: var(--note) var(--grain); border: 2.5px solid var(--ink); border-radius: 10px; padding: 8px 18px 8px 10px; box-shadow: 0 4px 0 var(--ink); font-weight: 800; font-size: 1.12rem; }
.dh-hint img { width: 42px; height: 42px; animation: wiggle 1s ease-in-out infinite; }
/* pouvoirs : des médaillons ronds cerclés de laiton */
.dh-powers { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 14px; }
.pw { pointer-events: auto; position: relative; width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #fffdf6, var(--note) 60%, #e6d0a6); border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 3px var(--teal), 0 4px 0 var(--ink), 0 8px 14px rgba(0, 0, 0, .35); cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; }
.pw img { width: 54px; height: 54px; position: relative; z-index: 1; }
.pw kbd { position: absolute; z-index: 3; left: 50%; bottom: 2px; transform: translateX(-50%); font-family: var(--display); font-weight: 900; font-size: .8rem; background: var(--ink); color: var(--paper); border: none; border-radius: 6px; padding: 0 6px; margin: 0; min-width: 0; line-height: 1.3; }
.pw .cd { position: absolute; inset: 0; z-index: 2; background: conic-gradient(rgba(46, 29, 18, .6) calc(var(--k, 0) * 360deg), transparent 0); }
.pw.ready { box-shadow: inset 0 0 0 4px var(--brass), 0 4px 0 var(--ink), 0 0 18px rgba(255, 210, 90, .85); }
.pw.ready .cd { display: none; }
.pw:not(.ready) img { filter: grayscale(.6); }
.pw.bump { animation: pulse .25s; }
.dh-rotate { display: none; }

/* ----- Fenêtres : une feuille de papier jauni ----- */
#modal-root { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(40, 22, 10, .45), rgba(20, 10, 4, .72)); }
.modal { position: relative; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--paper) var(--grain); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7.5px rgba(107, 74, 51, .3), 0 6px 0 var(--ink), 0 24px 50px rgba(0, 0, 0, .5); padding: 24px 26px; animation: pop .22s; }
.modal h2 { margin: 2px 0 8px; font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.modal h3 { margin: 18px 0 6px; font-size: 1.2rem; font-weight: 800; color: var(--ink2); }
.modal p { line-height: 1.55; }
.modal .btns { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.modal .hero { display: block; width: calc(100% + 52px); margin: -24px -26px 14px; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 3px solid var(--ink); border-radius: 13px 13px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-weight: 800; font-size: 1.05rem; background: linear-gradient(180deg, var(--brass-hi), var(--brass)); border: 2px solid var(--ink); border-radius: 999px; padding: 0 12px 0 4px; vertical-align: middle; }
.intro .how { display: flex; gap: 12px; align-items: center; background: var(--note); border: 2px dashed var(--ink2); border-radius: 10px; padding: 10px 12px; font-weight: 700; line-height: 1.45; }
.intro .how .ic { width: 46px; height: 46px; flex: none; }
.note { background: #fff1c7; border: 2px dashed var(--brass-lo); border-radius: 10px; padding: 7px 10px; font-weight: 700; }
.linkbtn { margin-right: auto; background: none; border: none; color: var(--muted); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; font-size: .88rem; }
.qm { font-family: var(--display); font-weight: 900; color: var(--wine); }
kbd { display: inline-block; min-width: 26px; text-align: center; font-family: var(--display); font-weight: 800; background: var(--note); border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 7px; padding: 0 6px; margin-right: 3px; }

/* Bilan */
.bilan { text-align: center; }
.stamp-title { display: inline-block; font-family: var(--marker); color: var(--wine); font-size: 1.5rem; border: 3px solid var(--wine); border-radius: 10px; padding: 2px 16px; transform: rotate(-3deg); animation: stampin .35s; }
.big-earn { font-size: 3.6rem; font-weight: 900; color: var(--green); margin: 8px 0 2px; font-variant-numeric: tabular-nums lining-nums; line-height: 1.05; text-shadow: 0 3px 0 rgba(46, 29, 18, .15); }
.bilan-sub { color: var(--ink2); font-weight: 700; }
.bilan-sub .new { color: var(--r3); }
.found-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 6px; }
.fg { position: relative; width: 60px; height: 60px; border-radius: 12px; background: var(--note); border: 3px solid var(--r0); display: flex; align-items: center; justify-content: center; animation: pop .3s backwards; box-shadow: 0 3px 0 rgba(46, 29, 18, .3); }
.fg img { width: 46px; height: 46px; }
.fg .n { position: absolute; right: -7px; bottom: -7px; background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 800; font-size: .78rem; padding: 0 6px; border-radius: 999px; }
.fg.r1 { border-color: var(--r1); } .fg.r2 { border-color: var(--r2); } .fg.r3 { border-color: var(--r3); box-shadow: 0 0 12px rgba(138, 79, 192, .5); }
.fg.r4 { border-color: var(--r4); box-shadow: 0 0 14px rgba(217, 154, 30, .6); } .fg.r5 { border-color: var(--r5); box-shadow: 0 0 18px rgba(214, 64, 122, .7); }
.fg.fresh::after { content: '★'; position: absolute; top: -11px; left: -8px; color: var(--brass); font-size: 1.35rem; text-shadow: 0 1px 0 var(--ink); }
.bossline { display: flex; gap: 12px; align-items: center; text-align: left; border: 2.5px solid var(--ink); background: linear-gradient(180deg, #fff1c7, #f3dca0); border-radius: 12px; padding: 6px 12px; margin: 12px 0 8px; box-shadow: 0 3px 0 var(--ink); }
.bossline.ko { background: var(--paper2); }
.bossline > img { width: 64px; height: 64px; flex: none; }
.bossline b { display: block; font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 1.2rem; }
.bossline span { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--brass-lo); }
.bossline.ko span { color: var(--muted); }
.bossline .ic, .note .ic { width: 22px; height: 22px; vertical-align: middle; }
.expert { display: flex; gap: 12px; align-items: center; text-align: left; margin: 16px 0 8px; background: var(--note); border: 2.5px solid var(--ink); border-radius: 12px; padding: 10px; }
.expert .portrait { width: 70px; height: 70px; }
.expert p { margin: 2px 0; font-style: italic; }
.expert small { color: var(--muted); font-weight: 700; }
.doubts { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.doubt { display: flex; align-items: center; gap: 10px; background: var(--note); border: 2.5px solid var(--r3); border-radius: 12px; padding: 6px 10px; text-align: left; transition: background .3s; }
.doubt .di { width: 48px; height: 48px; }
.doubt .dn { flex: 1; } .doubt .dn b { display: block; } .doubt .dn small { color: var(--muted); font-weight: 700; }
.doubt .db { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.doubt.checking .di { animation: inspect .4s ease-in-out infinite; }
.doubt.checking { background: #f4ecff; }
.doubt.genuine { background: #e4f1e3; border-color: var(--green); }
.doubt.fake { background: #f6e0dc; border-color: var(--wine); }
.doubt.sold { opacity: .8; border-color: var(--line); }
.verdict { font-family: var(--marker); font-size: 1.2rem; transform: rotate(-4deg); display: inline-block; animation: stampin .3s; }
.genuine .verdict { color: var(--green); } .fake .verdict { color: var(--wine); }

/* Huissier, talents, événements */
.visit { text-align: center; }
.quote { font-style: italic; font-size: 1.08rem; }
.receipt { position: relative; text-align: left; background: #fffdf4; border: 2px dashed var(--ink2); border-radius: 8px; padding: 10px 14px; margin: 12px auto; max-width: 420px; }
.receipt div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-weight: 700; }
.receipt .warn { color: var(--wine); }
.stampmark { position: absolute !important; right: -24px; top: -20px; font-family: var(--marker); font-size: 1.6rem; padding: 0 12px !important; border: 4px solid; border-radius: 10px; transform: rotate(-12deg); background: rgba(255, 253, 244, .85); animation: stampin .4s .3s backwards; }
.stampmark.paid { color: var(--green); } .stampmark.late { color: var(--wine); }
.talentpick { text-align: center; }
.cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.tcard { width: 178px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; background: var(--note) var(--grain); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink); cursor: pointer; color: var(--ink); transition: transform .12s; animation: deal .35s backwards; }
.tcard:nth-child(2) { animation-delay: .08s; } .tcard:nth-child(3) { animation-delay: .16s; } .tcard:nth-child(4) { animation-delay: .24s; } .tcard:nth-child(5) { animation-delay: .32s; }
.tcard:hover { transform: translateY(-6px) rotate(-2deg); box-shadow: 0 0 0 4px var(--brass), 0 9px 0 var(--ink); }
.tcard .ti { width: 78px; height: 78px; }
.tcard b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 1.15rem; }
.tcard span { font-size: .93rem; color: var(--ink2); font-weight: 700; line-height: 1.35; }
.eventcard { text-align: center; }
.eventcard small { color: var(--muted); font-weight: 700; }
.eventcard .ei { display: block; width: 108px; height: 108px; margin: 8px auto 0; animation: wiggle 2s ease-in-out infinite; }
.win, .intro, .season { text-align: left; }
.repgain { font-family: var(--display); font-size: 1.4rem; font-weight: 800; color: var(--brass-lo); display: flex; align-items: center; gap: 6px; }
.pause { text-align: center; }
.pause h2 { font-family: var(--marker); font-weight: 400; font-size: 2.6rem; color: var(--wine); }
.pause-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; margin: 16px 0 8px; }
.pause-btns .btn { min-width: 260px; }

/* Bulles « première fois » */
.tipcard .tip-top { display: flex; gap: 16px; align-items: center; }
.tipcard .ti { width: 100px; height: 100px; flex: none; object-fit: contain; animation: wiggle 1.4s ease-in-out infinite; }
.tipcard small { color: var(--brass-lo); font-weight: 800; }
.tipcard h2 { margin: 0 0 6px; }
.tipcard p { margin: 0; }

/* Équipement */
.modal:has(.gear) { width: min(780px, 100%); }
.gear-top { display: flex; gap: 14px; align-items: center; }
.gear-top .mq { width: 110px; height: 110px; flex: none; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .15)); }
.gear-top h2 { margin-top: 0; }
.gear h3 { font-family: var(--marker); font-weight: 400; }
.eqs { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.eq { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; background: rgba(230, 208, 166, .5); border: 2.5px dashed rgba(107, 74, 51, .5); border-radius: 14px; padding: 10px 8px; }
.eq.owned { background: var(--note); border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.eq.max { background: linear-gradient(180deg, #fff6d8, #f3dca0); }
.eq .ei { width: 66px; height: 66px; }
.eq:not(.owned) .ei { filter: grayscale(.7) opacity(.7); }
.eq b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 1.02rem; line-height: 1.15; }
.eq p { margin: 2px 0 6px; font-size: .85rem; line-height: 1.35; flex: 1; }
.eq .next { display: block; color: var(--green); font-weight: 800; }
.eq .stars { display: flex; gap: 3px; margin: 2px 0; }
.eq .stars i { width: 11px; height: 11px; border-radius: 50%; background: var(--paper2); border: 1.5px solid var(--ink2); }
.eq .stars i.on { background: var(--brass); border-color: var(--brass-lo); }
.eq .btn { margin-top: auto; }

/* Comment jouer */
.modal:has(.help) { width: min(840px, 100%); }
.help h3 { font-family: var(--marker); font-weight: 400; color: var(--ink); }
.hrows { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hrow { display: flex; gap: 10px; align-items: flex-start; background: var(--note); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 10px; box-shadow: 0 3px 0 rgba(46, 29, 18, .3); }
.hrow .hi { width: 50px; height: 50px; flex: none; object-fit: contain; }
.hrow b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; }
.hrow p { margin: 2px 0 0; font-size: .92rem; line-height: 1.38; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 700; }

/* Succès */
#achs { position: fixed; right: 16px; bottom: 16px; z-index: 65; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.achtoast { display: flex; gap: 10px; align-items: center; width: 330px; background: var(--note) var(--grain); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 12px; box-shadow: inset 0 0 0 3px var(--brass), 0 5px 0 var(--ink), 0 12px 24px rgba(0, 0, 0, .35); animation: achin 4.2s forwards; }
.achtoast .ai { width: 56px; height: 56px; flex: none; animation: wiggle 1s ease-in-out 2; }
.achtoast small { display: block; color: var(--brass-lo); font-weight: 800; font-size: .8rem; }
.achtoast b { display: block; font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 1.08rem; }
.achtoast span { font-size: .86rem; color: var(--ink2); font-weight: 700; }
.achgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ach { display: flex; gap: 8px; align-items: center; background: rgba(230, 208, 166, .5); border: 2px dashed rgba(107, 74, 51, .45); border-radius: 12px; padding: 6px 8px; }
.ach .ai { width: 42px; height: 42px; flex: none; filter: grayscale(1) opacity(.35); }
.ach b { display: block; font-family: var(--display); font-weight: 800; font-size: .98rem; color: var(--muted); }
.ach span { font-size: .82rem; color: var(--muted); font-weight: 700; }
.ach.ok { background: var(--note); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.ach.ok .ai { filter: none; } .ach.ok b { color: var(--ink); } .ach.ok span { color: var(--ink2); }
@keyframes achin { 0% { opacity: 0; transform: translateX(40px); } 6%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(40px); } }

/* Musée, options */
.sets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.set { background: var(--note); border: 2.5px solid var(--ink); border-radius: 12px; padding: 8px 10px; }
.set b { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; }
.set.done { background: linear-gradient(180deg, #fff6d8, #f3dca0); }
.pieces { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.piece { width: 52px; height: 52px; border-radius: 10px; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; background: var(--paper); }
.piece img { width: 44px; height: 44px; }
.piece.miss img { filter: brightness(0); opacity: .18; }
.piece.own.r3 { border-color: var(--r3); } .piece.own.r4 { border-color: var(--r4); } .piece.own.r5 { border-color: var(--r5); }
.statgrid { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 14px; font-weight: 700; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 2px dashed var(--line); font-weight: 700; }
.slider { display: flex; align-items: center; gap: 8px; }
.slider input { width: 170px; accent-color: var(--green); }
.slider output { min-width: 46px; text-align: right; font-family: var(--display); font-weight: 800; }
textarea { width: 100%; font: 12px ui-monospace, Consolas, monospace; border: 2px solid var(--ink); border-radius: 10px; padding: 8px; background: var(--note); }

/* Messages */
#toasts { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--note); border: 2.5px solid var(--ink); border-radius: 12px; padding: 8px 16px; box-shadow: 0 4px 0 var(--ink), 0 10px 20px rgba(0, 0, 0, .25); font-weight: 800; animation: toast 3.2s forwards; }
.toast.gold { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); } .toast.ok { box-shadow: inset 0 0 0 3px var(--green), 0 4px 0 var(--ink); } .toast.warn { color: var(--wine); }
.spark { position: fixed; z-index: 70; width: 9px; height: 9px; margin: -4px; border-radius: 50%; background: var(--brass-hi); box-shadow: 0 0 8px var(--brass); pointer-events: none; animation: spark .6s ease-out forwards; }

/* Animations (sans action du joueur : seulement la lueur de ce qui s'achète) */
@keyframes pop { from { transform: scale(.88); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bump { 50% { transform: scale(1.08) rotate(-2deg); } }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 200, 80, 0)); } 50% { filter: drop-shadow(0 0 10px rgba(255, 200, 80, .95)); } }
@keyframes pulse { 50% { transform: scale(1.12); } }
@keyframes blink { 50% { opacity: .55; } }
@keyframes nodepop { 0% { transform: scale(1); } 40% { transform: scale(1.3) rotate(8deg); } 100% { transform: scale(1); } }
@keyframes nope { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg) translateY(-3px); } }
@keyframes stampin { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } to { opacity: 1; } }
@keyframes inspect { 0%, 100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(6deg) scale(1.15); } }
@keyframes deal { from { transform: translateY(40px) rotate(8deg); opacity: 0; } }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ----- Petits écrans : le carnet passe en colonne et la page défile ----- */
@media (max-width: 900px) {
  html { overflow: auto; height: auto; }
  body { overflow: visible; height: auto; }   /* sinon le corps devient un conteneur de défilement et l'étagère ne colle plus */
  #hub { position: static; min-height: 100vh; display: flex; flex-direction: column; }
  #hub-top { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .logo span { display: none; }
  .money b { font-size: 1.35rem; min-width: 0; }
  .when { order: 3; flex-basis: 100%; font-size: .9rem; }
  .tools { flex-wrap: wrap; gap: 6px; }
  .tool { width: 40px; height: 40px; } .tool img { width: 28px; height: 28px; }
  #hub-side { padding: 22px 12px 12px; gap: 22px; }
  #carnet { height: 62vh; flex: none; margin: 0 10px; border-radius: 14px; border-bottom: 3px solid var(--ink); }
  .carnet-title small { display: none; }
  .tree-btns .tbtn span { display: none; } .tbtn { padding: 2px 4px; }
  #hub-bottom { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 10px; position: sticky; bottom: 0; margin-top: 12px; }
  #zones { flex-wrap: nowrap; gap: 12px; padding: 8px 4px 4px; }
  .zone { width: 104px; height: 88px; border-width: 5px; border-bottom-width: 24px; }
  .zone span { bottom: -23px; height: 22px; font-size: .66rem; }
  .zone.locked span { display: none; }
  .go { width: 100%; height: 64px; min-width: 0; } .go b { font-size: 1.6rem; }
  .dh-top { flex-wrap: wrap; padding: 8px; }
  .dh-left { min-width: 0; } .dh-left small { display: none; }
  .dh-bar { width: 40vw; }
  .sets, .achgrid { grid-template-columns: 1fr; }
  .tipcard .tip-top { flex-direction: column; text-align: center; }
  .modal { padding: 20px 16px; } .modal .hero { width: calc(100% + 32px); margin: -20px -16px 12px; }
}
@media (max-width: 700px) {
  .pw { width: 58px; height: 58px; } .pw img { width: 42px; height: 42px; }
  .dh-tokens { top: 70px; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .dh-rotate { display: block; position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); width: max-content; max-width: 90vw; text-align: center; background: rgba(46, 29, 18, .8); color: var(--paper); font-weight: 800; font-size: .88rem; border-radius: 999px; padding: 6px 14px; }
}
/* téléphone à l'horizontale : bandeau du haut sur une ligne, boutons plus petits */
@media (max-height: 500px) {
  .dh-top { flex-wrap: nowrap; padding: 6px 8px; gap: 8px; }
  .dh-left b { font-size: 1.05rem; } .dh-left small { display: none; }
  .dh-pause { width: 38px; height: 38px; border-radius: 11px; }
  .dh-energy img { width: 30px; height: 30px; }
  .dh-bar { width: 26vw; height: 12px; }
  .dh-money { min-width: 0; padding: 2px 10px 2px 4px; } .dh-money img { width: 32px; height: 32px; } .dh-money b { font-size: 1.15rem; } .dh-money small { display: none; }
  .dh-tokens { top: 52px; padding: 0 10px 0 2px; } .dh-tokens img { width: 28px; height: 28px; } .dh-tokens b { font-size: 1.05rem; }
  .dh-streak { top: 52px; }
  .pw { width: 50px; height: 50px; } .pw img { width: 36px; height: 36px; }
  .dh-powers { bottom: 8px; gap: 8px; }
  .dh-talents { bottom: 8px; } .dh-talents span { width: 36px; height: 36px; } .dh-talents img { width: 30px; height: 30px; }
  .dh-hint { bottom: 66px; font-size: .95rem; padding: 4px 12px 4px 6px; } .dh-hint img { width: 30px; height: 30px; }
}
