:root {
  --sea: #b9dcd9;
  --sea-deep: #8cc3c0;
  --panel: #f6fbfa;
  --panel-2: #e6f1ef;
  --ink: #15323a;
  --ink-soft: #4d6a70;
  --line: #c9dcda;
  --sun: #ffc93c;
  --sun-ink: #2b2100;
  --danger: #c8323b;
  --shadow: 0 6px 18px rgba(10, 45, 55, .18);
  --r-lg: 18px;
  --r-sm: 10px;
  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sea: #0f3b47; --sea-deep: #0a2c35; --panel: #16353e; --panel-2: #1d434d;
    --ink: #e4f1ef; --ink-soft: #9fbcbf; --line: #2a525c; --shadow: 0 6px 18px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sea: #0f3b47; --sea-deep: #0a2c35; --panel: #16353e; --panel-2: #1d434d;
  --ink: #e4f1ef; --ink-soft: #9fbcbf; --line: #2a525c; --shadow: 0 6px 18px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  background: radial-gradient(120% 80% at 50% 40%, var(--sea) 0%, var(--sea-deep) 100%) fixed;
  background-color: var(--sea);
  color: var(--ink);
  font: 15px/1.45 var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
#app { height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }

/* ---------- Màn hình chính ---------- */
.home { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 22px; gap: 18px; }
.logo { font: 800 56px/0.9 var(--font-display); letter-spacing: -1px; margin: 0; }
.logo span { display: block; font-size: 20px; font-weight: 500; letter-spacing: 0; color: var(--ink-soft); margin-top: 10px; font-family: var(--font-body); line-height: 1.4; }
.isle { width: 132px; height: 120px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.input { background: var(--panel); border: 2px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; width: 100%; min-width: 0; }
.input:focus { border-color: var(--sun); outline: none; }
.row { display: flex; gap: 8px; align-items: center; }
.btn { padding: 12px 18px; border-radius: 999px; font-weight: 600; background: var(--panel); border: 2px solid var(--line); white-space: nowrap; min-height: 46px; }
.btn.primary { background: var(--sun); color: var(--sun-ink); border-color: transparent; box-shadow: 0 3px 0 #c99a17; font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #c99a17; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.hint { color: var(--ink-soft); font-size: 13px; margin: 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Sảnh chờ ---------- */
.lobby { flex: 1; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.code { font: 800 48px/1 var(--font-display); letter-spacing: 6px; }
.seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seat { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: var(--r-sm); padding: 10px 12px; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }
.seat .name { flex: 1; font-weight: 600; }
.seat .tag { font-size: 12px; color: var(--ink-soft); }
.seat.empty { background: transparent; border: 2px dashed var(--line); color: var(--ink-soft); }

/* ---------- Trong ván ---------- */
.game { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.players { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; padding: 8px 8px 0; }
.pl { background: var(--panel); border-radius: var(--r-sm); padding: 6px 26px 6px 8px; position: relative; border: 2px solid transparent; min-width: 0; }
.pl.active { border-color: var(--pc); box-shadow: var(--shadow); }
.pl .nm { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .stats { display: flex; flex-wrap: wrap; gap: 2px 6px; min-height: 17px; font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.pl .vp { font: 800 20px/1 var(--font-display); color: var(--ink); position: absolute; right: 8px; bottom: 6px; }
.pl .off { opacity: .5; }
.badges { font-size: 13px; }
.status { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px 0; min-height: 40px; }
.status .msg { font-weight: 600; font-size: 14px; }
.status .timer { font: 700 15px var(--font-display); color: var(--ink-soft); }
.dice { display: flex; gap: 4px; }
.die { width: 30px; height: 30px; border-radius: 7px; background: #fffdf6; color: #222; display: grid; place-items: center; font: 800 18px var(--font-display); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.die.roll { animation: tumble .5s ease-out; }
@keyframes tumble { from { transform: rotate(-200deg) scale(.6); } to { transform: none; } }
.boardwrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: none; overflow: hidden; position: relative; }
svg.board { width: 100%; height: 100%; max-height: 100%; user-select: none; }
.hex { stroke: rgba(30, 40, 30, .35); stroke-width: 2; }
.tgt { cursor: pointer; }
.tgt-v { fill: var(--sun); stroke: #fff; stroke-width: 3; animation: pulse 1.1s ease-in-out infinite; }
.tgt-e { stroke: var(--sun); stroke-width: 10; stroke-linecap: round; opacity: .85; animation: pulse 1.1s ease-in-out infinite; }
.tgt-h { fill: rgba(255, 255, 255, .28); stroke: #fff; stroke-width: 5; stroke-dasharray: 10 6; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .tgt-v, .tgt-e, .tgt-h, .die.roll { animation: none; } }
.zoom { position: absolute; left: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 38px; height: 38px; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow); font: 700 20px var(--font-display); }

.tray { background: var(--panel); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -4px 18px rgba(10, 45, 55, .15); padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.hand { display: flex; gap: 6px; }
.card { flex: 1; border-radius: var(--r-sm); padding: 6px 0 4px; text-align: center; color: #fff; position: relative; min-width: 0; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.card .ic { font-size: 20px; line-height: 1; }
.card .ct { font: 800 20px/1.1 var(--font-display); }
.card .lb { font-size: 11px; opacity: .95; }
.card.zero { opacity: .38; }
.card.devc { background: #6b4fa0; }
.actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6px; }
.act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: var(--panel-2); font-size: 12px; font-weight: 600; min-height: 56px; }
.act .ic { font-size: 20px; line-height: 1; }
.act.primary { background: var(--sun); color: var(--sun-ink); font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.act:disabled { opacity: .4; }

/* ---------- Bảng trượt ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 25, 30, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--panel); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); max-height: 82vh; overflow: auto; }
.sheet.anim { animation: up .2s ease-out; }
@media (prefers-reduced-motion: reduce) { .sheet.anim { animation: none; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { font: 700 22px/1.2 var(--font-display); margin: 0 0 4px; }
.sheet .sub { color: var(--ink-soft); font-size: 13px; margin: 0 0 14px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: var(--r-sm); background: var(--panel-2); margin-bottom: 8px; text-align: left; }
.opt .big { font-size: 24px; }
.opt .t { flex: 1; }
.opt .t b { display: block; font-size: 15px; }
.opt .t small { color: var(--ink-soft); font-size: 12px; }
.opt:disabled { opacity: .45; }
.cost { display: inline-flex; gap: 2px; font-size: 13px; }
.pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.pick button { border-radius: var(--r-sm); padding: 8px 0; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); position: relative; border: 3px solid transparent; }
.pick button.on { border-color: var(--ink); }
.pick button:disabled { opacity: .35; }
.pick .n { font: 800 18px var(--font-display); display: block; }
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.stepper .col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stepper .chip { width: 100%; border-radius: var(--r-sm); text-align: center; color: #fff; padding: 6px 0; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.stepper .chip b { font: 800 18px var(--font-display); display: block; }
.stepper .pm { display: flex; gap: 4px; }
.stepper .pm button { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); font-weight: 700; }
.seg { display: flex; background: var(--panel-2); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 8px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--panel); box-shadow: var(--shadow); }
.label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 4px 0 6px; }
.log { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.log li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 40; box-shadow: var(--shadow); max-width: 90vw; text-align: center; }
.offer { background: var(--panel); margin: 0 8px; border-radius: var(--r-sm); padding: 10px 12px; box-shadow: var(--shadow); font-size: 14px; }
.offer .row { margin-top: 8px; }
.win { text-align: center; }
.win .trophy { font-size: 64px; }
.rank { list-style: none; padding: 0; margin: 12px 0; text-align: left; }
.rank li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank li b { margin-left: auto; font: 800 20px var(--font-display); }

/* ---------- Chat + video call ---------- */
#social[hidden], #social [hidden] { display: none !important; }
.soc-dock { position: fixed; right: 8px; bottom: var(--dock-b, 16px); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 15; }
.soc-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--panel); color: var(--ink); font-size: 20px; box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.soc-btn.off { background: var(--panel-2); opacity: .8; }
.soc-btn.end { background: var(--danger); transform: rotate(135deg); }
.soc-btn.ring { animation: socRing 1.2s ease-in-out infinite; background: var(--sun); }
@keyframes socRing { 50% { transform: scale(1.12); } }
.soc-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 11px/18px var(--font-body); font-style: normal; }
.soc-tiles { position: fixed; left: 8px; top: calc(136px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 6px; z-index: 15; }
.soc-tile { position: relative; width: 74px; height: 98px; border-radius: 12px; overflow: hidden; background: #0b252c; border: 2px solid var(--c); box-shadow: var(--shadow); cursor: pointer; }
.soc-tile.docked { position: fixed; border-radius: 50%; border-width: 2px; box-shadow: 0 0 0 2px var(--panel); }
.soc-tile.docked .soc-name { display: none; }
.soc-tile.docked .soc-av { font-size: 15px; }
.soc-tile.docked .soc-mute { top: auto; bottom: -2px; right: -2px; font-size: 10px; }
.soc-tile.big { position: fixed !important; left: 50% !important; top: 42% !important; width: min(78vw, 340px) !important; height: min(104vw, 450px) !important; transform: translate(-50%, -50%); border-radius: 18px !important; z-index: 35; border-width: 3px; }
.soc-tile.big .soc-name { display: block; font-size: 14px; padding: 6px 10px; }
.soc-tile.big .soc-av { font-size: 64px; }
.soc-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-tile video.me { transform: scaleX(-1); }
.soc-av { position: absolute; inset: 0; display: none; place-items: center; font: 800 30px/1 var(--font-display); color: #fff; background: var(--c); }
.soc-tile.nocam .soc-av { display: grid; }
.soc-tile.nocam video { visibility: hidden; }
.soc-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-mute { position: absolute; top: 3px; right: 4px; font-size: 13px; }
.soc-bubble { position: fixed; right: 8px; bottom: calc(var(--dock-b, 16px) + 50px); max-width: min(64vw, 280px); background: var(--panel); color: var(--ink); padding: 8px 12px; border-radius: 14px 14px 4px 14px; box-shadow: var(--shadow); font-size: 14px; z-index: 16; cursor: pointer; }
.soc-chat { position: fixed; right: 8px; left: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); max-width: 380px; margin-left: auto; height: min(60vh, 460px); background: var(--panel); color: var(--ink); border-radius: 18px; box-shadow: var(--shadow); z-index: 30; display: flex; flex-direction: column; overflow: hidden; }
.soc-chat header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); font: 700 17px var(--font-display); }
.soc-x { border: 0; background: none; color: var(--ink-soft); font-size: 18px; width: 36px; height: 36px; cursor: pointer; }
.soc-msgs { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.soc-msgs li { align-self: flex-start; max-width: 82%; background: var(--panel-2); padding: 6px 10px; border-radius: 12px 12px 12px 4px; font-size: 14px; overflow-wrap: anywhere; }
.soc-msgs li.mine { align-self: flex-end; background: var(--sun); color: var(--sun-ink); border-radius: 12px 12px 4px 12px; }
.soc-msgs b { display: block; font-size: 12px; }
.soc-msgs time { display: block; font-size: 10px; opacity: .6; text-align: right; }
.soc-quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px; border-top: 1px solid var(--line); }
.soc-quick button { flex: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 999px; padding: 5px 10px; font: 500 13px var(--font-body); cursor: pointer; }
.soc-form { display: flex; gap: 6px; padding: 8px 10px 10px; }
.soc-form input { flex: 1; min-width: 0; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 0 14px; font: 15px var(--font-body); }
.soc-form button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--sun); color: var(--sun-ink); font-size: 16px; cursor: pointer; }

/* ---------- ô video / ảnh đại diện trên thẻ người chơi ---------- */
.vslot { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--c); color: #fff; font: 800 16px/1 var(--font-display); box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }
.vslot.live { visibility: hidden; }
/* thẻ người chơi gọn, luôn 1 hàng ngang để bàn cờ rộng hơn */
.players { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 5px; padding: 6px 6px 0; }
.pl { padding: 5px 6px 4px; min-height: 0; }
.pl .vslot { position: relative; width: 32px; height: 32px; font-size: 15px; }
.pl .vp { top: 6px; bottom: auto; right: 7px; font-size: 20px; }
.pl .badges { position: absolute; right: 5px; top: 28px; min-height: 0; margin: 0; gap: 0; font-size: 11px; }
.pl .nm { display: block; font-size: 12px; margin-top: 3px; }
.pl .stats { flex-wrap: nowrap; gap: 0 5px; min-height: 0; font-size: 11px; margin-top: 1px; overflow: hidden; white-space: nowrap; }
.players.many .pl { padding: 4px 4px 3px; }
.players.many .pl .vslot { width: 26px; height: 26px; font-size: 12px; }
.players.many .pl .vp { font-size: 16px; right: 5px; top: 5px; }
.players.many .pl .badges { top: 22px; right: 3px; font-size: 9px; }
.players.many .pl .nm { font-size: 10.5px; }
.players.many .pl .stats { font-size: 9.5px; gap: 0 3px; letter-spacing: -.2px; }
.seat .vslot { width: 36px; height: 36px; }
.bigtog { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; border: 2px solid var(--line); }
.bigtog input { width: 22px; height: 22px; accent-color: var(--sun); flex: none; }
.bigtog span { display: flex; flex-direction: column; }
.bigtog small { color: var(--ink-soft); font-size: 12px; }
.btn.gear { align-self: center; }
.status .timer.low { color: var(--danger); animation: socRing 1s ease-in-out infinite; }

/* ---------- hiệu ứng nhận tài nguyên ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 25; overflow: hidden; }
.fx-ring { position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; border: 4px solid var(--sun); box-shadow: 0 0 24px var(--sun), inset 0 0 18px var(--sun); animation: fxRing 1.1s ease-out forwards; }
@keyframes fxRing { 0% { transform: scale(.4); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
.fx-fly { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; display: grid; place-items: center; font-size: 26px; background: rgba(255,255,255,.92); border-radius: 50%; box-shadow: 0 4px 14px rgba(0,0,0,.3); transition: transform .65s cubic-bezier(.5,-0.3,.6,1), opacity .65s ease-in; animation: fxPop .25s ease-out; }
@keyframes fxPop { from { transform: scale(0); } to { transform: scale(1); } }
.fx-plus { position: absolute; transform: translate(-50%, -50%); font: 800 18px/1 var(--font-display); color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.6); animation: fxUp 1s ease-out forwards; white-space: nowrap; }
@keyframes fxUp { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -36px; } }
.fx-bump { animation: fxBump .45s ease-out; }
@keyframes fxBump { 30% { transform: scale(1.18); box-shadow: 0 0 0 3px var(--sun), 0 0 18px var(--sun); } }
@media (prefers-reduced-motion: reduce) { .fx-fly { transition-duration: .01s; } .fx-ring, .fx-plus, .fx-bump { animation-duration: .01s; } }

/* ---------- bảng cài đặt âm thanh ---------- */
.set-scrim { position: fixed; inset: 0; background: rgba(5,25,30,.5); z-index: 45; display: flex; align-items: center; justify-content: center; padding: 16px; }
.set-scrim[hidden] { display: none; }
.set-box { background: var(--panel); color: var(--ink); width: 100%; max-width: 400px; border-radius: 20px; padding: 6px 16px 16px; box-shadow: var(--shadow); }
.set-box header { display: flex; align-items: center; justify-content: space-between; font: 700 22px var(--font-display); padding: 6px 0; }
.set-x { border: 0; background: none; color: var(--ink-soft); font-size: 20px; width: 40px; height: 40px; cursor: pointer; }
.set-row { display: grid; grid-template-columns: 28px 1fr 2fr 34px; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.set-row.tog { grid-template-columns: 28px 1fr auto; }
.set-row.tog input { width: 22px; height: 22px; accent-color: var(--sun); }
.set-ic { font-size: 18px; text-align: center; }
.set-row input[type=range] { width: 100%; accent-color: var(--sun); }
.set-row output { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.set-test { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.set-note { color: var(--ink-soft); font-size: 12px; margin: 10px 0 0; }
@media (max-width: 360px) { .set-row { grid-template-columns: 24px 1fr 34px; } .set-row .set-n { grid-column: 2 / 4; } .set-row input[type=range] { grid-column: 1 / 3; } }

.soc-btn.ctl.open { background: var(--sun); color: var(--sun-ink); font-size: 18px; }
.soc-btn.ctl .soc-badge { font-size: 9px; background: var(--panel-2); }

/* ---------- thông báo bản mới ---------- */
.upd { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--panel); padding: 8px 8px 8px 16px; border-radius: 999px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; white-space: nowrap; max-width: calc(100vw - 32px); }

/* ---------- hàng nút nổi + giữ để nói ---------- */
.soc-row { display: flex; gap: 6px; }
.soc-btn.ptt { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.soc-btn.ptt.rec { background: var(--danger); transform: scale(1.18); box-shadow: 0 0 0 6px rgba(200,50,59,.25); }
.soc-rec { position: fixed; right: 8px; bottom: calc(var(--dock-b, 16px) + 52px); background: var(--danger); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; z-index: 16; box-shadow: var(--shadow); max-width: calc(100vw - 16px); }
.soc-vplay { border: 0; background: rgba(0,0,0,.08); color: inherit; border-radius: 999px; padding: 4px 12px; font: 600 14px var(--font-body); cursor: pointer; }
.talking { box-shadow: 0 0 0 3px var(--sun), 0 0 14px var(--sun) !important; animation: socRing .9s ease-in-out infinite; }
.lobby { padding-bottom: 76px; }

.autostart{text-align:center;margin:6px 0;padding:8px 10px;border-radius:12px;background:rgba(255,200,80,.18);font-weight:700}
.autostart b{font-size:1.2em}
.home .back { color: var(--ink-soft); font-size: 14px; text-decoration: none; align-self: flex-start; }

/* Hàng người chơi + trạng thái: cho rộng/cao đủ để không bị cắt (đông người, chữ hệ thống to) */
.players { padding: 6px 4px 0; gap: 4px; }
.pl { overflow: visible; }
.pl .stats { flex-wrap: wrap; white-space: normal; overflow: visible; row-gap: 0; }
.pl .badges { position: static; display: flex; gap: 2px; margin-top: 1px; font-size: 12px; min-height: 0; }
.pl .badges:empty { display: none; }
.players.many .pl { padding: 4px 3px 4px 4px; }
.players.many .pl .stats { flex-wrap: wrap; font-size: 10px; gap: 0 3px; }
.players.many .pl .badges { position: static; font-size: 11px; }
.players.many .pl .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { position: relative; z-index: 3; padding: 6px 10px 6px; flex-wrap: wrap; row-gap: 4px; }
.status .msg { flex: 1 1 140px; min-width: 0; line-height: 1.25; }
.status .row { flex: none; gap: 4px; align-items: center; }
.status .row .btn.small { min-height: 34px; padding: 4px 10px; }
