:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: #dcdfe6;
  --text: #1d2130;
  --muted: #687085;
  --accent: #a8701a;
  --accent-text: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--surface));
  --danger: #d0384b;
  --ok: #1f9d63;
  --warn: #c98a12;
  --mention: #fff3c4;
  --code-bg: #eceff5;
  --felt: #1f6b45;
  --felt-dark: color-mix(in srgb, var(--felt) 70%, #000);
  --sea: #cfe4f7;
  --sea-dark: #9cc4ea;
  --sq-light: #ecd9b9;
  --sq-dark: #b58863;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 25, 40, .08), 0 4px 16px rgba(20, 25, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1f2b; --surface: #132b34; --surface-2: #1c3640; --border: #2b4752; --text: #e8eef1;
    --muted: #94a8b2; --accent: #dc9729; --accent-text: #1c1204; --accent-soft: color-mix(in srgb, var(--accent) 20%, var(--surface)); --danger: #f06272;
    --ok: #3cc488; --warn: #e2a73a; --mention: #4d3d17; --code-bg: #11232d; --sea: #123b52; --sea-dark: #1d5675;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1f2b; --surface: #132b34; --surface-2: #1c3640; --border: #2b4752; --text: #e8eef1;
  --muted: #94a8b2; --accent: #dc9729; --accent-text: #1c1204; --accent-soft: color-mix(in srgb, var(--accent) 20%, var(--surface)); --danger: #f06272;
  --ok: #3cc488; --warn: #e2a73a; --mention: #4d3d17; --code-bg: #11232d; --sea: #123b52; --sea-dark: #1d5675;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: var(--font-size, 15px); }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- Mise en page : barre du haut + barre latérale ---- */
:root { --topbar-h: 56px; --sidebar-w: 76px; }
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 30; display: flex; align-items: center; gap: .8rem;
  padding: 0 1rem 0 0; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { width: var(--sidebar-w); flex: none; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 800; font-size: 1.05rem; color: var(--text); white-space: nowrap; margin-left: -.4rem; }
.search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.search input { padding-left: 2.2rem; border-radius: 99px; background: var(--surface-2); border-color: transparent; }
.search input:focus { background: var(--surface); }
.search .ico { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: flex; }
.top-right { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.points-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 99px; background: var(--surface-2); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; transition: background .3s; }
.points-pill:hover { text-decoration: none; background: var(--accent-soft); }
.points-pill .coin { color: #d9a514; display: flex; }
.points-pill.up { background: color-mix(in srgb, var(--ok) 30%, var(--surface-2)); }
.points-pill.down { background: color-mix(in srgb, var(--danger) 25%, var(--surface-2)); }
.bell-wrap { position: relative; }
.icon-btn.round { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; position: relative; color: var(--text); }
.icon-btn .badge { position: absolute; top: 1px; right: 0; }
.me-link { display: flex; align-items: center; gap: .45rem; color: var(--text); font-weight: 600; padding: .2rem .5rem .2rem .25rem; border-radius: 99px; }
.me-link:hover { background: var(--surface-2); text-decoration: none; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; }
.conn-dot.on { background: var(--ok); }
.badge {
  display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 99px; background: var(--danger);
  color: #fff; font-size: .7rem; font-weight: 700; text-align: center; line-height: 1.3em;
}

.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 25; display: flex; flex-direction: column;
  align-items: center; gap: .25rem; padding: .7rem 0; background: var(--surface); border-right: 1px solid var(--border);
}
.side-link {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .15rem; width: 62px; padding: .5rem 0 .4rem;
  border-radius: 12px; color: var(--muted); font-size: .68rem; font-weight: 600; background: none; border: 0; cursor: pointer; font-family: inherit;
}
.side-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-link.active { background: var(--accent-soft); color: var(--accent); }
.side-link .badge { position: absolute; top: 3px; right: 9px; }
.side-spacer { flex: 1; }

.popover {
  position: fixed; z-index: 40; background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: .9rem; width: 300px; max-width: calc(100vw - 24px);
  max-height: calc(100vh - var(--topbar-h) - 24px); overflow-y: auto;
}
.popover h4 { margin: .8rem 0 .4rem; font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.popover h4:first-child { margin-top: 0; }
.seg { display: flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; color: var(--muted); padding: .3rem; border-radius: 6px; cursor: pointer; font: inherit; font-size: .85rem; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.swatches input[type=color] { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }

.dropdown { position: absolute; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.25); z-index: 40; overflow: hidden; }
.search .dropdown { left: 0; right: 0; max-height: 70vh; overflow-y: auto; }
.dd-section { padding: .3rem 0; border-bottom: 1px solid var(--border); }
.dd-section:last-child { border-bottom: 0; }
.dd-title { font-size: .7rem; text-transform: uppercase; color: var(--muted); padding: .3rem .8rem; font-weight: 700; }
.dd-item { display: flex; gap: .55rem; align-items: center; padding: .45rem .8rem; color: var(--text); cursor: pointer; }
.dd-item:hover, .dd-item.kb { background: var(--surface-2); text-decoration: none; }
.dd-item .sub { color: var(--muted); font-size: .8rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-item > div { min-width: 0; }
.dd-empty { padding: 1rem; text-align: center; color: var(--muted); }
.dd-foot { display: block; text-align: center; padding: .5rem; font-size: .85rem; border-top: 1px solid var(--border); }
mark { background: color-mix(in srgb, var(--warn) 40%, transparent); color: inherit; border-radius: 2px; }
.notif-panel { right: 0; width: 360px; max-width: calc(100vw - 24px); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif { display: flex; gap: .6rem; padding: .6rem .8rem; color: var(--text); border-bottom: 1px solid var(--border); cursor: pointer; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.notif.unread::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: .4rem; }
.notif .txt { flex: 1; font-size: .9rem; overflow-wrap: anywhere; }

main { margin: var(--topbar-h) 0 0 var(--sidebar-w); padding: 1.2rem 16px 3rem; }
main > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
main.wide > * { max-width: none; }
main.bare { margin: 0; }

@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  .brand { width: auto; padding-left: .8rem; }
  .brand-name, .me-link .name, .conn-dot { display: none; }
  .topbar { gap: .4rem; padding-right: .5rem; }
  .points-pill { padding: .25rem .5rem; font-size: .85rem; }
  .sidebar {
    top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 60px; flex-direction: row; justify-content: space-around;
    padding: 0 .3rem; border-right: 0; border-top: 1px solid var(--border);
  }
  .side-spacer { display: none; }
  .side-link { width: auto; flex: 1; padding: .35rem 0; }
  main { padding-bottom: 80px; }
  table.list { display: block; overflow-x: auto; }
}

/* ---- Composants ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-text); padding: .45rem .9rem; border-radius: 8px; cursor: pointer;
  font: inherit; font-weight: 600; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.small { padding: .2rem .55rem; font-size: .85rem; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.05rem; padding: .2rem .35rem; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .45rem .6rem; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; min-height: 6rem; }
label { display: block; font-weight: 600; margin: .7rem 0 .25rem; font-size: .92rem; }
.switch-row { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.switch-row input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; flex: none; accent-color: var(--accent); }
.form-error { color: var(--danger); margin-top: .5rem; min-height: 1.2em; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); font-size: .85rem; }
.avatar.lg { width: 96px; height: 96px; font-size: 2rem; }
.avatar.sm { width: 22px; height: 22px; font-size: .7rem; }
.role { font-size: .7rem; padding: .05rem .4rem; border-radius: 4px; background: var(--surface-2); color: var(--muted); text-transform: uppercase; font-weight: 700; }
.role.admin { background: var(--danger); color: #fff; }
.role.mod { background: var(--ok); color: #fff; }
.role.bot { background: var(--accent); color: var(--accent-text); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list th { color: var(--muted); font-size: .8rem; text-transform: uppercase; font-weight: 600; }
table.list tr:last-child td { border-bottom: 0; }
.pager { display: flex; gap: .3rem; margin: 1rem 0; flex-wrap: wrap; }
.pager a, .pager span { padding: .2rem .6rem; border-radius: 6px; border: 1px solid var(--border); }
.pager span { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.breadcrumb { color: var(--muted); margin-bottom: .8rem; font-size: .9rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }
.tag { font-size: .75rem; padding: .05rem .45rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tag.ok { background: var(--ok); color: #fff; } .tag.warn { background: var(--warn); color: #fff; }

/* ---- Toasts & lightbox ---- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: .5rem; z-index: 50; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: .6rem .8rem; border-radius: 8px; box-shadow: var(--shadow); cursor: pointer; }
.toast.error { border-left-color: var(--danger); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: flex; align-items: center; justify-content: center; z-index: 60; cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 95vh; border-radius: 6px; }

/* ---- Authentification ---- */
.auth-box { max-width: 380px; margin: 8vh auto; }
.auth-box h1 { text-align: center; }

/* ---- Markdown ---- */
.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 .5em; } .md p:last-child { margin-bottom: 0; }
.md code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; font-size: .9em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.md pre { background: var(--code-bg); padding: .7rem; border-radius: 8px; overflow-x: auto; margin: .4em 0; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: .4em 0; padding: .1em .8em; border-left: 3px solid var(--border); color: var(--muted); }
.md ul, .md ol { margin: .3em 0; padding-left: 1.5em; }
.md h1, .md h2, .md h3 { margin: .5em 0 .3em; }
.md hr { border: 0; border-top: 1px solid var(--border); }
.md img.md-img { max-width: min(100%, 360px); max-height: 300px; border-radius: 6px; display: block; margin: .3em 0; cursor: zoom-in; }
.md .spoiler { background: var(--text); color: transparent; border-radius: 3px; cursor: pointer; padding: 0 .2em; }
.md .spoiler.open { background: var(--surface-2); color: inherit; }
.md .mention { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 .2em; font-weight: 600; }
.md .mention.me { background: var(--mention); color: var(--text); }

/* ---- Éditeur Markdown ---- */
.editor .toolbar { display: flex; gap: .2rem; flex-wrap: wrap; margin-bottom: .3rem; }
.editor .toolbar button { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: .15rem .5rem; cursor: pointer; font: inherit; font-size: .85rem; }
.editor .preview { border: 1px dashed var(--border); border-radius: 8px; padding: .6rem; margin-top: .4rem; min-height: 3rem; }
.drop-hint { outline: 2px dashed var(--accent) !important; }

/* ---- Forum ---- */
.cat-row td:first-child a { font-weight: 600; font-size: 1.02rem; }
.post { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; }
.post + .post { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.post-author { text-align: center; font-size: .85rem; }
.post-author .name { font-weight: 700; display: block; margin-top: .3rem; }
.post-meta { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .82rem; margin-bottom: .4rem; }
@media (max-width: 640px) {
  .post { grid-template-columns: 1fr; }
  .post-author { display: flex; align-items: center; gap: .5rem; text-align: left; }
  .post-author .name { margin: 0; }
}
.topic-flags { font-size: .85rem; }

/* ---- Chat ---- */
.chat-layout { display: grid; grid-template-columns: 1fr 230px; gap: .8rem; height: calc(100vh - var(--topbar-h) - 2.6rem); min-height: 420px; }
.chat-side { overflow-y: auto; padding: .7rem; }
.chat-side h3 { font-size: .78rem; text-transform: uppercase; color: var(--muted); margin: .8rem 0 .3rem; }
.chat-side h3:first-child { margin-top: 0; }
.room-link { display: flex; align-items: center; gap: .4rem; padding: .3rem .45rem; border-radius: 6px; color: var(--text); cursor: pointer; }
.room-link:hover { background: var(--surface-2); text-decoration: none; }
.room-link.active { background: var(--accent-soft); color: var(--accent); }
.online-user { display: flex; align-items: center; gap: .45rem; padding: .25rem .2rem; font-size: .9rem; }
.online-user::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.chat-main { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: .35rem .35rem 0; overflow-x: auto; flex: none; }
.tab { display: flex; align-items: center; gap: .35rem; padding: .35rem .55rem .35rem .8rem; border-radius: 8px 8px 0 0; cursor: pointer; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.tab.active { background: var(--surface); color: var(--text); font-weight: 600; }
.tab-add { border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); padding: .35rem .7rem; }
.tab-add:hover { background: var(--surface); color: var(--accent); }
.tab .close { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 .15rem; font-size: 1rem; line-height: 1; border-radius: 4px; }
.tab .close:hover { background: var(--border); }
.chatbox { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: .5rem .8rem; }
.msg { display: grid; grid-template-columns: 34px 1fr; gap: .55rem; padding: .3rem .3rem; border-radius: 6px; position: relative; }
.msg:hover { background: var(--surface-2); }
.msg.cont { padding-top: 0; }
.msg.cont .avatar, .msg.cont .msg-head { visibility: hidden; height: 0; }
.msg.mentioned { background: var(--mention); }
.msg-head { display: flex; gap: .5rem; align-items: baseline; font-size: .85rem; }
.msg-head b { font-size: .95rem; }
.msg-actions { position: absolute; right: .4rem; top: .1rem; display: none; gap: .1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.msg:hover .msg-actions { display: flex; }
.msg.deleted .md { color: var(--muted); font-style: italic; }
.typing { height: 1.3rem; padding: 0 .9rem; font-size: .8rem; color: var(--muted); flex: none; }
.composer { border-top: 1px solid var(--border); padding: .5rem; display: flex; gap: .4rem; align-items: flex-end; flex: none; }
.composer textarea { min-height: 2.5rem; max-height: 10rem; resize: none; }
.emoji-pop { position: absolute; bottom: 3.5rem; left: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .4rem; display: grid; grid-template-columns: repeat(8, 1.9rem); gap: .1rem; box-shadow: var(--shadow); z-index: 5; }
.emoji-pop button { font-size: 1.2rem; background: none; border: 0; cursor: pointer; border-radius: 4px; }
.emoji-pop button:hover { background: var(--surface-2); }
.load-more { text-align: center; padding: .3rem; }
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-main { height: 70vh; }
}

/* ---- Salle de jeux ---- */
.game-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.section-title { margin: 1.2rem 0 .6rem; }
.game-cards > .card { margin: 0; }
.game-card { text-align: center; cursor: pointer; transition: transform .1s; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .2rem; color: var(--text); }
.game-card:hover { text-decoration: none; border-color: var(--accent); }
.game-card h3 { margin: .2rem 0; }
.game-card:hover { transform: translateY(-2px); }
.game-card .icon { font-size: 2.4rem; }
.game-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.game-layout .side { display: flex; flex-direction: column; gap: 1rem; }
.shoutbox { height: 440px; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.shout-head { padding: .8rem 1rem .4rem; border-bottom: 1px solid var(--border); flex: none; }
.game-chat { height: 360px; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
@media (max-width: 960px) { .game-layout { grid-template-columns: 1fr; } }
.status-line { font-weight: 600; margin: .5rem 0; min-height: 1.5em; }

/* Échecs */
.chess-wrap { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.chess-board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(100%, 520px); aspect-ratio: 1; border: 3px solid var(--sq-dark); border-radius: 4px; user-select: none; }
.sq { position: relative; display: flex; align-items: center; justify-content: center; font-size: clamp(1.6rem, 5.5vw, 2.9rem); cursor: pointer; line-height: 1; }
.sq.light { background: var(--sq-light); } .sq.dark { background: var(--sq-dark); }
.sq.sel { box-shadow: inset 0 0 0 4px #3a7bd5; }
.sq.last { background-image: linear-gradient(rgba(255, 230, 60, .4), rgba(255, 230, 60, .4)); }
.sq.check { background-image: radial-gradient(circle, rgba(230, 30, 30, .85) 20%, transparent 75%); }
.sq.target::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(20, 20, 20, .28); }
.sq.target.capture::after { width: 88%; height: 88%; background: none; border: 5px solid rgba(20, 20, 20, .28); }
.sq .coord { position: absolute; font-size: .62rem; font-weight: 700; opacity: .7; color: #3b2a1a; }
.sq .coord.f { bottom: 1px; right: 3px; } .sq .coord.r { top: 1px; left: 3px; }
.piece.w { color: #fff; text-shadow: 0 0 2px #000, 0 0 1px #000, 0 1px 2px #000; }
.piece.b { color: #111; text-shadow: 0 0 2px rgba(255,255,255,.4); }
.chess-info { flex: 1; min-width: 220px; }
.clock { font: 700 1.4rem ui-monospace, monospace; padding: .2rem .6rem; border-radius: 6px; background: var(--surface-2); }
.clock.running { background: var(--accent); color: var(--accent-text); }
.player-bar { display: flex; justify-content: space-between; align-items: center; margin: .3rem 0; gap: .5rem; }
.move-list { max-height: 260px; overflow-y: auto; font-family: ui-monospace, monospace; font-size: .9rem; display: grid; grid-template-columns: 2.5em 1fr 1fr; gap: .1rem .4rem; }
.promo { display: flex; gap: .3rem; }
.promo button { font-size: 2rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }

/* Bataille navale */
.bs-wrap { display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center; }
.bs-grid-box { flex: 1 1 300px; max-width: 420px; }
.bs-grid-box h3 { text-align: center; }
.bs-grid { display: grid; grid-template-columns: 1.4rem repeat(10, 1fr); grid-auto-rows: auto; width: 100%; gap: 3px; user-select: none; }
.bs-grid .lbl { display: flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--muted); font-weight: 700; }
.cell { background: var(--sea); border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: .9rem; aspect-ratio: 1; }
.cell.ship { background: #7c8597; }
.cell.ship.sunk, .cell.sunk { background: #5a2a2a; }
.cell.hit::after { content: "✹"; color: #ff5a3c; font-size: 1.05rem; }
.cell.miss::after { content: "•"; color: var(--muted); font-size: 1.2rem; }
.cell.preview { background: #8fbf8f; } .cell.preview.bad { background: #d98585; }
.cell.last { outline: 2px solid var(--warn); }
.bs-grid.clickable .cell:not(.hit):not(.miss):hover { background: var(--sea-dark); cursor: crosshair; }
.fleet-list { display: flex; flex-direction: column; gap: .3rem; margin: .5rem 0; }
.fleet-item { padding: .3rem .5rem; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; }
.fleet-item.sel { border-color: var(--accent); background: var(--accent-soft); }
.fleet-item.placed { opacity: .5; }

/* Poker */
.poker-table { position: relative; width: 100%; max-width: 820px; aspect-ratio: 16 / 9.5; margin: 0 auto; }
.felt { position: absolute; inset: 14% 8%; border-radius: 999px; background: radial-gradient(ellipse at center, var(--felt) 55%, var(--felt-dark)); border: 10px solid #5a3a22; box-shadow: inset 0 0 30px rgba(0,0,0,.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: #fff; }
.board-cards { display: flex; gap: .3rem; min-height: 3.6rem; }
.pot { font-weight: 700; background: rgba(0,0,0,.3); padding: .1rem .7rem; border-radius: 99px; }
.seat { position: absolute; transform: translate(-50%, -50%); width: 128px; text-align: center; background: var(--surface); border: 2px solid var(--border); border-radius: 10px; padding: .3rem .3rem .4rem; font-size: .82rem; box-shadow: var(--shadow); }
.seat.to-act { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(226, 167, 58, .4); }
.seat.folded { opacity: .45; }
.seat.me { border-color: var(--accent); }
.seat.winner { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(60, 196, 136, .45); }
.seat .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .hole { display: flex; justify-content: center; gap: .2rem; margin: .2rem 0; min-height: 2.6rem; }
.seat .bet { position: absolute; left: 50%; transform: translateX(-50%); background: #f2c94c; color: #222; border-radius: 99px; padding: 0 .5rem; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.dealer-btn { display: inline-block; width: 1.3em; height: 1.3em; border-radius: 50%; background: #fff; color: #000; border: 1px solid #999; font-weight: 800; font-size: .7rem; line-height: 1.2em; }
.pcard { width: 2.5rem; height: 3.5rem; border-radius: 5px; background: #fff; color: #111; border: 1px solid #bbb; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; line-height: 1; font-size: 1.05rem; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pcard.red { color: #c8102e; }
.pcard.back { background: repeating-linear-gradient(45deg, #3346a8, #3346a8 4px, #2a3a8c 4px, #2a3a8c 8px); border-color: #223; }
.seat .pcard { width: 1.8rem; height: 2.5rem; font-size: .8rem; }
.pcard.hl { outline: 3px solid var(--ok); }
.poker-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; margin-top: .8rem; min-height: 2.6rem; }
.poker-actions input[type=range] { width: 160px; }
.poker-actions input[type=number] { width: 90px; }
.poker-log { max-height: 220px; overflow-y: auto; font-size: .82rem; }
.poker-log div { padding: .1rem 0; border-bottom: 1px dashed var(--border); }
@media (max-width: 640px) {
  .seat { width: 92px; font-size: .72rem; }
  .pcard { width: 1.9rem; height: 2.7rem; font-size: .85rem; }
  .seat .pcard { width: 1.4rem; height: 2rem; font-size: .66rem; }
  .poker-table { aspect-ratio: 4 / 4.2; }
  .felt { inset: 16% 4%; }
}

/* ---- Profil ---- */
.profile-head { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.stat { background: var(--surface-2); border-radius: 8px; padding: .6rem; text-align: center; }
.stat b { display: block; font-size: 1.3rem; }

/* ---- Casino ---- */
.casino-card h1 { text-align: center; }
.btn.big { font-size: 1.1rem; padding: .65rem 1.6rem; }
.casino-card > .btn.big { display: flex; margin: 1rem auto 0; min-width: 220px; }
.bet-picker { justify-content: center; margin-top: 1rem; }
.chip { border: 2px dashed color-mix(in srgb, var(--warn) 70%, transparent); background: var(--surface-2); color: var(--text); width: 3.3rem; height: 3.3rem;
  border-radius: 50%; font-weight: 800; cursor: pointer; font-family: inherit; font-size: .85rem; }
.chip.on { background: var(--warn); color: #222; border-style: solid; }
.slot-machine { background: linear-gradient(180deg, #7a1f2b, #4a1018); border: 6px solid #c99a2e; border-radius: 22px; padding: 1.2rem; box-shadow: inset 0 0 24px rgba(0,0,0,.5); }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.reel { background: #fffdf6; border-radius: 12px; aspect-ratio: 1 / 1.1; display: flex; align-items: center; justify-content: center;
  font-size: clamp(2.4rem, 9vw, 4.4rem); box-shadow: inset 0 6px 12px rgba(0,0,0,.35), inset 0 -6px 12px rgba(0,0,0,.25); }
.reel.spinning { filter: blur(1.5px); }
.slot-result { margin-top: 1rem; text-align: center; color: #fff6d8; font-weight: 700; min-height: 1.6em; font-size: 1.05rem; }
.slot-result.win { color: #8ff0b6; } .slot-result.lose { color: #ffb3b3; } .slot-result.push { color: #ffe9a8; }
.slot-result.jackpot { animation: jackpot .4s ease-in-out 6 alternate; }
@keyframes jackpot { from { transform: scale(1); } to { transform: scale(1.12); color: #ffd84d; } }
.slot-history div { display: flex; justify-content: space-between; padding: .2rem 0; border-bottom: 1px dashed var(--border); font-size: 1.05rem; }
.paysym { font-size: 1.25rem; letter-spacing: .1em; }
.bj-table { background: radial-gradient(ellipse at center, var(--felt) 55%, var(--felt-dark)); border: 8px solid #5a3a22; border-radius: 24px;
  padding: 1.2rem; color: #fff; display: flex; flex-direction: column; gap: 1rem; min-height: 340px; justify-content: space-between; }
.bj-label { font-weight: 700; text-align: center; margin-bottom: .4rem; opacity: .9; }
.bj-cards { display: flex; justify-content: center; gap: .4rem; min-height: 3.6rem; }
.bj-cards .pcard { width: 3rem; height: 4.2rem; font-size: 1.2rem; }
.bj-msg { text-align: center; font-weight: 700; background: rgba(0,0,0,.25); border-radius: 99px; padding: .35rem 1rem; align-self: center; }
.bj-msg.win { background: rgba(31, 157, 99, .75); } .bj-msg.lose { background: rgba(208, 56, 75, .75); } .bj-msg.push { background: rgba(201, 138, 18, .75); }

/* ---- Salon vocal ---- */
.voice-panel { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .5rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--surface-2); flex: none; }
.voice-panel.in { background: color-mix(in srgb, var(--ok) 14%, var(--surface-2)); }
.vtitle { font-weight: 700; white-space: nowrap; }
.vmembers { display: flex; gap: .35rem; flex-wrap: wrap; flex: 1; min-width: 0; }
.vmember { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem .15rem .2rem; border-radius: 99px; background: var(--surface);
  font-size: .82rem; border: 2px solid transparent; transition: border-color .1s; }
.vmember.speaking { border-color: var(--ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 35%, transparent); }
.vmuted { font-size: .75rem; }
.vcontrols { display: flex; gap: .3rem; }
.voice-bar { position: fixed; right: 16px; bottom: 16px; z-index: 45; display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem .4rem .8rem;
  background: var(--surface); border: 1px solid var(--ok); border-radius: 99px; box-shadow: var(--shadow); }
.vdot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: vpulse 1.6s infinite; }
@keyframes vpulse { 50% { opacity: .35; } }
.toasts { bottom: 70px; }
@media (max-width: 700px) { .voice-bar { bottom: 72px; right: 8px; } }
