/* ==========================================================================
   MyPoly — feuille de style
   ========================================================================== */
:root {
  --bg: #0f1225;
  --bg2: #161a33;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-solid: #1c2142;
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #eef0ff;
  --muted: #9aa0c7;
  --primary: #ff5a5f;
  --primary2: #ff8a3d;
  --secondary: #3fa7ff;
  --accent: #a66bff;
  --success: #2ecc71;
  --danger: #ff4757;
  --gold: #ffd166;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Color Emoji', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(166, 107, 255, 0.25), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(255, 90, 95, 0.18), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(63, 167, 255, 0.18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: #8fc8ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.2; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-top: 1em; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------- barre haute */
#topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: rgba(15, 18, 37, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-border);
}
body.in-game #topbar { display: none; }
.logo { font-weight: 900; font-size: 1.5rem; letter-spacing: -0.03em; color: #fff; text-decoration: none !important; }
.logo span, .logo-big span, .center-logo span {
  background: linear-gradient(90deg, var(--primary), var(--primary2), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-links { display: flex; gap: 6px; }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: var(--panel); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#nav-user { display: flex; align-items: center; gap: 8px; }
.nav-profile { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--panel); text-decoration: none !important; }
#conn-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: var(--danger); color: #fff; text-align: center; padding: 6px; font-weight: 700; }

/* ---------------------------------------------------------------- boutons */
.btn {
  --b: var(--panel);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--b); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
  transition: transform .12s ease, filter .15s, box-shadow .2s, background .2s;
  text-decoration: none !important; white-space: nowrap; user-select: none;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); box-shadow: 0 6px 20px rgba(255, 90, 95, .35); }
.btn.secondary { background: linear-gradient(135deg, #2f80ed, var(--secondary)); box-shadow: 0 6px 20px rgba(63, 167, 255, .25); }
.btn.accent { background: linear-gradient(135deg, #7f53ff, var(--accent)); }
.btn.gold { background: linear-gradient(135deg, #f7b733, #ffd166); color: #3a2a00; }
.btn.danger { background: linear-gradient(135deg, #d63031, var(--danger)); }
.btn.ghost { background: var(--panel); border-color: var(--panel-border); }
.btn.sm { padding: 6px 10px; font-size: .85rem; border-radius: 9px; }
.btn.lg { padding: 14px 24px; font-size: 1.05rem; border-radius: 14px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.btn-row.center { justify-content: center; align-items: center; }
.btn-col { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.btn-col .btn { justify-content: space-between; }
.icon-btn { background: var(--panel); border: 1px solid var(--panel-border); color: #fff; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.icon-btn.danger:hover { background: var(--danger); }

/* --------------------------------------------------------------- formulaires */
.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, .25); color: #fff; font: inherit; outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(63, 167, 255, .2); }
.input.sm { padding: 6px 10px; border-radius: 9px; font-size: .9rem; width: auto; }
select.input { cursor: pointer; }
select.input option { background: var(--panel-solid); }
textarea.input { resize: vertical; }
.field { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .9rem; }
.form-error { color: var(--danger); font-weight: 600; min-height: 1.2em; margin: 6px 0; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: rgba(255, 255, 255, .15); border-radius: 26px; transition: .2s; cursor: pointer; }
.slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { cursor: default; opacity: .7; }

/* ------------------------------------------------------------------ cartes */
.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
.page.narrow { max-width: 720px; }
.page.center { text-align: center; padding-top: 80px; }
.page-title { font-size: 2rem; }
.card { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); backdrop-filter: blur(10px); margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--panel-border); border-top-color: var(--primary); animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ tags */
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: .62rem; font-weight: 900; padding: 2px 6px; border-radius: 6px; letter-spacing: .04em; margin-left: 5px; vertical-align: middle; white-space: nowrap; line-height: 1.4; }
.tag-vip { background: linear-gradient(135deg, #f7b733, #ffd166); color: #4a3300; box-shadow: 0 0 10px rgba(255, 209, 102, .5); animation: vipGlow 2.5s ease-in-out infinite; }
.tag-staff { background: linear-gradient(135deg, #e53935, #ff6b6b); color: #fff; box-shadow: 0 0 8px rgba(255, 71, 87, .45); }
.tag-admin { background: linear-gradient(135deg, #7f00ff, #e100ff); color: #fff; box-shadow: 0 0 10px rgba(225, 0, 255, .45); }
.tag-bot { background: #455a64; color: #cfd8dc; }
.tag-guest { background: rgba(255, 255, 255, .12); color: var(--muted); }
.tag-level { background: rgba(63, 167, 255, .18); color: #8fc8ff; }
.tag-host { background: rgba(255, 209, 102, .18); color: var(--gold); }
.tag-off { background: rgba(255, 71, 87, .2); color: #ff8a93; }
.tag-ban { background: var(--danger); color: #fff; }
@keyframes vipGlow { 50% { box-shadow: 0 0 16px rgba(255, 209, 102, .85); } }
.name-vip { background: linear-gradient(90deg, #ffd166, #fff3c4, #f7b733); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; background-size: 200% 100%; animation: shine 3s linear infinite; }
.name-staff { color: #ff8a93; font-weight: 800; }
@keyframes shine { to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ avatars */
.avatar { --c: #888; width: 42px; height: 42px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 60%, white), var(--c)); box-shadow: 0 0 0 3px rgba(0, 0, 0, .25), 0 4px 12px rgba(0, 0, 0, .35); }
.avatar.sm { width: 28px; height: 28px; font-size: 1rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 2.1rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 3rem; }

/* ------------------------------------------------------------------ toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel-solid); border: 1px solid var(--panel-border); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; opacity: 0; transform: translateY(20px); transition: .3s; max-width: 90vw; }
.toast.show { opacity: 1; transform: none; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warn { border-color: var(--gold); }

/* ------------------------------------------------------------------ modales */
.modal-overlay { position: fixed; inset: 0; z-index: 250; background: rgba(5, 7, 20, .65); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .2s; }
.modal-overlay.show { opacity: 1; }
.modal { background: var(--panel-solid); border: 1px solid var(--panel-border); border-radius: 20px; box-shadow: var(--shadow); width: min(480px, 100%); max-height: 90dvh; overflow: auto; transform: scale(.94) translateY(10px); transition: transform .25s cubic-bezier(.2, .9, .3, 1.3); }
.modal-overlay.show .modal { transform: none; }
.modal-title { font-weight: 900; font-size: 1.25rem; padding: 18px 20px 0; }
.modal-body { padding: 14px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }

/* ------------------------------------------------------------------ accueil */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; padding: 30px 0 20px; }
.hero-badge { display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(46, 204, 113, .15); color: #7ef0ac; font-weight: 700; font-size: .85rem; margin-bottom: 14px; }
.logo-big { font-size: clamp(3rem, 9vw, 5.5rem); font-weight: 900; letter-spacing: -0.05em; margin: 0; line-height: 1; }
.hero-sub { font-size: 1.15rem; color: #c8cbef; max-width: 560px; line-height: 1.55; }
.online-count { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: #7ef0ac; }
.online-count::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.hero-art { position: relative; height: 280px; display: flex; align-items: center; justify-content: center; }
.hero-board { position: absolute; width: 240px; height: 240px; border-radius: 28px; background: linear-gradient(135deg, #1d6b5a, #0f3d40); transform: rotateX(55deg) rotateZ(45deg); box-shadow: 0 40px 60px rgba(0, 0, 0, .5); }
.hero-board i { position: absolute; width: 36px; height: 36px; border-radius: 6px; background: hsl(calc(var(--i) * 30), 70%, 60%); left: calc(6px + (var(--i) % 6) * 38px); top: calc(var(--i) / 6 * 0px + (var(--i) > 5) * 198px + 6px); opacity: .9; }
.hero-dice { position: relative; z-index: 2; display: flex; gap: 18px; }
.die-face { font-size: 90px; line-height: 1; color: #fff; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .5)); animation: floaty 3s ease-in-out infinite; }
.die-face.b { animation-delay: -1.5s; color: #ffd166; }
@keyframes floaty { 50% { transform: translateY(-16px) rotate(12deg); } }
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.play-card h2, .rooms-card h2 { margin: 0 0 10px; }
.join-row { display: flex; gap: 8px; margin-top: 8px; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 900; text-align: center; font-size: 1.1rem; }
.room-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow: auto; }
.room-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--panel-border); }
.room-item-main { flex: 1; min-width: 0; }
.room-item-name { font-weight: 800; }
.room-item-meta { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item-players { font-weight: 800; color: var(--gold); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.feature { padding: 22px; border-radius: var(--radius); background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1px solid var(--panel-border); }
.feature-icon { font-size: 2rem; }
.feature h3 { color: #fff; text-transform: none; letter-spacing: 0; font-size: 1.1rem; margin: 8px 0 4px; }
.feature p { color: var(--muted); margin: 0; line-height: 1.5; }

/* ------------------------------------------------------------------ auth */
.auth { display: flex; justify-content: center; padding-top: 40px; }
.auth-card { width: min(440px, 100%); }

/* ---------------------------------------------------------- classement */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { background: var(--panel); border: 1px solid var(--panel-border); color: var(--muted); padding: 8px 14px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 700; }
.tab.active { background: #fff; color: #111; }
.tabs.small { margin: 0; }
.tabs.small .tab { padding: 6px 10px; font-size: .85rem; flex: 1; }
.lb-table { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 56px 42px 1fr auto 140px; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-border); color: #fff; text-decoration: none !important; transition: transform .15s; }
.lb-row:hover { transform: translateX(4px); background: rgba(255, 255, 255, .1); }
.lb-row.top1 { background: linear-gradient(90deg, rgba(255, 209, 102, .25), var(--panel)); border-color: rgba(255, 209, 102, .5); }
.lb-row.top2 { background: linear-gradient(90deg, rgba(200, 210, 230, .2), var(--panel)); }
.lb-row.top3 { background: linear-gradient(90deg, rgba(205, 127, 50, .25), var(--panel)); }
.lb-rank { font-weight: 900; font-size: 1.2rem; text-align: center; }
.lb-name { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-val { text-align: right; font-weight: 900; color: var(--gold); }

/* ------------------------------------------------------------------ profil */
.profile-head { display: flex; gap: 22px; align-items: center; }
.profile-head.vip { border-color: rgba(255, 209, 102, .6); box-shadow: 0 0 40px rgba(255, 209, 102, .15), var(--shadow); }
.profile-info { flex: 1; min-width: 0; }
.profile-info h1 { font-size: 1.9rem; margin-bottom: 4px; }
.bio { color: #c8cbef; margin: 4px 0 10px; }
.xp { margin: 8px 0; max-width: 360px; }
.xp-label { font-weight: 800; font-size: .9rem; margin-bottom: 4px; }
.xp-bar { height: 10px; border-radius: 10px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.xp-bar div { height: 100%; background: linear-gradient(90deg, var(--secondary), var(--accent)); border-radius: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; padding: 14px; text-align: center; }
.stat-icon { font-size: 1.4rem; }
.stat-value { font-size: 1.4rem; font-weight: 900; margin: 4px 0; }
.stat-label { font-size: .78rem; color: var(--muted); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { text-align: center; padding: 14px 10px; border-radius: 14px; background: rgba(0, 0, 0, .2); border: 2px solid var(--panel-border); transition: transform .15s; }
.badge:hover { transform: translateY(-3px); }
.badge-icon { font-size: 2rem; }
.badge-name { font-weight: 800; font-size: .88rem; margin-top: 4px; }
.badge-desc { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.badge.tier-bronze { border-color: #cd7f32; }
.badge.tier-silver { border-color: #c0c8d8; }
.badge.tier-gold { border-color: #ffd166; box-shadow: 0 0 14px rgba(255, 209, 102, .25); }
.badge.tier-legend { border-color: #e100ff; box-shadow: 0 0 18px rgba(225, 0, 255, .35); }
.badge.locked { filter: grayscale(1); opacity: .35; border-color: var(--panel-border); box-shadow: none; }
.history { display: flex; flex-direction: column; gap: 6px; }
.history-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .2); border-left: 4px solid var(--muted); }
.history-row.won { border-left-color: var(--gold); }
.history-rank { font-weight: 900; width: 34px; text-align: center; }
.history-main { flex: 1; min-width: 0; }
.history-delta { font-weight: 900; }
.pos { color: #7ef0ac; }
.neg { color: #ff8a93; }

/* -------------------------------------------------------------- personnalisation */
.settings-preview { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.pick { width: 46px; height: 46px; border-radius: 12px; border: 2px solid var(--panel-border); background: rgba(0, 0, 0, .25); font-size: 1.4rem; cursor: pointer; position: relative; transition: transform .12s; }
.pick-grid.sm .pick { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 9px; }
.pick:hover { transform: scale(1.08); }
.pick.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.pick.color { background: var(--c); }
.pick.vip { border-color: rgba(255, 209, 102, .6); }
.pick.vip::after { content: '👑'; position: absolute; top: -8px; right: -8px; font-size: .7rem; }
.pick.locked { filter: grayscale(.8); opacity: .5; }
.pick.taken { opacity: .2; cursor: not-allowed; }
.vip-promo { border-color: rgba(255, 209, 102, .5); background: linear-gradient(135deg, rgba(255, 209, 102, .12), var(--panel)); }

/* -------------------------------------------------------------- admin */
.table-wrap { overflow-x: auto; margin-top: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 8px; text-align: left; border-bottom: 1px solid var(--panel-border); white-space: nowrap; }
.table th { color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.table tr.banned td { opacity: .6; }
.table td.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.audit-row { font-size: .85rem; padding: 5px 0; border-bottom: 1px solid var(--panel-border); }
.admin .card h2 { margin-bottom: 12px; }

/* -------------------------------------------------------------- règles */
.rules li { margin: 4px 0; }
.rules p { line-height: 1.55; color: #d4d7f5; }
.rules-summary div { padding: 6px 0; border-bottom: 1px solid var(--panel-border); }

/* ================================================================== SALON */
.lobby-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.lobby-title h1 { margin: 0 0 4px; }
.room-name { font-size: 1.6rem; font-weight: 900; background: transparent; border-color: transparent; padding: 4px 8px; margin-left: -8px; }
.room-name:hover { border-color: var(--panel-border); }
.invite { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.invite-label { color: var(--muted); font-size: .85rem; }
.invite-code { font-size: 1.8rem; font-weight: 900; letter-spacing: .25em; padding: 6px 16px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 2px dashed rgba(255, 209, 102, .6); color: var(--gold); cursor: pointer; }
.lobby-grid { display: grid; grid-template-columns: 1fr 1.15fr 0.9fr; gap: 16px; align-items: start; }
.seats { display: flex; flex-direction: column; gap: 8px; }
.seat { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(0, 0, 0, .22); border: 1px solid var(--panel-border); animation: slideIn .3s ease; }
.seat.me { border-color: rgba(63, 167, 255, .6); }
.seat.vip { border-color: rgba(255, 209, 102, .55); background: linear-gradient(90deg, rgba(255, 209, 102, .12), rgba(0, 0, 0, .22)); }
.seat.empty { border-style: dashed; opacity: .75; }
.seat-name { flex: 1; font-weight: 800; min-width: 0; }
.kick { color: #ff8a93; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } }
.settings-form { display: flex; flex-direction: column; gap: 14px; max-height: 62dvh; overflow: auto; padding-right: 4px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.set-group-title { font-weight: 900; color: var(--gold); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.set-label { font-weight: 600; font-size: .92rem; }
.set-label small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.lobby-actions { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 40%); }
.start-btn { font-size: 1.15rem; padding: 16px 32px; animation: glow 2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 6px 34px rgba(255, 90, 95, .7); } }
.waiting { color: var(--muted); font-weight: 600; }
.dot-pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--secondary); animation: pulse 1s infinite; }

/* ------------------------------------------------------------------ chat */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 200px; max-height: 50dvh; padding-right: 4px; }
.chat-line { font-size: .88rem; line-height: 1.4; padding: 4px 8px; border-radius: 8px; background: rgba(0, 0, 0, .18); word-wrap: break-word; }
.chat-line.mine { background: rgba(63, 167, 255, .15); }
.chat-line.system { background: none; color: var(--muted); font-style: italic; font-size: .8rem; text-align: center; }
.chat-name { font-weight: 800; }
.chat-text { margin-left: 6px; }
.chat-input { display: flex; gap: 6px; margin-top: 8px; }

/* ================================================================== JEU */
body.in-game { overflow: hidden; }
.room-root { height: 100dvh; }
body.in-game .room-root:has(.lobby) { height: auto; }
body.in-game:has(.lobby) { overflow: auto; }
.game {
  --side: 370px;
  height: 100dvh; display: grid; grid-template-columns: 1fr var(--side); gap: 0;
  background: radial-gradient(ellipse at 40% 45%, rgba(40, 140, 150, .25), transparent 65%);
}
.board-wrap { position: relative; display: flex; align-items: center; justify-content: center; padding: 10px; min-width: 0; min-height: 0; overflow: hidden; }
.board-scale { position: relative; width: min(calc(100dvh - 48px), calc(100vw - var(--side) - 48px)); aspect-ratio: 1; flex: none; container-type: inline-size; perspective: 230vmin; }

/* --------------------------------------------------------------- plateau */
.board {
  --untilt: 0deg;
  position: relative; width: 100%; height: 100%;
  display: grid; grid-template-columns: 1.5fr repeat(7, 1fr) 1.5fr; grid-template-rows: 1.5fr repeat(7, 1fr) 1.5fr;
  gap: 0.32cqw; padding: 1.1cqw; border-radius: 2.4cqw;
  background:
    radial-gradient(circle at 50% 50%, #1a5f63 0%, #0f3f47 55%, #0a2c35 100%);
  box-shadow:
    inset 0 0 0 0.35cqw #f3d27a,
    inset 0 0 0 0.6cqw #8a6420,
    inset 0 0 3cqw rgba(0, 0, 0, .55),
    0 0 0 0.55cqw #5b3a14,
    0 0 0 0.85cqw #d4a64a,
    0 1.4cqw 0 0.85cqw #3a2409,
    0 2.4cqw 0 0.85cqw #24160a,
    0 4cqw 7cqw rgba(0, 0, 0, .65);
  container-type: size;
  user-select: none;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.view-3d .board-scale { width: min(calc((100dvh - 40px) * 1.04), calc((100vw - var(--side) - 30px) / 1.2)); }
.view-3d .board { --untilt: -32deg; transform: rotateX(32deg) translateY(-1.5%); }
.board.shake { animation: shake .8s; }
@keyframes shake { 10%, 50%, 90% { translate: -6px 2px; } 30%, 70% { translate: 6px -2px; } }

/* --------------------------------------------------------------- cases */
.cell {
  --band: #999; --owner: transparent;
  position: relative; border-radius: 0.9cqw; cursor: pointer; overflow: hidden;
  background: linear-gradient(170deg, #fffaf0, #efe6d2);
  color: #23233a;
  display: flex; align-items: stretch; justify-content: center;
  font-size: 1.1cqw; line-height: 1.1;
  box-shadow: 0 0.35cqw 0 #b9ab8c, 0 0.55cqw 0.8cqw rgba(0, 0, 0, .35);
  transition: transform .18s, box-shadow .2s, filter .2s, opacity .25s;
}
.cell:hover { transform: translateY(-0.5cqw) scale(1.04); z-index: 5; box-shadow: 0 0.6cqw 0 #b9ab8c, 0 1.4cqw 2cqw rgba(0, 0, 0, .45); }
.cell.step { transform: translateY(0.25cqw); box-shadow: 0 0.1cqw 0 #b9ab8c, 0 0.2cqw 0.4cqw rgba(0, 0, 0, .3); }
.cell.owned { background: linear-gradient(170deg, color-mix(in srgb, var(--owner) 30%, #fffaf0), color-mix(in srgb, var(--owner) 52%, #efe6d2)); box-shadow: 0 0.35cqw 0 color-mix(in srgb, var(--owner) 60%, #000), 0 0.55cqw 0.8cqw rgba(0, 0, 0, .35), inset 0 0 0 0.3cqw var(--owner); }
.cell.dim { opacity: .3; filter: grayscale(.8); }
.cell.selectable { animation: selectable 1s ease-in-out infinite; z-index: 4; }
@keyframes selectable { 50% { box-shadow: 0 0 0 0.5cqw #fff, 0 0 3cqw #fff; transform: translateY(-0.6cqw); } }

.tile-band { position: absolute; display: flex; align-items: center; justify-content: center; gap: 0.25cqw; background: linear-gradient(180deg, color-mix(in srgb, var(--band) 85%, #fff), var(--band)); box-shadow: inset 0 -0.2cqw 0 rgba(0, 0, 0, .18); z-index: 1; }
.side-b .tile-band { top: 0; left: 0; right: 0; height: 27%; }
.side-t .tile-band { bottom: 0; left: 0; right: 0; height: 27%; }
.side-l .tile-band { right: 0; top: 0; bottom: 0; width: 25%; flex-direction: column; }
.side-r .tile-band { left: 0; top: 0; bottom: 0; width: 25%; flex-direction: column; }
.tile-band .flag { font-size: 1.35cqw; line-height: 1; filter: drop-shadow(0 0.1cqw 0.15cqw rgba(0, 0, 0, .35)); }
.tile-band.mono { animation: monoShine 2.4s linear infinite; background-size: 100% 300%; background-image: linear-gradient(180deg, var(--band), #fff6c9 50%, var(--band)); }
@keyframes monoShine { to { background-position: 0 -300%; } }
.mono-chip { font-size: max(6px, 0.85cqw); font-weight: 900; background: #ffd166; color: #4a3300; padding: 0 0.3cqw; border-radius: 0.4cqw; box-shadow: 0 0 0.6cqw #ffd166; }
.bld { display: inline-flex; gap: 0.05cqw; }
.side-l .bld, .side-r .bld { flex-direction: column; }
.bld svg { width: 1.45cqw; height: 1.45cqw; filter: drop-shadow(0 0.15cqw 0.1cqw rgba(0, 0, 0, .45)); }
.bld.hotel svg { width: 2cqw; height: 2.35cqw; }
.bld.pop svg { animation: buildPop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.bld.pop svg:nth-child(2) { animation-delay: .1s; }
.bld.pop svg:nth-child(3) { animation-delay: .2s; }
@keyframes buildPop { from { transform: translateY(-2cqw) scale(.2); opacity: 0; } }

.tile-body { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.15cqw; padding: 0.3cqw; min-width: 0; }
.side-b.city .tile-body { padding-top: 2.6cqw; }
.side-t.city .tile-body { padding-bottom: 2.6cqw; }
.side-l.city .tile-body { padding-right: 3.6cqw; }
.side-r.city .tile-body { padding-left: 3.6cqw; }
.tile-icon { font-size: 2.1cqw; line-height: 1; filter: drop-shadow(0 0.25cqw 0.2cqw rgba(0, 0, 0, .25)); }
.side-l .tile-icon, .side-r .tile-icon { font-size: 1.8cqw; }
.tile-name { font-weight: 900; font-size: max(6px, 1.02cqw); line-height: 1.05; letter-spacing: -0.01em; word-break: break-word; hyphens: auto; text-transform: uppercase; }
.tile-price { font-weight: 900; font-size: max(6px, 0.98cqw); line-height: 1.15; padding: 0.12cqw 0.55cqw; border-radius: 99px; background: #2b2b44; color: #fff; box-shadow: 0 0.15cqw 0 rgba(0, 0, 0, .3); white-space: nowrap; }
.cell.owned .tile-price { background: color-mix(in srgb, var(--owner) 75%, #000); }
.owner-flag { position: absolute; z-index: 2; width: 2.1cqw; height: 2.1cqw; border-radius: 50%; font-size: 1.15cqw; display: flex; align-items: center; justify-content: center; background: var(--c); box-shadow: 0 0 0 0.18cqw #fff, 0 0.2cqw 0.4cqw rgba(0, 0, 0, .4); }
.side-b .owner-flag { bottom: 0.35cqw; right: 0.35cqw; }
.side-t .owner-flag { top: 0.35cqw; right: 0.35cqw; }
.side-l .owner-flag { bottom: 0.35cqw; left: 0.35cqw; }
.side-r .owner-flag { bottom: 0.35cqw; right: 0.35cqw; }

/* Stations balnéaires */
.cell.resort { background: linear-gradient(180deg, #8fe3f0 0%, #4fc3dc 45%, #f6dfa8 46%, #efd08e 100%); }
.cell.resort.owned { background: linear-gradient(180deg, color-mix(in srgb, var(--owner) 35%, #8fe3f0), color-mix(in srgb, var(--owner) 30%, #4fc3dc) 45%, color-mix(in srgb, var(--owner) 30%, #f6dfa8) 46%, color-mix(in srgb, var(--owner) 45%, #efd08e)); }
.cell.resort .sea { position: absolute; left: -10%; right: -10%; top: 36%; height: 1.4cqw; background: radial-gradient(circle at 50% 0, transparent 0.55cqw, rgba(255, 255, 255, .7) 0.6cqw, transparent 0.75cqw) 0 0 / 1.6cqw 1.4cqw repeat-x; animation: waves 3s linear infinite; }
@keyframes waves { to { background-position: 3.2cqw 0; } }
.cell.resort .tile-icon { font-size: 2.6cqw; }
/* Chance & impôts */
.cell.chance { background: linear-gradient(160deg, #fff4d6, #ffd98a); }
.chance-mini { width: 3cqw; height: 3.8cqw; border-radius: 0.5cqw; display: flex; align-items: center; justify-content: center; transform: rotate(-8deg); background: repeating-linear-gradient(45deg, #ff8a3d, #ff8a3d 0.4cqw, #ff5a5f 0.4cqw, #ff5a5f 0.8cqw); box-shadow: 0.3cqw 0.3cqw 0 #fff, 0.5cqw 0.5cqw 0 #ffb36b, 0 0.4cqw 0.8cqw rgba(0, 0, 0, .3); }
.chance-mini span { font-weight: 900; font-size: 2.2cqw; color: #fff; text-shadow: 0 0.15cqw 0 rgba(0, 0, 0, .3); }
.cell.tax { background: linear-gradient(160deg, #ffe3e3, #ffb3b3); }
/* Coins */
.cell.start, .cell.jail, .cell.festival, .cell.travel { border-radius: 1.6cqw; flex-direction: column; align-items: center; justify-content: center; gap: 0.3cqw; }
.cell.start { background: radial-gradient(circle at 50% 35%, #d9ffe3, #4fd18b 70%, #27a463); }
.cell.jail { background: radial-gradient(circle at 50% 35%, #fff2c9, #ffc35a 65%, #2fb6d6 66%, #1b8fb3); }
.cell.festival { background: radial-gradient(circle at 50% 35%, #ffe1f5, #d77bff 70%, #8e44ff); }
.cell.travel { background: radial-gradient(circle at 50% 35%, #e1f3ff, #6fc0ff 70%, #2d86e0); }
.corner-art { position: relative; display: flex; align-items: center; justify-content: center; }
.corner-glow { position: absolute; width: 7cqw; height: 7cqw; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .8), transparent 70%); animation: pulse 3s ease-in-out infinite; }
.corner-icon { position: relative; font-size: 5cqw; line-height: 1; filter: drop-shadow(0 0.5cqw 0.5cqw rgba(0, 0, 0, .3)); }
.cell.travel .corner-icon { animation: hover 3s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-0.6cqw) rotate(-6deg); } }
.corner-ribbon { position: relative; font-weight: 900; font-size: max(6px, 1.25cqw); color: #fff; padding: 0.3cqw 1.2cqw; background: linear-gradient(#ff6b6b, #c62828); border-radius: 0.4cqw; box-shadow: 0 0.3cqw 0 #8e1b1b, 0 0.5cqw 0.8cqw rgba(0, 0, 0, .3); letter-spacing: .04em; white-space: nowrap; }
.cell.start .corner-ribbon { background: linear-gradient(#2ecc71, #1e8f4e); box-shadow: 0 0.3cqw 0 #126236, 0 0.5cqw 0.8cqw rgba(0, 0, 0, .3); }
.cell.travel .corner-ribbon { background: linear-gradient(#3fa7ff, #1f6fd1); box-shadow: 0 0.3cqw 0 #164f96, 0 0.5cqw 0.8cqw rgba(0, 0, 0, .3); }
.cell.festival .corner-ribbon { background: linear-gradient(#e056fd, #8e44ff); box-shadow: 0 0.3cqw 0 #5b22b0, 0 0.5cqw 0.8cqw rgba(0, 0, 0, .3); }
.cell.jail .corner-ribbon { background: linear-gradient(#ffb142, #e17b00); box-shadow: 0 0.3cqw 0 #9a5300, 0 0.5cqw 0.8cqw rgba(0, 0, 0, .3); }
.corner-sub { font-size: max(6px, 1cqw); font-weight: 800; color: rgba(0, 0, 0, .65); background: rgba(255, 255, 255, .7); padding: 0.1cqw 0.6cqw; border-radius: 99px; max-width: 95%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.festival-badge { position: absolute; top: 0.3cqw; left: 0.3cqw; z-index: 3; font-size: max(6px, 0.95cqw); font-weight: 900; background: linear-gradient(135deg, #ff00aa, #8e44ff); color: #fff; padding: 0.15cqw 0.45cqw; border-radius: 0.6cqw; animation: pulse 1.2s infinite; }
.cell.festival-on { box-shadow: 0 0.35cqw 0 #8e44ff, 0 0 2.5cqw #ff00aa, inset 0 0 0 0.3cqw #ff00aa; }
/* Effets */
.cell.fx-pulse, .cell.fx-land { animation: fxPulse .7s ease; }
@keyframes fxPulse { 40% { transform: translateY(-0.8cqw) scale(1.1); box-shadow: 0 0 0 0.5cqw var(--fx, #fff), 0 0 3cqw var(--fx, #fff); z-index: 6; } }
.cell.fx-rent { animation: fxRent .9s ease; }
@keyframes fxRent { 30%, 60% { box-shadow: 0 0 0 0.6cqw #ff4757, 0 0 3cqw #ff4757; } }
.cell.fx-takeover { animation: fxTake 1s ease; }
@keyframes fxTake { 0% { transform: rotateY(0); } 50% { transform: rotateY(180deg) scale(1.1); box-shadow: 0 0 3cqw var(--fx); } 100% { transform: rotateY(360deg); } }
.cell.fx-festival { animation: fxFest 1.2s ease; }
@keyframes fxFest { 0%, 100% { filter: none; } 25% { filter: hue-rotate(90deg) brightness(1.3); transform: scale(1.15); } 50% { filter: hue-rotate(200deg); } 75% { filter: hue-rotate(300deg) brightness(1.2); } }
.cell.fx-quake { animation: shake .8s; }

/* --------------------------------------------------------- centre (océan) */
.board-center { grid-row: 2 / 9; grid-column: 2 / 9; position: relative; border-radius: 1.6cqw; overflow: hidden; transform-style: preserve-3d; }
.ocean { position: absolute; inset: 0; background:
    radial-gradient(circle at 50% 45%, rgba(120, 230, 240, .25), transparent 60%),
    repeating-radial-gradient(circle at 50% 120%, rgba(255, 255, 255, .035) 0 0.6cqw, transparent 0.6cqw 2.4cqw),
    linear-gradient(160deg, #146b7a, #0c4a5c 50%, #0a3446);
  box-shadow: inset 0 0 4cqw rgba(0, 0, 0, .45); }
.globe { position: absolute; left: 50%; top: 50%; width: 52cqw; height: 52cqw; translate: -50% -50%; opacity: .9; animation: spinSlow 160s linear infinite; }
.globe svg, .compass svg { width: 100%; height: 100%; }
@keyframes spinSlow { to { rotate: 360deg; } }
.compass { position: absolute; right: 3cqw; bottom: 3cqw; width: 11cqw; height: 11cqw; opacity: .8; }
.cloud { position: absolute; width: 14cqw; height: 4cqw; border-radius: 50%; background: rgba(255, 255, 255, .13); filter: blur(0.8cqw); animation: drift 60s linear infinite; }
.cloud.c1 { top: 18%; left: -20%; }
.cloud.c2 { top: 62%; left: -30%; animation-duration: 85s; animation-delay: -30s; width: 18cqw; }
.cloud.c3 { top: 82%; left: -25%; animation-duration: 70s; animation-delay: -50s; }
@keyframes drift { to { translate: 110cqw 0; } }
.plane { position: absolute; left: -8%; top: 30%; font-size: 3cqw; animation: fly 26s linear infinite; filter: drop-shadow(0 2cqw 0.6cqw rgba(0, 0, 0, .35)); }
.plane span { display: inline-block; transform: rotate(10deg); }
@keyframes fly { 0% { translate: 0 0; opacity: 0; } 4% { opacity: 1; } 45% { translate: 80cqw -10cqw; opacity: 1; } 50%, 100% { translate: 90cqw -12cqw; opacity: 0; } }
.center-logo { position: absolute; top: 5%; left: 0; right: 0; text-align: center; font-size: 6.5cqw; font-weight: 900; letter-spacing: -0.04em; color: #fff; filter: drop-shadow(0 0.3cqw 0 #0a3446) drop-shadow(0 0.8cqw 1.2cqw rgba(0, 0, 0, .5)); pointer-events: none; }
.dice { position: absolute; left: 50%; top: 31%; translate: -50% 0; display: flex; gap: 3cqw; perspective: 60cqw; transform-style: preserve-3d; }
.die { width: 7cqw; height: 7cqw; }
.cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.2, .8, .25, 1.05); }
.face { position: absolute; inset: 0; background: linear-gradient(145deg, #ffffff, #e4e4ef); border-radius: 1.3cqw; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 0.9cqw; box-shadow: inset 0 0 1cqw rgba(0, 0, 0, .15); }
.face .pip { width: 1.3cqw; height: 1.3cqw; border-radius: 50%; place-self: center; }
.face .pip.on { background: radial-gradient(circle at 35% 35%, #555, #111); }
.f1 { transform: translateZ(3.5cqw); }
.f6 { transform: rotateY(180deg) translateZ(3.5cqw); }
.f2 { transform: rotateY(90deg) translateZ(3.5cqw); }
.f5 { transform: rotateY(-90deg) translateZ(3.5cqw); }
.f3 { transform: rotateX(90deg) translateZ(3.5cqw); }
.f4 { transform: rotateX(-90deg) translateZ(3.5cqw); }
.f1 .pip.on { background: radial-gradient(circle at 35% 35%, #ff6b6b, #b3261e); }
.die.rolling { animation: dieBounce 1.1s ease; }
@keyframes dieBounce { 0% { translate: 0 -5cqw; } 30% { translate: 0 0; } 45% { translate: 0 -1.6cqw; } 60% { translate: 0 0; } }
.die.double .face { box-shadow: inset 0 0 1cqw rgba(0, 0, 0, .15), 0 0 2.5cqw #ffd166; }

/* ------------------------------------------- interface superposée (HUD) */
.board-hud { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.board-hud > * { pointer-events: auto; }
.center-info { position: absolute; top: 28%; left: 50%; translate: -50% 0; display: flex; gap: 1.5cqw; font-size: 1.45cqw; font-weight: 800; color: rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .3); padding: 0.4cqw 1.4cqw; border-radius: 99px; backdrop-filter: blur(4px); pointer-events: none; }
.view-3d .center-info { top: 27%; }
.center-info:empty { display: none; }
.game-clock.urgent { color: #ff8a93; animation: pulse 1s infinite; }
.action-panel { position: absolute; left: 50%; top: 52%; translate: -50% 0; width: min(46cqw, 100%); display: flex; flex-direction: column; align-items: center; gap: 0.9cqw; font-size: 1.6cqw; }
.view-3d .action-panel { top: 50%; }
.action-panel:empty { display: none; }
.action-panel.pop { animation: pop .3s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { from { scale: .9; opacity: 0; } }
.action-panel .btn { font-size: 1.55cqw; padding: 1cqw 1.6cqw; border-radius: 1.2cqw; }
.action-panel .btn.sm { font-size: 1.25cqw; padding: 0.6cqw 1cqw; }
.action-panel > .btn-col, .action-panel > .prop-header, .action-panel > .sell-list { filter: drop-shadow(0 1cqw 1.5cqw rgba(0, 0, 0, .35)); }
.roll-btn { font-size: 2.4cqw !important; padding: 1.6cqw 4cqw !important; background: linear-gradient(135deg, var(--primary), var(--primary2)); box-shadow: 0 0.5cqw 0 #b33a2a, 0 1.2cqw 3cqw rgba(255, 90, 95, .5); animation: glow 1.6s infinite; }
.panel-title { font-weight: 900; font-size: 1.8cqw; text-align: center; text-shadow: 0 0.2cqw 0.6cqw rgba(0, 0, 0, .6); }
.panel-title.danger { color: #ff8a93; }
.hint { font-size: 1.3cqw; color: rgba(255, 255, 255, .85); text-align: center; text-shadow: 0 0.2cqw 0.5cqw rgba(0, 0, 0, .6); }
.waiting-turn { display: flex; align-items: center; gap: 1cqw; background: rgba(5, 20, 30, .6); backdrop-filter: blur(6px); padding: 1cqw 1.8cqw; border-radius: 99px; font-size: 1.55cqw; border: 1px solid rgba(255, 255, 255, .12); }
.waiting-turn .avatar.sm { width: 3cqw; height: 3cqw; font-size: 1.8cqw; }
.timer-bar { width: 100%; height: 0.7cqw; border-radius: 1cqw; background: rgba(0, 0, 0, .35); overflow: hidden; }
.timer-bar div { height: 100%; width: 100%; background: linear-gradient(90deg, var(--success), #b6f09c); transition: width .25s linear; }
.timer-bar.urgent div { background: linear-gradient(90deg, var(--danger), #ff9f43); }
.sell-list { display: flex; flex-wrap: wrap; gap: 0.6cqw; justify-content: center; max-height: 14cqw; overflow: auto; }
.prop-header { --band: #888; width: 100%; border-radius: 1.2cqw; overflow: hidden; background: linear-gradient(170deg, #fffaf0, #efe6d2); color: #1d1d2b; text-align: center; box-shadow: 0 0.4cqw 0 #b9ab8c, 0 1cqw 2cqw rgba(0, 0, 0, .3); }
.prop-header-band { background: var(--band); color: #fff; font-weight: 800; padding: 0.5cqw; font-size: 1.3cqw; text-shadow: 0 0.1cqw 0.2cqw rgba(0, 0, 0, .4); }
.prop-header-name { font-weight: 900; font-size: 2.2cqw; padding: 0.5cqw 0 0; text-transform: uppercase; }
.prop-header-sub { font-size: 1.15cqw; padding: 0.2cqw 0.6cqw 0.7cqw; color: #555; }
.cell-modal .prop-header { border-radius: 12px; }
.cell-modal .prop-header-band { font-size: .95rem; padding: 6px; }
.cell-modal .prop-header-name { font-size: 1.5rem; padding: 6px 0; }
.rent-table { width: 100%; border-collapse: collapse; margin: 12px 0 6px; }
.rent-table td { padding: 6px 8px; border-bottom: 1px solid var(--panel-border); }
.rent-table td:last-child { text-align: right; font-weight: 800; }
.rent-table tr.cur { background: rgba(255, 209, 102, .15); }
.info-row { padding: 6px 0; font-size: .92rem; }
.tile-tip { position: absolute; left: 0; top: 0; z-index: 40; pointer-events: none; background: rgba(15, 18, 37, .95); border: 1px solid var(--panel-border); border-radius: 10px; padding: 8px 12px; font-size: .82rem; line-height: 1.5; box-shadow: var(--shadow); white-space: nowrap; }
.tip-title { font-weight: 900; font-size: .92rem; }

/* Carte chance */
.card-slot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 8; }
.chance-card { width: 26cqw; height: 34cqw; perspective: 80cqw; transform: scale(.3) translateY(30cqw); opacity: 0; transition: transform .45s cubic-bezier(.2, .9, .3, 1.2), opacity .3s; }
.chance-card.flip { transform: none; opacity: 1; }
.chance-card.out { transform: scale(.6) translateY(-20cqw); opacity: 0; }
.chance-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s .25s; }
.chance-card.flip .chance-inner { transform: rotateY(180deg); }
.chance-back, .chance-front { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 2cqw; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 2cqw 5cqw rgba(0, 0, 0, .5); }
.chance-back { background: repeating-linear-gradient(45deg, #ff8a3d, #ff8a3d 1cqw, #ff5a5f 1cqw, #ff5a5f 2cqw); border: 0.6cqw solid #fff; }
.chance-back span { font-size: 12cqw; font-weight: 900; color: #fff; text-shadow: 0 0.6cqw 0 rgba(0, 0, 0, .25); }
.chance-front { transform: rotateY(180deg); background: linear-gradient(160deg, #fffaf0, #ffe8c2); color: #2b1d0e; padding: 2cqw; text-align: center; border: 0.5cqw solid #ff8a3d; }
.chance-icon { font-size: 7cqw; }
.chance-title { font-weight: 900; font-size: 2.4cqw; margin: 1cqw 0; text-transform: uppercase; }
.chance-text { font-size: 1.6cqw; line-height: 1.3; }
.chance-who { margin-top: 1.5cqw; font-size: 1.2cqw; opacity: .6; font-weight: 700; }

/* --------------------------------------------------------------- pions */
.pawn-layer { position: absolute; inset: 0; pointer-events: none; z-index: 10; transform-style: preserve-3d; }
.pawn, .coin-fly, .board-float { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.pawn { --c: #fff; transition: transform .17s ease-out, opacity .25s; }
.pawn-ring { position: absolute; width: 4.4cqw; height: 4.4cqw; left: -2.2cqw; top: -2.2cqw; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 55%, transparent) 30%, transparent 70%); box-shadow: 0 0 0 0.2cqw color-mix(in srgb, var(--c) 70%, transparent); opacity: .75; }
.pawn.current .pawn-ring { animation: ringPulse 1.4s ease-out infinite; opacity: 1; }
@keyframes ringPulse { 0% { scale: .7; } 70% { scale: 1.3; opacity: .2; } 100% { scale: 1.3; opacity: 0; } }
.pawn-pin { position: absolute; left: 0; top: 0; width: 4.2cqw; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 100%; transform: translate(-50%, -100%) rotateX(var(--untilt)); transition: transform .6s; }
.pawn-head { width: 4.2cqw; height: 4.2cqw; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.4cqw; background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c) 45%, white), var(--c) 62%, color-mix(in srgb, var(--c) 70%, black)); box-shadow: 0 0 0 0.3cqw #fff, 0 0.6cqw 1cqw rgba(0, 0, 0, .45); }
.pawn-head span { filter: drop-shadow(0 0.15cqw 0.15cqw rgba(0, 0, 0, .35)); }
.pawn-tip { width: 0; height: 0; margin-top: -0.2cqw; border-left: 1cqw solid transparent; border-right: 1cqw solid transparent; border-top: 1.5cqw solid #fff; filter: drop-shadow(0 0.3cqw 0.2cqw rgba(0, 0, 0, .35)); }
.pawn-crown { position: absolute; top: -1.9cqw; font-size: 1.8cqw; animation: hover 2s ease-in-out infinite; }
.pawn.vip .pawn-head { box-shadow: 0 0 0 0.3cqw #ffd166, 0 0 1.6cqw rgba(255, 209, 102, .8), 0 0.6cqw 1cqw rgba(0, 0, 0, .45); }
.pawn.vip .pawn-tip { border-top-color: #ffd166; }
.pawn.current .pawn-head { box-shadow: 0 0 0 0.3cqw #fff, 0 0 0 0.65cqw var(--c), 0 0 2.4cqw var(--c), 0 0.6cqw 1cqw rgba(0, 0, 0, .45); }
.pawn.moving .pawn-pin { animation: hop .17s ease-in-out infinite; }
@keyframes hop { 50% { translate: 0 -1.2cqw; } }
.pawn.teleport { opacity: 0; }
.pawn.appear .pawn-pin { animation: appear .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes appear { from { translate: 0 -6cqw; opacity: 0; } }
.pawn.gone { opacity: 0; }
.coin-fly { transition: transform .55s cubic-bezier(.45, -0.2, .4, 1.1); z-index: 99999; }
.coin { position: absolute; left: -1cqw; top: -2cqw; width: 2cqw; height: 2cqw; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1cqw; font-weight: 900; color: #7a5200; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffd166 45%, #d19a1a); box-shadow: 0 0 0 0.15cqw #b07d0a, 0 0.3cqw 0.5cqw rgba(0, 0, 0, .4); transform-origin: 50% 100%; transform: rotateX(var(--untilt)); }
.coin-fly.go .coin { animation: coinSpin .55s linear; }
@keyframes coinSpin { 50% { scale: 1.3; translate: 0 -2.5cqw; } }
.board-float { z-index: 99999; }
.float-money { position: absolute; right: 10px; top: 4px; font-weight: 900; font-size: 1rem; animation: floatUp 1.6s ease-out forwards; pointer-events: none; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); z-index: 5; }
.float-money.board { right: auto; left: 0; top: 0; font-size: 2cqw; white-space: nowrap; transform-origin: 0 100%; transform: translate(-50%, -7.5cqw) rotateX(var(--untilt)); text-shadow: 0 0.2cqw 0 rgba(0, 0, 0, .5), 0 0 1cqw rgba(0, 0, 0, .6); }
.float-money.pos { color: #7ef0ac; }
.float-money.neg { color: #ff6b75; }
@keyframes floatUp { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: 0 -40px; } }
.emote-bubble { position: absolute; left: 0; top: 0; font-size: 4cqw; transform-origin: 0 100%; transform: translate(-50%, -11cqw) rotateX(var(--untilt)); animation: emote 2.2s ease forwards; }
.emote-card { position: absolute; right: 50%; top: -12px; font-size: 1.8rem; animation: emote 2.2s ease forwards; pointer-events: none; }
@keyframes emote { 0% { opacity: 0; scale: .3; } 15% { opacity: 1; scale: 1.3; } 25% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; translate: 0 -20px; } }
.flash-banner { position: absolute; left: 50%; top: 45%; z-index: 30; font-size: 3.4cqw; font-weight: 900; padding: 1.5cqw 4cqw; border-radius: 2cqw; background: linear-gradient(135deg, rgba(255, 90, 95, .95), rgba(166, 107, 255, .95)); box-shadow: 0 2cqw 6cqw rgba(0, 0, 0, .5); animation: banner 1.8s ease forwards; pointer-events: none; white-space: nowrap; translate: -50% -50%; }
@keyframes banner { 0% { opacity: 0; scale: .5; } 15% { opacity: 1; scale: 1.08; } 25% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; translate: -50% -80%; } }
.view-btn { font-weight: 900; font-size: .8rem !important; }

/* Colonne latérale */
.side { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 10px 0; min-height: 0; height: 100dvh; }
.toolbar { display: flex; align-items: center; gap: 6px; }
.tb-code { white-space: nowrap; font-weight: 900; letter-spacing: .12em; color: var(--gold); background: var(--panel); padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.tb-info { flex: 1; white-space: nowrap; color: var(--muted); font-weight: 700; font-size: .9rem; padding-left: 4px; }
.players { display: flex; flex-direction: column; gap: 6px; }
.pcard { --c: #888; position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--panel-border); border-left: 5px solid var(--c); cursor: pointer; transition: transform .2s, background .2s, box-shadow .2s; overflow: visible; }
.pcard:hover { background: rgba(255, 255, 255, .09); }
.pcard.turn { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 30%, transparent), var(--panel)); box-shadow: 0 0 0 2px var(--c), 0 6px 24px color-mix(in srgb, var(--c) 40%, transparent); transform: scale(1.02); }
.pcard.me .pcard-name::after { content: ' (vous)'; color: var(--muted); font-weight: 600; font-size: .75rem; }
.pcard.vip { border-top: 1px solid rgba(255, 209, 102, .45); border-right: 1px solid rgba(255, 209, 102, .45); border-bottom: 1px solid rgba(255, 209, 102, .45); }
.pcard.out { opacity: .45; filter: grayscale(1); }
.pcard.hl { outline: 2px dashed #fff; }
.pcard-main { flex: 1; min-width: 0; }
.pcard-name { font-weight: 800; font-size: .95rem; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.pcard-name > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pcard-name .tag { margin-left: 4px; }
.pcard-sub { font-size: .75rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pcard-cash { font-weight: 900; font-size: 1.15rem; color: #7ef0ac; font-variant-numeric: tabular-nums; }
.pcard-timer { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--c); border-radius: 3px; transition: width .25s linear; width: 100%; }
.side-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; padding: 8px; }
.side-panel .chat { flex: 1; }
.side-panel .chat-list { max-height: none; min-height: 0; }
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; font-size: .82rem; }
.log-line { padding: 3px 6px; border-radius: 6px; line-height: 1.35; color: #d4d7f5; animation: slideIn .25s ease; }
.log-line:nth-child(even) { background: rgba(0, 0, 0, .12); }
.log-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.emotes { display: flex; justify-content: space-between; gap: 2px; }
.emote { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px; font-size: 1.15rem; padding: 4px 0; flex: 1; cursor: pointer; transition: transform .12s; }
.emote:hover { transform: scale(1.2); }

/* Fin de partie */
.end-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(5, 7, 20, .75); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .4s; }
@keyframes fadeIn { from { opacity: 0; } }
.end-card { background: var(--panel-solid); border: 1px solid var(--panel-border); border-radius: 24px; padding: 28px; width: min(640px, 100%); text-align: center; box-shadow: var(--shadow); animation: pop .5s cubic-bezier(.2, .9, .3, 1.4); max-height: 94dvh; overflow: auto; }
.end-title { font-size: 2.2rem; font-weight: 900; background: linear-gradient(90deg, var(--gold), #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200%; animation: shine 3s linear infinite; }
.end-sub { color: var(--muted); margin: 6px 0 20px; }
.podium { display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: end; gap: 10px; margin: 10px 0 16px; }
.podium-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.podium-step { width: 100%; border-radius: 12px 12px 0 0; display: flex; align-items: flex-start; justify-content: center; font-size: 2rem; padding-top: 6px; }
.podium-slot.p1 .podium-step { height: 110px; background: linear-gradient(#ffd166, #b8860b); }
.podium-slot.p2 .podium-step { height: 80px; background: linear-gradient(#e0e6f0, #8892a8); }
.podium-slot.p3 .podium-step { height: 60px; background: linear-gradient(#e1a46d, #8b5a2b); }
.podium-name { font-weight: 800; font-size: .9rem; }
.podium-worth { font-weight: 900; color: #7ef0ac; }
.end-row { display: flex; justify-content: space-between; padding: 6px 12px; border-radius: 8px; background: rgba(0, 0, 0, .2); margin: 4px 0; }
.rewards { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0; }
.reward { padding: 8px 14px; border-radius: 10px; background: rgba(63, 167, 255, .18); font-weight: 900; }
.new-badges { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.new-badges .small { width: 100%; font-weight: 800; color: var(--gold); }
.new-badges .badge { animation: pop .6s cubic-bezier(.2, .9, .3, 1.5); }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; }

/* ================================================================ responsive */
@media (max-width: 1100px) {
  .lobby-grid { grid-template-columns: 1fr 1fr; }
  .lobby-chat { grid-column: 1 / -1; }
  .game { --side: 310px; }
}
@media (max-width: 900px) {
  .hero, .play-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .features { grid-template-columns: 1fr 1fr; }
  .nav-links a { padding: 6px 8px; font-size: .9rem; }
  #topbar { gap: 10px; }
  .lb-row { grid-template-columns: 40px 36px 1fr 90px; }
  .lb-sub { display: none; }
  /* Jeu en colonne sur mobile / tablette portrait */
  body.in-game { overflow: auto; }
  .room-root { height: auto; }
  .game { display: flex; flex-direction: column; height: auto; }
  .board-wrap { padding: 4px; }
  .board-scale, .view-3d .board-scale { width: min(100vw - 8px, 100dvh - 8px); }
  .side { height: auto; padding: 8px; }
  .side-panel { height: 300px; flex: none; }
  .players { display: grid; grid-template-columns: 1fr 1fr; }
  .pcard { padding: 6px 8px; }
  .pcard .avatar { width: 32px; height: 32px; font-size: 1rem; }
  .pcard-cash { font-size: .95rem; }
  .action-panel { width: 70cqw; }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .features { grid-template-columns: 1fr; }
  .lobby-grid { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; text-align: center; }
  .xp { margin: 8px auto; }
  .invite-code { font-size: 1.3rem; }
  .players { grid-template-columns: 1fr; }
  .tile-icon { font-size: 1.7cqw; }
  .side-b.city .tile-body { padding-top: 2.2cqw; }
  .side-t.city .tile-body { padding-bottom: 2.2cqw; }
  .tile-body { gap: 0.4cqw; }
  .action-panel { width: 78cqw; font-size: 2.4cqw; }
  .action-panel .btn { font-size: 2.3cqw; }
  .panel-title { font-size: 2.6cqw; }
  .hint { font-size: 2cqw; }
  .waiting-turn { font-size: 2.3cqw; }
}
/* Paysage sur petit écran : plateau à gauche, panneau compact à droite */
@media (max-height: 520px) and (orientation: landscape) {
  .game { display: grid; --side: 280px; height: 100dvh; }
  .board-scale, .view-3d .board-scale { width: min(calc(100dvh - 8px), calc(100vw - var(--side) - 8px)); }
  .side { height: 100dvh; }
  .players { grid-template-columns: 1fr; }
  .emotes { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
