/* 7Earth — interface. Style « carton découpé » : aplats, contour encre épais, ombres dures. */
:root {
  --ink: #1b1a21; --paper: #f7f0de; --paper2: #eadfc4; --paper3: #d9cba8; --night: #14202b; --night2: #1f3140;
  --green: #2fbf71; --green-d: #1f9457; --ember: #ff7a3d; --red: #e5484d; --blue: #4aa8ff; --gold: #f1c232; --cyan: #5ee6e0;
  --r0: #3dbb5e; --r1: #3f8fe8; --r2: #a45fd6; --r3: #f1c232;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --nav: 62px; --top: 52px; --sh: 0 4px 0 var(--ink); --ui: 1;
  font-size: 16px;
}
:root[data-text="s"] { font-size: 14px; } :root[data-text="l"] { font-size: 18.5px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
body { font-family: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Nunito", "Segoe UI", system-ui, sans-serif; font-weight: 700; line-height: 1.3; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
.hidden { display: none !important; }
#sky { position: fixed; inset: 0; background: radial-gradient(120% 90% at 50% 35%, #3d6f87 0%, #24475c 45%, var(--night) 100%); transition: opacity .4s; }
body.ar #sky { opacity: 0; }
#cam { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
body.ar-cam #cam { display: block; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: none; }
#ui button, #ui input, #ui .panel, #ui .card, #ui #modal, #ui .hotbar, #ui #stick, #ui .title-wrap { pointer-events: auto; }

/* ---------- boutons */
.btn { min-height: 44px; min-width: 44px; padding: 0 16px; border: 3px solid var(--ink); border-radius: 13px; background: var(--paper); box-shadow: var(--sh); font-weight: 800; letter-spacing: .01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, box-shadow .08s, background .15s, filter .15s; position: relative; white-space: nowrap; }
.btn:active, .btn.down { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.go { background: var(--green); color: #07200f; } .btn.danger { background: var(--ember); } .btn.ar { background: var(--cyan); } .btn.gold { background: var(--gold); }
.btn.ghost { background: transparent; color: var(--paper); border-color: var(--paper); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.btn.big { min-height: 58px; font-size: 1.3rem; padding: 0 30px; border-radius: 16px; }
.btn.round { padding: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; }
.btn.pill { border-radius: 24px; padding: 0 16px; }
.btn svg { width: 20px; height: 20px; fill: var(--ink); image-rendering: pixelated; shape-rendering: crispEdges; }
.btn[disabled], .btn.off { filter: grayscale(.85) brightness(.85); opacity: .7; }
.btn.shake { animation: shake .28s; }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.btn:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- accueil */
#s-title { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: calc(16px + var(--sat)) 16px calc(22px + var(--sab)); background: linear-gradient(180deg, rgba(20,32,43,0) 30%, rgba(20,32,43,.82) 78%); }
.title-wrap { width: min(430px, 100%); text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.logo { margin: 0; display: flex; gap: 5px; justify-content: center; font-size: clamp(2rem, 10.5vw, 3.2rem); line-height: 1; }
.logo span { display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; border: 3px solid var(--ink); border-radius: 9px; box-shadow: 0 5px 0 var(--ink); font-weight: 900; color: var(--ink); animation: bob 2.4s ease-in-out infinite; }
.logo span:nth-child(1) { background: var(--ember); } .logo span:nth-child(2) { background: var(--green); animation-delay: .12s; } .logo span:nth-child(3) { background: #c49a5c; animation-delay: .24s; }
.logo span:nth-child(4) { background: #a9aeb5; animation-delay: .36s; } .logo span:nth-child(5) { background: var(--blue); animation-delay: .48s; } .logo span:nth-child(6) { background: var(--gold); animation-delay: .6s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.tagline { margin: 0; color: var(--paper); font-size: 1.02rem; text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.title-actions { display: flex; flex-direction: column; gap: 12px; width: min(300px, 100%); }
.credit { margin: 4px 0 0; color: #b8c7cf; font-size: .74rem; font-weight: 600; }

/* ---------- HUD */
.chip { background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 3px 0 var(--ink); padding: 3px 10px; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; font-size: .9rem; }
#hud-top { position: absolute; top: calc(8px + var(--sat)); left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; animation: slideDown .28s ease-out; }
@keyframes slideDown { from { transform: translateY(-60px); opacity: 0; } }
.chip.player { padding: 3px 12px 3px 3px; min-width: 0; text-align: left; }
.chip .lvl { width: 32px; height: 32px; border-radius: 50%; background: var(--green); border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 900; flex: none; }
.chip .lvl.bump { animation: pop .4s; }
.who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.who b { font-size: .84rem; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xpbar { width: clamp(64px, 22vw, 120px); height: 8px; border: 2px solid var(--ink); border-radius: 5px; background: var(--paper3); overflow: hidden; display: block; }
.xpbar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .5s cubic-bezier(.2,.9,.3,1); }
.chip.status { font-size: .76rem; padding: 3px 9px; min-height: 30px; margin-top: 3px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 20px; }
.chip.status:empty { display: none; }
.chip.eclats img { width: 22px; height: 22px; image-rendering: pixelated; }
.chip.eclats b.bump, .btn.item b.bump { animation: pop .35s; display: inline-block; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

#nav { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--nav) + var(--sab)); padding: 0 calc(6px + var(--sal)) var(--sab) calc(6px + var(--sar)); display: flex; background: var(--paper); border-top: 3px solid var(--ink); animation: slideUp .28s ease-out; }
@keyframes slideUp { from { transform: translateY(80px); } }
#nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; font-weight: 800; color: #6b6470; position: relative; min-height: 44px; }
#nav svg { width: 24px; height: 24px; fill: currentColor; shape-rendering: crispEdges; transition: transform .15s; }
#nav button.on { color: var(--ink); } #nav button.on svg { transform: translateY(-3px) scale(1.15); fill: var(--green-d); }
#nav button.on::after { content: ""; position: absolute; top: -3px; left: 22%; right: 22%; height: 5px; background: var(--green); border: 0 solid var(--ink); border-radius: 0 0 5px 5px; }
#nav button .dot { position: absolute; top: 8px; right: calc(50% - 20px); width: 12px; height: 12px; border-radius: 50%; background: var(--ember); border: 2px solid var(--ink); }

.screen.hud { position: absolute; inset: 0; }
.side { position: absolute; display: flex; flex-direction: column; gap: 10px; top: calc(var(--top) + 76px + var(--sat)); }
.side.right { right: calc(10px + var(--sar)); align-items: flex-end; } .side.left { left: calc(10px + var(--sal)); align-items: flex-start; }
.btn.item { padding: 0 9px 0 5px; gap: 3px; min-width: 58px; border-radius: 14px; } .btn.item img { width: 30px; height: 30px; image-rendering: pixelated; } .btn.item b { font-size: .9rem; min-width: 12px; }
.btn.tool { min-width: 78px; background: var(--paper2); } .btn.tool.on { background: var(--green); } #t-casser.on { background: var(--ember); }
.attrib { position: absolute; left: calc(8px + var(--sal)); bottom: calc(var(--nav) + var(--sab) + 4px); margin: 0; font-size: .62rem; color: rgba(255,255,255,.85); text-shadow: 0 1px 2px #000; font-weight: 600; }

/* manette de balade libre */
#stick { position: absolute; left: calc(18px + var(--sal)); bottom: calc(var(--nav) + var(--sab) + 26px); width: 104px; height: 104px; border-radius: 50%; background: rgba(247,240,222,.5); border: 3px solid var(--ink); touch-action: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }

/* flèches vers ce qui est hors de l'écran */
#arrows { position: absolute; inset: 0; pointer-events: none; }
.arrow { position: absolute; display: flex; align-items: center; gap: 4px; transform: translate(-50%, -50%); background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; padding: 2px 8px 2px 4px; font-size: .72rem; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.arrow i { width: 0; height: 0; border: 7px solid transparent; border-bottom: 12px solid var(--ink); display: block; }
.arrow.raid { background: #ffd0c0; } .arrow.exped { background: #d6ecff; }

/* carte d'action (expédition / raid à portée) */
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink); }
.card.action { position: absolute; left: max(calc(10px + var(--sal)), calc(50% - 190px)); right: max(calc(10px + var(--sar)), calc(50% - 190px)); bottom: calc(var(--nav) + var(--sab) + 16px); padding: 10px 12px; display: flex; align-items: center; gap: 10px; animation: cardIn .25s cubic-bezier(.2,1.3,.4,1); }
body.libre .card.action { left: max(calc(134px + var(--sal)), calc(50% - 190px)); }
@keyframes cardIn { from { transform: translateY(30px) scale(.9); opacity: 0; } }
.card.action .txt { flex: 1; min-width: 0; font-size: .86rem; } .card.action .txt small { display: block; font-weight: 600; color: #5c5560; font-size: .74rem; }
.rar { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border: 2px solid var(--ink); border-radius: 9px; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: #fff; vertical-align: middle; }
.rar.r0 { background: var(--r0); } .rar.r1 { background: var(--r1); } .rar.r2 { background: var(--r2); } .rar.r3 { background: var(--r3); color: var(--ink); }
.rar::before { content: ""; width: 7px; height: 7px; background: currentColor; display: inline-block; } .rar.r1::before { transform: rotate(45deg); } .rar.r2::before { border-radius: 50%; } .rar.r3::before { clip-path: polygon(50% 0, 65% 35%, 100% 35%, 72% 58%, 82% 100%, 50% 75%, 18% 100%, 28% 58%, 0 35%, 35% 35%); width: 10px; height: 10px; }

/* barre de blocs */
.hotbar { position: absolute; left: 0; right: 0; bottom: calc(var(--nav) + var(--sab) + 10px); display: flex; gap: 8px; padding: 6px calc(10px + var(--sar)) 8px calc(10px + var(--sal)); overflow-x: auto; touch-action: pan-x; scrollbar-width: none; scroll-snap-type: x proximity; }
.hotbar::-webkit-scrollbar { display: none; }
.slot { flex: none; width: 58px; height: 62px; background: var(--paper); border: 3px solid var(--ink); border-radius: 13px; box-shadow: 0 4px 0 var(--ink); position: relative; padding: 0; scroll-snap-align: center; transition: transform .12s, background .12s; }
.slot img { width: 44px; height: 44px; image-rendering: pixelated; display: block; margin: 2px auto 0; }
.slot b { position: absolute; right: 4px; bottom: 1px; font-size: .78rem; background: var(--paper); border-radius: 6px; padding: 0 3px; }
.slot.on { background: #fff3b8; transform: translateY(-7px); } .slot.on::after { content: ""; position: absolute; left: 50%; bottom: -13px; width: 10px; height: 10px; margin-left: -5px; background: var(--ink); transform: rotate(45deg); }
.slot.empty { opacity: .45; }
.hotbar .hint { align-self: center; color: var(--paper); text-shadow: 0 2px 0 rgba(0,0,0,.5); font-size: .86rem; padding: 0 8px; white-space: normal; }

/* réalité augmentée */
#ar-bar { position: absolute; left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); top: calc(10px + var(--sat)); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#ar-bar .ar-ctl { margin-left: auto; display: flex; gap: 8px; } #ar-hint { font-size: .78rem; max-width: 100%; white-space: normal; }
body.ar #hud-top, body.ar #nav, body.ar #build-side, body.ar #c-ar, body.ar .attrib { display: none !important; }
body.ar .hotbar { bottom: calc(14px + var(--sab)); } body.ar .side.left { top: calc(120px + var(--sat)); }

/* ---------- combat */
.c-top { position: absolute; top: calc(8px + var(--sat)); left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); display: flex; gap: 8px; align-items: flex-start; }
body.ar .c-top { top: calc(64px + var(--sat)); }
.objective { flex: 1; max-width: 420px; margin: 0 auto; }
.obj-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--paper); text-shadow: 0 2px 0 rgba(0,0,0,.6); font-size: .86rem; padding: 0 4px 2px; } .obj-name span { font-size: .76rem; font-weight: 700; }
.bar { height: 22px; border: 3px solid var(--ink); border-radius: 12px; background: #3b2d33; position: relative; overflow: hidden; box-shadow: 0 3px 0 var(--ink); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: left; }
.bar .ghost { background: #fff; transition: transform .5s .3s ease-in; } .bar .fill { background: linear-gradient(180deg, #ff8fa3, var(--red)); transition: transform .12s; }
.bar.boss .fill { background: linear-gradient(180deg, #ffb26b, var(--ember)); } .bar.low .fill { animation: pulse .5s infinite alternate; }
@keyframes pulse { to { filter: brightness(1.5); } }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .74rem; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.bar.hit { animation: barhit .18s; } @keyframes barhit { 50% { transform: scale(1.03, 1.2); filter: brightness(1.6); } }
.hearts { display: flex; gap: 4px; position: absolute; left: 0; right: 0; top: 56px; justify-content: center; }
.c-top::after { content: ""; width: 46px; flex: none; }
.hearts i { width: 18px; height: 16px; background: var(--red); clip-path: polygon(50% 100%, 0 45%, 0 18%, 18% 0, 38% 0, 50% 14%, 62% 0, 82% 0, 100% 18%, 100% 45%); filter: drop-shadow(0 2px 0 var(--ink)); transition: transform .2s, background .2s; }
.hearts i.off { background: #4b3d44; transform: scale(.8); } .hearts i.lost { animation: pop .4s; }
.banner { position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%); background: var(--ink); color: var(--paper); padding: 10px 26px; border-radius: 14px; font-size: 1.35rem; font-weight: 900; letter-spacing: .03em; text-align: center; border: 3px solid var(--paper); white-space: nowrap; animation: bannerIn .3s cubic-bezier(.2,1.4,.4,1); max-width: 92vw; }
.banner small { display: block; font-size: .8rem; font-weight: 700; color: var(--gold); white-space: normal; }
.banner.out { animation: bannerOut .22s ease-in forwards; }
@keyframes bannerIn { from { transform: translate(-150%, -50%) skewX(-12deg); opacity: 0; } } @keyframes bannerOut { to { transform: translate(60%, -50%) skewX(-12deg); opacity: 0; } }
.combo { position: absolute; right: calc(16px + var(--sar)); top: 38%; text-align: center; color: var(--paper); text-shadow: 0 3px 0 var(--ink); transform: rotate(6deg); }
.combo b { display: block; font-size: 2.4rem; line-height: 1; font-weight: 900; color: var(--gold); -webkit-text-stroke: 2px var(--ink); } .combo span { font-size: .78rem; } .combo.bump b { animation: pop .25s; }
.c-actions { position: absolute; right: calc(14px + var(--sar)); bottom: calc(22px + var(--sab)); display: flex; gap: 12px; align-items: flex-end; }
.btn.act { width: 64px; height: 64px; border-radius: 50%; padding: 0; flex-direction: column; gap: 0; font-size: .7rem; overflow: hidden; }
.btn.act img { width: 30px; height: 30px; image-rendering: pixelated; } .btn.act b { font-size: .8rem; }
.btn.act.skill { width: 84px; height: 84px; background: var(--cyan); } .btn.act.skill svg { width: 30px; height: 30px; } .btn.act.skill.full { background: var(--gold); animation: glow 0.7s infinite alternate; }
@keyframes glow { to { box-shadow: 0 4px 0 var(--ink), 0 0 0 6px rgba(241,194,50,.5); } }
.btn.act .cd { position: absolute; inset: 0; background: rgba(27,26,33,.62); transform-origin: bottom; transform: scaleY(0); pointer-events: none; }
#c-ar { position: absolute; left: calc(12px + var(--sal)); bottom: calc(22px + var(--sab)); }

/* nombres flottants */
#floats { position: absolute; inset: 0; overflow: hidden; }
.fl { position: absolute; font-weight: 900; font-size: 1.15rem; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; transform: translate(-50%, -50%); animation: fl .75s ease-out forwards; white-space: nowrap; will-change: transform, opacity; }
.fl.crit { font-size: 1.7rem; color: var(--gold); } .fl.block { font-size: .85rem; color: #b9bdc4; } .fl.heal { color: #7dffa8; } .fl.hurt { color: #ff7a7a; font-size: 1.4rem; } .fl.loot { color: #fff; font-size: 1rem; }
@keyframes fl { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 18% { transform: translate(-50%, -90%) scale(1.25); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx, 0px)), -260%) scale(1); opacity: 0; } }

/* messages */
#toasts { position: absolute; left: 0; right: 0; margin: 0 auto; top: calc(var(--top) + 26px + var(--sat)); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 380px); }
.toast { background: var(--ink); color: var(--paper); border-radius: 14px; padding: 8px 14px; font-size: .86rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; animation: toastIn .25s cubic-bezier(.2,1.3,.4,1); border: 2px solid var(--paper); max-width: 100%; text-align: center; }
.toast.out { animation: toastOut .2s ease-in forwards; } .toast.bad { background: #5b1d22; } .toast.good { background: #14452a; }
.toast img { width: 22px; height: 22px; image-rendering: pixelated; } .toast .it { display: inline-flex; align-items: center; gap: 2px; }
@keyframes toastIn { from { transform: translateY(-16px) scale(.85); opacity: 0; } } @keyframes toastOut { to { transform: translateY(-10px); opacity: 0; } }
.toast.legend { background: linear-gradient(100deg, #6a4a00, #c99a1c, #6a4a00); background-size: 200% 100%; animation: toastIn .25s, shimmer 1.4s linear infinite; color: #fff; }
@keyframes shimmer { to { background-position: -200% 0; } }

#coach { position: fixed; left: 12px; right: 12px; margin: 0 auto; width: fit-content; bottom: calc(var(--nav) + var(--sab) + 148px); background: var(--gold); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); padding: 8px 14px; font-size: .9rem; max-width: min(88vw, 360px); text-align: center; animation: bob 1.6s ease-in-out infinite; }
body.ar #coach { bottom: calc(110px + var(--sab)); }
body.fight #coach { bottom: calc(126px + var(--sab)); }

/* ---------- panneaux (sac, profil) */
.panel { position: absolute; left: 0; right: 0; top: calc(var(--top) + 14px + var(--sat)); bottom: calc(var(--nav) + var(--sab)); background: var(--paper); border-top: 3px solid var(--ink); border-radius: 22px 22px 0 0; padding: 12px calc(14px + var(--sar)) 24px calc(14px + var(--sal)); overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; animation: panelIn .22s ease-out; user-select: text; -webkit-user-select: text; }
@keyframes panelIn { from { transform: translateY(40px); opacity: 0; } }
.panel h2 { margin: 6px 0 10px; font-size: 1.15rem; font-weight: 900; } .panel h3 { margin: 18px 0 8px; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: #5c5560; }
.panel p { font-weight: 600; margin: 6px 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; position: sticky; top: -12px; background: var(--paper); padding: 8px 0; z-index: 2; }
.tabs button { flex: 1; min-height: 42px; border: 3px solid var(--ink); border-radius: 12px; background: var(--paper2); font-weight: 800; transition: background .15s, transform .1s; } .tabs button.on { background: var(--gold); box-shadow: 0 3px 0 var(--ink); transform: translateY(-2px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 9px; }
.cell { background: #fff9ea; border: 3px solid var(--ink); border-radius: 13px; padding: 5px 3px 4px; text-align: center; position: relative; font-size: .68rem; min-height: 96px; display: flex; flex-direction: column; align-items: center; animation: cellIn .25s backwards; }
@keyframes cellIn { from { transform: scale(.7); opacity: 0; } }
.cell img { width: 46px; height: 46px; image-rendering: pixelated; } .cell b { position: absolute; right: 4px; top: 2px; font-size: .84rem; } .cell span { line-height: 1.1; margin-top: 2px; overflow-wrap: anywhere; }
.cell::before { content: ""; position: absolute; left: 4px; top: 4px; width: 9px; height: 9px; background: var(--r0); border: 2px solid var(--ink); }
.cell.r1::before { background: var(--r1); transform: rotate(45deg); } .cell.r2::before { background: var(--r2); border-radius: 50%; } .cell.r3::before { background: var(--r3); width: 12px; height: 12px; border: 0; clip-path: polygon(50% 0, 65% 35%, 100% 35%, 72% 58%, 82% 100%, 50% 75%, 18% 100%, 28% 58%, 0 35%, 35% 35%); }
.cell.unknown img { filter: brightness(0) opacity(.28); } .cell.unknown span { color: #9a9198; }
.recipe { display: flex; align-items: center; gap: 8px; background: #fff9ea; border: 3px solid var(--ink); border-radius: 13px; padding: 7px 8px; margin-bottom: 9px; flex-wrap: wrap; }
.recipe .ins { display: flex; gap: 8px; align-items: center; flex: 1 1 190px; flex-wrap: wrap; min-width: 120px; } .recipe .it { display: inline-flex; align-items: center; gap: 2px; font-size: .84rem; } .recipe .it.miss { color: var(--red); }
.recipe img { width: 32px; height: 32px; image-rendering: pixelated; } .recipe .arrowr { font-weight: 900; } .recipe .out { display: inline-flex; align-items: center; gap: 3px; min-width: 76px; }
.recipe .btn { min-height: 40px; padding: 0 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; } .row > .grow { flex: 1; min-width: 0; }
.stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; } .stat div { background: #fff9ea; border: 3px solid var(--ink); border-radius: 12px; padding: 6px 10px; font-size: .78rem; } .stat b { display: block; font-size: 1.2rem; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; margin: 8px 0; } .field input[type=text], .field input[type=password] { min-height: 46px; border: 3px solid var(--ink); border-radius: 12px; padding: 0 12px; background: #fff; font-weight: 700; user-select: text; -webkit-user-select: text; width: 100%; }
input[type=range] { width: 100%; accent-color: var(--green-d); min-height: 34px; }
.seg { display: inline-flex; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; } .seg button { border: 0; background: var(--paper2); min-height: 40px; padding: 0 14px; font-weight: 800; } .seg button + button { border-left: 3px solid var(--ink); } .seg button.on { background: var(--gold); }
.swatches { display: flex; gap: 8px; } .swatches button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--ink); padding: 0; } .swatches button.on { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
.note { font-size: .78rem; color: #5c5560; font-weight: 600; }

/* ---------- fenêtres */
#modal { position: absolute; inset: 0; background: rgba(12,18,26,.72); display: flex; align-items: center; justify-content: center; padding: calc(14px + var(--sat)) 14px calc(14px + var(--sab)); animation: fadeIn .18s; z-index: 30; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { background: var(--paper); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 7px 0 var(--ink); width: min(430px, 100%); max-height: 100%; overflow-y: auto; touch-action: pan-y; padding: 16px 16px 14px; animation: sheetIn .26s cubic-bezier(.2,1.35,.4,1); text-align: center; user-select: text; -webkit-user-select: text; }
#modal.out { animation: fadeOut .14s forwards; } #modal.out .sheet { animation: sheetOut .14s ease-in forwards; }
@keyframes sheetIn { from { transform: scale(.8) translateY(20px); opacity: 0; } } @keyframes sheetOut { to { transform: scale(.9); opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.sheet h2 { margin: 2px 0 8px; font-size: 1.3rem; font-weight: 900; } .sheet p { font-weight: 600; margin: 8px 0; } .sheet .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; } .sheet .btns .btn { flex: 1; min-width: 120px; }
.sheet .left { text-align: left; }
.sheet .btn.ghost { color: var(--ink); border-color: var(--ink); box-shadow: none; background: transparent; }
.stars { display: flex; justify-content: center; gap: 8px; margin: 8px 0; } .stars i { width: 46px; height: 46px; background: var(--paper3); clip-path: polygon(50% 0, 63% 35%, 100% 38%, 71% 61%, 80% 100%, 50% 78%, 20% 100%, 29% 61%, 0 38%, 37% 35%); }
.stars i.on { background: var(--gold); animation: starIn .45s cubic-bezier(.2,1.6,.4,1) backwards; } @keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.loot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; } .loot .it { background: #fff9ea; border: 3px solid var(--ink); border-radius: 12px; padding: 3px 8px 3px 4px; display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; animation: cellIn .3s backwards; } .loot img { width: 30px; height: 30px; image-rendering: pixelated; }
.top5 { text-align: left; margin: 8px auto; max-width: 260px; font-size: .88rem; } .top5 div { display: flex; justify-content: space-between; padding: 3px 6px; border-bottom: 2px dashed var(--paper3); }
#fade { position: absolute; inset: 0; background: var(--night); opacity: 0; pointer-events: none !important; transition: opacity .22s; z-index: 40; } #fade.on { opacity: 1; }
#fade.flash { background: #b3131b; opacity: .38; transition: none; }
#qa { position: absolute; left: 6px; bottom: calc(var(--nav) + var(--sab) + 6px); font: 600 11px/1.3 ui-monospace, monospace; color: #9effa0; background: rgba(0,0,0,.6); padding: 4px 6px; border-radius: 6px; white-space: pre; z-index: 50; }

@media (max-height: 520px) {            /* téléphone en paysage : tout est plus compact */
  :root { --nav: 50px; --top: 44px; }
  #nav button span { display: none; } .side { gap: 6px; top: calc(var(--top) + 14px + var(--sat)); } #coach { position: static; margin: 0; font-size: .82rem; padding: 5px 12px; animation: none; } .btn { min-height: 40px; } .btn.round { width: 42px; height: 42px; }
  .slot { width: 50px; height: 54px; } .slot img { width: 38px; height: 38px; } #stick { width: 88px; height: 88px; }
  #s-title { align-items: center; justify-content: flex-end; padding-right: calc(5vw + var(--sar)); background: linear-gradient(90deg, rgba(20,32,43,0) 30%, rgba(20,32,43,.85) 70%); } .title-wrap { width: min(340px, 48vw); gap: 8px; } .logo { font-size: clamp(1.6rem, 5vw, 2.6rem); } .tagline { font-size: .86rem; } .title-actions { gap: 8px; } .btn.big { min-height: 48px; }
  .banner { top: 34%; font-size: 1.1rem; } .btn.act.skill { width: 70px; height: 70px; } .btn.act { width: 56px; height: 56px; }
  .card.action { bottom: calc(var(--nav) + var(--sab) + 8px); }
}
@media (min-width: 900px) { .panel { left: 50%; right: auto; width: 760px; transform: translateX(-50%); border: 3px solid var(--ink); border-bottom: 0; } @keyframes panelIn { from { transform: translateX(-50%) translateY(40px); opacity: 0; } } }
@media (prefers-reduced-motion: reduce) { .logo span, #coach { animation: none; } }
:root[data-motion="0"] .logo span, :root[data-motion="0"] #coach, :root[data-motion="0"] .btn.act.skill.full { animation: none; }
:root[data-motion="0"] .banner, :root[data-motion="0"] .sheet, :root[data-motion="0"] .toast, :root[data-motion="0"] .card.action { animation-duration: .01s; }
