/* kbsino : feutre bleu pétrole, cuir, laiton, ivoire. Aucune police externe. */
:root {
  --petrol: #0a2a30;
  --petrol-2: #0e363d;
  --feutre: #12414a;
  --feutre-2: #0d3239;
  --cuir: #3b2416;
  --cuir-2: #54331f;
  --laiton: #d9a441;
  --laiton-2: #f0c36a;
  --ivoire: #f3ead5;
  --argile: #c2452d;
  --craie: #9db9b6;
  --line: rgba(243, 234, 213, .14);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --serif: "Bodoni 72", "Didot", "Playfair Display", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(1200px 700px at 50% -10%, #124650 0%, var(--petrol) 60%) fixed, var(--petrol);
  color: var(--ivoire); font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .6rem; letter-spacing: .01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: 1.25rem; margin-top: 1.6rem; }
p { margin: 0 0 .8rem; }
a { color: var(--laiton-2); }
.muted { color: var(--craie); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--laiton-2); outline-offset: 2px; border-radius: 6px; }

/* ---------- Boutons et champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--feutre); color: var(--ivoire); font: 600 1rem var(--sans); cursor: pointer; text-decoration: none;
  transition: transform .12s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--craie); }
.btn:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(180deg, var(--laiton-2), var(--laiton)); color: #2a1a05; border-color: #a97a22; box-shadow: 0 2px 0 #7c5716; }
.btn-gold:hover { border-color: #fff3cf; }
.btn-ghost { background: transparent; }
.btn.sm { min-height: 38px; padding: .3rem .8rem; font-size: .92rem; }
.btn.wide { width: 100%; }
.btn[disabled], .btn-link[disabled] { opacity: .45; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: .4rem 0; color: var(--laiton-2); font: inherit; text-decoration: underline; cursor: pointer; min-height: 36px; }
.btn-link.danger { color: #ff9b86; }

.field { display: flex; flex-direction: column; gap: .3rem; font-size: .92rem; color: var(--craie); min-width: 0; }
.field.grow, .grow { flex: 1 1 160px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .8rem; font: 1rem var(--sans); /* 16px : pas de zoom iOS */
  color: var(--ivoire); background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 10px;
}
input::placeholder { color: rgba(157, 185, 182, .6); }
input:focus, select:focus, textarea:focus { border-color: var(--laiton); outline: none; box-shadow: 0 0 0 3px rgba(217, 164, 65, .3); }
select option { color: #111; }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--laiton); }
.check { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; color: var(--ivoire); cursor: pointer; font-size: 1rem; }
.checks { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.row-form { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.row-form.tight { gap: .5rem; margin-top: .5rem; }
.row-form.tight input { flex: 1 1 110px; min-height: 38px; }
.stack-form { display: flex; flex-direction: column; gap: .9rem; }
.error { color: #ffb4a3; min-height: 1.4em; margin: 0; }

/* ---------- Structure ---------- */
.screen:not(.active) { display: none !important; }
.screen.active { display: block; }
.screen.splash.active, .screen.login.active { display: grid; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .8rem;
  padding: calc(.6rem + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) .6rem max(16px, env(safe-area-inset-left));
  background: rgba(10, 42, 48, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-title { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.spacer { flex: 1; }
.back { color: var(--ivoire); text-decoration: none; padding: .5rem .2rem; min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; }
.wordmark { display: inline-flex; align-items: center; gap: .6rem; margin-right: auto; text-decoration: none; color: var(--ivoire); }
.wm-mark { width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--argile) 0 12%, var(--ivoire) 0 25%, var(--argile) 0 37%, var(--ivoire) 0 50%, var(--argile) 0 62%, var(--ivoire) 0 75%, var(--argile) 0 87%, var(--ivoire) 0); position: relative; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.wm-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--argile); border: 2px dashed var(--ivoire); }
.wm-text { white-space: nowrap; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
.wallet {
  display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .9rem; min-height: 44px;
  border-radius: 999px; background: var(--cuir); border: 1px solid #7a5232; color: var(--ivoire); text-decoration: none; font-variant-numeric: tabular-nums;
}
.wallet strong { color: var(--laiton-2); }
.stack-side { display: inline-flex; flex-direction: column-reverse; width: 22px; gap: 1px; }
.stack-side i { display: block; height: 5px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--argile) 0 4px, var(--ivoire) 4px 7px); }
.stack-side i:nth-child(2) { transform: translateX(2px); }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .6rem; border-radius: 999px; border: 1px solid var(--line); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: "▾"; font-size: .8rem; color: var(--craie); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; padding: .5rem; background: var(--petrol-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 30; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; min-height: 44px; padding: 0 .8rem; color: var(--ivoire); text-decoration: none; background: none; border: 0; text-align: left; font: inherit; border-radius: 8px; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: rgba(255, 255, 255, .07); }
.menu-pop .install-btn { color: var(--laiton-2); }
.menu-pop .who { padding: .5rem .8rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.role-tag { font-size: .8rem; color: var(--craie); }

.page { max-width: 1100px; margin: 0 auto; padding: 1.2rem max(16px, env(safe-area-inset-left)) 3rem; }
.page.narrow { max-width: 640px; }
.panel { background: linear-gradient(180deg, rgba(18, 65, 74, .75), rgba(13, 50, 57, .75)); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.panel h2:first-child, .panel-head h2 { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.notice { padding: .7rem .9rem; border-radius: 10px; background: rgba(217, 164, 65, .14); border: 1px solid rgba(217, 164, 65, .4); }
.notice.good { background: rgba(80, 180, 120, .15); border-color: rgba(80, 180, 120, .5); }
.notice.warn { background: rgba(194, 69, 45, .18); border-color: rgba(194, 69, 45, .6); }
.tag { display: inline-block; padding: .05rem .55rem; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: .82rem; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--argile); color: #fff; font-size: .8rem; text-align: center; }
.status { display: inline-block; padding: .05rem .6rem; border-radius: 999px; font-size: .82rem; background: rgba(255,255,255,.1); }
.status.pending { background: rgba(217, 164, 65, .25); }
.status.approved { background: rgba(80, 180, 120, .25); }
.status.refused { background: rgba(194, 69, 45, .3); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: .6rem 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; }
.quote { border-left: 3px solid var(--laiton); padding-left: .8rem; color: var(--craie); margin: .4rem 0; }
.empty-line { color: var(--craie); padding: .8rem 0; }
.request { padding: .9rem 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .5rem; }
.tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .6rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; min-height: 44px; padding: 0 1rem; border-radius: 999px; background: transparent; color: var(--ivoire); border: 1px solid var(--line); font: 600 .98rem var(--sans); cursor: pointer; }
.tabs button.active { background: var(--laiton); color: #2a1a05; border-color: var(--laiton); }
.tabs.small button { min-height: 38px; padding: 0 .8rem; }

.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-weight: 600; color: var(--craie); padding: .6rem .6rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.grid td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.credit-cell { display: flex; gap: .4rem; flex-wrap: wrap; min-width: 220px; }
.credit-cell input { width: 110px; min-height: 38px; }
@media (max-width: 719px) {
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid thead { display: none; }
  .grid tr { background: rgba(18, 65, 74, .6); border: 1px solid var(--line); border-radius: var(--r); padding: .4rem .8rem; margin-bottom: .7rem; }
  .grid td { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border: 0; padding: .4rem 0; text-align: right; }
  .grid td::before { content: attr(data-label); color: var(--craie); text-align: left; font-size: .88rem; flex: 0 0 38%; }
  .credit-cell { min-width: 0; justify-content: flex-end; }
}

.site-footer { text-align: center; padding: 1.5rem 16px 2.5rem; color: var(--craie); }
.site-footer form { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: .6rem; }
.site-footer input { max-width: 240px; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 100; background: var(--ivoire); color: #1d1a12; padding: .7rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow); max-width: min(92vw, 440px); font-weight: 600; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Écran de chargement et de connexion ---------- */
.splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 1rem; text-align: center; padding: 1rem; }
.login { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.vignette { display: none; }
.login-panel { align-self: center; justify-self: center; width: min(100% - 32px, 420px); margin: 2rem 0; padding: 1.5rem 1.4rem; background: linear-gradient(180deg, rgba(18, 65, 74, .85), rgba(13, 50, 57, .9)); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.wordmark-big { font-family: var(--serif); font-size: 2.3rem; font-weight: 700; line-height: 1.05; margin-bottom: .4rem; }
.login-panel .tabs { margin: 1rem 0 .8rem; }
.login-panel form { display: flex; flex-direction: column; gap: .9rem; }
@media (min-width: 900px) {
  .login { grid-template-columns: 1.1fr 1fr; }
  .vignette { display: grid; place-items: center; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 50%, var(--feutre) 0, var(--petrol) 75%); }
  .vig-table { width: 78%; aspect-ratio: 1.7; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #1a5560, var(--feutre-2)); border: 16px solid var(--cuir); box-shadow: inset 0 0 40px rgba(0,0,0,.5), var(--shadow); display: grid; place-items: center; }
  .fan { display: flex; }
  .fan .pcard { margin: 0 -10px; transform: rotate(-9deg); width: 84px; height: 118px; font-size: 1.7rem; }
  .fan .pcard + .pcard { transform: rotate(9deg) translateY(4px); }
  .vig-stack { position: absolute; right: 12%; bottom: 14%; display: flex; flex-direction: column-reverse; gap: 2px; }
  .vig-stack i { display: block; width: 62px; height: 12px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--argile) 0 8px, var(--ivoire) 8px 14px); box-shadow: 0 2px 3px rgba(0,0,0,.4); }
}

/* ---------- Accueil ---------- */
.hero { padding: .6rem 0 1rem; }
.hero p { color: var(--craie); max-width: 52ch; }
.tables { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .tables { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tables { grid-template-columns: repeat(3, 1fr); } }
.table-card { background: linear-gradient(180deg, rgba(18, 65, 74, .8), rgba(13, 50, 57, .85)); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.mini { position: relative; padding: 1rem; background: rgba(0, 0, 0, .18); }
.mini-rail { aspect-ratio: 2 / 1; width: 78%; margin: 0 auto; border-radius: 50%; background: var(--cuir); padding: 8px; box-shadow: inset 0 2px 4px rgba(255,255,255,.15), 0 6px 12px rgba(0,0,0,.4); }
.mini-felt { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #1b5a66, var(--feutre-2)); box-shadow: inset 0 0 14px rgba(0,0,0,.5); }
.pip { position: absolute; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--craie); background: transparent; }
.pip.taken { background: var(--laiton); border-color: var(--laiton-2); }
.tc-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.tc-body h3 { margin: 0; font-size: 1.3rem; }
.facts { margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; }
.facts dt { color: var(--craie); }
.facts dd { margin: 0; text-align: right; }
.tc-body .btn { margin-top: auto; }
.empty { padding: 2rem 1rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); color: var(--craie); grid-column: 1 / -1; }
.rules { margin-top: 2rem; }
.rules ul { padding-left: 1.2rem; color: var(--craie); }

/* ---------- Cartes et jetons ---------- */
.pcard { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 40px; height: 56px; border-radius: 6px; background: #fbf6e6; color: #1b1b1b; font-family: var(--serif); box-shadow: 0 2px 5px rgba(0,0,0,.5); line-height: 1; gap: 2px; vertical-align: middle; }
.pcard b { font-size: 1.15rem; }
.pcard i { font-style: normal; font-size: 1.1rem; }
.pcard.red { color: var(--argile); }
.pcard.back { background: repeating-linear-gradient(45deg, #7d2a1c 0 5px, #9b3a28 5px 10px); border: 3px solid #fbf6e6; }
.pcard.empty { background: rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 2px rgba(243, 234, 213, .18); }
.disc { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; position: relative; color: #fff; font: 700 1.1rem var(--serif); box-shadow: 0 3px 6px rgba(0,0,0,.5); --c: var(--argile); background: radial-gradient(circle, var(--c) 0 58%, transparent 59%), conic-gradient(var(--ivoire) 0 12.5%, var(--c) 0 25%, var(--ivoire) 0 37.5%, var(--c) 0 50%, var(--ivoire) 0 62.5%, var(--c) 0 75%, var(--ivoire) 0 87.5%, var(--c) 0); }
.disc span { position: relative; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.disc.tiny { width: 26px; height: 26px; font-size: .8rem; }
.disc.chip-0 { --c: #c2452d; } .disc.chip-1 { --c: #2f6f8f; } .disc.chip-2 { --c: #2f7a55; }
.disc.chip-3 { --c: #7a4a9a; } .disc.chip-4 { --c: #b87d1b; } .disc.chip-5 { --c: #3a3a46; }

/* ---------- Table de jeu ---------- */
.table-title { flex: 1; min-width: 0; }
.table-title h1 { font-size: 1.1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-title .muted { font-size: .8rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room { display: grid; grid-template-columns: 1fr; gap: 1rem; padding: 1rem max(12px, env(safe-area-inset-left)) 3rem; max-width: 1400px; margin: 0 auto; }
.stage { position: relative; }
.rail { aspect-ratio: 2 / 1; width: 100%; border-radius: 999px; padding: clamp(8px, 2vw, 18px); background: linear-gradient(180deg, var(--cuir-2), var(--cuir)); box-shadow: inset 0 3px 6px rgba(255,255,255,.18), 0 14px 30px rgba(0,0,0,.5); }
.felt { position: relative; width: 100%; height: 100%; border-radius: 999px; background: radial-gradient(ellipse at 50% 35%, #1d5f6c 0, var(--feutre) 55%, var(--feutre-2) 100%); box-shadow: inset 0 0 40px rgba(0,0,0,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; text-align: center; padding: 0 8%; }
.pot { display: flex; align-items: baseline; gap: .5rem; font-size: .95rem; color: var(--craie); }
.pot strong { font: 700 clamp(1.3rem, 4vw, 2rem) var(--serif); color: var(--laiton-2); }
.board { display: flex; gap: clamp(3px, 1vw, 8px); }
.board .pcard { width: clamp(32px, 7vw, 56px); height: clamp(45px, 9.8vw, 78px); }
.board .pcard b { font-size: clamp(.95rem, 2.4vw, 1.5rem); }
.board .pcard i { font-size: clamp(.9rem, 2.2vw, 1.4rem); }
.phase { font-size: .85rem; color: var(--craie); }
.last { font-size: .85rem; min-height: 1.2em; color: var(--ivoire); }
.seats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-top: 1rem; }
@media (min-width: 420px) { .seats { grid-template-columns: repeat(3, 1fr); } }
.seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .7rem .4rem .6rem; border-radius: var(--r); background: rgba(13, 50, 57, .8); border: 1px solid var(--line); text-align: center; min-width: 0; }
.seat.mine { border-color: var(--laiton); box-shadow: 0 0 0 2px rgba(217, 164, 65, .35); }
.seat.out { opacity: .6; }
.seat.free { background: transparent; border-style: dashed; justify-content: center; min-height: 90px; }
.free-ring { width: 36px; height: 36px; border-radius: 50%; border: 2px dashed var(--craie); opacity: .5; }
.hole { display: flex; gap: 3px; min-height: 40px; }
.hole .pcard { width: 28px; height: 40px; }
.hole .pcard b, .hole .pcard i { font-size: .85rem; }
.hole.five { gap: 2px; }
.hole.five .pcard { width: 22px; height: 31px; }
.hole.five .pcard b, .hole.five .pcard i { font-size: .7rem; }
.stage.ring .hole.five .pcard { width: 17px; height: 25px; }
.stage.ring .hole.five .pcard b, .stage.ring .hole.five .pcard i { font-size: .6rem; }
.my-hole.five { gap: .35rem; }
.my-hole.five .pcard { width: min(15vw, 66px); height: min(21vw, 92px); }
.my-hole.five .pcard b { font-size: 1.5rem; }
.my-hole.five .pcard i { font-size: 1.4rem; }
.hole.out .pcard { opacity: .4; }
.avatar { position: relative; }
.dealer { position: absolute; right: -10px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ivoire); color: #1b1b1b; font: 700 .75rem var(--sans); display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.plate { display: flex; flex-direction: column; line-height: 1.2; max-width: 100%; }
.plate .nm { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.plate .sk { color: var(--laiton-2); font-variant-numeric: tabular-nums; font-weight: 700; }
.bot { font-size: .7rem; padding: 0 .35rem; border-radius: 999px; background: rgba(255,255,255,.14); color: var(--craie); font-weight: 600; }
.bet { padding: .05rem .6rem; border-radius: 999px; background: var(--argile); color: #fff; font-size: .82rem; font-weight: 700; }
.state { font-size: .75rem; color: var(--craie); }
.state.win { color: var(--laiton-2); font-weight: 700; }

.stage.ring { padding: 62px 0; }
.stage.ring .hole { min-height: 34px; }
.stage.ring .hole .pcard { width: 24px; height: 34px; }
.stage.ring .hole .pcard b, .stage.ring .hole .pcard i { font-size: .72rem; }
.stage.ring .disc { width: 38px; height: 38px; font-size: .95rem; }
.stage.ring .seats { display: block; position: absolute; inset: 0; margin: 0; pointer-events: none; }
.stage.ring .seat { position: absolute; width: 100px; transform: translate(-50%, -50%); background: rgba(10, 42, 48, .88); pointer-events: auto; padding: .4rem .3rem; gap: .15rem; }
.stage.ring .seat.free { min-height: 0; background: transparent; }
@media (min-width: 900px) { .stage.ring .seat { width: 118px; } }

.dock { display: flex; flex-direction: column; }
.my-hole { display: flex; gap: .6rem; justify-content: center; margin: .4rem 0 .8rem; }
.my-hole .pcard { width: 76px; height: 106px; border-radius: 9px; }
.my-hole .pcard b { font-size: 2rem; }
.my-hole .pcard i { font-size: 1.9rem; }
.my-hole.out { opacity: .45; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .6rem 0; }
.actions .btn { flex: 1 1 110px; }
.croupier-seats { display: flex; flex-direction: column; gap: .6rem; margin: .8rem 0; }
.c-row { padding: .7rem .8rem; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--line); }
.c-row.out { opacity: .6; }
.c-head { display: flex; flex-direction: column; gap: .15rem; }
.c-mini, .c-win .hn { display: none; }
.c-who { display: flex; align-items: center; gap: .5rem; }
.proposal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .5rem; padding: .5rem .7rem; border-radius: 10px; background: rgba(217, 164, 65, .16); border: 1px solid rgba(217, 164, 65, .45); }
.proposal-actions { display: flex; gap: .4rem; }
.log { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; font-size: .9rem; }
.log li { padding: .35rem 0; border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; }

@media (min-width: 900px) {
  .room { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); align-items: start; padding-top: 1.6rem; }
  .dock { position: sticky; top: 76px; max-height: calc(100dvh - 90px); overflow-y: auto; }
}
@media (min-width: 620px) and (max-width: 899px) {
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Notifications ---------- */
.bell { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ivoire); border: 1px solid var(--line); text-decoration: none; }
.bell:hover { border-color: var(--craie); }
.bell-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--argile); color: #fff; font: 700 .75rem/20px var(--sans); text-align: center; }
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.notif a { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem; border-radius: var(--r); background: rgba(18, 65, 74, .6); border: 1px solid var(--line); color: var(--ivoire); text-decoration: none; }
.notif.unread a { border-color: var(--laiton); background: rgba(217, 164, 65, .12); }
.notif.unread strong::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: .5rem; border-radius: 50%; background: var(--laiton); }
textarea { resize: vertical; min-height: 88px; }
input[type=radio] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--laiton); }
.panel-head { flex-wrap: wrap; }
.panel-head > span { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
@media (max-width: 719px) { .grid td > div { text-align: right; } }

/* ---------- Code d'accès ---------- */
.access-box { text-align: center; }
.code-big { font: 700 clamp(2rem, 9vw, 3.2rem) var(--serif); letter-spacing: .12em; color: var(--laiton-2); margin: .2rem 0 1rem; word-break: break-all; }
.access-box .row-form { justify-content: center; }
#gate-code { text-transform: uppercase; letter-spacing: .12em; font-size: 1.2rem; text-align: center; }

/* ---------- Réglages téléphone ---------- */
.menu summary #user-name { max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 559px) {
  .topbar { gap: .5rem; }
  .menu summary .role-tag { display: none; }
  .wallet { padding: .35rem .7rem; }
  .page { padding-top: 1rem; }
}
@media (max-width: 379px) {
  .wm-text { display: none; }
}
/* joueurs autour de la table : trois par ligne, compacts (grille sous la table, hors mode ovale) */
.stage:not(.ring) .seats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin-top: .7rem; }
.stage:not(.ring) .seat { padding: .45rem .2rem .4rem; gap: .12rem; border-radius: 12px; }
.stage:not(.ring) .seat.free { min-height: 0; padding: .6rem .2rem; }
.stage:not(.ring) .free-ring { width: 24px; height: 24px; }
.stage:not(.ring) .hole { min-height: 0; }
.stage:not(.ring) .hole .pcard { width: clamp(15px, 6vw, 28px); height: auto; aspect-ratio: 5 / 7; border-width: 2px; border-radius: 4px; }
.stage:not(.ring) .hole.five .pcard { width: clamp(12px, 3.6vw, 20px); }
.stage:not(.ring) .hole .pcard b, .stage:not(.ring) .hole .pcard i { font-size: clamp(.55rem, 2.4vw, .85rem); }
.stage:not(.ring) .disc { width: 34px; height: 34px; font-size: .9rem; }
.stage:not(.ring) .dealer { width: 18px; height: 18px; font-size: .65rem; right: -8px; top: -4px; }
.stage:not(.ring) .plate .nm { font-size: .82rem; }
.stage:not(.ring) .plate .sk { font-size: .85rem; }
.stage:not(.ring) .state { font-size: .68rem; }
.stage:not(.ring) .bet { font-size: .72rem; padding: 0 .45rem; }
.stage:not(.ring) .seat.free .nm { font-size: .8rem; }
/* panneau croupier plus dense */
.croupier h2 { margin-bottom: .3rem; }
.croupier details.help { margin: .2rem 0 .6rem; color: var(--craie); }
.croupier details.help summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; color: var(--laiton-2); }
.c-row { padding: .55rem .65rem; }
.c-head .muted { font-size: .85rem; }
.c-row .check { min-height: 40px; }
.pending-gap { margin-top: .8rem; }
#pending-slot { margin-top: .8rem; }
.stage:not(.ring) .seat.mine .hole { display: none; }
@media (max-width: 559px) {
  .panel .row-form:not(.tight) > .btn { flex: 1 1 100%; }
  .actions .btn { min-height: 48px; }
}

/* ---------- Table en paysage sur téléphone : tout sur un seul écran, sans défilement ---------- */
.rotate-hint { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .6rem max(16px, env(safe-area-inset-left)); background: rgba(217, 164, 65, .16); border-bottom: 1px solid rgba(217, 164, 65, .45); font-size: .92rem; }
.rotate-hint span { flex: 1 1 220px; }
body.tight { overflow: hidden; height: 100dvh; }
body.tight .topbar { height: 46px; padding-top: 0; padding-bottom: 0; }
body.tight .back { min-height: 40px; }
body.tight .table-title .muted { display: none; }
body.tight .table-title h1 { font-size: 1rem; }
body.tight .wallet { min-height: 36px; padding: .15rem .7rem; }
body.tight .room { grid-template-columns: minmax(0, 1fr) clamp(250px, 38vw, 380px); height: calc(100dvh - 46px); padding: 4px max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left)); gap: 8px; max-width: none; overflow: hidden; align-items: stretch; }
body.tight .stage, body.tight .stage.ring { height: 100%; margin: 0; padding: 36px 0; }
body.tight .rail { aspect-ratio: auto; height: 100%; padding: 6px; box-shadow: inset 0 2px 4px rgba(255,255,255,.18), 0 6px 14px rgba(0,0,0,.5); }
body.tight .felt { gap: .12rem; padding: 0 6%; }
body.tight .pot { font-size: .8rem; }
body.tight .pot strong { font-size: 1.15rem; }
body.tight .board .pcard { width: clamp(26px, 5vw, 38px); height: clamp(36px, 7vw, 53px); }
body.tight .board .pcard b, body.tight .board .pcard i { font-size: clamp(.75rem, 1.8vw, 1rem); }
body.tight .phase, body.tight .last { font-size: .7rem; min-height: 0; }
body.tight .stage.ring .seat { width: var(--sw, 78px); padding: .2rem .1rem; gap: .04rem; border-radius: 10px; }
body.tight .stage.ring .seat.free { width: 44px; padding: .15rem; }
body.tight .seat.free .nm { display: none; }
body.tight .free-ring { width: 20px; height: 20px; }
body.tight .stage.ring .disc { width: 28px; height: 28px; font-size: .8rem; }
body.tight .dealer { width: 16px; height: 16px; font-size: .58rem; right: -7px; top: -4px; }
body.tight .plate .nm { font-size: .68rem; }
body.tight .plate .sk { font-size: .72rem; }
body.tight .bet { font-size: .62rem; padding: 0 .35rem; }
body.tight .state { font-size: .58rem; line-height: 1.1; }
body.tight .stage.ring .hole { min-height: 0; }
body.tight .stage.ring .hole .pcard { width: 14px; height: 20px; }
body.tight .stage.ring .hole.five .pcard { width: 12px; height: 17px; }
body.tight .stage.ring .hole .pcard b, body.tight .stage.ring .hole .pcard i { font-size: .5rem; }
body.tight .dock { position: static; height: 100%; max-height: none; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
body.tight .panel { padding: .55rem .7rem; margin-bottom: .45rem; box-shadow: none; }
body.tight .panel h2 { font-size: 1rem; margin: 0 0 .35rem; }
body.tight .hint, body.tight #log-panel { display: none; }
body.tight .my-hole { margin: .1rem 0 .4rem; gap: .3rem; }
body.tight .my-hole .pcard, body.tight .my-hole.five .pcard { width: clamp(34px, 6.4vw, 54px); height: auto; aspect-ratio: 5 / 7; border-radius: 6px; }
body.tight .my-hole .pcard b, body.tight .my-hole.five .pcard b { font-size: clamp(1rem, 2.6vw, 1.5rem); }
body.tight .my-hole .pcard i, body.tight .my-hole.five .pcard i { font-size: clamp(1rem, 2.6vw, 1.4rem); }
body.tight .actions { margin: .3rem 0; gap: .4rem; }
body.tight .actions .btn { flex: 1 1 70px; min-height: 40px; padding: .3rem .5rem; font-size: .92rem; }
body.tight .field { font-size: .78rem; }
body.tight input, body.tight select { min-height: 40px; padding: .35rem .6rem; }
body.tight .row-form { gap: .5rem; }
body.tight .panel .row-form:not(.tight) > .btn { flex: 1 1 auto; }
body.tight .croupier details.help { display: none; }
body.tight .c-row { padding: .45rem .55rem; }
body.tight .toast { bottom: 8px; }
body.tight .seat .state:not(.win) { display: none; }
body.tight .raise-row { flex-wrap: nowrap; align-items: flex-end; }
body.tight .raise-row .field { flex: 1 1 80px; }
body.tight .raise-row .btn { flex: 0 0 auto !important; white-space: nowrap; }
body.tight .actions .btn { white-space: nowrap; padding: .3rem .3rem; font-size: .85rem; }
body.tight .my-hole .pcard, body.tight .my-hole.five .pcard { width: clamp(30px, 5.6vw, 46px); }
body.tight .notice { font-size: .82rem; padding: .35rem .55rem; margin: .3rem 0; }
body.tight .btn-link { min-height: 30px; padding: .2rem 0; font-size: .85rem; }

/* panneau croupier en paysage : une ligne par joueur, détails dépliables, boutons clés toujours visibles */
body.tight .c-detail { display: none; }
body.tight .c-mini { display: inline; color: var(--craie); font-size: .78rem; }
body.tight .c-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; cursor: pointer; min-height: 36px; }
body.tight .c-who { flex: 1 1 auto; }
body.tight .c-win { margin-left: auto; min-height: 36px; font-size: .85rem; }
body.tight .c-win .hn { display: inline; }
body.tight .c-row { padding: .1rem .55rem; }
body.tight .c-body { display: none; padding-bottom: .4rem; }
body.tight .c-row.open .c-body, body.tight .c-row.has-proposal .c-body { display: block; }
body.tight .c-row.has-proposal { border-color: rgba(217, 164, 65, .6); }
body.tight .croupier-seats { gap: .35rem; margin: .4rem 0; }
body.tight .c-top { position: sticky; top: -1px; z-index: 5; background: #12414a; padding: .3rem 0; margin: 0 0 .2rem; }
body.tight .c-award { position: sticky; bottom: -1px; z-index: 5; background: #0f3a42; padding: .4rem 0 .1rem; border-top: 1px solid var(--line); }
body.tight .c-note { display: none; }
body.tight .c-award .btn { margin-bottom: .3rem; min-height: 38px; }
body.tight .proposal { margin-top: .2rem; padding: .35rem .5rem; font-size: .88rem; }
body.tight .c-award { display: flex; gap: .4rem; }
body.tight .c-award .btn { flex: 1 1 0; margin: 0 0 .2rem; font-size: .78rem; line-height: 1.15; padding: .25rem .4rem; min-height: 40px; }

/* Fil d'événements en direct : arrivées, départs, mises, cartes... */
.live { position: fixed; left: 50%; top: calc(56px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 6px; align-items: center; width: min(92vw, 420px); pointer-events: none; }
.live .ev { background: rgba(10,42,48,.94); color: var(--ivoire); border: 1px solid var(--laiton); border-radius: 999px; padding: .4rem .9rem; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow); animation: evIn .25s ease-out; text-align: center; }
.live .ev.out { opacity: 0; transition: opacity .4s; }
@keyframes evIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
body.tight .live { top: 44px; }
body.tight .live .ev { font-size: .8rem; padding: .25rem .7rem; }
@media (prefers-reduced-motion: reduce) { .live .ev { animation: none; } }

/* ---------- Discussion et vocal de table (discrets : fermés par défaut, jamais sur la table) ---------- */
.talk-btns { display: inline-flex; gap: .35rem; }
.tbtn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ivoire); display: inline-grid; place-items: center; cursor: pointer; }
.tbtn:hover, .tbtn[aria-expanded="true"] { background: rgba(255,255,255,.08); }
.tbtn.on { border-color: #5fd08a; color: #8be6ac; }
.tbtn.on.muted { border-color: var(--argile); color: #ffb4a3; }
.tbtn .badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--argile); color: #fff; font-size: .7rem; line-height: 17px; text-align: center; font-weight: 700; }
.tbtn .badge.dot { background: #3fae6a; }
.talk-panel { position: fixed; right: max(8px, env(safe-area-inset-right)); top: calc(62px + env(safe-area-inset-top)); z-index: 80; width: min(320px, calc(100vw - 16px)); max-height: min(380px, calc(100dvh - 76px)); display: flex; flex-direction: column; background: rgba(10,42,48,.97); border: 1px solid var(--laiton); border-radius: 14px; box-shadow: var(--shadow); padding: .6rem; gap: .5rem; }
.talk-panel[hidden] { display: none; }
.chat-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 90px; display: flex; flex-direction: column; gap: .35rem; overscroll-behavior: contain; }
.chat-list li { max-width: 88%; padding: .35rem .6rem; border-radius: 12px; background: rgba(255,255,255,.07); font-size: .92rem; word-break: break-word; align-self: flex-start; }
.chat-list li.me { align-self: flex-end; background: rgba(217,164,65,.22); }
.chat-list li b { display: block; font-size: .75rem; color: var(--laiton-2); font-weight: 600; }
.chat-list li.sys { align-self: center; background: none; color: var(--craie, #9fb3b3); font-size: .8rem; }
.chat-form { display: flex; gap: .4rem; }
.chat-form input { flex: 1; min-width: 0; min-height: 40px; }
.voice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.voice-list li { display: flex; align-items: center; gap: .5rem; font-size: .92rem; }
.voice-list li i { width: 9px; height: 9px; border-radius: 50%; background: #3fae6a; flex: none; }
.voice-list li.muted i { background: var(--argile); }
.voice-list li.muted span::after { content: " (micro coupé)"; color: #ffb4a3; font-size: .78rem; }
.voice-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.voice-actions .btn { flex: 1; }
body.tight .talk-panel { top: 50px; max-height: calc(100dvh - 58px); width: min(300px, 46vw); }
body.tight .tbtn { width: 34px; height: 34px; }
@media (max-width: 559px) { .talk-btns { gap: .25rem; } .tbtn { width: 36px; height: 36px; } }
