/* Le Village des Cubes — styles de l'interface (ADN Zaplud : verre sombre, accents vifs ; GDD §11.5). Portrait, au pouce. */
:root {
  --bg: #0b0d12; --panel: #12151de6; --line: #ffffff1f; --text: #f2f4f8; --soft: #c3c9d6; --muted: #8b93a7;
  --accent: #2f7bff; --gold: #fcc419; --ok: #34d399; --pink: #ff6b8b; --warm: #ffb347; --ink: #1b1433;
  --font: Inter, system-ui, -apple-system, sans-serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: #0b0d12; color: var(--text); font-family: var(--font); -webkit-user-select: none; user-select: none; touch-action: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:active:not(:disabled) { transform: scale(.94); }
input { font: 700 16px var(--font); color: var(--text); }
[hidden] { display: none !important; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.glass { background: var(--panel); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border: 1px solid var(--line); }
.av { display: grid; place-items: center; }
.av svg { width: 100%; height: 100%; transform: scale(1.55); transform-origin: 50% 64%; }
.hero .av svg { transform: none; }

/* ---------- HUD ---------- */
.hud { position: fixed; top: calc(var(--st) + 10px); left: 12px; right: 12px; display: flex; align-items: flex-start; gap: 8px; z-index: 30; pointer-events: none; }
.hud > * { pointer-events: auto; }
.me { width: 58px; height: 58px; border-radius: 20px; position: relative; display: grid; place-items: center; flex: none; }
.me .av { width: 40px; height: 40px; margin-top: -2px; }
.me .lv { position: absolute; bottom: -7px; left: 50%; translate: -50% 0; background: var(--warm); color: #2a1600; font: 900 11px var(--font); padding: 2px 7px; white-space: nowrap; border-radius: 99px; box-shadow: 0 0 0 2px #0b0d12; }
.me svg.ring { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); }
#xpRing { transition: stroke-dashoffset .5s ease; }
.pill { height: 38px; border-radius: 99px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px 0 10px; font-weight: 800; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.col { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.coin { color: var(--gold); font-size: 18px; line-height: 1; text-shadow: 0 0 8px #fcc41988; }
.money b, .hearts b { min-width: 28px; text-align: right; }
.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }
.sub { position: fixed; top: calc(var(--st) + 78px); left: 12px; right: 12px; display: flex; gap: 8px; z-index: 30; align-items: center; pointer-events: none; }
.sub > * { pointer-events: auto; }
.friends { display: flex; align-items: center; padding-left: 9px; }
.friends .f { width: 36px; height: 36px; border-radius: 13px; background: #1d2230; border: 2px solid #0b0d12; margin-left: -9px; position: relative; display: grid; place-items: center; }
.friends .f .av { width: 30px; height: 30px; margin-top: 3px; }
.friends .f::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px #0b0d12; }
.friends .more { margin-left: 4px; font: 800 12px var(--font); color: var(--soft); }
.bell { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; position: relative; font-size: 18px; }
.bell i { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 2px #0b0d12; }
.vname { position: fixed; top: calc(var(--st) + 128px); left: 0; right: 0; text-align: center; font: 900 13px var(--font); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 8px #000a; z-index: 5; pointer-events: none; opacity: .85; }

/* entrée en jeu : le HUD glisse en place pendant que la caméra plonge */
#game:not([hidden]) .hud { animation: dropIn .6s .25s cubic-bezier(.2,1.3,.4,1) both; }
#game:not([hidden]) .sub, #game:not([hidden]) .vname { animation: dropIn .6s .4s cubic-bezier(.2,1.3,.4,1) both; }
#game:not([hidden]) .tabs { animation: riseIn .55s .3s cubic-bezier(.2,1.2,.4,1) both; }
#game:not([hidden]) .tools { animation: riseIn .55s .45s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes dropIn { from { transform: translateY(-120%); opacity: 0; } }
@keyframes riseIn { from { transform: translateY(140%); opacity: 0; } }

/* ---------- bulle d'action ---------- */
.bubble { position: fixed; z-index: 25; padding: 12px; border-radius: 22px; width: 260px; box-shadow: 0 18px 40px #0009; animation: pop .22s cubic-bezier(.3,1.6,.6,1); }
.bubble::after { content: ""; position: absolute; bottom: -9px; left: var(--tip, 50%); width: 18px; height: 18px; background: #151925; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.bubble.down::after { bottom: auto; top: -9px; transform: translateX(-50%) rotate(225deg); }
.bubble h4 { font-size: 15px; font-weight: 900; display: flex; align-items: center; gap: 7px; }
.bubble p { color: var(--soft); font-size: 12px; font-weight: 600; margin: 3px 0 10px; line-height: 1.35; }
.bubble .x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 10px; color: var(--muted); font-size: 16px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { flex: 1; min-height: 50px; border-radius: 15px; font: 900 14px var(--font); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: #262b3a; padding: 0 12px; white-space: nowrap; }
.btn small { font-weight: 800; opacity: .8; font-size: 11px; }
.btn.blue { background: linear-gradient(180deg, #4aa3ff, #2f7bff); box-shadow: 0 4px 0 #1b4fb8, 0 10px 22px #2f7bff44; }
.btn.warm { background: linear-gradient(180deg, #ffc56b, #ff9d2e); color: #3a1d00; box-shadow: 0 4px 0 #c46a12, 0 10px 22px #ff9d2e44; }
.btn.green { background: linear-gradient(180deg, #4fe0a0, #20b97a); color: #032a1a; box-shadow: 0 4px 0 #13804f, 0 10px 22px #20b97a44; }
.btn.pink { background: linear-gradient(180deg, #ff8fab, #ff4d7d); box-shadow: 0 4px 0 #b8264f, 0 10px 22px #ff4d7d44; }
.btn:disabled { opacity: .45; filter: grayscale(.5); }
.btn.sm { min-height: 40px; font-size: 13px; border-radius: 12px; flex: none; }
.bar { height: 8px; background: #ffffff14; border-radius: 9px; overflow: hidden; margin: 4px 0 8px; }
.bar b { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #ff6b7f, #ffb347); transition: width .4s ease; }
.bar.green b { background: linear-gradient(90deg, #34d399, #9be86a); }

/* ---------- outils et onglets ---------- */
.tools { position: fixed; left: 50%; translate: -50% 0; bottom: calc(var(--sb) + 84px); display: flex; gap: 8px; padding: 7px; border-radius: 24px; z-index: 30; }
.tool { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: #ffffff0d; font-size: 24px; transition: background .2s; }
.tool.on { background: linear-gradient(180deg, #3a8bff, #2f6ae8); box-shadow: 0 0 0 2px #9cc4ff inset, 0 8px 18px #2f7bff66; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 6px calc(var(--sb) + 8px); display: flex; z-index: 31; border-radius: 24px 24px 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
.tab { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: 800 11px var(--font); color: var(--muted); position: relative; }
.tab i { font-style: normal; font-size: 22px; filter: grayscale(.6); opacity: .75; transition: .2s; }
.tab.on { color: #fff; }
.tab.on i { filter: none; opacity: 1; transform: translateY(-2px); }
.tab.on::before { content: ""; position: absolute; top: -2px; width: 30px; height: 3px; border-radius: 3px; background: var(--warm); box-shadow: 0 0 12px var(--warm); }
.tab .dot { position: absolute; top: 4px; right: calc(50% - 22px); width: 10px; height: 10px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 2px #12151d; }

/* ---------- feuilles du bas ---------- */
#game:has(#sheet:not([hidden])) .tools { display: none; }
.shade { position: fixed; inset: 0; background: linear-gradient(180deg, #0b0d1200, #0b0d12aa 40%, #0b0d12ee); z-index: 28; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: calc(var(--st) + 140px); border-radius: 30px 30px 0 0; z-index: 29; padding: 10px 16px 0;
  background: linear-gradient(180deg, #171b27f7, #0f121bfc); border: 1px solid var(--line); border-bottom: 0; display: flex; flex-direction: column;
  animation: sheetUp .38s cubic-bezier(.2,1.25,.4,1); }
@keyframes sheetUp { from { transform: translateY(70%); } }
.grab { width: 44px; height: 5px; border-radius: 3px; background: #ffffff33; margin: 0 auto 10px; flex: none; }
.sheet-body { overflow-y: auto; flex: 1; padding-bottom: calc(var(--sb) + 100px); -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.sheet h2 { font-size: 24px; font-weight: 900; letter-spacing: -.02em; margin: 2px 0 4px; display: flex; align-items: center; gap: 8px; }
.sheet h3 { font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); margin: 18px 0 8px; }
.sheet .lead { color: var(--soft); font-size: 13px; font-weight: 600; line-height: 1.4; }
.card { background: #ffffff0a; border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-size: 15px; font-weight: 900; }
.row .t span { display: block; color: var(--soft); font-size: 12px; font-weight: 600; margin-top: 2px; }
.ico { width: 44px; height: 44px; border-radius: 14px; background: #ffffff12; display: grid; place-items: center; font-size: 24px; flex: none; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { aspect-ratio: 1; border-radius: 16px; background: #ffffff0d; border: 1px solid var(--line); display: grid; place-items: center; position: relative; font-size: 28px; }
.slot b { position: absolute; bottom: 4px; right: 7px; font: 900 13px var(--font); font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px #000; }
.slot.sel { border-color: var(--warm); box-shadow: 0 0 0 2px var(--warm) inset; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; border-radius: 99px; padding: 0 10px; display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 12px; background: #ffffff12; white-space: nowrap; }
.chip.miss { background: #ff4d6d26; color: #ffb3c1; }
.chip.ok { background: #34d39926; color: #a7f3d0; }
.q { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.q .it { flex: 1; min-width: 110px; height: 44px; border-radius: 12px; background: #ffffff0d; display: flex; align-items: center; gap: 6px; padding: 0 8px; font: 800 12px var(--font); position: relative; overflow: hidden; }
.q .it i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--warm); }
.q .it.ready { background: #34d3992a; color: #a7f3d0; }
.seg { display: flex; gap: 6px; background: #ffffff0a; padding: 4px; border-radius: 14px; margin: 10px 0; }
.seg button { flex: 1; height: 38px; border-radius: 10px; font: 800 13px var(--font); color: var(--soft); }
.seg button.on { background: #ffffff1a; color: #fff; }
.avs { display: flex; }
.avs .a { width: 34px; height: 34px; margin-left: -6px; }
.avs .a:first-child { margin-left: 0; }
.pav { width: 46px; height: 46px; border-radius: 15px; background: #1d2230; display: grid; place-items: center; position: relative; flex: none; }
.pav .av { width: 38px; height: 38px; margin-top: 4px; }
.pav.on::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px #12151d; }
.muted { color: var(--muted); }
.jr { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #ffffff10; font-size: 14px; font-weight: 600; line-height: 1.35; }
.jr .when { color: var(--muted); font-size: 11px; font-weight: 700; margin-top: 2px; }
.jr .e { font-size: 20px; width: 28px; text-align: center; flex: none; }

/* ---------- messages rapides ---------- */
.saymenu { position: fixed; top: calc(var(--st) + 124px); left: 12px; right: 12px; z-index: 32; border-radius: 22px; padding: 12px; animation: pop .2s; }
.saymenu .em { display: flex; gap: 6px; margin-bottom: 8px; }
.saymenu .em button { flex: 1; height: 46px; border-radius: 14px; background: #ffffff10; font-size: 24px; }
.saymenu .ph { display: flex; flex-wrap: wrap; gap: 6px; }
.saymenu .ph button { height: 38px; border-radius: 12px; background: #ffffff10; padding: 0 11px; font: 700 13px var(--font); }

/* ---------- toasts, bannières, modales ---------- */
.toasts { position: fixed; top: calc(var(--st) + 150px); left: 12px; right: 12px; z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: #12151df2; border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; font: 800 14px var(--font); box-shadow: 0 10px 30px #0008; animation: tin .35s cubic-bezier(.2,1.4,.4,1); max-width: 100%; display: flex; gap: 8px; align-items: center; }
.toast.bad { border-color: #ff4d6d66; }
.toast.good { border-color: #34d39966; }
.toast.out { animation: tout .3s forwards; }
@keyframes tin { from { transform: translateY(-30px); opacity: 0; } }
@keyframes tout { to { transform: translateY(-20px); opacity: 0; } }
.banner { position: fixed; top: calc(var(--st) + 8px); left: 50%; translate: -50% 0; z-index: 70; background: #ff9d2e; color: #2a1600; font: 900 13px var(--font); padding: 8px 14px; border-radius: 99px; box-shadow: 0 6px 20px #0008; }
.guestbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--sb) + 156px); z-index: 27; border-radius: 18px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; font: 700 13px var(--font); animation: pop .3s; }
.guestbar span { flex: 1; line-height: 1.3; }
.modal { position: fixed; inset: 0; z-index: 80; background: #05060acc; display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal .box { width: 100%; max-width: 400px; border-radius: 26px; padding: 20px; background: linear-gradient(180deg, #1b2030, #12151d); border: 1px solid var(--line); box-shadow: 0 30px 80px #000; animation: pop .3s cubic-bezier(.3,1.5,.6,1); }
.modal h3 { font-size: 22px; font-weight: 900; margin-bottom: 6px; letter-spacing: -.02em; }
.modal p { color: var(--soft); font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 14px; }
.field { display: block; width: 100%; height: 52px; border-radius: 15px; border: 1px solid var(--line); background: #0b0d12; padding: 0 14px; margin-bottom: 10px; outline: none; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #2f7bff33; }
.err { color: #ff8fa3; font: 700 13px var(--font); min-height: 18px; margin: -4px 0 8px; }
.loading { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 16px; background: radial-gradient(120% 80% at 50% 0%, #2a1650, #0b0d12 70%); color: var(--soft); font-weight: 800; transition: opacity .4s; }
.loading.gone { opacity: 0; pointer-events: none; }
.spin { width: 54px; height: 54px; border-radius: 18px; background: linear-gradient(135deg, #ffb347, #ff6b7f); box-shadow: 0 0 0 3px var(--ink), 0 10px 30px #ff6b7f66; animation: hop .7s ease-in-out infinite alternate; }
@keyframes hop { from { transform: translateY(0) scale(1.06, .92); } to { transform: translateY(-22px) scale(.95, 1.06); } }

/* ---------- accueil (lobby) ---------- */
.lobby { position: fixed; inset: 0; z-index: 40; overflow-y: auto; padding: calc(var(--st) + 24px) 18px calc(var(--sb) + 30px); touch-action: pan-y;
  background: radial-gradient(130% 70% at 50% 0%, #3a1d5ccc 0%, #1a1440cc 35%, #0b0d12f2 75%); }
.lobby .hero { text-align: center; margin: 10px 0 22px; }
.lobby .hero .logo { width: 120px; height: 104px; margin: 0 auto 6px; position: relative; }
.lobby .hero .logo .av { position: absolute; width: 74px; height: 74px; }
.lobby .hero .logo:has(.herocv) { width: 300px; height: 250px; margin: -18px auto 0; animation: heroIn .7s cubic-bezier(.2,1.3,.4,1); }
.herocv { display: block; filter: drop-shadow(0 18px 30px #0008); }
@keyframes heroIn { from { transform: translateY(24px) scale(.85); opacity: 0; } }
.lobby h1 { font-size: 32px; font-weight: 900; letter-spacing: -.03em; line-height: 1.05; }
.lobby h1 b { color: var(--warm); }
.lobby .hero p { color: var(--soft); font-weight: 600; margin-top: 8px; font-size: 15px; line-height: 1.4; }
.lobby h3 { font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); margin: 22px 0 10px; }
.vcard { width: 100%; text-align: left; border-radius: 22px; padding: 14px; display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.vcard .pic { width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(135deg, #86e05a, #3f9a3e); display: grid; place-items: center; font-size: 30px; box-shadow: inset 0 -6px 0 #0002; flex: none; }
.vcard .t { flex: 1; min-width: 0; }
.vcard .t b { display: block; font-size: 17px; font-weight: 900; }
.vcard .t span { display: block; color: var(--soft); font-size: 13px; font-weight: 600; margin-top: 3px; }
.vcard .go { font-size: 22px; color: var(--warm); }
.joinrow { display: flex; gap: 8px; }
.joinrow .field { margin: 0; text-transform: uppercase; letter-spacing: .2em; font-weight: 900; text-align: center; }
.invite-card { border-radius: 26px; padding: 20px; text-align: center; background: linear-gradient(160deg, #ff8a5b33, #b18cff22 60%, #0000); border: 1px solid #ffb34755; }
.invite-card .avs { justify-content: center; margin: 12px 0; }
.invite-card .avs .a { width: 52px; height: 52px; margin-left: -10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.small { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; line-height: 1.4; }
.link { color: var(--warm); font-weight: 800; text-decoration: underline; display: inline-block; padding: 12px 8px; margin: -12px -8px; } /* zone tactile ≥ 40 px */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- phase Contenu : composants des feuilles, mini-jeux, maison ---------- */
.vname small { opacity: .75; font-weight: 800; letter-spacing: .04em; }
.tab .dot.num { width: auto; min-width: 18px; height: 18px; padding: 0 5px; top: 0; font: 900 11px/18px var(--font); color: #fff; text-align: center; }
.goal { position: fixed; left: 50%; translate: -50% 0; bottom: calc(var(--sb) + 156px); z-index: 26; max-width: calc(100% - 32px); padding: 9px 16px; border-radius: 99px; font: 800 13px var(--font); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 24px #0007; animation: pop .3s; }
.goal::before { content: "🎯 "; }
#game:has(#sheet:not([hidden])) .goal { display: none; }
#game:has(#guestBar:not([hidden])) .goal { bottom: calc(var(--sb) + 214px); }
.seg.scroll { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; touch-action: pan-x; }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg.scroll button { flex: none; padding: 0 12px; white-space: nowrap; position: relative; }
.seg button i { position: absolute; top: 5px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #ff4d6d; }
.chipsel { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 10px; touch-action: pan-x; flex-wrap: wrap; }
.chipsel button { height: 36px; border-radius: 99px; padding: 0 12px; background: #ffffff10; font: 800 12px var(--font); color: var(--soft); white-space: nowrap; }
.chipsel button.on { background: linear-gradient(180deg, #ffc56b, #ff9d2e); color: #3a1d00; }
.card.dim { opacity: .55; }
.star { color: var(--gold); font-size: 11px; font-weight: 900; margin-left: 4px; }
.new { color: #a7f3d0; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; margin-left: 4px; }
.sheet h3 small { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--muted); }
.hero-card { background: linear-gradient(160deg, #ffb34722, #ff6b7f14 60%, #ffffff08); border-color: #ffb34744; }
.ico.big { width: 56px; height: 56px; font-size: 32px; border-radius: 18px; background: #ffffff1a; }
.steps { display: flex; gap: 6px; margin: 4px 0 8px; flex-wrap: wrap; }
.steps span { font: 800 11px var(--font); color: var(--muted); background: #ffffff0d; border-radius: 99px; padding: 4px 9px; }
.steps span.on { background: #34d39926; color: #a7f3d0; }
.steps span.cur { background: #ffb34733; color: #ffe0b8; }
.quote { font-style: italic; color: var(--soft); font-size: 13px; font-weight: 600; margin: 8px 0; }
.pav.npc { background: linear-gradient(135deg, #5b1f78, #2a1650); }
.linkchip { background: #2f7bff33; color: #cfe0ff; }
.colgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 6px; }
.colgrid span { aspect-ratio: 1; border-radius: 11px; background: #ffffff08; border: 1px dashed #ffffff22; display: grid; place-items: center; font-size: 18px; color: var(--muted); position: relative; }
.colgrid span.has { background: #34d39922; border: 1px solid #34d39955; }
.colgrid small { display: none; }
.room { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; padding: 10px; border-radius: 20px; margin: 10px 0;
  background: repeating-linear-gradient(45deg, #e8a86822 0 12px, #c07c4522 12px 24px), #2a1d16; border: 2px solid #c07c4566; }
.room .cell { aspect-ratio: 1; border-radius: 10px; background: #ffffff0a; border: 1px solid #ffffff14; font-size: 22px; display: grid; place-items: center; }
.room .cell.full { background: color-mix(in srgb, var(--bg) 45%, #1b1433); border-color: #ffffff33; }
.room .cell.sel { box-shadow: 0 0 0 2px var(--warm) inset; }
.gauge { position: relative; height: 34px; border-radius: 17px; background: linear-gradient(90deg, #1f8fd6, #3cc7f5); overflow: hidden; border: 2px solid #ffffff33; margin-top: 6px; }
.gauge .zone { position: absolute; top: 0; bottom: 0; background: linear-gradient(180deg, #4fe0a0, #20b97a); box-shadow: 0 0 18px #4fe0a0aa; }
.gauge .needle { position: absolute; top: -2px; bottom: -2px; width: 6px; margin-left: -3px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 2px #1b1433, 0 0 12px #fff; }
.btn.big { min-height: 60px; font-size: 18px; }
.qty { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0; }
.qty b { font: 900 22px var(--font); min-width: 70px; text-align: center; font-variant-numeric: tabular-nums; }
.grid.picker { grid-template-columns: repeat(6, 1fr); max-height: 150px; overflow-y: auto; }
.grid.picker .slot { font-size: 20px; border-radius: 12px; }
.grid.picker .slot b { font-size: 10px; right: 4px; bottom: 2px; }
.ribbon { text-align: center; font-size: 34px; animation: hop .6s ease-in-out infinite alternate; }
.card.gift { border-color: #ff8fab55; background: linear-gradient(160deg, #ff8fab1a, #ffffff06); }
.plaque { max-height: 50vh; overflow-y: auto; }
.plaque .row { margin: 6px 0; }
#hudBuff { font-size: 15px; }

/* ---------- phase Graphismes : juice de l'interface ---------- */
.fly { position: fixed; left: 0; top: 0; width: 28px; height: 28px; font-size: 24px; line-height: 28px; text-align: center; z-index: 65; pointer-events: none; filter: drop-shadow(0 3px 4px #0008); will-change: transform; }
.tab.gulp i { animation: gulp .35s cubic-bezier(.3,1.8,.5,1); }
@keyframes gulp { 40% { transform: translateY(-4px) scale(1.3); } }
.btn, .tool, .tab, .slot, .vcard, .bell { transition: transform .12s cubic-bezier(.3,1.6,.5,1), background .2s, box-shadow .2s; }
.btn:active:not(:disabled), .vcard:active { transform: scale(.94) translateY(2px); }
.btn.blue:active:not(:disabled) { box-shadow: 0 1px 0 #1b4fb8, 0 4px 12px #2f7bff44; }
.btn.warm:active:not(:disabled) { box-shadow: 0 1px 0 #c46a12, 0 4px 12px #ff9d2e44; }
.btn.green:active:not(:disabled) { box-shadow: 0 1px 0 #13804f, 0 4px 12px #20b97a44; }
.btn.pink:active:not(:disabled) { box-shadow: 0 1px 0 #b8264f, 0 4px 12px #ff4d7d44; }
.tool.on { animation: toolOn .3s cubic-bezier(.3,1.7,.5,1); }
@keyframes toolOn { 50% { transform: scale(1.12); } }
.sheet-body > * { animation: cardIn .35s cubic-bezier(.2,1.2,.4,1) both; }
.sheet-body > *:nth-child(2) { animation-delay: .03s; } .sheet-body > *:nth-child(3) { animation-delay: .06s; } .sheet-body > *:nth-child(4) { animation-delay: .09s; }
.sheet-body > *:nth-child(5) { animation-delay: .12s; } .sheet-body > *:nth-child(n+6) { animation-delay: .15s; }
@keyframes cardIn { from { transform: translateY(14px); opacity: 0; } }
.sheet-body.live > * { animation: none; }
.card { box-shadow: inset 0 1px 0 #ffffff0d; }
.hud .pill, .hud .me, .bell { box-shadow: 0 6px 18px #0005, inset 0 1px 0 #ffffff14; }
.tabs { box-shadow: 0 -10px 30px #0006; }
.tools { box-shadow: 0 10px 30px #0007, inset 0 1px 0 #ffffff12; }
.goal { box-shadow: 0 8px 22px #0006; animation: goalIn .5s cubic-bezier(.2,1.3,.4,1); }
@keyframes goalIn { from { transform: translateY(10px) scale(.9); opacity: 0; } }
#game:has(#sheet:not([hidden])) ~ .toasts, body:has(#sheet:not([hidden])) .toasts { top: auto; bottom: calc(var(--sb) + 92px); }
.sheet.closing { animation: sheetDown .18s ease-in forwards; pointer-events: none; }
.shade.closing { animation: fadeOut .18s forwards; pointer-events: none; }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes fadeOut { to { opacity: 0; } }

/* ---------- paysage (téléphone couché) : onglets et outils en pastilles compactes en bas, feuille centrée ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  .tabs { left: auto; right: max(10px, env(safe-area-inset-right)); bottom: max(6px, var(--sb)); padding: 4px; border-radius: 20px; border: 1px solid var(--line); gap: 2px; }
  .tab { flex: none; min-height: 42px; flex-direction: row; gap: 5px; padding: 0 10px; font-size: 11.5px; border-radius: 14px; }
  .tab i { font-size: 17px; }
  .tab.on { background: #ffffff10; }
  .tab.on::before { top: auto; bottom: -1px; width: 18px; height: 2px; }
  .tab .dot { top: 2px; right: 2px; }
  .tools { left: max(10px, env(safe-area-inset-left)); translate: 0 0; bottom: max(6px, var(--sb)); padding: 4px; gap: 4px; border-radius: 18px; }
  .tool { width: 42px; height: 42px; border-radius: 14px; font-size: 19px; }
  .vname { display: none; }
  .sheet { top: calc(var(--st) + 8px); left: 50%; right: auto; width: min(620px, 100vw - 24px); translate: -50% 0; bottom: 0; }
  .sheet-body { padding-bottom: calc(var(--sb) + 70px); }
  .goal { bottom: calc(max(6px, var(--sb)) + 56px) !important; }
}
/* zone verte de la jauge qui s'allume quand le curseur passe dedans */
.gauge .zone { transition: filter .08s; }
.gauge .zone.hot { filter: brightness(1.35) saturate(1.2); }

/* ---------- écran titre ---------- */
.title { position: fixed; inset: 0; z-index: 200; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(var(--st) + 24px) 16px calc(var(--sb) + 26px); cursor: pointer; justify-content: space-evenly;
  background: radial-gradient(130% 70% at 50% 100%, #ff9d5c 0%, #c2508a 30%, #4a2a8a 58%, #120f2b 85%); }
.title.out { animation: tOut .7s cubic-bezier(.6,0,.4,1) forwards; pointer-events: none; }
@keyframes tOut { to { opacity: 0; transform: scale(1.12); filter: blur(6px); } }
.t-sky { position: absolute; inset: 0; pointer-events: none; }
.t-sky b { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; animation: tw 3s ease-in-out infinite; }
@keyframes tw { 50% { opacity: .2; transform: scale(.6); } }
.t-sun { position: absolute; left: 50%; bottom: -26vh; width: 70vh; height: 70vh; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(circle, #ffe7a0 0%, #ffb86b 35%, #ff8a6b00 68%); animation: sunUp 2.4s cubic-bezier(.2,.8,.3,1) both; }
@keyframes sunUp { from { transform: translateY(30%); opacity: 0; } }
.t-cloud { position: absolute; height: 26px; border-radius: 20px; background: #ffffff24; filter: blur(1px); animation: drift 26s linear infinite; }
.t-cloud::before { content: ""; position: absolute; left: 22%; top: -14px; width: 46%; height: 30px; border-radius: 50%; background: inherit; }
.t-cloud.c1 { width: 120px; top: 22%; left: -130px; }
.t-cloud.c2 { width: 86px; top: 36%; left: -100px; animation-duration: 34s; animation-delay: -15s; opacity: .7; }
@keyframes drift { to { transform: translateX(calc(100vw + 260px)); } }
.t-petals { position: absolute; inset: 0; pointer-events: none; }
.t-petals i { position: absolute; top: -20px; width: 8px; height: 6px; border-radius: 6px 0 6px 0; background: var(--c); opacity: .85; animation: fall linear infinite; }
@keyframes fall { to { transform: translate(-60px, 110vh) rotate(720deg); } }
.t-mid { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 2vh; }
.t-isl { width: 300px; height: 250px; animation: isl 1s cubic-bezier(.2,1.4,.4,1) both, float 4.5s 1s ease-in-out infinite; }
.t-isl.boing { animation: boing .45s cubic-bezier(.3,1.8,.5,1); }
@keyframes isl { from { transform: translateY(60px) scale(.6); opacity: 0; } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes boing { 30% { transform: scale(1.08, .9); } 60% { transform: scale(.95, 1.06); } }
.t-name { text-align: center; line-height: .95; margin-top: -8px; color: #fff; text-shadow: 0 4px 0 #2a1650, 0 10px 30px #000a; }
.t-name span { display: block; font: 900 30px var(--font); letter-spacing: -.01em; color: #ffe8c2; }
.t-name b { display: block; font: 900 54px var(--font); letter-spacing: -.035em; color: #ffd27a; text-shadow: 0 3px 0 #ff7a6b, 0 6px 0 #6b2a4a, 0 14px 26px #000a; }
.t-name i { display: inline-block; font-style: normal; animation: letter .6s cubic-bezier(.2,1.6,.4,1) both, wave 3.2s 1.6s ease-in-out infinite; }
.t-name i.sp { width: .25em; animation: none; }
@keyframes letter { from { transform: translateY(-60px) scale(.4) rotate(-20deg); opacity: 0; } }
@keyframes wave { 0%, 100% { transform: none; } 8% { transform: translateY(-5px) rotate(-3deg); } 16% { transform: none; } }
.t-tag { margin-top: 14px; max-width: 300px; text-align: center; color: #ffe8f0; font: 700 15px/1.4 var(--font); text-shadow: 0 2px 10px #0008; animation: letter .8s 1.4s both; }
.t-go { position: relative; min-height: 58px; padding: 0 34px; border-radius: 99px; font: 900 17px var(--font); color: #3a1d00;
  background: linear-gradient(180deg, #ffd88a, #ff9d2e); box-shadow: 0 5px 0 #c46a12, 0 16px 34px #ff9d2e66; animation: letter .7s 1.8s both, pulse 1.6s 2.5s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.t-foot { color: #ffffff8c; font: 700 12px var(--font); letter-spacing: .08em; text-transform: uppercase; margin-top: 12px; }
.t-foot b { color: #fff; }
.title.rainbow .t-name b i { animation: letter .6s both, hue 1.2s linear infinite; }
.title.rainbow .t-name b i:nth-child(2n) { color: #7ee8ff; } .title.rainbow .t-name b i:nth-child(3n) { color: #9be86a; } .title.rainbow .t-name b i:nth-child(5n) { color: #ff8fab; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@media (max-height: 700px) { .t-isl { width: 240px; height: 200px; } .t-isl canvas { transform: scale(.8); transform-origin: 50% 30%; } .t-name b { font-size: 44px; } .t-name span { font-size: 24px; } }

/* ---------- tutoriel intégré ---------- */
.coach { position: fixed; left: 12px; right: 12px; bottom: calc(var(--sb) + 206px); z-index: 27; display: flex; gap: 11px; padding: 12px 13px; border-radius: 22px;
  box-shadow: 0 14px 34px #0008; border-color: #ffb34755; max-width: 460px; margin: 0 auto; }
.coach.pop { animation: pop .35s cubic-bezier(.3,1.6,.6,1); }
.coach.out { animation: fadeOut .3s forwards; }
.coach .c-av { width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(180deg, #ffc56b, #ff9d2e); display: grid; place-items: center; font-size: 24px; flex: none; animation: float 2.6s ease-in-out infinite; }
.coach .c-t { flex: 1; min-width: 0; }
.coach small { display: block; font: 900 10.5px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--warm); }
.coach .c-t > b { display: block; font: 900 15.5px var(--font); margin-top: 1px; }
.coach p b { color: #fff; }
.coach p { color: var(--soft); font: 600 12.5px/1.4 var(--font); margin-top: 3px; }
.coach .c-b { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.coach .c-wait { font: 800 12px var(--font); color: #9be86a; animation: tw 1.6s ease-in-out infinite; }
.coach .c-skip { margin-left: auto; min-height: 36px; padding: 0 6px; font: 700 12px var(--font); color: var(--muted); }
#game:has(#sheet:not([hidden])) .coach { display: none; }
.coach-hl { animation: hl 1.3s ease-in-out infinite !important; }
@keyframes hl { 50% { box-shadow: 0 0 0 4px #ffb347, 0 0 26px 6px #ffb347aa; } }
@media (orientation: landscape) and (max-height: 520px) { .coach { bottom: auto; top: calc(var(--st) + 10px); left: 50%; right: auto; translate: -50% 0; width: 340px; } }
.title .herocv { filter: none; }
