:root { --violet:#8B3FE0; --violet-d:#5B2AA6; --navy:#14183A; --bg:#f3ecff; --ink:#1b1b2f; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; font-family: system-ui, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); overflow:hidden; }
.hidden { display:none !important; }
.screen { position:fixed; inset:0; }
.center { display:flex; overflow-y:auto; padding:12px; background: radial-gradient(circle at 30% 20%, #c9a6ff 0%, #8B3FE0 45%, #3a1c6b 100%); }
.center > .card { margin:auto; }
.card { background:#fff; border-radius:22px; padding:28px 30px; width:min(400px, 92vw); box-shadow:0 20px 60px rgba(20,24,58,.35); }
.logo { font-size:34px; font-weight:900; color:var(--violet); letter-spacing:-1px; text-align:center; }
.tagline { text-align:center; color:#6a6a86; margin:4px 0 18px; }
.tabs { display:flex; gap:6px; background:#efe8fb; padding:4px; border-radius:12px; margin-bottom:14px; }
.tab { flex:1; border:0; background:transparent; padding:9px; border-radius:9px; font-weight:700; color:#6a6a86; cursor:pointer; font-size:14px; }
.tab.active { background:#fff; color:var(--violet-d); box-shadow:0 1px 4px rgba(0,0,0,.12); }
label { display:block; font-size:13px; font-weight:700; color:#44445f; margin-bottom:12px; }
input[type=text], input[type=password] { display:block; width:100%; margin-top:5px; padding:11px 13px; border:2px solid #e2d8f5; border-radius:11px; font-size:15px; outline:none; background:#fbf9ff; }
input:focus { border-color: var(--violet); }
.btn { border:0; border-radius:12px; padding:12px 18px; font-weight:800; font-size:15px; cursor:pointer; }
.btn.primary { background: var(--violet); color:#fff; width:100%; box-shadow:0 4px 0 var(--violet-d); }
.btn.primary:active { transform: translateY(2px); box-shadow:0 2px 0 var(--violet-d); }
.btn.big { padding:15px; font-size:17px; margin-top:6px; }
.msg { min-height:20px; margin-top:10px; font-size:14px; font-weight:600; }
.msg.err { color:#c62839; } .msg.ok { color:#1f8f55; }
.small { font-size:12px; color:#7a7a96; font-weight:500; }
.card .small { text-align:center; margin:14px 0 0; }

.create-layout { display:flex; height:100%; background: linear-gradient(160deg,#efe4ff,#d9c3ff); }
.preview-wrap { flex:1; position:relative; min-width:0; }
#preview { width:100%; height:100%; display:block; cursor:grab; touch-action:none; }
.preview-hint { position:absolute; left:0; right:0; bottom:18px; text-align:center; color:#5b2aa6; font-weight:600; opacity:.75; font-size:14px; }
.panel { width:min(430px, 46vw); background:#fff; padding:22px 26px; overflow:auto; box-shadow:-10px 0 40px rgba(20,24,58,.18); }
.panel h2 { margin:0 0 6px; color:var(--violet-d); font-size:26px; }
.group { margin:14px 0; }
.group h3 { margin:0 0 8px; font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:#6a6a86; }
.seg { display:flex; gap:8px; flex-wrap:wrap; }
.seg button { flex:1; min-width:90px; border:2px solid #e2d8f5; background:#fbf9ff; border-radius:11px; padding:10px 8px; font-weight:700; cursor:pointer; color:#44445f; font-size:14px; }
.seg button.sel { border-color:var(--violet); background:#efe4ff; color:var(--violet-d); }
.swatches { display:flex; gap:9px; flex-wrap:wrap; }
.sw { width:38px; height:38px; border-radius:50%; border:3px solid #fff; box-shadow:0 0 0 2px #d6cbea; cursor:pointer; padding:0; }
.sw.sel { box-shadow:0 0 0 3px var(--violet); transform:scale(1.1); }

#game { position:absolute; inset:0; width:100%; height:100%; display:block; outline:none; cursor:grab; touch-action:none; }
#hud-top { position:absolute; top:12px; left:12px; display:flex; gap:8px; align-items:center; }
.pill { background:rgba(20,24,58,.72); color:#fff; padding:8px 14px; border-radius:999px; font-weight:700; font-size:14px; backdrop-filter: blur(4px); }
.btn-pill { border:0; cursor:pointer; background:rgba(139,63,224,.9); }
#world-map { position:absolute; inset:0; z-index:40; background:rgba(15,24,42,.72); display:grid; place-items:center; padding:16px; }
.map-card { width:min(660px,96vw); max-height:96vh; overflow:auto; padding:16px; border-radius:20px; background:#fffaf1; box-shadow:0 20px 60px #10182780; }
.map-card header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.map-card h2 { margin:0 0 10px; color:var(--violet-d); }
#map-canvas { display:block; width:min(100%, min(72vh,600px)); aspect-ratio:1; margin:auto; border:5px solid #7b5a43; border-radius:12px; background:#a5d687; }
.map-card p { margin:10px 0 0; text-align:center; font-weight:700; }
.map-dot { display:inline-block; width:13px; height:13px; border-radius:50%; margin:0 5px 0 18px; vertical-align:middle; }
.map-dot.me { background:#ed5a55; } .map-dot.other { background:#7542c9; }
.help { position:absolute; top:12px; right:12px; background:rgba(255,255,255,.82); padding:10px 14px; border-radius:14px; font-size:12.5px; line-height:1.6; max-width:340px; }
#chat { position:absolute; z-index:6; left:12px; bottom:12px; width:min(430px, 92vw); display:flex; flex-direction:column; gap:6px; pointer-events:none; }
#chat-panel { max-height:250px; overflow:hidden; border:1px solid rgba(225,232,255,.45); border-radius:16px; background:linear-gradient(145deg,rgba(24,31,65,.88),rgba(48,35,84,.82)); box-shadow:0 10px 30px rgba(18,22,46,.22); backdrop-filter:blur(12px); color:#fff; pointer-events:auto; transition:opacity .28s ease,transform .28s ease,max-height .28s ease,border-color .28s ease; }
#chat.faded #chat-panel { max-height:0; opacity:0; transform:translateY(8px); border-color:transparent; border-width:0; pointer-events:none; }
.chat-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 9px 5px 13px; font-size:12px; font-weight:800; letter-spacing:.02em; color:#f4e9ff; border-bottom:1px solid rgba(255,255,255,.14); }
#chat-pin { border:1px solid rgba(255,255,255,.3); border-radius:999px; padding:5px 9px; background:rgba(255,255,255,.12); color:#fff; font-size:11px; font-weight:700; font-family:inherit; cursor:pointer; }
#chat-pin:hover, #chat-pin[aria-pressed="true"] { background:#d9b8ff; border-color:#d9b8ff; color:#34204d; }
#chat-reopen { display:none; align-self:flex-start; border:1px solid rgba(255,255,255,.65); border-radius:999px; padding:7px 12px; background:rgba(29,34,73,.72); color:#fff; font-size:12px; font-weight:700; font-family:inherit; box-shadow:0 4px 12px rgba(20,24,58,.18); cursor:pointer; pointer-events:auto; }
#chat.faded #chat-reopen { display:block; }
#chat-log { max-height:176px; overflow-y:auto; padding:6px 8px 8px; font-size:13px; color:#fff; line-height:1.35; scrollbar-width:thin; scrollbar-color:#bba4e0 transparent; }
#chat-log .line { margin:3px 0; padding:5px 7px; border-radius:8px; background:rgba(255,255,255,.07); word-wrap:break-word; }
#chat-log .name { font-weight:800; color:#d8b8ff; } #chat-log .name.me { color:#ffe08a; }
#chat-log .sys { color:#d9f5ff; background:rgba(84,178,218,.18); border-left:2px solid #72d5ef; }
#chat-form { pointer-events:auto; } #chat-form input { margin:0; background:rgba(255,255,255,.94); border:1px solid rgba(255,255,255,.7); border-radius:12px; box-shadow:0 5px 16px rgba(20,24,58,.16); }
.overlay { position:absolute; inset:0; background:rgba(20,24,58,.7); display:flex; align-items:center; justify-content:center; }
.overlay .card { text-align:center; }

@media (max-width: 760px) { .create-layout { flex-direction:column; } .panel { width:100%; height:55%; } .help { display:none; } }

/* ===== phase 2 : garde-robe, emotes ===== */
.seg.compact button { min-width:0; flex:0 1 auto; padding:7px 11px; font-size:13px; }
#emote-bar { position:absolute; left:50%; bottom:14px; transform:translateX(-50%); display:flex; gap:8px; }
.emote-btn { border:0; background:rgba(255,255,255,.9); color:var(--violet-d); font-weight:800; padding:9px 16px; border-radius:999px; cursor:pointer; font-size:14px; box-shadow:0 2px 8px rgba(20,24,58,.25); }
.emote-btn:hover { background:#fff; }
#wardrobe { position:absolute; top:58px; right:12px; bottom:12px; width:min(450px, 96vw); background:rgba(255,255,255,.97); border-radius:20px; box-shadow:0 12px 40px rgba(20,24,58,.35); display:flex; flex-direction:column; overflow:hidden; }
#wardrobe header { display:flex; align-items:center; gap:10px; padding:12px 16px 4px; }
#wardrobe h2 { margin:0; flex:1; color:var(--violet-d); font-size:20px; }
#wardrobe .pill { background:#efe4ff; color:var(--violet-d); font-size:13px; padding:5px 12px; }
.btn-x { border:0; background:#efe4ff; color:var(--violet-d); width:30px; height:30px; border-radius:50%; cursor:pointer; font-weight:800; }
.wd-preview-wrap { height:230px; flex:none; background:linear-gradient(160deg,#efe4ff,#d9c3ff); margin:6px 14px; border-radius:14px; overflow:hidden; }
#wd-preview { width:100%; height:100%; display:block; cursor:grab; touch-action:none; }
#wd-tabs { display:flex; gap:4px; padding:4px 14px; flex-wrap:wrap; }
.wd-tab { border:0; background:#f1eafc; color:#5b2aa6; font-weight:700; font-size:12.5px; padding:6px 10px; border-radius:9px; cursor:pointer; }
.wd-tab.active { background:var(--violet); color:#fff; }
#wd-body { flex:1; overflow-y:auto; padding:6px 16px 14px; }
.wd-group { margin:10px 0; } .wd-group h4 { margin:0 0 6px; font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:#6a6a86; }
.wd-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); gap:8px; margin:8px 0; }
.wd-card { border:2px solid #e2d8f5; border-radius:12px; padding:8px 9px; cursor:pointer; background:#fbf9ff; min-height:66px; }
.wd-card:hover { border-color:#b793f0; }
.wd-card.worn { border-color:var(--violet); background:#efe4ff; }
.wd-card.selected { box-shadow:0 0 0 3px rgba(139,63,224,.35); }
.wd-card.locked { opacity:.5; cursor:not-allowed; filter:grayscale(.8); }
.wd-name { font-weight:800; font-size:13px; line-height:1.2; }
.wd-state { font-size:11.5px; color:#6a6a86; margin-top:2px; } .wd-card.worn .wd-state { color:var(--violet-d); font-weight:700; }
.wd-price { font-size:12px; margin-top:6px; color:#6a6a86; }
.wd-dots { display:flex; gap:4px; margin-top:5px; } .wd-dot { width:14px; height:14px; border-radius:50%; border:1.5px solid rgba(0,0,0,.2); }
.wd-editor { border-top:2px dashed #e2d8f5; margin-top:10px; padding-top:8px; }
.wd-editor-head { display:flex; justify-content:space-between; align-items:center; }
.btn-small { border:0; background:var(--violet); color:#fff; font-weight:700; border-radius:9px; padding:6px 14px; cursor:pointer; }
.small-sw .sw { width:26px; height:26px; border-width:2px; }
.wd-pick { width:30px; height:28px; padding:0; border:0; background:none; cursor:pointer; }
.wd-hint { text-align:left !important; }
.wd-open .help { display:none; }
.wd-open #chat { width:min(380px, 40vw); }

/* ===== 2.1.0 : écrans tactiles ===== */
html, body { overscroll-behavior:none; -webkit-tap-highlight-color:transparent; }
#screen-game { touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
#screen-game input { user-select:text; -webkit-user-select:text; }
#wd-body, #chat-log { touch-action:pan-y; overscroll-behavior:contain; }
#touch-ui { display:none; }
.screen { height:100vh; height:100dvh; }
@media (pointer:coarse) { input[type=text], input[type=password] { font-size:16px; } }
body.touch input[type=text], body.touch input[type=password] { font-size:16px; }
@media (max-height:520px) {
  .panel { padding:12px 18px; } .panel h2 { font-size:20px; } .group { margin:8px 0; } .card { padding:18px 22px; } .logo { font-size:28px; } .tagline { margin-bottom:10px; }
}

body.touch #touch-ui { display:block; position:absolute; inset:0; pointer-events:none; z-index:5; }
body.touch #screen-game.wd-open #touch-ui, body.chat-open #touch-ui { display:none; }
#joy { position:absolute; left:max(18px, env(safe-area-inset-left)); bottom:max(24px, env(safe-area-inset-bottom)); width:148px; height:148px; border-radius:50%;
  background:rgba(255,255,255,.22); border:3px solid rgba(255,255,255,.55); box-shadow:0 4px 16px rgba(20,24,58,.25); pointer-events:auto; touch-action:none; }
#joy-knob { position:absolute; left:50%; top:50%; width:64px; height:64px; margin:-32px 0 0 -32px; border-radius:50%; background:rgba(139,63,224,.85); border:3px solid rgba(255,255,255,.85); pointer-events:none; }
#touch-btns { position:absolute; right:max(14px, env(safe-area-inset-right)); bottom:max(20px, env(safe-area-inset-bottom)); width:230px; height:250px; pointer-events:none; }
.tbtn { position:absolute; width:64px; height:64px; border-radius:50%; border:2px solid rgba(255,255,255,.7); background:rgba(20,24,58,.55); color:#fff; pointer-events:auto; touch-action:none;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; padding:0; font-weight:800; font-family:inherit; box-shadow:0 3px 10px rgba(20,24,58,.3); backdrop-filter:blur(3px); }
.tbtn i { font-style:normal; font-size:22px; line-height:1; } .tbtn span { font-size:10.5px; line-height:1.1; text-align:center; }
.tbtn:active { background:rgba(139,63,224,.9); transform:scale(.94); }
.tbtn-main { width:80px; height:80px; right:0; bottom:0; background:rgba(139,63,224,.78); } .tbtn-main i { font-size:28px; }
#tb-sit { right:92px; bottom:4px; } #tb-wave { right:6px; bottom:94px; } #tb-wardrobe { right:82px; bottom:100px; width:60px; height:60px; } #tb-chat { right:6px; bottom:170px; width:60px; height:60px; }
/* 2.13.0 : le Sac quitte le bord gauche du groupe (trop près du joystick) et passe au-dessus de Chat ; Parler au-dessus de Garde-robe */
#tb-bag { right:6px; bottom:240px; width:60px; height:60px; }
#fridge-action { position:absolute; left:50%; bottom:100px; transform:translateX(-50%); z-index:12; border:2px solid #fff; border-radius:999px; background:#237db6; color:#fff; padding:12px 18px; font-weight:800; cursor:pointer; }
#water-bag { position:absolute; right:12px; top:58px; width:min(380px,96vw); max-height:calc(100vh - 70px); overflow:auto; z-index:31; padding:18px; border-radius:18px; background:#fffdf8; box-shadow:0 15px 45px #10182780; }
#water-bag header { display:flex; justify-content:space-between; align-items:center; } #water-bag h2 { margin:0 0 16px; color:var(--violet-d); }
/* .bag-item : marqueur des emplacements remplis (2.11.0) */ .bag-item strong { color:#1973a8; }
.bag-actions { display:flex; gap:7px; flex-wrap:wrap; margin:14px 0; } .bag-actions button, #bag-give-list button, #throw-fire { border:0; border-radius:10px; padding:10px 14px; background:var(--violet); color:#fff; font-weight:800; cursor:pointer; }
.bag-actions button:disabled { opacity:.45; cursor:default; } #bag-give-list { display:grid; gap:7px; } #bag-msg { min-height:20px; font-size:13px; font-weight:700; }
#throw-aim { position:absolute; inset:0; z-index:25; touch-action:none; cursor:crosshair; color:#fff; text-shadow:0 2px 6px #000; } #throw-aim.orienting { cursor:grabbing; } #throw-aim span { position:absolute; transform:translate(-50%,-50%); pointer-events:none; font-size:64px; line-height:1; } #throw-aim small { position:absolute; left:50%; bottom:112px; transform:translateX(-50%); width:max-content; max-width:92vw; text-align:center; background:#101827a8; padding:8px 12px; border-radius:8px; pointer-events:none; } #throw-fire { position:absolute; left:50%; transform:translateX(-50%); bottom:48px; }
body.touch #water-bag { inset:0; width:100%; max-height:none; border-radius:0; padding:max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); }
body.touch #fridge-action { bottom:225px; max-width:55vw; font-size:12px; }

body.touch #hud-top { top:max(10px, env(safe-area-inset-top)); left:max(10px, env(safe-area-inset-left)); gap:6px; flex-wrap:wrap; max-width:calc(100vw - 20px); }
body.touch .pill { padding:6px 11px; font-size:13px; }
body.touch #btn-wardrobe, body.touch #hud-help, body.touch #emote-bar { display:none; }
body.touch #btn-logout { min-height:36px; }
body.touch #chat { left:max(10px, env(safe-area-inset-left)); top:calc(max(10px, env(safe-area-inset-top)) + 46px); bottom:auto; width:min(54vw, 360px); pointer-events:none; }
body.touch #chat-panel { pointer-events:auto; }
body.touch #chat-log { max-height:min(24vh, 150px); font-size:13px; pointer-events:auto; }
body.touch #chat-form { display:none; }
body.touch.chat-open #chat { position:fixed; left:0; right:0; top:0; width:auto; padding:max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left)); background:rgba(20,24,58,.85); pointer-events:auto; z-index:20; }
body.touch.chat-open #chat-form { display:block; }
body.touch.chat-open #chat-log { max-height:28vh; }
body.touch #chat-input { height:46px; }

/* garde-robe : feuille plein écran sur mobile (écran étroit ou tactile) */
@media (max-width:760px) { #wardrobe { top:0; right:0; bottom:0; left:0; width:100%; border-radius:0; } .create-layout { overflow:hidden; } }
body.touch #wardrobe { top:0; right:0; bottom:0; left:0; width:100%; border-radius:0; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); z-index:30; }
body.touch .wd-preview-wrap { height:min(230px, 32vh); }
body.touch .btn-x { width:44px; height:44px; font-size:16px; } body.touch .wd-tab { padding:10px 12px; font-size:13.5px; } body.touch .wd-card { min-height:72px; }
body.touch .wd-grid { grid-template-columns:repeat(auto-fill, minmax(104px, 1fr)); }
body.touch .wd-pick { width:44px; height:40px; } body.touch .small-sw .sw { width:34px; height:34px; }
@media (max-width:760px) and (orientation:portrait) { .preview-wrap { min-height:38%; } .panel { height:62%; } }
@media (orientation:landscape) and (max-height:520px) { .create-layout { flex-direction:row; } .panel { width:min(430px, 56vw); height:100%; } .preview-wrap { min-height:0; } }
#tb-wardrobe span { font-size:9.5px; letter-spacing:-.2px; }

/* ===== 2.2.0 : administration en jeu (comptes admin) ===== */
.badge { background:#d6303a; color:#fff; border-radius:999px; font-size:12px; padding:1px 8px; margin-left:4px; font-weight:800; }
#btn-admin.has-pending { background:#d6303a; animation:ad-pulse 1.6s ease-in-out infinite; }
@keyframes ad-pulse { 50% { box-shadow:0 0 0 6px rgba(214,48,58,.3); } }
#admin-panel { position:absolute; top:58px; right:12px; bottom:12px; width:min(450px, 96vw); background:rgba(255,255,255,.97); border-radius:20px; box-shadow:0 12px 40px rgba(20,24,58,.35); display:flex; flex-direction:column; overflow:hidden; z-index:12; }
#admin-panel header { display:flex; align-items:center; gap:10px; padding:12px 16px 4px; }
#admin-panel h2 { margin:0; flex:1; color:var(--violet-d); font-size:20px; }
#ad-tabs { display:flex; gap:4px; padding:4px 14px; flex-wrap:wrap; }
#ad-body { flex:1; overflow-y:auto; padding:6px 16px 14px; touch-action:pan-y; overscroll-behavior:contain; }
.ad-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid #eee6fb; }
.ad-who { flex:1; min-width:0; display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; } .ad-who b { font-size:15px; overflow-wrap:anywhere; } .ad-who small { flex-basis:100%; color:#7a7a96; font-size:11.5px; }
.ad-act { display:flex; gap:6px; flex:none; }
.btn-small.ok { background:#2e9e5b; } .btn-small.no { background:#d6303a; }
.tag { font-size:11px; font-weight:800; border-radius:999px; padding:2px 8px; background:#eee; color:#444; } .tag.pending { background:#fff0c9; color:#7a5200; } .tag.approved { background:#d9f5e3; color:#1d6b3c; } .tag.rejected { background:#fde0e2; color:#9b1c25; }
.ad-gift { display:flex; flex-direction:column; gap:10px; margin:8px 0; }
.ad-gift select { padding:11px 12px; border:2px solid #e2d8f5; border-radius:11px; font-size:15px; background:#fbf9ff; font-family:inherit; }
.ad-gift .btn-small { padding:11px 14px; font-size:15px; }
.muted { color:#7a7a96; }
#ad-body .msg { margin-top:10px; min-height:20px; } #ad-body .msg.ok { color:#1d6b3c; font-weight:700; } #ad-body .msg.err { color:#b3202a; font-weight:700; }
#admin-toast { position:absolute; top:max(56px, calc(env(safe-area-inset-top) + 50px)); left:50%; transform:translateX(-50%); max-width:min(92vw, 420px); z-index:40; border:2px solid #fff; background:#5B2AA6; color:#fff; padding:12px 18px; border-radius:14px; font-weight:800; font-size:14px; line-height:1.3; font-family:inherit; cursor:pointer; box-shadow:0 10px 30px rgba(0,0,0,.35); animation:ad-pop .25s ease-out; }
@keyframes ad-pop { from { transform:translateX(-50%) translateY(-12px); opacity:0; } }
.ad-open .help { display:none; }
@media (max-width:760px) { #admin-panel { top:0; right:0; bottom:0; left:0; width:100%; border-radius:0; } }
body.touch #admin-panel { top:0; right:0; bottom:0; left:0; width:100%; border-radius:0; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); z-index:30; }
body.touch #screen-game.ad-open #touch-ui { display:none; }
body.touch #btn-admin { min-height:38px; }
body.touch .ad-act .btn-small { min-height:44px; min-width:76px; font-size:14px; }
body.touch .ad-gift select { min-height:48px; font-size:16px; }
body.touch #ad-tabs .wd-tab { padding:10px 12px; font-size:13.5px; }

/* ===== 2.3.0 : reconnexion silencieuse ===== */
#net-banner { position:fixed; top:max(10px, env(safe-area-inset-top)); left:50%; transform:translateX(-50%); z-index:60; background:rgba(20,24,58,.88); color:#fff; padding:8px 16px; border-radius:999px; font-weight:700; font-size:14px; pointer-events:none; }

/* ===== 2.4.0 : cinéma ===== */
#cinema-layer { position:absolute; inset:0; overflow:hidden; pointer-events:none; background:#000; }
#cinema-bg { position:absolute; inset:0; background:#000; }
#cinema-frame { position:absolute; left:0; top:0; width:1280px; height:720px; border:0; background:#000; transform-origin:0 0; pointer-events:none; }
#vol-pop { position:absolute; top:58px; left:12px; z-index:15; width:min(300px, 90vw); background:rgba(255,255,255,.96); border-radius:14px; padding:12px 14px; box-shadow:0 8px 28px rgba(20,24,58,.35); }
#vol-pop label { display:flex; justify-content:space-between; font-weight:800; font-size:14px; color:var(--violet-d); margin:0 0 8px; }
#vol-pop input[type=range] { width:100%; height:32px; margin:0; accent-color:var(--violet); touch-action:pan-x; }
#vol-pop small { display:block; margin-top:6px; color:#6a6a86; font-size:12px; line-height:1.35; }
body.touch #vol-pop { top:calc(max(10px, env(safe-area-inset-top)) + 46px); left:max(10px, env(safe-area-inset-left)); }
#btn-sound { position:absolute; left:50%; bottom:max(70px, calc(env(safe-area-inset-bottom) + 60px)); transform:translateX(-50%); z-index:18; border:2px solid #fff; background:#d6303a; color:#fff; font-weight:800; font-size:16px; padding:12px 20px; border-radius:999px; cursor:pointer; box-shadow:0 8px 24px rgba(0,0,0,.4); font-family:inherit; }
#cinema-hint { display:none; position:absolute; left:50%; bottom:max(14px, env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:8; background:rgba(0,0,0,.6); color:#fff; padding:8px 16px; border-radius:999px; font-size:13px; font-weight:600; pointer-events:none; white-space:nowrap; }
#cinema-hint .t { display:none; }
body.cinema-view #cinema-hint { display:block; } body.cinema-view.touch #cinema-hint { display:none; }
body.cinema-view #hud-help, body.cinema-view #emote-bar, body.cinema-view #chat { display:none; }
body.cinema-view #joy, body.cinema-view #tb-jump, body.cinema-view #tb-wave, body.cinema-view #tb-wardrobe, body.cinema-view #tb-bag, body.cinema-view #tb-chat { display:none; }
body.cinema-view.touch #hud-top { opacity:.85; }
#ad-cin-form label { display:block; } #ad-cin-form select, #ad-cin-form input[type=text] { width:100%; } #ad-cin-vol { display:block; width:100%; height:32px; margin:6px 0 0; accent-color:var(--violet); }
#ad-amb-vol-lab { display:block; margin-top:12px; font-weight:700; } #ad-amb-vol { display:block; width:100%; height:32px; margin:6px 0 0; accent-color:var(--violet); } #ad-amb-switch { margin-bottom:8px; }
#ad-dn-mpd-lab,#ad-dn-hour-lab { display:block; margin-top:12px; font-weight:700; } #ad-dn-mpd { width:6em; margin-left:8px; } #ad-dn-hour { display:block; width:100%; height:32px; margin:6px 0 0; accent-color:var(--violet); } #ad-dn-switch,#ad-dn-pause,#ad-dn-clear { margin:0 8px 8px 0; }

/* ===== 2.4.1 : mode « aide son » (iOS : le son ne démarre que sur un toucher dans l'iframe) ===== */
body.cinema-tw #cinema-layer, body.cinema-tw.cinema-assist #cinema-layer { z-index: 6; background: transparent; } /* au-dessus de #touch-ui (z 5, transparent mais recouvrant : Twitch le prend pour un obstacle et refuse de démarrer) */
body.cinema-tw #cinema-bg { display: none; }
body.cinema-tw #cinema-frame { pointer-events: auto; transform-origin: 0 0; }
.tw-away { visibility: hidden !important; }
body.cinema-tw #screen-game { background: #000; } /* 2.4.3 : Twitch passe devant le canvas (lecteur réellement visible, sinon pas d'autoplay) */
body.cinema-assist #cinema-layer { z-index: 4; background: transparent; }
body.cinema-assist #cinema-bg { display: none; }
body.cinema-assist #cinema-frame { pointer-events: auto; }
body.cinema-assist #btn-sound { bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 54px); background: #1d6fe0; max-width: 92vw; }
body.touch #btn-sound { bottom: max(170px, calc(env(safe-area-inset-bottom) + 160px)); }
body.touch.cinema-assist #btn-sound { bottom: auto; }

body.cinema-assist #joy, body.cinema-assist #tb-jump, body.cinema-assist #tb-wave, body.cinema-assist #tb-wardrobe, body.cinema-assist #tb-bag, body.cinema-assist #tb-chat { display:none; } /* le lecteur agrandi reste entièrement touchable */
body.cinema-assist #screen-game, body.cinema-view #screen-game { background:#000; } /* zones transparentes du canvas (ciel au-dessus de la salle) : noir, pas le fond de page */

/* 2.5.0 : chat vocal de proximité */
#voice-pill { font-size:13px; } #voice-pill.live { background:#d6303a; }
#tb-mic { right:82px; bottom:170px; width:60px; height:60px; } #tb-mic.live { background:rgba(214,48,58,.92); }
body.cinema-assist #tb-mic { display:none; }
body.cinema-view #tb-mic { right:164px; bottom:4px; width:64px; height:64px; z-index:5; } /* 2.6.2 : assis au cinéma, « Parler » à côté de « Se lever » */
/* 2.10.0 : salle de jeux */
#table-action, #arcade-action, #board-action, #shuttle-action, #scooter-action, #scooter-claim { position:absolute; left:50%; bottom:150px; transform:translateX(-50%); z-index:12; border:2px solid #fff; border-radius:999px; background:#2f6b4f; color:#fff; padding:12px 18px; font-weight:800; box-shadow:0 6px 18px rgba(0,0,0,.25); cursor:pointer; }
body.touch #table-action, body.touch #arcade-action, body.touch #board-action, body.touch #shuttle-action, body.touch #scooter-action, body.touch #scooter-claim { bottom:280px; max-width:70vw; font-size:13px; }
#gt-overlay { position:fixed; inset:0; z-index:60; display:flex; flex-direction:column; background:#10261c; }
#gt-overlay .gt-bar { flex:0 0 auto; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:max(8px, env(safe-area-inset-top)) 12px 8px; background:#2f6b4f; color:#fff; font-size:16px; }
#gt-stand { border:2px solid #fff; border-radius:999px; background:#fff; color:#2f6b4f; font-weight:800; padding:10px 18px; font-size:15px; cursor:pointer; min-height:44px; }
#gt-body { flex:1 1 auto; overflow:auto; position:relative; -webkit-overflow-scrolling:touch; }
#gt-body > div { min-height:100%; }
#gt-chess #btn-fullscreen, #gt-chess [data-mode="2player"], #gt-chess .board-controls, #gt-chess .mode-panel h2 { display:none !important; }
#gt-chess .mode-buttons { grid-template-columns:1fr !important; }
body.game-open #joy, body.game-open .tbtn, body.game-open #chat, body.game-open #hud-help { display:none !important; }
#gt-overlay #gt-body [hidden] { display:none; }
/* 2.11.0 : sac générique avec miniatures */
.visually-hidden { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.bag-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; margin-bottom:12px; }
.bag-slot { position:relative; aspect-ratio:1; border-radius:12px; border:2px solid #d9cfe6; background:#f3eff8; display:flex; align-items:center; justify-content:center; padding:6px; cursor:pointer; }
.bag-slot.empty { cursor:default; background:#f8f6fb; border-style:dashed; }
.bag-slot.selected { border-color:var(--violet-d); background:#e8f6fc; box-shadow:0 0 0 3px rgba(124,58,237,.18); }
.bag-slot img { max-width:78%; max-height:78%; object-fit:contain; pointer-events:none; }
.bag-slot .qty { position:absolute; right:4px; bottom:2px; min-width:22px; padding:1px 6px; border-radius:999px; background:#2b2140; color:#fff; font-size:12px; font-weight:800; text-align:center; }
.bag-detail-head { display:flex; gap:14px; align-items:center; padding:12px; border-radius:14px; background:#e8f6fc; }
.bag-detail-head img { width:56px; height:56px; object-fit:contain; } .bag-detail-head p { margin:4px 0; font-size:13px; }
body.touch .bag-grid { grid-template-columns:repeat(4, 1fr); gap:10px; }
/* 2.12.0 : sandwich du frigo et pommes */
#fridge-sandwich, #apple-action { position:absolute; left:50%; transform:translateX(-50%); z-index:12; border:2px solid #fff; border-radius:999px; color:#fff; padding:12px 18px; font-weight:800; box-shadow:0 6px 18px rgba(0,0,0,.25); cursor:pointer; }
#fridge-sandwich { bottom:160px; background:#c9822f; } #apple-action { bottom:100px; background:#c23a2c; }
body.touch #fridge-sandwich { bottom:280px; max-width:55vw; font-size:12px; } body.touch #apple-action { bottom:225px; max-width:60vw; font-size:13px; }

/* 2.13.0 : HUD mobile compact (icônes), Déconnexion = icône Power en haut à droite */
#btn-logout .ico { display:none; }
body.touch #hud-top { flex-wrap:nowrap; gap:6px; max-width:calc(100vw - 120px); overflow:hidden; }
body.touch #hud-top .pill { padding:0 10px; height:38px; min-height:38px; display:inline-flex; align-items:center; font-size:13px; white-space:nowrap; flex:none; }
body.touch #hud-user { max-width:30vw; overflow:hidden; text-overflow:ellipsis; display:block !important; line-height:38px; flex:none !important; }
body.touch #hud-top .lbl { display:none; }
body.touch #btn-map, body.touch #btn-vol { width:40px; padding:0 !important; justify-content:center; font-size:18px !important; }
body.touch #btn-bag, body.touch #chat-reopen { display:none !important; }
body.touch #btn-admin, body.touch #btn-logout { position:fixed; top:max(10px, env(safe-area-inset-top)); width:40px; height:40px; min-height:40px; padding:0; justify-content:center; font-size:18px; z-index:7; }
body.touch #btn-logout { right:max(10px, env(safe-area-inset-right)); background:rgba(190,40,52,.85); }
body.touch #btn-admin { right:calc(max(10px, env(safe-area-inset-right)) + 48px); }
body.touch #btn-admin .badge { position:absolute; top:-4px; right:-4px; }
body.touch #btn-logout .ico { display:inline; font-size:20px; line-height:1; }
body.touch #btn-logout .lbl { display:none; }
body.touch #voice-pill { position:fixed; right:max(10px, env(safe-area-inset-right)); top:calc(max(10px, env(safe-area-inset-top)) + 48px); max-width:36vw; white-space:normal; font-size:11.5px; line-height:1.25; padding:6px 10px; height:auto; z-index:6; }
body.touch #chat { top:calc(max(10px, env(safe-area-inset-top)) + 48px); width:min(58vw, 360px); }
body.touch #vol-pop { top:calc(max(10px, env(safe-area-inset-top)) + 48px); }
/* actions contextuelles : toutes à DROITE, au-dessus de l'arc, jamais près du joystick */
body.touch #fridge-action, body.touch #apple-action, body.touch #fridge-sandwich, body.touch #table-action, body.touch #arcade-action, body.touch #board-action, body.touch #shuttle-action, body.touch #scooter-action, body.touch #scooter-claim, body.touch #btn-sound, body.touch #throw-fire { left:auto; right:max(14px, env(safe-area-inset-right)); transform:none; max-width:min(58vw, 260px); font-size:13px; text-align:right; }
body.touch #fridge-action, body.touch #apple-action, body.touch #btn-sound { bottom:calc(max(20px, env(safe-area-inset-bottom)) + 310px); }
body.touch #fridge-sandwich, body.touch #table-action { bottom:calc(max(20px, env(safe-area-inset-bottom)) + 362px); }
body.touch #throw-fire { bottom:calc(max(20px, env(safe-area-inset-bottom)) + 8px); min-width:96px; min-height:56px; font-size:16px; }
body.touch.cinema-assist #btn-sound { right:auto; left:50%; transform:translateX(-50%); }
@media (max-width:400px) { body.touch #joy { width:136px; height:136px; } }
/* 2.13.0 : table de jeu défilable sur téléphone, échiquier adapté à l'écran, barre « Se lever » fixe */
#gt-overlay { height:100vh; height:100dvh; }
#gt-body { touch-action:pan-y; overscroll-behavior:contain; min-height:0; }
#gt-overlay #gt-chess, #gt-overlay #gt-blackjack { min-height:0; padding-bottom:max(24px, env(safe-area-inset-bottom)); }
@media (max-width:760px) {
  #gt-chess #chess-container { width:min(100%, calc(100dvh - 300px)) !important; height:auto !important; margin:0 auto; }
  #gt-overlay .gt-bar b { font-size:14px; line-height:1.2; }
  #gt-stand { padding:8px 14px; white-space:nowrap; }
}
@media (max-width:760px) { #gt-chess > .container > header, #gt-chess header:first-of-type { display:none; } }
#gt-overlay #gt-chess, #gt-overlay #gt-blackjack { overflow-x:clip; overflow-y:visible; } /* pas de second conteneur défilant : le doigt fait défiler #gt-body */
@media (max-width:760px) {
  #gt-overlay #gt-chess .sidebar.left, #gt-overlay #gt-chess .sidebar.right { display:flex; flex-direction:column; gap:.75rem; }
  #gt-overlay #gt-chess .panel { height:auto !important; max-height:none !important; min-height:0 !important; overflow:visible !important; }
  #gt-overlay #gt-chess .container, #gt-overlay #gt-chess .chess-main { min-height:0; }
}
body.touch #btn-wardrobe { display:none !important; }
/* 2.13.1 : réglage de taille des jeux + mise en page des échecs en 3 colonnes sans chevauchement (PC) */
#gt-overlay .gt-tools { display:flex; align-items:center; gap:12px; flex:none; }
#gt-overlay .gt-size { font-size:14px; font-weight:700; display:flex; align-items:center; gap:6px; }
#gt-size { font:inherit; font-weight:700; border-radius:10px; border:2px solid #fff; background:#24553e; color:#fff; padding:6px 8px; cursor:pointer; }
@media (max-width:760px) { #gt-overlay .gt-size { display:none; } }
@media (min-width:761px) {
  #gt-overlay { --gt-board:600px; }
  #gt-overlay[data-size="s"] { --gt-board:420px; }
  #gt-overlay[data-size="l"] { --gt-board:min(860px, calc(100dvh - 250px)); }
  #gt-overlay[data-size="xl"] { --gt-board:min(1400px, calc(100dvh - 140px)); }
  #gt-overlay #gt-chess #chess-container { width:var(--gt-board) !important; height:auto !important; max-width:100% !important; max-height:none !important; aspect-ratio:1; }
  #gt-overlay #gt-chess .chess-main { min-width:0; min-height:0; width:100%; }
  #gt-overlay #gt-chess .controls-bar { max-width:100%; flex-wrap:wrap; justify-content:center; }
  #gt-overlay[data-size="s"] #gt-blackjack > * { zoom:.82; }
  #gt-overlay[data-size="l"] #gt-blackjack > * { zoom:1.2; }
  #gt-overlay[data-size="xl"] #gt-blackjack > * { zoom:1.45; }
}
@media (min-width:1201px) {
  #gt-overlay #gt-chess .game-layout { grid-template-columns:minmax(200px, 280px) minmax(0, 1fr) minmax(200px, 280px); max-width:none; }
}
#gt-overlay #gt-chess .sidebar { min-width:0; }
#gt-overlay #gt-chess .sidebar > .panel { width:100%; max-width:100%; min-width:0; overflow:hidden; overflow-wrap:anywhere; }
#gt-overlay .gt-size { color:#fff; }

/* 2.15.0 : roue d'emotes et de réactions */
#emote-wheel { position:fixed; inset:0; z-index:60; display:flex; align-items:center; justify-content:center; background:rgba(10,12,30,.25); }
#emote-wheel.hidden { display:none; }
#ew-ring { position:relative; width:min(330px, 88vw); height:min(330px, 88vw); border-radius:50%; background:rgba(20,24,58,.72); border:2px solid rgba(255,255,255,.55); box-shadow:0 10px 40px rgba(0,0,0,.35); }
#ew-close { position:absolute; left:50%; top:50%; width:58px; height:58px; margin:-29px 0 0 -29px; border-radius:50%; border:2px solid rgba(255,255,255,.7); background:rgba(139,63,224,.85); color:#fff; font-size:22px; cursor:pointer; }
.ew-item { position:absolute; width:60px; height:60px; border-radius:50%; border:2px solid rgba(255,255,255,.75); background:rgba(255,255,255,.12); color:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; cursor:pointer; padding:0; touch-action:manipulation; }
.ew-item:hover, .ew-item:active { background:rgba(139,63,224,.9); }
.ew-item.ew-react { background:rgba(255,120,160,.18); }
.ew-item i { font-style:normal; font-size:24px; line-height:1; } .ew-item span { font-size:10px; line-height:1.1; }
.ew-item b { position:absolute; top:-4px; right:-4px; width:18px; height:18px; border-radius:50%; background:#fff; color:#2a1a55; font-size:11px; line-height:18px; text-align:center; }
body.touch .ew-item b { display:none; }
#tb-emote { right:82px; bottom:240px; width:60px; height:60px; }
body.cinema-view #tb-emote, body.cinema-assist #tb-emote { display:none; }

/* 2.16.0 : réglage des bruitages (HUD du haut, PC et mobile) */
#sfx-pop { position:absolute; top:58px; left:12px; z-index:15; width:min(300px, 90vw); max-height:min(70vh, 420px); overflow:auto; background:rgba(255,255,255,.96); border-radius:14px; padding:12px 14px; box-shadow:0 8px 28px rgba(20,24,58,.35); }
#sfx-pop.hidden { display:none; }
#sfx-pop .sfx-lab { display:flex; justify-content:space-between; font-weight:800; font-size:14px; color:var(--violet-d); margin:0 0 8px; }
#sfx-pop input[type=range] { width:100%; height:32px; margin:0; accent-color:var(--violet); touch-action:pan-x; }
#sfx-pop input[type=range]:disabled { opacity:.45; }
#sfx-pop .sfx-mute { display:flex; align-items:center; gap:8px; margin-top:6px; font-size:14px; font-weight:700; color:#333; }
#sfx-pop .sfx-mute input { width:20px; height:20px; accent-color:var(--violet); }
#sfx-pop small { display:block; margin-top:6px; color:#6a6a86; font-size:12px; line-height:1.35; }
#sfx-pop .sfx-block { margin-top:10px; padding-top:10px; border-top:1px solid #e6e6f0; }
#btn-sfx.muted { opacity:.75; }
body.touch #sfx-pop { top:calc(max(10px, env(safe-area-inset-top)) + 46px); left:max(10px, env(safe-area-inset-left)); }
body.touch #btn-sfx { width:40px; padding:0 !important; justify-content:center; font-size:18px !important; }
body.touch #btn-sfx .lbl { display:none; }

/* 2.17.0 : mode photo / selfie */
body.photo-mode #hud-top, body.photo-mode #chat, body.photo-mode #emote-bar, body.photo-mode #hud-help, body.photo-mode #touch-ui, body.photo-mode #table-action,
body.photo-mode #fridge-sandwich, body.photo-mode #apple-action, body.photo-mode #fridge-action, body.photo-mode #btn-sound, body.photo-mode #throw-fire,
body.photo-mode #vol-pop, body.photo-mode #sfx-pop, body.photo-mode #voice-pill, body.photo-mode #water-bag { display:none !important; }
body[data-photo-filter="nb"] #game { filter:grayscale(1) contrast(1.1); }
body[data-photo-filter="sepia"] #game { filter:sepia(1); }
body[data-photo-filter="vintage"] #game { filter:sepia(.45) contrast(.9) saturate(.85) brightness(1.03); }
body[data-photo-filter="vif"] #game { filter:saturate(1.55) contrast(1.12); }
body[data-photo-filter="crepuscule"] #game { filter:sepia(.25) saturate(1.2) hue-rotate(-12deg) contrast(1.05) brightness(.95); }
#photo-ui { position:absolute; inset:0; pointer-events:none; z-index:40; }
#photo-ui.hidden { display:none; }
#photo-ui .ph-hint { position:absolute; top:12px; left:50%; transform:translateX(-50%); background:rgba(20,24,58,.6); color:#fff; padding:6px 12px; border-radius:20px; font-size:13px; white-space:nowrap; }
#photo-ui .ph-btns { position:absolute; left:50%; bottom:18px; transform:translateX(-50%); display:flex; gap:10px; pointer-events:auto; }
#photo-ui button { width:64px; height:64px; border-radius:50%; border:2px solid rgba(255,255,255,.8); background:rgba(20,24,58,.6); color:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; cursor:pointer; padding:0; touch-action:manipulation; }
#photo-ui button i { font-style:normal; font-size:22px; line-height:1; } #photo-ui button span { font-size:10px; line-height:1.1; max-width:60px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#photo-ui button.on { background:rgba(139,63,224,.85); }
#photo-ui button.ph-main { width:78px; height:78px; background:rgba(214,48,58,.85); } #photo-ui button.ph-main i { font-size:28px; }
body.touch #photo-ui .ph-hint { display:none; }
/* mobile : colonne à droite (côté opposé au joystick), le gros bouton Photo en bas */
body.touch #photo-ui .ph-btns { left:auto; transform:none; right:max(14px, env(safe-area-inset-right)); bottom:max(20px, env(safe-area-inset-bottom)); flex-direction:column-reverse; align-items:center; gap:8px; }
body.touch #photo-ui button { width:56px; height:56px; } body.touch #photo-ui button.ph-main { width:76px; height:76px; }
body.photo-flash #game { animation:ph-flash .18s ease-out; }
@keyframes ph-flash { from { opacity:.25; } to { opacity:1; } }
#photo-result { position:fixed; inset:0; z-index:70; background:rgba(10,12,30,.6); display:flex; align-items:center; justify-content:center; padding:12px; }
#photo-result.hidden { display:none; }
#photo-result .ph-card { background:#fff; border-radius:16px; padding:10px; max-width:min(860px, 96vw); box-shadow:0 12px 40px rgba(0,0,0,.4); }
#photo-img { display:block; max-width:100%; max-height:70vh; border-radius:10px; }
#photo-result .ph-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:10px; }
#photo-result .ph-actions button { border:0; border-radius:22px; padding:10px 16px; font-weight:800; font-size:14px; background:var(--violet); color:#fff; cursor:pointer; }
#photo-result .ph-actions button.hidden { display:none; }
#photo-result #ph-close { background:#6a6a86; }
body.touch #hud-top #btn-photo { display:none !important; } /* mobile : entrée par la roue d'emotes (bouton 😀) */

/* 2.18.0 : amis, présence, messages privés */
#friends-panel { position:absolute; right:12px; top:58px; width:min(400px,96vw); max-height:calc(100vh - 70px); display:flex; flex-direction:column; z-index:32; padding:16px; border-radius:18px; background:#fffdf8; box-shadow:0 15px 45px #10182780; }
#friends-panel.hidden { display:none; }
#friends-panel header { display:flex; align-items:center; justify-content:space-between; } #friends-panel h2 { margin:0; font-size:20px; color:var(--violet-d); }
#fr-tabs { display:flex; gap:6px; margin:10px 0 6px; flex-wrap:wrap; } #fr-tabs.hidden { display:none; }
#fr-tabs button { border:0; border-radius:16px; padding:7px 11px; font-weight:800; font-size:13px; background:#eee8f8; color:var(--violet-d); cursor:pointer; } #fr-tabs button.on { background:var(--violet); color:#fff; }
#fr-flash { min-height:18px; font-size:13px; font-weight:700; } #fr-flash.ok { color:#1d8a4a; } #fr-flash.ko { color:#c62828; }
#fr-body { overflow:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action:pan-y; flex:1 1 auto; min-height:0; }
#fr-body.hidden { display:none; }
.fr-list { list-style:none; margin:0; padding:0; } .fr-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 4px; border-bottom:1px solid #eee; }
.fr-who { display:flex; flex-direction:column; min-width:0; } .fr-who b { font-size:15px; overflow:hidden; text-overflow:ellipsis; } .fr-who small { color:#6a6a86; font-size:12px; } .fr-row.off .fr-who b { color:#888; }
.fr-btns { display:flex; gap:5px; flex:none; } .fr-btns button { border:0; border-radius:14px; padding:7px 10px; font-weight:800; font-size:13px; background:#eee8f8; color:var(--violet-d); cursor:pointer; min-height:34px; }
.fr-btns .fr-join, .fr-btns .fr-ok { background:var(--violet); color:#fff; } .fr-btns .fr-del { background:#f3e3e3; color:#a33; } .fr-btns .fr-unread { background:#ff5a7a; color:#fff; }
.fr-empty { color:#6a6a86; font-size:14px; } #fr-body h3 { font-size:14px; margin:14px 0 4px; color:var(--violet-d); }
.fr-add { display:flex; gap:6px; } .fr-add input { flex:1; min-width:0; border:2px solid #ddd; border-radius:12px; padding:9px; font-size:16px; } .fr-add button { border:0; border-radius:12px; padding:0 12px; font-weight:800; background:var(--violet); color:#fff; }
#fr-chat { display:flex; flex-direction:column; min-height:0; flex:1 1 auto; } #fr-chat.hidden { display:none; }
.fr-chat-head { display:flex; align-items:center; justify-content:space-between; gap:6px; margin:8px 0; } .fr-chat-head button { border:0; border-radius:14px; padding:7px 10px; font-weight:800; background:#eee8f8; color:var(--violet-d); }
#fr-msgs { overflow:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action:pan-y; flex:1 1 auto; min-height:160px; max-height:52vh; background:#f6f3fb; border-radius:12px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.fr-msg { max-width:80%; padding:7px 10px; border-radius:14px; font-size:14px; line-height:1.3; word-wrap:break-word; overflow-wrap:anywhere; } .fr-msg time { display:block; font-size:10px; opacity:.6; margin-top:2px; }
.fr-msg.me { align-self:flex-end; background:var(--violet); color:#fff; } .fr-msg.them { align-self:flex-start; background:#fff; color:#222; box-shadow:0 1px 3px #0002; }
#fr-form { display:flex; gap:6px; margin-top:8px; } #fr-form input { flex:1; min-width:0; border:2px solid #ddd; border-radius:12px; padding:9px; font-size:16px; } #fr-form button { border:0; border-radius:12px; padding:0 14px; font-weight:800; background:var(--violet); color:#fff; }
#fr-toast { position:absolute; left:50%; top:62px; transform:translateX(-50%); z-index:45; max-width:min(440px,92vw); background:rgba(20,24,58,.92); color:#fff; padding:10px 16px; border-radius:16px; font-weight:700; font-size:14px; cursor:pointer; box-shadow:0 8px 24px #0005; }
#fr-toast.hidden { display:none; }
#hud-online { cursor:pointer; } #btn-friends .badge, .fr-badge { background:#ff3b5c; color:#fff; border-radius:10px; padding:0 6px; font-size:11px; font-weight:800; }
.fr-badge { display:none; }
body.touch #friends-panel { inset:0; width:100%; max-height:none; border-radius:0; padding:max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
body.touch #hud-top #btn-friends { display:none !important; } /* mobile : roue d'emotes ou toucher le compteur de joueurs */
body.touch .fr-badge:not(.hidden) { display:inline-block; position:relative; margin-left:-14px; top:-12px; z-index:2; flex:none; }
body.touch #fr-toast { top:calc(max(10px, env(safe-area-inset-top)) + 50px); }
body.photo-mode #friends-panel, body.photo-mode #fr-toast { display:none !important; }
/* 2.18.0 : barre du haut PC plus compacte (Photo et Sons en icône, info-bulle au survol) */
#btn-photo .lbl, #btn-sfx .lbl { display:none; }
@media (max-width:1180px) { body:not(.touch) #btn-friends .lbl, body:not(.touch) #btn-map .lbl, body:not(.touch) #btn-bag .lbl, body:not(.touch) #btn-logout .lbl { display:none; } body:not(.touch) #btn-logout .ico { display:inline; } }
/* 2.19.0 : pièces (compteur HUD, toast, échange jetons du blackjack) */
#hud-coins { font-weight:800; white-space:nowrap; }
#hud-coins-n { display:inline-block; } #hud-coins-n.bump { animation: coin-bump .5s ease; }
@keyframes coin-bump { 0%{transform:scale(1)} 40%{transform:scale(1.25)} 100%{transform:scale(1)} }
#coin-toast { position:absolute; left:50%; top:104px; transform:translateX(-50%); z-index:46; pointer-events:none; background:rgba(40,30,8,.92); color:#ffd75e; padding:8px 16px; border-radius:16px; font-weight:800; font-size:16px; box-shadow:0 8px 24px #0005; max-width:min(440px,92vw); text-align:center; }
#coin-toast.loss { color:#ffb3a8; }
#coin-toast.info { color:#fff; font-size:14px; }
#coin-toast.hidden { display:none; }
body.touch #coin-toast { top:calc(max(10px, env(safe-area-inset-top)) + 92px); }
body.photo-mode #coin-toast { display:none !important; }
#gt-chips { display:flex; gap:6px; }
#gt-chips.hidden { display:none; }
#gt-chips button { font:inherit; font-weight:700; font-size:13px; border-radius:10px; border:2px solid #fff; background:#7a5a10; color:#fff; padding:5px 8px; cursor:pointer; }
@media (max-width: 700px) { #gt-chips button { font-size:11px; padding:4px 6px; } }
/* 2.20.0 : barre du haut mobile (iPhone) : tout tient sur une ligne, ⏻ reste en haut à droite */
body.touch #hud-top { gap:5px; max-width:calc(100vw - 72px); }
body.touch.is-admin #hud-top { max-width:calc(100vw - 120px); }
body.touch #hud-top .pill { padding:0 8px; }
body.touch #hud-user { max-width:21vw; }
body.touch #hud-coins { font-size:12px; padding:0 7px !important; }
body.touch #hud-online { padding:0 7px !important; }
body.touch #btn-map, body.touch #btn-sfx, body.touch #btn-vol { width:36px; font-size:17px !important; }
/* 2.20.0 : boutique & familiers */
#shop-action { position:absolute; left:50%; bottom:150px; transform:translateX(-50%); z-index:12; border:2px solid #fff; border-radius:999px; background:#2f4a8a; color:#fff; padding:12px 18px; font-weight:800; box-shadow:0 6px 18px rgba(0,0,0,.25); cursor:pointer; }
#shop-action.hidden { display:none; }
body.touch #shop-action { left:auto; right:max(14px, env(safe-area-inset-right)); transform:none; max-width:min(58vw, 260px); font-size:13px; bottom:calc(max(20px, env(safe-area-inset-bottom)) + 362px); }
body.photo-mode #shop-action, body.game-open #shop-action { display:none !important; }
/* 2.21.0 : panier de la boutique (en haut à gauche, sous la barre ; hors grille tactile) */
#basket-hud { position:absolute; left:max(10px, env(safe-area-inset-left)); top:58px; z-index:13; max-width:260px; }
#basket-hud.hidden, body.photo-mode #basket-hud, body.game-open #basket-hud { display:none !important; }
#basket-toggle { border:2px solid #fff; border-radius:999px; background:#2f4a8a; color:#fff; padding:7px 14px; font-weight:800; font-size:14px; box-shadow:0 4px 14px rgba(0,0,0,.25); cursor:pointer; }
#basket-list { margin-top:6px; background:rgba(255,255,255,.96); border-radius:14px; padding:8px 10px; box-shadow:0 6px 18px rgba(0,0,0,.25); color:#2a2340; }
#basket-list.hidden { display:none; }
#basket-items { list-style:none; margin:0 0 6px; padding:0; max-height:38vh; overflow:auto; }
#basket-items li { display:flex; align-items:center; gap:8px; padding:3px 0; font-size:13px; }
#basket-items li span { flex:1; font-weight:700; }
.basket-rm { width:30px; height:30px; border-radius:50%; border:none; background:#f0e6ff; color:#5a2ea6; font-weight:900; font-size:16px; cursor:pointer; }
#basket-clear { width:100%; border:none; border-radius:10px; background:#ffe1e1; color:#a12a2a; font-weight:800; padding:8px; cursor:pointer; }
#basket-list .muted { margin:6px 0 0; font-size:12px; }
body.touch #basket-hud { top:calc(max(10px, env(safe-area-inset-top)) + 56px); }
body.basket-open #coin-toast { top:auto; bottom:96px; }
body.touch.basket-open #coin-toast { bottom:calc(max(20px, env(safe-area-inset-bottom)) + 440px); max-width:80vw; }

#bag-pets { margin-top:8px; width:100%; }
#shop-panel { position:absolute; left:50%; top:58px; transform:translateX(-50%); width:min(760px,96vw); max-height:calc(100vh - 76px); display:flex; flex-direction:column; z-index:33; padding:16px; border-radius:18px; background:#fffdf8; box-shadow:0 15px 45px #10182780; }
#shop-panel.hidden { display:none; }
#shop-panel header { display:flex; align-items:center; gap:10px; } #shop-panel h2 { margin:0; font-size:20px; color:var(--violet-d); flex:1; }
.shop-coins { font-weight:800; color:#7a5a10; background:#fff3cf; border-radius:12px; padding:4px 10px; white-space:nowrap; }
#shop-tabs { display:flex; gap:6px; margin:10px 0 4px; flex-wrap:wrap; }
#shop-tabs button { border:0; border-radius:16px; padding:7px 11px; font-weight:800; font-size:13px; background:#eee8f8; color:var(--violet-d); cursor:pointer; }
#shop-tabs button.on { background:var(--violet); color:#fff; } #shop-tabs button:disabled { opacity:.5; cursor:default; }
#shop-msg { min-height:18px; margin:2px 0 6px; font-weight:700; color:#2f6b4f; font-size:13px; }
#shop-body { overflow:auto; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action:pan-y; flex:1 1 auto; min-height:0; }
.shop-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(158px, 1fr)); gap:10px; padding-bottom:6px; }
.shop-card { border:2px solid #eee8f8; border-radius:14px; padding:8px; display:flex; flex-direction:column; align-items:center; text-align:center; background:#fff; }
.shop-card.owned { border-color:#cfe9d9; } .shop-card.active { border-color:var(--violet); box-shadow:0 0 0 2px #8b3fe033; }
.shop-card img { width:112px; height:112px; object-fit:contain; background:radial-gradient(#f4effc, #e6dcf6); border-radius:12px; }
.shop-card b { margin-top:4px; font-size:15px; } .shop-card small { color:#777; font-weight:700; }
.shop-blurb { font-size:11.5px; color:#555; margin:4px 0 6px; line-height:1.3; flex:1; }
.shop-row { display:flex; align-items:center; justify-content:space-between; width:100%; gap:6px; }
.shop-price { font-weight:800; color:#7a5a10; } .shop-owned { font-weight:800; color:#2f6b4f; font-size:13px; }
.shop-row button, .shop-none { border:0; border-radius:12px; padding:7px 10px; font-weight:800; cursor:pointer; background:var(--violet); color:#fff; font-size:13px; }
.shop-row button.confirm { background:#d6303a; } .shop-row button:disabled { background:#bbb; cursor:not-allowed; }
.shop-act { background:#2f6b4f !important; }
.shop-none { display:block; width:100%; margin-bottom:10px; background:#eee8f8; color:var(--violet-d); } .shop-none.on { background:#cfe9d9; color:#2f6b4f; }
body.touch #shop-panel { inset:0; transform:none; width:100%; max-height:100vh; max-height:100dvh; border-radius:0; padding:max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); }
body.touch .shop-grid { grid-template-columns:repeat(2, 1fr); }
body.photo-mode #shop-panel { display:none !important; }
body.shop-open #hud-help { display:none; }
.shop-card.product img { background:radial-gradient(#fff7e6, #f6e3c0); }

/* 2.21.1 : admin — donner à tous */
.ad-giveall { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 12px; margin:0 0 10px; border-radius:12px; background:#fff6d8; border:1px solid #f0d27a; }
.ad-giveall input { width:90px; padding:6px 8px; border-radius:8px; border:1px solid #c9b77a; font-weight:700; }
.ad-giveall select { padding:6px 8px; border-radius:8px; border:1px solid #c9b77a; }
.ad-giveall small { flex-basis:100%; font-size:12px; }
/* 2.21.2 : comptes lisibles quand le panneau est étroit (téléphone ~390 px) : nom + statut sur toute la largeur, boutons en dessous */
.ad-row { flex-wrap:wrap; }
.ad-who { min-width:150px; }
.ad-who b { overflow-wrap:normal; word-break:normal; }
@media (max-width: 600px) {
  .ad-row { align-items:flex-start; gap:6px; }
  .ad-who { flex:1 1 100%; }
  .ad-act { flex:1 1 100%; display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-start; }
  .ad-act .btn-small { padding:6px 10px; font-size:12.5px; white-space:nowrap; }
  .ad-giveall { display:grid; grid-template-columns:1fr auto; gap:8px; }
  .ad-giveall b { grid-column:1 / -1; }
  .ad-giveall input { width:100%; box-sizing:border-box; font-size:16px; }
  .ad-giveall select { grid-column:1 / -1; width:100%; font-size:16px; order:3; }
  .ad-giveall #ad-giveall-go { grid-column:2; grid-row:2; padding:6px 14px; }
  .ad-giveall small { grid-column:1 / -1; order:4; }
}

#arcade-action { background:#3a2f7a; } /* 2.22.0 : borne d'arcade */
body.touch #arcade-action { bottom:calc(330px + env(safe-area-inset-bottom)); } /* au-dessus de la grille de boutons mobile */

/* 2.28.0 : Campus, tableau partagé (Excalidraw). Bouton contextuel comme les bornes ; overlay plein écran comme les tables de jeu. */
#board-action { background:#3f5d8a; }
body.touch #board-action { bottom:calc(330px + env(safe-area-inset-bottom)); }
body.photo-mode #board-action, body.game-open #board-action { display:none !important; }
#board-overlay { position:fixed; inset:0; z-index:60; display:flex; flex-direction:column; background:#fff; }
#board-overlay .bd-bar { flex:0 0 auto; display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); background:#3f5d8a; color:#fff; font-size:15px; }
#board-overlay .bd-bar button, #board-overlay .bd-bar select, #bd-panel button, #bd-panel input, #bd-panel select { font:inherit; font-size:14px; border-radius:8px; border:1px solid #c9d3e6; padding:5px 9px; background:#fff; color:#1d2840; cursor:pointer; }
#board-overlay .bd-bar select { max-width:min(46vw, 260px); }
#bd-close { margin-left:auto; background:#b52b38 !important; color:#fff !important; border-color:#fff !important; font-weight:800; }
#bd-peers, #bd-status { font-size:13px; opacity:.92; }
#bd-status:empty, #bd-peers:empty { display:none; }
#bd-panel { flex:0 0 auto; display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; padding:8px 12px; background:#eef2fa; color:#1d2840; font-size:14px; border-bottom:1px solid #c9d3e6; }
#bd-panel ul { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px 12px; }
#bd-panel li button { margin-left:4px; padding:2px 7px; }
#bd-panel #bd-delete { background:#fbe9eb; color:#8c1d28; border-color:#e6b3b9; }
#bd-canvas { flex:1 1 auto; position:relative; min-height:0; }
body.touch #board-overlay .bd-bar { font-size:13px; gap:6px; }
body.touch #board-overlay .bd-bar button, body.touch #board-overlay .bd-bar select { padding:6px 8px; font-size:13px; }
#board-notice { position:fixed; top:max(60px, calc(env(safe-area-inset-top) + 50px)); left:50%; transform:translateX(-50%); z-index:70; max-width:88vw; text-align:center; background:rgba(20,24,58,.92); color:#fff; padding:8px 16px; border-radius:14px; font-weight:700; font-size:14px; pointer-events:none; } /* 2.28.1 */
/* 2.29.0 : notes partagées (onglets Tableau / Notes, éditeur texte) */
#board-overlay .bd-tabs { display:inline-flex; gap:4px; }
#board-overlay .bd-tabs button.on { background:#ffd54f; border-color:#fff; font-weight:800; }
#bd-notes { position:absolute; inset:0; width:100%; height:100%; box-sizing:border-box; resize:none; border:0; outline:none; padding:18px max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); font:16px/1.55 system-ui, sans-serif; color:#1d2840; background:#fffdf5; white-space:pre-wrap; }
body.touch #bd-notes { font-size:16px; padding:12px; }
/* 2.30.0 : classes */
#bd-classes { position:absolute; inset:0; overflow:auto; padding:14px max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background:#f6f8fc; color:#1d2840; font-size:15px; }
#bd-classes h3 { margin:14px 0 6px; font-size:17px; } #bd-classes h4 { margin:12px 0 4px; font-size:15px; }
#bd-classes .bd-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:6px 0; }
#bd-classes .bd-chips { display:flex; flex-wrap:wrap; gap:8px; }
#bd-classes button, #bd-classes input, #bd-classes select { font:inherit; font-size:14px; border-radius:8px; border:1px solid #c9d3e6; padding:6px 10px; background:#fff; color:#1d2840; cursor:pointer; }
#bd-classes input { cursor:text; min-width:min(260px, 60vw); }
#bd-classes .bd-chips button.on { background:#ffd54f; font-weight:800; }
#bd-classes .bd-class { margin-top:12px; padding:10px 12px; border:1px solid #c9d3e6; border-radius:12px; background:#fff; }
#bd-classes .bd-members-list { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
#bd-classes .bd-members-list li { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
#bd-classes .bd-role { color:#3f5d8a; font-weight:700; }
#bd-classes .bd-muted { color:#6b7590; font-size:14px; }
#bd-classes .bd-danger { background:#fbe9eb; color:#8c1d28; border-color:#e6b3b9; }
/* 2.32.0 : vidéoprojecteur */
#bd-projo.on { background:#ffd54f; font-weight:800; }
/* 2.33.0 : diapos projetées — commandes de l'intervenant, au-dessus du bouton de salle (téléphone : colonne de droite) */
#slide-ctl { position:absolute; left:50%; bottom:205px; transform:translateX(-50%); z-index:12; display:flex; gap:6px; align-items:center; background:#2b3550; border:2px solid #fff; border-radius:999px; padding:5px 8px; color:#fff; font-weight:800; box-shadow:0 6px 18px rgba(0,0,0,.25); }
#slide-ctl.hidden { display:none; }
#slide-ctl button { border:0; border-radius:999px; background:#ffd54f; color:#1d2840; font:inherit; font-size:16px; min-width:40px; min-height:36px; cursor:pointer; }
#slide-ctl button[data-stop] { background:#f3d3d7; color:#8c1d28; }
#slide-ctl span { min-width:54px; text-align:center; font-size:14px; }
body.touch #slide-ctl { left:auto; right:max(14px, env(safe-area-inset-right)); transform:none; bottom:calc(385px + env(safe-area-inset-bottom)); }
body.photo-mode #slide-ctl, body.game-open #slide-ctl { display:none !important; }
#bd-classes .bd-decks li { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }

/* 2.34.0 : amphithéâtre — mains levées, parole donnée, parole libre (carte sobre en haut à droite ; téléphone : sous le bandeau vocal) */
#amphi-hands { position:absolute; right:14px; bottom:20px; /* 2.35.0 : en bas à droite sur ordinateur (ne recouvre plus le coin du grand écran) */ z-index:12; width:240px; display:flex; flex-direction:column; gap:5px; background:rgba(29,40,64,.92); border:2px solid #fff; border-radius:14px; padding:8px; color:#fff; font-size:13px; font-weight:700; box-shadow:0 6px 18px rgba(0,0,0,.25); }
#amphi-hands.hidden { display:none; }
#amphi-hands .ah-row { display:flex; align-items:center; justify-content:space-between; gap:6px; }
#amphi-hands .ah-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#amphi-hands button { border:0; border-radius:999px; background:#ffd54f; color:#1d2840; font:inherit; font-size:12px; padding:5px 10px; cursor:pointer; white-space:nowrap; }
#amphi-hands button.ah-open { background:#e4e7ef; } #amphi-hands button.ah-open.on { background:#7ee0a1; }
#amphi-hands button[data-take] { background:#f3d3d7; color:#8c1d28; }
#amphi-hands button.ah-hand { width:100%; font-size:13px; padding:8px 10px; } #amphi-hands button.ah-hand.on { background:#7ee0a1; }
#amphi-hands .ah-empty { opacity:.85; font-weight:600; } #amphi-hands .ah-note { color:#ffd54f; font-weight:600; }
body.touch #amphi-hands { position:fixed; right:max(10px, env(safe-area-inset-right)); bottom:auto; top:calc(max(10px, env(safe-area-inset-top)) + 100px); width:auto; max-width:36vw; font-size:11.5px; padding:6px; }
body.touch #amphi-hands .ah-row { flex-wrap:wrap; } body.touch #amphi-hands button { font-size:11px; padding:5px 8px; } body.touch #amphi-hands button.ah-hand { white-space:normal; font-size:12px; }
body.photo-mode #amphi-hands, body.game-open #amphi-hands { display:none !important; }
/* 2.35.1 : ordinateur < 1180 px — le champ de chat (430 px) recouvrait « Saluer » (barre d'emotes centrée) ; il s'arrête avant (téléphone : règles body.touch, inchangées) */
@media (max-width:1180px) { #chat { width:min(430px, calc(50vw - 150px)); } }
/* 2.39.0 : zoom local sur la projection */
#projo-zoom { position:absolute; left:50%; bottom:205px; transform:translateX(-50%); z-index:12; border:2px solid #fff; border-radius:999px; background:#2b3550; color:#fff; font:700 14px system-ui, sans-serif; padding:8px 14px; cursor:pointer; box-shadow:0 4px 14px #0005; }
#projo-zoom.hidden { display:none; }
body.projo-zoom-ctl #projo-zoom { bottom:255px; }
body.touch #projo-zoom { left:auto; right:max(14px, env(safe-area-inset-right)); transform:none; bottom:calc(385px + env(safe-area-inset-bottom)); font-size:13px; }
body.touch.projo-zoom-ctl #projo-zoom { bottom:calc(440px + env(safe-area-inset-bottom)); }
body.photo-mode #projo-zoom, body.game-open #projo-zoom, body.projo-zoom-open #projo-zoom { display:none !important; }
#projo-zoom-view { position:fixed; inset:0; z-index:80; background:#151a26; touch-action:none; user-select:none; -webkit-user-select:none; }
#projo-zoom-view.hidden { display:none; }
#projo-zoom-view .pz-canvas { position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; cursor:grab; }
#projo-zoom-view .pz-canvas:active { cursor:grabbing; }
#projo-zoom-view .pz-bar { position:absolute; left:0; right:0; top:0; display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left)); background:rgba(29,40,64,.94); color:#fff; font:600 14px system-ui, sans-serif; z-index:1; }
#projo-zoom-view .pz-title { flex:1 1 140px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#projo-zoom-view .pz-bar button { border:0; border-radius:999px; background:#ffd54f; color:#1d2840; font:700 15px system-ui, sans-serif; min-width:38px; min-height:36px; padding:0 10px; cursor:pointer; }
#projo-zoom-view .pz-bar .pz-fit { background:#e6ecf8; font-size:13px; }
#projo-zoom-view .pz-bar .pz-close { background:#f3d3d7; color:#8c1d28; margin-left:4px; }
#projo-zoom-view .pz-pct { min-width:52px; text-align:center; font-variant-numeric:tabular-nums; }
body.projo-zoom-open #touch-ui, body.projo-zoom-open #chat, body.projo-zoom-open #hud-help { display:none !important; }
#projo-zoom-view .pz-bar { padding-right:calc(max(10px, env(safe-area-inset-right)) + 50px); }
#projo-zoom-view .pz-bar .pz-close { position:absolute; top:max(8px, env(safe-area-inset-top)); right:max(10px, env(safe-area-inset-right)); margin:0; }
/* 2.39.1 : défilement au doigt (téléphone) dans les classes du Campus, le panier, les sons et le plan ; le rebond ne passe pas à la page */
#bd-classes, #basket-items, #sfx-pop, .map-card { -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
/* 2.40.0 : présentateur ponctuel (ordinateur : en bas à droite, au-dessus de la carte ✋ si elle est là ; téléphone : à droite sous ⏻) */
#campus-guest { position:absolute; right:14px; bottom:20px; z-index:12; width:250px; display:flex; flex-direction:column; gap:5px; background:rgba(29,40,64,.92); color:#fff; border-radius:14px; padding:8px; font:600 13px system-ui, sans-serif; box-shadow:0 6px 20px rgba(0,0,0,.3); }
#campus-guest.hidden { display:none; }
#campus-guest button { border:0; border-radius:999px; background:#ffd54f; color:#1d2840; font:inherit; font-size:12px; padding:5px 10px; cursor:pointer; white-space:nowrap; }
#campus-guest .cg-head { width:100%; background:#e4e7ef; text-align:left; overflow:hidden; text-overflow:ellipsis; }
#campus-guest .cg-head.on { background:#ffd54f; }
#campus-guest .cg-off { background:#f3d3d7; color:#8c1d28; }
#campus-guest .cg-list { display:flex; flex-direction:column; gap:5px; max-height:240px; overflow:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action:pan-y; }
#campus-guest .cg-row { display:flex; align-items:center; justify-content:space-between; gap:6px; }
#campus-guest .cg-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#campus-guest .cg-row em { opacity:.7; font-size:11px; }
#campus-guest .cg-cur span { color:#7ee0a1; }
#campus-guest .cg-me { line-height:1.35; }
#campus-guest .cg-empty { opacity:.85; } #campus-guest .cg-note { color:#ffd54f; }
body.touch #campus-guest { position:fixed; right:max(10px, env(safe-area-inset-right)); bottom:auto; top:calc(max(10px, env(safe-area-inset-top)) + 100px); width:auto; max-width:46vw; font-size:11.5px; padding:6px; }
body.touch #campus-guest .cg-list { max-height:30vh; } body.touch #campus-guest button { font-size:11px; padding:5px 8px; }
body.touch #campus-guest .cg-row { flex-wrap:wrap; }
body.photo-mode #campus-guest, body.game-open #campus-guest, body.projo-zoom-open #campus-guest { display:none !important; }

/* 2.42.0 : pêche (bouton d'action PC, boutons tactiles, toast « Montrer », carnet) */
#fish-action { position:absolute; left:50%; bottom:100px; transform:translateX(-50%); z-index:12; border:2px solid #fff; border-radius:999px; background:#1f7a8c; color:#fff; padding:12px 18px; font-weight:800; cursor:pointer; }
#fish-action.bite, #tb-fish.bite { background:#e0532f; animation:fishPulse .35s ease-in-out infinite alternate; }
@keyframes fishPulse { from { transform:translateX(-50%) scale(1); } to { transform:translateX(-50%) scale(1.08); } }
#tb-fish.bite { animation-name:fishPulseT; } @keyframes fishPulseT { from { transform:scale(1); } to { transform:scale(1.1); } }
body.touch #fish-action { display:none; }
#tb-rod { right:92px; bottom:4px; background:rgba(31,122,140,.85); } #tb-rod span { font-size:9.5px; }
#tb-fish { background:rgba(31,122,140,.9); } #tb-fish span { font-size:12px; }
body.fish-hut #tb-sit { display:none; } body.fish-spot #tb-jump { display:none; }
#fish-toast { position:absolute; left:50%; top:110px; transform:translateX(-50%); z-index:14; display:flex; align-items:center; gap:10px; padding:8px 8px 8px 16px; border-radius:999px; background:#10182ee0; color:#fff; font-weight:800; box-shadow:0 8px 24px #10182780; }
#fish-toast.hidden { display:none; }
body.touch #fish-toast { top:auto; bottom:calc(max(20px, env(safe-area-inset-bottom)) + 340px); max-width:92vw; }
#fish-show { border:0; border-radius:999px; padding:8px 14px; background:#f2a516; color:#1b1b1b; font-weight:800; cursor:pointer; font-family:inherit; }
#fish-panel { position:absolute; right:12px; top:58px; width:min(440px,96vw); max-height:calc(100vh - 70px); display:flex; flex-direction:column; z-index:32; padding:16px; border-radius:18px; background:#fffdf8; box-shadow:0 15px 45px #10182780; }
#fish-panel.hidden { display:none; }
#fish-panel header { display:flex; align-items:center; justify-content:space-between; } #fish-panel h2 { margin:0; font-size:20px; color:var(--violet-d); }
#fish-sum { margin:8px 0; font-weight:700; font-size:13px; color:#334; }
#fish-body { overflow:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action:pan-y; flex:1 1 auto; min-height:0; display:grid; grid-template-columns:1fr; gap:8px; }
.fish-card { display:flex; align-items:center; gap:10px; padding:6px 10px; border-radius:14px; background:#eef6f8; }
.fish-card canvas { width:96px; height:48px; flex:none; }
.fish-card.unknown { background:#f0eef2; } .fish-card.unknown b { color:#777; }
.fish-txt { display:flex; flex-direction:column; gap:1px; font-size:13px; } .fish-txt b { font-size:15px; color:#1b2a3a; } .fish-txt small { display:block; color:#667; } .fish-txt small::first-letter { text-transform:uppercase; }
.fish-foot { margin:8px 0 0; font-size:12px; color:#667; }
body.touch #fish-panel { inset:0; width:100%; max-height:none; border-radius:0; padding:max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
body.touch #btn-fishlog { width:36px; padding:0 !important; justify-content:center; font-size:17px !important; } body.touch #btn-fishlog .lbl { display:none; }
@media (max-width:1180px) { body:not(.touch) #btn-fishlog .lbl { display:none; } }
body.photo-mode #fish-action, body.photo-mode #fish-toast { display:none !important; }

/* 2.46.1 : compte à rebours du duel pour le joueur levé (overlay fermé) */
#duel-away { position:fixed; left:50%; top:max(12px, env(safe-area-inset-top)); transform:translateX(-50%); z-index:50; max-width:min(92vw, 440px); padding:8px 14px; border-radius:10px; background:rgba(20,24,40,.92); color:#ffe8b0; font-weight:700; font-size:15px; text-align:center; pointer-events:none; box-shadow:0 4px 16px rgba(0,0,0,.35); }
#duel-away[hidden] { display:none !important; }
body.game-open #duel-away { display:none !important; } /* le panneau du jeu affiche déjà le décompte */
body.touch #duel-away { top:calc(max(10px, env(safe-area-inset-top)) + 52px); font-size:14px; } /* sous le bouton ⏻, sans recouvrir joystick ni actions */
