/* Hub — En direct : Mode jeu (hub-livegame.js). Couleurs = variables du theme (suit l'apparence), aucun violet en dur. */
#page-direct .page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lg-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); }
.lg-switch button { appearance: none; border: 0; background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.lg-switch button:hover { color: var(--text-primary); }
.lg-switch button.on { background: var(--bg-hover); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border-light); }
#lg-root { display: none; }
#page-direct.lg-on #lg-root { display: block; }
#page-direct.lg-on #lv-root { display: none; }

.lg-wrap { display: flex; flex-direction: column; gap: 14px; }
.lg-hud { display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(3, minmax(90px, .7fr)) minmax(220px, 1.8fr); gap: 10px; }
.lg-hud > div { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.lg-stat span, .lg-lvl-top span { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.lg-stat b { display: block; font-size: 20px; color: var(--text-primary); margin-top: 4px; font-variant-numeric: tabular-nums; }
.lg-lvl-top { display: flex; align-items: baseline; gap: 8px; }
.lg-lvl-top b { font-size: 20px; color: var(--text-primary); }
.lg-lvl-top small { margin-left: auto; color: var(--text-secondary); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lg-bar { height: 6px; border-radius: 6px; background: var(--bg-hover); margin-top: 10px; overflow: hidden; }
.lg-bar i { display: block; height: 100%; border-radius: 6px; background: var(--text-primary); transition: width .6s cubic-bezier(.16,1,.3,1); }
.lg-ext { display: flex; gap: 10px; align-items: center; }
.lg-ext b { display: block; font-size: 13px; color: var(--text-primary); }
.lg-ext small { display: block; font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lg-ext > div { min-width: 0; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex: none; }
.lg-ext.on .lg-dot { background: var(--green); }
.lg-ext.off .lg-dot { background: var(--red); }
.lg-ext.busy .lg-dot { animation: lgp 1.2s infinite; }
@keyframes lgp { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.45); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); } }

.lg-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.lg-stage { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-secondary); }
.lg-stage canvas { display: block; width: 100%; touch-action: manipulation; }
.lg-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.lg-btn { appearance: none; font-family: inherit; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border-light); background: var(--text-primary); color: var(--bg-primary); cursor: pointer; white-space: nowrap; }
.lg-btn.ghost { background: var(--bg-card); color: var(--text-secondary); }
.lg-btn.ghost:hover { color: var(--text-primary); }
.lg-btn[disabled] { opacity: .4; cursor: not-allowed; }
.lg-toasts { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: max-content; max-width: 90%; }
.lg-toast { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 10px; padding: 8px 14px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: lgin .35s cubic-bezier(.16,1,.3,1); transition: opacity .5s, transform .5s; }
.lg-toast.out { opacity: 0; transform: translateY(-6px); }
.lg-toast small { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.lg-toast b { display: block; font-size: 13px; color: var(--text-primary); margin-top: 2px; }
@keyframes lgin { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }

.lg-side { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; max-height: 560px; }
.lg-tabs { display: flex; border-bottom: 1px solid var(--border); }
.lg-tabs button { flex: 1; appearance: none; border: 0; background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 11px 6px; cursor: pointer; border-bottom: 2px solid transparent; }
.lg-tabs button.on { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.lg-panel { overflow: auto; padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.lg-wallet { font-size: 12px; color: var(--text-secondary); padding: 2px 2px 6px; }
.lg-wallet b { color: var(--text-primary); }
.lg-item, .lg-ach { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid var(--border); }
.lg-item > div, .lg-ach > div { flex: 1; min-width: 0; }
.lg-item b, .lg-ach b { display: block; font-size: 12.5px; color: var(--text-primary); }
.lg-item small, .lg-ach small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.lg-ach { opacity: .55; }
.lg-ach.ok { opacity: 1; }
.lg-medal { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 2px dashed var(--border-light); }
.lg-ach.ok .lg-medal { border: 0; background: radial-gradient(circle at 35% 30%, #fff6d8, var(--yellow) 55%, #8a5a00); }
.lg-reset { appearance: none; border: 0; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 11px; text-decoration: underline; cursor: pointer; margin-top: 6px; align-self: flex-start; }
.lg-reset:hover { color: var(--red); }
.lg-j { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text-secondary); padding: 6px 0; border-bottom: 1px dashed var(--border); }
.lg-j span { font-family: ui-monospace, monospace; font-size: 11px; color: var(--text-muted); flex: none; }
.lg-j div { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-j b { color: var(--text-primary); }
.lg-j em { font-style: normal; color: var(--text-primary); font-size: 11px; flex: none; }
.lg-j.bad div { color: var(--red); }
.lg-empty { font-size: 12px; color: var(--text-muted); padding: 10px 2px; }
.lg-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

@media (max-width: 1100px) {
  .lg-main { grid-template-columns: 1fr; }
  .lg-side { max-height: 420px; }
  .lg-hud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg-lvl, .lg-ext { grid-column: span 3; }
}
@media (max-width: 560px) {
  .lg-hud > div { padding: 10px 11px; }
  .lg-stat b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .lg-toast, .lg-bar i { animation: none; transition: none; } }
