:root {
  --bg: #151226;
  --panel: rgba(20, 17, 36, 0.78);
  --panel-solid: #1e1a33;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f1ff;
  --muted: #b3abd0;
  --gold: #ffc440;
  --gold-2: #ffd84a;
  --red: #d63b3b;
  --ok: #57c77a;
  --warn: #f2b134;
  --danger: #ff5a4a;
  --radius: 16px;
  --font: 'Be Vietnam Pro', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
kbd {
  font: 700 10px var(--font);
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}
.hidden { display: none !important; }

#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; transition: filter 0.4s; }
#vignette {
  position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(120, 10, 20, 0.85) 100%);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pill { border-radius: 999px; padding: 8px 14px; font-size: 13px; }
.icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 19px; display: grid; place-items: center;
}
.icon.big { width: 54px; height: 54px; font-size: 24px; border-radius: 16px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }

#statsCard {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px;
  padding: 12px 14px; min-width: 220px;
}
.who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.who b { font-size: 16px; font-weight: 800; }
.who span { font-size: 12px; font-weight: 700; }
.nums { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.nums b { color: var(--text); font-size: 15px; }
.meters { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
#glass {
  width: 24px; height: 34px; border: 2px solid rgba(220, 240, 255, 0.7); border-top: 0;
  border-radius: 0 0 6px 6px; position: relative; overflow: hidden; flex: none;
}
#glassFill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(#fff7e0 0 4px, #e8a21c 4px);
  transition: height 0.35s;
}
.phe { flex: 1; }
.phe-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 600; }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-top: 4px; }
#pheFill { height: 100%; width: 0; background: var(--ok); transition: width 0.4s, background 0.4s; }

#topbar {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
#topbar .btns { display: flex; gap: 8px; }
.home {
  height: 42px; padding: 0 14px; border-radius: 12px; font-weight: 700; font-size: 14px;
  background: var(--panel); border: 1px solid var(--line);
}
.live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; box-shadow: 0 0 8px var(--ok); }

#hint { position: absolute; bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); white-space: nowrap; color: var(--muted); }

#bottom {
  position: absolute; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; gap: 10px;
}
#actions { flex: 1; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.act {
  position: relative; width: 74px; height: 70px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: transform 0.08s, background 0.2s;
  touch-action: manipulation;
}
.act:active, .act.holding { transform: scale(0.94); background: rgba(255, 196, 64, 0.25); }
.act .ic { font-size: 24px; line-height: 1; }
.act .lb { font-size: 12px; font-weight: 700; }
.act kbd { position: absolute; top: 4px; right: 4px; font-size: 9px; }
.act small { font-size: 9px; color: var(--muted); }
.act.big { width: 96px; background: linear-gradient(160deg, #ffcf4a, #f08a1c); color: #2a1600; border: 0; }
.act.big .lb { font-size: 15px; font-weight: 900; }
.act.big kbd { background: rgba(0, 0, 0, 0.15); color: #4a2a00; }
.act.pulse { animation: pulse 0.4s ease-in-out 4; }
@keyframes pulse { 50% { transform: scale(1.15); box-shadow: 0 0 30px var(--gold); } }

#vovaiBtn {
  position: absolute; bottom: calc(100px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 999px; font-weight: 800;
  background: #3a8bff; color: #fff; box-shadow: 0 6px 24px rgba(58, 139, 255, 0.5);
  animation: bob 1s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateX(-50%) translateY(-4px); } }

#phrases {
  position: absolute; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 24px)); max-height: 50vh; overflow: auto;
  padding: 8px; display: grid; gap: 4px;
}
#phrases button { text-align: left; padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
#phrases button:hover { background: rgba(255, 255, 255, 0.08); }

#countdown {
  position: fixed; top: 32%; left: 50%; transform: translate(-50%, -50%) scale(0.6);
  font: 900 clamp(64px, 14vw, 140px) var(--font); color: #fff; opacity: 0; pointer-events: none;
  text-shadow: 0 6px 0 #00000066, 0 0 40px #ffb04088;
}
#countdown.show { animation: pop 0.56s ease-out; }
#countdown.go { color: var(--gold-2); }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }

#banner {
  position: fixed; top: 22%; left: 50%; transform: translateX(-50%);
  padding: 14px 26px; border-radius: 999px; pointer-events: none; opacity: 0;
  font: 900 clamp(20px, 4vw, 30px) var(--font); color: #2a1600; white-space: nowrap;
  background: linear-gradient(160deg, #ffe07a, #f39a1c); box-shadow: 0 10px 40px rgba(255, 170, 40, 0.5);
}
#banner.show { animation: banner 2.2s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) scale(0.6); } 12% { opacity: 1; transform: translateX(-50%) scale(1.08); } 20% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-20px); } }

#toasts {
  position: fixed; top: calc(130px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(520px, calc(100vw - 32px));
}
.toast {
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; font-weight: 600; text-align: center;
  animation: tin 0.25s ease-out; transition: opacity 0.4s, transform 0.4s;
}
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

#gucOverlay {
  position: fixed; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px;
  background: rgba(5, 3, 12, 0.72); pointer-events: none; padding: 16px;
}
#gucOverlay .zzz { font: 900 54px var(--font); animation: bob2 2s ease-in-out infinite; }
#gucOverlay p { color: var(--muted); max-width: 360px; margin: 0 auto; }
@keyframes bob2 { 50% { transform: translateY(-8px) rotate(-4deg); } }

/* ---------- Lobby & modal ---------- */
#lobby, .modal {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: radial-gradient(ellipse at 50% 30%, rgba(21, 18, 38, 0.2), rgba(10, 8, 20, 0.75));
}
.modal { background: rgba(8, 6, 16, 0.7); z-index: 5; }
.card {
  position: relative; width: min(440px, 100%);
  background: rgba(24, 20, 42, 0.9); border: 1px solid var(--line); border-radius: 22px;
  padding: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.brand { text-align: center; margin-bottom: 14px; }
.logo { font-weight: 900; font-size: 46px; letter-spacing: -1px; line-height: 0.95; color: var(--gold-2); text-shadow: 0 4px 0 #b3171d; }
.logo span { display: block; font-size: 22px; letter-spacing: 9px; color: #fff; text-shadow: none; margin-top: 4px; }
.tag { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.tag b { color: var(--gold-2); }

.field { display: block; margin-top: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.row { display: flex; gap: 8px; }
input#nameInput {
  flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06); color: var(--text); padding: 0 14px; font: 700 16px var(--font);
  user-select: text;
}
input#nameInput:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
#shirts { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); }
.swatch.on { outline: 3px solid var(--gold); outline-offset: 2px; }

#rooms { display: grid; gap: 6px; }
.room {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); text-align: left;
}
.room.on { border-color: var(--gold); background: rgba(255, 196, 64, 0.12); }
.room .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.room .rname { font-weight: 700; }
.room .rn { font-size: 12px; color: var(--muted); }
.room .tag { margin: 0; font-size: 11px; font-weight: 800; color: var(--gold-2); }

.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.check b { color: var(--text); }

.primary {
  width: 100%; height: 52px; margin-top: 16px; border-radius: 14px;
  background: linear-gradient(160deg, #ffcf4a, #f08a1c); color: #2a1600; font-weight: 900; font-size: 18px;
  box-shadow: 0 8px 24px rgba(240, 138, 28, 0.35);
}
.link { display: block; margin: 12px auto 0; color: var(--muted); font-weight: 600; font-size: 14px; }
.link:hover { color: var(--text); }
.foot { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.foot b { color: #ff8a7a; }

.card h2 { margin: 0 0 12px; font-size: 22px; font-weight: 900; }
.x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); font-weight: 700; font-size: 13px; }
.tab.on { background: var(--gold); color: #2a1600; }
#topList { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#topList li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
#topList li.empty { display: block; text-align: center; color: var(--muted); }
#topList .pos { font-weight: 900; text-align: center; }
#topList .tn { font-weight: 700; display: flex; flex-direction: column; }
#topList .tn small { font-size: 11px; }
#topList .tv { font-weight: 900; color: var(--gold-2); }

#cardHolder canvas { width: 100%; height: auto; border-radius: 14px; display: block; }
.warn { text-align: center; color: #ff8a7a; font-size: 14px; }
#summary .row .primary { margin-top: 0; flex: 2; height: 48px; font-size: 16px; }
#summary .row button:not(.primary) { flex: 1; border-radius: 14px; background: rgba(255, 255, 255, 0.08); font-weight: 700; }

/* ---------- Bàn riêng, trò chơi ---------- */
.invite { background: linear-gradient(160deg, #3a8bff, #2563d6); border: 0; }
.invite-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(58, 139, 255, 0.15); border: 1px solid rgba(58, 139, 255, 0.4); font-size: 14px; font-weight: 600; }
.room.priv .dot { background: #3a8bff; }
.room.priv .tag { color: #8cbcff; }
.priv-btn { width: 100%; margin-top: 8px; padding: 11px; border-radius: 12px; border: 1px dashed rgba(140, 188, 255, 0.6); color: #cfe2ff; font-weight: 700; font-size: 14px; }
.priv-btn:hover { background: rgba(58, 139, 255, 0.12); }

#gameMenu, #rpsPanel, #duelInvite, #duelBox {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(170px + env(safe-area-inset-bottom)); width: min(400px, calc(100vw - 24px)); padding: 10px;
}
#gameMenu { display: grid; gap: 4px; }
#gameMenu button { display: flex; gap: 12px; align-items: center; text-align: left; padding: 10px; border-radius: 12px; }
#gameMenu button:hover { background: rgba(255, 255, 255, 0.08); }
#gameMenu .gi { font-size: 28px; }
#gameMenu b { display: block; font-size: 15px; }
#gameMenu small { color: var(--muted); font-size: 12px; }
.gtip { margin: 4px 6px 2px; font-size: 12px; color: var(--gold-2); }

#rpsPanel { text-align: center; border-color: var(--gold); }
.rps-title { font-weight: 800; font-size: 16px; }
.rps-title span { display: block; font-weight: 600; font-size: 13px; color: var(--muted); margin-top: 2px; }
.rps-btns { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.rps-btns button { width: 84px; height: 84px; border-radius: 18px; font-size: 40px; background: rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rps-btns button small { font-size: 12px; font-weight: 700; }
.rps-btns button:not(:disabled):hover { background: rgba(255, 196, 64, 0.25); }
#rpsBar { height: 100%; width: 100%; background: var(--gold); }

#duelInvite { text-align: center; border-color: #ff6b4a; }
#duelInvite p { margin: 4px 0 10px; font-size: 16px; }
#duelInvite .primary { margin: 0; height: 46px; flex: 2; font-size: 16px; }
#duelInvite .row button:not(.primary) { flex: 1; border-radius: 14px; background: rgba(255, 255, 255, 0.08); font-weight: 700; }

#duelBox { border-color: #ff6b4a; }
.duel-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; margin: 4px 0; font-weight: 700; font-size: 13px; }
.duel-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-row .bar { height: 14px; margin: 0; }
#duelBarA, #duelBarB { height: 100%; width: 0; background: linear-gradient(90deg, #ffcf4a, #f08a1c); transition: width 0.12s; }
#duelStatus { text-align: center; font-weight: 800; margin: 6px 0; color: var(--gold-2); }
#duelTap { width: 100%; height: 64px; border-radius: 16px; font: 900 24px var(--font); color: #2a1600; background: linear-gradient(160deg, #ffcf4a, #f08a1c); touch-action: manipulation; }
#duelTap.bump { animation: bump 0.12s; }
@keyframes bump { 50% { transform: scale(0.95); } }

/* ---------- Nhiệm vụ, tủ đồ, giờ vàng, tường ---------- */
.goal {
  display: block; width: 100%; margin-top: 8px; padding: 6px 8px; border-radius: 10px; text-align: left;
  background: rgba(255, 196, 64, 0.12); color: var(--gold-2); font-size: 12px; font-weight: 700;
}
.goal:empty { display: none; }
.icon { position: relative; }
.badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font: 800 11px/18px var(--font);
}
.golden {
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #2a1600;
  background: linear-gradient(160deg, #ffe07a, #f39a1c); box-shadow: 0 0 18px rgba(255, 170, 40, 0.5);
}
.lobby-golden { margin: 12px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--gold-2); }
.links { justify-content: center; gap: 16px; }
.links .link { margin: 10px 0 0; }
.muted { color: var(--muted); font-size: 13px; }

#questModal .card, #wallModal .card { max-height: calc(100vh - 32px); overflow: auto; }
.q-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-weight: 800; }
.q-item { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); margin-bottom: 8px; }
.q-item.done { background: rgba(87, 199, 122, 0.14); }
.q-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.q-top span:last-child { color: var(--gold-2); white-space: nowrap; }
.q-item .bar { height: 8px; margin-top: 8px; }
.q-item .bar div { height: 100%; background: var(--gold); }
.q-item.done .bar div { background: var(--ok); }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.shop-item { padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; gap: 6px; }
.shop-item .si { font-size: 26px; }
.shop-item b { font-size: 13px; }
.shop-item button { padding: 7px; border-radius: 10px; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, 0.1); }
.shop-item button.buy { background: linear-gradient(160deg, #ffcf4a, #f08a1c); color: #2a1600; }
.shop-item button.on { background: var(--ok); color: #082a12; }

#wallCompose textarea {
  width: 100%; min-height: 70px; resize: vertical; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06); color: var(--text); padding: 10px 12px; font: 600 15px var(--font); user-select: text;
}
#wallCompose .row { justify-content: space-between; align-items: center; margin: 6px 0 12px; }
.primary.small { width: auto; height: 40px; margin: 0; padding: 0 16px; font-size: 14px; }
#wallList { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#wallList li { padding: 12px; border-radius: 12px; background: #fff6c4; color: #2a2622; transform: rotate(var(--rot, 0deg)); }
#wallList li:nth-child(4n + 2) { background: #ffd6e0; }
#wallList li:nth-child(4n + 3) { background: #d4f5d4; }
#wallList li:nth-child(4n + 4) { background: #d6e8ff; }
#wallList .wt { font-size: 15px; font-weight: 600; line-height: 1.4; word-break: break-word; }
#wallList .wm { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: #6b6458; }
#wallList .wm b { color: #2a2622; }
#wallList .wm .sp { flex: 1; }
#wallList .like { padding: 5px 10px; border-radius: 999px; background: #2a2622; color: #fff; font-weight: 800; font-size: 13px; }
#wallList .like:disabled { opacity: 0.55; }
#wallList .rep { color: #9a8f7c; font-size: 12px; }
#wallList li.empty { background: rgba(255, 255, 255, 0.05); color: var(--muted); text-align: center; }

/* ---------- Thực đơn, PG ---------- */
.beer-now { margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#promoBtn {
  position: absolute; bottom: calc(150px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 999px; font-weight: 800; white-space: nowrap;
  background: linear-gradient(160deg, #ff7ab8, #e0407e); color: #fff; box-shadow: 0 6px 24px rgba(224, 64, 126, 0.5);
  animation: bob 1s ease-in-out infinite;
}
#menuModal .card { max-height: calc(100vh - 32px); overflow: auto; }
.menu-item { display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); margin-bottom: 8px; }
.mi-txt b { display: block; font-size: 14px; }
.mi-txt small { display: block; color: var(--muted); font-size: 12px; }
.mi-txt small.have { color: var(--gold-2); font-weight: 700; }
.mi-btns { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; }
.mi-btns button { padding: 7px 12px; border-radius: 10px; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, 0.1); }
.mi-btns button.buy { background: linear-gradient(160deg, #ffcf4a, #f08a1c); color: #2a1600; }
.mi-btns button.on { background: var(--ok); color: #082a12; }
.mi-icon { font-size: 30px; text-align: center; grid-row: span 2; }
.mi-glass {
  grid-row: span 2; width: 30px; height: 42px; margin: 0 auto; border-radius: 0 0 6px 6px; border: 2px solid rgba(220, 240, 255, 0.7); border-top: 0;
  background: linear-gradient(var(--foam) 0 8px, var(--beer) 8px);
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  #statsCard { min-width: 0; padding: 10px 12px; right: auto; max-width: 56vw; }
  .who b { font-size: 14px; }
  .nums { gap: 10px; font-size: 12px; }
  #topbar .pill { display: none; }
  .home { padding: 0 10px; font-size: 13px; }
  .act { width: calc((100vw - 24px - 64px - 4 * 6px) / 5); height: 58px; }
  .act.big { width: calc((100vw - 24px - 64px - 4 * 6px) / 5); }
  .act .ic { font-size: 21px; }
  .act .lb, .act.big .lb { font-size: 10px; }
  .act kbd, .act small { display: none; }
  .home span { display: none; }
  .home { width: 42px; padding: 0; font-size: 19px; }
  /* 6 nút xếp 2 hàng bên phải, chừa chỗ cho thẻ thông tin bên trái */
  #topbar .btns { gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 138px; }
  #statsCard { max-width: calc(100vw - 24px - 146px); }
  .golden { font-size: 11px; padding: 4px 8px; }
  #gameMenu, #rpsPanel, #duelInvite, #duelBox { bottom: calc(150px + env(safe-area-inset-bottom)); }
  #actions { gap: 6px; }
  #hint { font-size: 12px; white-space: normal; text-align: center; width: calc(100vw - 32px); }
}
@media (hover: none) { kbd { display: none; } }
