/* Sảnh game ở trang chủ: nền gỗ tối, khung đồng, biểu tượng vàng. Toàn bộ hình vẽ bằng CSS/SVG, không dùng ảnh ngoài. */
body.page-home,body.pl-on{--bg:#0d0905;--panel:#1d150e;--text:#f4e8cb;--muted:#bfae88;--bd:#43321f;--accent:#c8321f;--wood:#d8b06a;
  background:#0d0905 radial-gradient(120% 55% at 50% 0,#3d2c1c 0,#1a110a 48%,#0d0905 78%) no-repeat;padding-bottom:84px}
body.pl-on{padding-bottom:168px}
body.page-home header,body.pl-on header{background:linear-gradient(#241a10,#120c07);border-bottom:2px solid #5d4527}
body.page-home .btn,body.pl-on .btn{background:#2a2016;border-color:#5d4527}
body.page-home .btn.main,body.pl-on .btn.main{background:var(--accent);border-color:#e0502f}
body.lb-lock{overflow:hidden}

.lobby{max-width:560px;margin:0 auto;padding:14px 14px 10px}
.lobby a{color:inherit;text-decoration:none}

/* Thẻ người chơi */
.lb-top{display:flex;align-items:flex-start;gap:6px;position:relative}
.lb-ava{flex:none;width:96px;height:96px;border-radius:50%;padding:5px;z-index:2;background:linear-gradient(145deg,#f6dc8a,#8f5d12 55%,#e8b53a);box-shadow:0 5px 12px #000b,inset 0 0 0 2px #3a2610}
.lb-ava img{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover;background:#2a1b0d;border:3px solid #2a1b0d}
.lb-card{position:relative;flex:1;min-width:0;margin:8px 0 0 -14px;padding:8px 50px 10px 22px;border-radius:14px;background:linear-gradient(#2c1f13,#150e08);
  border:2px solid #6a5233;box-shadow:inset 0 0 0 1px #000,inset 0 0 0 3px #2b1e11,0 5px 12px #000b;display:grid;gap:4px}
.lb-bell{position:absolute;top:50%;width:40px;height:40px;margin-top:-20px;border-radius:50%;display:grid;place-items:center;
  background:radial-gradient(circle at 35% 30%,#5a4630,#241a10);border:2px solid #8a6a3a;box-shadow:0 2px 6px #000a}
.lb-bell{right:6px}
.lb-dot{position:absolute;top:2px;right:2px;width:12px;height:12px;border-radius:50%;background:#ff3b30;border:2px solid #1b120a}
.lb-name{font-weight:800;font-size:clamp(18px,5vw,24px);line-height:1.2;color:#ffe9a8;text-shadow:0 2px 3px #000;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lb-stats{display:flex;gap:6px 14px;justify-content:center;flex-wrap:wrap}
.lb-stat{display:inline-flex;align-items:center;gap:6px;font-weight:800;font-size:clamp(15px,4.2vw,19px);color:#f6e7bd;text-shadow:0 1px 2px #000}
.lb-stat small{font-size:12px;font-weight:600;color:var(--muted)}
.lb-piece{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 28%,#f7dfa4,#c9a05a);color:#b3261e;border:2px solid #b3261e;
  font:700 16px/1 "Noto Serif CJK SC","Noto Serif TC","Songti SC","SimSun",serif;text-shadow:none}
.lb-coin{width:26px;height:26px;border-radius:50%;background:radial-gradient(circle at 35% 28%,#fff2b0,#e0a82e 55%,#8f5d12);border:2px solid #6b4310;box-shadow:inset 0 0 0 3px rgba(255,255,255,.18)}
.lb-guest a{padding:6px 16px;border-radius:8px;font-weight:800;background:#3a2d20;border:1px solid #6a5233;color:#f6e7bd}
.lb-guest a.hot{background:var(--accent);border-color:#e0502f;color:#fff}

/* Lưới chức năng */
.lb-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:26px 12px;margin:22px 0 0}
.lb-tiles.lb-tiles4{grid-template-columns:repeat(4,1fr);gap:20px 8px}
.lb-tile{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1/.92;border-radius:10px;
  background:radial-gradient(circle at 50% 38%,#33271b,#120c07);border:2px solid #6a5233;
  box-shadow:inset 0 0 0 2px #0a0603,inset 0 0 0 3px #4b3922,0 6px 10px #000b;-webkit-tap-highlight-color:transparent;transition:transform .12s,box-shadow .12s}
.lb-tile::before{content:"";position:absolute;top:-10px;left:50%;width:48px;height:10px;transform:translateX(-50%);background:linear-gradient(#7a6140,#3a2a18);clip-path:polygon(0 100%,12% 30%,30% 0,70% 0,88% 30%,100% 100%)}
.lb-tile:hover,.lb-tile:focus-visible{box-shadow:inset 0 0 0 2px #0a0603,inset 0 0 0 3px #7a6140,0 0 16px rgba(255,200,80,.35),0 6px 10px #000b}
.lb-tile:active{transform:scale(.96)}
.lb-ico{display:block;width:58%;margin-top:-8%;filter:drop-shadow(0 0 7px rgba(255,205,90,.5)) drop-shadow(0 2px 2px #000)}
.lb-ico svg{display:block;width:100%;height:auto}
.lb-lab{position:absolute;left:3%;right:3%;bottom:-11px;padding:3px 2px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  background:linear-gradient(#52443a,#30271e);border:1px solid #7a6140;border-radius:6px;color:#f4d98a;font-weight:700;font-size:clamp(12px,3.4vw,16px);letter-spacing:-.2px;text-shadow:0 1px 2px #000;box-shadow:0 2px 4px #000a}
.lb-new{position:absolute;top:6px;left:-5px;z-index:1;padding:1px 9px;border-radius:3px;background:linear-gradient(#ff6b4a,#b3261e);color:#fff;font:800 11px/1.5 "Be Vietnam Pro",system-ui,sans-serif;font-style:normal;transform:rotate(-12deg);box-shadow:0 2px 3px #000a}

/* Hai khu chơi */
.lb-modes{position:relative;display:grid;grid-template-columns:1fr 1fr;margin-top:34px;border-radius:14px;overflow:visible;
  background:linear-gradient(#2c2218,#17100a);border:2px solid #6a5233;box-shadow:inset 0 0 0 1px #000,inset 0 0 0 3px #2b1e11,0 -4px 14px #0009}
.lb-modes::before{content:"";position:absolute;top:-12px;left:50%;width:70px;height:12px;transform:translateX(-50%);background:linear-gradient(#7a6140,#3a2a18);clip-path:polygon(0 100%,14% 30%,32% 0,68% 0,86% 30%,100% 100%)}
.lb-mode{display:grid;justify-items:center;align-content:start;gap:12px;padding:16px 8px 22px}
.lb-mode+.lb-mode{border-left:2px solid #4a3822;box-shadow:-1px 0 0 #000}
.lobby h2.lb-plaque{margin:0;padding:8px 22px;border-radius:22px;font-size:clamp(16px,4.6vw,20px);line-height:1;font-weight:700;color:#d8c9a6;background:#3a2e22;border:1px solid #5a432a;box-shadow:inset 0 2px 6px #0009}
.lb-pair{display:grid;grid-template-columns:1fr;justify-items:center;gap:12px;margin-top:10px}
.lb-disc{--d:72px;position:relative;width:var(--d);height:var(--d);border-radius:50%;display:grid;place-items:center;margin-bottom:12px;-webkit-tap-highlight-color:transparent;
  background:radial-gradient(circle at 35% 28%,#f4dba0 0,#c9964d 48%,#7a4d1d 100%);border:3px solid #3a2210;
  box-shadow:inset 0 0 0 3px rgba(255,235,170,.55),inset 0 -7px 10px rgba(80,40,0,.5),0 6px 10px #000b;transition:transform .12s}
.lb-disc:active{transform:scale(.94)}
.lb-disc.big{--d:104px}
.lb-disc .g{font:700 calc(var(--d)*.52)/1 "Noto Serif CJK SC","Noto Serif TC","Songti SC","SimSun",serif;color:#1b1209;text-shadow:0 1px 0 rgba(255,255,255,.35)}
.lb-disc .g.red{color:#b3261e}
.lb-disc .t{position:absolute;bottom:-14px;left:50%;transform:translateX(-50%);white-space:nowrap;font-weight:800;font-size:clamp(13px,3.7vw,16px);color:#fff;text-shadow:0 2px 3px #000,0 0 4px #000}
.lb-disc.up{background:radial-gradient(circle at 35% 28%,#9a7a52 0,#5a3d22 55%,#2b1a0c 100%);border-color:#1d1208}
.lb-disc.up .g{color:#f1d98c;text-shadow:0 2px 3px #000}
.lb-disc.hot{animation:lbglow 2.2s ease-in-out infinite}
@keyframes lbglow{0%,100%{box-shadow:inset 0 0 0 3px rgba(255,235,170,.55),inset 0 -7px 10px rgba(80,40,0,.5),0 6px 10px #000b,0 0 0 0 rgba(255,190,60,.0)}
  50%{box-shadow:inset 0 0 0 3px rgba(255,235,170,.55),inset 0 -7px 10px rgba(80,40,0,.5),0 6px 10px #000b,0 0 22px 4px rgba(255,190,60,.55)}}
@media (prefers-reduced-motion:reduce){.lb-disc.hot{animation:none}.lb-tile,.lb-disc{transition:none}}

/* Thanh dưới */
.lb-bar{position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;align-items:center;gap:12px;max-width:560px;margin:0 auto;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px));background:linear-gradient(#2c2218,#120c07);border-top:2px solid #6a5233;box-shadow:0 -6px 14px #000a}
.lb-sq{flex:none;width:54px;height:54px;border-radius:8px;display:grid;place-items:center;cursor:pointer;padding:0;
  background:linear-gradient(#64533f,#2e241a);border:2px solid #8a6a3a;box-shadow:inset 0 0 0 1px #000,0 3px 6px #000a}
.lb-sq:active{transform:scale(.95)}
.lb-purse{flex:1;min-width:0;height:54px;display:flex;align-items:center;gap:8px;padding:0 5px 0 10px;border-radius:6px;background:#0a0705;border:2px solid #4b3922;box-shadow:inset 0 2px 8px #000}
.lb-purse b{flex:1;text-align:center;font-size:clamp(20px,6vw,26px);color:#ffd35c;text-shadow:0 2px 3px #000}
.lb-bar a{color:inherit;text-decoration:none}
.lb-bar .lb-plus{flex:none;width:42px;height:42px;display:grid;place-items:center;border-radius:6px;background:linear-gradient(#ffe38a,#d9a22a);border:2px solid #6b4310;color:#6b3d00;font-weight:900;font-size:30px;line-height:1}

/* Bảng cài đặt */
.lb-sheet{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-end;justify-content:center;background:rgba(0,0,0,.66)}
.lb-sheet-in{width:min(100%,560px);max-height:82vh;max-height:82dvh;overflow:auto;padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px));background:#1d150e;border:2px solid #6a5233;border-bottom:0;border-radius:16px 16px 0 0}
.lb-sheet-in h3{margin:0 0 10px;font-size:20px;color:#ffe9a8}
#lb-sfx{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.lb-links{list-style:none;margin:0 0 14px;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.lb-links a{display:block;padding:10px 12px;border-radius:8px;background:#2a2016;border:1px solid #5d4527;font-weight:600}

body.page-home nav,body.pl-on nav{min-height:54px}
body.page-home nav ul,body.pl-on nav ul{display:none}
@media (min-width:701px){
  .lobby{padding-top:26px}
}

/* ===== Sảnh phòng chơi (trang Phòng chơi) ===== */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
body.pl-on .roomsec{padding:12px 0 0}
.pl{max-width:560px;margin:0 auto}
.pl-tabs{display:grid;grid-template-columns:repeat(3,1fr);border:2px solid #6a5233;border-radius:10px;overflow:hidden;background:#120c07;box-shadow:inset 0 0 0 1px #000,0 4px 10px #000a}
.pl-tab{padding:14px 4px;border:0;border-left:2px solid #2b1e11;background:linear-gradient(#2b2218,#17100a);color:#cbb98f;font:700 clamp(15px,4.2vw,18px) "Be Vietnam Pro",system-ui,sans-serif;cursor:pointer}
.pl-tab:first-child{border-left:0}
.pl-tab.on{background:linear-gradient(#665646,#3d3329);color:#ffe9a8;text-shadow:0 1px 2px #000;box-shadow:inset 0 0 8px #0008}
.pl-me{margin:8px 4px;font-size:14px;color:var(--muted);text-align:center}
.pl-frame{border:2px solid #4b3922;border-radius:10px;background:linear-gradient(#1b140d,#110b06);box-shadow:inset 0 0 0 1px #000,inset 0 0 0 3px #261a0f;padding:14px 8px 18px;min-height:240px}
.pl-grid.rl-list{display:grid;grid-template-columns:1fr 1fr;gap:18px 6px;flex-direction:initial}
.pl-empty{grid-column:1/-1;text-align:center;padding:28px 12px;margin:0}
.pl .rl-room.pl-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 2px 8px;background:transparent;border:0;border-radius:10px;cursor:pointer;min-width:0}
.pl .rl-room.pl-card:hover,.pl .rl-room.pl-card:focus-within{background:rgba(255,200,80,.07)}
.pl-bet{font-weight:800;font-size:clamp(17px,4.8vw,21px);color:#f4d35c;text-shadow:0 2px 3px #000}.pl-bet.free{color:#9fb59a;font-size:15px;font-weight:700}
.pl-lock{position:absolute;top:4px;right:6px;font-size:14px}
.pl-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr) minmax(0,1fr);align-items:center;width:100%;gap:2px}
.pl-seat{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0}
.pl-av{display:block;width:100%;max-width:56px}.pl-av svg{display:block;width:100%;height:auto}
.pl-table{display:block;width:100%}.pl-table svg{display:block;width:100%;height:auto;filter:drop-shadow(0 3px 3px #000a)}
.pl-stars{display:flex;gap:0;justify-content:center;font-style:normal;line-height:1}
.pl-stars i{font-style:normal;font-size:11px;color:#3a2f24}.pl-stars i.on{color:#f4c430;text-shadow:0 1px 1px #000}
.pl-nm{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#cbb98f}
.pl-seat:not(.full) .pl-nm{color:#6b5d4a}
.pl-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;font-size:14px;color:#f0e2c0;padding:0 4px}
.pl-state{font-size:12px;color:var(--muted)}.pl-state.waiting{color:#5fd283;font-weight:700}.pl-state.playing{color:#ff8a6b;font-weight:700}.pl-state.finished{color:#e0b24a;font-weight:700}
.pl-sub{font-size:11px;color:#8f7f60}
.pl-go{margin-top:4px;padding:5px 16px;border-radius:14px;border:1px solid #7a6140;background:linear-gradient(#52443a,#30271e);color:#f4d98a;font:700 13px "Be Vietnam Pro",system-ui,sans-serif;cursor:pointer}
.pl-go.main{background:linear-gradient(#e0502f,#a82e14);border-color:#e0502f;color:#fff}
.pl-switch{display:block;text-align:center;margin:10px 0 0;color:var(--muted);font-size:14px}
.pl-board{margin:18px 0 0;padding:14px;border:1px solid #43321f;border-radius:10px;background:#17100a}
.pl-board h2{font-size:20px;margin:0 0 10px}

/* hai nút dưới */
.pl-dock{position:fixed;left:0;right:0;bottom:calc(76px + env(safe-area-inset-bottom,0px));z-index:19;display:grid;grid-template-columns:1fr 1fr;gap:10px;max-width:560px;margin:0 auto;padding:10px 14px;background:linear-gradient(transparent,rgba(13,9,5,.92) 40%)}
.pl-btn{position:relative;height:56px;border:0;cursor:pointer;color:#5e1a06;font:800 clamp(20px,6vw,26px) "Be Vietnam Pro",system-ui,sans-serif;text-shadow:0 1px 0 rgba(255,255,255,.35);
  clip-path:polygon(8% 0,92% 0,100% 50%,92% 100%,8% 100%,0 50%);background:linear-gradient(#ffe58a,#f0b429 55%,#c98a12);filter:drop-shadow(0 3px 3px #000)}
.pl-btn:active{transform:scale(.97)}.pl-btn:disabled{opacity:.6}

/* bảng tạo bàn */
.pl-sheet{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center;background:rgba(0,0,0,.7)}
.pl-sheet-in{width:min(100%,560px);max-height:88vh;max-height:88dvh;overflow:auto;padding:14px 14px calc(18px + env(safe-area-inset-bottom,0px));background:#1d150e;border:2px solid #6a5233;border-bottom:0;border-radius:16px 16px 0 0}
.pl-sheet-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.pl-sheet-h b{font-size:20px;color:#ffe9a8}
.pl-sheet-body{display:flex;flex-direction:column;gap:14px}
.pl-sheet .mbox{max-width:none;background:#241a10;border:1px solid #4b3922}
.pl-sheet .mbox>h2:first-child{display:none}
.pl-sheet input,.pl-sheet select{background:#120c07;color:var(--text);border-color:#4b3922}

/* ===== Màn hình trong phòng (kiểu game) ===== */
body.rg-on{--bg:#0d0905;--panel:#1d150e;--text:#f4e8cb;--muted:#bfae88;--bd:#43321f;--accent:#c8321f;--wood:#d8b06a;
  background:#0d0905 radial-gradient(120% 50% at 50% 0,#3d2c1c 0,#1a110a 48%,#0d0905 78%) no-repeat;padding-bottom:150px}
body.rg-on header,body.rg-on footer,body.rg-on .notice,body.rg-on .site-footer{display:none}
body.rg-on .btn{background:#2a2016;border-color:#5d4527;color:var(--text)}
body.rg-on .btn.main{background:var(--accent);border-color:#e0502f}
body.rg-on main,body.rg-on .wrap{padding-top:6px}
body.rg-on .rr{display:flex;flex-direction:column;align-items:stretch;gap:6px;max-width:560px;margin:0 auto}
body.rg-on .rr-side{gap:8px}
body.rg-on .rr .rr-player,body.rg-on .rr .rr-title,body.rg-on .rr .rr-chath,body.rg-on .rr .boardtools{display:none}
body.rg-on .rr.full .rr-player{display:flex}
body.rg-on .rr.full .rg-head,body.rg-on .rr.full .rg-eye,body.rg-on .rr.full .rg-river,body.rg-on ~ .rg-bar{display:none}
body.rg-on .rr.full ~ .rg-bar{display:none}
.rg-head{display:grid;grid-template-columns:1fr auto 1fr;align-items:start;gap:4px;padding:8px 6px 0}
.rg-seat{display:flex;flex-direction:column;align-items:center;gap:2px;position:relative;min-width:0}
.rg-av{width:62px;height:62px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(#4a382a,#1b130c);border:3px solid #b8892f;box-shadow:0 0 0 2px #3a2a14,0 3px 8px #000a}
.rg-av svg{width:52px;height:52px}
.rg-seat.red .rg-av{border-color:#d65a3a}.rg-seat.black .rg-av{border-color:#9aa0b8}
.rg-seat.turn .rg-av{box-shadow:0 0 0 2px #3a2a14,0 0 14px 4px #ffd24a;animation:rgpulse 1.2s ease-in-out infinite}
@keyframes rgpulse{50%{box-shadow:0 0 0 2px #3a2a14,0 0 4px 1px #ffd24a}}
.rg-dot{position:absolute;top:2px;left:calc(50% + 20px);width:11px;height:11px;border-radius:50%;background:#6b6256;border:2px solid #1d150e}.rg-dot.on{background:#3ddc6a}
.rg-nm{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;font-size:14px;color:#f4e8cb}
.rg-elo{font-size:11px;color:#e3c466}
.rg-cw{display:flex;align-items:center;gap:4px;margin-top:2px;padding:1px 10px;border-radius:12px;background:#0007;border:1px solid #5d4527}
.rg-clock{font-variant-numeric:tabular-nums;font-weight:800;font-size:17px;color:#fff3cf}.rg-clock.low{color:#ff6a55}
.rg-mid{display:flex;flex-direction:column;align-items:center;gap:4px;padding-top:2px;min-width:104px}
.rg-prize{font-size:12px;font-weight:700;color:#ffd24a;text-shadow:0 1px 2px #000}
.rg-plaque{display:flex;align-items:center;gap:4px;padding:3px 12px 3px 8px;border-radius:14px;background:linear-gradient(#5b1d12,#2f0e08);border:2px solid #d9a63a;color:#ffe9a0;font-size:15px}
.rg-plaque.free{border-color:#6b5a3a;color:#bfae88}
.rg-name{font-size:11px;color:#bfae88;max-width:130px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rg-eye{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:0 10px;font-size:12px;color:#e3c466;min-height:16px}
.rg-capline{color:#bfae88;text-align:right;flex:1}
.rr-board{position:relative}
.rg-river{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:10px;pointer-events:none;padding:0 6%;z-index:3}
.rg-river>*{pointer-events:auto}
.rg-river:empty{display:none}
.rg-gold{min-width:112px;padding:9px 20px;font:700 17px/1.1 system-ui,sans-serif;color:#4a2a05;cursor:pointer;
  background:linear-gradient(#ffe48a,#e3a62e 55%,#b87a14);border:2px solid #5a360a;clip-path:polygon(10% 0,90% 0,100% 50%,90% 100%,10% 100%,0 50%);
  filter:drop-shadow(0 2px 3px #000b);text-shadow:0 1px 0 #fff6c8}
.rg-gold.rg-main{background:linear-gradient(#ff8a63,#d6402a 55%,#9c2415);color:#fff4d6;text-shadow:0 1px 2px #5a0e05}
.rg-gold.dis,.rg-gold:disabled{opacity:.6;cursor:default}
.rg-cap{flex-basis:100%;text-align:center;font-size:13px;color:#fff3cf;text-shadow:0 1px 3px #000,0 0 6px #000}
.rg-bar{position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px;max-width:560px;margin:0 auto;padding:8px 16px calc(8px + env(safe-area-inset-bottom));background:linear-gradient(#2a1d11,#140d07);border-top:2px solid #5d4527}
.rr.full ~ .rg-bar{display:none}
.rg-bar .lb-sq{position:relative}
.rg-bar .lb-sq.live{box-shadow:0 0 0 2px #3ddc6a}.rg-bar .lb-sq.wait{box-shadow:0 0 0 2px #ffd24a}.rg-bar .lb-sq.muted{opacity:.6}
.rg-badge{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;border-radius:9px;background:#e0302a;color:#fff;font:700 11px/18px system-ui;text-align:center;padding:0 4px}
.rg-warn{flex-basis:100%;text-align:center;font-size:11px;color:#bfae88;line-height:1.3}
.rg-warn:empty{display:none}
.rg-sheet{position:fixed;inset:0;z-index:60;background:#000a;display:flex;align-items:flex-end;justify-content:center}
.rg-sheet[hidden]{display:none}
.rg-sheet-in{width:100%;max-width:560px;max-height:82vh;overflow:auto;padding:14px 16px calc(16px + env(safe-area-inset-bottom));background:#1d150e;border:2px solid #5d4527;border-bottom:0;border-radius:16px 16px 0 0;color:#f4e8cb}
.rg-sheet-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.rg-sheet .rr-chat{display:flex;flex-direction:column;gap:8px}
.rg-sheet .rr-log{height:46vh;max-height:46vh;overflow:auto}
.rg-sheet .rr-voice{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px}
.rg-setrow{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.rg-modal{align-items:center}.rg-modal .rg-sheet-in{border-radius:16px;border-bottom:2px solid #5d4527;max-width:340px;display:flex;flex-direction:column;gap:8px}
.rg-betin{width:100%;padding:12px;font-size:20px;border-radius:10px;border:2px solid #5d4527;background:#0d0905;color:#f4e8cb;box-sizing:border-box}
.rr-actions{justify-content:center}
@media (min-width:900px){body.rg-on .rr{max-width:560px}}
body.rg-on .bq-side>b.b{color:#e8e4ee}body.rg-on .bq-side>b.r{color:#ff7a62}

/* ===== Máy tính / màn hình ngang: bàn cờ theo chiều cao màn hình, thông tin bên phải ===== */
@media (min-width:900px) and (orientation:landscape){
  body.rg-on{padding-bottom:120px}
  body.rg-on .rr:not(.full){display:grid;max-width:1000px;grid-template-columns:minmax(0,calc((100vh - 150px) * .902)) minmax(300px,1fr);grid-template-columns:minmax(0,calc((100dvh - 150px) * .902)) minmax(300px,1fr);column-gap:28px;row-gap:6px;align-items:start;grid-template-rows:auto auto 1fr}
  body.rg-on .rr:not(.full) .rr-board{grid-column:1;grid-row:1/span 3}
  body.rg-on .rr:not(.full) .rg-head{grid-column:2;grid-row:1}
  body.rg-on .rr:not(.full) .rg-eye{grid-column:2;grid-row:2}
  body.rg-on .rr:not(.full) .rr-side{grid-column:2;grid-row:3}
  .rg-bar{max-width:640px}
  /* Toàn màn hình trên máy tính: bàn cờ cao hết màn hình, thông tin ở cột phải */
  body.rg-on .rr.full{display:grid;grid-template-columns:auto minmax(280px,1fr);align-content:center;justify-items:stretch;column-gap:20px;row-gap:6px;max-width:none}
  body.rg-on .rr.full .rr-board{grid-column:1;grid-row:1/span 7;width:auto;height:calc(100vh - 16px);height:calc(100dvh - 16px);aspect-ratio:460/510;align-self:center}
  body.rg-on .rr.full.has-tray .rr-board{width:auto}
  body.rg-on .rr.full [data-pos],.rr.full .status,.rr.full .rr-fsbar{grid-column:2;max-width:none}
  body.rg-on .rr.full .rr-chat{grid-column:2;grid-row:2;max-width:none}
  body.rg-on .rr.full [data-pos=top]{grid-row:1}.rr.full .rr-tray{grid-column:2;grid-row:3}.rr.full [data-pos=bot]{grid-row:4}.rr.full .status{grid-row:5}.rr.full .rr-fsbar{grid-row:6}
  body.rg-on .rr.full .rr-log{max-height:12em}
  body.rg-on .rr.full .rr-fsbar .btn{max-width:none}
}
.lb-home{display:block;text-align:center;margin:0 0 12px;padding:12px;border-radius:10px;text-decoration:none;font-weight:700}

/* ===== Trang đấu máy dùng cùng giao diện phòng chơi ===== */
body.pc-on .gameintro,body.pc-on .first>.wrap.content{display:none}
body.pc-on .play:not(.pfull){display:flex;flex-direction:column;align-items:stretch;gap:6px;max-width:560px;margin:0 auto;padding-top:0}
body.pc-on .play-board{position:relative}
body.pc-on .play:not(.pfull) .play-side{background:transparent;border:0;padding:0;gap:10px;align-items:center}
body.pc-on .play-side .rules,body.pc-on .boardtools{display:none}
body.pc-on .play-side .actions{justify-content:center}
body.pc-on .play-side .actions #btn-sound,body.pc-on .play-side .actions .pf-exit{display:none}
body.pc-on .play.pfull .pf-exit{display:inline-block}
body.pc-on .play.pfull .rg-head,body.pc-on .play.pfull .rg-eye,body.pc-on .play.pfull .rg-river{display:none}
body.pc-on .rg-sheet .field{margin:0 0 10px}
body.pc-on .rg-sheet select{width:100%;padding:10px;border-radius:8px;background:#0d0905;color:#f4e8cb;border:2px solid #5d4527}
body.pc-on .rg-sheet label{display:block;margin-bottom:4px}
body.pc-on .rg-bar a.lb-sq{text-decoration:none}
body:has(.play.pfull) .rg-bar{display:none}
@media (min-width:900px) and (orientation:landscape){
  body.pc-on .play:not(.pfull){display:grid;max-width:1000px;grid-template-columns:minmax(0,calc((100vh - 150px) * .902)) minmax(300px,1fr);grid-template-columns:minmax(0,calc((100dvh - 150px) * .902)) minmax(300px,1fr);column-gap:28px;row-gap:6px;align-items:start;grid-template-rows:auto auto 1fr}
  body.pc-on .play:not(.pfull) .play-board{grid-column:1;grid-row:1/span 3}
  body.pc-on .play:not(.pfull) .rg-head{grid-column:2;grid-row:1}
  body.pc-on .play:not(.pfull) .rg-eye{grid-column:2;grid-row:2}
  body.pc-on .play:not(.pfull) .play-side{grid-column:2;grid-row:3}
}

@media (min-width:900px) and (orientation:landscape){
  .play.pfull{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:center;column-gap:14px}
  .play.pfull .play-board{grid-column:1;grid-row:1/span 4;width:auto;height:calc(100vh - 16px);height:calc(100dvh - 16px);aspect-ratio:460/510}
  .play.pfull .status{grid-column:2;grid-row:1;align-self:end}.play.pfull #gone{grid-column:2;grid-row:2}.play.pfull .actions{grid-column:2;grid-row:3;flex-wrap:wrap}.play.pfull .actions .btn{max-width:none}
}
.rg-levels{display:flex;gap:4px;justify-content:center;flex-wrap:nowrap;padding:2px 6px}
.rg-lv{padding:7px 8px;white-space:nowrap;border-radius:14px;border:2px solid #5d4527;background:#2a2016;color:#f4e8cb;font:600 12px/1 system-ui,sans-serif;cursor:pointer}
.rg-lv.on{background:linear-gradient(#ffe48a,#e3a62e 60%,#b87a14);color:#4a2a05;border-color:#5a360a}
@media (min-width:900px) and (orientation:landscape){
  body.pc-on .play:not(.pfull) .rg-levels{grid-column:2;grid-row:3;justify-content:flex-start}
  body.pc-on .play:not(.pfull) .play-side{grid-row:4}
  body.pc-on .play:not(.pfull){grid-template-rows:auto auto auto 1fr}
  body.pc-on .play:not(.pfull) .play-board{grid-row:1/span 4}
}
body.pc-on .play.pfull .rg-levels{display:none}

.lc-in .lc-log{height:min(46vh,340px);background:#120c07;border:1px solid #3a2a18;border-radius:10px;padding:8px;color:#f3e6c8;margin-bottom:8px}
.lc-in .rr-msg b{color:#c9a96a}.lc-in .rr-msg.mine b{color:#ffd36b}
.lc-in .rr-chatform input{background:#120c07;color:#f3e6c8;border-color:#6a5233}
.emo-bar{display:flex;flex-wrap:wrap;gap:2px;margin:0 0 8px;padding:6px;background:rgba(0,0,0,.25);border-radius:10px;max-height:116px;overflow:auto}
.emo-bar button,.emo-toggle{border:0;background:transparent;font-size:24px;line-height:1;padding:5px;border-radius:8px;cursor:pointer;min-width:38px;min-height:38px}
.emo-bar button:hover,.emo-toggle:hover{background:rgba(255,255,255,.12)}
.emo-toggle{flex:none;font-size:22px;padding:0 4px}
.rr-chatform .emo-toggle{align-self:center}
.inv-stack{position:fixed;left:0;right:0;top:calc(8px + env(safe-area-inset-top,0px));z-index:80;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;padding:0 10px}
.inv-card{pointer-events:auto;width:min(100%,460px);background:#1d150e;color:#f3e6c8;border:2px solid #c9a96a;border-radius:12px;padding:10px 12px;box-shadow:0 6px 24px rgba(0,0,0,.5)}
.inv-t b{color:#ffd36b}.inv-row{display:flex;gap:8px;margin-top:8px}.inv-row .btn{flex:1;text-align:center;text-decoration:none}
.inv-list{display:flex;flex-direction:column;gap:6px;max-height:42vh;overflow:auto;margin:8px 0}
.inv-item{display:flex;align-items:center;gap:8px;padding:6px 8px;background:rgba(0,0,0,.25);border-radius:10px;color:#f3e6c8}
.inv-item span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inv-item small{color:#b9a780}
.inv-item .btn{padding:6px 14px}
/* Chat gắn dưới bàn cờ (không che bàn cờ) */
.rg-sheet.rg-dock{position:fixed;background:transparent;pointer-events:none;display:block;z-index:55}
.rg-sheet.rg-dock[hidden]{display:none}
.rg-dock .rg-sheet-in{pointer-events:auto;width:100%;max-width:none;height:100%;max-height:none;display:flex;flex-direction:column;padding:8px;border:2px solid #6a5233;border-radius:12px;overflow:hidden}
.rg-dock .rg-sheet-h{display:none}
.rg-dock .rr-chat{flex:1;min-height:0;display:flex;flex-direction:column;gap:6px;position:relative}
.rg-sheet.rg-dock .rr-log{flex:1;height:auto;max-height:none;min-height:0;font-size:14px;color:#f3e6c8}
.rg-dock .rr-msg b{color:#c9a96a}.rg-dock .rr-msg.mine b{color:#ffd36b}
.rg-dock .emo-bar{position:absolute;left:0;right:0;top:0;bottom:50px;margin:0;max-height:none;background:#1d150e;z-index:2;align-content:flex-start}
.rr-chatform .rg-dockx{display:none}.rg-dock .rr-chatform .rg-dockx{display:block}
.rg-dock .rr-chatform{flex:none;align-items:center;gap:4px}
.rg-dock .rr-chatform input{padding:8px 10px;font-size:16px}.rg-dock .rr-chatform .btn{padding:8px 12px}
.rr-chatform .rg-dockmic.live{background:rgba(60,200,90,.25)}.rr-chatform .rg-dockmic.wait{background:rgba(240,190,60,.25)}
.emo-toggle{min-width:36px}
.rg-dock .rg-sheet-in{padding:6px}
.rg-dock .rr-chatform{height:44px}
.rg-dock .rr-chatform input{height:40px;box-sizing:border-box;padding:0 10px;border-width:2px}
.rg-dock .rr-chatform .btn{height:40px;padding:0 12px}
.rg-dock .rr-chatform .emo-toggle{height:40px;min-height:0}
.rg-dock .emo-bar{bottom:50px}
.rg-dock .emo-bar button{font-size:21px;min-width:34px;min-height:34px;padding:3px}
.rg-dock .rr-chatform input:focus{outline:none;border-color:#e0b85c}
body.rg-on .rr{padding-bottom:120px}
/* Thanh chat luôn hiện ngay trên thanh nút (điện thoại) */
.rg-strip{position:fixed;z-index:54;display:flex;flex-direction:column;gap:3px;padding:4px 6px;background:rgba(29,21,14,.96);border:2px solid #6a5233;border-radius:12px;box-sizing:border-box}
.rg-strip[hidden]{display:none}
.rg-strip-last{all:unset;display:block;box-sizing:border-box;width:100%;font-size:13px;line-height:18px;height:18px;color:#d9c9a3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.rg-strip-last.mine{color:#ffe29a}
.rg-strip .rr-chatform{display:flex;align-items:center;gap:4px;height:40px}
.rg-strip .rr-chatform input{flex:1;min-width:0;height:38px;box-sizing:border-box;padding:0 10px;font-size:16px;background:#120c07;color:#f3e6c8;border:2px solid #6a5233;border-radius:10px}
.rg-strip .rr-chatform input:focus{outline:none;border-color:#e0b85c}
.rg-strip .rr-chatform .btn{height:38px;padding:0 12px}
.rg-strip .rr-chatform .emo-toggle{height:38px;min-height:0}
.rg-strip .rg-dockx{display:none}
.rg-strip .emo-bar{position:absolute;left:0;right:0;bottom:100%;margin:0 0 4px;background:#1d150e;border:2px solid #6a5233;border-radius:12px;max-height:130px;z-index:3}
/* Chỗ dưới bàn cờ chật: thu gọn dòng trạng thái và nút ván để vừa cùng thanh chat */
body.rg-strip-on .rr:not(.full) .rr-side .meta,body.rg-strip-on .rr:not(.full) .rr-side .rr-h,body.rg-strip-on .rr:not(.full) .rr-side .rr-moves{display:none}
body.rg-strip-on .rr:not(.full) .rr-side .status{margin:4px 0 4px;padding:0;font-size:14px;line-height:1.25;font-weight:700;background:none;border:0}
body.rg-strip-on .rr:not(.full) .rr-side .rr-actions{display:flex;flex-wrap:nowrap;gap:6px;margin:0}
body.rg-strip-on .rr:not(.full) .rr-side .rr-actions .btn{flex:1;min-width:0;height:34px;padding:0 6px;font-size:13px;white-space:nowrap}
body.rg-strip-on .rr:not(.full){padding-bottom:150px}
body.rg-strip-on .rr:not(.full) .rr-side,body.rg-strip-on .rr:not(.full) .play-side{padding:0;margin:0;gap:4px}
body.rg-strip-on .rr:not(.full) .rr-side{padding-top:2px}
body.rg-strip-on .rr:not(.full) .rr-side .status{margin:2px 0;min-height:0}
body.rg-strip-on .rr:not(.full) .rr-side .rr-actions .btn{height:32px}
.rg-strip{gap:2px;padding:3px 6px}.rg-strip-last{height:16px;line-height:16px;font-size:12px}
.rg-strip .rr-chatform,.rg-strip .rr-chatform input,.rg-strip .rr-chatform .btn,.rg-strip .rr-chatform .emo-toggle{height:36px}
.rg-strip .emo-bar{position:static;display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;max-height:none;margin:0;padding:2px 4px;border:0;background:rgba(0,0,0,.3);border-radius:8px}
.rg-strip .emo-bar[hidden]{display:none}
.rg-strip .emo-bar button{flex:none;font-size:24px}
.rg-sheet.rg-dock .rr-log{font-size:13px}
.rg-dock .rg-sheet-in{padding:4px 8px}

/* Nút Chat ở hàng đầu trang */
.lb-chatbtn{flex:none;align-self:center;margin:8px 0 0 6px;width:62px;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 4px;border-radius:14px;background:linear-gradient(#2c1f13,#150e08);border:2px solid #6a5233;color:#ffe9a8;text-decoration:none;font-weight:800;font-size:13px;box-shadow:0 3px 8px #0008}
.lb-chatbtn:hover{border-color:#e0b85c}

/* bong bóng chat kiểu game */
.rg-bub{position:fixed;z-index:70;max-width:min(47vw,300px);padding:9px 13px;border-radius:14px;background:#fff;color:#2a1a0a;font-size:16px;line-height:1.3;box-shadow:0 3px 10px rgba(0,0,0,.45);pointer-events:none;animation:rgbub .18s ease-out;transition:opacity .4s}
.rg-bub.mine{background:#ffe9a8}.rg-bub.view{background:#e8f1ff}.rg-bub.out{opacity:0}
.rg-bub:after{content:"";position:absolute;left:22px;border:7px solid transparent}
.rg-bub.up:after{top:100%;border-top-color:inherit;border-top-color:#fff}.rg-bub.mine.up:after{border-top-color:#ffe9a8}
.rg-bub.dn:after{bottom:100%;border-bottom-color:#fff}.rg-bub.mine.dn:after{border-bottom-color:#ffe9a8}
.rg-bub.view:after{display:none}
@keyframes rgbub{from{transform:scale(.85);opacity:0}to{transform:none;opacity:1}}
.emo-bar .emo-phrase{font-size:14px!important;min-height:0;min-width:0;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:inherit;border-radius:14px;padding:6px 10px;font-size:14px;margin:3px}
.rg-bub.rt:after{left:auto;right:22px}.rg-bub.view{max-width:min(86vw,360px)}
