:root {
  --ui: 1; --joy: 1;
  --pine: #1f2f27; --pine-2: #2a3f34; --amber: #f2b84b; --cream: #f6efdc; --ink: #263029; --red: #e0503f; --blue: #4da3ff;
  --panel: rgba(31, 47, 39, 0.82);
  --font: 'Nunito', system-ui, -apple-system, sans-serif;
  --display: 'Lilita One', 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #2e3b2c; font-family: var(--font); color: var(--cream); user-select: none; -webkit-user-select: none; touch-action: none; }
canvas#game { position: fixed; inset: 0; display: block; }
button { font-family: var(--font); font-weight: 800; cursor: pointer; border: 0; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.hidden { display: none !important; }

/* ---------- Accueil / mort ---------- */
#home, #death { position: fixed; inset: 0; display: grid; place-items: center; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; background: radial-gradient(ellipse at center, rgba(31,47,39,0.25), rgba(20,30,24,0.78)); z-index: 20; padding: 16px; }
.homeCard { width: min(560px, 100%); background: var(--pine); border: 5px solid var(--ink); border-radius: 26px; padding: 28px 28px 22px; box-shadow: 0 10px 0 var(--ink); text-align: center; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(54px, 11vw, 84px); line-height: 0.95; margin: 0 0 8px; color: var(--amber); text-shadow: 0 5px 0 var(--ink), 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 -4px 0 var(--ink); letter-spacing: 0.5px; }
h1 span { color: var(--cream); font-size: 0.55em; }
h2 { font-family: var(--display); font-weight: 400; font-size: 44px; margin: 0 0 6px; color: var(--amber); }
.tag { margin: 0 0 20px; font-size: 17px; opacity: 0.9; }
#nameInput { width: 100%; font: 800 22px var(--font); text-align: center; padding: 14px; border-radius: 14px; border: 4px solid var(--ink); background: var(--cream); color: var(--ink); }
#skins { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: 12px 0; scroll-snap-type: x proximity; touch-action: pan-x; scrollbar-width: thin; }
.skin { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--pine-2); border: 3px solid transparent; border-radius: 14px; padding: 4px 4px 6px; color: var(--cream); font-size: 11px; width: 72px; scroll-snap-align: start; }
.skin.on { border-color: var(--amber); background: #34503f; }
.skin.locked canvas { filter: grayscale(0.85) brightness(0.7); }
.skin.locked span { color: var(--amber); }
.big { width: 100%; font: 400 34px var(--display); padding: 12px; border-radius: 16px; background: var(--amber); color: var(--ink); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); margin-top: 4px; }
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.big:disabled { opacity: 0.55; cursor: wait; }
.ghost { background: transparent; color: var(--cream); border: 3px solid rgba(246,239,220,0.35); border-radius: 12px; padding: 8px 14px; font-size: 15px; }
.homeRow { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; }
#status { font-size: 13px; opacity: 0.85; }
#status.ok::before { content: '● '; color: #7ee06a; }
#status.ko { color: #ff9a8a; }
.keysHelp { font-size: 13px; opacity: 0.7; margin: 14px 0 0; line-height: 1.45; }
#death .homeCard { display: grid; gap: 10px; }
#deathBy { margin: 0 0 6px; opacity: 0.9; }

/* ---------- HUD ---------- */
#hud > * { position: fixed; z-index: 5; }
.panel { background: var(--panel); border: 3px solid var(--ink); border-radius: 16px; padding: 10px 12px; }
#topLeft { top: calc(12px + env(safe-area-inset-top)); left: 12px; display: flex; gap: 8px; align-items: center; transform: scale(var(--ui)); transform-origin: top left; }
#topLeft button { background: var(--panel); color: var(--cream); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 14px; font-size: 15px; }
#stats { font-size: 13px; font-weight: 800; text-shadow: 0 2px 0 var(--ink); }
#clanPanel { top: calc(62px + env(safe-area-inset-top)); left: 12px; width: 300px; max-height: 60vh; overflow: auto; transform: scale(var(--ui)); transform-origin: top left; }
#clanPanel h3 { margin: 0 0 8px; font: 400 24px var(--display); color: var(--amber); }
#clanPanel ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
#clanPanel li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; }
#clanPanel li small { display: block; font-weight: 600; opacity: 0.75; }
#clanPanel li.empty { opacity: 0.7; font-weight: 600; }
#clanPanel .row { display: flex; gap: 6px; }
#clanPanel input { flex: 1; min-width: 0; padding: 8px; border-radius: 10px; border: 3px solid var(--ink); font: 800 14px var(--font); }
#clanPanel button { background: var(--amber); color: var(--ink); border-radius: 10px; padding: 7px 10px; border: 3px solid var(--ink); }
#clanPanel button.danger { background: var(--red); color: #fff; width: 100%; }
#clanPanel .hint { font-size: 12px; opacity: 0.8; }
#leaderboard { top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 230px; font-size: 14px; transform: scale(var(--ui)); transform-origin: top right; }
#leaderboard h4 { margin: 0 0 6px; font: 400 20px var(--display); color: var(--amber); }
#leaderboard div { display: flex; justify-content: space-between; gap: 6px; padding: 1px 0; }
#leaderboard div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#leaderboard div.me { color: var(--amber); }
#minimapBox { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); transform: scale(var(--ui)); transform-origin: bottom left; }
#minimap { width: 200px; height: 200px; border-radius: 16px; border: 4px solid var(--ink); display: block; }
#biome, #bossTimer { font-size: 13px; font-weight: 800; text-shadow: 0 2px 0 var(--ink); margin-top: 3px; }
#bossTimer { color: #ffb3e9; }
#resources { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 6px; transform: scale(var(--ui)); transform-origin: bottom right; }
.res { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 3px solid var(--ink); border-radius: 12px; padding: 5px 12px; min-width: 175px; }
.res i { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--ink); }
.res span { flex: 1; font-size: 14px; opacity: 0.85; }
.res b { font-size: 18px; }
#bottomCenter { left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%) scale(var(--ui)); transform-origin: bottom center; display: grid; gap: 8px; justify-items: center; }
#buff { color: var(--amber); font-weight: 900; text-shadow: 0 2px 0 var(--ink); min-height: 0; }
#ageRow { display: flex; align-items: center; gap: 10px; }
#ageLabel { font: 400 24px var(--display); color: var(--amber); text-shadow: 0 3px 0 var(--ink); }
#xpBar { position: relative; width: 340px; height: 24px; background: var(--panel); border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; }
#xpFill { height: 100%; width: 0; background: linear-gradient(#ffd774, #e8a52c); transition: width 0.2s; }
#xpText { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 900; text-shadow: 0 1px 0 var(--ink); }
#hotbar { display: flex; gap: 6px; }
.slot { position: relative; width: 62px; height: 62px; display: grid; place-items: center; background: var(--panel); border: 3px solid var(--ink); border-radius: 14px; padding: 0; }
.slot.on { background: #4a6b52; border-color: var(--amber); box-shadow: 0 0 0 3px var(--ink); }
.slot kbd { position: absolute; top: 2px; left: 6px; font: 900 12px var(--font); color: var(--cream); text-shadow: 0 1px 0 var(--ink); }
#upgrades { top: 50%; left: 50%; transform: translate(-50%, -62%) scale(var(--ui)); width: min(760px, 94vw); background: var(--pine); border: 5px solid var(--ink); border-radius: 22px; padding: 16px; box-shadow: 0 8px 0 var(--ink); text-align: center; z-index: 8; }
#upgrades h3 { margin: 0 0 12px; font: 400 26px var(--display); color: var(--amber); }
#upgrades p { margin: 10px 0 0; font-size: 13px; opacity: 0.75; }
#upgrades .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.card { display: grid; justify-items: center; gap: 6px; background: var(--pine-2); color: var(--cream); border: 3px solid var(--ink); border-radius: 16px; padding: 12px 10px; text-align: center; }
.card:hover { border-color: var(--amber); background: #34503f; }
.card strong { display: block; font-size: 16px; }
.card small { display: block; font-weight: 600; font-size: 13px; opacity: 0.85; line-height: 1.35; margin-top: 3px; }
.card em { display: block; font-style: normal; color: var(--amber); font-size: 12px; margin-top: 4px; }
#chatInput { left: 50%; bottom: 190px; transform: translateX(-50%); width: min(420px, 90vw); padding: 12px; border-radius: 12px; border: 4px solid var(--ink); font: 800 16px var(--font); z-index: 9; }
#toasts { left: 50%; bottom: 175px; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.toast { background: var(--panel); border: 3px solid var(--ink); border-radius: 12px; padding: 7px 14px; font-weight: 800; font-size: 14px; animation: toast 2.8s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#announce { top: 18%; left: 50%; transform: translateX(-50%); width: min(720px, 92vw); text-align: center; font: 400 28px var(--display); color: var(--amber); text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); opacity: 0; pointer-events: none; }
#announce.show { animation: announce 6s forwards; }
@keyframes announce { 0% { opacity: 0; transform: translate(-50%, -10px); } 6%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* ---------- Mobile ---------- */
#mobile { display: none; }
body.touch #mobile { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.joy { position: fixed; width: calc(130px * var(--joy)); height: calc(130px * var(--joy)); margin: calc(-65px * var(--joy)) 0 0 calc(-65px * var(--joy)); border-radius: 50%; background: rgba(31,47,39,0.35); border: 3px solid rgba(246,239,220,0.4); display: none; }
.joy.active { display: grid; place-items: center; }
.knob { width: 56px; height: 56px; border-radius: 50%; background: rgba(246,239,220,0.75); border: 3px solid var(--ink); }
#mBtns { position: fixed; right: 12px; bottom: calc(185px + env(safe-area-inset-bottom)); display: grid; gap: 8px; pointer-events: auto; }
#mBtns button { touch-action: none; }
#mBtns button { width: 76px; padding: 10px 0; border-radius: 14px; background: var(--panel); color: var(--cream); border: 3px solid var(--ink); font-size: 13px; }
#mBtns button.on { background: var(--amber); color: var(--ink); }
body.touch .res { min-width: 0; padding: 3px 8px; }
body.touch .res span { display: none; }
@media (max-width: 760px) {
  #xpBar { width: 200px; }
  .slot { width: 48px; height: 48px; }
  #minimap { width: 120px; height: 120px; }
  #leaderboard { width: 170px; font-size: 12px; }
  #bottomCenter { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Paramètres (inspiration Epic Games) ---------- */
#settings { position: fixed; inset: 0; z-index: 30; background: linear-gradient(160deg, #142019 0%, #1f2f27 60%, #2a3f34 100%); color: #eef6ef; display: grid; grid-template-rows: auto 1fr auto; font-family: var(--font); }
#settings header { display: flex; align-items: center; gap: 18px; padding: 18px 28px 0; border-bottom: 2px solid rgba(255,255,255,0.08); flex-wrap: wrap; }
#settings h2 { color: #fff; font-size: 34px; margin: 0 12px 10px 0; }
#setTabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
#setTabs button { background: transparent; color: rgba(238,242,255,0.65); font-size: 16px; padding: 12px 16px; border-bottom: 4px solid transparent; border-radius: 0; }
#setTabs button.on { color: #fff; border-bottom-color: #f2d14b; }
#setTabs button:hover { color: #fff; }
#setClose { background: rgba(255,255,255,0.08); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 18px; margin-bottom: 10px; }
#setList { overflow: auto; padding: 18px 28px; display: grid; gap: 6px; align-content: start; max-width: 980px; width: 100%; margin: 0 auto; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255,255,255,0.05); border-left: 4px solid transparent; padding: 12px 16px; border-radius: 4px; }
.srow:hover { background: rgba(255,255,255,0.09); border-left-color: #f2d14b; }
.srow label { font-size: 16px; font-weight: 700; }
.sctl { display: flex; align-items: center; gap: 6px; min-width: 260px; justify-content: space-between; }
.sctl span { flex: 1; text-align: center; font-weight: 800; }
.sctl .arr { background: rgba(255,255,255,0.1); color: #fff; width: 36px; height: 36px; border-radius: 6px; font-size: 22px; line-height: 1; }
.sctl .arr:hover { background: #f2d14b; color: #10162b; }
.sctl input[type=range] { flex: 1; accent-color: #f2d14b; }
.sctl .num { flex: 0 0 40px; }
.keybtn { width: 100%; background: rgba(255,255,255,0.1); color: #fff; padding: 9px; border-radius: 6px; font-size: 15px; }
.keybtn.wait { background: #f2d14b; color: #10162b; }
#settings footer { display: flex; align-items: center; gap: 16px; padding: 14px 28px; border-top: 2px solid rgba(255,255,255,0.08); font-size: 13px; opacity: 0.85; }
@media (max-width: 600px) { .srow { flex-direction: column; align-items: stretch; } .sctl { min-width: 0; } }
@media (prefers-reduced-motion: reduce) { #xpFill { transition: none; } }


/* ================= v0.2 : compte, serveurs, boutique, app, événements ================= */
.ic { width: 1.05em; height: 1.05em; vertical-align: -0.16em; flex: 0 0 auto; }
.ic.gold, .plus .ic { color: #ffd34d; }
.ic.sk { color: #f2efe6; }
.homeCard { width: min(620px, 100%); margin: auto; }
#home { place-items: start center; padding: max(16px, env(safe-area-inset-top)) 16px 24px; }
#home .homeCard { margin-top: max(0px, calc(50vh - 430px)); }
.pill { background: var(--amber); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.pill.gold, .big.gold { background: linear-gradient(#ffe08a, #f2b84b); }
.pill.danger { background: var(--red); color: #fff; }
.pill:disabled, .big:disabled { opacity: 0.55; }
.btnLink { background: none; color: inherit; padding: 0; border: 0; text-decoration: underline; text-underline-offset: 3px; font: inherit; font-weight: 800; }
.ghost { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.ghost.wide, .wide { width: 100%; margin-top: 8px; }
.ghost.danger { color: #ffb0a8; border-color: rgba(255,120,110,0.45); }
#accountBar { margin: 0 0 12px; }
.acc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.acc .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 16px; color: var(--cream); text-decoration: none; }
.lvl { background: rgba(255,255,255,0.12); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 800; }
.plus { display: inline-flex; align-items: center; gap: 4px; background: #3a2f12; color: #ffd34d; border: 2px solid #c99a1a; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 900; }
.plus.mini { padding: 0 4px; }
.gems { display: inline-flex; align-items: center; gap: 5px; background: rgba(120,200,255,0.12); color: #bfe6ff; border-radius: 999px; padding: 4px 10px; font-weight: 900; }
.accHint { display: block; opacity: 0.7; margin-top: 6px; font-size: 12px; }
.skin.prem { border-color: rgba(255,211,77,0.35); }
.skin span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.sectionHead { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 2px 6px; font-weight: 900; }
.sectionHead small { opacity: 0.7; font-weight: 700; font-size: 12px; }
#servers { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; margin-bottom: 12px; padding-right: 2px; touch-action: pan-y; }
.srv { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'n c' 't t'; gap: 4px 8px; text-align: left; background: var(--pine-2); color: var(--cream); border: 3px solid transparent; border-radius: 14px; padding: 9px 12px; }
.srv.on { border-color: var(--amber); background: #34503f; }
.sName { grid-area: n; font-weight: 900; font-size: 15px; }
.sName small { opacity: 0.7; font-weight: 700; }
.sCount { grid-area: c; font-weight: 900; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sCount small { opacity: 0.7; }
.sTags { grid-area: t; display: flex; gap: 5px; flex-wrap: wrap; }
.sTags i { font-style: normal; font-size: 11px; font-weight: 800; background: rgba(255,255,255,0.1); border-radius: 999px; padding: 2px 8px; display: inline-flex; gap: 3px; align-items: center; }
.sTags i.hot { background: #ff7a3d; color: #2a1200; }
.sTags i.nightTag { background: #2b2f6a; color: #cfd6ff; }
.srvGroup { font-size: 12px; font-weight: 900; opacity: 0.7; margin: 6px 2px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.srvActions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.srvEmpty { opacity: 0.7; padding: 10px; }
.privRoom { border-style: dashed; }
.homeRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
#status { font-size: 13px; opacity: 0.85; margin-top: 10px; }
.keysHelp.mob { display: none; }
body.touch .keysHelp.mob { display: block; }
body.touch .keysHelp.desk { display: none; }
.adSlot { margin-top: 12px; min-height: 60px; background: rgba(0,0,0,0.15); border-radius: 12px; padding: 4px; overflow: hidden; }
.adSlot small { display: block; font-size: 10px; opacity: 0.5; text-align: left; }

/* Fenêtre */
#modal { position: fixed; inset: 0; z-index: 40; background: rgba(10,16,12,0.72); display: grid; place-items: center; padding: 16px; }
.mBox { width: min(560px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; background: var(--pine); border: 5px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); overflow: hidden; }
.mBox header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.mBox h3 { margin: 0; font: 400 28px var(--display); color: var(--amber); }
#mClose { background: rgba(255,255,255,0.1); color: var(--cream); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
#mBody { padding: 4px 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
#mBody h4 { font: 400 20px var(--display); color: var(--amber); margin: 16px 0 6px; display: flex; align-items: center; gap: 6px; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; background: rgba(0,0,0,0.2); border-radius: 12px; padding: 4px; }
.tabs button { flex: 1; background: transparent; color: var(--cream); border-radius: 9px; padding: 9px 6px; font-size: 14px; opacity: 0.75; }
.tabs button.on { background: var(--amber); color: var(--ink); opacity: 1; }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-weight: 800; font-size: 14px; }
.form input:not([type=radio]):not([type=checkbox]):not([type=range]), .form select { width: 100%; font: 800 16px var(--font); padding: 11px 12px; border-radius: 12px; border: 3px solid var(--ink); background: var(--cream); color: var(--ink); }
.form .chk { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.form .chk input { width: 20px; height: 20px; accent-color: var(--amber); }
.form small, .note, .secure { opacity: 0.75; font-size: 13px; }
.form input[type=range] { accent-color: var(--amber); width: 100%; }
.form output { font-weight: 900; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg label { display: block; position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; border-radius: 12px; background: var(--pine-2); border: 3px solid transparent; font-size: 13px; text-align: center; }
.seg input:checked + span { border-color: var(--amber); background: #34503f; }
.maps { display: grid; gap: 6px; }
.mapPick { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; background: var(--pine-2); border: 3px solid transparent; border-radius: 14px; padding: 6px; cursor: pointer; position: relative; }
.mapPick input { position: absolute; opacity: 0; }
.mapPick:has(input:checked) { border-color: var(--amber); background: #34503f; }
.mapPick canvas { width: 64px; height: 64px; border-radius: 10px; border: 3px solid var(--ink); }
.mapPick span { display: grid; gap: 2px; }
.mapPick small { font-weight: 600; }
.evChecks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 8px; }
details summary { cursor: pointer; font-weight: 800; padding: 6px 0; }
.err { color: #ffb0a8; font-weight: 800; min-height: 1em; margin: 0; }
.ok { color: #b8f5a0; }
.warn { color: #ffd59a; }
.profile .pHead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 20px; }
.lvlBar { position: relative; height: 22px; background: rgba(0,0,0,0.3); border: 3px solid var(--ink); border-radius: 11px; overflow: hidden; margin: 10px 0; }
.lvlBar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#9fd8ff, #4da3ff); }
.lvlBar span { position: relative; display: grid; place-items: center; height: 100%; font-size: 12px; font-weight: 900; text-shadow: 0 1px 0 var(--ink); }
.statGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.statGrid div { background: var(--pine-2); border-radius: 12px; padding: 8px 4px; text-align: center; }
.statGrid b { display: block; font-size: 18px; }
.statGrid small { opacity: 0.7; font-size: 11px; }
.myRooms { display: grid; gap: 6px; }
.myRoom { background: var(--pine-2); border-radius: 12px; padding: 8px 10px; display: grid; gap: 6px; }
.myRoom small { display: block; opacity: 0.75; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center; }
code { background: rgba(0,0,0,0.3); padding: 1px 6px; border-radius: 6px; font-weight: 900; letter-spacing: 1px; }
.created { text-align: center; display: grid; gap: 10px; justify-items: center; }
.codeBig { font: 400 46px var(--display); letter-spacing: 6px; color: var(--amber); background: rgba(0,0,0,0.25); padding: 6px 20px; border-radius: 14px; }
.linkBox { width: 100%; font: 700 14px var(--font); padding: 9px; border-radius: 10px; border: 3px solid var(--ink); text-align: center; }
.codeIn { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-size: 26px !important; }
.buyBox { text-align: center; display: grid; justify-items: center; gap: 8px; }
.buyBox canvas { width: 120px; height: 120px; }
.plusBox { background: linear-gradient(160deg, #3a2f12, #2a2410); border: 3px solid #c99a1a; border-radius: 16px; padding: 12px 14px; }
.plusBox h4 { margin-top: 0 !important; color: #ffd34d !important; }
.plusBox ul { margin: 0 0 6px; padding-left: 18px; line-height: 1.6; }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.offer { display: grid; gap: 4px; text-align: left; background: var(--pine-2); color: var(--cream); border: 3px solid var(--ink); border-radius: 16px; padding: 12px; }
.offer.premium { border-color: #c99a1a; }
.offer .price { font: 400 26px var(--display); color: var(--amber); }
.offer small { opacity: 0.75; }
.lbList { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lbList li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; background: var(--pine-2); border-radius: 10px; padding: 7px 10px; }
.lbList li.me { outline: 3px solid var(--amber); }
.lbList .rk { font: 400 20px var(--display); color: var(--amber); text-align: center; }
.lbList .nm small { opacity: 0.6; }
.lbList li.empty { display: block; text-align: center; opacity: 0.7; }
.steps { line-height: 1.7; padding-left: 20px; }
.kbdI { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.12); padding: 1px 8px; border-radius: 8px; font-weight: 900; }
.reward { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 20px; color: #bfe6ff; margin: 4px 0; }
.reward.guestR { font-size: 15px; color: var(--cream); display: block; }
#deathReward { display: grid; gap: 8px; justify-items: center; }
.toast.floating { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; }

/* Bannière d'installation */
#installBanner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 35; display: flex; align-items: center; gap: 10px; background: var(--pine); border: 4px solid var(--ink); border-radius: 18px; padding: 10px; box-shadow: 0 6px 0 var(--ink); max-width: 560px; margin: 0 auto; animation: slideUp 0.35s ease-out; }
#installBanner img { border-radius: 12px; flex: 0 0 auto; }
.ibText { flex: 1; min-width: 0; display: grid; }
.ibText small { opacity: 0.8; font-size: 12px; line-height: 1.3; }
.ibBtn { background: var(--amber); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 9px 12px; display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.ibX { background: transparent; color: var(--cream); width: 34px; height: 34px; display: grid; place-items: center; opacity: 0.7; }
@keyframes slideUp { from { transform: translateY(120%); } to { transform: none; } }

/* Bandeau jour/nuit + événements */
#envBox { top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%) scale(var(--ui)); transform-origin: top center; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 54vw; }
#envBox > span { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 800; white-space: nowrap; }
#phase.night { background: rgba(28,30,80,0.88); color: #d6dcff; }
#phase.day .ic { color: #ffd34d; }
#event { cursor: pointer; }
#event.soon { background: rgba(120,60,10,0.9); animation: pulse 1s infinite; }
#event.live { background: linear-gradient(90deg, #c0392b, #e67e22); color: #fff; }
@keyframes pulse { 50% { transform: scale(1.06); } }
#dashPill { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 900; opacity: 0.6; }
#dashPill.ready { opacity: 1; color: #9fd8ff; }
#leaderboard div.prem span { color: #ffd34d; }
#leaderboard small { opacity: 0.6; font-size: 10px; }
/* Éliminations à côté de l'or : compact, sur une ligne */
#leaderboard div b { margin-left: auto; white-space: nowrap; }
#leaderboard div em.kl { flex: 0 0 auto; min-width: 2.4em; font-style: normal; font-size: 0.86em; opacity: 0.75; white-space: nowrap; text-align: right; }
#leaderboard em.kl .ic { width: 0.95em; height: 0.95em; margin-right: 1px; color: #ff9a7a; }
#rotateHint { display: none; }

/* Mobile : gros boutons ronds, mode gaucher, portrait */
body.touch #mBtns { right: calc(12px + env(safe-area-inset-right)); bottom: calc(150px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, auto); gap: 8px; }
body.touch #mBtns .mb { width: calc(62px * var(--btn, 1)); height: calc(62px * var(--btn, 1)); padding: 0; border-radius: 50%; font-size: calc(11px * var(--btn, 1)); display: grid; place-items: center; align-content: center; gap: 1px; }
body.touch #mBtns .big2 { grid-column: span 2; justify-self: end; width: calc(78px * var(--btn, 1)); height: calc(78px * var(--btn, 1)); background: rgba(40,90,140,0.9); }
body.touch #mBtns .big2 .ic { width: 24px; height: 24px; color: #9fd8ff; }
body.touch #mBtns .big2.cd { opacity: 0.55; }
body.touch.lefty #mBtns { right: auto; left: calc(12px + env(safe-area-inset-left)); }
body.touch.lefty #mBtns .big2 { justify-self: start; }
body.touch.lefty #minimapBox { left: auto; right: 12px; transform-origin: bottom right; }
body.touch #dashPill { display: none; }
body.touch #leaderboard { width: 150px; font-size: 11px; padding: 6px 8px; }
body.touch #leaderboard h4 { font-size: 15px; }
body.touch #minimap { width: 110px; height: 110px; }
body.touch #hotbar { gap: 4px; max-width: 96vw; overflow-x: auto; }
body.touch .slot { width: 46px; height: 46px; border-radius: 12px; }
body.touch #bottomCenter { bottom: calc(8px + env(safe-area-inset-bottom)); }
body.touch #xpBar { width: 180px; height: 18px; }
body.touch #ageLabel { font-size: 18px; }
body.touch #resources { right: auto; left: 50%; transform: translateX(-50%) scale(var(--ui)); transform-origin: bottom center; bottom: calc(96px + env(safe-area-inset-bottom)); grid-template-columns: repeat(4, auto); }
body.touch .res b { font-size: 14px; }
body.touch .res i { width: 12px; height: 12px; }
body.touch #topLeft button { padding: 6px 10px; font-size: 13px; }
body.touch #upgrades { transform: translate(-50%, -55%) scale(var(--ui)); max-height: 80vh; overflow-y: auto; }
body.touch #upgrades .cards { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
body.touch #chatInput { top: 30%; bottom: auto; }
@media (orientation: portrait) {
  body.touch #rotateHint { display: block; position: fixed; top: calc(92px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 6; background: var(--panel); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 800; pointer-events: none; animation: fadeHint 7s forwards; white-space: nowrap; }
  body.touch #envBox { max-width: 92vw; top: calc(52px + env(safe-area-inset-top)); }
  body.touch #leaderboard { display: none; }
  body.touch #mBtns { bottom: calc(190px + env(safe-area-inset-bottom)); }
  body.touch #resources { bottom: calc(100px + env(safe-area-inset-bottom)); grid-template-columns: repeat(2, auto); }
  body.touch #minimapBox { bottom: calc(190px + env(safe-area-inset-bottom)); }
}
@keyframes fadeHint { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (orientation: landscape) and (max-height: 500px) {
  body.touch #mBtns { bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.touch #minimap { width: 86px; height: 86px; }
  body.touch #minimapBox #biome, body.touch #minimapBox #bossTimer { font-size: 11px; }
  body.touch #leaderboard { max-height: 38vh; overflow: hidden; }
  body.touch #resources { bottom: calc(72px + env(safe-area-inset-bottom)); }
  #home .homeCard { margin-top: 0; }
  #servers { max-height: 180px; }
}
@media (max-width: 520px) {
  .homeCard { padding: 18px 14px 16px; border-radius: 20px; }
  h1 { font-size: 52px; }
  .tag { font-size: 14px; margin-bottom: 12px; }
  .statGrid { grid-template-columns: repeat(2, 1fr); }
  #modal { padding: 0; place-items: end stretch; }
  .mBox { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; border-bottom: 0; box-shadow: none; padding-bottom: env(safe-area-inset-bottom); }
  .two, .evChecks { grid-template-columns: 1fr; }
  .big { font-size: 28px; }
}
body.standalone #installBanner { display: none !important; }
.big { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
body.touch #hotbar { scrollbar-width: none; overscroll-behavior: contain; }
body.touch #hotbar::-webkit-scrollbar { display: none; }
body.touch .slot kbd { display: none; }
@media (min-width: 900px) { #installBanner { left: auto; right: 16px; max-width: 420px; } }
#home, #death { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.homeCard { width: 100%; max-width: 620px; min-width: 0; }
#death .homeCard { max-width: 560px; }
@media (orientation: portrait) { body.touch #rotateHint { top: calc(132px + env(safe-area-inset-top)); } body.touch #resources { bottom: calc(112px + env(safe-area-inset-bottom)); } }

/* ================= v0.3 : chat, émotes, bonus, clans ================= */
#chatLog { left: 12px; bottom: calc(250px + env(safe-area-inset-bottom)); width: min(360px, 60vw); max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; pointer-events: none; scrollbar-width: none; transform: scale(var(--ui)); transform-origin: bottom left; }
#chatLog::-webkit-scrollbar { display: none; }
#chatLog .cl { background: rgba(20,30,24,0.62); border-radius: 10px; padding: 4px 10px; font-size: 13px; font-weight: 700; line-height: 1.35; text-shadow: 0 1px 0 rgba(0,0,0,0.5); transition: opacity 1s; word-break: break-word; align-self: flex-start; max-width: 100%; }
#chatLog .cl b { color: #ffe08f; }
#chatLog .cl.me b { color: #9fd8ff; }
#chatLog .cl.clan { background: rgba(30,60,110,0.7); }
#chatLog .cl.clan b { color: #9fd8ff; }
#chatLog .cl.staff b { color: #ffd34d; }
#chatLog .cl.prem b { color: #ffe7a0; }
#chatLog .cl.old { opacity: 0; }
#chatLog.open { pointer-events: auto; background: rgba(20,30,24,0.35); border-radius: 12px; padding: 4px; }
#chatLog.open .cl.old { opacity: 1; }
#chatBar { left: 50%; bottom: calc(200px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, 94vw); display: flex; gap: 6px; align-items: center; z-index: 9; background: var(--pine); border: 3px solid var(--ink); border-radius: 16px; padding: 6px; }
#chatBar #chatInput { position: static; transform: none; left: auto; bottom: auto; flex: 1; min-width: 0; width: auto; padding: 10px; border-radius: 10px; border: 3px solid var(--ink); font: 800 16px var(--font); background: var(--cream); color: var(--ink); }
#chatBar > button { flex: 0 0 auto; height: 42px; min-width: 42px; border-radius: 10px; background: var(--pine-2); color: var(--cream); border: 3px solid var(--ink); font-size: 18px; display: grid; place-items: center; padding: 0 8px; }
#chatChan { font-size: 13px !important; }
#chatChan.clan { background: #2c5a9a !important; }
#chatSend { background: var(--amber) !important; color: var(--ink) !important; }
#emoPicker { position: absolute; bottom: calc(100% + 6px); right: 0; width: min(320px, 90vw); display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: var(--pine); border: 3px solid var(--ink); border-radius: 14px; padding: 6px; max-height: 190px; overflow-y: auto; }
#emoPicker button { background: transparent; font-size: 22px; padding: 4px 0; border-radius: 8px; }
#emoPicker button:hover { background: rgba(255,255,255,0.1); }
#emoteWheel { left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: rgba(20,30,24,0.85); border: 3px solid var(--ink); border-radius: 22px; padding: 12px; z-index: 9; }
#emoteWheel button { width: 64px; height: 64px; font-size: 36px; border-radius: 16px; background: var(--pine-2); border: 3px solid transparent; display: grid; place-items: center; touch-action: none; }
#emoteWheel button:hover { border-color: var(--amber); }
#buffs { left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%) scale(var(--ui)); transform-origin: bottom center; display: flex; gap: 6px; pointer-events: none; }
.buffPill { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 3px solid var(--c); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.buffPill b { color: var(--c); }
.buffPill .pu { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
#btnClan.notif { background: #c0392b !important; animation: pulse 1s infinite; }
#clanPanel h3 small { font: 700 13px var(--font); opacity: 0.7; }
#clanPanel h4 { margin: 10px 0 4px; font: 400 18px var(--display); color: var(--amber); }
#clanPanel .reqs li { background: rgba(255,255,255,0.06); border-radius: 8px; padding: 4px 6px; }
#clanPanel .ghostB { background: transparent !important; color: var(--cream) !important; }
#clanPanel .chkRow { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-top: 8px; }
#clanPanel .chkRow input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--amber); }
.seg.mini span { padding: 6px 4px; font-size: 12px; }
body.touch #chatLog { bottom: auto; top: calc(100px + env(safe-area-inset-top)); max-height: 110px; width: min(300px, 46vw); }
body.touch #chatLog .cl { font-size: 12px; padding: 3px 8px; }
body.touch #chatBar { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
body.touch #chatBar #emoPicker { bottom: auto; top: calc(100% + 6px); }
body.touch #buffs { bottom: calc(132px + env(safe-area-inset-bottom)); }
body.touch #mEmote { font-size: 24px !important; }
@media (orientation: portrait) {
  body.touch #chatLog { top: calc(150px + env(safe-area-inset-top)); width: 70vw; }
  body.touch #buffs { bottom: calc(150px + env(safe-area-inset-bottom)); flex-wrap: wrap; justify-content: center; width: 90vw; }
}
@media (orientation: landscape) and (max-height: 500px) {
  body.touch #chatLog { top: calc(60px + env(safe-area-inset-top)); max-height: 80px; }
  #emoteWheel button { width: 52px; height: 52px; font-size: 30px; }
}

/* ================= v0.4 : motion design de l'interface ================= */
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes floatT { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
@keyframes shine { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.6); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes slideUpIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 6px 0 var(--ink), 0 0 0 0 rgba(242,184,75,0.5); } 50% { box-shadow: 0 6px 0 var(--ink), 0 0 0 10px rgba(242,184,75,0); } }
@keyframes deathIn { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(3px); } }
#home .homeCard { animation: cardIn 0.55s cubic-bezier(.2,.9,.3,1.2) both; }
#home h1 { animation: floatT 4s ease-in-out infinite; display: inline-block; }
#home #btnPlay:not(:disabled) { animation: glowPulse 2.2s infinite; background-image: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%); background-size: 200% 100%; background-color: var(--amber); }
#home #btnPlay:not(:disabled):hover { animation: glowPulse 2.2s infinite, shine 1.2s linear infinite; }
.big, .pill, .ghost, .srv, .skin, .slot, .card, .offer, #mBtns .mb, #topLeft button { transition: transform 0.18s cubic-bezier(.3,1.6,.5,1), background-color 0.2s, border-color 0.2s, box-shadow 0.2s; }
.big:hover, .pill:hover, .offer:hover, .srv:hover { transform: translateY(-2px); }
.skin:hover { transform: translateY(-4px) rotate(-1.5deg); }
.skin.on { animation: popIn 0.35s both; }
.ghost:hover { border-color: rgba(246,239,220,0.7); }
.big:active, .pill:active, .ghost:active, .srv:active, .skin:active, #mBtns .mb:active { transform: scale(0.94); }
.srv { animation: slideUpIn 0.35s both; }
.srv:nth-child(2) { animation-delay: 0.04s; } .srv:nth-child(3) { animation-delay: 0.08s; } .srv:nth-child(4) { animation-delay: 0.12s; } .srv:nth-child(5) { animation-delay: 0.16s; } .srv:nth-child(6) { animation-delay: 0.2s; }
.mBox { animation: cardIn 0.32s cubic-bezier(.2,.9,.3,1.15) both; }
#death:not(.hidden) { animation: deathIn 0.5s both; }
#death .homeCard { animation: cardIn 0.5s 0.1s cubic-bezier(.2,.9,.3,1.2) both; }
#death h2 { animation: popIn 0.6s 0.2s both; }
.reward, .lvlUp { animation: popIn 0.5s 0.35s both; }
.lvlUp { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(90deg, #3a2f12, #5a4614); border: 3px solid #c99a1a; color: #ffd34d; border-radius: 14px; padding: 6px 12px; font-weight: 900; }
.lvlUp.skinUp { background: linear-gradient(90deg, #1f3a52, #2c5a7a); border-color: #4da3ff; color: #bfe6ff; animation-delay: 0.5s; }
.slot { transition: transform 0.15s cubic-bezier(.3,1.8,.5,1); }
.slot.on { transform: translateY(-6px) scale(1.06); }
#upgrades:not(.hidden) { animation: popIn 0.4s cubic-bezier(.2,.9,.3,1.3) both; }
#upgrades .card { animation: slideUpIn 0.35s both; }
#upgrades .card:nth-child(2) { animation-delay: 0.07s; } #upgrades .card:nth-child(3) { animation-delay: 0.14s; } #upgrades .card:nth-child(4) { animation-delay: 0.21s; } #upgrades .card:nth-child(5) { animation-delay: 0.28s; }
#upgrades .card:hover { transform: translateY(-4px) scale(1.03); }
#xpFill { background: linear-gradient(110deg, #ffd774 30%, #fff3c4 50%, #e8a52c 70%); background-size: 200% 100%; animation: shine 3s linear infinite; }
.res b { display: inline-block; }
.buffPill { animation: popIn 0.3s both; }
#envBox > span { transition: background 0.4s; }
#event.live { animation: popIn 0.4s both; }
.toast { animation: toastIn 3.2s forwards; }
@keyframes toastIn { 0% { opacity: 0; transform: translateY(12px) scale(0.9); } 6% { opacity: 1; transform: translateY(-2px) scale(1.03); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
#announce.show { animation: announce2 6s forwards; }
@keyframes announce2 { 0% { opacity: 0; transform: translate(-50%, -16px) scale(0.92); letter-spacing: 3px; } 6% { opacity: 1; transform: translate(-50%, 0) scale(1.04); letter-spacing: 0; } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }
.homeRow.three { grid-template-columns: repeat(3, 1fr); }
.homeRow.three .ghost { padding: 8px 6px; font-size: 14px; }
.qmI { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; background: var(--amber); color: var(--ink); font-size: 0.85em; }
.statusRow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.statusRow #status { margin: 0; }
.langBtn { background: rgba(255,255,255,0.1); color: var(--cream); border-radius: 999px; padding: 4px 10px; font-size: 12px; border: 2px solid rgba(246,239,220,0.3); }
#btnHelp b { font-size: 16px; }
#event .qm { font-style: normal; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,0.25); font-size: 11px; margin-left: 2px; }
.tabs.wrap { flex-wrap: wrap; }
.tabs.wrap button { flex: 1 1 auto; font-size: 13px; }
.gList { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.gList li { background: var(--pine-2); border-radius: 12px; padding: 9px 12px; display: grid; gap: 2px; position: relative; animation: slideUpIn 0.3s both; }
.gList li b { font-size: 15px; color: var(--amber); }
.gList li small { opacity: 0.85; line-height: 1.4; }
.gList li em { position: absolute; top: 9px; right: 12px; font-style: normal; font-size: 11px; opacity: 0.6; }
.gList li .pu { position: absolute; top: 12px; right: 12px; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.gList li.gKey { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.gList kbd { background: var(--cream); color: var(--ink); border-radius: 8px; padding: 3px 9px; font: 900 13px var(--font); box-shadow: 0 3px 0 var(--ink); }
.pTitle { display: inline-flex; align-items: center; gap: 6px; color: var(--amber); font-weight: 900; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }

/* ================= v0.5 : garde-robe, fil des éliminations ================= */
.wardBtn { margin: 0 0 12px; }
.ward { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.wPrev { position: sticky; top: 0; background: radial-gradient(circle at 50% 55%, #34503f, #1f2f27 70%); border-radius: 18px; border: 3px solid var(--ink); }
.wPrev canvas { width: 100%; height: auto; display: block; }
.wOpts h4 { margin: 10px 0 6px !important; font-size: 17px !important; }
.wSkins { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.wSk { position: relative; aspect-ratio: 1; border-radius: 50%; background: var(--b); border: 3px solid var(--ink); padding: 0; box-shadow: inset -5px -5px 0 var(--a); transition: transform 0.15s cubic-bezier(.3,1.8,.5,1); }
.wSk.on { outline: 3px solid var(--amber); outline-offset: 2px; transform: scale(1.1); }
.wSk.locked { filter: none; }
.wSk .ic { position: absolute; inset: auto -2px -2px auto; width: 16px; height: 16px; color: #fff; background: var(--ink); border-radius: 50%; padding: 2px; }
.wSk:hover { transform: scale(1.12); }
.wChips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--pine-2); color: var(--cream); border: 2px solid transparent; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip.on { border-color: var(--amber); background: #34503f; }
.chip.locked { opacity: 0.5; cursor: not-allowed; }
.wCols { display: flex; flex-wrap: wrap; gap: 6px; }
.wCols .col { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--ink); padding: 0; background: var(--pine-2); color: var(--cream); font-weight: 900; transition: transform 0.15s; }
.wCols .col.on { outline: 3px solid var(--amber); outline-offset: 2px; transform: scale(1.12); }
.ward #wSave { margin-top: 14px; width: 100%; }
@media (max-width: 560px) { .ward { grid-template-columns: 1fr; } .wPrev { position: static; max-width: 220px; margin: 0 auto; } }
#btnWardHud .ic { width: 18px; height: 18px; }
#killFeed { top: calc(258px + env(safe-area-inset-top)); right: 12px; display: grid; gap: 4px; justify-items: end; pointer-events: none; transform: scale(var(--ui)); transform-origin: top right; }
#killFeed .kf { display: inline-flex; align-items: center; gap: 6px; background: rgba(20,30,24,0.72); border: 2px solid var(--ink); border-radius: 10px; padding: 3px 10px; font-size: 13px; font-weight: 800; animation: kfIn 0.35s cubic-bezier(.2,.9,.3,1.3) both; transition: opacity 0.5s, transform 0.5s; }
#killFeed .kf b { color: #ffb07a; }
#killFeed .kf.me { border-color: var(--amber); background: rgba(80,60,15,0.85); }
#killFeed .kf.out { opacity: 0; transform: translateX(30px); }
@keyframes kfIn { from { opacity: 0; transform: translateX(40px) scale(0.9); } to { opacity: 1; transform: none; } }
body.touch #killFeed { top: calc(60px + env(safe-area-inset-top)); font-size: 11px; }
@media (orientation: portrait) { body.touch #killFeed { top: calc(200px + env(safe-area-inset-top)); } }

/* ================= v0.6 : infos de pose ================= */
.selInfo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; background: var(--panel); border: 3px solid var(--ink); border-radius: 14px; padding: 5px 12px; font-size: 13px; font-weight: 800; animation: popIn 0.25s both; max-width: 92vw; }
.selInfo b { color: var(--amber); }
.selInfo.ko { border-color: #8a2a24; }
.selInfo.ok { border-color: #3f8a3a; }
.selInfo .cost { display: inline-flex; align-items: center; gap: 4px; }
.selInfo .cost i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); }
.selInfo .cost.ko { color: #ffb0a8; }
.selInfo .cost em { font-style: normal; font-size: 11px; background: rgba(224,80,63,0.3); border-radius: 6px; padding: 0 5px; }
.selInfo .lim { background: rgba(255,255,255,0.12); border-radius: 999px; padding: 1px 8px; }
.selInfo .lim.ko { background: rgba(224,80,63,0.4); }
body.touch .selInfo { font-size: 11px; padding: 3px 8px; }
#minimap { cursor: zoom-in; }
#minimapBox.big { left: 50% !important; bottom: 50% !important; transform: translate(-50%, 50%) !important; z-index: 12; }
#minimapBox.big { display: flex; flex-direction: column; align-items: center; width: max-content; max-width: 96vw; background: var(--pine); border: 4px solid var(--ink); border-radius: 22px; padding: 12px; box-shadow: 0 10px 0 var(--ink); }
#minimapBox.big #minimap { width: min(78vmin, 620px) !important; height: min(78vmin, 620px) !important; cursor: zoom-out; }
#minimapBox.big #biome { text-align: center; font-size: 16px; margin-top: 6px; }

/* ================= v0.7 : HUD mobile refait (prioritaire sur les règles précédentes) ================= */
/* Âge centré au-dessus de la barre d'XP (partout) */
#ageRow { flex-direction: column; gap: 3px; }
#ageRow #ageLabel { line-height: 1; white-space: nowrap; }
#ageRow #dashPill { position: absolute; right: -96px; bottom: 2px; }
#bottomCenter #ageRow { position: relative; }

body.touch #bottomCenter { left: 50%; bottom: calc(6px + env(safe-area-inset-bottom)); transform: translateX(-50%); gap: 5px; width: auto; }
body.touch #ageRow { gap: 2px; }
body.touch #ageLabel { font-size: 15px; }
body.touch #xpBar { width: min(230px, 56vw); height: 16px; }
body.touch #xpText { font-size: 10px; }
body.touch .slot { width: 44px; height: 44px; }
body.touch #selInfo { font-size: 11px; padding: 3px 8px; gap: 5px; max-width: 70vw; }

/* Ressources : une ligne compacte en haut */
body.touch #resources { display: flex !important; gap: 4px; top: calc(52px + env(safe-area-inset-top)); bottom: auto !important; left: 8px !important; right: auto !important; transform: none !important; grid-template-columns: none; }
body.touch .res { min-width: 0; padding: 2px 7px; gap: 4px; border-width: 2px; border-radius: 10px; }
body.touch .res span { display: none; }
body.touch .res b { font-size: 12px; }
body.touch .res i { width: 10px; height: 10px; border-width: 2px; }

/* Boutons d'action : grappe en bas à droite, Esquive en grand */
body.touch #mBtns { display: grid !important; grid-template-columns: repeat(3, auto); grid-template-areas: "auto chat emote" "use eat dash"; gap: 6px; align-items: end; right: calc(8px + env(safe-area-inset-right)) !important; left: auto !important; bottom: calc(10px + env(safe-area-inset-bottom)) !important; }
body.touch #mBtns .mb { width: calc(46px * var(--btn, 1)) !important; height: calc(46px * var(--btn, 1)) !important; font-size: calc(10px * var(--btn, 1)) !important; border-width: 2px; }
body.touch #mBtns #mDash { grid-area: dash; width: calc(68px * var(--btn, 1)) !important; height: calc(68px * var(--btn, 1)) !important; justify-self: end; }
body.touch #mBtns #mEat { grid-area: eat; } body.touch #mBtns #mUse { grid-area: use; } body.touch #mBtns #mAuto { grid-area: auto; }
body.touch #mBtns #mChat { grid-area: chat; } body.touch #mBtns #mEmote { grid-area: emote; font-size: 20px !important; }
body.touch.lefty #mBtns { right: auto !important; left: calc(8px + env(safe-area-inset-left)) !important; grid-template-areas: "emote chat auto" "dash eat use"; }

/* Mini-carte compacte en bas à gauche */
body.touch #minimapBox:not(.big) { left: 8px; bottom: calc(10px + env(safe-area-inset-bottom)) !important; top: auto; right: auto; transform: none; }
body.touch #minimapBox:not(.big) #minimap { width: 92px !important; height: 92px !important; border-width: 3px; border-radius: 12px; }
body.touch #minimapBox:not(.big) #biome, body.touch #minimapBox:not(.big) #bossTimer { font-size: 10px; }
body.touch.lefty #minimapBox:not(.big) { left: auto; right: 8px; }

/* Classement réduit (paysage) */
body.touch #leaderboard { width: 132px; font-size: 10px; padding: 5px 7px; max-height: 92px; overflow: hidden; border-width: 2px; }
body.touch #leaderboard h4 { font-size: 13px; margin-bottom: 2px; }
body.touch #leaderboard div { gap: 3px; }
body.touch #leaderboard div em.kl { min-width: 2em; font-size: 0.9em; }
body.touch #killFeed { top: calc(110px + env(safe-area-inset-top)); }
body.touch #chatLog { top: calc(84px + env(safe-area-inset-top)); left: 8px; bottom: auto; max-height: 90px; width: min(260px, 40vw); }
body.touch #buffs { bottom: auto; top: calc(84px + env(safe-area-inset-top)); left: 50%; }
body.touch #envBox { top: calc(8px + env(safe-area-inset-top)); max-width: 46vw; }
body.touch #envBox > span { font-size: 11px; padding: 3px 9px; border-width: 2px; }
body.touch #topLeft { gap: 5px; top: calc(8px + env(safe-area-inset-top)); left: 8px; }
body.touch #topLeft button { padding: 5px 9px; font-size: 12px; border-width: 2px; }
body.touch #stats { display: none; }

/* Portrait : on empile proprement */
@media (orientation: portrait) {
  body.touch #envBox { top: calc(48px + env(safe-area-inset-top)); max-width: 94vw; }
  body.touch #resources { top: calc(112px + env(safe-area-inset-top)); left: 50% !important; transform: translateX(-50%) !important; }
  body.touch #leaderboard { display: none; }
  body.touch #killFeed { top: calc(144px + env(safe-area-inset-top)); }
  body.touch #chatLog { top: calc(176px + env(safe-area-inset-top)); width: 64vw; }
  body.touch #buffs { top: calc(144px + env(safe-area-inset-top)); }
  body.touch #rotateHint { top: calc(176px + env(safe-area-inset-top)); }
  body.touch #bottomCenter { bottom: calc(132px + env(safe-area-inset-bottom)); }
  body.touch #mBtns { bottom: calc(10px + env(safe-area-inset-bottom)) !important; }
  body.touch #minimapBox:not(.big) { bottom: calc(10px + env(safe-area-inset-bottom)) !important; }
  body.touch #upgrades { width: 94vw; }
}
@media (orientation: portrait) and (max-width: 420px) {
  body.touch .slot { width: 40px; height: 40px; }
  body.touch #hotbar { gap: 3px; }
}
/* Paysage bas (téléphone couché) */
@media (orientation: landscape) and (max-height: 500px) {
  body.touch #bottomCenter { bottom: calc(4px + env(safe-area-inset-bottom)); }
  body.touch #resources { top: calc(44px + env(safe-area-inset-top)); }
  body.touch #chatLog { top: calc(74px + env(safe-area-inset-top)); max-height: 70px; }
  body.touch #minimapBox:not(.big) #minimap { width: 82px !important; height: 82px !important; }
  body.touch #mBtns .mb { width: calc(42px * var(--btn, 1)) !important; height: calc(42px * var(--btn, 1)) !important; }
  body.touch #mBtns #mDash { width: calc(60px * var(--btn, 1)) !important; height: calc(60px * var(--btn, 1)) !important; }
}

/* ================= v0.9 : chargement, gadgets, clans, animations ================= */
#loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2a3f34, #121a15 70%); transition: opacity 0.6s, transform 0.6s; }
#loading.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.ldCard { text-align: center; display: grid; gap: 16px; justify-items: center; padding: 16px; }
.ldTitle { margin: 0; font: 400 clamp(54px, 13vw, 96px) var(--display); color: var(--amber); text-shadow: 0 5px 0 var(--ink); display: flex; }
.ldTitle span, .bigTitle .l { display: inline-block; animation: letterHop 1.6s cubic-bezier(.3,1.6,.5,1) infinite; }
.ldTitle span:nth-child(2), .bigTitle .l:nth-child(2) { animation-delay: 0.08s; } .ldTitle span:nth-child(3), .bigTitle .l:nth-child(3) { animation-delay: 0.16s; } .ldTitle span:nth-child(4), .bigTitle .l:nth-child(4) { animation-delay: 0.24s; }
.ldTitle span:nth-child(5), .bigTitle .l:nth-child(5) { animation-delay: 0.32s; } .ldTitle span:nth-child(6), .bigTitle .l:nth-child(6) { animation-delay: 0.4s; } .ldTitle span:nth-child(7), .bigTitle .l:nth-child(7) { animation-delay: 0.48s; }
.bigTitle .l { animation-duration: 3.2s; }
@keyframes letterHop { 0%, 60%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-14px) rotate(-6deg); } 35% { transform: translateY(2px) rotate(3deg); } }
.ldBar { width: min(320px, 70vw); height: 14px; border-radius: 999px; background: rgba(0,0,0,0.35); border: 3px solid var(--ink); overflow: hidden; }
.ldBar i { display: block; height: 100%; width: 40%; border-radius: 999px; background: linear-gradient(90deg, #ffd774, #e8a52c); animation: ldSlide 1.1s ease-in-out infinite; }
@keyframes ldSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
#ldTip { margin: 0; opacity: 0.8; font-weight: 700; font-size: 14px; max-width: 80vw; }
#ageBurst { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; pointer-events: none; opacity: 0; }
#ageBurst b { font: 400 clamp(48px, 10vw, 110px) var(--display); color: #ffd34d; text-shadow: 0 6px 0 var(--ink), 0 0 40px rgba(255,211,77,0.8); }
#ageBurst::before { content: ''; position: absolute; width: 160vmax; height: 160vmax; background: repeating-conic-gradient(rgba(255,211,77,0.18) 0 10deg, transparent 10deg 20deg); border-radius: 50%; }
#ageBurst.go { animation: burstIn 1.8s ease-out forwards; }
#ageBurst.go::before { animation: raySpin 1.8s linear; }
#ageBurst.go b { animation: popIn 0.6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes burstIn { 0% { opacity: 0; } 10%, 65% { opacity: 1; } 100% { opacity: 0; } }
@keyframes raySpin { from { transform: rotate(0) scale(0.6); } to { transform: rotate(40deg) scale(1); } }
body.dead canvas#game { filter: grayscale(0.85) brightness(0.8); transition: filter 0.8s; }
canvas#game { transition: filter 0.6s; }
.res.bump b { animation: bump 0.35s cubic-bezier(.3,1.8,.5,1); color: #ffe08f; }
.res.zero { opacity: 0.55; }
#gadgetPill { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 900; }
#gadgetPill .gBar { width: 80px; height: 8px; border-radius: 6px; background: rgba(0,0,0,0.4); overflow: hidden; }
#gadgetPill .gBar i { display: block; height: 100%; background: linear-gradient(90deg, #4da3ff, #9fe0ff); transition: width 0.15s; }
#gadgetPill.low .gBar i { background: #e0503f; }
#gadgetPill.flying { border-color: #ffb347; box-shadow: 0 0 12px rgba(255,179,71,0.6); }
body.touch #mBtns #mGadget { grid-area: gad; background: rgba(140,80,30,0.9); }
body.touch #mBtns:has(#mGadget:not(.hidden)) { grid-template-areas: "auto chat emote" "gad eat dash" "use . dash"; }
.emblems { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 8px; }
.emb { background: rgba(255,255,255,0.06) !important; border: 2px solid transparent !important; border-radius: 10px !important; padding: 3px !important; display: grid; place-items: center; }
.emb.on { border-color: var(--amber) !important; }
.emblemCols { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.ecol { width: 22px; height: 22px; border-radius: 50% !important; border: 2px solid var(--ink) !important; padding: 0 !important; }
.ecol.on { outline: 3px solid var(--amber); }
.cIco { display: inline-grid; vertical-align: middle; margin-right: 6px; }
.clanIco { display: block; }
.giftB { background: #5fae4f !important; color: #fff !important; }
.giftRow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; background: rgba(255,255,255,0.06); padding: 8px; border-radius: 10px; }
.giftRow b { grid-column: 1 / -1; font-size: 13px; }
.giftRow select, .giftRow input { min-width: 0; padding: 6px; border-radius: 8px; border: 2px solid var(--ink); font: 800 13px var(--font); }
@media (orientation: portrait) {
  body.touch #hotbar { flex-wrap: wrap; justify-content: center; max-width: 94vw; overflow: visible; }
  body.touch #bottomCenter { bottom: calc(196px + env(safe-area-inset-bottom)); }
  body.touch #mBtns:has(#mGadget:not(.hidden)) ~ #bottomCenter { bottom: calc(196px + env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) and (max-height: 500px) { body.touch #hotbar { max-width: 56vw; flex-wrap: wrap; justify-content: center; } body.touch .slot { width: 38px; height: 38px; } }
@media (orientation: portrait) { body.touch #gadgetPill { display: none !important; } }
body.touch #mBtns #mGadget { background: conic-gradient(rgba(255,179,71,0.95) var(--fuel, 100%), rgba(60,40,20,0.85) 0) !important; }

/* ================= v1.0 : armurerie, véhicules, gadgets ================= */
.armBtn { display: inline-flex; align-items: center; gap: 5px; background: linear-gradient(#5a6b3a, #3a3f2c) !important; }
.armBtn .ic { color: #ffd34d; }
body.touch .armBtn span { display: none; }
.armory { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.arm-item { display: grid; gap: 4px; justify-items: center; text-align: center; background: var(--pine-2); color: var(--cream); border: 3px solid var(--ink); border-radius: 16px; padding: 10px; transition: transform 0.18s cubic-bezier(.3,1.6,.5,1); }
.arm-item:hover { transform: translateY(-3px) scale(1.02); border-color: var(--amber); }
.arm-item canvas { width: 160px; height: 110px; max-width: 100%; }
.arm-item b { font: 400 20px var(--display); color: var(--amber); }
.arm-item small { opacity: 0.8; font-size: 12px; line-height: 1.35; }
.arm-item .price { font-weight: 900; color: #ffd34d; display: inline-flex; gap: 4px; align-items: center; }
.arm-item.poor { opacity: 0.55; }
#vehPill { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(90deg, #5a6b3a, #3a3f2c); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-size: 12px; font-weight: 900; color: #fff; animation: popIn 0.3s both; }
#vehPill .arm { color: #9fe0ff; }
#gadgetPill em { font-style: normal; font-size: 10px; opacity: 0.8; background: rgba(255,255,255,0.12); border-radius: 6px; padding: 1px 6px; }
body.touch #mBtns #mArmory { grid-area: arm; background: linear-gradient(#5a6b3a, #3a3f2c); }
body.touch #mBtns { grid-template-areas: "auto chat emote" "arm eat dash" "use . dash"; }
body.touch #mBtns:has(#mGadget:not(.hidden)) { grid-template-areas: "auto chat emote" "gad eat dash" "use arm dash"; }
body.touch #mBtns #mEmote .ic { width: 24px; height: 24px; color: #ffd34d; }
@media (orientation: portrait) { body.touch #toasts { bottom: calc(300px + env(safe-area-inset-bottom)); } body.touch #bottomCenter { bottom: calc(206px + env(safe-area-inset-bottom)); } }
/* v1.0 : panneau d'âge recentré (l'animation ne casse plus le centrage) */
#upgrades { --upy: -62%; }
body.touch #upgrades { --upy: -55%; }
#upgrades:not(.hidden) { animation: upgIn 0.4s cubic-bezier(.2,.9,.3,1.3) both !important; transform: translate(-50%, var(--upy)) scale(var(--ui)) !important; }
@keyframes upgIn { from { opacity: 0; transform: translate(-50%, var(--upy)) scale(0.7); } to { opacity: 1; transform: translate(-50%, var(--upy)) scale(var(--ui)); } }
body.touch #toasts { top: calc(80px + env(safe-area-inset-top)) !important; bottom: auto !important; max-width: 70vw; }
body.touch .toast { font-size: 12px; padding: 5px 10px; }
@media (orientation: portrait) { body.touch #toasts { top: calc(146px + env(safe-area-inset-top)) !important; max-width: 92vw; } }

/* ================= v1.1 : achats retirables ================= */
#vehPill { background: transparent !important; border: 0 !important; padding: 0 !important; gap: 6px; flex-wrap: wrap; justify-content: center; }
#vehPill .vp { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(90deg, #5a6b3a, #3a3f2c); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 4px 2px 12px; font-size: 12px; font-weight: 900; color: #fff; pointer-events: auto; }
#vehPill button { width: 22px; height: 22px; border-radius: 50%; background: #c0392b; color: #fff; font-size: 14px; line-height: 1; display: grid; place-items: center; border: 2px solid var(--ink); padding: 0; }
#bottomCenter #vehPill { pointer-events: auto; }

/* ================= v1.2 : mariage, spectateur, niveaux de clan ================= */
.playRow { display: flex; gap: 8px; align-items: stretch; }
.playRow #btnPlay { flex: 1; }
.playRow .specB { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; }
#specBar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 8px; background: rgba(38,48,41,0.92); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 8px 6px 14px; color: #fff; font-weight: 900; max-width: calc(100vw - 32px); }
#specBar .specTag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #9fd0ff; }
#specBar #specName { min-width: 90px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
#specBar button { min-height: 34px; padding: 0 12px; border-radius: 999px; }
#specPrev, #specNext { width: 34px; padding: 0 !important; font-size: 20px; }
body.spectating #bottomCenter, body.spectating #mBtns, body.spectating #hotbar, body.spectating #resBox, body.spectating #resources, body.spectating .joy, body.spectating #upgrades { display: none !important; }
#marPill { pointer-events: auto; display: flex; justify-content: center; }
#marPill button { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: linear-gradient(90deg, #ff6fa8, #c94d84); color: #fff; border: 3px solid var(--ink); padding: 3px 12px; font-weight: 900; font-size: 12px; }
#marPill button.cd { filter: saturate(.4); }
#marPill small { opacity: .85; }
#marPill .marBox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; background: rgba(38,48,41,0.9); border: 3px solid var(--ink); border-radius: 16px; padding: 6px 10px; color: #ffe3ef; max-width: min(92vw, 520px); }
.heartI { color: #ff6fa8; width: 16px; height: 16px; }
#marPill button .heartI { color: #fff; }
#marAsk { position: fixed; top: 18%; left: 50%; transform: translateX(-50%); z-index: 60; background: #fff7fb; border: 4px solid var(--ink); border-radius: 18px; padding: 14px 18px; text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,.25); color: var(--ink); max-width: calc(100vw - 32px); }
#marAsk .row { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.clanLv { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 4px 0 8px; }
.clBar { height: 10px; background: rgba(0,0,0,.25); border-radius: 6px; overflow: hidden; border: 2px solid var(--ink); }
.clBar i { display: block; height: 100%; background: linear-gradient(90deg, #f2b84b, #ffd34d); }
.clanPerks ul { margin: 6px 0; padding: 0; list-style: none; }
.clanPerks li { opacity: .55; font-size: 12px; padding: 2px 0; }
.clanPerks li.on { opacity: 1; color: #8ee06a; }
.marRow { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
@media (max-width: 520px) { .playRow .specB span { display: none; } #specBar { bottom: 10px; gap: 5px; } }

/* QA v1.2 : messages sous les bonus actifs sur mobile */
body.touch #toasts { top: calc(118px + env(safe-area-inset-top)) !important; }
@media (orientation: portrait) { body.touch #toasts { top: calc(200px + env(safe-area-inset-top)) !important; max-width: 70vw; } }

#btnQuit.arm { background: #c0392b !important; color: #fff; animation: quitPulse .5s ease-in-out infinite alternate; }
@keyframes quitPulse { to { transform: scale(1.08); } }

/* pastille « Marié(e) à … » : rejoindre + divorcer */
#marPill .marWed { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(90deg, #ff6fa8, #c94d84); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 4px 2px 10px; color: #fff; font-weight: 900; font-size: 12px; }
#marPill .marWed .heartI { color: #fff; }
#marPill .marWed .mw { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#marPill .marWed button { border: 2px solid var(--ink); padding: 1px 10px; background: #fff; color: #c94d84; font-size: 12px; }
#marPill .marWed button.cd { background: #f3d6e3; color: #8a5a70; }
#marPill .marWed #marX { width: 24px; height: 24px; padding: 0; background: #c0392b; color: #fff; display: grid; place-items: center; font-size: 15px; }
#marPill .marWed #marX.arm { animation: quitPulse .5s ease-in-out infinite alternate; }

/* ================= Passe visuelle (revue art direction) ================= */
#announce { -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; background: rgba(20,30,24,.55); border-radius: 14px; padding: 6px 18px; width: auto; max-width: min(720px, 92vw); }
#xpText.max { color: #263029; text-shadow: none; }
.armory .price { white-space: nowrap; }
.wSk { overflow: hidden; display: grid; place-items: center; }
.wSk .wSkCv { width: 100%; height: 100%; pointer-events: none; }
.wSk.locked .wSkCv { filter: brightness(.7); }
.wSk.locked::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,.25); pointer-events: none; }
.wSk .wSkCv { position: relative; z-index: 0; }
.wSk.locked svg { z-index: 2; color: #ffd34d; }
.wSk.locked svg { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; }
#home #btnPlay:not(:disabled) { background-color: #f2b84b; }
#home #btnPlay:not(:disabled):hover { background-color: #ffc857; }
* { scrollbar-color: #f2b84b #1f2f27; scrollbar-width: thin; }
#biome, #bossTimer { background: var(--panel, rgba(31,47,39,.9)); color: #f6efdc; border-radius: 8px; padding: 1px 6px; }
@media (max-height: 430px) {
  body.touch #bottomCenter { bottom: calc(4px + env(safe-area-inset-bottom)); transform: translateX(-50%) scale(.82); }
  body.touch #mBtns { transform: scale(.88); transform-origin: bottom right; }
}

/* ================= Coffre de clan ================= */
#chestPanel { pointer-events: auto; background: rgba(31,47,39,.94); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 10px; color: #f6efdc; width: min(440px, 94vw); }
#chestPanel .chHead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
#chestPanel .chAmt { display: flex; gap: 4px; }
#chestPanel .chAmt button { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; background: #2a3f34; color: #f6efdc; border: 2px solid var(--ink); }
#chestPanel .chAmt button.on { background: #f2b84b; color: #263029; }
#chestPanel .chRow { display: grid; grid-template-columns: 12px 80px 1fr auto auto; gap: 6px; align-items: center; font-size: 12px; padding: 2px 0; }
#chestPanel .chRow i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
#chestPanel .chRow small { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chestPanel .chRow button { padding: 2px 8px; font-size: 12px; border-radius: 8px; }
#chestPanel .chRow button:disabled { opacity: .4; }
#chestPanel .hint { margin: 4px 0 0; font-size: 11px; opacity: .75; }
body.touch #chestPanel .hint { display: none; }
@media (max-height: 430px) { body.touch #chestPanel { transform: scale(.8); transform-origin: bottom center; } }

/* ================= Annonces : séparées des boutons (règles Google) ================= */
.adSlot.adFar { margin-top: 28px; padding-top: 10px; border-top: 1px dashed rgba(255,255,255,.18); }
.adSlot .adLabel { display: block; font-size: 11px; opacity: .6; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.legalLinks { margin-top: 14px; font-size: 12px; opacity: .75; text-align: center; line-height: 1.8; }
.legalLinks a, .legalLinks .linkBtn { color: inherit; text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; min-height: 0; }
