/* Chợ Lạc Xoong — chợ trời, bạt sọc, bìa carton viết bút lông. */
:root {
  --night: #141c2b;
  --night-glass: rgba(20, 28, 43, 0.74);
  --kraft: #c8a06a;
  --kraft-face: #d8b885;
  --kraft-edge: #8e6a3c;
  --paper: #f3e7cf;
  --ink: #1e1b18;
  --ink-soft: #3f3428;
  --tarp: #2e6db4;
  --stool: #d63a2f;
  --stool-deep: #a92a22;
  --bulb: #ffc86b;
  --ok: #3fbf6f;

  --f-sign: 'Bungee', 'Be Vietnam Pro', system-ui, sans-serif;
  --f-hand: 'Sriracha', 'Be Vietnam Pro', system-ui, sans-serif;
  --f-body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 10px;
  --drawer-w: 384px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
/* nền chỉ đặt ở html: nền của body sẽ vẽ ĐÈ lên lớp video chiếu live (z-index âm) nằm sau khung 3D */
html { background: var(--night); }
body {
  font: 400 15px/1.5 var(--f-body);
  color: #fff;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#scene.is-hovering { cursor: pointer; }
#scene.is-dragging { cursor: grabbing; }

:focus-visible { outline: 3px solid var(--bulb); outline-offset: 2px; }
.cardboard :focus-visible { outline-color: var(--tarp); }

/* ───────── bìa carton ───────── */
.cardboard {
  color: var(--ink);
  background-color: var(--kraft);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .21 0 0 0 0 .1 0 0 0 .28 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(170deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.06));
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 1px rgba(110, 76, 36, 0.45),
    inset 0 0 28px rgba(110, 76, 36, 0.28),
    0 18px 44px rgba(0, 0, 0, 0.5);
}
.marker { font-family: var(--f-hand); font-weight: 400; letter-spacing: 0.005em; }
.eyebrow {
  margin: 0;
  font: 600 12px/1.2 var(--f-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stool-deep);
}

/* ───────── nút ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  font: 600 15px/1 var(--f-body);
  border: 0; border-radius: 12px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.12s var(--ease-out), filter 0.12s, box-shadow 0.12s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
/* đỏ ghế nhựa: bóng phía trên, gờ phía dưới */
.btn-red {
  color: #fff; background: var(--stool);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.22), 0 6px 18px rgba(214, 58, 47, 0.32);
}
.btn-red:hover { filter: brightness(1.07); }
.btn-blue {
  color: #fff; background: var(--tarp);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18), inset 0 -3px 0 rgba(0, 0, 0, 0.22);
}
.btn-blue:hover { filter: brightness(1.08); }
.btn-ghost {
  color: #fff; background: var(--night-glass);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(32, 44, 66, 0.86); }
.btn-plain { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(30, 27, 24, 0.55); }
.btn-plain:hover { background: rgba(30, 27, 24, 0.07); }
.btn-link {
  background: none; border: 0; padding: 4px 0; min-height: 0;
  color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600;
}
.btn-danger { color: var(--stool-deep); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; }

.badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px;
  border-radius: 10px; background: var(--stool); color: #fff; font-size: 12px; font-weight: 800;
}

/* ───────── màn vào chợ ───────── */
.intro {
  position: fixed; inset: 0; z-index: 30;
  display: grid; align-items: center;
  padding: 24px max(24px, 7vw);
  background: radial-gradient(120% 90% at 20% 60%, rgba(10, 14, 22, 0.55), rgba(10, 14, 22, 0) 70%);
  transition: opacity 0.6s ease;
}
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro-card {
  position: relative;
  width: min(500px, 100%);
  padding: 34px 32px 26px;
  transform: rotate(-1.4deg);
  transition: transform 0.55s var(--ease-out);
}
.intro.is-leaving .intro-card { transform: translateY(40px) rotate(-6deg); }
.tape {
  position: absolute; top: -12px; width: 92px; height: 26px;
  background: rgba(240, 228, 196, 0.72);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.tape-l { left: 18px; transform: rotate(-8deg); }
.tape-r { right: 22px; transform: rotate(6deg); }
.intro-title {
  margin: 6px 0 10px;
  font: 400 clamp(42px, 5.4vw, 58px)/1 var(--f-hand);
  color: var(--ink);
  letter-spacing: -0.01em;
}
.intro-lede { margin: 0 0 22px; font-size: 16px; color: var(--ink-soft); max-width: 34ch; }
.intro-form { display: grid; gap: 8px; }
.intro-form > label, .intro-shirt legend { font-weight: 600; }
.intro-shirt { margin: 8px 0 0; padding: 0; border: 0; min-width: 0; }
.intro-shirt legend { padding: 0; margin-bottom: 8px; }
.intro-enter { justify-self: start; min-width: 170px; margin-top: 10px; }
.intro-stats { margin: 16px 0 0; font-size: 13px; color: var(--ink-soft); }
.intro-switch { margin-left: 6px; }

/* ───────── ô nhập trên bìa ───────── */
.field { display: grid; gap: 6px; }
.field > span, .field > label, .legend { font-weight: 600; font-size: 14px; }
.field small, .help { font-size: 13px; color: var(--ink-soft); }
input[type='text'], input[type='search'], input[type='url'], input:not([type]), textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid rgba(30, 27, 24, 0.55);
  border-radius: 9px;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #7d6d58; }
.form-error {
  margin: 10px 0 0; padding: 8px 12px; border-radius: 8px;
  background: rgba(169, 42, 34, 0.12); color: #7c1d17; font-weight: 600; font-size: 14px;
}

/* ───────── HUD ───────── */
.hud { position: fixed; z-index: 10; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top {
  top: max(14px, env(safe-area-inset-top)); left: 16px; right: 16px;
  display: flex; align-items: flex-start; gap: 16px;
}
.brand {
  margin: 0; padding: 7px 14px 5px;
  font: 400 22px/1 var(--f-hand);
  color: var(--ink);
  background: var(--kraft);
  border-radius: 4px;
  transform: rotate(-2deg);
  box-shadow: inset 0 0 0 1px rgba(110, 76, 36, 0.45), 0 8px 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.search { position: relative; flex: 0 1 600px; margin: 0 auto; display: grid; gap: 8px; min-width: 0; }
body.has-drawer .hud-top { right: calc(var(--drawer-w) + 32px); }
.search input {
  min-height: 46px; padding-left: 16px;
  background: rgba(243, 231, 207, 0.96);
  border: 0; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
/* một hàng, kéo qua lại (chuột kéo / lăn chuột / vuốt); hai mép mờ dần báo còn chip bị che */
.chips {
  display: flex; flex-wrap: nowrap; gap: 6px; padding-bottom: 2px;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  cursor: grab; user-select: none; -webkit-user-select: none;
  --fade-l: 0px; --fade-r: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}
.chips::-webkit-scrollbar { display: none; }
.chips.more-l { --fade-l: 36px; }
.chips.more-r { --fade-r: 36px; }
.chips.is-dragging { cursor: grabbing; }
.chips.is-dragging .chip { pointer-events: none; }
.chip {
  flex: none; min-height: 34px; padding: 0 12px;
  border-radius: 17px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--night-glass); color: #fff; font-size: 13.5px; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}
.chip:hover { background: rgba(32, 44, 66, 0.9); }
.chip[aria-pressed='true'] { background: var(--bulb); border-color: var(--bulb); color: var(--ink); }

.results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  max-height: min(56vh, 460px); overflow: auto;
  padding: 10px;
}
.results-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 6px 8px; }
.results-head strong { font: 400 20px/1 var(--f-hand); }
.results-head span { font-size: 13px; color: var(--ink-soft); }
.result {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 8px; border: 0; border-radius: 8px;
  background: transparent; text-align: left; cursor: pointer; color: var(--ink);
}
.result:hover, .result:focus-visible { background: rgba(255, 255, 255, 0.28); }
.result-swatch { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 22px; }
.result-name { display: block; font-weight: 700; }
.result-meta { display: block; font-size: 13px; color: var(--ink-soft); }
.result-price { font: 400 18px/1 var(--f-hand); }
.results-empty { padding: 10px 8px 6px; }
.results-empty p { margin: 0 0 10px; }

.hud-bottom {
  bottom: max(14px, env(safe-area-inset-bottom)); left: 16px; right: 16px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.hint, .online {
  margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.hud .hint { flex: 1; align-self: flex-end; padding-bottom: 12px; text-align: center; pointer-events: none; }

/* ───────── chat chung ───────── */
.lobby {
  flex: none; width: 360px; max-width: 100%;
  display: flex; flex-direction: column;
  background: rgba(14, 19, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.lobby-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; background: transparent; color: #fff; cursor: pointer; text-align: left;
}
.lobby-title { font: 400 19px/1 var(--f-hand); }
.lobby-head .online { margin-left: auto; text-shadow: none; }
.lobby-chevron::before { content: '▾'; font-size: 14px; opacity: 0.7; }
.lobby.is-collapsed .lobby-chevron::before { content: '▴'; }
.lobby.is-collapsed .lobby-body { display: none; }
.lobby-log {
  list-style: none; margin: 0; padding: 0 6px 6px;
  height: 210px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 1px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.lobby-log > li:first-child { margin-top: auto; }
.lobby-msg {
  display: block; width: 100%; padding: 4px 7px; border: 0; border-radius: 8px;
  background: transparent; color: rgba(255, 255, 255, 0.92); text-align: left;
  font-size: 14px; line-height: 1.4; overflow-wrap: anywhere;
}
button.lobby-msg { cursor: pointer; }
button.lobby-msg:hover, button.lobby-msg:focus-visible { background: rgba(255, 255, 255, 0.09); }
.lobby-name { font-weight: 700; }
.lobby-empty { padding: 8px 7px; font-size: 13px; color: rgba(255, 255, 255, 0.6); }
.lobby-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.lobby-form input { min-height: 36px; padding: 6px 10px; font-size: 14px; border: 0; background: rgba(243, 231, 207, 0.96); }

.menu {
  position: fixed; left: 0; top: 0; z-index: 45; min-width: 210px;
  display: grid; padding: 6px; border-radius: 12px;
  background: var(--paper); color: var(--ink); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.menu-title { margin: 4px 8px 6px; font: 400 19px/1.1 var(--f-hand); }
.menu button {
  padding: 9px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font-weight: 600; text-align: left; cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: rgba(30, 27, 24, 0.09); }
.menu-fight {
  display: grid; grid-template-columns: repeat(3, auto); gap: 2px;
  margin-top: 4px; padding-top: 6px; border-top: 1px dashed rgba(30, 27, 24, 0.28);
}
.menu-label { grid-column: 1 / -1; margin: 0 8px 2px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.menu-fight button { padding: 8px 7px; text-align: center; white-space: nowrap; }
.hint kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; margin: 0 1px;
  border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.3);
  font: 600 11px/1.5 var(--f-body); text-align: center; background: rgba(255, 255, 255, 0.08);
}
.online { display: flex; align-items: center; gap: 7px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.hud-actions { display: flex; gap: 10px; }

/* ───────── tooltip & toast ───────── */
.tooltip {
  position: fixed; z-index: 15; left: 0; top: 0;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(14, 19, 30, 0.86); color: #fff;
  font-size: 13px; font-weight: 600; pointer-events: none; white-space: nowrap;
}
.tooltip small { display: block; font-weight: 400; color: rgba(255, 255, 255, 0.72); }
.toasts {
  position: fixed; z-index: 40; left: 50%; bottom: 84px; transform: translateX(-50%);
  display: grid; gap: 8px; width: min(420px, calc(100% - 32px));
}
.toast {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(14, 19, 30, 0.94); color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.28s var(--ease-out);
}
.toast p { margin: 0; font-size: 14px; }
.toast .btn { flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ───────── ngăn kéo bên phải ───────── */
.drawer {
  position: fixed; z-index: 20;
  top: 16px; right: 16px; bottom: 16px; width: var(--drawer-w);
  display: flex; flex-direction: column;
  animation: drawer-in 0.32s var(--ease-out);
}
@keyframes drawer-in { from { opacity: 0; transform: translateX(24px); } }
.drawer-close {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(30, 27, 24, 0.08); color: var(--ink);
  font-size: 26px; line-height: 1; cursor: pointer;
}
.drawer-close:hover { background: rgba(30, 27, 24, 0.16); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 22px 20px; display: grid; align-content: start; gap: 16px; }
.drawer-title { margin: 0; padding-right: 40px; font: 400 32px/1.05 var(--f-hand); }
.drawer-sub { margin: -10px 0 0; font-size: 13px; color: var(--ink-soft); }
.section-label {
  margin: 4px 0 -4px;
  font: 600 12px/1.2 var(--f-body); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--stool-deep);
  display: flex; align-items: center; gap: 10px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: rgba(30, 27, 24, 0.25); }

/* biển hiệu thu nhỏ ở đầu sạp */
.stall-sign {
  margin: -22px -22px 0; padding: 22px 64px 16px 22px;
  border-radius: 6px 6px 0 0;
  border-bottom: 4px solid rgba(0, 0, 0, 0.18);
}
.stall-sign .drawer-title { color: inherit; padding-right: 0; }
.stall-sign .drawer-sub { margin: 4px 0 0; color: inherit; opacity: 0.85; }
.stall-sign.font-sign .drawer-title { font-family: var(--f-sign); font-size: 26px; text-transform: uppercase; line-height: 1.15; }
.stall-sign.font-plain .drawer-title { font-family: var(--f-body); font-weight: 800; font-size: 28px; }

.item { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start; }
.item-photo {
  width: 112px; aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden;
  background: var(--paper); padding: 6px 6px 18px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28); transform: rotate(-2deg);
}
.item-photo img, .item-photo .emoji-tile { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; border-radius: 2px; }
.emoji-tile { font-size: 46px; }
.item-title { margin: 0 0 6px; font-size: 18px; font-weight: 700; line-height: 1.25; }
.price-tag {
  display: inline-block; position: relative;
  padding: 4px 14px 2px 24px;
  font: 400 26px/1.2 var(--f-hand);
  background: var(--kraft-face); color: var(--ink);
  border-radius: 3px 10px 10px 3px;
  box-shadow: inset 0 0 0 1px rgba(110, 76, 36, 0.4), 0 3px 8px rgba(0, 0, 0, 0.2);
  transform: rotate(2.5deg);
}
.price-tag::before {
  content: ''; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--kraft-edge);
}
.item-desc { margin: 0; white-space: pre-line; }
.seller { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.seller-dot { width: 10px; height: 10px; border-radius: 50%; background: #8b7d6a; flex: none; }
.seller-dot.is-on { background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 191, 111, 0.25); }
.leave-link { justify-content: space-between; width: 100%; }
.leave-link small { font-weight: 400; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; }
.note { margin: 0; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.22); font-size: 14px; }

/* chat */
.chat { display: grid; gap: 10px; }
.owner-actions { display: flex; gap: 16px; align-items: center; }
.chat-log {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 260px; min-height: 64px; overflow-y: auto;
  padding: 10px; border-radius: 10px; background: rgba(30, 27, 24, 0.1);
}
.chat-empty { margin: auto; text-align: center; font-size: 14px; color: var(--ink-soft); }
.bubble {
  max-width: 82%; padding: 7px 11px; border-radius: 14px 14px 14px 4px;
  background: var(--paper); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 14.5px; line-height: 1.4;
}
.bubble.is-mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--tarp); color: #fff; }
.bubble time { display: block; margin-top: 2px; font-size: 11px; opacity: 0.7; }
.bubble-name { display: block; margin-bottom: 1px; font-size: 12px; font-weight: 800; }
.chat-note { margin: 2px 0; align-self: center; font-size: 12px; color: var(--ink-soft); }
.car-leave { margin-top: 12px; justify-self: start; }
.car-tag {
  padding: 4px 10px 5px; border-radius: 999px; margin-bottom: 6px;
  background: rgba(14, 19, 30, 0.82); color: #ffe2b0; font: 600 13px/1.2 var(--f-body); white-space: nowrap;
}
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button {
  min-height: 32px; padding: 0 11px; border-radius: 16px; cursor: pointer;
  border: 1px dashed rgba(30, 27, 24, 0.55); background: transparent; color: var(--ink); font-size: 13px;
}
.quick button:hover { background: rgba(255, 255, 255, 0.25); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { min-height: 44px; height: 44px; max-height: 120px; resize: none; }

/* danh sách tin nhắn */
.threads { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.thread {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center;
  width: 100%; padding: 10px; border: 0; border-radius: 8px; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, 0.16); color: var(--ink);
}
.thread:hover, .thread:focus-visible { background: rgba(255, 255, 255, 0.32); }
.thread-swatch { width: 12px; height: 36px; border-radius: 3px; }
.thread-swatch.is-person { height: 12px; border-radius: 50%; }
.thread-name { display: block; font-weight: 700; }
.thread-last { display: block; font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.thread-time { font-size: 12px; color: var(--ink-soft); text-align: right; }
.thread.is-unread .thread-name::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--stool); }
.back { justify-self: start; }

/* form dựng sạp */
.stall-form { display: grid; gap: 14px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg label {
  display: grid; place-items: center; min-height: 48px; padding: 4px; border-radius: 9px; cursor: pointer;
  background: var(--paper); border: 1.5px solid rgba(30, 27, 24, 0.3); text-align: center; line-height: 1.1;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); background: #fff7e6; }
.seg input:focus-visible + label { outline: 3px solid var(--tarp); outline-offset: 2px; }
.seg .f-sign { font-family: var(--f-sign); font-size: 13px; }
.seg .f-hand { font-family: var(--f-hand); font-size: 18px; }
.seg .f-plain { font-weight: 800; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatches input[type='radio'] { position: absolute; opacity: 0; pointer-events: none; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(30, 27, 24, 0.35);
}
.swatches input:checked + .swatch { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), 0 0 0 3px var(--ink); }
.swatches input:focus-visible + .swatch { outline: 3px solid var(--tarp); outline-offset: 3px; }
.swatch-custom { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; background: conic-gradient(#d63a2f, #e8b21e, #2f8f5b, #2e6db4, #6b4fa8, #d63a2f); }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch-custom.is-active { box-shadow: 0 0 0 3px var(--ink); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.emoji-grid input { position: absolute; opacity: 0; pointer-events: none; }
.emoji-grid label { display: grid; place-items: center; height: 38px; border-radius: 8px; cursor: pointer; font-size: 20px; }
.emoji-grid label:hover { background: rgba(255, 255, 255, 0.28); }
.emoji-grid input:checked + label { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ink); }
.emoji-grid input:focus-visible + label { outline: 3px solid var(--tarp); outline-offset: 1px; }
.photo-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.photo-thumb { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: sticky; bottom: -20px; padding: 12px 0 4px; background: linear-gradient(transparent, var(--kraft) 30%); }
.form-actions .btn-red { flex: 1; }
.counter { font-size: 12px; color: var(--ink-soft); justify-self: end; margin-top: -4px; }

/* hộp thoại */
.dialog {
  width: min(400px, calc(100% - 32px)); padding: 22px; border: 0;
}
.dialog::backdrop { background: rgba(8, 11, 18, 0.6); }
.dialog-title { margin: 0 0 6px; font-size: 26px; line-height: 1.1; }
.dialog-text { margin: 0 0 6px; }
.dialog-url {
  margin: 0 0 4px; padding: 8px 10px; border-radius: 8px; background: rgba(30, 27, 24, 0.1);
  font-size: 13px; overflow-wrap: anywhere;
}
.dialog-url strong { font-size: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ───────── điện thoại ───────── */
@media (max-width: 1180px) {
  .hud .hint { display: none; }
}

/* ───────── cảm ứng: cần đi ảo, nút ❓, bảng hướng dẫn ───────── */
.touch-only, .mobile-only { display: none; }
.stick {
  position: fixed; z-index: 12; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom));
  width: 124px; height: 124px; border-radius: 50%;
  background: rgba(14, 19, 30, 0.42); border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.stick::before {
  content: ''; position: absolute; inset: 14px; border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.22);
}
.stick-knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE68A, #FFC414 70%); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s var(--ease-out);
}
.stick.is-on .stick-knob { transition: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); }
.coach { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 14, 0.62); }
.coach-card { width: min(420px, 100%); padding: 22px 20px 18px; display: grid; gap: 14px; }
.coach-title { margin: 0; font: 400 26px/1.1 var(--f-hand); }
.coach-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.4; color: var(--ink); }
.coach-list li { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; }
.coach-ico { font-size: 24px; text-align: center; }
.coach-card .btn { justify-self: stretch; }
@media (pointer: coarse) {
  .touch-only { display: inline-flex; }
  .hud-bottom { padding-left: 140px; } /* chừa chỗ cho cần đi ở góc trái */
  body.has-drawer .stick, body.lobby-open .stick, body.loto-open .stick { display: none; }
}

/* ───────── điện thoại ───────── */
@media (max-width: 760px) {
  body { touch-action: manipulation; } /* không zoom khi chạm đúp lên nút */
  .hud-top { left: 8px; right: 8px; top: max(8px, env(safe-area-inset-top)); flex-direction: column; gap: 6px; }
  .brand { display: none; }
  .search { flex: none; width: 100%; margin: 0; gap: 6px; }
  .search input { min-height: 40px; font-size: 16px; } /* 16px: iOS không tự zoom khi gõ */
  .chip { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
  /* bảng sân khấu nằm ngay dưới ô tìm, mở ra tối đa 42% màn hình */
  .hud-top .stage-panel { position: static; width: 100%; max-height: 42dvh; overflow: auto; } /* .hud-top: thắng quy tắc gốc nằm phía dưới */
  .stage-body { max-height: none; }
  /* thanh nút tròn dọc bên phải; chat thu thành nút 💬 */
  .hud-bottom { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); padding-left: 0; flex-wrap: nowrap; justify-content: flex-end; }
  .hint { display: none; }
  .mobile-only { display: inline-flex; }
  .hud-actions { flex-direction: column; align-items: center; gap: 19px; padding-bottom: 12px; }
  .hud-actions .btn {
    position: relative; width: 42px; height: 42px; min-height: 0; padding: 0; border-radius: 50%; overflow: visible;
    justify-content: center; font-size: 0; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }
  .hud-actions .btn::before { content: attr(data-ico); font-size: 20px; line-height: 1; }
  /* nhãn nhỏ dưới mỗi nút tròn để biết nút gì */
  .hud-actions .btn::after {
    content: attr(data-label); position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
    font: 700 10.5px/1 var(--f-body); color: #fff; letter-spacing: 0.01em; white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.7);
  }
  .hud-actions .btn .badge { position: absolute; top: -4px; right: -4px; font-size: 11px; }
  .lobby {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; width: auto; max-height: 62dvh;
    border-radius: 16px 16px 0 0; animation: sheet-in 0.25s var(--ease-out) both;
  }
  .lobby.is-collapsed { display: none; }
  .lobby-log { height: 34dvh; }
  .lobby-form input { font-size: 16px; }
  body .loto-card { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; z-index: 30; }
  .drawer {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    max-height: 72dvh; border-radius: 16px 16px 0 0;
    animation-name: sheet-in;
  }
  .stall-sign { border-radius: 16px 16px 0 0; }
  .drawer-body { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .intro { align-items: end; padding: 16px; }
  .intro-card { padding: 28px 22px 20px; }
  .intro-enter { justify-self: stretch; }
  /* thông báo & băng rôn lên phía trên, không đè cần đi và nút */
  .toasts { top: calc(env(safe-area-inset-top) + 98px); bottom: auto; width: calc(100% - 16px); }
  body .rao-banner { top: calc(env(safe-area-inset-top) + 52px); max-width: calc(100vw - 16px); }
  .menu { max-width: calc(100vw - 16px); }
  body.has-drawer .hud-bottom,
  body.has-drawer .hud-top { display: none; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(40px); } }

/* ───────── tờ dò lô tô ───────── */
.loto-card {
  position: fixed; z-index: 12; right: 16px; bottom: 84px; width: min(340px, calc(100vw - 32px));
  padding: 12px 14px 12px;
}
.loto-head { display: flex; align-items: center; justify-content: space-between; }
.loto-title { margin: 0; font: 400 20px/1.1 var(--f-hand); }
.loto-round { font: 600 13px var(--f-body); color: var(--ink-soft); }
.loto-close { position: static; }
.loto-board { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; }
.loto-label { font-size: 12px; color: var(--ink-soft); }
.loto-last {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: #fff; color: #B3261E; border: 3px solid #FF3FA4; font: 400 20px/1 var(--f-sign);
}
.loto-count { margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.loto-grid { display: grid; gap: 4px; }
.loto-row { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; padding: 2px; border-radius: 6px; }
.loto-row.is-done { background: rgba(255, 210, 63, 0.55); }
.loto-cell {
  display: grid; place-items: center; height: 30px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.75); font: 700 14px var(--f-body); color: var(--ink);
}
.loto-cell.is-empty { background: rgba(30, 27, 24, 0.08); }
.loto-cell.is-hit { background: #D63A2F; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); }
.loto-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.loto-veso { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.loto-veso b {
  display: grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 4px;
  background: #F7A8C4; color: #6B1239; font: 400 14px var(--f-sign); border: 1px dashed rgba(107, 18, 57, 0.45);
}
.loto-veso b:nth-of-type(2) { background: #A8E6B0; color: #14532D; border-color: rgba(20, 83, 45, 0.45); }
.loto-veso b:nth-of-type(3) { background: #A9CDF5; color: #12355B; border-color: rgba(18, 53, 91, 0.45); }
.loto-veso small { font-weight: 400; color: var(--ink-soft); }
.loto-kinh { min-width: 92px; font: 400 18px var(--f-sign); }
.loto-kinh.is-ready { animation: kinh-pulse 0.8s ease-in-out infinite; }
@keyframes kinh-pulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(214, 58, 47, 0.25); } }
.loto-note { margin: 0; font-size: 12px; line-height: 1.35; color: var(--ink-soft); }

/* ───────── máy gắp thú ───────── */
.claw-dialog { text-align: center; }
.claw-canvas { display: block; width: 300px; max-width: 100%; height: auto; margin: 6px auto; border-radius: 10px; border: 4px solid #E2689A; }
.claw-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.claw-go { min-width: 110px; font: 400 18px var(--f-sign); }
.claw-msg { margin: 0; min-width: 150px; font-size: 13px; text-align: left; }
.claw-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-soft); }
.claw-dialog .dialog-actions { justify-content: center; }

/* ───────── quẻ bói bài chim ───────── */
.fortune-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #5B3A8C; }
.fortune-luck { margin: 10px 0 0; font-size: 13px; font-weight: 600; }

/* ───────── rao hàng ───────── */
.rao-form { display: flex; gap: 6px; }
.rao-form input { flex: 1; min-width: 0; }
.rao-banner {
  position: fixed; z-index: 14; left: 50%; top: 132px; max-width: min(640px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border-radius: 999px;
  background: rgba(122, 15, 25, 0.92); color: #FFF3D6; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  font-size: 14px; transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  transition: transform 0.35s var(--ease-out), opacity 0.35s;
}
.rao-banner.is-in { transform: translate(-50%, 0); opacity: 1; }
.rao-banner.is-new { background: rgba(176, 108, 0, 0.94); color: #FFF8E6; }
.rao-banner.is-new strong { color: #FFE08A; }
.rao-banner.is-new .rao-open { background: #FFF3D6; }
.rao-banner strong { color: #FFD23F; white-space: nowrap; }
.rao-banner .rao-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rao-banner.has-link.is-in { pointer-events: auto; }
.rao-open {
  flex: none; margin-left: 4px; padding: 4px 12px; border: 0; border-radius: 999px;
  background: #FFD23F; color: #3A0A10; font: 700 13px var(--f-body); cursor: pointer;
}
.rao-icon { font-size: 18px; }

/* ───────── hộp mã QR ủng hộ ───────── */
.qr-dialog { text-align: center; }
.qr-img { display: block; width: min(260px, 70vw); height: auto; margin: 6px auto 4px; border-radius: 10px; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.qr-note { margin: 4px 0 10px; font-size: 13px; color: var(--ink-soft); }
.qr-dialog .dialog-actions { justify-content: center; }

/* ───────── bảng Sân khấu: clip YouTube đang phát, hàng chờ ───────── */
.stage-panel {
  position: relative; flex: none; width: min(340px, 34vw);
  border-radius: 14px; overflow: hidden; color: #F2E8D5;
  background: rgba(14, 19, 30, 0.88); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
body.has-drawer .stage-panel { visibility: hidden; } /* ẩn chứ không gỡ: tiếng clip vẫn chạy */
.stage-head { display: flex; align-items: center; padding-right: 6px; }
.stage-toggle {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 10px 12px;
  border: 0; background: none; color: inherit; font: 600 14px/1.2 var(--f-body); text-align: left; cursor: pointer;
}
.stage-toggle:focus-visible, .stage-mute:focus-visible { outline: 3px solid var(--tarp); outline-offset: -3px; }
.stage-mute {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: none; color: inherit; font-size: 16px; cursor: pointer;
}
.stage-mute:hover { background: rgba(255, 255, 255, 0.1); }
/* trình phát ẩn cho nhạc khắp chợ: nằm sau khung 3D, đủ 320×180 để YouTube chịu phát */
.stage-audio { position: fixed; left: 0; bottom: 0; width: 320px; height: 180px; z-index: -2; opacity: 0; pointer-events: none; overflow: hidden; }
.stage-audio > *, .stage-audio iframe { width: 100%; height: 100%; border: 0; }
.stage-label { font: 400 19px/1 var(--f-hand); color: #FFD23F; }
.stage-now { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; opacity: 0.85; }
.stage-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #6B6F7A; }
.stage-panel.is-live .stage-dot { background: #FF3FA4; box-shadow: 0 0 10px #FF3FA4; }
.stage-panel .lobby-chevron { transform: rotate(0deg); }
.stage-panel.is-open .lobby-chevron { transform: rotate(180deg); }
/* minmax(0, 1fr): không cho nội dung dài (tên bài, nút) nở cột rộng hơn bảng */
.stage-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 12px 12px; }
.stage-video { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.stage-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage-mount { position: absolute; inset: 0; }
.stage-mount > * { width: 100%; height: 100%; }
/* lớp chiếu live nằm SAU khung 3D; khung 3D khoét lỗ đúng chỗ 2 màn hình LED để lộ video */
.stage-live { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.stage-live * { pointer-events: none; }
.stage-live-screen { background: #000; }
.stage-live-holder, .stage-live-holder > *, .stage-live-holder iframe { display: block; width: 100%; height: 100%; border: 0; }
.stage-idle { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; font-size: 13px; color: #C9BFD6; }
.stage-title { margin: 0; font-size: 13px; line-height: 1.35; }
.stage-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stage-row .btn { flex: 1 1 130px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-form { display: flex; gap: 6px; }
.stage-form input { flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px; font-size: 14px; }
.stage-rule { margin: 0; font-size: 12px; line-height: 1.4; color: #B9B0C6; }
.stage-queue { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-height: 240px; margin: 0; padding: 0; overflow-y: auto; list-style: none; font-size: 13px; }
.stage-queue li { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.stage-queue li.is-mine { background: rgba(255, 63, 164, 0.18); }
.stage-queue li.is-now { background: rgba(255, 63, 164, 0.3); font-weight: 600; }
.stage-queue li.is-now .q-num { color: #FF3FA4; }
.stage-queue li.is-now .q-by { font-weight: 800; }
.stage-queue .q-main { display: grid; flex: 1; min-width: 0; gap: 1px; }
.stage-queue .q-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-queue .q-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: #FFD23F; }
.stage-queue .q-pull { color: #FFD23F; font-size: 12px; }
.stage-queue .q-empty { justify-content: center; opacity: 0.7; }

/* ───────── chữ nổi trên khung 3D: bong bóng lời nói, chữ BỐP! ───────── */
.overlay { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.float { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; will-change: transform; }
.say { padding-bottom: 10px; }
.say::after {
  content: ''; position: absolute; left: 50%; bottom: 4px; width: 13px; height: 13px;
  background: #fffaf0; border-radius: 2px; transform: translateX(-50%) rotate(45deg);
}
.say-box {
  position: relative; z-index: 1; max-width: 240px; padding: 7px 13px 8px;
  background: #fffaf0; color: #1e1b18; border-radius: 14px;
  font: 600 15px/1.35 var(--f-body); text-align: center; overflow-wrap: anywhere;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
  transform-origin: 50% 100%; animation: say-in 0.22s var(--ease-out) both;
}
@keyframes say-in { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
/* nhãn "MỚI VỀ" trên sạp vừa có hàng: tem vàng xoay nghiêng, nổ hoa giấy lúc hiện, sau 2 phút tự tắt */
.new-tag { position: relative; width: 0; height: 0; }
.new-tag-text {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%) rotate(-8deg);
  padding: 3px 10px 4px; border-radius: 6px; background: #FFD23F; color: #B3261E;
  font: 400 15px/1.1 var(--f-sign); letter-spacing: 0.02em; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 0 0 2px #B3261E;
  animation: new-tag-in 0.5s var(--ease-out) both, new-tag-bob 2.2s ease-in-out 0.5s infinite;
}
@keyframes new-tag-in { from { transform: translateX(-50%) rotate(-8deg) scale(0); } 60% { transform: translateX(-50%) rotate(-8deg) scale(1.25); } to { transform: translateX(-50%) rotate(-8deg) scale(1); } }
@keyframes new-tag-bob { 50% { transform: translateX(-50%) rotate(-8deg) translateY(-5px); } }
.new-tag i {
  position: absolute; left: -3px; bottom: 8px; width: 6px; height: 10px; border-radius: 2px; background: var(--c);
  transform: rotate(var(--a)) translateY(0) scale(0); opacity: 0;
  animation: new-burst 1.1s ease-out both;
}
@keyframes new-burst {
  0% { transform: rotate(var(--a)) translateY(0) scale(0.4); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(260deg) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .new-tag-text { animation: none; } .new-tag i { display: none; } }

/* bot rao link: bong bóng bấm được, dòng link màu xanh dưới lời rao */
.say.has-link { pointer-events: auto; }
.say.has-link .say-box { -webkit-line-clamp: 6; }
.say-link {
  display: block; margin: 5px auto 0; padding: 3px 10px; max-width: 100%;
  border: 0; border-radius: 999px; background: #1F5FAF; color: #fff; cursor: pointer;
  font: 700 12.5px/1.3 var(--f-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.say-link:hover { background: #2A73CF; }
.say-link:focus-visible { outline: 2px solid #FFD23F; outline-offset: 2px; }
.pow-word {
  display: block; font: 400 32px/1 var(--f-sign); color: #ffd23f; white-space: nowrap;
  -webkit-text-stroke: 2.5px #1e1b18; paint-order: stroke fill; text-shadow: 0 3px 0 #1e1b18;
  transform-origin: 50% 100%; animation: pow 0.95s ease-out forwards;
}
.pow-word.is-angry { color: #FF4D3D; }
.menu-hint { margin: 4px 8px 4px; max-width: 220px; font-size: 12px; line-height: 1.35; color: var(--ink-soft); }
.pow-word.is-heart { color: #FF6B9A; font: 800 30px/1 var(--f-body); -webkit-text-stroke: 2px #1e1b18; }
@keyframes pow {
  0% { transform: scale(0.3) rotate(-14deg); opacity: 0; }
  15% { transform: scale(1.25) rotate(-8deg); opacity: 1; }
  30% { transform: scale(1) rotate(-6deg); }
  75% { opacity: 1; }
  100% { transform: scale(1) rotate(-6deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .pow-word { animation: none !important; } /* không nảy, chỉ hiện rồi tắt */
}
