/* Garame : salon de jeu nocturne au cœur du Gabon.
   Feutre vert profond, rails en bois d'okoumé, laiton martelé des reliquaires Kota, masques Punu,
   tissages de raphia et ruban vert-jaune-bleu du drapeau. Boutons « liquides » : de l'or en fusion qui ondule. */
:root {
  --night: #050f0b;
  --night-2: #08170f;
  --felt: #0e4a35;
  --felt-hi: #1d7d58;
  --felt-deep: #052117;
  --panel: rgba(12, 32, 24, .82);
  --panel-solid: #0c2018;
  --line: rgba(226, 184, 74, .22);
  --line-strong: rgba(226, 184, 74, .5);
  --gold: #e2b84a;
  --gold-hi: #ffe39a;
  --gold-deep: #a8761c;
  --ivory: #f6eedb;
  --muted: #a3b5a8;
  --okoume: #8a4424;
  --okoume-dark: #44200e;
  --card: #fdf9ee;
  --card-edge: #e3d6b6;
  --card-red: #c0142b;
  --card-black: #15171a;
  --gab-green: #009e60;
  --gab-yellow: #fcd116;
  --gab-blue: #3a75c4;
  --ok: #3ccf8e;
  --bad: #ff6b5e;
  --display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --caps: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --radius: 18px;
  --ease-spring: cubic-bezier(.2, .9, .25, 1.35);
  --brass: linear-gradient(135deg, #fff1b8 0%, #e4b64a 30%, #a8721a 55%, #f3cf6b 78%, #8a5a12 100%);
  /* frise de raphia : triangles et losanges alternés */
  --frieze: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12' viewBox='0 0 36 12'%3E%3Cpath d='M0 12 6 0 12 12z' fill='%23e2b84a' fill-opacity='.6'/%3E%3Cpath d='M18 1 23 6 18 11 13 6z' fill='none' stroke='%23e2b84a' stroke-opacity='.75'/%3E%3Cpath d='M24 12 30 0 36 12z' fill='%23e2b84a' fill-opacity='.6'/%3E%3C/svg%3E");
  /* tissage de raphia, très discret, en fond */
  --weave: repeating-linear-gradient(45deg, rgba(226, 184, 74, .035) 0 2px, transparent 2px 14px),
           repeating-linear-gradient(-45deg, rgba(226, 184, 74, .035) 0 2px, transparent 2px 14px);
  --tricolor: linear-gradient(90deg, var(--gab-green) 0 33.33%, var(--gab-yellow) 0 66.66%, var(--gab-blue) 0);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 15% -10%, rgba(0, 158, 96, .16), transparent 60%),
    radial-gradient(900px 600px at 105% 10%, rgba(58, 117, 196, .12), transparent 60%),
    radial-gradient(1000px 700px at 50% 120%, rgba(226, 184, 74, .1), transparent 60%),
    var(--weave),
    var(--night);
  background-attachment: fixed;
  color: var(--ivory);
  font: 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: rgba(226, 184, 74, .35); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; }
.caps { font-family: var(--caps); letter-spacing: .2em; text-transform: uppercase; font-size: .72rem; color: var(--gold); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.gold-text {
  background: var(--brass); -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: brass-shift 8s ease-in-out infinite alternate;
}
@keyframes brass-shift { to { background-position: 100% 0; } }
.frieze { height: 12px; background: var(--frieze) repeat-x center / auto 12px; opacity: .85; }
.tricolor { height: 3px; background: var(--tricolor); }
.ico { width: 1.15em; height: 1.15em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Boutons liquides ---------- */
.lq {
  --lvl: 20%;
  --top: #f8dc8a; --bottom: #c08a24; --ink: #241503; --edge: rgba(248, 220, 138, .8); --glow: rgba(226, 184, 74, .6);
  --empty: linear-gradient(180deg, #3b2707, #1b1103);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10' preserveAspectRatio='none'%3E%3Cpath d='M0 5Q7.5 0 15 5T30 5T45 5T60 5V10H0z' fill='%23f8dc8a'/%3E%3C/svg%3E");
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.6em; border-radius: 999px;
  border: 1px solid var(--edge); background: var(--empty);
  color: var(--ink); font-weight: 800; letter-spacing: .015em; cursor: pointer; user-select: none;
  box-shadow: 0 14px 30px -14px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .4s var(--ease-spring), box-shadow .35s, filter .25s, color .25s .1s;
  -webkit-tap-highlight-color: transparent;
}
.lq-fill {
  position: absolute; left: -1px; right: -1px; bottom: -1px; top: var(--lvl); z-index: -1;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .35), transparent 55%),
    linear-gradient(180deg, var(--top), var(--bottom));
  transition: top .85s cubic-bezier(.2, .9, .2, 1.1);
}
.lq-fill::before, .lq-fill::after {
  content: ''; position: absolute; bottom: calc(100% - 1px); left: 0; width: calc(100% + 60px); height: 9px;
  background: var(--wave) repeat-x 0 0 / 60px 100%;
  animation: lq-wave 2.4s linear infinite;
}
.lq-fill::after { left: -84px; width: calc(100% + 84px); height: 12px; background-size: 84px 100%; opacity: .45; animation: lq-wave-back 3.8s linear infinite; }
@keyframes lq-wave { to { transform: translateX(-60px); } }
@keyframes lq-wave-back { to { transform: translateX(84px); } }
.lq-bubbles { position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: opacity .3s; }
.lq-bubbles i { position: absolute; bottom: -6px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .6); opacity: 0; animation: lq-bubble 3.2s ease-in infinite; }
.lq-bubbles i:nth-child(1) { left: 14%; animation-delay: .2s; }
.lq-bubbles i:nth-child(2) { left: 32%; width: 3px; height: 3px; animation-delay: 1.4s; animation-duration: 2.6s; }
.lq-bubbles i:nth-child(3) { left: 55%; animation-delay: .8s; }
.lq-bubbles i:nth-child(4) { left: 73%; width: 4px; height: 4px; animation-delay: 2.1s; animation-duration: 3.6s; }
.lq-bubbles i:nth-child(5) { left: 88%; width: 3px; height: 3px; animation-delay: 1.1s; }
@keyframes lq-bubble { 0% { transform: translateY(0) scale(.5); opacity: 0; } 25% { opacity: .85; } 100% { transform: translateY(-34px) scale(1.1); opacity: 0; } }
.lq-label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .55em; white-space: nowrap; }
.lq:hover, .lq:focus-visible { --lvl: -16px; transform: translateY(-2px); box-shadow: 0 20px 40px -14px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .4); }
.lq:active { transform: translateY(1px) scale(.97); }
.lq:disabled { filter: grayscale(.7) brightness(.7); cursor: not-allowed; transform: none; box-shadow: none; }
.lq:disabled .lq-fill::before, .lq:disabled .lq-fill::after, .lq:disabled .lq-bubbles i { animation-play-state: paused; }
.lq-ripple { position: absolute; z-index: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: rgba(255, 255, 255, .6); pointer-events: none; animation: lq-ripple .7s ease-out forwards; }
@keyframes lq-ripple { to { transform: scale(22); opacity: 0; } }
.lq-splash .lq-fill { animation: lq-slosh .6s ease-out; }
@keyframes lq-slosh { 25% { transform: translateY(5px) skewY(-3deg); } 55% { transform: translateY(-3px) skewY(2deg); } }

.lq-ghost { --lvl: calc(100% + 18px); --empty: rgba(5, 20, 14, .55); color: var(--gold-hi); }
.lq-ghost .lq-bubbles { opacity: 0; }
.lq-ghost:hover, .lq-ghost:focus-visible { color: var(--ink); }
.lq-ghost:hover .lq-bubbles { opacity: 1; }
.lq-green {
  --top: #5fe8ad; --bottom: #0b7a4f; --ink: #02180e; --edge: rgba(95, 232, 173, .8); --glow: rgba(0, 158, 96, .7);
  --empty: linear-gradient(180deg, #08341f, #031409);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10' preserveAspectRatio='none'%3E%3Cpath d='M0 5Q7.5 0 15 5T30 5T45 5T60 5V10H0z' fill='%235fe8ad'/%3E%3C/svg%3E");
}
.lq-blue {
  --top: #8cb8ff; --bottom: #2a58a6; --ink: #04122b; --edge: rgba(140, 184, 255, .8); --glow: rgba(58, 117, 196, .7);
  --empty: linear-gradient(180deg, #0d2347, #050e1f);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10' preserveAspectRatio='none'%3E%3Cpath d='M0 5Q7.5 0 15 5T30 5T45 5T60 5V10H0z' fill='%238cb8ff'/%3E%3C/svg%3E");
}
.lq-red {
  --top: #ff9a8a; --bottom: #b3302a; --ink: #2a0503; --edge: rgba(255, 154, 138, .8); --glow: rgba(255, 107, 94, .6);
  --empty: linear-gradient(180deg, #3d0d0a, #1a0504);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10' preserveAspectRatio='none'%3E%3Cpath d='M0 5Q7.5 0 15 5T30 5T45 5T60 5V10H0z' fill='%23ff9a8a'/%3E%3C/svg%3E");
}
.lq-ghost.lq-green, .lq-ghost.lq-blue, .lq-ghost.lq-red { --lvl: calc(100% + 18px); }
.lq-ghost.lq-green { color: #8ff0c3; }
.lq-ghost.lq-blue { color: #b5d0ff; }
.lq-ghost.lq-red { color: #ffb9ae; }
.lq-ghost.lq-green:hover, .lq-ghost.lq-blue:hover, .lq-ghost.lq-red:hover { --lvl: -16px; color: var(--ink); }
.lq-sm { min-height: 38px; padding: 0 1.1em; font-size: .86rem; }
.lq-lg { min-height: 58px; padding: 0 2.1em; font-size: 1.08rem; }
.lq-block { width: 100%; }

/* bouton discret (liens d'action) */
.link-btn { background: none; border: 0; padding: .35em .2em; color: var(--muted); cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(163, 181, 168, .4); text-underline-offset: 3px; }
.link-btn:hover { color: var(--ivory); }
.link-btn:disabled { opacity: .6; cursor: default; text-decoration: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: rgba(5, 20, 14, .6); color: var(--gold-hi); cursor: pointer;
  transition: transform .3s var(--ease-spring), border-color .2s, background .2s; position: relative;
}
.icon-btn:hover { transform: translateY(-2px) rotate(-4deg); border-color: var(--gold); background: rgba(226, 184, 74, .12); }
.icon-btn .dot { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; }

/* ---------- Champs ---------- */
.field { display: grid; gap: .4rem; }
.field label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.input {
  width: 100%; padding: .85em 1.05em; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .32); color: var(--ivory); outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder { color: rgba(163, 181, 168, .55); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(226, 184, 74, .14); background: rgba(0, 0, 0, .45); }
.form { display: grid; gap: 1rem; }
/* mot de passe : bouton « œil » pour afficher ou masquer ce que l'on tape (barré quand le texte est visible) */
.pwd-wrap { position: relative; display: grid; }
.pwd-wrap .input { padding-right: 3.2em; }
.eye-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; transition: color .2s, background .2s; }
.eye-btn:hover, .eye-btn:focus-visible { color: var(--gold-hi); background: rgba(226, 184, 74, .1); outline: none; }
.eye-btn .ico { width: 21px; height: 21px; }
.eye-btn::after { content: ''; position: absolute; width: 24px; height: 2px; border-radius: 2px; background: currentColor; box-shadow: 0 0 0 1.5px #06140e; transform: rotate(-45deg) scaleX(0); transition: transform .2s; }
.eye-btn.on { color: var(--gold-hi); }
.eye-btn.on::after { transform: rotate(-45deg) scaleX(1); }
.pwd-wrap input::-ms-reveal, .pwd-wrap input::-ms-clear { display: none; } /* Edge : un seul œil */
.forgot-link { justify-self: end; font-size: .84rem; margin-top: -.15rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.error { color: var(--bad); font-size: .88rem; min-height: 1.2em; }
.note { font-size: .85rem; color: var(--muted); margin: 0; }

.segmented { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); gap: 2px; }
.segmented button { border: 0; background: none; padding: .5em 1.1em; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 700; transition: background .25s, color .25s; }
.segmented button.on { background: var(--brass); color: #241503; box-shadow: 0 4px 14px -4px rgba(226, 184, 74, .6); }

/* ---------- Jetons de casino (choix de la mise) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 12px 8px; }
.chip {
  --c: #b8332a; --t: #fff;
  position: relative; width: 54px; aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; flex: none; cursor: pointer;
  display: grid; place-items: center; color: var(--t); font-weight: 800; font-size: .78rem; letter-spacing: -.01em;
  background:
    radial-gradient(circle, var(--c) 0 50%, transparent 51%),
    repeating-conic-gradient(from 8deg, rgba(255, 255, 255, .92) 0 14deg, var(--c) 14deg 45deg);
  box-shadow: 0 0 0 3px var(--c), 0 7px 0 -1px rgba(0, 0, 0, .45), 0 10px 18px rgba(0, 0, 0, .4), inset 0 0 0 2px rgba(255, 255, 255, .25);
  transition: transform .35s var(--ease-spring), box-shadow .3s;
}
.chip::before { content: ''; position: absolute; inset: 21%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .7); }
.chip span { position: relative; z-index: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.chip:hover { transform: translateY(-4px) rotate(-8deg); }
.chip.on { transform: translateY(-8px) scale(1.08); box-shadow: 0 0 0 3px var(--c), 0 0 0 6px var(--gold-hi), 0 0 26px rgba(226, 184, 74, .7), 0 14px 22px rgba(0, 0, 0, .5); }
.chip[data-v="0"] { --c: #0d6b45; }
.chip[data-v="50"] { --c: #e9e2d0; --t: #2a2214; }
.chip[data-v="100"] { --c: #c0312a; }
.chip[data-v="250"] { --c: #2d6fd0; }
.chip[data-v="500"] { --c: #0f8a5a; }
.chip[data-v="1000"] { --c: #1d1d22; }
.chip[data-v="2500"] { --c: #7b3fb5; }
.chip[data-v="5000"] { --c: #d4831c; }
.chip[data-v="10000"] { --c: #b8902e; --t: #241503; }
.chip.custom { --c: #3c4a43; }

/* ---------- Accueil / connexion ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.auth-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  background:
    radial-gradient(80% 70% at 30% 40%, rgba(29, 125, 88, .9) 0%, rgba(14, 74, 53, .85) 40%, rgba(5, 33, 23, .95) 100%),
    var(--weave), var(--felt-deep);
  border-right: 12px solid var(--okoume);
  box-shadow: inset -3px 0 0 var(--okoume-dark), inset -6px 0 0 rgba(226, 184, 74, .5);
}
.auth-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--tricolor); }
.hero-mask {
  position: absolute; z-index: -1; right: -6%; top: 6%; width: min(46vw, 520px); height: auto; aspect-ratio: 120 / 170;
  color: rgba(255, 238, 190, .07); filter: drop-shadow(0 0 30px rgba(226, 184, 74, .08));
  animation: mask-breathe 9s ease-in-out infinite;
}
@keyframes mask-breathe { 50% { color: rgba(255, 238, 190, .12); transform: translateY(-8px); } }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand svg { width: 30px; height: 44px; color: var(--gold); filter: drop-shadow(0 0 10px rgba(226, 184, 74, .35)); }
.brand .word { font-family: var(--caps); font-weight: 800; font-size: 1.3rem; letter-spacing: .34em; }
.hero-copy { display: grid; gap: 18px; max-width: 34rem; }
.hero-copy h1 { font-size: clamp(2.6rem, 5.4vw, 4.7rem); line-height: .95; font-style: italic; font-weight: 600; }
.hero-copy h1 em { font-style: normal; }
.hero-copy p { color: #d6e2d6; font-size: clamp(1rem, 1.4vw, 1.15rem); margin: 0; max-width: 31rem; }
.hero-stage { position: relative; height: 214px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 16px; }
.hero-stage::before {
  content: ''; position: absolute; left: 50%; bottom: -20px; width: min(470px, 100%); height: 70px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 222, 150, .24), rgba(255, 222, 150, 0)); pointer-events: none;
}
.hero-kota {
  position: relative; flex: none; width: 96px; height: 144px; margin: 0 0 6px -2px;
  filter: drop-shadow(0 0 24px rgba(226, 184, 74, .45)) drop-shadow(0 10px 18px rgba(0, 0, 0, .5));
  animation: kota-float 6s ease-in-out infinite;
}
@keyframes kota-float { 50% { transform: translateY(-10px) rotate(2deg); } }
.hero-fan { position: relative; flex: none; width: 300px; height: 190px; }
.hero-fan .card { position: absolute; left: 50%; bottom: 0; --w: 112px; transform-origin: 50% 130%; animation: fan-in .9s var(--ease-spring) both; animation-delay: calc(var(--i) * 90ms + .2s); }
@keyframes fan-in { from { opacity: 0; transform: translateX(-50%) translateY(60px) rotate(0deg); } }
.hero-facts { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: end; }
.hero-facts div { display: grid; }
.hero-facts b { font-family: var(--display); font-size: 1.85rem; line-height: 1.05; color: var(--gold-hi); font-weight: 700; }
.hero-facts span { font-size: .8rem; color: var(--muted); }
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; color: #c9f5de; }
.live-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(60, 207, 142, .7); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(60, 207, 142, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 207, 142, 0); } }

.auth-panel { display: grid; place-items: center; padding: 40px 22px; position: relative; }
.auth-box {
  width: min(430px, 100%); display: grid; gap: 22px; padding: 30px; border-radius: 24px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(16, 41, 31, .92), rgba(8, 23, 16, .95));
  border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.auth-box > .frieze { margin: -30px -30px 0; }
.auth-box h2 { font-size: 2.1rem; line-height: 1.05; }
.code-inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code-inputs input { text-align: center; font-size: 1.6rem; font-family: var(--display); font-weight: 700; padding: .4em 0; }
.dev-code { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-strong); background: rgba(226, 184, 74, .07); }
.dev-code b { font-family: var(--display); font-size: 1.7rem; letter-spacing: .25em; color: var(--gold-hi); }

/* ---------- Coque de l'application ---------- */
.shell { min-height: 100%; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.topbar-wrap { position: sticky; top: 0; z-index: 20; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px clamp(14px, 3vw, 30px); padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(5, 15, 11, .86); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.topbar .brand svg { width: 22px; height: 32px; }
.topbar .brand .word { font-size: 1.02rem; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { position: relative; text-decoration: none; color: var(--muted); padding: .5em .95em; border-radius: 999px; font-weight: 700; font-size: .9rem; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ivory); background: rgba(226, 184, 74, .08); }
.nav a.on { color: #241503; background: var(--brass); }
.spacer { flex: 1; }
.balance-chip {
  display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px; border-radius: 999px; text-decoration: none; color: var(--ivory);
  background: linear-gradient(180deg, rgba(226, 184, 74, .18), rgba(226, 184, 74, .05)); border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.balance-chip .amt { display: grid; line-height: 1.05; }
.balance-chip .amt small { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.balance-chip .amt b { font-family: var(--display); font-size: 1.3rem; color: var(--gold-hi); font-weight: 700; }
.balance-chip .plus { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brass); color: #241503; font-weight: 800; font-size: 1.2rem; box-shadow: 0 4px 12px -2px rgba(226, 184, 74, .6); }
.bump { animation: bump .6s var(--ease-spring); }
.bump-down { animation: bump-down .6s ease; }
@keyframes bump { 40% { transform: scale(1.18); color: #c9f5de; } }
@keyframes bump-down { 40% { transform: scale(.92); color: #ffb9ae; } }
.who {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .88rem; color: var(--muted); text-decoration: none;
  padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid transparent; transition: color .2s, background .2s, border-color .2s;
}
.who:hover, .who.on { color: var(--ivory); background: rgba(226, 184, 74, .08); border-color: var(--line); }
.who-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* écran moyen : le pseudo laisse sa place au menu, l'avatar reste (son nom s'affiche au survol) */
@media (max-width: 1180px) { .who-name { display: none; } .who { padding: 3px; } }
@media (min-width: 901px) and (max-width: 1040px) { .topbar .brand .word { display: none; } .nav { margin-left: 0; } .nav a { padding: .5em .75em; } }

main { padding: clamp(16px, 3vw, 34px); padding-bottom: 110px; width: 100%; max-width: 1280px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(2.1rem, 4.4vw, 3.1rem); line-height: 1.02; }
.page-head h1 i { font-style: italic; }

.panel {
  position: relative; min-width: 0; border-radius: var(--radius); padding: 22px; overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 44, 33, .9), rgba(9, 25, 18, .92));
  border: 1px solid var(--line); box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.panel > .frieze { margin: -22px -22px 18px; }
.panel h2 { font-size: 1.6rem; margin-bottom: 4px; line-height: 1.1; }
.panel .lead { margin: 0 0 16px; color: var(--muted); }
.stack { display: grid; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: .35em .75em; border-radius: 999px; background: rgba(0, 0, 0, .35); color: var(--gold-hi); border: 1px solid var(--line); width: max-content; white-space: nowrap; }
.badge.live { color: #ffd3cf; border-color: rgba(255, 107, 94, .5); }
.badge.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: pulse 1.4s infinite; }
.badge.free { color: #bff3da; border-color: rgba(60, 207, 142, .45); }
.badge.blue { color: #cfe0ff; border-color: rgba(58, 117, 196, .6); }
@keyframes pulse { 50% { opacity: .3; } }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative;
  font-family: var(--caps); font-weight: 800; font-size: .78rem; color: #241503; background: var(--brass);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25), 0 4px 10px rgba(0, 0, 0, .35);
}
.avatar.on::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel-solid); }
.avatar.has-img { background: var(--panel-solid); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; user-select: none; }

/* ---------- Mon compte ---------- */
.profile-card { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-bottom: 14px; }
.avatar.xl {
  width: 112px; height: 112px; font-size: 2.1rem;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .22), 0 0 0 4px rgba(226, 184, 74, .35), 0 18px 34px -12px rgba(0, 0, 0, .7);
}
.avatar.xl.on::after { content: none; }
.profile-meta { display: grid; gap: 6px; min-width: 0; }
.profile-meta h2 { font-size: 2.1rem; overflow-wrap: anywhere; }
.photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px; }
.contact-list { display: grid; gap: 10px; margin: 0 0 18px; }
.contact-list div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .22); }
.contact-list span { color: var(--muted); font-size: .85rem; font-weight: 700; }
.contact-list b { text-align: right; overflow-wrap: anywhere; min-width: 0; }
#acc-contact .segmented { margin-bottom: 16px; }
#acc-contact .dev-code { margin-bottom: 16px; }

/* Code PIN de retrait */
.pin-input { text-align: center; font-family: var(--display); font-size: 1.5rem; font-weight: 700; letter-spacing: .6em; padding-left: .6em; max-width: 11rem; }
.pwd-wrap:has(.pin-input) { max-width: 15rem; }
.pwd-wrap .pin-input { max-width: none; }
.pin-input::placeholder { letter-spacing: .3em; }
.pin-forgot { align-self: flex-start; font-size: .85rem; }
.pin-state { padding: .25em .75em; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; border: 1px solid var(--line); white-space: nowrap; }
.pin-ok { color: #9fe3bd; border-color: rgba(57, 196, 120, .5); background: rgba(57, 196, 120, .12); }
.pin-off { color: var(--gold-hi); border-color: rgba(226, 184, 74, .5); background: rgba(226, 184, 74, .1); }
.pin-bad { color: #ffd3cf; border-color: rgba(255, 107, 94, .5); background: rgba(255, 107, 94, .12); }
.pin-actions { align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
#pin-panel .dev-code, #pin-panel .alert { margin-bottom: 14px; }
#pin-panel .lead { margin-bottom: 14px; }
.wallet-form .risk .link-btn { padding: 0; margin-left: 4px; color: var(--gold-hi); }
.modal .pin-input { max-width: 100%; }

/* ---------- Salon ---------- */
.hello { display: flex; align-items: center; gap: 14px; }
.hello svg { width: 34px; height: 50px; color: var(--gold); }
.quick {
  position: relative; overflow: hidden; border-radius: 26px; padding: clamp(22px, 3.5vw, 36px); display: grid; gap: 22px;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(58, 117, 196, .25), transparent 55%),
    radial-gradient(80% 90% at 0% 100%, rgba(0, 158, 96, .35), transparent 60%),
    radial-gradient(70% 70% at 50% 40%, #1a6e50, #0b3a2a 60%, #062117);
  border: 1px solid var(--line-strong); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 255, 255, .03);
}
.quick::before { content: ''; position: absolute; inset: 0; background: var(--weave); pointer-events: none; }
.quick::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--tricolor); }
.quick > * { position: relative; }
.quick-mask { position: absolute; right: -40px; bottom: -60px; width: 260px; height: 368px; color: rgba(255, 238, 190, .07); pointer-events: none; }
.quick h2 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1; }
.quick .stake-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.players-pick { display: flex; align-items: center; gap: 10px; }
.players-pick .segmented button { min-width: 46px; padding: .5em .95em; font-size: 1rem; }
.quick .stake-line b { font-family: var(--display); font-size: clamp(2.4rem, 5vw, 3.2rem); line-height: 1; color: var(--gold-hi); }
.risk { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .28); border: 1px dashed var(--line); font-size: .86rem; color: #d6e2d6; }
.risk b { color: var(--gold-hi); }
.searching { display: flex; align-items: center; gap: 14px; }
.radar { width: 46px; height: 46px; border-radius: 50%; position: relative; border: 1px solid var(--line-strong); background: radial-gradient(circle, rgba(226, 184, 74, .15), transparent 70%); flex: none; }
.radar::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(226, 184, 74, .6), transparent 30%); animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.table-tile {
  position: relative; border-radius: 22px; padding: 16px 18px 18px; display: grid; gap: 10px;
  background: radial-gradient(120% 100% at 50% 0%, #1a6a4f, var(--felt-deep));
  border: 7px solid var(--okoume); box-shadow: inset 0 0 0 1px rgba(226, 184, 74, .5), 0 14px 30px -12px rgba(0, 0, 0, .7);
  transition: transform .35s var(--ease-spring);
}
.table-tile:hover { transform: translateY(-4px) rotate(-.6deg); }
.table-tile .stake { font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--gold-hi); font-weight: 700; }
.table-tile .stake small { font-family: var(--body); font-size: .72rem; color: var(--muted); margin-left: 4px; font-weight: 600; }
.seats-dots { display: flex; gap: 6px; }
.seats-dots span { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--gold); }
.seats-dots span.full { background: var(--brass); box-shadow: 0 0 8px rgba(226, 184, 74, .6); }
.code-box { display: flex; align-items: center; gap: 8px; }
.code-box .input { font-family: var(--caps); letter-spacing: .3em; text-transform: uppercase; text-align: center; font-weight: 800; }

.people { display: grid; gap: 2px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid rgba(226, 184, 74, .08); }
.person:last-child { border-bottom: 0; }
.person .meta { flex: 1; min-width: 0; }
.person .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .meta span { font-size: .8rem; color: var(--muted); }
.empty { padding: 18px; border-radius: 14px; border: 1px dashed var(--line); text-align: center; color: var(--muted); font-size: .92rem; }

/* ---------- Table de jeu ---------- */
.room { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.room-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.room-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.room-head .left, .room-head .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.rail {
  position: relative; margin: 0 auto; width: min(100%, calc((100vh - 460px) * 1.75)); min-width: min(100%, 480px);
  padding: clamp(12px, 1.8vw, 20px); border-radius: 50% / 44%;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 210, 160, .22), transparent 50%),
    repeating-linear-gradient(100deg, rgba(0, 0, 0, .14) 0 3px, transparent 3px 11px),
    repeating-linear-gradient(80deg, rgba(255, 190, 140, .07) 0 2px, transparent 2px 17px),
    linear-gradient(180deg, #a35a33, var(--okoume) 45%, #5a2a12);
  box-shadow: 0 0 0 2px var(--okoume-dark), 0 36px 70px -20px rgba(0, 0, 0, .85), inset 0 2px 0 rgba(255, 220, 180, .25);
}
.felt {
  position: relative; aspect-ratio: 16 / 9.4; border-radius: 50% / 44%; overflow: visible;
  background:
    radial-gradient(60% 55% at 50% 42%, rgba(60, 170, 120, .55), transparent 70%),
    repeating-radial-gradient(circle at 50% 50%, rgba(0, 0, 0, .025) 0 2px, transparent 2px 4px),
    radial-gradient(75% 70% at 50% 50%, #17704f 0%, #0d4a34 55%, #062419 100%);
  box-shadow: inset 0 0 0 3px rgba(226, 184, 74, .6), inset 0 0 0 7px rgba(0, 0, 0, .25), inset 0 0 90px rgba(0, 0, 0, .6);
}
.felt::before { content: ''; position: absolute; inset: 16% 20%; border-radius: 50%; border: 1px solid rgba(226, 184, 74, .22); }
.felt-mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; color: rgba(255, 238, 190, .1); transition: opacity .4s; }
.felt:has(.felt-center) .felt-mark, .felt:has(.overlay) .felt-mark { opacity: 0; }
#felt-extra { position: absolute; inset: 0; z-index: 5; border-radius: inherit; pointer-events: none; }
.felt-mark svg { width: 64px; height: 90px; display: block; margin: 0 auto; }
.felt-mark div { font-family: var(--caps); letter-spacing: .5em; font-size: .78rem; margin-top: 2px; }

.seat { position: absolute; z-index: 3; display: grid; justify-items: center; gap: 5px; transform: translate(-50%, -50%); width: max-content; max-width: 46%; }
.seat.p-bottom { left: 50%; top: 88%; }
.seat.p-top { left: 50%; top: 11%; }
.seat.p-left { left: 9%; top: 47%; }
.seat.p-right { left: 91%; top: 47%; }
.seat-id { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(3, 12, 8, .82); border: 1px solid var(--line); font-weight: 700; font-size: .84rem; white-space: nowrap; box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .7); transition: border-color .3s, box-shadow .3s; }
.seat-id .avatar { width: 32px; height: 32px; font-size: .64rem; }
.seat-id .avatar.on::after { width: 8px; height: 8px; right: -2px; bottom: -2px; border-width: 1.5px; }
.seat-id .nm { max-width: 11ch; overflow: hidden; text-overflow: ellipsis; }
.seat-id .tag { font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .2em .55em; border-radius: 999px; background: rgba(226, 184, 74, .14); color: var(--gold-hi); }
.seat-id .tag.fold { background: rgba(163, 181, 168, .16); color: #d0dbd3; }
.seat-id .tag.out { background: rgba(255, 107, 94, .18); color: #ffc2ba; }
.seat-id .tag.ok { background: rgba(60, 207, 142, .18); color: #c3f5dd; }
.seat-id .tag.next { background: rgba(120, 170, 255, .16); color: #cfe0ff; }
/* Couronne du joueur qui dirige le pli */
.lead-mark { position: absolute; top: -13px; left: -6px; z-index: 2; display: inline-flex; align-items: center; gap: 3px; padding: .18em .55em .18em .4em; border-radius: 999px; background: linear-gradient(180deg, #f6d77a, #c99a2e); color: #2a1c02; font-size: .6rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 2px 8px rgba(0, 0, 0, .55), 0 0 12px rgba(255, 213, 110, .45); }
.lead-mark.in { animation: lead-in .35s var(--ease-spring); }
.lead-mark b { font-size: .95em; line-height: 1; }
.seat.lead .seat-id { border-color: rgba(246, 215, 122, .75); }
@keyframes lead-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.seat .ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); pointer-events: none; }
.seat .ring circle { fill: none; stroke: var(--gold-hi); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; animation: ring var(--turn-ms, 30s) linear forwards; animation-delay: var(--turn-delay, 0s); filter: drop-shadow(0 0 4px rgba(255, 227, 154, .9)); }
@keyframes ring { to { stroke-dashoffset: 100; stroke: #ff6b5e; } }
.seat.turn .seat-id { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(226, 184, 74, .18), 0 0 30px rgba(226, 184, 74, .45); }
.seat.away .seat-id, .seat.st-out .seat-id { opacity: .55; }
.seat.st-folded .seat-id { filter: grayscale(.6); }
.seat .mini-hand { display: flex; height: 36px; }
.seat .mini-hand .card { --w: 26px; margin-left: -16px; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.seat .mini-hand .card:first-child { margin-left: 0; }
.seat-empty { color: rgba(255, 227, 154, .55); font-size: .78rem; font-weight: 700; border: 1px dashed rgba(226, 184, 74, .4); padding: 7px 14px; border-radius: 999px; background: rgba(0, 0, 0, .2); }
.played-row { display: flex; gap: 3px; min-height: 30px; }
.mcard {
  --h: 30px; height: var(--h); width: calc(var(--h) * .72); border-radius: 4px; display: grid; justify-items: center; align-content: center; gap: 0;
  background: linear-gradient(160deg, #fffdf6, #efe5cc); border: 1px solid var(--card-edge); color: var(--card-black);
  font-family: var(--display); font-weight: 700; line-height: .9; font-size: calc(var(--h) * .42); box-shadow: 0 2px 5px rgba(0, 0, 0, .4);
}
.mcard svg { width: calc(var(--h) * .32); height: calc(var(--h) * .32); fill: currentColor; }
.mcard.red { color: var(--card-red); }
.mcard.won { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 12px rgba(255, 227, 154, .8); transform: translateY(-3px); }
.mcard.new { animation: pop .5s var(--ease-spring); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.trick-zone { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); width: 42%; height: 50%; z-index: 2; }
.trick-zone .card { position: absolute; --w: clamp(48px, 6.4vw, 80px); transform: translate(-50%, -50%) rotate(var(--r, 0deg)); }
.trick-zone .t-bottom { left: 50%; top: 70%; --r: 2deg; }
.trick-zone .t-top { left: 50%; top: 30%; --r: -3deg; }
.trick-zone .t-left { left: 30%; top: 50%; --r: -8deg; }
.trick-zone .t-right { left: 70%; top: 50%; --r: 7deg; }
.trick-zone .card.enter.t-bottom { animation: from-bottom .45s var(--ease-spring); }
.trick-zone .card.enter.t-top { animation: from-top .45s var(--ease-spring); }
.trick-zone .card.enter.t-left { animation: from-left .45s var(--ease-spring); }
.trick-zone .card.enter.t-right { animation: from-right .45s var(--ease-spring); }
@keyframes from-bottom { from { transform: translate(-50%, 160%) rotate(20deg) scale(.8); opacity: 0; } }
@keyframes from-top { from { transform: translate(-50%, -260%) rotate(-20deg) scale(.8); opacity: 0; } }
@keyframes from-left { from { transform: translate(-260%, -50%) rotate(-30deg) scale(.8); opacity: 0; } }
@keyframes from-right { from { transform: translate(160%, -50%) rotate(30deg) scale(.8); opacity: 0; } }
.trick-zone .win { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 40px rgba(255, 227, 154, .9); z-index: 2; animation: win-glow 1s ease-in-out infinite alternate; }
.trick-zone .lose { filter: brightness(.6) saturate(.7); }
.trick-zone .lead { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(226, 184, 74, .55); z-index: 1; }
@keyframes win-glow { to { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 60px rgba(255, 227, 154, 1); } }
.turn-hint { position: absolute; left: 50%; top: 69%; transform: translateX(-50%); z-index: 2; font-size: .78rem; font-weight: 700; color: var(--gold-hi); text-shadow: 0 1px 3px #000; white-space: nowrap; pointer-events: none; }
.led { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); z-index: 1; font-size: .7rem; color: rgba(255, 238, 190, .55); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.led svg { width: 14px; height: 14px; fill: currentColor; }

.overlay {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; border-radius: inherit; text-align: center;
  background: radial-gradient(closest-side, rgba(3, 12, 8, .93), rgba(3, 12, 8, .74)); animation: fade .35s;
}
@keyframes fade { from { opacity: 0; } }
.overlay .box { display: grid; gap: 8px; justify-items: center; padding: 14px; max-width: 92%; }
.overlay .big { font-family: var(--display); font-style: italic; font-weight: 700; font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: .95; }
.overlay .count { font-family: var(--display); font-size: clamp(3.4rem, 9vw, 6rem); line-height: 1; color: var(--gold-hi); animation: count-pop 1s ease-out infinite; }
@keyframes count-pop { from { transform: scale(1.35); opacity: .3; } 30% { transform: scale(1); opacity: 1; } }
.overlay .mult { font-family: var(--caps); letter-spacing: .3em; color: var(--gold-hi); font-weight: 800; font-size: clamp(.9rem, 2vw, 1.2rem); }
.result-big { animation: result-in .8s var(--ease-spring) both; }
@keyframes result-in { from { transform: scale(.3) rotate(-6deg); opacity: 0; } }
.deltas { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; font-size: .86rem; }
.deltas span { padding: .25em .7em; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.revealed { display: flex; gap: 4px; justify-content: center; }
.revealed .mcard { --h: 40px; }
.continue-ring { width: 64px; height: 64px; position: relative; display: grid; place-items: center; font-weight: 800; font-family: var(--display); font-size: 1.5rem; color: var(--gold-hi); }
.continue-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.continue-ring circle { fill: none; stroke-width: 4; }
.continue-ring .track { stroke: rgba(226, 184, 74, .2); }
.continue-ring .bar { stroke: var(--gold-hi); stroke-linecap: round; stroke-dasharray: 100; animation: ring var(--ms, 30s) linear forwards; animation-delay: var(--delay, 0s); }

.hand-zone { display: grid; gap: 10px; justify-items: center; }
.my-hand { display: flex; justify-content: center; align-items: flex-end; min-height: 142px; padding: 14px 10px 4px; }
.my-hand .card {
  --w: clamp(70px, 7vw, 96px); margin-left: calc(var(--w) * -.22);
  transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 5deg)) translateY(calc(var(--off, 0) * 1px));
  transform-origin: 50% 120%; transition: transform .3s var(--ease-spring), box-shadow .25s, filter .25s;
}
.my-hand .card:first-child { margin-left: 0; }
.my-hand button.card { cursor: pointer; }
.my-hand.turn button.card:not(:disabled) { box-shadow: 0 0 0 2px rgba(255, 227, 154, .85), 0 0 22px rgba(255, 227, 154, .45), 0 10px 22px rgba(0, 0, 0, .45); animation: legal-bob 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * .12s); }
.my-hand button.card:not(:disabled):hover, .my-hand button.card:not(:disabled):focus-visible { transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 5deg)) translateY(-22px) scale(1.05); z-index: 2; animation: none; }
.my-hand.turn button.card:disabled, .my-hand.wait .card { filter: brightness(.7) saturate(.75); cursor: default; }
.my-hand button.card:disabled { opacity: 1; }
@keyframes legal-bob { 50% { translate: 0 -6px; } }
.my-hand .card.deal { animation: deal .6s var(--ease-spring) both; animation-delay: calc(var(--i) * 90ms); }
@keyframes deal { from { opacity: 0; translate: 0 -240px; rotate: 180deg; scale: .5; } }
.my-hand .card.playing { transform: translateY(-160px) scale(.6) !important; opacity: 0; transition: transform .35s ease-in, opacity .35s; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.points { display: inline-flex; align-items: center; gap: 8px; padding: .45em .9em; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); font-size: .85rem; color: var(--muted); }
.points b { color: var(--gold-hi); font-family: var(--display); font-size: 1.25rem; }
.status-line { text-align: center; color: var(--muted); font-size: .92rem; min-height: 1.4em; }
.status-line b { color: var(--gold-hi); }

.share-box { display: grid; gap: 8px; justify-items: center; text-align: center; max-width: 100%; }
.share-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; max-width: 100%; }
.share-link { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; border-radius: 999px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line-strong); max-width: 100%; min-width: 0; }
.share-link .icon-btn { width: 34px; height: 34px; flex: none; }
.share-link code { font-family: var(--body); font-weight: 700; color: var(--gold-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }

.emoji-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.emoji-bar button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid transparent; background: rgba(0, 0, 0, .25); font-size: 1.25rem; cursor: pointer; transition: transform .3s var(--ease-spring), background .2s, border-color .2s; }
.emoji-bar button:hover { transform: translateY(-4px) scale(1.2) rotate(-6deg); background: rgba(226, 184, 74, .12); border-color: var(--line); }

.chat { position: sticky; top: 84px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: calc(100vh - 120px); max-height: 720px; min-height: 380px; padding: 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head h3 { font-size: 1.3rem; }
.chat-list { overflow-y: auto; padding: 12px 14px; display: grid; align-content: start; gap: 8px; overscroll-behavior: contain; }
.msg { display: grid; gap: 1px; max-width: 92%; animation: msg-in .3s ease; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg .from { font-size: .72rem; font-weight: 800; color: var(--gold); }
.msg .from i { font-style: normal; color: var(--muted); font-weight: 600; }
.msg .txt { padding: .45em .8em; border-radius: 4px 14px 14px 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(226, 184, 74, .1); overflow-wrap: anywhere; font-size: .9rem; }
.msg.mine { justify-self: end; justify-items: end; }
.msg.mine .txt { border-radius: 14px 4px 14px 14px; background: rgba(226, 184, 74, .16); border-color: rgba(226, 184, 74, .3); }
.msg.sys { justify-self: center; max-width: 100%; text-align: center; font-size: .78rem; color: var(--muted); font-style: italic; }
.chat-emojis { padding: 8px 10px 0; border-top: 1px solid var(--line); }
.chat-form { display: flex; gap: 8px; padding: 10px; }
.chat-form .input { padding: .7em 1em; border-radius: 999px; }
.chat-toggle { display: none; }

/* ---------- Cartes ---------- */
.card {
  --w: 96px;
  position: relative; width: var(--w); aspect-ratio: 5 / 7; flex: none; padding: 0;
  border-radius: calc(var(--w) * .085); border: 1px solid var(--card-edge);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 42%),
    radial-gradient(120% 90% at 30% 10%, #fffdf7, var(--card) 60%, #f1e7cf);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 8px 18px rgba(0, 0, 0, .38);
  color: var(--card-black); font-family: var(--display); overflow: hidden;
}
.card::after { content: ''; position: absolute; inset: calc(var(--w) * .035); border-radius: calc(var(--w) * .06); border: 1px solid rgba(190, 150, 60, .38); pointer-events: none; }
.card.red { color: var(--card-red); }
.card svg { fill: currentColor; display: block; }
.card .idx { position: absolute; display: grid; justify-items: center; line-height: .9; z-index: 1; }
.card .idx b { font-size: calc(var(--w) * .21); font-weight: 700; letter-spacing: -.04em; }
.card .idx svg { width: calc(var(--w) * .12); height: calc(var(--w) * .12); margin-top: calc(var(--w) * .02); }
.card .idx.tl { left: calc(var(--w) * .065); top: calc(var(--w) * .07); }
.card .idx.br { right: calc(var(--w) * .065); bottom: calc(var(--w) * .07); transform: rotate(180deg); }
.card .pips { position: absolute; left: 24%; right: 24%; top: 15%; bottom: 15%; }
.card .pip { position: absolute; width: calc(var(--w) * .19); height: calc(var(--w) * .19); transform: translate(-50%, -50%); }
.card .pip.flip { transform: translate(-50%, -50%) rotate(180deg); }
.card .pip svg { width: 100%; height: 100%; }
.card.back {
  border-color: #c9a646;
  background:
    var(--frieze) repeat-x top / auto calc(var(--w) * .1),
    linear-gradient(90deg, transparent 0 46%, rgba(252, 209, 22, .5) 46% 54%, transparent 54%) center / 100% 100% no-repeat,
    repeating-linear-gradient(45deg, rgba(226, 184, 74, .2) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, rgba(226, 184, 74, .2) 0 1px, transparent 1px 8px),
    radial-gradient(circle at 50% 50%, #18604a, #0a2c21);
}
.card.back::after { border-color: rgba(226, 184, 74, .7); }
.back-art { position: absolute; inset: 0; display: grid; place-items: center; }
.back-kota { width: 40%; height: 54%; color: var(--gold); filter: drop-shadow(0 0 4px rgba(0, 0, 0, .5)); }

/* ---------- Portefeuille ---------- */
.balance-hero { display: grid; gap: 8px; }
.balance-hero .amount { font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 7vw, 4.4rem); line-height: 1; }
.balance-hero .split { display: flex; gap: 22px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.airtel { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.airtel::before { content: ''; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff6b6b, #d0021b); box-shadow: 0 0 10px rgba(208, 2, 27, .6); }
#wallet-form > .segmented { margin: 4px 0 18px; }
.breakdown { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: rgba(0, 0, 0, .28); border: 1px dashed var(--line); font-size: .9rem; }
.breakdown div { display: flex; justify-content: space-between; gap: 12px; }
.breakdown div:last-child { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 800; color: var(--gold-hi); }
.alert { padding: 12px 14px; border-radius: 14px; background: rgba(255, 107, 94, .1); border: 1px solid rgba(255, 107, 94, .4); color: #ffd3cf; font-size: .9rem; }
.history { width: 100%; border-collapse: collapse; font-size: .88rem; }
.history th { text-align: left; font-weight: 700; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: 8px; border-bottom: 1px solid var(--line); }
.history td { padding: 10px 8px; border-bottom: 1px solid rgba(226, 184, 74, .07); }
.history td.r, .history th.r { text-align: right; }
.scroll-x { overflow-x: auto; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.status-pending { color: var(--gold-hi); }
.status-failed { color: var(--bad); }
.status-success { color: var(--ok); }

/* ---------- Règles ---------- */
.rules { display: grid; gap: 18px; }
.rules section { display: grid; gap: 10px; }
.rules h2 { font-size: 1.75rem; }
.rules p, .rules li { color: #dbe5dc; }
.rules ol, .rules ul { padding-left: 1.2em; display: grid; gap: 6px; margin: 0; }
.mult-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.mult-table div { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); display: grid; gap: 4px; align-content: start; }
.mult-table b { font-family: var(--display); font-size: 2.3rem; line-height: 1; }
.deck-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.deck-strip .mcard { --h: 42px; }

/* ---------- Notifications et effets ---------- */
#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100% - 28px)); pointer-events: none; }
#toast div { padding: 12px 16px; border-radius: 14px; background: rgba(12, 36, 27, .97); border: 1px solid var(--gold); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); animation: toast-in .45s var(--ease-spring); font-weight: 600; }
#toast div.err { border-color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: confetti-fall 3s cubic-bezier(.3, .6, .5, 1) forwards; }
.confetti.round { width: 10px; height: 10px; border-radius: 50%; }
@keyframes confetti-fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }
.coin {
  position: absolute; top: -40px; width: var(--size); height: var(--size); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #f0c75e 35%, #b07a1a 70%, #7a520e);
  box-shadow: inset 0 0 0 2px rgba(255, 246, 200, .6), 0 4px 8px rgba(0, 0, 0, .4);
  animation: coin-fall 2s cubic-bezier(.4, .1, .6, 1) forwards;
}
@keyframes coin-fall { to { transform: translateY(110vh) rotateY(720deg); } }
/* Émoji d'un joueur : visible 5 secondes au-dessus de sa place (même durée que EMOJI_MS dans fx.js) */
.emote-float { position: fixed; z-index: 75; font-size: 2.2rem; transform: translate(-50%, -130%); animation: emote-fly 5s ease-out forwards; text-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
@keyframes emote-fly {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  5% { transform: translate(-50%, -115%) scale(1.3); opacity: 1; }
  10% { transform: translate(-50%, -130%) scale(1); }
  90% { transform: translate(-50%, -175%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -215%) scale(.9); opacity: 0; }
}

/* ---------- Table : couches du tapis, centre, résultat ---------- */
.seats-layer { position: absolute; inset: 0; }
.felt-center {
  position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); z-index: 4;
  display: grid; justify-items: center; gap: 6px; text-align: center; width: max-content; max-width: 62%;
  padding: 18px 30px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(3, 12, 8, .74), rgba(3, 12, 8, 0));
  animation: fade .4s;
}
.felt-center b { font-family: var(--display); font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-weight: 700; line-height: 1.05; }
.felt-center > span:not(.caps) { color: var(--muted); font-size: .85rem; }
.felt-center .count { font-size: clamp(3.4rem, 9vw, 6rem); line-height: 1; color: var(--gold-hi); animation: count-pop 1s ease-out infinite; min-width: 1ch; }
.felt-center .radar { width: 54px; height: 54px; }
.result-why { color: #d6e2d6; font-size: .9rem; max-width: 30rem; }
.revealed-hand { display: grid; gap: 4px; justify-items: center; font-size: .75rem; color: var(--muted); }
.deltas b { margin-left: 4px; }
.continue-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 20px; }
.stack-sm { display: grid; gap: 10px; justify-items: start; max-width: 32rem; }
.stack-sm .status-line { text-align: left; }
.warn { color: #ffb9ae; font-weight: 700; }
.suit-inline { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; fill: var(--ivory); }
.suit-inline.red { fill: #ff8b80; }
.spectator-banner { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 12px 16px; border-radius: 14px; border: 1px dashed var(--line); background: rgba(0, 0, 0, .25); color: #d6e2d6; font-size: .9rem; }
.spectator-banner .ico { color: var(--gold); }
.emoji-bar.emoji-strip { display: none; }
.badge .ico { width: 1.15em; height: 1.15em; }
.center { text-align: center; }
.row.center { justify-content: center; }
.small { font-size: .78rem; }
.tile-live { margin: 2px 0 6px; }
.tile-live .live-dot { font-size: .78rem; }
.history-panel .row.between { align-items: center; gap: 12px; }
.history-panel .lead { margin-bottom: 0; }
.history-panel #history-box { margin-top: 16px; }
.tile-meta { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-stake { max-width: 300px; }
.presets button { padding: .45em .85em; font-size: .84rem; }
.risk .ico { margin-top: 1px; color: var(--gold); }
.search-field { margin: 12px 0; }
.plain { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; color: #dbe5dc; }
.deck { display: grid; gap: 8px; }
.deck-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); font-weight: 700; }
.mult-table strong { font-size: 1rem; }
.mult-table span { font-size: .82rem; }
.chat-head .icon-btn { width: 34px; height: 34px; }
.admin-loading { min-height: 60vh; display: grid; place-items: center; }

/* fenêtre de confirmation */
.modal-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(2, 8, 5, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .25s; }
.modal { width: min(470px, 100%); max-height: calc(100vh - 36px); overflow: auto; display: grid; gap: 14px; padding: 26px; border-radius: 22px; background: linear-gradient(180deg, #13342a, #08190f); border: 1px solid var(--line-strong); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .85); animation: modal-in .45s var(--ease-spring); }
.modal > .frieze { margin: -26px -26px 4px; }
.modal h3 { font-size: 1.9rem; line-height: 1.05; }
.modal-body p { margin: 0 0 8px; color: #d6e2d6; }
.modal-body .field { margin-top: 12px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.94); } }

/* retour à la table, perte de connexion */
.resume-pill {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 35; display: flex; align-items: center; gap: 10px;
  max-width: calc(100% - 24px); padding: 8px 8px 8px 16px; border-radius: 999px; text-decoration: none; color: var(--ivory);
  font-weight: 700; font-size: .86rem; white-space: nowrap; background: rgba(8, 23, 16, .96); border: 1px solid var(--gold);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6), 0 0 24px rgba(226, 184, 74, .25); animation: pill-in .5s var(--ease-spring);
}
.resume-pill b { padding: .45em 1em; border-radius: 999px; background: var(--brass); color: #241503; }
@keyframes pill-in { from { opacity: 0; transform: translate(-50%, 20px); } }
.net-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 90; padding: 8px 14px; text-align: center; font-weight: 700; font-size: .85rem; background: #7a2119; color: #ffe1dc; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }

/* ---------- Téléphone ---------- */
.tabbar { display: none; }
@media (max-width: 1080px) {
  .room { grid-template-columns: minmax(0, 1fr); }
  .chat { position: fixed; right: 12px; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); top: auto; z-index: 40; height: min(62vh, 520px); min-height: 0; transform: translateY(calc(100% + 120px)); transition: transform .45s var(--ease-spring); }
  .chat.open { transform: none; }
  .chat-toggle { display: inline-grid; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { border-right: 0; border-bottom: 10px solid var(--okoume); box-shadow: inset 0 -3px 0 var(--okoume-dark); gap: 16px; padding: 24px 20px 28px; }
  .hero-copy { gap: 12px; }
  .hero-copy h1 { font-size: clamp(2.3rem, 10vw, 3rem); }
  .hero-copy p { font-size: .98rem; }
  .hero-stage { height: 124px; margin-bottom: 8px; }
  .hero-stage::before { height: 46px; bottom: -14px; }
  .hero-fan { width: 190px; height: 112px; }
  .hero-fan .card { --w: 66px; }
  .hero-kota { width: 58px; height: 87px; margin-bottom: 4px; }
  .hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
  .hero-facts b { font-size: 1.3rem; }
  .hero-facts span { font-size: .7rem; }
  .hero-mask { width: 70vw; right: -20%; top: 2%; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .nav { display: none; }
  .who { padding: 2px; }
  .who-name { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: rgba(5, 15, 11, .96); border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .tabbar::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--tricolor); opacity: .8; }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 700; padding: 6px 0; border-radius: 12px; }
  .tabbar a b { font-size: 1.15rem; line-height: 1; font-weight: 400; }
  .tabbar a.on { color: var(--gold-hi); background: rgba(226, 184, 74, .1); }
  .rail { width: 100%; min-width: 0; border-radius: 44% / 36%; padding: 10px; }
  .felt { aspect-ratio: 4 / 4.25; border-radius: 44% / 36%; }
  .seat { transition: opacity .4s; }
  .felt:has(.overlay) .seat { opacity: .1; }
  .felt::before { inset: 20% 14%; }
  .seat.p-top { top: 9%; }
  .seat.p-bottom { top: 90%; }
  .seat.p-left { left: 15%; top: 46%; }
  .seat.p-right { left: 85%; top: 46%; }
  .seat-id { font-size: .74rem; padding-right: 9px; }
  .seat-id .avatar { width: 28px; height: 28px; }
  .seat-id .nm { max-width: 8ch; }
  .mcard { --h: 26px; }
  .seat .mini-hand { height: 30px; }
  .seat .mini-hand .card { --w: 22px; margin-left: -14px; }
  .trick-zone { width: 60%; height: 44%; }
  .trick-zone .card { --w: clamp(46px, 13vw, 64px); }
  .trick-zone .t-left { left: 24%; }
  .trick-zone .t-right { left: 76%; }
  .my-hand { min-height: 130px; }
  .my-hand .card { --w: clamp(62px, 17vw, 84px); }
}
@media (max-width: 520px) {
  .balance-chip .amt small { display: none; }
  .topbar { gap: 10px; }
  .who .avatar { width: 34px; height: 34px; font-size: .66rem; }
  .topbar .brand .word { letter-spacing: .2em; font-size: .9rem; }
  .chips { gap: 10px 8px; }
  .chip { width: 50px; font-size: .7rem; }
  .auth-box { padding: 24px 18px; }
  .auth-box > .frieze { margin: -24px -18px 0; }
  .seat-id .tag { position: absolute; top: -11px; right: -6px; font-size: .5rem; padding: .2em .5em; box-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
  .seat-id .tag.fold { background: #3a4a41; }
  .seat-id .tag.out { background: #6d2a24; }
  .seat-id .tag.ok { background: #1d6b4a; }
  .seat-id .tag.next { background: #26406b; }
  .seat-id .tag.host { display: none; }
  .seat-id .tag:not(.fold):not(.out):not(.ok):not(.next) { background: #5b4718; }
  .lead-mark { top: -11px; font-size: .5rem; }
  .seat-id:has(.tag:not(.host)) .lead-mark { font-size: 0; gap: 0; padding: 2px 5px; }
  .seat-id:has(.tag:not(.host)) .lead-mark b { font-size: .55rem; }
  .room-head { flex-wrap: nowrap; }
  .room-head .left { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .room-head .left::-webkit-scrollbar { display: none; }
  .room-head .left .badge { flex: none; }
  .room-head .right { flex: none; flex-wrap: nowrap; gap: 6px; }
  .room-head .b-extra { display: none; }
  .room-head .badge { padding: .3em .6em; letter-spacing: .04em; font-size: .64rem; }
  .lq-quit { width: 40px; min-height: 40px; padding: 0; }
  .lq-quit .q-txt { display: none; }
  .lq-quit .lq-label { gap: 0; }
  .players-pick .caps { display: none; }
  .seat.p-left, .seat.p-right { max-width: 30%; }
}
@media (max-width: 1080px) {
  .emoji-bar.emoji-strip { display: flex; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; max-width: 100%; padding: 2px 2px 6px; scrollbar-width: none; }
  .emoji-bar.emoji-strip::-webkit-scrollbar { display: none; }
  .emoji-strip button { flex: none; }
}
@media (max-width: 900px) {
  .resume-pill { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  #toast { top: calc(66px + env(safe-area-inset-top, 0px)); bottom: auto; }
  .continue-box { flex-direction: column; }
  .stack-sm { justify-items: center; }
  .stack-sm .status-line { text-align: center; }
}
@media (max-width: 420px) {
  /* petit téléphone : la pastille du solde perd son « + » pour laisser la place à l'avatar et à la déconnexion */
  .balance-chip { padding: 6px 14px; }
  .balance-chip .plus { display: none; }
}
@media (max-width: 440px) {
  .topbar .brand .word { display: none; } /* l'emblème Kota suffit ; le mot GARAME reprend sa place dès 441 px */
}
@media (max-width: 520px) {
  .resume-pill { font-size: .78rem; padding-left: 12px; }
  .felt-center { max-width: 80%; padding: 12px 16px; }
}
/* ---------- Table : conseil « tournez le téléphone », plein écran ---------- */
.rotate-hint, .room-head .b-land, .room-head .b-sound { display: none; }
@media (orientation: portrait) and (max-width: 600px) and (pointer: coarse) {
  .rotate-hint { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 14px; border: 1px dashed var(--line-strong); background: rgba(226, 184, 74, .07); font-size: .78rem; line-height: 1.3; color: #d6e2d6; }
  .rotate-hint > .ico { width: 26px; height: 26px; flex: none; color: var(--gold); animation: rotate-nudge 2.6s ease-in-out infinite; }
  .rotate-hint .icon-btn { width: 32px; height: 32px; margin-left: auto; font-size: .8rem; }
}
@keyframes rotate-nudge { 0%, 50%, 100% { transform: rotate(0); } 65%, 85% { transform: rotate(-90deg); } }

/* ---------- Téléphone tourné en paysage : la table, la main et les commandes sur un seul écran ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  .shell.r-table { display: block; min-height: 0; }
  .shell.r-table .topbar-wrap, .shell.r-table .tabbar { display: none; }
  .shell.r-table main {
    max-width: none; height: 100vh; height: 100dvh; overflow: hidden;
    padding: max(6px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  }
  .room { display: block; height: 100%; }
  .room-main { height: 100%; grid-template-columns: minmax(0, 1fr) clamp(236px, 35vw, 340px); grid-template-rows: auto minmax(0, 1fr); gap: 6px 12px; }

  /* colonne de droite : boutons de la table, informations de la manche, puis la main du joueur */
  .room-head { grid-column: 2; grid-row: 1; flex-direction: column-reverse; align-items: stretch; flex-wrap: nowrap; gap: 6px; }
  .room-head .left { flex-wrap: wrap; gap: 5px; }
  .room-head .badge { flex: none; padding: .3em .6em; font-size: .62rem; letter-spacing: .04em; }
  .room-head .b-extra { display: none; }
  .room-head .b-land { display: inline-flex; }
  .room-head .b-sound { display: inline-grid; }
  .room-head .right { flex: none; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
  .room-head .icon-btn { width: 34px; height: 34px; }
  .room-head .icon-btn .ico { width: 18px; height: 18px; }
  .lq-quit { width: 34px; min-height: 34px; padding: 0; }
  .lq-quit .q-txt { display: none; }
  .lq-quit .lq-label { gap: 0; }
  /* lignes à leur taille réelle : un contenu trop haut fait défiler la zone au lieu de faire chevaucher cartes et boutons */
  .hand-zone {
    grid-column: 2; grid-row: 2; min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: 6px; padding: 0 2px 2px; scrollbar-width: thin;
    grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: end; align-content: safe end;
  }
  .share-box { grid-template-columns: minmax(0, 1fr); }
  .status-line { font-size: .8rem; min-height: 0; }
  .actions { gap: 6px; }
  .actions .lq, .hand-zone .lq-lg { min-height: 38px; padding: 0 1.1em; font-size: .84rem; }
  .points { padding: .3em .7em; font-size: .76rem; }
  .points b { font-size: 1.05rem; }
  .hand-zone .note { font-size: .72rem; }
  .my-hand { min-height: 0; padding: 20px 4px 2px; }
  .my-hand .card { --w: clamp(50px, 6.6vw, 66px); }
  .my-hand button.card:not(:disabled):hover, .my-hand button.card:not(:disabled):focus-visible { transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 5deg)) translateY(-14px) scale(1.04); }
  .my-hand .card.playing { transform: translate(-40vw, -10px) scale(.6) !important; }
  .continue-box { flex-direction: column; gap: 8px; }
  .continue-ring { width: 52px; height: 52px; font-size: 1.25rem; }
  .stack-sm { justify-items: center; }
  .stack-sm .status-line { text-align: center; }
  .spectator-banner { font-size: .76rem; padding: 8px 10px; }
  .share-box .note { font-size: .72rem; }
  .emoji-bar.emoji-strip { display: flex; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; max-width: 100%; padding: 2px 2px 4px; scrollbar-width: none; }
  .emoji-bar.emoji-strip::-webkit-scrollbar { display: none; }
  .emoji-strip button { flex: none; }

  /* colonne de gauche : le tapis sur toute la hauteur de l'écran */
  .rail { grid-column: 1; grid-row: 1 / span 2; width: 100%; min-width: 0; height: 100%; margin: 0; padding: 7px; border-radius: 50% / 46%; }
  .felt { aspect-ratio: auto; height: 100%; border-radius: 50% / 46%; }
  .felt::before { inset: 18%; }
  .felt-mark svg { width: 42px; height: 60px; }
  .felt-mark div { font-size: .62rem; }
  .felt:has(.overlay) .seat { opacity: .1; }
  .seat { gap: 3px; transition: opacity .4s; }
  .seat.p-top { top: 14%; }
  .seat.p-bottom { top: 86%; }
  .seat.p-left { left: 13%; top: 49%; }
  .seat.p-right { left: 87%; top: 49%; }
  .seat.p-left, .seat.p-right { max-width: 26%; }
  .seat-id { font-size: .7rem; gap: 6px; padding: 3px 9px 3px 3px; }
  .seat-id .avatar { width: 26px; height: 26px; font-size: .58rem; }
  .seat-id .nm { max-width: 8ch; }
  .seat-id .tag { position: absolute; top: -10px; right: -6px; font-size: .5rem; padding: .2em .5em; box-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
  .seat-id .tag.fold { background: #3a4a41; }
  .seat-id .tag.out { background: #6d2a24; }
  .seat-id .tag.ok { background: #1d6b4a; }
  .seat-id .tag.next { background: #26406b; }
  .seat-id .tag.host { display: none; }
  .seat-id .tag:not(.fold):not(.out):not(.ok):not(.next) { background: #5b4718; }
  .lead-mark { top: -10px; font-size: .5rem; }
  .seat-id:has(.tag:not(.host)) .lead-mark { font-size: 0; gap: 0; padding: 2px 5px; }
  .seat-id:has(.tag:not(.host)) .lead-mark b { font-size: .55rem; }
  .mcard { --h: 24px; }
  .played-row { min-height: 24px; gap: 2px; }
  .seat .mini-hand { height: 24px; }
  .seat .mini-hand .card { --w: 18px; margin-left: -11px; }
  .trick-zone { top: 52%; width: 46%; height: 44%; }
  .trick-zone .card { --w: clamp(40px, 6.2vw, 56px); }
  .trick-zone .t-left { left: 25%; }
  .trick-zone .t-right { left: 75%; }
  .felt-center { padding: 10px 14px; max-width: 70%; }
  .felt-center .count { font-size: 3rem; }
  .overlay .box { max-height: 100%; overflow-y: auto; gap: 4px; padding: 10px 8px; scrollbar-width: none; }
  .overlay .big { font-size: clamp(1.6rem, 4.2vw, 2.4rem); }
  .result-why { font-size: .78rem; }
  .revealed .mcard { --h: 28px; }
  .deltas { font-size: .74rem; gap: 4px 8px; }

  /* discussion : panneau sur toute la hauteur, à droite */
  .chat {
    position: fixed; z-index: 40; top: max(8px, env(safe-area-inset-top, 0px)); bottom: max(8px, env(safe-area-inset-bottom, 0px));
    right: max(8px, env(safe-area-inset-right, 0px)); left: auto; width: min(380px, 52vw); height: auto; min-height: 0; max-height: none;
    transform: translateX(calc(100% + 40px)); transition: transform .45s var(--ease-spring);
  }
  .chat.open { transform: none; }
  .chat-toggle { display: inline-grid; }
  .chat-head { padding: 8px 12px; }
  .chat-head h3 { font-size: 1.1rem; }
  body:has(.shell.r-table) #toast { top: max(8px, env(safe-area-inset-top, 0px)); bottom: auto; }
}

/* ---------- Son et musique : bouton et petit panneau de réglages ---------- */
.sound-btn.is-playing::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-hi); box-shadow: 0 0 8px var(--gold); animation: sound-beat .6s ease-in-out infinite alternate;
}
@keyframes sound-beat { from { transform: scale(.6); opacity: .55; } to { transform: scale(1); opacity: 1; } }
.auth { position: relative; }
.sound-fab { position: absolute; z-index: 30; top: max(14px, env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); box-shadow: 0 8px 20px rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sound-panel {
  position: fixed; z-index: 85; width: min(300px, calc(100vw - 20px)); padding: 16px 16px 14px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 48, 36, .98), rgba(8, 24, 17, .98)); border: 1px solid var(--line-strong);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .05);
  display: grid; gap: 12px; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); overflow-y: auto;
  animation: sound-in .28s var(--ease-spring);
}
.sound-panel::before { content: ''; height: 10px; margin: -16px -16px 0; border-radius: 16px 16px 0 0; background: var(--frieze) center / 36px 10px repeat-x, rgba(68, 32, 14, .9); }
@keyframes sound-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.sp-title { font-family: var(--caps); font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-hi); }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.sp-row span { display: grid; gap: 1px; font-weight: 700; font-size: .92rem; }
.sp-row small, .sp-vol span { color: var(--muted); font-weight: 600; font-size: .74rem; }
.sp-switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 46px; height: 26px; margin: 0; border-radius: 13px; cursor: pointer;
  background: rgba(5, 20, 14, .8); border: 1px solid var(--line-strong); transition: background .25s, border-color .25s;
}
.sp-switch::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #6f8277; transition: transform .3s var(--ease-spring), background .25s;
}
.sp-switch:checked { background: linear-gradient(180deg, #f6d77a, #b98a26); border-color: var(--gold-hi); }
.sp-switch:checked::before { transform: translateX(20px); background: #2a1c02; }
.sp-switch:focus-visible, .sp-vol input:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.sp-vol { display: grid; gap: 6px; }
.sp-vol input { width: 100%; margin: 0; accent-color: var(--gold); cursor: pointer; }
.sp-note { margin: 2px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .74rem; line-height: 1.4; font-style: italic; }
@media (max-width: 420px) {
  .topbar .icon-btn { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .emote-float { animation: none !important; } /* reste affiché, immobile, pendant ses 5 secondes */
}
