/* GẠT NHANH ĐẨY NỢ — token thiết kế (thiet_ke/design_tokens.json) dùng chung mọi màn */
:root {
  --bg: #262630; --surface: #d7a468; --primary: #e59d28; --secondary: #2a2a29; --accent: #1d46c4;
  --text: #f7d7a8; --muted: #d4c5bf; --border: #c58c45; --danger: #871811; --success: #7fe900;
  --ink: #26221d; --shadow: #211e1a; --hi: #eab464; --kraft: #c28f5d; --brass-dk: #5a4c3b; --steel-g: #61585f; --red-ink: #a3241b;
  --f-display: 'Be Vietnam Pro', 'IntlSans', 'Arial Black', sans-serif;
  --f-cond: 'Barlow Condensed', 'IntlSans', 'Arial Narrow', sans-serif;
  --f-num: 'Chakra Petch', 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --lift: 0 4px 0 #211e1a, 0 8px 12px #211e1a99;
  --c-s: 6px; --c-m: 12px; --c-l: 22px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--f-cond); font-weight: 600; touch-action: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; pointer-events: none; -webkit-user-drag: none; }
.logo .l1, .logo .l2, .stamp-last, .qm > b, .red-strip, .logo-strip > b, .btn-steel > span:not(.sep), .btn-play .pl, .btn-play .fm em,
.code-row label, .navbar button > span, .g-head h2, .hud-card span, .combo-x, .combo-more, .target > span, .btn-act > span, .bin-label span,
.r-logo span, .tag-plate, #r-place, #r-stamp, #r-meta, .r-stats span, .btn-x2 b, .btn-x2 span, .shop-row h4, .btn-buy b, .btn-yellow > span,
.room-code > span, .row-btns .btn-mini, .tabs button, .tb-name span, .stamp-time span, .online-line { white-space: nowrap; min-width: 0; max-width: 100%; } /* không overflow:hidden: line-height .88 sẽ cắt đầu/chân chữ; bề ngang đã do fitTexts thu chữ */
.logo { max-width: 750px; } .stamp-last { max-width: 540px; } .r-place .stamp { max-width: 640px; }
.num { font-family: var(--f-num); font-weight: 700; letter-spacing: .015em; font-variant-numeric: tabular-nums; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: square; stroke-linejoin: miter; }
.ic.gold { color: var(--primary); }
html[dir=rtl] .tb-name svg, html[dir=rtl] .code-row svg { transform: scaleX(-1); }

#stage { position: fixed; inset: 0; background: var(--bg) url(../assets/img/steel_tile.webp); background-size: 384px; }
#stage::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, #000a 100%); pointer-events: none; }
.screen { display: none; }
.screen.on { display: grid; }
/* artboard co đều theo min(viewW/W, viewH/H) — JS đặt --s */
.art { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(var(--s, 1)); transform-origin: center; z-index: 1; }

/* ---- vật liệu ---- */
.steel { background: #2a2a29 url(../assets/img/steel_tile.webp); background-size: 384px; box-shadow: inset 0 2px 0 #4a4744, inset 0 -2px 0 #111, 0 0 0 2px var(--border), 0 0 0 4px #1a1816, var(--lift); }
.kraft { background: var(--surface) url(../assets/img/kraft_tile.webp); background-size: 384px; color: var(--ink); box-shadow: inset 0 2px 0 #f0c48a, inset 0 -2px 0 #8a5f33, 0 0 0 2px var(--border), 0 0 0 4px #1a1816, var(--lift); }
.bevel-s { clip-path: polygon(var(--c-m) 0, calc(100% - var(--c-m)) 0, 100% var(--c-m), 100% calc(100% - var(--c-m)), calc(100% - var(--c-m)) 100%, var(--c-m) 100%, 0 calc(100% - var(--c-m)), 0 var(--c-m)); }
.bevel-m { clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px); }
.bevel-l { clip-path: polygon(24px 0, calc(100% - 24px) 0, 100% 24px, 100% calc(100% - 24px), calc(100% - 24px) 100%, 24px 100%, 0 calc(100% - 24px), 0 24px); }
.sep { width: 2px; align-self: stretch; margin: 10px 0; background: var(--border); opacity: .8; }

/* nút thép (ảnh nút GPT) & nút vàng giấy */
.btn-steel { position: relative; display: flex; align-items: center; justify-content: center; gap: 18px; height: 104px; background: url(../assets/img/btn_steel.webp) center/100% 100% no-repeat; font-weight: 900; font-size: 44px; letter-spacing: .015em; text-transform: uppercase; color: var(--text); filter: drop-shadow(0 4px 0 #211e1a); transition: transform .08s; }
.btn-steel img { height: 64px; }
.btn-steel .sep { height: 54px; align-self: center; margin: 0; }
.btn-steel:active, .btn-yellow:active, .btn-play:active, .btn-act:active, .btn-buy:active { transform: translateY(4px) scale(.98); filter: none; }
.btn-yellow { display: flex; align-items: center; justify-content: center; background: url(../assets/img/btn_yellow.webp) center/100% 100% no-repeat; color: var(--ink); font-weight: 900; font-size: 72px; letter-spacing: .015em; text-transform: uppercase; filter: drop-shadow(0 5px 0 #211e1a); transition: transform .08s; padding: 0 40px; }
.btn-yellow.sm { font-size: 40px; height: 84px; min-width: 300px; }
.btn-mini { padding: 12px 20px; font-weight: 900; font-size: 30px; text-transform: uppercase; color: var(--text); background: #1d1c1b; box-shadow: inset 0 0 0 2px var(--border); clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px); }
.btn-mini:active { background: #000; }

/* ================= SẢNH (06: 1054×1492) ================= */
.art-lobby { width: 1054px; height: 1492px; grid-template-rows: 94px 1fr 144px; }
.topbar { display: flex; align-items: center; gap: 20px; padding: 0 22px; height: 94px; box-shadow: inset 0 -2px 0 var(--border), 0 4px 0 #111; }
.tb-emblem img { height: 80px; }
.tb-name { display: flex; flex-direction: column; line-height: 1; border-inline-start: 2px solid var(--border); padding-inline-start: 20px; flex: 1; }
.tb-name b { font-weight: 900; font-size: 38px; letter-spacing: .02em; max-width: 440px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.35; margin-block: -.175em; }
.tb-name span { font-size: 26px; color: var(--muted); display: flex; align-items: center; gap: 6px; text-transform: uppercase; }
.tb-name svg { font-size: 22px; color: var(--primary); }
.tb-coins { display: flex; align-items: center; gap: 16px; border-inline: 2px solid var(--border); padding: 0 26px; height: 60px; }
.tb-coins img { height: 52px; }
.tb-coins b { font-size: 46px; min-width: 120px; }
.tb-gear img { height: 76px; }
.kraft-sheet { position: relative; background: var(--surface) url(../assets/img/kraft_tile.webp); background-size: 384px; color: var(--ink); display: grid; grid-template-columns: 1fr; grid-template-rows: 216px 50px 422px 66px 222px 112px 88px 48px; align-content: space-evenly; padding: 0 20px; row-gap: 0; overflow: hidden; }
.deco-hazard { position: absolute; left: 0; top: 24px; width: 100px; opacity: .95; }
.deco-tape { position: absolute; left: 0; top: 206px; width: 170px; transform: rotate(-12deg); opacity: .9; }
.logo { position: relative; align-self: end; justify-self: center; display: flex; flex-direction: column; align-items: flex-start; font-family: var(--f-display); font-weight: 900; text-transform: uppercase; line-height: .88; letter-spacing: -.02em; color: var(--ink); text-shadow: 0 0 1px #0006; margin-right: 120px; margin-bottom: 8px; }
.logo .l1 { font-size: 118px; transform: rotate(-1.5deg) skewX(-4deg); white-space: nowrap; }
.logo .l2 { font-size: 118px; white-space: nowrap; }
.stamp-time { position: absolute; right: 22px; top: 92px; width: 168px; height: 160px; background: #e9c995 url(../assets/img/kraft_tile.webp); background-size: 300px; filter: sepia(.2) brightness(1.15); transform: rotate(-8deg); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); clip-path: polygon(4% 0, 96% 3%, 100% 96%, 3% 100%); box-shadow: inset 0 0 0 4px #b8875199; }
.stamp-time span { font-weight: 900; font-size: 26px; text-transform: uppercase; text-align: center; line-height: 1; }
.stamp-time b { font-size: 64px; color: var(--red-ink); border-bottom: 5px solid var(--red-ink); line-height: 1.3; margin-top: -.15em; }
.logo-strip { display: flex; align-items: center; gap: 22px; justify-content: center; font-weight: 900; font-size: 34px; text-transform: uppercase; letter-spacing: .02em; }
.red-strip { background: var(--danger); color: var(--text); padding: 2px 24px; clip-path: polygon(1% 8%, 99% 0, 100% 92%, 0 100%); }
.logo-strip .sep { margin: 4px 0; background: var(--ink); }
.hero { position: relative; margin-top: 10px; }
.hero-img { width: 1014px; height: 411px; }
.stamp-last { position: absolute; right: 40px; bottom: 34px; padding: 6px 20px; font-weight: 900; font-size: 46px; text-transform: uppercase; color: var(--red-ink); background: #e9cd9f; border: 5px solid var(--red-ink); transform: rotate(-6deg); box-shadow: 0 0 0 4px #e9cd9f; max-width: 520px; text-align: center; line-height: 1; }
.qm { display: flex; align-items: center; justify-content: space-between; gap: 22px; height: 63px; margin-top: 2px; padding: 0 38px; color: var(--text); font-weight: 900; font-size: 36px; text-transform: uppercase; letter-spacing: .02em; }
.qm .sep { margin: 12px 0; }
.qm-dots { display: flex; gap: 8px; }
.qm-dots i { width: 31px; height: 30px; border: 3px solid var(--primary); }
.qm-dots i.on { background: var(--primary); box-shadow: inset 0 -4px 0 #a86c12; }
.qm b.num { font-size: 36px; font-family: var(--f-cond); font-weight: 900; }
.btn-play { position: relative; margin-top: 10px; height: 210px; background: url(../assets/img/btn_yellow.webp) center/100% 100% no-repeat; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); filter: drop-shadow(0 6px 0 #211e1a); transition: transform .08s; }
.btn-play .pl { font-family: var(--f-display); font-weight: 900; font-size: 136px; line-height: .88; letter-spacing: -.02em; text-transform: uppercase; }

/* Hộp chữ tiêu đề/PLAY cao đủ chứa nét chữ (không bị coi là cắt), bù bằng margin âm để giữ đúng nhịp dòng .88 của thiết kế */
.logo .l1, .logo .l2, .btn-play .pl { line-height: 1.3; margin-block: -.21em; }
.btn-play .fm { display: flex; align-items: center; gap: 28px; font-size: 36px; margin-top: 8px; }
.btn-play .fm i { width: 130px; height: 3px; background: var(--ink); }
.btn-play.busy .pl { animation: pulse .9s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.room-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 14px; padding: 0 6px; }
.code-row { display: grid; grid-template-columns: 300px 1fr 100px; height: 82px; margin: 4px 14px 0; clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px); box-shadow: inset 0 0 0 3px var(--border); background: #1e1d1c; }
.code-row label { display: flex; align-items: center; justify-content: center; background: #e6c48e url(../assets/img/kraft_tile.webp); background-size: 300px; font-weight: 900; font-size: 40px; text-transform: uppercase; color: var(--ink); margin: 3px 0 3px 3px; }
html[dir=rtl] .code-row label { margin: 3px 3px 3px 0; }
.code-row input { background: transparent; border: 0; outline: 0; color: var(--text); font-family: var(--f-cond); font-weight: 900; font-size: 44px; padding: 0 26px; letter-spacing: .25em; text-transform: uppercase; width: 100%; }
.code-row input::placeholder { color: var(--muted); opacity: .7; font-style: italic; font-weight: 600; font-size: 34px; letter-spacing: .02em; }
.code-row button { color: var(--primary); font-size: 54px; display: flex; align-items: center; justify-content: center; border-inline-start: 2px solid #000; }
.online-line { align-self: center; justify-self: center; font-size: 28px; color: #5a3d1e; display: flex; align-items: center; gap: 10px; }
.online-line i { width: 14px; height: 14px; background: #3d7a1a; box-shadow: 0 0 0 3px #3d7a1a55; }
.navbar { display: grid; grid-template-columns: repeat(4, 1fr); height: 144px; box-shadow: inset 0 2px 0 var(--border), 0 -4px 0 #111; }
.navbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text); font-weight: 900; font-size: 34px; text-transform: uppercase; letter-spacing: .015em; }
.navbar button + button::before { content: ''; position: absolute; inset-inline-start: 0; top: 30px; bottom: 30px; width: 2px; background: var(--border); }
.navbar img { height: 64px; }
.navbar .ic { font-size: 64px; stroke-width: 3.5; }
.navbar button.on::after { content: ''; position: absolute; bottom: 14px; left: 18%; right: 18%; height: 6px; background: var(--primary); }

/* ================= TRONG VÁN (07: 941×1672) ================= */
.art-game { width: 941px; height: 1672px; grid-template-rows: 105px 360px 1fr 470px; grid-template-areas: 'head' 'side' 'play' 'ctrl'; background: #1b1a19; overflow: hidden; }
#cv { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; touch-action: none; }
.g-head { grid-area: head; position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 16px; box-shadow: inset 0 -3px 0 var(--border), 0 4px 0 #111; }
.g-head h2 { font-weight: 900; font-size: 58px; letter-spacing: .015em; text-transform: uppercase; color: var(--text); text-shadow: 0 3px 0 #000; white-space: nowrap; max-width: 600px; overflow: hidden; text-overflow: ellipsis; }
.g-head .lau { height: 62px; }
.g-pause { position: absolute; inset-inline-end: 14px; top: 14px; }
.g-pause img { width: 76px; }
.g-side { grid-area: side; position: relative; z-index: 2; display: grid; grid-template-rows: 154px 1fr; padding: 10px 6px 0; gap: 10px; background: #1b1a19ee; }
.hud { display: grid; grid-template-columns: 301px 1fr 275px; gap: 8px; align-items: stretch; }
.hud-card { display: flex; align-items: center; gap: 10px; padding: 0 16px; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
.hud-card img { width: 78px; }
.hud-card div { display: flex; flex-direction: column; align-items: flex-start; line-height: .95; min-width: 0; }
.hud-card span { font-weight: 900; font-size: 40px; text-transform: uppercase; letter-spacing: .02em; border-bottom: 2px solid #26221d88; padding-bottom: 2px; }
.hud-card b { font-size: 64px; color: var(--red-ink); white-space: nowrap; }
.hud-clock { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--danger); clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px); box-shadow: inset 0 0 0 4px var(--border), inset 0 0 0 8px #3a0b08; }
.hud-clock b { font-size: 96px; line-height: .95; color: var(--text); text-shadow: 0 4px 0 #3a0b08; }
.hud-clock.low b { animation: pulse .5s infinite; }
.hud-clock .rnd { display: flex; align-items: center; gap: 8px; background: #1d1c1b; padding: 2px 16px; box-shadow: inset 0 0 0 2px var(--border); font-weight: 900; font-size: 34px; text-transform: uppercase; }
.hud-clock .rnd img { height: 30px; }
.ranks { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 74px; gap: 10px 10px; padding: 10px; align-content: start; }
.rk { position: relative; display: grid; grid-template-columns: 56px 1fr auto; grid-template-rows: 1fr 18px; align-items: center; column-gap: 8px; padding: 6px 12px; background: #1d1c1b; box-shadow: inset 0 0 0 2px #6b5a3e; clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px); transition: transform .15s; }
.rk img { grid-row: 1 / 3; width: 56px; height: 56px; object-fit: cover; object-position: top; background: #3a332b; }
.rk .n { font-weight: 900; font-size: 30px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.rk .s { font-family: var(--f-cond); font-weight: 800; font-size: 32px; color: var(--text); }
.rk .bar { grid-column: 2 / 4; display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; height: 12px; }
.rk .bar i { background: #555; }
.rk .bar i.on { background: var(--primary); }
.rk .bar.hot i.on { background: #d33a2a; }
.rk.me { box-shadow: inset 0 0 0 3px var(--primary), 0 0 14px #e59d2888; }
.rk.tgt::after { content: ''; position: absolute; inset-inline-end: 4px; top: 4px; width: 22px; height: 22px; background: url(../assets/ui/ic_target.webp) center/contain; }
.rk.out { opacity: .5; }
.rk.out::before { content: ''; position: absolute; inset: 8px 20px; background: linear-gradient(to top right, transparent calc(50% - 3px), var(--danger) calc(50% - 3px), var(--danger) calc(50% + 3px), transparent calc(50% + 3px)), linear-gradient(to top left, transparent calc(50% - 3px), var(--danger) calc(50% - 3px), var(--danger) calc(50% + 3px), transparent calc(50% + 3px)); z-index: 2; }
.rk.hit { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.playfield { grid-area: play; position: relative; z-index: 1; }
.bin-label { position: absolute; bottom: 52px; width: 196px; text-align: center; font-weight: 900; font-size: 40px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); pointer-events: none; line-height: 1; }
.bin-label span { display: inline-block; padding: 4px 16px; background: var(--surface) url(../assets/img/kraft_tile.webp); background-size: 300px; box-shadow: 0 0 0 3px var(--border), 0 0 0 5px #1a1816, 0 4px 0 #000; border-bottom: 5px solid var(--red-ink); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bin-label.l { left: 16px; } .bin-label.r { right: 16px; }
.banner { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%) rotate(-4deg); padding: 10px 36px; background: var(--danger); color: var(--text); font-weight: 900; font-style: italic; font-size: 48px; text-transform: uppercase; letter-spacing: .01em; box-shadow: 0 0 0 4px var(--border), 0 0 0 8px #1a1816, var(--lift); max-width: 820px; width: max-content; text-align: center; line-height: 1.05; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 4; }
.banner.on { opacity: 1; animation: pop .3s; }
.banner.good { background: #2a2a29; color: var(--primary); }
@keyframes pop { 0% { transform: translate(-50%, -50%) rotate(-4deg) scale(1.6); } 100% { transform: translate(-50%, -50%) rotate(-4deg) scale(1); } }
.g-ctrl { grid-area: ctrl; position: relative; z-index: 2; display: grid; grid-template-rows: 120px 84px 185px 1fr; justify-items: center; padding-top: 6px; gap: 8px; background: linear-gradient(#1b1a1900, #1b1a19 14%); }
.combo { width: 684px; padding: 12px 26px; display: grid; grid-template-rows: 1fr 30px; gap: 8px; }
.combo-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.combo-x { white-space: nowrap; flex-shrink: 0; background: var(--danger); color: var(--text); font-weight: 900; font-size: 48px; padding: 0 22px; line-height: 1.1; text-transform: uppercase; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.combo-more { overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 900; font-size: 36px; color: var(--text); text-transform: uppercase; white-space: nowrap; }
.combo-more.rdy { color: var(--primary); animation: pulse .7s infinite; }
.combo-top .sep { margin: 4px 0; }
.combo-bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 3px; background: #111; box-shadow: inset 0 0 0 2px var(--border); }
.combo-bar i { background: #3b3936; }
.combo-bar i.on { background: var(--primary); box-shadow: inset 0 -4px 0 #a86c12; }
.combo-bar.full i.on { background: #f3c14a; animation: pulse .5s infinite; }
.target-row { display: grid; grid-template-columns: 80px 458px 80px; gap: 18px; align-items: center; }
.arrow img { width: 80px; }
.target { height: 76px; display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 900; font-size: 42px; text-transform: uppercase; }
.target img { width: 50px; }
.target b { color: var(--red-ink); font-size: 50px; max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.act-row { display: grid; grid-template-columns: 420px 420px; gap: 30px; }
.btn-act { position: relative; display: flex; align-items: center; justify-content: center; gap: 20px; height: 185px; background: url(../assets/img/btn_steel.webp) center/100% 100% no-repeat; color: var(--text); font-weight: 900; font-size: 84px; text-transform: uppercase; letter-spacing: .015em; filter: drop-shadow(0 5px 0 #000); transition: transform .08s, opacity .2s; }
.btn-act .ic { font-size: 84px; color: var(--text); stroke-width: 7; }
.btn-act img { width: 130px; }
.btn-act.dim { opacity: .45; }
.btn-act.lit { filter: drop-shadow(0 0 16px #e59d28) drop-shadow(0 5px 0 #000); }
.badge { position: absolute; top: 4px; inset-inline-end: 22px; width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; background: url(../assets/ui/badge_red.webp) center/contain; color: transparent; font-style: normal; }
.badge::after { content: attr(data-n); position: absolute; inset: 9px; border-radius: 50%; background: #b5281c; color: var(--text); font-family: var(--f-num); font-weight: 700; font-size: 44px; display: flex; align-items: center; justify-content: center; }
.badge.zero { display: none; }
.g-hint { align-self: start; font-size: 32px; color: var(--text); display: flex; align-items: center; gap: 22px; text-align: center; }
.g-hint::before, .g-hint::after { content: ''; width: 90px; height: 2px; background: var(--border); }
.g-hint.warn { color: var(--primary); font-weight: 900; }
.count { position: absolute; inset: 0; z-index: 6; display: none; align-items: center; justify-content: center; background: #0008; font-family: var(--f-num); font-weight: 700; font-size: 300px; color: var(--primary); text-shadow: 0 10px 0 #000; }
.count.on { display: flex; }
.count.go { font-family: var(--f-display); font-size: 240px; }

/* ================= KẾT QUẢ (08: 1024×1536) ================= */
.art-result { width: 1024px; height: 1680px; align-content: center; background: #1b1a19 url(../assets/img/bg_play.webp) center/cover; grid-template-columns: 1fr; grid-template-rows: 176px auto auto; justify-items: center; padding-top: 16px; overflow: hidden; }
.art-result::before { content: ''; position: absolute; inset: 0; background: #1b1a19c4; }
.art-result > * { position: relative; }
.r-banner { position: absolute !important; top: 30px; width: 125px; } .r-banner.l { left: 30px; } .r-banner.r { right: 30px; }
.r-logo { width: 420px; height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; font-size: 56px; line-height: .95; text-transform: uppercase; color: var(--primary); text-shadow: 0 3px 0 #000; clip-path: polygon(14% 0, 86% 0, 100% 50%, 86% 100%, 14% 100%, 0 50%); }
.r-col1, .r-col2 { width: 960px; display: flex; flex-direction: column; align-items: center; }
.tag-plate { position: relative; z-index: 2; padding: 4px 46px; background: linear-gradient(#f0c35a, #d99a2a); color: var(--ink); font-weight: 900; font-size: 34px; letter-spacing: .02em; text-transform: uppercase; clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 22px 100%, 0 50%); margin-bottom: -18px; }
.r-place { position: relative; width: 816px; padding: 34px 0 18px; display: flex; flex-direction: column; align-items: center; clip-path: polygon(24px 0, calc(100% - 24px) 0, 100% 24px, 100% calc(100% - 24px), calc(100% - 24px) 100%, 24px 100%, 0 calc(100% - 24px), 0 24px); }
.r-place .lau { position: absolute; top: 30px; height: 130px; } .r-place .lau.l { left: 50px; } .r-place .lau.r { right: 50px; }
.r-place b { font-weight: 900; font-size: 112px; line-height: .95; color: #f3c14a; text-transform: uppercase; text-shadow: 0 5px 0 #6b4a12; }
.r-place .stamp { margin-top: -10px; padding: 0 26px; font-weight: 900; font-size: 64px; color: #d33a2a; border: 6px solid #d33a2a; transform: rotate(-6deg); background: #3a0b0866; text-transform: uppercase; line-height: 1.05; }
.r-place .stamp.out { color: var(--muted); border-color: var(--muted); }
.r-place p { margin-top: 14px; font-weight: 900; font-size: 32px; color: var(--text); text-transform: uppercase; letter-spacing: .04em; }
.r-ticket { position: relative; width: 836px; margin-top: 18px; padding: 22px 30px 18px; background: var(--surface) url(../assets/img/kraft_tile.webp); background-size: 384px; color: var(--ink); clip-path: polygon(0 3%, 3% 0, 20% 2%, 40% 0, 62% 2%, 80% 0, 97% 2%, 100% 6%, 99% 30%, 100% 60%, 99% 95%, 96% 100%, 70% 98%, 45% 100%, 20% 98%, 2% 100%, 0 94%, 1% 60%, 0 30%); display: flex; flex-direction: column; align-items: center; }
.r-ticket h3 { font-weight: 900; font-size: 40px; text-transform: uppercase; letter-spacing: .02em; display: flex; gap: 20px; align-items: center; }
.r-ticket h3::before, .r-ticket h3::after { content: ''; width: 70px; height: 3px; background: var(--ink); }
.r-total { font-size: 132px; color: var(--red-ink); line-height: 1; padding: 0 28px; border: 6px solid var(--red-ink); margin-top: 4px; }
.r-ticket .pm { position: absolute; right: 26px; top: 22px; width: 110px; transform: rotate(6deg); }
.r-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin-top: 16px; border-top: 2px solid #26221d66; padding-top: 10px; }
.r-stats div { display: flex; flex-direction: column; align-items: center; }
.r-stats div + div { border-inline-start: 2px solid #26221d66; }
.r-stats span { font-weight: 900; font-size: 30px; text-transform: uppercase; }
.r-stats b { font-size: 70px; color: var(--red-ink); line-height: 1; }
.r-stand { display: none; }
.r-col2 { margin-top: 18px; }
.r-rw { width: 944px; height: 130px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; padding-top: 10px; clip-path: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px); }
.r-rw div { display: flex; align-items: center; justify-content: center; gap: 14px; height: 80px; }
.r-rw div + div { border-inline-start: 2px solid var(--border); }
.r-rw img { height: 76px; }
.r-rw b { font-size: 60px; color: var(--text); }
.btn-x2 { margin-top: 10px; display: flex; align-items: center; gap: 14px; padding: 8px 26px; background: #1d1c1b; box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); font-size: 30px; }
.btn-x2 .ic { font-size: 40px; stroke-width: 3.5; }
.btn-x2 b { font-weight: 900; font-size: 36px; }
.btn-x2[disabled] { opacity: .4; }
.r-extra { display: flex; gap: 18px; margin-top: 10px; justify-content: center; }
.r-extra .btn-x2 { margin-top: 0; }
.btn-x2.share { color: var(--text); box-shadow: inset 0 0 0 2px var(--border); }
.menu-note { font-size: 34px; color: var(--muted); text-align: center; max-width: 520px; }
.r-shop { width: 960px; margin-top: 16px; }
.shop-head { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 30px; }
.shop-head .tag-plate { margin-bottom: -18px; }
.gold-pill { display: flex; align-items: center; gap: 10px; background: #1d1c1b; padding: 4px 22px; box-shadow: inset 0 0 0 2px var(--border); font-weight: 900; font-size: 32px; color: var(--text); margin-bottom: 6px; }
.gold-pill img { height: 34px; }
.shop-body { padding: 26px 30px 10px; clip-path: polygon(0 2%, 4% 0, 50% 2%, 96% 0, 100% 3%, 99% 50%, 100% 97%, 96% 100%, 50% 98%, 4% 100%, 0 97%, 1% 50%); }
.shop-row { display: grid; grid-template-columns: 170px 1fr 270px; align-items: center; gap: 20px; min-height: 120px; }
.shop-row + .shop-row { border-top: 2px solid #26221d55; }
.shop-row > img { width: 150px; justify-self: center; }
.shop-row h4 { font-weight: 900; font-size: 44px; text-transform: uppercase; line-height: 1; padding-inline-start: 20px; border-inline-start: 2px solid #26221d88; }
.shop-row p { font-size: 29px; padding-inline-start: 20px; border-inline-start: 2px solid #26221d88; }
.btn-buy { height: 72px; display: flex; align-items: center; justify-content: center; gap: 12px; background: linear-gradient(#f3c14a, #d8961f); color: var(--ink); font-weight: 900; font-size: 38px; text-transform: uppercase; box-shadow: inset 0 0 0 3px #8a5a14, 0 4px 0 #211e1a; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); transition: transform .08s; }
.btn-buy img { height: 40px; }
.btn-buy b { font-family: var(--f-cond); font-weight: 900; }
.btn-buy.no { filter: grayscale(.8); opacity: .7; }
.r-btns { display: grid; grid-template-columns: 568px 273px; gap: 40px; margin-top: 22px; }
.r-btns .btn-yellow { height: 124px; font-size: 68px; }
.r-btns .btn-steel { height: 105px; align-self: center; font-size: 50px; }
.r-next { margin-top: 12px; font-size: 30px; color: var(--text); }

/* ================= PHỦ ================= */
.overlay { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; background: #000b; }
.overlay.on { display: flex; }
.overlay .sheet { flex-shrink: 0; position: relative; width: 980px; max-height: 1400px; overflow: auto; padding: 44px 40px 36px; transform: scale(var(--s, 1)); display: flex; flex-direction: column; gap: 24px; align-items: center; color: var(--text); }
.overlay .sheet.small { width: 640px; }
.sheet h3 { font-weight: 900; font-size: 56px; text-transform: uppercase; color: var(--primary); display: flex; align-items: center; gap: 14px; text-align: center; }
.sheet .close { align-self: center; }
.room-code { display: flex; align-items: center; gap: 18px; font-weight: 900; font-size: 34px; text-transform: uppercase; flex-wrap: wrap; justify-content: center; }
.room-code b { font-size: 76px; color: var(--primary); letter-spacing: .2em; background: #111; padding: 0 20px; box-shadow: inset 0 0 0 2px var(--border); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; width: 100%; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; background: #1d1c1b; box-shadow: inset 0 0 0 2px #6b5a3e; min-height: 190px; justify-content: center; }
.slot img { width: 110px; height: 110px; object-fit: cover; object-position: top; background: #3a332b; }
.slot b { font-weight: 900; font-size: 28px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot small { font-size: 22px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.slot.empty { opacity: .45; border: 3px dashed var(--border); box-shadow: none; }
.slot.me { box-shadow: inset 0 0 0 3px var(--primary); }
.slot.pop { animation: pop2 .35s; }
@keyframes pop2 { 0% { transform: scale(.4); } 70% { transform: scale(1.1); } }
.room-status { font-size: 40px; font-weight: 900; text-transform: uppercase; color: var(--text); }
.row-btns { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: center; }
.flag { display: inline-block; font-family: var(--f-cond); font-weight: 800; font-size: .8em; padding: 0 5px; background: #e6c48e; color: var(--ink); line-height: 1.2; }
.tabs { display: flex; gap: 10px; }
.tabs button { padding: 10px 26px; font-weight: 900; font-size: 32px; text-transform: uppercase; background: #1d1c1b; box-shadow: inset 0 0 0 2px var(--border); }
.tabs button.on { background: var(--primary); color: var(--ink); }
.lb-list { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 70px 70px 1fr auto; align-items: center; gap: 14px; padding: 6px 14px; background: #1d1c1b; font-size: 32px; }
.lb-row:nth-child(-n+3) { box-shadow: inset 0 0 0 2px var(--primary); }
.lb-row.me { background: #4a3a1e; }
.lb-row .pos { font-family: var(--f-num); font-size: 36px; color: var(--primary); text-align: center; }
.lb-row img { width: 60px; height: 60px; object-fit: cover; object-position: top; }
.lb-row .nm { font-weight: 900; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lb-row .tr { font-family: var(--f-num); color: var(--text); }
.form { width: 100%; display: grid; grid-template-columns: 280px 1fr; gap: 16px 20px; align-items: center; font-size: 34px; }
.form input, .form select { background: #111; color: var(--text); border: 0; box-shadow: inset 0 0 0 2px var(--border); padding: 12px 18px; font-family: var(--f-cond); font-weight: 700; font-size: 34px; width: 100%; outline: 0; }
.chars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; width: 100%; }
.chars button { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 2px; background: #1d1c1b; box-shadow: inset 0 0 0 2px #6b5a3e; font-size: 22px; font-weight: 800; }
.chars button.on { box-shadow: inset 0 0 0 4px var(--primary); }
.chars img { height: 150px; }
.chars .pr { font-family: var(--f-cond); color: var(--primary); display: flex; gap: 4px; align-items: center; }
.chars .pr img { height: 24px; }
.htp { width: 100%; display: flex; flex-direction: column; gap: 16px; font-size: 36px; }
.htp li { display: grid; grid-template-columns: 76px 1fr; gap: 16px; align-items: center; list-style: none; }
.htp li b { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; font-family: 'Roboto Slab', serif; font-weight: 900; font-size: 52px; background: var(--danger); color: var(--text); box-shadow: 0 0 0 3px var(--border), 0 4px 0 #000; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.lang-grid button { padding: 20px 10px; font-size: 38px; font-weight: 800; background: #1d1c1b; box-shadow: inset 0 0 0 2px #6b5a3e; font-family: var(--f-cond); }
.lang-grid button.on { background: var(--primary); color: var(--ink); box-shadow: inset 0 0 0 3px #8a5a14; }
/* nút 🌐 của bộ i18n chung: ghi đè kiểu mặc định cho hợp chất liệu thép/đồng */
#vds-lang-btn { top: calc(6px + env(safe-area-inset-top)) !important; right: auto !important; left: 50% !important; transform: translateX(-50%); z-index: 15 !important;
  padding: 3px 12px !important; border-radius: 0 !important; border: 0 !important; background: #1d1c1bee !important; color: var(--text) !important;
  box-shadow: inset 0 0 0 2px var(--border), 0 2px 0 #000 !important; font: 800 14px var(--f-cond) !important; letter-spacing: .02em; white-space: nowrap; }
body:not(.at-lobby) #vds-lang-btn { display: none !important; }
#vds-lang-pop > div { background: #2a2a29 !important; border-radius: 0 !important; box-shadow: inset 0 0 0 2px var(--border); font-family: var(--f-cond) !important; }
#vds-lang-pop button { border-radius: 0 !important; }
#toast { position: fixed; z-index: 30; left: 50%; top: 16%; transform: translateX(-50%); padding: 10px 24px; background: var(--danger); color: var(--text); font-weight: 900; font-size: 20px; text-transform: uppercase; box-shadow: 0 0 0 2px var(--border), var(--lift); opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
#toast.on { opacity: 1; }
#loading { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: var(--bg); }
#loading.off { display: none; }
.ld-box { display: flex; flex-direction: column; gap: 14px; align-items: center; color: var(--text); font-size: 22px; }
.ld-bar { width: 220px; height: 12px; box-shadow: inset 0 0 0 2px var(--border); padding: 3px; }
.ld-bar i { display: block; height: 100%; width: 40%; background: var(--primary); animation: ld 1s infinite alternate; }
@keyframes ld { to { width: 100%; } }

/* ================= XOAY NGANG: bố cục riêng ================= */
@media (orientation: landscape) {
  .art-lobby { width: 1700px; height: 940px; grid-template-rows: 94px 1fr 0; }
  .art-lobby .navbar { position: absolute; left: 0; bottom: 0; width: 560px; height: 120px; grid-template-columns: repeat(4, 1fr); }
  .art-lobby .navbar img { height: 52px; } .art-lobby .navbar .ic { font-size: 52px; } .art-lobby .navbar button { font-size: 26px; }
  .art-lobby .navbar { left: auto; right: 0; width: 640px; }
  .kraft-sheet { display: block; }
  .kraft-sheet > * { position: absolute !important; }
  .logo { left: 120px; top: 14px; margin: 0; max-width: 740px; }
  .logo .l1, .logo .l2 { font-size: 104px; }
  .stamp-time { left: 870px; right: auto; top: 30px; }
  .logo-strip { left: 20px; top: 214px; width: 1014px; }
  .hero { left: 20px; top: 272px; margin: 0; }
  .qm { left: 1072px; top: 26px; width: 600px; margin: 0; padding: 0 22px; font-size: 30px; gap: 12px; }
  .qm-dots i { width: 24px; height: 24px; }
  .btn-play { left: 1072px; top: 112px; width: 600px; height: 236px; margin: 0; }
  .room-btns { left: 1072px; top: 372px; width: 600px; margin: 0; padding: 0; gap: 14px; }
  .room-btns .btn-steel { height: 96px; font-size: 34px; gap: 10px; }
  .room-btns .btn-steel img { height: 50px; }
  .code-row { left: 1080px; top: 494px; width: 584px; margin: 0; grid-template-columns: 220px 1fr 90px; height: 78px; }
  .code-row label { font-size: 32px; }
  .online-line { left: 1072px; top: 600px; width: 600px; justify-content: center; }
  .deco-tape { top: 200px; }
  .art-game { width: 1672px; height: 941px; grid-template-columns: 480px 1fr 460px; grid-template-rows: 105px 1fr; grid-template-areas: 'head head head' 'side play ctrl'; }
  .g-side { grid-template-rows: 154px 1fr; background: #1b1a19ee; padding: 10px; }
  .hud { grid-template-columns: 1fr 1.1fr 1fr; gap: 6px; }
  .hud-card { flex-direction: column; justify-content: center; gap: 2px; padding: 0 6px; }
  .hud-card img { width: 46px; } .hud-card div { align-items: center; }
  .hud-card span { font-size: 28px; } .hud-card b { font-size: 46px; }
  .hud-clock b { font-size: 60px; } .hud-clock .rnd { font-size: 24px; padding: 2px 8px; } .hud-clock .rnd img { height: 20px; }
  .ranks { grid-template-columns: repeat(2, 1fr); }
  .g-ctrl { grid-template-rows: 120px 84px 200px auto; align-content: center; gap: 22px; padding: 0 10px; background: #1b1a19ee; }
  .g-ctrl::before { content: ''; }
  .combo { width: 440px; padding: 12px 18px; }
  .combo-x { font-size: 34px; padding: 0 14px; } .combo-more { font-size: 26px; }
  .target-row { grid-template-columns: 64px 290px 64px; gap: 10px; }
  .target-row .arrow img { width: 64px; }
  .target { font-size: 34px; } .target b { font-size: 40px; max-width: 160px; }
  .act-row { grid-template-columns: 210px 210px; gap: 14px; }
  .btn-act { height: 160px; font-size: 52px; flex-direction: column; gap: 4px; }
  .btn-act .ic { font-size: 54px; } .btn-act img { width: 84px; }
  .g-hint { font-size: 26px; padding: 0 10px; }
  .g-hint::before, .g-hint::after { width: 30px; }
  .g-clock-land { display: flex !important; }
  .art-result { width: 1700px; height: 940px; grid-template-columns: 1fr 1fr; grid-template-rows: 160px 1fr; column-gap: 30px; padding: 10px 40px 0; }
  .r-logo { grid-column: 1 / 3; width: 380px; height: 136px; font-size: 50px; }
  .r-col1, .r-col2 { width: 800px; }
  .r-col2 { margin-top: 0; }
  .r-place { width: 780px; } .r-place b { font-size: 96px; }
  .r-ticket { width: 780px; } .r-total { font-size: 110px; }
  .r-rw { width: 780px; height: 110px; } .r-shop { width: 800px; }
  .shop-row { min-height: 100px; grid-template-columns: 140px 1fr 250px; } .shop-row > img { width: 110px; }
  .r-btns { grid-template-columns: 470px 260px; margin-top: 14px; }
  .r-btns .btn-yellow { height: 108px; font-size: 56px; }
  .r-banner { display: none; }
  .overlay .sheet { width: 1300px; max-height: 880px; }
  .slots { grid-template-columns: repeat(8, 1fr); }
}
.g-clock-land { display: none; position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 3; }
