:root {
  --ink: #2b2230;
  --cream: #fff7e8;
  --paper: #f9efdc;
  --wood: #7a4a2a;
  --red: #d8312f;
  --green: #2f9a5e;
  --blue: #3a6fd8;
  --gold: #ffd34d;
  --glass: rgba(24, 18, 40, 0.55);
  --font: 'Baloo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b2252; font-family: var(--font); color: var(--ink); }
canvas#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 .4em; border-radius: 6px; background: var(--cream); color: var(--ink); font: 700 .85em var(--font); box-shadow: 0 2px 0 #c9b9a6; text-align: center; }

.btn { border: 0; border-radius: 14px; padding: .6em 1.2em; background: var(--red); color: #fff; font: 800 1rem var(--font); box-shadow: 0 4px 0 #8e1e1c; transition: transform .08s; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #8e1e1c; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { font-size: 1.15rem; padding: .7em 1.4em; }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 #c9b9a6; }

#loading { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; color: #fff; background: radial-gradient(#4a3f6b, #1c1736); z-index: 50; font-size: 1.3rem; }
#loading .flake { font-size: 4rem; animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
#login { position: fixed; inset: 0; display: flex; align-items: center; padding: 24px 5vw; pointer-events: none; z-index: 20; }
.login-card { pointer-events: auto; width: min(460px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--cream); border-radius: 26px; padding: 26px 26px 20px; box-shadow: 0 10px 0 #c9b9a6, 0 30px 60px rgba(0,0,0,.35); }
.brand-kicker { display: inline-block; background: var(--green); color: #fff; font-weight: 800; border-radius: 999px; padding: 2px 12px; font-size: .85rem; }
.brand h1 { margin: 6px 0 2px; font-size: 2.6rem; line-height: 1; color: var(--red); letter-spacing: -.5px; }
.brand p { margin: 8px 0 14px; color: #5b4e57; line-height: 1.35; font-size: .98rem; }
.field { display: block; font-weight: 800; margin-bottom: 10px; }
.field input { display: block; width: 100%; margin-top: 4px; font: 700 1.15rem var(--font); padding: .45em .7em; border-radius: 12px; border: 3px solid #e3d3bb; background: #fff; color: var(--ink); outline: none; }
.field input:focus { border-color: var(--gold); }
.editor .group { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; margin: 7px 0; }
.editor .group > span { font-weight: 700; color: #5b4e57; font-size: .92rem; }
.editor .row { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 26px; height: 26px; border-radius: 8px; border: 3px solid rgba(0,0,0,.08); padding: 0; }
.sw.on { border-color: var(--ink); transform: scale(1.12); }
.chip { border: 0; border-radius: 999px; padding: 2px 10px; background: #efe2cc; color: var(--ink); font: 700 .85rem var(--font); }
.chip.on { background: var(--ink); color: #fff; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; margin: 6px 0 0 104px; }
.actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.err { color: var(--red); font-weight: 700; min-height: 1.2em; margin: 6px 0 0; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; color: #fff; }
#daybox { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); text-align: center; background: var(--glass); backdrop-filter: blur(6px); border-radius: 18px; padding: 6px 18px; }
#day-label { font-weight: 800; font-size: 1.15rem; }
#day-sub { font-size: .9rem; opacity: .85; margin-top: -3px; }
#compass { position: absolute; top: 82px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: var(--glass); border-radius: 999px; padding: 2px 12px 2px 8px; font-weight: 700; font-size: .9rem; }
#compass-arrow { color: var(--gold); font-size: 1.2rem; transform-origin: 50% 50%; display: inline-block; rotate: -90deg; }
#topright { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; align-items: center; pointer-events: auto; }
#credits { background: var(--gold); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 800; }
.muted-s { font-size: .82rem; opacity: .7; }
#online { background: var(--glass); border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.pill { border: 0; width: 38px; height: 38px; border-radius: 12px; background: var(--glass); color: #fff; font: 800 1.05rem var(--font); }
.pill:hover { background: rgba(24,18,40,.8); }
#feed { position: absolute; top: 64px; right: 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.feed-line { background: var(--glass); border-radius: 10px; padding: 2px 10px; font-size: .92rem; transition: opacity .6s; }
.feed-line.out { opacity: 0; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); transition: width .12s, height .12s; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,.6); border-radius: 2px; }
#crosshair i:nth-child(1) { left: 50%; top: 0; width: 2px; height: 8px; margin-left: -1px; }
#crosshair i:nth-child(2) { left: 50%; bottom: 0; width: 2px; height: 8px; margin-left: -1px; }
#crosshair i:nth-child(3) { top: 50%; left: 0; height: 2px; width: 8px; margin-top: -1px; }
#crosshair i:nth-child(4) { top: 50%; right: 0; height: 2px; width: 8px; margin-top: -1px; }
#crosshair.aim { width: 16px; height: 16px; }
#crosshair.lock i { background: #ffd34d; }
#crosshair.lock { width: 20px; height: 20px; transform: translate(-50%, -50%) rotate(45deg); }
#crosshair.fire { width: 36px; height: 36px; }
#crosshair.hit i { background: #ff4d4d; }
#crosshair.hit { animation: hitm .35s ease-out; }
@keyframes hitm { 0% { transform: translate(-50%, -50%) rotate(45deg) scale(1.6); } 100% { transform: translate(-50%, -50%) rotate(45deg) scale(1); } }
#prompt { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); background: var(--cream); color: var(--ink); font-weight: 800; font-size: 1.1rem; padding: 8px 18px; border-radius: 16px; box-shadow: 0 5px 0 #c9b9a6; white-space: nowrap; }
#prompt .pulse { color: var(--red); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }
#chat { position: absolute; left: 14px; bottom: 14px; width: min(380px, 60vw); pointer-events: auto; }
#chat-log { max-height: 200px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.chat-line { background: var(--glass); border-radius: 10px; padding: 2px 10px; font-size: .92rem; align-self: flex-start; max-width: 100%; overflow-wrap: anywhere; }
.chat-line b { color: var(--gold); }
.chat-line.system { opacity: .75; font-style: italic; }
#chat-input { width: 100%; font: 600 .95rem var(--font); padding: 6px 12px; border-radius: 12px; border: 0; background: rgba(24,18,40,.35); color: #fff; outline: none; }
#chat-input::placeholder { color: rgba(255,255,255,.6); }
#chat.typing #chat-input { background: rgba(255,255,255,.92); color: var(--ink); }
#keys { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 50vw; }
#keys span { background: var(--glass); border-radius: 10px; padding: 2px 10px; font-size: .85rem; }
#keys kbd { font-size: .8rem; }
#clicktoplay { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); background: var(--glass); padding: 6px 16px; border-radius: 999px; font-weight: 700; pointer-events: auto; cursor: pointer; }
#hitflash { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(rgba(255,255,255,0) 30%, rgba(220,235,255,.9)); }
#hitflash span { font-size: 2.2rem; font-weight: 800; color: var(--ink); background: #fff; padding: 6px 20px; border-radius: 18px; }
#hitflash.go { animation: fadeout 1.6s forwards; }
@keyframes fadeout { 0% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; } }

#toasts { position: fixed; left: 50%; bottom: 32%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 40; pointer-events: none; }
.toast { background: var(--cream); color: var(--ink); padding: 6px 16px; border-radius: 14px; font-weight: 800; box-shadow: 0 4px 0 #c9b9a6; transition: opacity .5s, transform .5s; }
.toast.ok { background: #e2f7e9; }
.toast.err { background: #ffe1df; }
.toast.out { opacity: 0; transform: translateY(-10px); }

/* ---------- panels ---------- */
#panel, #board, #help { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; }
#panel { background: rgba(20, 14, 36, .45); }
#board { pointer-events: none; }
.panel-card, .board-card, .help-card { position: relative; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--cream); border-radius: 26px; padding: 24px; box-shadow: 0 10px 0 #c9b9a6, 0 30px 60px rgba(0,0,0,.35); }
.close { position: absolute; top: 12px; right: 12px; border: 0; background: #efe2cc; width: 36px; height: 36px; border-radius: 12px; font-size: 1rem; font-weight: 800; color: var(--ink); }
.panel-head { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; }
.door-num { flex: none; width: 74px; height: 74px; border-radius: 20px; display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; color: #fff; background: var(--vc); box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.panel-head h2 { margin: 2px 0 0; font-size: 1.6rem; line-height: 1.1; }
.tags { display: flex; gap: 8px; align-items: center; }
.tag { color: #fff; font-weight: 800; border-radius: 999px; padding: 0 10px; font-size: .85rem; }
.date { font-weight: 700; color: var(--wood); }
.fact { background: #fff; border-radius: 18px; padding: 4px 16px; border: 3px solid #f0e2cb; }
.fact p { line-height: 1.45; color: #4a3f47; }
.fact .hook { font-weight: 800; color: var(--ink); font-size: 1.08rem; }
.locked, .nogame { color: #5b4e57; font-size: 1.05rem; line-height: 1.45; }
.game { margin-top: 16px; background: #2b2252; color: #fff; border-radius: 20px; padding: 16px 18px; }
.game-head { display: flex; align-items: baseline; gap: 10px; }
.game-kind { background: var(--gold); color: var(--ink); font-weight: 800; border-radius: 999px; padding: 0 10px; font-size: .8rem; }
.game h3 { margin: 0; font-size: 1.35rem; }
.game .q { font-size: 1.08rem; line-height: 1.4; margin: 8px 0 10px; }
.game .phase { opacity: .85; margin: 6px 0; }
.game-img { max-width: 100%; border-radius: 14px; display: block; margin: 8px auto; }
.estimate { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.estimate input { flex: 1; min-width: 140px; font: 800 1.3rem var(--font); padding: .3em .6em; border-radius: 12px; border: 0; outline: 3px solid transparent; }
.estimate input:focus { outline-color: var(--gold); }
.unit { font-weight: 700; opacity: .85; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { border: 0; border-radius: 14px; padding: 12px; background: #fff; color: var(--ink); font: 800 1rem var(--font); box-shadow: 0 4px 0 #c9b9a6; }
.choice:hover { background: var(--gold); }
.done { background: rgba(255,255,255,.1); border-radius: 14px; padding: 10px 14px; font-size: 1.05rem; }
.done span { opacity: .8; font-size: .95rem; }
.result .winner { font-size: 1.15rem; background: rgba(255,211,77,.18); border-radius: 14px; padding: 8px 14px; }
.result .winner span { font-size: .9rem; opacity: .8; }
.wheel-wrap { position: relative; width: 300px; height: 300px; margin: 6px auto 12px; }
.wheel-wrap canvas { width: 100%; height: 100%; }
.wheel-pin { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid #fff; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.game .spin { display: block; margin: 0 auto; }
.shop { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prod { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; background: #fff; color: var(--ink); border-radius: 14px; padding: 6px 10px; }
.prod .emo { font-size: 1.5rem; }
.prod .pname { font-weight: 700; font-size: .92rem; line-height: 1.1; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 9px; border: 0; background: #efe2cc; font-weight: 800; font-size: 1rem; }
.qty b { min-width: 1.4em; text-align: center; }
.shop-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; flex-wrap: wrap; }
.prices { display: flex; flex-wrap: wrap; gap: 6px; }
.prices span { background: rgba(255,255,255,.12); border-radius: 10px; padding: 2px 10px; }

.board-card h3 { margin: 0 0 8px; font-size: 1.5rem; }
.board-card table { width: 100%; border-collapse: collapse; }
.board-card th, .board-card td { text-align: left; padding: 4px 8px; }
.board-card tbody tr:nth-child(odd) { background: #f4e7d1; }
.board-card tr.me { background: #ffe9a8 !important; }
.board-card ul { margin: 4px 0 0; padding-left: 18px; }
.help-card h3 { margin-top: 0; font-size: 1.5rem; }
.help-card li { margin: 6px 0; line-height: 1.5; }

@media (max-width: 900px) {
  #login { align-items: flex-end; justify-content: center; }
  .login-card { max-height: 62vh; }
}

#ko { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(rgba(255,255,255,0) 35%, rgba(225,238,255,.92)); animation: koin .35s ease-out; }
@keyframes koin { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
.ko-card { text-align: center; background: var(--cream); color: var(--ink); border-radius: 26px; padding: 18px 34px; box-shadow: 0 8px 0 #c9b9a6, 0 20px 50px rgba(0,0,0,.25); }
.ko-title { font-weight: 700; font-size: 1.2rem; color: #5b4e57; }
#ko-by { font-weight: 800; font-size: 2.6rem; color: var(--red); line-height: 1.1; }
.ko-sub { font-weight: 700; margin-top: 4px; }
#ko-count { font-size: 1.4rem; color: var(--blue); }

/* supérette */
#crosshair.hand i { display: none; }
#crosshair.hand::after { content: '✋'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 28px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
#crosshair.hand.can::after { content: '🤏'; font-size: 34px; }
#hand-tip { position: absolute; left: 50%; top: calc(50% + 30px); transform: translateX(-50%); background: var(--cream); color: var(--ink); font-weight: 800; padding: 2px 12px; border-radius: 10px; box-shadow: 0 3px 0 #c9b9a6; white-space: nowrap; }
#shop-hud { position: absolute; left: 14px; top: 14px; width: 270px; background: rgba(255,247,232,.95); color: var(--ink); border-radius: 18px; padding: 10px 14px; box-shadow: 0 5px 0 #c9b9a6; pointer-events: auto; }
.shop-top { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.5rem; }
#shop-time.hurry { color: var(--red); animation: pulse .5s infinite alternate; }
#shop-score { color: var(--green); }
#shop-total { font-size: 1.05rem; }
#shop-total .over { color: var(--red); }
.shop-barwrap { height: 10px; background: #efe2cc; border-radius: 999px; overflow: hidden; margin: 4px 0 6px; }
#shop-bar { height: 100%; width: 0; background: var(--green); transition: width .2s; }
#shop-bar.over { background: var(--red); }
#shop-cats { display: flex; flex-wrap: wrap; gap: 4px; font-size: .78rem; }
#shop-cats span { background: #efe2cc; border-radius: 999px; padding: 0 8px; }
#shop-cats span.ok { background: #c8f0d4; }
#shop-cats em { width: 100%; opacity: .7; }
#shop-map { display: block; width: 240px; height: 152px; border-radius: 10px; margin: 4px 0; image-rendering: auto; }
#shop-dept { font-size: .95rem; }
#shop-items i { font-style: normal; font-size: .7rem; background: #ffd34d; border-radius: 999px; padding: 0 5px; }
#shop-items { max-height: 22vh; overflow: auto; }
#wheel-hud { position: absolute; left: 14px; top: 14px; width: 260px; background: rgba(255,247,232,.95); color: var(--ink); border-radius: 18px; padding: 10px 14px; box-shadow: 0 5px 0 #c9b9a6; z-index: 3; }
#wheel-hud .wh-title { font-weight: 800; font-size: 1.35rem; }
#wheel-hud .wh-tries { display: flex; gap: 6px; margin: 4px 0 6px; }
#wheel-hud .wh-tries span { flex: 1; text-align: center; font-weight: 800; border-radius: 10px; padding: 2px 0; background: #efe2cc; }
#wheel-hud .wh-tries span.used { background: #ffd34d; }
#wheel-hud .muted { opacity: .7; font-size: .9rem; }
#wheel-hud .wh-help { font-size: .78rem; opacity: .75; margin-top: 4px; }
#shop-items { margin: 6px 0; padding-left: 18px; max-height: 160px; overflow: auto; font-size: .9rem; }
#shop-items .muted { opacity: .6; list-style: none; margin-left: -18px; }
.shop-help { font-size: .78rem; opacity: .8; }
#shop-result { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.go-store { display: block; margin: 8px auto 0; }

/* elves */
.elf-hint { margin-top: 14px; background: #e2f7e9; border-radius: 16px; padding: 10px 14px; line-height: 1.4; }
.elf-head { display: flex; gap: 14px; align-items: flex-start; }
.elf-face { flex: none; width: 70px; height: 70px; border-radius: 20px; background: #2f9a5e; display: grid; place-items: center; font-size: 2.6rem; box-shadow: 0 5px 0 #1e6b40; }
.elf-name { font-weight: 800; font-size: 1.3rem; color: #2f9a5e; }
.bubble { position: relative; background: #fff; border-radius: 16px; padding: 4px 14px; border: 3px solid #f0e2cb; margin-top: 4px; }
.bubble p { margin: 6px 0; line-height: 1.4; }

#credits.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.3); } }

/* ---------- new panel games ---------- */
.panel-card.wide { width: min(1080px, 100%); }
.team-card { background: #e9defa; border-radius: 14px; padding: 8px 12px; margin: 8px 0; }
.team-card span { opacity: .75; font-size: .9rem; }
.qboard { margin: 4px 0 10px; padding-left: 22px; }
.qboard li { margin: 2px 0; }
.qboard li span { opacity: .65; font-size: .85rem; }
.qboard-wrap h4, .panel-card h4 { margin: 12px 0 4px; }
.quiz { color: var(--ink, #2b2230); background: #fff; border-radius: 18px; padding: 12px 14px; margin: 8px 0; box-shadow: 0 4px 0 var(--line, #e8d9c0); }
.qtop { display: flex; justify-content: space-between; font-weight: 800; }
.qbar { height: 10px; background: #efe2cc; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.qbar i { display: block; height: 100%; width: 100%; background: #2f9a5e; transition: width .1s linear; }
.qbar i.hurry { background: #d8312f; }
.qq { font-weight: 700; font-size: 1.08rem; }
.choice.right { background: #c8f0d4 !important; border-color: #2f9a5e !important; }
.choice.wrong { background: #f6d0cc !important; border-color: #d8312f !important; }
.qres { font-weight: 800; font-size: 1.2rem; text-align: center; margin: 6px 0 0; }
.qres.ok { color: #2f9a5e; } .qres.ko { color: #d8312f; }
.cake-studio, .orn-studio { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; margin: 8px 0; }
.cake-cv { width: min(420px, 100%); aspect-ratio: 1; border-radius: 18px; touch-action: none; cursor: crosshair; box-shadow: 0 4px 0 #c9b9a6; }
.orn-cv { width: 220px; height: 220px; border-radius: 50%; touch-action: none; cursor: crosshair; box-shadow: inset -18px -18px 40px rgba(0,0,0,.25), 0 4px 0 #c9b9a6; }
.cake-tools { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.cake-tools .row { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.cake-tools .row b { width: 64px; font-size: .9rem; }
.chip { font: 700 .85rem inherit; font-family: inherit; border: 2px solid #e8d9c0; background: #fff; border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.chip.on { border-color: #2b2230; background: #ffd34d; }
.chip.base { background: var(--c); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #e8d9c0; cursor: pointer; padding: 0; }
.sw.on { border: 3px solid #2b2230; transform: scale(1.12); }
.cake-title { font: 600 1rem inherit; font-family: inherit; padding: 6px 10px; border-radius: 10px; border: 2px solid #e8d9c0; }
.hidden { display: none !important; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; background: #fff; border-radius: 14px; padding: 6px; text-align: center; box-shadow: 0 3px 0 #e8d9c0; }
.gallery figure.voted { outline: 3px solid #d8312f; }
.gallery img { width: 100%; border-radius: 10px; display: block; }
.gallery figcaption { font-size: .82rem; margin: 4px 0; }
.pz-head { display: flex; justify-content: space-between; font-weight: 800; margin: 6px 0; }
.pz { display: flex; gap: 12px; align-items: flex-start; }
.pz-board { width: min(640px, 70vw); border-radius: 12px; background: #2b2252; touch-action: none; }
.pz-board.shake { animation: shake .3s; }
.pz-tray { display: flex; flex-wrap: wrap; gap: 8px; width: 260px; align-content: flex-start; }
.pz-piece { width: 118px; height: auto; border-radius: 4px; cursor: grab; box-shadow: 0 3px 8px rgba(0,0,0,.3); touch-action: none; }
.pz-piece.taken { opacity: .3; }
.pz-ghost { position: fixed; z-index: 60; pointer-events: none; width: 118px; height: auto; transform: rotate(-4deg) scale(1.05); box-shadow: 0 10px 24px rgba(0,0,0,.45); cursor: grabbing; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.mine-balls .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.ball-thumb { position: relative; width: 56px; height: 56px; border-radius: 50%; background-size: cover; box-shadow: inset -8px -8px 16px rgba(0,0,0,.25); }
.ball-thumb .del { position: absolute; top: -6px; right: -6px; border: 0; border-radius: 50%; width: 22px; height: 22px; background: #2b2230; color: #fff; cursor: pointer; font-size: .7rem; }

/* storyteller elves dialogue */
#dialog { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); width: min(720px, calc(100vw - 32px)); z-index: 25; background: var(--cream, #fff7e8); color: var(--ink, #2b2230); border-radius: 22px; padding: 14px 20px 10px; box-shadow: 0 8px 0 #c9b9a6, 0 24px 48px rgba(0,0,0,.35); cursor: pointer; }
#dialog .dlg-name { font-weight: 800; font-size: 1.05rem; color: #7a4ad8; }
#dialog .dlg-name span { font-weight: 600; font-size: .8rem; opacity: .6; color: var(--ink, #2b2230); margin-left: 6px; }
#dialog .dlg-text { font-size: 1.15rem; font-weight: 600; min-height: 3.2em; margin: 6px 0; line-height: 1.4; }
#dialog .dlg-next { text-align: right; font-size: .8rem; opacity: .7; animation: pulse 1s infinite alternate; }
#dialog .dlg-next span { margin-left: 8px; }
.story-hint { background: #efe2f9; border-radius: 14px; padding: 8px 12px; }
#shop-items li.ok { color: #2f9a5e; text-decoration: line-through; }
#shop-items li.carry { color: #d88a1e; font-weight: 700; }
/* Secret Santa */
.gift-tabs .chip.on { background: #2b2252; color: #fff; }
.gift-cv { width: 100%; max-width: 480px; aspect-ratio: 3 / 2; border-radius: 12px; touch-action: none; cursor: crosshair; box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.gift-text { width: 100%; min-height: 70px; border-radius: 10px; border: 2px solid #e8d9c0; padding: 8px; font: 600 1rem 'Baloo 2', system-ui; margin-top: 8px; color: #2b2230; }
.sent { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.sent .del { border: 0; background: none; cursor: pointer; color: #d8312f; font-weight: 800; }
.gift-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.gift-box { width: 64px; height: 56px; border: 0; border-radius: 8px; background:
  linear-gradient(90deg, transparent 42%, #ffd34d 42% 58%, transparent 58%),
  linear-gradient(0deg, transparent 42%, #ffd34d 42% 58%, transparent 58%), var(--w); box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.gift-box.closed { cursor: pointer; animation: giftwiggle 1.6s infinite; }
.gift-box.opened { opacity: .35; animation: none; }
@keyframes giftwiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-6deg); } 90% { transform: rotate(6deg); } 95% { transform: rotate(-3deg); } }
.gift-card { background: #fff; border-radius: 14px; padding: 12px; color: #2b2230; animation: giftpop .4s ease-out; }
.gift-card img { width: 100%; border-radius: 10px; }
.gift-card p { font-size: 1.1rem; margin: 10px 0 4px; }
.gift-card .from { opacity: .75; }
@keyframes giftpop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- qui suis-je ---- */
.clues { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 6px; }
.clues li { background: #fff7e8; border: 2px solid #e8d9c0; border-radius: 12px; padding: 7px 12px; font-weight: 600; transition: opacity 0.4s, transform 0.4s; }
.clues li.hide { opacity: 0; transform: translateY(6px); height: 0; padding: 0 12px; border-width: 0; overflow: hidden; }
.who-form, .price-form { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.who-in { flex: 1; min-width: 180px; font: inherit; font-size: 18px; padding: 8px 12px; border-radius: 12px; border: 2px solid #c9b48f; }
.who-msg { text-align: center; margin: 6px 0 0; }
.who-msg .ko, .mem-msg .ko { color: #d8312f; }
.who-reveal { text-align: center; }
.who-reveal img { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; border: 4px solid #ffd34d; margin-top: 8px; animation: who-pop 0.5s ease-out; }
@keyframes who-pop { from { transform: scale(0.4) rotate(-12deg); opacity: 0; } }
/* ---- juste prix ---- */
.price-item { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0; font-size: 20px; }
.price-item img { max-width: 220px; max-height: 160px; border-radius: 12px; object-fit: contain; }
.price-emoji { font-size: 72px; line-height: 1; }
.price-pick { display: grid; gap: 8px; }
.price-range { width: 100%; accent-color: #d8312f; }
.price-in { width: 120px; font: inherit; font-size: 20px; padding: 6px 10px; border-radius: 12px; border: 2px solid #c9b48f; text-align: right; }
.center { text-align: center; }
/* ---- memory ---- */
.mem-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 8px; margin: 8px 0; perspective: 800px; }
.mem-card { aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; }
.mem-in { position: relative; width: 100%; height: 100%; transition: transform 0.35s; transform-style: preserve-3d; }
.mem-card.up .mem-in { transform: rotateY(180deg); }
.mem-back, .mem-face { position: absolute; inset: 0; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; backface-visibility: hidden; overflow: hidden; }
.mem-back { background: repeating-linear-gradient(45deg, #d8312f 0 10px, #b82724 10px 20px); color: #fff; font-size: 26px; border: 3px solid #fff7e8; box-shadow: 0 3px 0 #8a1c1a; }
.mem-card:hover:not(.up) .mem-back { filter: brightness(1.1); }
.mem-face { background: #fff7e8; border: 3px solid #e8d9c0; transform: rotateY(180deg); font-size: 34px; }
.mem-face img { width: 100%; height: 100%; object-fit: cover; }
.mem-face em { position: absolute; bottom: 2px; font-size: 11px; font-style: normal; background: rgba(255, 255, 255, 0.85); border-radius: 6px; padding: 0 4px; }
.mem-card.found .mem-face { border-color: #2f9a5e; box-shadow: 0 0 0 2px #2f9a5e inset; }
.mem-msg .ok { color: #2f9a5e; font-weight: 800; }
.memory { color: var(--ink, #2b2230); background: #fff; border-radius: 18px; padding: 12px 14px; margin: 8px 0; box-shadow: 0 4px 0 var(--line, #e8d9c0); }
#wheel-hud .wh-sub { font-size: 0.85rem; font-weight: 700; opacity: 0.8; margin-top: 2px; }
.slot-reels { display: flex; justify-content: center; gap: 8px; margin: 8px 0 4px; }
.slot-reels span { width: 64px; height: 64px; border-radius: 12px; background: #fff7e8; border: 3px solid #ffd34d; display: flex; align-items: center; justify-content: center; font-size: 38px; overflow: hidden; }
.slot-reels img { width: 100%; height: 100%; object-fit: contain; }
.slot-reels img.jp { object-fit: cover; }
