/* Maths & Monstres — feuille de style (aucune ressource externe) */
:root {
  --bg: #120f24; --bg2: #1b1636; --panel: #211b42; --panel2: #2a2352; --line: #3a3170;
  --txt: #ece8ff; --mute: #a49bd6; --gold: #ffcc4d; --gold2: #ff9f1c; --red: #ff4d6d; --red2: #c9184a;
  --green: #3ddc97; --blue: #4cc9f0; --violet: #9d4edd; --crit: #ffd60a;
  --r: 16px; --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --display: "Arial Black", "Segoe UI Black", ui-rounded, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); color: var(--txt); background: var(--bg);
  background-image: radial-gradient(ellipse at 50% -10%, #3b2a7a 0%, transparent 55%),
                    radial-gradient(circle at 10% 90%, #2b1650 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, #14284f 0%, transparent 40%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
h1, h3 { font-family: var(--display); letter-spacing: .5px; }
h3 { font-size: .95rem; text-transform: uppercase; color: var(--mute); margin: 18px 0 10px; }
h3 small { color: var(--gold); font-family: var(--font); }

/* ---------- Barre du haut ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.35rem; text-transform: uppercase; }
.brand em { color: var(--gold); font-style: normal; }
.brand-ico { font-size: 1.6rem; filter: drop-shadow(0 0 8px rgba(255,204,77,.6)); }
.topinfo { display: flex; gap: 8px; align-items: center; }
.chip { white-space: nowrap; background: var(--panel); border: 1px solid var(--line); padding: 6px 12px; border-radius: 99px; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.6s infinite; }
.iconbtn { background: var(--panel); border: 1px solid var(--line); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; }

/* ---------- Boutons & champs ---------- */
.btn { cursor: pointer; border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 800; color: #1a1033;
  background: linear-gradient(180deg, var(--gold), var(--gold2)); box-shadow: 0 4px 0 #b86a00, 0 8px 20px rgba(255,159,28,.25);
  transition: transform .08s, box-shadow .08s, filter .2s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b86a00; }
.btn-big { font-size: 1.15rem; padding: 16px 26px; width: 100%; }
.btn-ghost { background: transparent; color: var(--mute); border: 1px solid var(--line); box-shadow: none; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 700; font-size: .9rem; color: var(--mute); }
.field small { font-weight: 400; }
.field input, .field select { background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--txt); font-size: 1rem; outline: none; }
.field input:focus, .field select:focus { border-color: var(--gold); }
.field.small select { padding: 8px 10px; font-size: .9rem; }
.err { color: var(--red); min-height: 1.2em; font-weight: 700; margin: 4px 0 10px; }

/* ---------- Écran d'accueil ---------- */
.screen { padding: 8px 20px 40px; }
.join-card { max-width: 520px; margin: 30px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.join-card h1 { margin: 0 0 8px; font-size: 1.9rem; color: var(--gold); text-shadow: 0 3px 0 #7a3d00; }
.lead { color: var(--mute); line-height: 1.5; margin-bottom: 22px; }
.lead strong { color: var(--txt); }
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatar-grid button { font-size: 1.6rem; aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); cursor: pointer; transition: transform .1s; }
.avatar-grid button[aria-checked="true"] { border-color: var(--gold); background: #3b2f12; transform: scale(1.08); }
.fineprint { font-size: .78rem; color: var(--mute); text-align: center; margin-top: 12px; }

/* ---------- Mise en page du jeu ---------- */
.game { display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; gap: 18px; max-width: 1400px; margin: 0 auto; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }

/* ---------- Héros ---------- */
.me-head { display: flex; gap: 12px; align-items: center; }
.me-avatar { font-size: 2.4rem; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 16px; background: var(--bg2); border: 2px solid var(--gold); }
.me-pseudo { font-family: var(--display); font-size: 1.15rem; word-break: break-word; }
.me-title { color: var(--mute); font-size: .85rem; }
.me-title b { color: var(--gold); }
.xpbar { position: relative; height: 18px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin-top: 14px; border: 1px solid var(--line); }
.xpbar i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--violet), var(--blue)); transition: width .6s ease; }
.xpbar span { position: relative; display: block; text-align: center; font-size: .72rem; line-height: 18px; font-weight: 700; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.stats div { background: var(--bg2); border-radius: 12px; padding: 10px; text-align: center; }
.stats b { display: block; font-size: 1.25rem; font-family: var(--display); color: var(--gold); }
.stats span { font-size: .72rem; color: var(--mute); }
.badge-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.badge { aspect-ratio: 1; display: grid; place-items: center; font-size: 1.4rem; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); cursor: help; }
.badge.off { filter: grayscale(1); opacity: .25; }
.badge.on { border-color: var(--gold); box-shadow: inset 0 0 12px rgba(255,204,77,.25); }
.me-actions { margin-top: 16px; display: grid; gap: 8px; }

/* ---------- Arène ---------- */
.arena { background: linear-gradient(180deg, #2a1d58, #170f33); border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px 0; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.arena.boss { background: linear-gradient(180deg, #4a1530, #1a0b1e); border-color: #7a2050; }
.monster-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mlevel { background: var(--gold); color: #1a1033; font-weight: 900; padding: 4px 10px; border-radius: 8px; font-family: var(--display); font-size: .85rem; }
.mname { font-family: var(--display); font-size: 1.3rem; flex: 1; min-width: 0; }
.tag { font-size: .75rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--panel2); color: var(--mute); }
.tag.ghost { background: transparent; border: 1px solid var(--line); }
.tag.boss { background: var(--red2); color: #fff; animation: pulse 1.2s infinite; }
.tag.regen { background: #145c3f; color: #b7ffde; margin-left: 6px; }
.hpbar { position: relative; height: 26px; background: #0d0a1c; border-radius: 99px; margin: 12px 0 0; overflow: hidden; border: 2px solid #000; }
.hpbar i { position: absolute; inset: 0 auto 0 0; width: 100%; }
#hpGhost { background: #ffe8a3; transition: width 1.2s ease .35s; }
#hpFill { background: linear-gradient(180deg, #ff7b8f, var(--red) 50%, var(--red2)); transition: width .25s ease; }
.hpbar span { position: relative; display: block; text-align: center; line-height: 22px; font-weight: 900; font-size: .85rem; text-shadow: 0 1px 2px #000; }
.stage { position: relative; height: 330px; display: grid; place-items: center; }
.aura { position: absolute; width: 260px; height: 60px; bottom: 26px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.55), transparent 70%); }
.arena.boss .aura { background: radial-gradient(ellipse, rgba(255,40,90,.45), transparent 70%); animation: pulse 1.4s infinite; }
.monster-box { width: 290px; height: 290px; position: relative; z-index: 1; }
.monster-box svg { width: 100%; height: 100%; overflow: visible; animation: bob 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.monster-box.hit svg { animation: hit .35s ease; }
.monster-box.spawn svg { animation: spawn .7s cubic-bezier(.2,1.6,.4,1); }
.monster-box.dying svg { animation: die 1.1s ease forwards; }
.floaters { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.float { position: absolute; font-family: var(--display); font-weight: 900; font-size: 1.6rem; color: #fff; text-shadow: 0 3px 0 #000, 0 0 12px rgba(255,77,109,.8); animation: floatUp 1.3s ease-out forwards; white-space: nowrap; }
.float.mine { font-size: 2.3rem; color: var(--gold); }
.float.crit { color: var(--crit); font-size: 2.7rem; }
.float.other { font-size: 1.05rem; opacity: .9; color: #d8d2ff; }
.float.heal { color: var(--green); }
.banner { position: absolute; z-index: 4; top: 40%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-family: var(--display); font-size: 2rem; color: var(--gold); text-shadow: 0 4px 0 #6b2c00, 0 0 30px rgba(255,204,77,.7); animation: bannerIn .5s cubic-bezier(.2,1.6,.4,1); width: 90%; }
.banner small { display: block; font-family: var(--font); font-size: 1rem; color: var(--txt); text-shadow: 0 2px 4px #000; margin-top: 6px; }
.particle { position: absolute; width: 10px; height: 10px; border-radius: 3px; left: 50%; top: 50%; animation: burst 1s ease-out forwards; }

/* ---------- Carte question ---------- */
.qcard { margin-top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); position: relative; min-height: 260px; }
.qtop { display: flex; justify-content: space-between; align-items: center; }
.hearts { font-size: 1.4rem; letter-spacing: 2px; }
.hearts .lost { filter: grayscale(1); opacity: .25; }
.combo { font-weight: 800; color: var(--mute); }
.combo b { color: var(--txt); font-size: 1.2rem; }
.combo span { color: var(--gold); margin-left: 4px; }
.combo.hot span { color: var(--crit); text-shadow: 0 0 10px var(--gold2); }
.timer { position: relative; height: 12px; background: var(--bg2); border-radius: 99px; margin: 12px 0; }
.timer i { border-radius: 99px; }
.timer i { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--green); }
.timer.warn i { background: var(--gold2); }
.timer.danger i { background: var(--red); animation: pulse .5s infinite; }
.timer { margin-right: 44px; overflow: visible; }
.timer span { position: absolute; right: -42px; top: -3px; font-size: .78rem; font-weight: 800; }
.qmeta { display: flex; gap: 6px; }
.qtext { font-size: 1.45rem; font-weight: 800; line-height: 1.4; margin: 14px 0 18px; white-space: pre-line; overflow-wrap: anywhere; }
.qanswers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qanswers.single { grid-template-columns: 1fr; }
.choice { cursor: pointer; text-align: left; border: 2px solid var(--line); background: var(--bg2); border-radius: 14px; padding: 14px 16px; font-size: 1.1rem; font-weight: 700; display: flex; gap: 10px; align-items: center; transition: transform .08s, border-color .15s, background .15s; }
.choice:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.choice kbd { font-family: var(--font); font-size: .75rem; background: var(--panel2); border-radius: 6px; padding: 2px 7px; color: var(--mute); }
.choice.good { border-color: var(--green); background: #10402d; }
.choice.bad { border-color: var(--red); background: #4a1424; }
.choice:disabled { cursor: default; }
.vf-true { border-color: #1f7a55; } .vf-false { border-color: #8a2440; }
.numrow { display: flex; gap: 10px; }
.numrow input { flex: 1; min-width: 0; font-size: 1.4rem; font-weight: 800; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg2); color: var(--txt); outline: none; }
.numrow input:focus { border-color: var(--gold); }
.keys { display: flex; gap: 6px; margin-top: 8px; }
.keys button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-weight: 900; font-size: 1.1rem; cursor: pointer; }
.hint { color: var(--mute); font-size: .82rem; margin-top: 8px; }
.qresult { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--bg2); border-left: 5px solid var(--green); animation: bannerIn .3s ease; }
.qresult.bad { border-left-color: var(--red); }
.rhead { font-family: var(--display); font-size: 1.2rem; margin-bottom: 6px; }
.rhead .dmg { color: var(--gold); }
.rans { font-weight: 800; margin-bottom: 4px; }
.rexpl { color: var(--mute); line-height: 1.5; margin-bottom: 12px; }
.qresult .bonus { display: inline-block; margin: 0 6px 6px 0; padding: 2px 8px; border-radius: 6px; background: var(--panel2); font-size: .8rem; font-weight: 800; }
#startBtn { margin-top: 6px; }
.kobox { text-align: center; padding: 20px 10px; }
.ko-ico { font-size: 3rem; animation: spin 2s linear infinite; display: inline-block; }
.ko-count { font-size: 1.2rem; margin: 8px 0; }
.ko-count b { color: var(--gold); font-size: 1.6rem; }
.ko-tip { color: var(--mute); font-size: .85rem; }

/* ---------- Fil & classements ---------- */
.feed { list-style: none; padding: 0; margin: 0; max-height: 230px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.feed li { font-size: .85rem; padding: 6px 8px; border-radius: 8px; background: var(--bg2); display: flex; gap: 6px; align-items: baseline; animation: slideIn .3s ease; }
.feed li.kill { background: linear-gradient(90deg, #4b3a0e, var(--bg2)); border: 1px solid var(--gold); }
.feed .who { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.feed .g { color: var(--mute); font-size: .72rem; }
.feed .d { margin-left: auto; font-weight: 900; color: var(--gold); white-space: nowrap; }
.feed .empty { color: var(--mute); background: none; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 18px 0 10px; }
.tab { flex: 1; font-size: .75rem; font-weight: 800; padding: 7px 4px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--mute); cursor: pointer; }
.tab.active { background: var(--gold); color: #1a1033; border-color: var(--gold); }
.board ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.board li { display: flex; gap: 8px; align-items: center; background: var(--bg2); padding: 7px 10px; border-radius: 10px; font-size: .88rem; }
.board .rk { width: 26px; text-align: center; font-weight: 900; color: var(--mute); }
.board li:nth-child(1) .rk { color: var(--gold); font-size: 1.1rem; }
.board li:nth-child(2) .rk { color: #d6d6e7; }
.board li:nth-child(3) .rk { color: #e3a46b; }
.board .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.board .nm small { color: var(--mute); font-weight: 400; margin-left: 4px; }
.board .vl { font-weight: 900; color: var(--gold); }
.board .empty { color: var(--mute); text-align: center; padding: 14px; font-size: .9rem; }
.gbar { margin-bottom: 8px; }
.gbar .lbl { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 700; margin-bottom: 3px; }
.gbar .track { height: 14px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.gbar .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--violet), var(--red)); transition: width .8s ease; }
.gbar.top .fill { background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.rec { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.rec div { background: var(--bg2); border-radius: 10px; padding: 8px; text-align: center; font-size: .75rem; color: var(--mute); }
.rec b { display: block; color: var(--gold); font-size: 1.05rem; font-family: var(--display); }
.rec em { display: block; font-style: normal; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Notifications ---------- */
.toasts { position: fixed; top: 70px; right: 20px; pointer-events: none; display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(92vw, 380px); }
.toast { background: var(--panel2); border: 2px solid var(--gold); border-radius: 14px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); animation: toastIn .4s cubic-bezier(.2,1.6,.4,1); }
.toast .ti { font-size: 2rem; }
.toast b { color: var(--gold); display: block; }
.toast.err { border-color: var(--red); }
.noscript { text-align: center; padding: 40px; }

/* ---------- Animations ---------- */
@keyframes pulse { 50% { opacity: .55; } }
@keyframes bob { 50% { transform: translateY(-8px) scale(1.02, .98); } }
@keyframes hit { 0% { transform: translateX(0); filter: brightness(3) saturate(0); } 25% { transform: translateX(-12px) rotate(-3deg); } 50% { transform: translateX(10px) rotate(2deg); } 100% { transform: none; filter: none; } }
@keyframes spawn { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes die { 30% { transform: scale(1.15) rotate(8deg); filter: brightness(3); } 100% { transform: scale(0) rotate(-40deg); opacity: 0; filter: brightness(5) blur(4px); } }
@keyframes floatUp { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 15% { transform: translate(-50%, -20px) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -120px) scale(1); opacity: 0; } }
@keyframes bannerIn { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } }
.qresult { animation-name: fadeUp; }
@keyframes fadeUp { from { transform: translateY(10px); opacity: 0; } }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; } }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }
@keyframes toastIn { from { transform: translateY(30px) scale(.8); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.shake { animation: screenShake .4s; }
@keyframes screenShake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .game { grid-template-columns: minmax(0, 1fr) 300px; }
  .me-panel { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 760px) {
  .screen { padding: 6px 12px 30px; }
  .game { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .arena-col { order: 1; } .side-panel { order: 2; } .me-panel { order: 3; }
  .stage { height: 200px; } .monster-box { width: 180px; height: 180px; }
  .topbar { padding: 10px 12px; } .brand { font-size: 1rem; } .brand-ico { font-size: 1.3rem; }
  .mname { font-size: 1.05rem; flex-basis: calc(100% - 70px); }
  .mtags { width: 100%; }
  .toasts { top: auto; bottom: 14px; right: 50%; transform: translateX(50%); }
  .qtext { font-size: 1.2rem; }
  .qanswers { grid-template-columns: 1fr; }
  .avatar-grid { grid-template-columns: repeat(8, 1fr); }
  .avatar-grid button { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Connexion / création ---------- */
.jtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg2); padding: 5px; border-radius: 14px; margin-bottom: 18px; }
.jtab { border: 0; background: transparent; color: var(--mute); font-weight: 800; padding: 10px; border-radius: 10px; cursor: pointer; }
.jtab.active { background: var(--panel2); color: var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.namecard { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #3b2f12, var(--bg2)); border: 2px solid var(--gold); border-radius: 14px; padding: 12px 14px; }
.namecard b { flex: 1; font-family: var(--display); font-size: 1.25rem; color: var(--gold); }
.btn-small { padding: 8px 12px; font-size: .85rem; }
.linkbtn { background: none; border: 0; color: var(--mute); font-weight: 700; cursor: pointer; padding: 4px 0; text-align: left; text-decoration: underline dotted; }
.linkbtn:hover { color: var(--txt); }
.pwrow { display: flex; gap: 6px; }
.pwrow input { flex: 1; min-width: 0; background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--txt); font-size: 1rem; outline: none; }
.pwrow input:focus { border-color: var(--gold); }
.eyebtn { width: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel2); cursor: pointer; font-size: 1.1rem; }
.check { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--mute); margin: 4px 0 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.check small { opacity: .8; }
button.chip { cursor: pointer; color: var(--txt); }
button.chip.masked { letter-spacing: 1px; }

.modal { position: fixed; inset: 0; background: rgba(8, 5, 20, .82); display: grid; place-items: center; z-index: 60; padding: 16px; backdrop-filter: blur(4px); }
.modal-card { width: min(100%, 440px); background: var(--panel); border: 2px solid var(--gold); border-radius: 22px; padding: 24px; text-align: center; box-shadow: var(--shadow); animation: toastIn .4s cubic-bezier(.2,1.6,.4,1); }
.modal-card h2 { font-family: var(--display); color: var(--gold); margin: 4px 0 8px; }
.modal-card p { color: var(--mute); line-height: 1.5; }
.modal-ico { font-size: 3rem; }
.cred { background: var(--bg2); border: 1px dashed var(--gold); border-radius: 12px; padding: 10px; margin: 8px 0; }
.cred span { display: block; font-size: .75rem; color: var(--mute); text-transform: uppercase; }
.cred b { font-size: 1.35rem; font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.modal-card .btn-ghost { margin: 6px 0 12px; }
.modal-card .check { justify-content: center; }
.btn:disabled { filter: grayscale(1); opacity: .5; cursor: not-allowed; }

/* ---------- Héros équipé ---------- */
.hero { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 30%; background: var(--bg2); border: 2px solid var(--line); }
.hero-av { line-height: 1; }
.hero-hat, .hero-weapon, .hero-pet { position: absolute; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.hero-hat { top: -38%; left: 50%; transform: translateX(-50%); }
.hero-weapon { right: -26%; bottom: 2%; transform: rotate(18deg); }
.hero-pet { left: -24%; bottom: -10%; }
.hero-xs { width: 26px; height: 26px; border-width: 1px; margin: 0 4px; } .hero-xs .hero-av { font-size: 16px; }
.hero-xs .hero-hat { font-size: 11px; top: -42%; } .hero-xs .hero-weapon, .hero-xs .hero-pet { display: none; }
.hero-sm { width: 40px; height: 40px; } .hero-sm .hero-av { font-size: 24px; } .hero-sm .hero-hat, .hero-sm .hero-weapon, .hero-sm .hero-pet { font-size: 16px; }
.hero-lg { width: 66px; height: 66px; border-width: 3px; } .hero-lg .hero-av { font-size: 40px; } .hero-lg .hero-hat, .hero-lg .hero-weapon, .hero-lg .hero-pet { font-size: 24px; }
.hero-xl { width: 110px; height: 110px; border-width: 4px; } .hero-xl .hero-av { font-size: 66px; } .hero-xl .hero-hat, .hero-xl .hero-weapon, .hero-xl .hero-pet { font-size: 40px; }
.frame-wood { border-color: #8b5a2b; }
.frame-bronze { border-color: #cd7f32; box-shadow: 0 0 8px rgba(205,127,50,.4); }
.frame-silver { border-color: #d8dce6; box-shadow: 0 0 10px rgba(216,220,230,.5); }
.frame-gold { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,204,77,.6); }
.frame-emerald { border-color: #2ecc71; box-shadow: 0 0 12px rgba(46,204,113,.6); }
.frame-amethyst { border-color: #b57edc; box-shadow: 0 0 14px rgba(181,126,220,.7); }
.frame-fire { border-color: #ff6b1a; box-shadow: 0 0 14px #ff3d00, inset 0 0 10px rgba(255,90,0,.5); animation: flicker 1.2s infinite; }
.frame-rainbow { border-color: transparent; background: linear-gradient(var(--bg2), var(--bg2)) padding-box, linear-gradient(135deg, #ff4d6d, #ffcc4d, #3ddc97, #4cc9f0, #9d4edd) border-box; }
.frame-cosmic { border-color: transparent; background: radial-gradient(circle at 30% 30%, #2b1e5c, #0b0820) padding-box, linear-gradient(135deg, #4cc9f0, #9d4edd, #ff4d6d) border-box; box-shadow: 0 0 18px rgba(157,78,221,.8); }
@keyframes flicker { 50% { box-shadow: 0 0 20px #ff9f1c, inset 0 0 14px rgba(255,140,0,.6); } }
.me-hero { padding: 14px 18px 6px 14px; }
.me-id { min-width: 0; }
.me-epithet { color: var(--gold); font-style: italic; font-size: .82rem; }
.btn-wide { width: 100%; margin-top: 10px; display: flex; justify-content: center; gap: 8px; align-items: center; }
.pill { background: var(--red); color: #fff; border-radius: 99px; padding: 1px 8px; font-size: .7rem; font-weight: 900; animation: pulse 1.4s infinite; }
.btn-danger { background: linear-gradient(180deg, #ff6b81, var(--red2)); color: #fff; box-shadow: 0 4px 0 #7a0f2a; }
.linkbtn.danger { color: #ff8fa3; font-size: .82rem; }
.center { text-align: center; }
.lead.small { font-size: .9rem; }
.classinfo { font-weight: 800; font-size: .9rem; }
.foot { text-align: center; color: var(--mute); font-size: .82rem; padding: 10px 0 30px; }
.foot a { color: var(--mute); }

/* ---------- Quêtes ---------- */
.quests { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.quests li { background: var(--bg2); border-radius: 10px; padding: 8px 10px; font-size: .82rem; font-weight: 700; }
.quests li.done { opacity: .75; }
.qrow { display: flex; justify-content: space-between; gap: 6px; }
.qrow small { color: var(--gold); white-space: nowrap; }
.qbar { height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.qbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); }

/* ---------- Modales & vestiaire ---------- */
.modal-card { position: relative; max-height: 92vh; overflow: auto; }
.modal-card.wide { width: min(100%, 620px); }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: var(--panel2); color: var(--txt); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.modal-card .pwrow { margin: 10px 0; }
.wd-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 0 10px; }
.wd-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.wd-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.wd-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); cursor: pointer; color: var(--txt); }
.wd-item.on { border-color: var(--gold); background: #3b2f12; }
.wd-item.locked { opacity: .45; cursor: not-allowed; filter: grayscale(.8); }
.wd-ico { font-size: 1.8rem; height: 36px; display: grid; place-items: center; }
.wd-name { font-size: .8rem; font-weight: 800; text-align: center; }
.wd-req { font-size: .68rem; color: var(--mute); text-align: center; }
.swatch { display: block; width: 30px; height: 30px; border-radius: 30%; border: 4px solid var(--line); background: var(--bg2); }
.cred-rec b { font-size: 1.1rem; }
.toasts .toast:nth-child(n+4) { display: none; }
html, body { overflow-x: hidden; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .topinfo { flex-wrap: wrap; justify-content: flex-end; }
  .chip { font-size: .78rem; padding: 5px 9px; }
  .qcard { min-height: 0; }
  .wd-items { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}

/* ---------- Mise en avant des héros ---------- */
.clickable { cursor: pointer; }
.clickable:hover { filter: brightness(1.15); }
.epi { display: block; color: var(--gold); font-style: italic; font-size: .75rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .nm { display: flex; flex-direction: column; line-height: 1.25; }
.board .nm small { margin-left: 0; }
.board li { padding: 9px 10px 9px 6px; gap: 12px; }
.board li .hero { margin: 0 6px 0 2px; }
.rec em { display: flex; align-items: center; justify-content: center; gap: 2px; }

/* Lueur selon la rareté du plus bel objet équipé */
.glow-rare { box-shadow: 0 0 10px rgba(76,201,240,.55); }
.glow-epic { box-shadow: 0 0 14px rgba(157,78,221,.8); }
.glow-legendary { box-shadow: 0 0 16px rgba(255,204,77,.9), 0 0 32px rgba(255,120,0,.45); animation: legend 2.4s ease-in-out infinite; }
@keyframes legend { 50% { box-shadow: 0 0 24px rgba(255,214,10,1), 0 0 44px rgba(255,120,0,.6); } }

/* Vitrine du champion */
.champion { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 12px 14px; margin: -4px 0 6px;
  border-radius: 18px; cursor: pointer; background: radial-gradient(ellipse at 50% 30%, #3b2f12 0%, var(--bg2) 70%); border: 2px solid #6b5520; }
.champion.rank-epic { background: radial-gradient(ellipse at 50% 30%, #3d1d5c 0%, var(--bg2) 70%); border-color: var(--violet); }
.champion.rank-legendary { background: radial-gradient(ellipse at 50% 30%, #5c3d0a 0%, var(--bg2) 72%); border-color: var(--gold); box-shadow: 0 0 22px rgba(255,204,77,.35); }
.champ-label { font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); }
.champ-stage { position: relative; display: flex; flex-direction: column; align-items: center; padding: 42px 40px 0; }
.champ-stage .hero { z-index: 1; }
.pedestal { width: 150px; height: 22px; margin-top: -6px; border-radius: 50%; background: radial-gradient(ellipse, #ffcc4d 0%, #8a5a00 55%, transparent 72%); opacity: .85; }
.champ-name { font-family: var(--display); font-size: 1.15rem; margin-top: 6px; }
.champ-sub { color: var(--mute); font-size: .78rem; margin-top: 2px; }
.champion .epi { font-size: .85rem; }

/* Fiche héros */
.hero-card { text-align: center; }
.hero-card h2 { margin: 6px 0 2px; }
.hero-card .epi { font-size: 1rem; }
.hero-card .stats { margin: 12px 0; }
.hero-card.rank-legendary { border-color: var(--gold); box-shadow: 0 0 40px rgba(255,204,77,.35); }
.hero-card.rank-epic { border-color: var(--violet); }
.badge-line { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.badge-line .badge { width: 42px; aspect-ratio: 1; }
.badge.r-epic { border-color: var(--violet); box-shadow: inset 0 0 12px rgba(157,78,221,.5); }
.badge.r-legendary { border-color: var(--gold); box-shadow: inset 0 0 14px rgba(255,204,77,.6), 0 0 8px rgba(255,204,77,.5); }

/* Coup de grâce : le héros en grand dans le bandeau de victoire */
.banner-hero { display: flex; justify-content: center; padding: 34px 0 6px; animation: heroRise .6s cubic-bezier(.2,1.6,.4,1); }
.banner .epi { font-size: 1rem; text-shadow: 0 2px 4px #000; }
@keyframes heroRise { from { transform: translateY(40px) scale(.3); opacity: 0; } }
.banner { top: 46%; }

/* Rareté dans le vestiaire */
.wd-rar { font-size: .62rem; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--mute); }
.wd-item.r-rare { border-color: #2a6f8a; } .wd-item.r-rare .wd-rar { color: var(--blue); }
.wd-item.r-epic { border-color: #6a3a9a; } .wd-item.r-epic .wd-rar { color: #c77dff; }
.wd-item.r-legendary { border-color: #a77b1a; background: linear-gradient(180deg, #3b2f12, var(--bg2)); } .wd-item.r-legendary .wd-rar { color: var(--gold); }
.wd-item.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
@media (max-width: 760px) { .champ-stage { padding: 36px 30px 0; } }
.board .nm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Figures des questions (papier clair, lisible au vidéoprojecteur) ---------- */
.qfig { display: flex; justify-content: center; margin: -6px 0 16px; }
.qfig-svg { width: 100%; max-width: 380px; height: auto; background: #fbf9ff; border-radius: 14px; padding: 8px; box-shadow: inset 0 0 0 2px #d9d2f5; }
.qfig-svg .stroke { stroke: #2a2350; stroke-width: 2; fill: none; }
.qfig-svg .stroke.thin { stroke-width: 1.2; }
.qfig-svg .axis { stroke-width: 1.6; }
.qfig-svg .dash { stroke-dasharray: 6 5; }
.qfig-svg .nofill { fill: none; }
.qfig-svg .arcm { stroke: #c9184a; stroke-width: 2; }
.qfig-svg .grid { stroke: #dcd6f0; stroke-width: 1; }
.qfig-svg .fillc { fill: #2a2350; }
.qfig-svg .fill2 { fill: #e85d04; }
.qfig-svg .lbl { fill: #2a2350; font: 600 14px var(--font); }
.qfig-svg .lbl.sm { font-size: 11px; }
.qfig-svg .lbl.b { font-weight: 900; }
.qfig-svg .ptname { fill: #c9184a; font-size: 16px; }
.qfig-svg .pt { fill: #c9184a; }
.qfig-svg .curve { stroke: #3a0ca3; stroke-width: 2.6; fill: none; stroke-linejoin: round; }
.qfig-svg .curve.c2 { stroke: #e85d04; }
.qfig-svg .area { fill: rgba(76, 201, 240, .35); }
.qfig-svg .shape { fill: rgba(157, 78, 221, .12); stroke: #2a2350; stroke-width: 2.2; stroke-linejoin: round; }
.qfig-svg .bar.b0 { fill: #7b2cbf; } .qfig-svg .bar.b1 { fill: #f72585; } .qfig-svg .bar.b2 { fill: #4361ee; } .qfig-svg .bar.b3 { fill: #2ec4b6; }
.qfig-svg .slice { fill: #fff; stroke: #2a2350; stroke-width: 2; }
.qfig-svg .slice.on { fill: #f72585; }
.qfig-svg .cell { fill: #9d4edd; opacity: .75; }
.qfig-svg .clockface { fill: #fff; stroke: #2a2350; stroke-width: 3; }
.qfig-svg .hand { stroke: #2a2350; stroke-linecap: round; }
.qfig-svg .hand.h { stroke-width: 6; } .qfig-svg .hand.m { stroke-width: 3.5; stroke: #c9184a; }

/* ---------- Monstres : boss et rage ---------- */
.monster-box svg.mon.boss { filter: drop-shadow(0 0 14px rgba(255, 60, 100, .55)); }
.monster-box svg.mon.rage { animation: rage .35s infinite, bob 1.2s ease-in-out infinite; filter: drop-shadow(0 0 22px rgba(255, 30, 60, .95)) saturate(1.4); }
@keyframes rage { 25% { transform: translate(-3px, 1px) rotate(-1deg); } 75% { transform: translate(3px, -1px) rotate(1deg); } }
.monster-box svg.mon.sp-ghost { animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }

/* ---------- Correctifs mobile ---------- */
.avatar-grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
.avatar-grid button { min-width: 0; padding: 0; display: grid; place-items: center; }
.numrow { flex-wrap: wrap; }
.numrow input { flex: 1 1 150px; width: 100%; }
.numrow .btn { flex: 0 0 auto; }
.qcard, .join-card, .panel, .arena { min-width: 0; max-width: 100%; }
.qtext { word-break: normal; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .join-card { padding: 20px 16px; margin: 14px auto; }
  .join-card h1 { font-size: 1.55rem; }
  .avatar-grid { grid-template-columns: repeat(6, 1fr); gap: 5px; }
  .avatar-grid button { font-size: 1.3rem; }
  .numrow .btn { flex: 1 1 100%; }
  .numrow input { font-size: 1.25rem; }
  .qcard { padding: 14px; }
  .check { align-items: flex-start; }
  .namecard { flex-wrap: wrap; }
  .namecard b { font-size: 1.1rem; }
  .jtab { font-size: .85rem; padding: 8px 6px; }
}
@media (max-width: 760px) { .toasts { top: 8px; bottom: auto; } }

/* ---------- Objets brillants, rareté mythique, cadres animés ---------- */
.shine { animation: shine 2.2s ease-in-out infinite; }
@keyframes shine { 0%, 100% { filter: drop-shadow(0 0 2px rgba(255,255,255,.6)) drop-shadow(0 2px 2px rgba(0,0,0,.5)); } 50% { filter: drop-shadow(0 0 9px rgba(255,236,150,1)) drop-shadow(0 0 3px #fff) brightness(1.2); } }
.glow-mythic { box-shadow: 0 0 14px #ff4d6d, 0 0 26px #4cc9f0; animation: mythic 3s linear infinite; }
@keyframes mythic { 0% { box-shadow: 0 0 14px #ff4d6d, 0 0 28px #4cc9f0; } 33% { box-shadow: 0 0 14px #ffcc4d, 0 0 28px #9d4edd; } 66% { box-shadow: 0 0 14px #3ddc97, 0 0 28px #ff4d6d; } 100% { box-shadow: 0 0 14px #ff4d6d, 0 0 28px #4cc9f0; } }
.spark { position: absolute; color: #fff7c2; text-shadow: 0 0 6px #ffd60a; font-size: 12px; pointer-events: none; animation: twinkle 1.8s ease-in-out infinite; }
.hero-lg .spark, .hero-xl .spark { font-size: 16px; }
.spark.s0 { top: -10%; left: -12%; } .spark.s1 { top: 30%; right: -18%; animation-delay: .6s; } .spark.s2 { bottom: -12%; left: 40%; animation-delay: 1.2s; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1.2) rotate(90deg); } }
.frame-aurora { border-color: transparent; background: linear-gradient(var(--bg2), var(--bg2)) padding-box, linear-gradient(120deg, #3ddc97, #4cc9f0, #9d4edd, #3ddc97) border-box; background-size: 100% 100%, 300% 300%; animation: flow 4s linear infinite; }
.frame-prism { border-color: transparent; background: linear-gradient(var(--bg2), var(--bg2)) padding-box, conic-gradient(#ff4d6d, #ffcc4d, #3ddc97, #4cc9f0, #9d4edd, #ff4d6d) border-box; animation: hue 4s linear infinite; }
.frame-lava { border-color: #ff5400; background: radial-gradient(circle at 50% 120%, #7a1500, var(--bg2) 70%); box-shadow: 0 0 12px #ff5400, inset 0 -6px 12px rgba(255,84,0,.6); animation: flicker 1s infinite; }
.frame-diamond { border-color: #e0fbff; position: relative; overflow: visible; background: linear-gradient(135deg, #1b2f45, var(--bg2)); box-shadow: 0 0 12px rgba(224,251,255,.9), inset 0 0 10px rgba(160,240,255,.4); }
.frame-galaxy { border-color: transparent; background: radial-gradient(circle at 30% 30%, #2b1e5c, #05020f) padding-box, conic-gradient(from 0deg, #9d4edd, #4cc9f0, #f72585, #9d4edd) border-box; animation: hue 6s linear infinite; box-shadow: 0 0 18px rgba(157,78,221,.9); }
.frame-pi { border-color: #ffcc4d; border-style: double; border-width: 5px !important; background: linear-gradient(135deg, #3b2f12, var(--bg2)); }
.frame-void { border-color: #000; background: radial-gradient(circle, #000 35%, #3c096c 70%, #9d4edd); box-shadow: 0 0 16px #7b2cbf, inset 0 0 14px #000; }
.swatch.frame-pi, .swatch.frame-void, .swatch.frame-galaxy { display: block; }
@keyframes flow { to { background-position: 0 0, 300% 0; } }
@keyframes hue { to { filter: hue-rotate(360deg); } }
.wd-item.r-mythic { border-color: #c77dff; background: linear-gradient(160deg, #3d1d5c, #1b2f45 60%, var(--bg2)); }
.wd-item.r-mythic .wd-rar { background: linear-gradient(90deg, #ff4d6d, #ffcc4d, #3ddc97, #4cc9f0, #c77dff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wd-item.secret { opacity: .75; filter: none; }
.wd-item.secret .wd-ico { animation: pulse 2s infinite; }
.badge.r-mythic.on { border-color: #c77dff; box-shadow: inset 0 0 12px rgba(199,125,255,.6), 0 0 10px rgba(255,77,109,.5); }
.badge.secret { filter: none; opacity: .45; border-style: dashed; }
.champion.rank-mythic, .hero-card.rank-mythic { border-color: #c77dff; box-shadow: 0 0 30px rgba(199,125,255,.45); }
@media (prefers-reduced-motion: reduce) { .spark { display: none; } }
.lvlpick { display: flex; flex-wrap: wrap; gap: 5px; }
.lvlpick .lvl { border: 2px solid var(--line); background: var(--bg2); color: var(--mute); border-radius: 9px; padding: 5px 9px; font-weight: 800; font-size: .8rem; cursor: pointer; }
.lvlpick .lvl.on { border-color: var(--gold); background: #3b2f12; color: var(--gold); }
.lvlpick .lvl:disabled { cursor: not-allowed; opacity: .7; }
