/* DuckPoint — thème sombre « mare de nuit » */
:root {
  --bg: #0b0f15;
  --bg-2: #0f141c;
  --surface: #141a23;
  --surface-2: #1a222d;
  --surface-3: #222c39;
  --border: #263140;
  --border-2: #314054;
  --text: #e9eef4;
  --muted: #8d9aab;
  --duck: #ffd233;
  --duck-2: #f4b400;
  --beak: #ff8a1f;
  --pond: #2bb3a3;
  --pond-2: #3bc9db;
  --danger: #ff6464;
  --ok: #4fd18b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(43, 179, 163, .08), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(255, 210, 51, .05), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: var(--pond-2); }
:focus-visible { outline: 2px solid var(--duck); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.ic { width: 20px; height: 20px; flex: none; display: block; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); letter-spacing: -.01em; }

#root { height: 100%; }
.boot { height: 100%; display: grid; place-items: center; }
.boot img { animation: bob 1.4s ease-in-out infinite; }

@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(6px); } }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--border-2);
  background: var(--surface-2); font-weight: 600; transition: background .15s, transform .1s, border-color .15s;
}
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--duck); border-color: var(--duck); color: #1b1600; }
.btn.primary:hover:not(:disabled) { background: #ffdc5c; }
.btn.danger { color: var(--danger); border-color: rgba(255, 100, 100, .35); background: rgba(255, 100, 100, .07); }
.btn.wide { width: 100%; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn .ic { width: 17px; height: 17px; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--muted); transition: background .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn.tiny { width: 26px; height: 26px; border-radius: 8px; }
.icon-btn.tiny .ic { width: 15px; height: 15px; }
.icon-btn .badge {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--beak); color: #1b0d00; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface);
}
.trophy-btn { color: var(--duck); background: rgba(255, 210, 51, .08); border-color: rgba(255, 210, 51, .18); }
.trophy-btn:hover:not(:disabled) { color: var(--duck); background: rgba(255, 210, 51, .16); }

.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border-2);
  background: var(--bg-2); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--duck); box-shadow: 0 0 0 3px rgba(255, 210, 51, .15); }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; }
.tabs button { flex: 1; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset; }
.tabs.small button { padding: 5px 8px; font-size: 12.5px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

.avatar {
  position: relative; flex: none; display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 50%; background: var(--surface-3); color: #fff; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-letter { font-weight: 800; font-size: .95em; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }

.lvl-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800;
  background: rgba(255, 210, 51, .14); color: var(--duck); white-space: nowrap;
}
.xp-bar { display: block; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.xp-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--duck-2), var(--duck)); transition: width .6s ease; }
.xp-bar.big { height: 9px; border-radius: 5px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(79, 209, 139, .18); }

/* ---------- Connexion ---------- */
.auth { height: 100%; display: grid; place-items: center; padding: 16px; overflow: auto; }
.auth-card { width: min(400px, 100%); padding: 32px 28px; text-align: center; box-shadow: var(--shadow); animation: pop-in .35s ease; }
.auth-logo { width: 112px; height: 112px; margin: -8px auto 4px; }
.auth-logo svg { animation: bob 3s ease-in-out infinite; }
.auth-form { display: grid; gap: 14px; margin-top: 22px; text-align: left; }
.form-error { min-height: 1em; margin: 0; color: var(--danger); font-size: 13px; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.02em; }
.brand-name b { color: var(--duck); font-weight: 800; }
.brand-name.big { font-size: 34px; margin-bottom: 4px; }

/* ---------- Disposition principale ---------- */
.app {
  height: 100dvh; display: grid; gap: 12px; padding: 12px;
  grid-template-columns: minmax(0, 3fr) minmax(330px, 2fr);
  grid-template-areas: "chat side";
}
.chat { grid-area: chat; }
.side { grid-area: side; }
.game-area { grid-area: game; display: none; min-width: 0; min-height: 0; }

.app.in-game { grid-template-columns: minmax(0, 1fr); grid-template-areas: "game"; }
.app.in-game.chat-open { grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 400px); grid-template-areas: "game chat"; }
.app.in-game .side { display: none; }
.app.in-game .game-area { display: flex; }
.app.in-game:not(.chat-open) .chat { display: none; }
.chat-close, .chat-toggle { display: none; }
.app.in-game .chat-close, .app.in-game .chat-toggle { display: inline-grid; }

/* ---------- Panneau de droite ---------- */
.side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-duck { width: 42px; height: 42px; }
.brand-duck svg { width: 100%; height: 100%; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.me-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); text-align: right; transition: border-color .15s, background .15s;
}
.me-chip:hover { border-color: var(--border-2); background: var(--surface-3); }
.me-text { display: grid; gap: 1px; line-height: 1.2; }
.me-text b { font-size: 14px; }
.me-text .xp-bar { margin-top: 3px; }

.games { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 18px 16px 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px 12px; }
.section-head h2 { font-size: 19px; }
.game-list { display: grid; gap: 10px; overflow: auto; align-content: start; padding: 2px; }
.game-card {
  display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 14px; text-align: left;
  padding: 12px 14px 12px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2);
  transition: transform .15s, border-color .15s, background .15s;
}
button.game-card:hover { transform: translateY(-2px); border-color: rgba(255, 210, 51, .45); background: var(--surface-3); }
.game-card h3 { font-size: 16px; margin-bottom: 2px; }
.game-card p { margin: 0 0 6px; }
.game-meta { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.game-meta .dot { width: 7px; height: 7px; }
.play-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--duck); color: #1b1600; }
.play-btn .ic { width: 18px; height: 18px; fill: currentColor; margin-left: 2px; }
.game-card.soon { opacity: .55; }
.lock { color: var(--muted); padding: 0 8px; }
.game-preview { height: 76px; border-radius: 10px; position: relative; overflow: hidden; }
.sol-preview { background: radial-gradient(circle at 50% 30%, #17675f, #0c3a3d); }
.mini-card {
  position: absolute; width: 38px; height: 53px; top: 12px; left: 29px; border-radius: 4px;
  background-size: 100% 100%; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .3s;
}
.mini-card.c0 { transform: rotate(-16deg) translate(-16px, 4px); }
.mini-card.c2 { transform: rotate(16deg) translate(16px, 4px); }
.game-card:hover .mini-card.c0 { transform: rotate(-24deg) translate(-22px, 2px); }
.game-card:hover .mini-card.c2 { transform: rotate(24deg) translate(22px, 2px); }
.soon-preview { display: grid; place-items: center; font-size: 34px; background: var(--surface-3); }

/* ---------- Chat ---------- */
.chat { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; container-type: inline-size; }
@container (max-width: 440px) { .oc-label { display: none; } .avatar-stack .avatar:nth-child(n+3) { display: none; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); }
.chat-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.chat-title > div { min-width: 0; }
.chat-title h2 { font-size: 18px; }
.chat-title p { margin: 0; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.chat-title p span { overflow: hidden; text-overflow: ellipsis; }
.chat-title p .ic { width: 13px; height: 13px; }
.chat-logo { width: 38px; height: 38px; flex: none; }
.online {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.online:hover { background: var(--surface-3); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface-2); font-size: 12px; }
.avatar-stack .avatar + .avatar { margin-left: -9px; }
.online-count { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.online-count .dot { width: 7px; height: 7px; }

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px 6px 6px; scroll-behavior: auto; overscroll-behavior: contain; }
.chat-empty { height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; padding: 20px; gap: 2px; }
.chat-empty p { margin: 0; max-width: 300px; }
.chat-empty-duck { width: 110px; height: 110px; opacity: .9; animation: bob 3.2s ease-in-out infinite; }
.chat-list { display: flex; flex-direction: column; }

.msg {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; gap: 0 12px;
  padding: 6px 10px; margin-top: 8px; border-radius: 12px; animation: fade-up .22s ease;
  transition: opacity .35s, transform .35s, max-height .35s;
}
.msg:hover { background: rgba(255, 255, 255, .025); }
.msg.cont { margin-top: 0; padding-top: 2px; }
.msg.cont > .avatar { visibility: hidden; height: 0; }
.msg.cont .msg-meta { display: none; }
.msg.mentioned { background: rgba(255, 210, 51, .07); box-shadow: inset 3px 0 0 var(--duck); }
.msg.leaving { opacity: 0; transform: translateX(-16px) scale(.98); pointer-events: none; }
.msg-body { min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; line-height: 1.3; margin-bottom: 2px; }
.msg-user { font-size: 14.5px; }
.msg.mine .msg-user { color: var(--duck); }
.msg-meta .lvl { font-size: 11px; font-weight: 700; color: var(--pond-2); background: rgba(59, 201, 219, .1); padding: 0 6px; border-radius: 999px; }
.msg-meta time { font-size: 11.5px; color: var(--muted); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-text.big { font-size: 34px; line-height: 1.25; }
.mention { color: var(--pond-2); background: rgba(59, 201, 219, .12); padding: 0 4px; border-radius: 6px; font-weight: 600; }
.mention.me { color: #1b1600; background: var(--duck); }
.msg-gif, .msg-media img, video.msg-media {
  display: block; margin-top: 6px; max-width: min(320px, 100%); height: auto; max-height: 280px;
  border-radius: 12px; background: var(--surface-2); object-fit: contain;
}
.msg-media { display: inline-block; }
.msg audio { margin-top: 6px; max-width: 100%; }
.file-chip {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; padding: 10px 12px; max-width: 100%;
  border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); text-decoration: none;
}
.file-chip:hover { border-color: var(--pond); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; font-weight: 600; }
.msg-tools { position: relative; display: flex; justify-content: flex-end; align-items: flex-start; }
.msg-actions {
  position: absolute; top: -12px; right: 40px; z-index: 2; display: flex; gap: 2px; padding: 2px;
  border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .12s;
}
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; pointer-events: auto; }
.msg.cont .msg-actions { top: -16px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reaction {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface-2); font-size: 13px; transition: background .12s, border-color .12s, transform .1s;
  animation: pop-in .18s ease;
}
.reaction:hover { background: var(--surface-3); }
.reaction:active { transform: scale(.94); }
.reaction.mine { border-color: rgba(255, 210, 51, .6); background: rgba(255, 210, 51, .12); }
.reaction-emoji { font-size: 15px; line-height: 1; }
.reaction-count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.reaction.mine .reaction-count { color: var(--duck); }
.react-bar { position: absolute; top: -48px; right: 40px; z-index: 6; display: flex; gap: 2px; padding: 4px; }
.react-bar .emoji { width: 36px; height: 36px; font-size: 21px; }
.react-bar .more { display: grid; place-items: center; color: var(--muted); }
.react-bar .more .ic { width: 18px; height: 18px; }
.chat-list > .msg:first-child .react-bar { top: 30px; }
.ttl { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.msg.cont .ttl { margin-top: 3px; }
.ttl svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ttl circle {
  fill: none; stroke: var(--pond); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0;
  animation: ttl var(--dur) linear var(--delay) forwards;
}
@keyframes ttl {
  70% { stroke: var(--duck); }
  90% { stroke: var(--beak); }
  to { stroke-dashoffset: 100; stroke: var(--danger); }
}

.new-pill {
  position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  border: 0; background: var(--duck); color: #1b1600; font-weight: 700; font-size: 13px; box-shadow: var(--shadow);
  animation: fade-up .2s;
}
.new-pill .ic { width: 15px; height: 15px; }
.typing { display: flex; align-items: center; gap: 8px; min-height: 26px; padding: 0 18px; font-size: 12.5px; color: var(--muted); }
.typing:not(:empty) { animation: fade-up .2s ease; }
.typing .avatar-stack .avatar { font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
.typing-bubble { display: inline-flex; gap: 3px; padding: 6px 8px; border-radius: 10px; background: var(--surface-3); }
.typing-bubble i { width: 6px; height: 6px; border-radius: 50%; background: var(--duck); animation: typing 1.2s infinite ease-in-out; }
.typing-bubble i:nth-child(2) { animation-delay: .15s; }
.typing-bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.composer { position: relative; padding: 0 12px 12px; }
.composer-row {
  display: flex; align-items: flex-end; gap: 2px; padding: 6px; border-radius: 16px;
  border: 1px solid var(--border-2); background: var(--bg-2); transition: border-color .15s, box-shadow .15s;
}
.composer-row:focus-within { border-color: rgba(255, 210, 51, .6); box-shadow: 0 0 0 3px rgba(255, 210, 51, .1); }
.composer-input {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; color: var(--text);
  font: inherit; padding: 9px 8px; max-height: 160px; line-height: 1.4;
}
.composer-row .icon-btn { width: 38px; height: 38px; }
.gif-btn { font-size: 11px; font-weight: 900; letter-spacing: .04em; }
.send-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px;
  background: var(--duck); color: #1b1600; transition: transform .1s, background .15s;
}
.send-btn:hover:not(:disabled) { background: #ffdc5c; }
.send-btn:active { transform: scale(.94); }
.send-btn .ic { width: 18px; height: 18px; }

.attach-preview { padding-bottom: 8px; }
.attach-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-2); animation: fade-up .2s;
}
.attach-chip img, .thumb-ic { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface-3); }
.attach-info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.progress { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--pond); transition: width .2s; }
.progress.done > span { width: 100% !important; background: var(--ok); }

.drop-hint {
  position: absolute; inset: 8px; z-index: 20; display: none; place-items: center; align-content: center; gap: 10px;
  border: 2px dashed var(--duck); border-radius: 14px; background: rgba(11, 15, 21, .85); color: var(--duck); font-weight: 700;
}
.drop-hint .ic { width: 34px; height: 34px; }
.chat.dropping .drop-hint { display: grid; }

/* Popovers du chat */
.pop-host { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); z-index: 30; pointer-events: none; }
.pop-host > * { pointer-events: auto; }
.popover {
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: var(--shadow); animation: pop-in .16s ease;
}
.emoji-picker { width: min(360px, 100%); }
.picker-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.picker-tabs button { border: 0; background: transparent; font-size: 18px; padding: 4px 8px; border-radius: 8px; opacity: .6; }
.picker-tabs button.active { opacity: 1; background: var(--surface-3); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); padding: 6px; height: 230px; overflow-y: auto; }
.emoji { border: 0; background: transparent; font-size: 23px; height: 40px; border-radius: 8px; transition: transform .1s, background .1s; }
.emoji:hover { background: var(--surface-3); transform: scale(1.15); }
.gif-picker { width: min(420px, 100%); padding: 10px; }
.gif-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--bg-2); color: var(--muted); }
.gif-search .input { border: 0; background: transparent; padding: 9px 0; box-shadow: none; }
.gif-grid { columns: 3 110px; column-gap: 6px; height: 280px; overflow-y: auto; margin-top: 8px; }
.gif { display: block; width: 100%; padding: 0; margin: 0 0 6px; border: 0; background: var(--surface-3); border-radius: 8px; overflow: hidden; break-inside: avoid; }
.gif img { display: block; width: 100%; height: auto; transition: transform .2s; }
.gif:hover img { transform: scale(1.05); }
.gif-credit { margin: 6px 0 0; text-align: right; }
.gif-picker > p.muted:not(.gif-credit) { margin: 10px 4px 0; }

.mention-box { position: absolute; left: 12px; bottom: calc(100% + 2px); width: min(280px, calc(100% - 24px)); padding: 6px; z-index: 31; }
.mention-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.mention-item.active, .mention-item:hover { background: var(--surface-3); }
.mention-item .small { margin-left: auto; }

.head-pop { position: absolute; top: 64px; right: 12px; z-index: 30; }
.online-list { width: 260px; padding: 12px; max-height: 360px; overflow: auto; }
.online-list h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.online-item { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }

/* ---------- Zone de jeu ---------- */
.game-area > * { flex: 1; min-width: 0; }
.sol { display: flex; flex-direction: column; gap: 10px; min-height: 0; height: 100%; container-type: inline-size; }
@container (max-width: 1180px) {
  .tool-btn .lbl, .mode-chip { display: none; }
  .tool-btn { padding: 0 11px; }
  .tool-btn.primary .lbl { display: inline; }
}
@container (max-width: 980px) {
  .tool-btn.primary .lbl, .lvl-mini, .game-title b { display: none; }
  .sol-stats > div { min-width: 0; padding: 2px 9px; }
}
.game-bar {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; flex-wrap: nowrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); z-index: 40;
}
.game-title { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 17px; }
.game-title > span:first-child { width: 30px; height: 30px; display: block; }
.game-title svg { width: 100%; height: 100%; }
.mode-chip { font-size: 11.5px; font-weight: 700; color: var(--pond-2); background: rgba(59, 201, 219, .1); padding: 2px 8px; border-radius: 999px; font-family: var(--font); }
.sol-stats { display: flex; gap: 4px; margin-left: 6px; }
.sol-stats > div { display: grid; padding: 2px 12px; border-left: 1px solid var(--border); line-height: 1.15; min-width: 64px; }
.sol-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sol-stats b { font-variant-numeric: tabular-nums; font-size: 16px; }
.sol-tools { display: flex; gap: 6px; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 11px;
  border: 1px solid var(--border-2); background: var(--surface-2); font-weight: 600; font-size: 13.5px; transition: background .15s, border-color .15s;
}
.tool-btn:hover:not(:disabled) { background: var(--surface-3); }
.tool-btn .ic { width: 17px; height: 17px; }
.tool-btn.primary { background: var(--duck); border-color: var(--duck); color: #1b1600; }
.tool-btn.primary:hover:not(:disabled) { background: #ffdc5c; }
.tool-btn.accent { border-color: var(--pond); color: var(--pond-2); animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(43, 179, 163, .18); } }
.bar-spacer { flex: 1; }
.lvl-mini { display: grid; gap: 4px; justify-items: end; }
.lvl-mini .xp-bar { width: 70px; }
.game-bar .me-chip .me-text { display: none; }
.game-bar .me-chip { padding: 2px; }
.menu-host { position: absolute; inset: 0; pointer-events: none; }
.menu { position: absolute; width: 250px; padding: 6px; pointer-events: auto; z-index: 50; }
.menu button { display: grid; gap: 1px; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; }
.menu button:has(.ic) { display: flex; align-items: center; gap: 8px; }
.menu button:hover { background: var(--surface-3); }
.menu button.active { color: var(--duck); background: rgba(255, 210, 51, .08); }
.menu button.active::after { content: "✓"; position: absolute; right: 18px; }
.menu-label { margin: 6px 10px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.menu-hint { margin: 4px 10px 6px; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }

.sol-felt {
  flex: 1; min-height: 0; padding: 10px; border-radius: var(--radius); border: 1px solid #12463f;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(59, 201, 219, .14), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, .35), transparent 60%),
    linear-gradient(160deg, #0f4a44, #0a3132 60%, #082628);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .35);
}
.sol-board { position: relative; isolation: isolate; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; }
.slot, .card { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .075); }
.slot {
  display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .12);
  color: rgba(255, 255, 255, .16); font-weight: 800; font-size: calc(var(--cw) * .32); font-family: var(--display);
}
.slot-w { border-style: none; background: transparent; }
.slot-s { cursor: pointer; }
.slot-s .ic { width: calc(var(--cw) * .38); height: calc(var(--cw) * .38); stroke-width: 2.4; }
.slot-s.dead { cursor: default; opacity: .4; }
.slot-f { border-color: rgba(255, 210, 51, .18); color: rgba(255, 210, 51, .2); }

.card { will-change: transform; transition: transform .2s cubic-bezier(.2, .8, .3, 1); cursor: grab; }
.card .card-inner { position: relative; width: 100%; height: 100%; transition: transform .26s ease; transform-style: preserve-3d; transform: rotateY(180deg); border-radius: inherit; }
.card.up .card-inner { transform: rotateY(0); }
.card-face, .card-back {
  position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background-size: 100% 100%; box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .15);
}
.card-back { background-image: var(--card-back); transform: rotateY(180deg); }
.card:not(.up) { cursor: default; }
.card.dragging { transition: none; cursor: grabbing; }
.card.dragging .card-face { box-shadow: 0 14px 28px rgba(0, 0, 0, .45); }
.card.hint .card-face, .card.hint .card-back, .slot.hint { box-shadow: 0 0 0 3px var(--duck), 0 0 22px rgba(255, 210, 51, .6); }
.slot.hint { border-color: var(--duck); }
.card.shake .card-inner { animation: shake .32s; }
@keyframes shake { 25% { translate: -5px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }
.sol-board.no-anim .card, .sol-board.no-anim .card-inner { transition: none !important; }
.win-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5000; pointer-events: none; }

.win-box { display: grid; justify-items: center; gap: 14px; text-align: center; }
.win-duck { width: 130px; height: 130px; margin-top: -10px; animation: bob 2.4s ease-in-out infinite; }
.win-sub { margin: -6px 0 0; color: var(--muted); }
.win-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.win-stats > div, .stat { display: grid; gap: 2px; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.win-stats span, .stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.win-stats b, .stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.win-stats .xp b { color: var(--duck); }
.level-up { margin: 0; padding: 8px 14px; border-radius: 12px; background: rgba(255, 210, 51, .1); color: var(--duck); font-weight: 700; }
.xp-line { display: flex; align-items: center; gap: 10px; width: 100%; }
.xp-line .xp-bar { flex: 1; }
.row-actions { display: flex; gap: 10px; justify-content: center; width: 100%; }
.row-actions .btn { flex: 1; }

/* ---------- Limite Canard ---------- */
.lim { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 0; }
.lim-body { flex: 1; min-height: 0; overflow: auto; }
.lim-card {
  position: relative; display: block; border-radius: 14px; padding: 14px 14px 34px; text-align: left;
  font: 700 15px/1.32 var(--display); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); overflow-wrap: anywhere;
}
.lim-card.black { background: #101114; color: #f5f5f5; border: 1px solid #2c2e35; }
.lim-card.white { background: #fffbf0; color: #1b1f2a; border: 1px solid #e3dccb; }
.lim-card.small { width: 130px; height: 178px; font-size: 13px; }
.lim-card.big { width: min(100%, 440px); min-height: 190px; font-size: clamp(18px, 2.1vw, 24px); padding: 22px 22px 46px; }
.lim-card .blank { display: inline-block; width: 3.6em; height: .95em; border-bottom: 3px solid currentColor; margin: 0 3px; vertical-align: baseline; }
.lim-card mark { background: var(--duck); color: #1b1600; padding: 0 5px; border-radius: 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lim-card strong { color: #c2410c; }
.lim-card-brand { position: absolute; left: 14px; bottom: 10px; display: flex; align-items: center; gap: 6px; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .55; }
.lim-card-brand svg { width: 16px; height: 16px; }
.lim-pick { position: absolute; right: 14px; bottom: 10px; font-size: 11px; background: #fff; color: #111; border-radius: 999px; padding: 1px 9px; }
button.lim-card { cursor: default; }

.lim-lobby { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.lim-hero { padding: 26px; display: grid; gap: 22px; background: radial-gradient(600px 300px at 20% 0%, rgba(124, 140, 255, .1), transparent 70%), var(--surface); }
.lim-hero-cards { display: flex; justify-content: center; padding: 4px 0 20px; }
.lim-hero-cards .lim-card:nth-child(1) { transform: rotate(-7deg); z-index: 1; }
.lim-hero-cards .lim-card:nth-child(2) { margin-left: -36px; transform: rotate(2deg) translateY(10px); z-index: 2; }
.lim-hero-cards .lim-card:nth-child(3) { margin-left: -36px; transform: rotate(10deg) translateY(22px); z-index: 3; }
.lim-hero-text { display: grid; gap: 10px; }
.lim-hero-text h2 { font-size: 24px; }
.lim-hero-text p { margin: 0; }
.lim-create, .lim-host-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lim-host-controls { justify-content: center; }
.lim-targets { flex: none; }
.lim-tables { padding: 18px; display: grid; gap: 8px; }
.lim-tables h3 { font-size: 17px; margin-bottom: 4px; }
.lim-table-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.lim-table-info { flex: 1; min-width: 0; display: grid; }
.lim-status { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.lim-status.lobby { color: var(--ok); background: rgba(79, 209, 139, .12); }
.lim-status.playing { color: var(--duck); background: rgba(255, 210, 51, .12); }
.lim-status.ended { color: var(--muted); background: var(--surface-3); }
.lim-empty { display: grid; justify-items: center; text-align: center; padding: 22px; gap: 6px; }
.lim-empty-duck { width: 78px; height: 78px; }

.lim-table { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 10px; height: 100%; min-height: 0; }
.lim-players { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 14px; }
.lim-players-head h3 { font-size: 16px; }
.lim-player-list { flex: 1; overflow: auto; display: grid; gap: 4px; align-content: start; }
.lim-player { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.lim-player.me { background: rgba(255, 210, 51, .07); }
.lim-player.off { opacity: .5; }
.lim-player-name { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lim-player-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lim-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.lim-badge { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.lim-badge.judge { background: rgba(124, 140, 255, .16); color: #b4bcff; }
.lim-badge.ok { background: rgba(79, 209, 139, .12); color: var(--ok); }
.lim-badge.host { background: none; padding: 0; }
.lim-score { min-width: 26px; text-align: right; font-size: 21px; font-weight: 800; color: var(--duck); font-variant-numeric: tabular-nums; }
.lim-players-foot { display: grid; gap: 6px; }

.lim-stage {
  min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 10px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: radial-gradient(900px 400px at 50% -10%, rgba(124, 140, 255, .12), transparent 70%), var(--surface);
}
.lim-round { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 10px; padding: 12px 16px 0; }
.lim-timer { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.lim-timer span { display: block; height: 100%; width: 100%; background: var(--pond); transition: width .25s linear, background .3s; }
.lim-timer.urgent span { background: var(--beak); }
.lim-msg { margin: 0; padding: 0 16px; color: var(--muted); text-align: center; }
.lim-msg.win { color: var(--duck); font-weight: 800; font-size: 17px; }
.lim-subs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; padding: 0 12px; }
.lim-card.sub { width: 240px; min-height: 150px; font-size: 15px; }
.lim-card.sub:disabled { opacity: 1; }
.lim-card.sub.pickable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.lim-card.sub.pickable:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 0 0 3px var(--duck), 0 10px 24px rgba(0, 0, 0, .4); }
.lim-card.sub.winner { transform: scale(1.04); box-shadow: 0 0 0 4px var(--duck), 0 0 34px rgba(255, 210, 51, .45); animation: pop-in .3s ease; }
.lim-owner { position: absolute; left: 12px; bottom: 8px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: #4a4f5c; }
.lim-hand-wrap { width: 100%; margin-top: auto; padding: 4px 14px 0; }
.lim-hand-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lim-hand-head b { flex: 1; }
.lim-hand { display: flex; gap: 10px; overflow-x: auto; padding: 14px 4px 10px; }
.lim-card.hand { flex: none; width: 148px; height: 190px; font-size: 14px; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; }
.lim-card.hand:hover:not(:disabled) { transform: translateY(-6px); }
.lim-card.hand.selected { transform: translateY(-10px); box-shadow: 0 0 0 3px var(--duck), 0 12px 22px rgba(0, 0, 0, .45); }
.lim-card.hand:disabled { cursor: default; opacity: .55; }
.lim-order { position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--duck); color: #1b1600; font-weight: 800; }
.lim-waiting, .lim-podium { width: 100%; display: grid; justify-items: center; gap: 14px; padding: 34px 16px; text-align: center; }
.lim-waiting p, .lim-podium p { margin: 0; }
.lim-results { width: min(460px, 100%); display: grid; gap: 6px; }
.lim-result { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.lim-result.won { border-color: var(--duck); background: rgba(255, 210, 51, .08); }
.lim-result-name { flex: 1; text-align: left; }
.lim-xp { min-width: 70px; text-align: right; font-weight: 800; color: var(--duck); }

.lim-preview { background: radial-gradient(circle at 50% 30%, #3a3170, #17142b); }
.mini-card.lim { padding: 4px; font: 800 5.6px/1.25 var(--display); overflow: hidden; background: #101114; color: #fff; border: 1px solid #333; }
.mini-card.lim.white { background: #fffbf0; color: #1b1f2a; border-color: #e3dccb; }

/* ---------- Coin-Coin ---------- */
.uno-card { display: block; width: 78px; height: 117px; border-radius: 9px; background-size: 100% 100%; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); flex: none; }
.uno-card.big { width: 104px; height: 156px; border-radius: 11px; }
.uno-card.hero { width: 96px; height: 144px; }
.uno-card.fresh { animation: uno-drop .32s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes uno-drop { from { transform: translateY(-30px) rotate(-12deg) scale(1.1); opacity: .4; } }
.uno-hero-cards { display: flex; justify-content: center; padding: 6px 0 18px; }
.uno-hero-cards .uno-card:nth-child(1) { transform: rotate(-12deg) translateY(8px); }
.uno-hero-cards .uno-card:nth-child(2) { margin-left: -30px; z-index: 1; }
.uno-hero-cards .uno-card:nth-child(3) { margin-left: -30px; transform: rotate(12deg) translateY(8px); z-index: 2; }

.uno-felt {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 14px 14px;
  border-radius: var(--radius); border: 1px solid #13475a;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(59, 201, 219, .16), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, .35), transparent 60%),
    linear-gradient(160deg, #0f4152, #0a2c38 60%, #08222b);
}
.uno-head { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.uno-seats { width: 100%; display: flex; justify-content: center; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; }
.uno-seats.wrap { flex-wrap: wrap; }
.uno-seat {
  position: relative; flex: none; display: grid; gap: 6px; min-width: 150px; padding: 10px 12px; border-radius: 14px;
  background: rgba(10, 20, 28, .55); border: 1px solid rgba(255, 255, 255, .08); transition: box-shadow .2s, border-color .2s;
}
.uno-seat.turn { border-color: var(--duck); box-shadow: 0 0 0 3px rgba(255, 210, 51, .25), 0 0 24px rgba(255, 210, 51, .25); }
.uno-seat.off { opacity: .55; }
.uno-seat.me { border-color: rgba(59, 201, 219, .4); }
.uno-seat-top { display: flex; align-items: center; gap: 9px; }
.uno-seat-info { display: grid; line-height: 1.25; flex: 1; min-width: 0; }
.uno-seat-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uno-mini-hand { display: flex; align-items: center; height: 26px; }
.uno-mini { width: 17px; height: 26px; border-radius: 3px; background: #1b1f2a; border: 1.5px solid #fff; box-shadow: inset 0 0 0 3px #e5484d; }
.uno-mini + .uno-mini { margin-left: -9px; }
.coin-bubble {
  position: absolute; top: -10px; right: -6px; padding: 2px 9px; border-radius: 999px; background: var(--duck); color: #1b1600;
  font-weight: 900; font-size: 12px; transform: rotate(6deg); box-shadow: var(--shadow); animation: pop-in .25s;
}
.btn.catch { background: var(--danger); border-color: var(--danger); color: #fff; animation: glow-red 1s infinite; }
@keyframes glow-red { 50% { box-shadow: 0 0 0 5px rgba(255, 100, 100, .25); } }

.uno-center { display: flex; align-items: center; justify-content: center; gap: 26px; padding: 6px 0; }
.uno-pile { position: relative; padding: 0; border: 0; background: none; border-radius: 12px; transition: transform .15s; }
.uno-pile:disabled { opacity: 1; }
.uno-pile.ready { cursor: pointer; }
.uno-pile.ready:hover { transform: translateY(-4px) rotate(-2deg); }
.uno-pile.ready .uno-card { box-shadow: 0 0 0 3px var(--duck), 0 8px 20px rgba(0, 0, 0, .45); }
.uno-pile-count { position: absolute; bottom: -8px; right: -8px; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.uno-discard { border-radius: 14px; padding: 6px; box-shadow: 0 0 0 4px var(--uno-color), 0 0 40px var(--uno-color); transition: box-shadow .3s; }
.uno-info { display: grid; justify-items: center; gap: 10px; }
.uno-color-pill { padding: 3px 12px; border-radius: 999px; color: #fff; font-weight: 800; font-size: 13px; text-transform: capitalize; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.uno-dir { width: 40px; height: 40px; display: grid; place-items: center; color: var(--duck); animation: spin 4s linear infinite; }
.uno-dir .ic { width: 30px; height: 30px; }
.uno-dir.ccw { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.uno-last { margin: 0; min-height: 1.4em; color: #cfe9ee; text-align: center; font-size: 14px; }
.uno-turn { width: min(520px, 100%); display: grid; gap: 6px; text-align: center; color: var(--muted); font-weight: 700; }
.uno-turn.mine { color: var(--duck); }
.uno-timer { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.uno-timer span { display: block; height: 100%; width: 100%; background: var(--pond-2); transition: width .2s linear; }
.uno-timer.urgent span { background: var(--beak); }

.uno-hand-zone { width: 100%; margin-top: auto; padding: 10px 12px 4px; border-radius: 16px; background: rgba(6, 14, 20, .45); border: 1px solid rgba(255, 255, 255, .06); transition: box-shadow .2s; }
.uno-hand-zone.mine { box-shadow: 0 0 0 2px rgba(255, 210, 51, .5); }
.uno-hand-head { display: flex; align-items: center; gap: 8px; }
.uno-hand { display: flex; justify-content: center; padding: 22px 30px 8px; overflow-x: auto; }
.uno-hand-card { flex: none; padding: 0; border: 0; background: none; border-radius: 10px; transition: transform .15s, filter .15s; }
.uno-hand-card + .uno-hand-card { margin-left: -26px; }
.uno-hand-card:disabled { opacity: 1; filter: brightness(.55) saturate(.7); }
.uno-hand-card.playable { cursor: pointer; transform: translateY(-10px); }
.uno-hand-card.playable:hover { transform: translateY(-22px) rotate(-3deg); z-index: 5; }
.uno-hand-card.drawn .uno-card { box-shadow: 0 0 0 3px var(--duck), 0 6px 16px rgba(0, 0, 0, .5); }
.coin-btn { padding: 8px 16px; font-weight: 900; letter-spacing: .03em; }
.coin-btn.ready { background: var(--duck); border-color: var(--duck); color: #1b1600; animation: glow 1.2s ease-in-out infinite; }

.uno-picker { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; background: rgba(5, 8, 12, .55); backdrop-filter: blur(3px); }
.uno-picker-box { display: grid; gap: 14px; padding: 20px; text-align: center; }
.uno-picker-colors { display: grid; grid-template-columns: repeat(2, 120px); gap: 10px; }
.uno-picker-colors button { height: 70px; border: 0; border-radius: 14px; color: #fff; font-weight: 900; font-size: 16px; text-transform: capitalize; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); transition: transform .12s; }
.uno-picker-colors button:hover { transform: scale(1.05); }

.coin-preview { background: radial-gradient(circle at 50% 30%, #145a6c, #0a2c38); }
.mini-card.uno { border-radius: 4px; }

/* ---------- Modales ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 8, 12, .62); backdrop-filter: blur(6px); animation: fade .18s;
}
.modal-back.out { opacity: 0; transition: opacity .18s; pointer-events: none; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(480px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 20px; box-shadow: var(--shadow); animation: pop-in .22s ease;
}
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 22px; }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 8px 22px 22px; overflow: auto; }

.profile { display: grid; gap: 14px; }
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head > div:last-child { flex: 1; min-width: 0; display: grid; gap: 8px; }
.profile-head h3 { font-size: 22px; }
.profile-avatar { position: relative; flex: none; }
.profile-avatar .avatar { font-size: 40px; box-shadow: 0 0 0 4px var(--surface-2), 0 0 0 6px rgba(255, 210, 51, .35); }
.profile-avatar.loading { opacity: .5; }
.avatar-edit {
  position: absolute; right: -2px; bottom: -2px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  border: 3px solid var(--surface); background: var(--duck); color: #1b1600;
}
.avatar-edit .ic { width: 17px; height: 17px; }
.xp-block { display: grid; gap: 6px; }
.xp-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 14px; color: var(--muted); margin-top: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { padding: 10px 12px; }
.settings { display: grid; gap: 6px; }
.switch-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
}
.switch-row > span:nth-child(2) { flex: 1; }
.switch-row:hover { background: var(--surface-3); }
.switch { width: 38px; height: 22px; border-radius: 11px; background: var(--surface-3); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch-row.on .switch { background: rgba(255, 210, 51, .3); }
.switch-row.on .switch::after { transform: translateX(16px); background: var(--duck); }
.settings .btn { margin-top: 8px; }

.leaderboard { display: grid; gap: 10px; }
.leaderboard > p { margin: 0; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; min-height: 120px; max-height: 52vh; overflow: auto; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.lb-row:hover { background: var(--surface-2); }
.lb-row.me { background: rgba(255, 210, 51, .08); box-shadow: inset 0 0 0 1px rgba(255, 210, 51, .25); }
.lb-rank { width: 28px; text-align: center; font-weight: 800; color: var(--muted); font-size: 15px; }
.lb-row:nth-child(-n+3) .lb-rank { font-size: 21px; }
.lb-name { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.lb-value { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--duck); white-space: nowrap; }
.lb-empty { padding: 30px 10px; text-align: center; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2000; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; pointer-events: auto; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: fade-up .22s ease; transition: opacity .25s, transform .25s;
}
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-error { border-color: rgba(255, 100, 100, .45); }
.toast-ic { width: 26px; height: 26px; flex: none; color: var(--duck); }
.toast-ic svg { width: 100%; height: 100%; }

/* ---------- Barres de défilement ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .app { padding: 8px; gap: 8px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "side" "chat"; }
  .side { gap: 8px; }
  .side-top { padding: 8px 8px 8px 12px; }
  .brand-duck { width: 34px; height: 34px; }
  .brand-name { font-size: 19px; }
  .me-text { display: none; }
  .me-chip { padding: 2px; }
  .games { padding: 10px; }
  .section-head { display: none; }
  .game-list { grid-auto-flow: column; grid-auto-columns: minmax(260px, 82%); overflow-x: auto; scroll-snap-type: x mandatory; }
  .game-card { scroll-snap-align: start; grid-template-columns: 70px 1fr auto; padding: 8px 10px 8px 8px; }
  .game-card p { display: none; }
  .game-preview { height: 58px; }
  .mini-card { width: 30px; height: 42px; top: 8px; left: 20px; }
  .msg-text.big { font-size: 28px; }

  .app.in-game, .app.in-game.chat-open { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "game"; }
  .app.in-game.chat-open .chat {
    position: fixed; inset: 0 0 0 auto; width: min(420px, 100%); z-index: 900; border-radius: 0; animation: slide-in .22s ease;
    box-shadow: -10px 0 40px rgba(0, 0, 0, .5);
  }
  .sol { gap: 8px; }
  .game-bar { gap: 6px; padding: 6px; }
  .game-title b, .mode-chip, .lvl-mini, .tool-btn .lbl { display: none; }
  .tool-btn { padding: 0 10px; }
  .game-bar { flex-wrap: wrap; }
  .sol-stats { margin-left: 0; order: 10; width: 100%; justify-content: space-around; }
  .sol-stats > div { border: 0; text-align: center; }
  .sol-felt { padding: 6px; }
  .win-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .lim-lobby { grid-template-columns: minmax(0, 1fr); }
  .lim-table { grid-template-columns: minmax(0, 1fr); height: auto; }
  .lim-player-list { grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); overflow-x: auto; }
  .lim-players-foot { grid-template-columns: 1fr 1fr; }
  .lim-players-foot .btn { padding: 8px 10px; font-size: 13px; }
  .lim-stage { overflow: visible; }
  .lim-card.big { font-size: 18px; }
  .lim-card.sub { width: 100%; min-height: 110px; }
  .lim-card.hand { width: 120px; height: 160px; font-size: 12.5px; }
  .lim-hero { padding: 18px; }
}
@media (max-width: 900px) {
  .uno-felt { padding: 10px 8px; gap: 10px; }
  .uno-seats { justify-content: flex-start; }
  .uno-seat { min-width: 120px; padding: 8px; }
  .uno-center { gap: 14px; }
  .uno-card.big { width: 78px; height: 117px; }
  .uno-card { width: 62px; height: 93px; border-radius: 7px; }
  .uno-hand { justify-content: flex-start; padding: 20px 10px 8px; }
  .uno-hand-card + .uno-hand-card { margin-left: -22px; }
  .uno-picker-colors { grid-template-columns: repeat(2, 110px); }
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .ttl circle { animation-duration: var(--dur) !important; }
}
