:root {
  --bg: #05070c;
  --panel: rgba(11, 16, 25, 0.78);
  --panel-strong: rgba(9, 13, 21, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --ink: #eef1f7;
  --muted: #8d97a9;
  --gold: #e8c37a;
  --gold-2: #b98f45;
  --green: #39d98a;
  --red: #ff6172;
  --cyan: #5fe0ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --sans: "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 42%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 22%, transparent 74%, rgba(0, 0, 0, 0.5));
  z-index: 1;
}

/* ------------------------------------------------------------------ lobby */

.lobby {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  gap: 14px;
  padding: 24px;
  background:
    radial-gradient(80% 60% at 50% 18%, rgba(28, 48, 62, 0.55), transparent 70%),
    radial-gradient(70% 60% at 50% 110%, rgba(71, 52, 22, 0.35), transparent 70%),
    rgba(3, 5, 9, 0.55);
  backdrop-filter: blur(7px) saturate(0.9);
  -webkit-backdrop-filter: blur(7px) saturate(0.9);
  overflow-x: hidden;
  overflow-y: auto;
}

.lobby__halo {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: min(760px, 100vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 195, 122, 0.12), transparent 62%);
  filter: blur(10px);
  pointer-events: none;
  animation: halo 9s ease-in-out infinite alternate;
}

@keyframes halo {
  from { transform: scale(0.92); opacity: 0.7; }
  to { transform: scale(1.06); opacity: 1; }
}

.lobby__card {
  position: relative;
  width: min(520px, 100%);
  padding: clamp(26px, 5vw, 44px);
  border-radius: 26px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), transparent 38%),
    var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lobby__card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(232, 195, 122, 0.55), transparent 35%, transparent 65%, rgba(95, 224, 255, 0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--gold);
  opacity: 0.85;
}

.lobby__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(44px, 11vw, 64px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: #f6efdf;
  text-shadow: 0 2px 40px rgba(232, 195, 122, 0.22);
}

.join label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.join__row {
  display: flex;
  gap: 10px;
}

.join input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.join input::placeholder { color: #5d6675; }

.join input:focus {
  border-color: rgba(232, 195, 122, 0.65);
  box-shadow: 0 0 0 3px rgba(232, 195, 122, 0.12);
}

.join__error {
  min-height: 18px;
  margin: 9px 2px 0;
  font-size: 13px;
  color: var(--red);
}

.btn {
  position: relative;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: 13px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.18s, background 0.18s, border-color 0.18s, opacity 0.18s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { filter: brightness(1.12); border-color: rgba(255, 255, 255, 0.3); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.995); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.btn small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  opacity: 0.55;
  font-weight: 600;
  margin-bottom: 2px;
}

.btn--primary {
  border: none;
  background: linear-gradient(180deg, #f3d9a4, #d3a95c 55%, #b4873c);
  color: #201404;
  box-shadow: 0 8px 24px rgba(214, 171, 92, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn--primary:hover:not(:disabled) { filter: brightness(1.05) saturate(1.05); }
.btn--ghost { background: transparent; }
.btn b { font-weight: 700; }

.online {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ------------------------------------------------------------------- room */

.room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(232, 195, 122, 0.28);
  background: linear-gradient(180deg, rgba(232, 195, 122, 0.09), rgba(232, 195, 122, 0.02));
}

.room__id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.room__label { font-size: 9px; letter-spacing: 0.28em; color: var(--gold); }
.room__code {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #fff3d6;
  line-height: 1.15;
}
.room__share { height: 40px; white-space: nowrap; }
.room__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.room__home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.room--empty {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  text-align: center;
  border-color: var(--line);
  background: rgba(8, 12, 19, 0.55);
}
.room__or { margin: 0; font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }

.room__code-form { display: flex; gap: 8px; }
.room__code-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  outline: none;
}
.room__code-form input:focus {
  border-color: rgba(232, 195, 122, 0.65);
  box-shadow: 0 0 0 3px rgba(232, 195, 122, 0.12);
}
.room__code-form .btn { height: 44px; padding: 0 20px; }

.room__error {
  min-height: 16px;
  margin: -8px 2px 14px;
  font-size: 12.5px;
  color: var(--red);
}

/* ------------------------------------------------------------------ share */

.share {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 4, 8, 0.72);
  backdrop-filter: blur(6px);
  animation: fade 0.18s ease both;
}

.share__card {
  width: min(380px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  animation: rise 0.22s ease both;
}

.share__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.share__head .eyebrow { margin: 0 0 6px; }
.share__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.share__title span { color: var(--gold); letter-spacing: 0.14em; }

.share__qr {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 196px;
  margin: 16px 0 14px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
}
.share__svg { width: min(240px, 62vw); height: auto; border-radius: 10px; }

.share__link-row { display: flex; gap: 8px; }
.share__link-row input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.35);
  color: #cfd6e2;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  user-select: text;
}
.share__link-row .btn { height: 44px; white-space: nowrap; }
.share__native { width: 100%; margin-top: 10px; }
.share__hint { margin: 12px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* -------------------------------------------------------------------- HUD */

.shell { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.shell > * { pointer-events: none; }
.shell button, .shell input, .shell label.icon-btn, .shell .log, .shell .tip-menu, .shell .winner, .shell .screen-panel, .shell .room-menu__list, .shell .room-menu__item { pointer-events: auto; }

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 3vw, 32px) 14px;
  background: linear-gradient(180deg, rgba(4, 6, 11, 0.82), transparent);
}

.meta {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.meta__sep { opacity: 0.4; }

.btn-badge {
  font-size: 8px;
  letter-spacing: 0.16em;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3d9a4, #d3a95c);
  color: #201404;
  font-weight: 700;
}

.stack {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(95, 224, 255, 0.22);
  background: rgba(10, 18, 26, 0.55);
  margin-left: auto;
}

.stack span { font-size: 9px; letter-spacing: 0.22em; color: var(--cyan); opacity: 0.9; }
.stack b { font-size: 16px; color: #d9f6ff; font-variant-numeric: tabular-nums; }

.topbar__actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  min-width: 58px;
  height: 48px;
  padding: 4px 7px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(10, 15, 23, 0.72);
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  transition: background 0.18s, border-color 0.18s, transform 0.12s, box-shadow 0.18s;
}

.icon-btn__glyph { font-size: 17px; line-height: 1; }
.icon-btn__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-strong); }
.icon-btn:hover .icon-btn__label { color: var(--ink); }
.icon-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.icon-btn:active { transform: scale(0.96); }
.icon-btn--sm { min-width: 28px; width: 28px; height: 28px; padding: 0; font-size: 12px; }
.icon-btn.is-off { opacity: 0.5; }
.icon-btn.is-off .icon-btn__label { color: var(--muted); }

/* Menu ẩn của thanh công cụ: đổi trò, chọn ngôn ngữ, rời bàn nằm trong đây. */
.room-menu { position: relative; }

.room-menu__list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 196px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(232, 195, 122, 0.28);
  background: var(--panel-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: rise 0.18s ease both;
}

[dir="rtl"] .room-menu__list { right: auto; left: 0; }

.room-menu__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}

[dir="rtl"] .room-menu__item { text-align: right; }

.room-menu__item:hover,
.room-menu__item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
}

.room-menu__glyph { font-size: 15px; line-height: 1; }
.room-menu__label { flex: 1 1 auto; white-space: nowrap; }

.room-menu__value {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.room-menu__select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}

.room-menu__btn[aria-expanded="true"] {
  border-color: rgba(95, 224, 255, 0.6);
  color: var(--cyan);
}

.room-menu__btn[aria-expanded="true"] .icon-btn__label { color: var(--cyan); }

.conn {
  position: absolute;
  top: 86px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 97, 114, 0.15);
  border: 1px solid rgba(255, 97, 114, 0.45);
  color: #ffd2d7;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}

.turn-banner {
  position: absolute;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(8, 13, 21, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: slideDown 0.3s ease both;
}

@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes riseCentered {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.turn-banner__label {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.turn-banner b { font-size: 15px; color: var(--gold); }
.turn-banner__timer {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--cyan);
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.turn-banner.is-you { border-color: rgba(95, 224, 255, 0.45); box-shadow: 0 0 30px rgba(95, 224, 255, 0.14); }
.turn-banner.is-you b { color: var(--cyan); }

.status-line {
  position: absolute;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(8, 12, 19, 0.66);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- controls */

.controls {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(860px, calc(100% - 28px));
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 24, 36, 0.92), rgba(8, 12, 19, 0.94));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px);
  overflow: hidden;
  animation: riseCentered 0.4s ease both;
}

.timer { height: 3px; background: rgba(255, 255, 255, 0.07); }
.timer i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), #9ef4c5);
  box-shadow: 0 0 12px rgba(95, 224, 255, 0.55);
  transition: background 0.3s;
}

.timer.is-low i { background: linear-gradient(90deg, #ffb25f, var(--red)); box-shadow: 0 0 14px rgba(255, 97, 114, 0.6); }

.actions {
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1.2fr 1.2fr 0.95fr;
  gap: 10px;
  padding: 14px;
}

.actions .btn {
  position: relative;
  height: 64px;
  padding: 10px 8px;
  font-size: 15.5px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.actions .btn small {
  font-size: 10px;
  letter-spacing: 0.14em;
  opacity: 0.6;
  margin-bottom: 1px;
}

.actions .btn kbd {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.32);
  color: rgba(246, 239, 223, 0.82);
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.actions .btn:hover:not(:disabled) { transform: translateY(-1px); }
.actions .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.actions .btn:disabled {
  opacity: 1;
  color: rgba(214, 222, 235, 0.5);
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  cursor: not-allowed;
}
.actions .btn:disabled small,
.actions .btn:disabled kbd { opacity: 0.45; }

.btn--fold { background: linear-gradient(180deg, rgba(255, 97, 114, 0.2), rgba(255, 97, 114, 0.08)); border-color: rgba(255, 97, 114, 0.4); }
.btn--check { background: linear-gradient(180deg, rgba(95, 224, 255, 0.18), rgba(95, 224, 255, 0.06)); border-color: rgba(95, 224, 255, 0.38); }
.btn--call { background: linear-gradient(180deg, rgba(57, 217, 138, 0.22), rgba(57, 217, 138, 0.07)); border-color: rgba(57, 217, 138, 0.42); }
.btn--raise { background: linear-gradient(180deg, rgba(232, 195, 122, 0.24), rgba(232, 195, 122, 0.07)); border-color: rgba(232, 195, 122, 0.45); }
.btn--allin { background: linear-gradient(180deg, rgba(255, 61, 87, 0.85), rgba(160, 16, 42, 0.9)); border-color: rgba(255, 120, 140, 0.55); box-shadow: 0 6px 20px rgba(255, 45, 85, 0.25); }

.actions .btn--fold:hover:not(:disabled) { border-color: rgba(255, 97, 114, 0.8); box-shadow: 0 0 0 1px rgba(255, 97, 114, 0.28), 0 8px 22px rgba(255, 97, 114, 0.14); }
.actions .btn--check:hover:not(:disabled) { border-color: rgba(95, 224, 255, 0.8); box-shadow: 0 0 0 1px rgba(95, 224, 255, 0.26), 0 8px 22px rgba(95, 224, 255, 0.12); }
.actions .btn--call:hover:not(:disabled) { border-color: rgba(57, 217, 138, 0.8); box-shadow: 0 0 0 1px rgba(57, 217, 138, 0.28), 0 8px 22px rgba(57, 217, 138, 0.14); }
.actions .btn--raise:hover:not(:disabled) { border-color: rgba(232, 195, 122, 0.8); box-shadow: 0 0 0 1px rgba(232, 195, 122, 0.28), 0 8px 22px rgba(232, 195, 122, 0.14); }
.actions .btn--allin:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 10px 28px rgba(255, 45, 85, 0.4); }

.btn--call b, .btn--raise b { font-variant-numeric: tabular-nums; }

/* raise panel */
.raise { padding: 4px 14px 14px; animation: rise 0.2s ease both; }
.raise__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.raise__head b { font-size: 24px; color: var(--gold); font-variant-numeric: tabular-nums; }

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(232, 195, 122, 0.7), rgba(232, 195, 122, 0.15));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6df, #d8ad63 55%, #8d6827);
  border: 2px solid #2a1d08;
  box-shadow: 0 0 14px rgba(232, 195, 122, 0.5);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(232, 195, 122, 0.4); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 2px solid #2a1d08; border-radius: 50%; background: #e8c37a; }

.raise__row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.raise__row--end { justify-content: flex-end; margin-top: 12px; }

.chip {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 40px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { color: var(--ink); border-color: var(--gold); }
.chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.raise__row--end .btn { min-height: 48px; padding: 12px 22px; }

.raise input[type="number"] {
  width: 110px;
  margin-left: auto;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--gold);
  font-family: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  padding: 0 12px;
  outline: none;
  text-align: right;
}

/* ------------------------------------------------------------------- log */

.log {
  position: absolute;
  left: 18px;
  bottom: 120px;
  width: 300px;
  max-height: min(58vh, 520px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.28s ease both;
}

.log__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 8px; }
.log__head h3 { margin: 0; font-size: 11px; letter-spacing: 0.2em; color: var(--gold); font-weight: 600; }

.log ol {
  list-style: none;
  margin: 0;
  padding: 0 14px 14px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.45;
  color: #b7c0cf;
}

.log li { padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.log li:last-child { border-bottom: none; }
.log li:first-child { color: var(--ink); }

.log__section { display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; overflow: hidden; }
.log__section--actions { flex: 1 1 auto; min-height: 96px; }
.log__section--actions ol { flex: 1 1 auto; min-height: 0; }

.log__subhead {
  margin: 0;
  padding: 2px 14px 4px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.log ol.log__results {
  flex: 0 0 auto;
  min-height: 0;
  max-height: 168px;
  padding: 0 14px 6px;
}

.log__results li { padding: 2px 0; border-bottom: none; }
.log__results li:first-child { color: inherit; }
.log__results .history__empty { color: var(--muted); font-size: 11.5px; padding: 4px 0 6px; }

.history__item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'no who amount'
    'no cat cat';
  align-items: center;
  gap: 0 8px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.history__item:hover { background: rgba(232, 195, 122, 0.14); border-color: rgba(232, 195, 122, 0.32); }
.history__item:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.history__no { grid-area: no; font-size: 10.5px; color: var(--gold); font-variant-numeric: tabular-nums; }
.history__who { grid-area: who; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f2f5fa; font-size: 12px; font-weight: 600; }
.history__cat { grid-area: cat; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10.5px; }
.history__amount { grid-area: amount; color: var(--green); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ tip menu */

.tip-menu {
  position: absolute;
  left: 0;
  top: 0;
  width: 216px;
  max-width: calc(100vw - 16px);
  padding: 10px 12px 12px;
  transform: translateX(-50%);
  border-radius: 14px;
  border: 1px solid rgba(232, 195, 122, 0.35);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  text-align: center;
  animation: tipPop 0.22s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.tip-menu::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(232, 195, 122, 0.35);
  border-bottom: 1px solid rgba(232, 195, 122, 0.35);
  background: var(--panel);
}

.tip-menu__name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tip-menu__hint { margin: 4px 0 9px; font-size: 11px; line-height: 1.4; color: var(--muted); }

.tip-menu__btn {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(232, 195, 122, 0.55);
  background: linear-gradient(180deg, #f2cf82, #d9a94e);
  color: #241a0c;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s;
}
.tip-menu__btn:hover:not(:disabled) { filter: brightness(1.07); }
.tip-menu__btn:active:not(:disabled) { transform: scale(0.96) rotate(-1.5deg); }
.tip-menu__btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }

@keyframes tipPop {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.94); }
  to { opacity: 1; transform: translateX(-50%); }
}

/* ---------------------------------------------------------------- emotes */

.emotes {
  position: absolute;
  right: 18px;
  bottom: 120px;
  display: grid;
  grid-template-columns: repeat(2, 46px);
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.emotes button {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.emotes button:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px) scale(1.06); }
.emotes button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.emotes button:active { transform: scale(0.92); }

/* ---------------------------------------------------------------- winner */

.winner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 10px 22px 12px;
  border-radius: 18px;
  background: radial-gradient(120% 160% at 50% 0%, rgba(232, 195, 122, 0.18), transparent 70%), rgba(7, 10, 17, 0.8);
  border: 1px solid rgba(232, 195, 122, 0.36);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), inset 0 0 50px rgba(232, 195, 122, 0.06);
  animation: winnerPop 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  width: min(94vw, 560px);
  max-width: min(94vw, 620px);
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  z-index: 12;
}

@media (min-width: 900px) {
  .winner { left: calc(50% - 70px); }
}

@keyframes winnerPop {
  0% { opacity: 0; transform: translate(-50%, calc(-50% - 12px)) scale(0.9); }
  60% { opacity: 1; transform: translate(-50%, calc(-50% + 4px)) scale(1.02); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.winner__kicker { margin: 0; font-size: 9px; letter-spacing: 0.32em; color: var(--gold); }
.winner__close { position: absolute; top: 6px; inset-inline-end: 6px; }
.winner h2 { margin: 2px 0 0; font-family: var(--serif); font-size: clamp(22px, 4vw, 30px); font-weight: 600; color: #fff8e8; line-height: 1.1; }
.winner__amount { margin: 2px 0 0; font-size: 18px; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.winner__hand { margin: 2px 0 0; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }

.winner__board {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.winner__rows {
  display: grid;
  gap: 3px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-height: min(42vh, 300px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.winner__row {
  display: grid;
  grid-template-columns: minmax(64px, 1.1fr) auto minmax(88px, 1.05fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.winner__row.is-winner {
  background: rgba(232, 195, 122, 0.14);
  box-shadow: inset 0 0 0 1px rgba(232, 195, 122, 0.4);
}

.winner__row.is-folded { opacity: 0.55; }

.winner__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f2f5fa; font-weight: 600; }
.winner__name[data-you='1']::after { content: ' (' attr(data-you-label) ')'; color: var(--gold); font-weight: 400; font-size: 10px; }
.winner__cards { display: flex; gap: 3px; }
.winner__best { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.winner__handname { color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner__detail { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner__muted { color: var(--muted); font-size: 11px; }
.winner__net { justify-self: end; font-weight: 700; color: var(--muted); }
.winner__net.is-up { color: var(--green); }
.winner__net.is-down { color: var(--red); }

.winner__five {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding-top: 3px;
  border-top: 1px dashed rgba(255, 255, 255, 0.09);
}

.winner__five-label {
  margin-right: 2px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.winner__five .pcard { opacity: 0.68; font-size: 10px; padding: 0 3px; }
.winner__five .pcard.is-hole { opacity: 1; box-shadow: 0 0 0 1px rgba(232, 195, 122, 0.6); }

.winner__next {
  margin: 8px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.winner__next b { color: var(--gold); font-variant-numeric: tabular-nums; }

.pcard {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #f4f1ea;
  color: #12151c;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.pcard--red { color: #c2263a; }
.pcard i { font-style: normal; font-size: 10px; }

/* ---------------------------------------------------------------- toasts */

.toast-host {
  position: fixed;
  z-index: 90;
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: min(92vw, 460px);
}

.toast {
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(10, 15, 23, 0.92);
  border: 1px solid var(--line-strong);
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.25s ease both;
  text-align: center;
}

.toast.is-error { border-color: rgba(255, 97, 114, 0.5); color: #ffd2d7; }
.toast.is-emote { font-size: 15px; }
.toast.is-out { animation: toastOut 0.3s ease both; }

@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* ------------------------------------------------------- ngôn ngữ / Ko-fi */

.lobby__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.lobby__top .eyebrow { margin: 0; min-width: 0; }

.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.lang:hover { border-color: var(--line-strong); color: var(--ink); }
.lang__globe { font-size: 13px; line-height: 1; }

.lang__select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0 2px;
  max-width: 132px;
  cursor: pointer;
  outline: none;
}

.lang__select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.lang__select option { background: #0d1119; color: var(--ink); }

.lobby__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 22px;
}

.kofi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px 9px 13px;
  border-radius: 999px;
  border: 1px solid rgba(232, 195, 122, 0.42);
  background: linear-gradient(180deg, rgba(243, 217, 164, 0.16), rgba(180, 135, 60, 0.1));
  color: #f6dfb0;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.12s ease, filter 0.18s, border-color 0.18s;
}

.kofi__glyph { font-size: 15px; line-height: 1; }
.kofi:hover { filter: brightness(1.12); border-color: rgba(232, 195, 122, 0.75); }
.kofi:active { transform: translateY(1px) scale(0.995); }
.kofi:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 760px) {
  .meta { display: none; }
  .topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .stack span { font-size: 8px; letter-spacing: 0.14em; }
  .stack { padding: 5px 9px; gap: 5px; }
  .stack b { font-size: 14px; }
  .icon-btn { width: 36px; min-width: 36px; height: 40px; padding: 0; font-size: 16px; border-radius: 10px; }
  .icon-btn__label { display: none; }
  .topbar__actions { gap: 4px; }

  .turn-banner { top: 76px; padding: 8px 14px; }
  .turn-banner__label { display: none; }

  .controls { width: calc(100% - 16px); bottom: calc(48px + env(safe-area-inset-bottom)); border-radius: 16px; }
  .actions { gap: 6px; padding: 8px; grid-template-columns: 0.85fr 0.85fr 1.1fr 1.1fr; }
  .actions .btn { height: 58px; font-size: 13.5px; border-radius: 12px; }
  .actions .btn--allin { grid-column: span 4; height: 44px; flex-direction: row; gap: 6px; }
  .actions .btn--allin small { margin: 0; }
  .actions .btn kbd { top: 5px; right: 6px; font-size: 8px; padding: 2px 4px; }
  .btn small { font-size: 9px; }

  .log { left: 8px; right: 8px; width: auto; bottom: 108px; max-height: 58vh; }
  .log ol.log__results { max-height: 28vh; }
  .emotes {
    left: 8px;
    right: 8px;
    bottom: max(4px, env(safe-area-inset-bottom));
    grid-template-columns: repeat(8, 1fr);
    padding: 4px;
    gap: 4px;
    border-radius: 12px;
  }
  .emotes button { width: 100%; height: 38px; min-width: 0; padding: 0; font-size: 18px; border-radius: 8px; }
  .status-line { bottom: calc(160px + env(safe-area-inset-bottom)); font-size: 12px; }
  .winner {
    padding: 8px 12px 10px;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
  }
  .winner__row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'name hand net'
      'cards cards cards'
      'five five five';
    row-gap: 3px;
    gap: 5px;
    font-size: 11px;
    padding: 4px 6px;
  }
  .winner__name { grid-area: name; }
  .winner__cards { grid-area: cards; }
  .winner__best { grid-area: hand; }
  .winner__net { grid-area: net; }
  .winner__five { grid-area: five; border-top: none; padding-top: 0; align-self: center; }
  .winner__detail { white-space: normal; }
  .winner__five .pcard { font-size: 9px; }
  .winner__five-label { display: none; }
  .winner__rows { max-height: none; overflow: visible; }
  .raise__row { flex-wrap: wrap; }
  .raise input[type="number"] { margin-left: 0; flex: 1; text-align: left; }
  .toast-host { top: 168px; }
  .lobby__foot { margin-top: 18px; gap: 8px; }
  .kofi { padding: 8px 12px; font-size: 11.5px; }
  .lang__select { max-width: 104px; }
}

@media (max-width: 460px) {
  .topbar { gap: 5px; padding-left: 8px; padding-right: 8px; }
  .stack span { display: none; }
  .icon-btn { width: 30px; min-width: 30px; height: 30px; font-size: 14px; border-radius: 8px; }
  .topbar__actions { gap: 3px; }
}

/* Hàng nút + cụm coin không đủ một hàng dưới 381px: cho hàng nút tự xuống dòng. */
@media (max-width: 380px) {
  .topbar__actions {
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 3px;
  }
  .turn-banner { top: 108px; }
  .conn { top: 108px; }
  .toast-host { top: 196px; }
}

@media (max-width: 420px) {
  .join__row { flex-direction: column; }
  .join input, .join .btn { height: 48px; }
  .lobby__title { font-size: 42px; }
  .actions .btn { height: 54px; font-size: 12.5px; }
  .room { flex-wrap: wrap; row-gap: 8px; }
  .room__home { padding: 0 12px; }
}


@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ------------------------------------------------------- character editor */

.character {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.character__stage {
  position: relative;
  width: 150px;
  height: 190px;
  flex: none;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 30%, rgba(95, 224, 255, 0.16), rgba(8, 12, 19, 0.65) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  overflow: hidden;
}

#avatarPreview {
  display: block;
  width: 150px;
  height: 190px;
}

.character__tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  text-align: center;
  font-size: 8px;
  letter-spacing: 0.26em;
  color: rgba(232, 195, 122, 0.7);
}

.character__reroll {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(8, 12, 19, 0.72);
  color: var(--gold);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.character__reroll:hover {
  transform: rotate(-12deg) scale(1.08);
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(232, 195, 122, 0.28);
}
.character__reroll:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.character__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
}

/* Tablet/desktop: xếp lựa chọn thành lưới để tận dụng chiều ngang. */
@media (min-width: 761px) {
  .lobby__card { width: min(880px, 100%); }

  .character__body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    align-content: start;
    gap: 8px 14px;
  }

  .character__body .opt {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .character__body .opt__label {
    width: auto;
    font-size: 8.5px;
    line-height: 1.3;
  }

  .character__body .swatches { gap: 4px; }
  .character__body .swatch { width: 16px; height: 16px; border-width: 2px; }
  .character__body .swatches--sm .swatch { width: 14px; height: 14px; }
  .character__body .pill { font-size: 9px; padding: 2px 5px; }
}

/* Màn hình rộng: hai cột cho phần nhập liệu, avatar trải hết chiều ngang. */
@media (min-width: 900px) {
  .lobby__card {
    width: min(1000px, 100%);
    padding: clamp(24px, 3vw, 36px) clamp(28px, 3.4vw, 40px);
    display: grid;
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    grid-template-areas:
      "top top"
      "intro setup"
      "character character"
      "foot foot";
    align-items: start;
    column-gap: 32px;
    row-gap: 18px;
  }

  .lobby__top { grid-area: top; margin-bottom: 0; }
  .lobby__intro { grid-area: intro; }
  .lobby__setup { grid-area: setup; }
  .character { grid-area: character; margin-top: 0; }
  .lobby__foot { grid-area: foot; margin-top: 0; }

  .character__stage { width: 168px; height: 210px; }
  #avatarPreview { width: 168px; height: 210px; }
}

.opt { display: flex; align-items: flex-start; gap: 7px; }

.opt__label {
  width: 58px;
  flex: none;
  font-size: 8.5px;
  line-height: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.swatches { display: flex; flex-wrap: wrap; gap: 5px; }

.swatch {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}

.swatch:hover { transform: scale(1.12); }
.swatch.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 195, 122, 0.2), 0 0 12px rgba(232, 195, 122, 0.25);
}
.swatches--sm .swatch { width: 15px; height: 15px; }

.pills { display: flex; flex-wrap: wrap; gap: 4px; }

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: inherit;
  font-size: 9.5px;
  line-height: 1.25;
  border-radius: 999px;
  padding: 3px 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.pill:hover { color: var(--ink); border-color: var(--line-strong); }
.pill.is-active {
  color: #1f1503;
  border-color: transparent;
  background: linear-gradient(180deg, #f3d9a4, #d3a95c);
  font-weight: 600;
}

.icon-btn.is-active {
  border-color: rgba(95, 224, 255, 0.6);
  box-shadow: 0 0 16px rgba(95, 224, 255, 0.25);
  color: var(--cyan);
}
.icon-btn.is-active .icon-btn__label { color: var(--cyan); }

.look-hint {
  position: absolute;
  left: 18px;
  bottom: 118px;
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(8, 12, 19, 0.72);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  transition: opacity 0.4s;
}
.look-hint b { color: var(--gold); }

@media (max-width: 760px) {
  .character { flex-direction: column; gap: 10px; padding: 10px; }
  .character__stage { width: 100%; height: 168px; }
  #avatarPreview { width: 100%; height: 168px; }
  .opt { gap: 6px; }
  .opt__label { width: 54px; font-size: 8px; line-height: 19px; }
  .swatch { width: 17px; height: 17px; }
  .swatches--sm .swatch { width: 14px; height: 14px; }
  .pill { font-size: 9px; padding: 3px 6px; }
  .character__tag { display: none; }
  .look-hint {
    top: 168px;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 10.5px;
  }
}

/* ------------------------------------------------------------- màn chiếu */

.cinema-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cinema-layer__canvas { position: absolute; top: 0; left: 0; }

.cinema {
  position: relative;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  background: #06050a;
  color: #f0dcb6;
  font-family: var(--sans);
  pointer-events: none;
}

/* CSS3DObject gán inline pointer-events: auto; màn chiếu không được nuốt chuột,
   kể cả iframe YouTube bên trong — kéo nhìn phải rơi xuống canvas. */
.cinema,
.cinema * { pointer-events: none !important; }

.cinema__video { position: absolute; inset: 0; background: #000; }
.cinema__video iframe { display: block; width: 100%; height: 100%; border: 0; }

.cinema__standby,
.cinema__notice {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 176, 92, 0.14), transparent 62%),
    linear-gradient(180deg, #120c09, #060509);
  box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.85);
}

.cinema__notice { background: linear-gradient(180deg, #15090a, #060509); }
.cinema__kicker { font-size: 24px; letter-spacing: 0.52em; color: var(--gold); }
.cinema__standby b, .cinema__notice b { font-size: 52px; font-weight: 600; letter-spacing: 0.01em; }
.cinema__sub { font-size: 26px; color: rgba(240, 220, 182, 0.6); }

/* Tắt riêng trên máy này: tối hẳn, không phát, phòng vẫn chạy. */
.cinema__off {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  background: #08070b;
  box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.92);
}
.cinema__off b { font-size: 44px; font-weight: 600; color: rgba(240, 220, 182, 0.66); }
.cinema__off .cinema__sub { font-size: 24px; color: rgba(240, 220, 182, 0.36); }

.screen-panel {
  position: absolute;
  top: 78px;
  left: 50%;
  z-index: 20;
  width: min(430px, calc(100vw - 28px));
  padding: 12px 14px 14px;
  transform: translateX(-50%);
  border-radius: 16px;
  border: 1px solid rgba(232, 195, 122, 0.32);
  background: var(--panel-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: rise 0.28s ease both;
}

.screen-panel__head { display: flex; align-items: center; justify-content: space-between; }
.screen-panel__head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}

.screen-panel__form { display: flex; gap: 8px; margin-top: 10px; }
.screen-panel__form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: 13px var(--sans);
}
.screen-panel__form input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.screen-panel__form .btn { height: 38px; padding: 0 16px; }

.screen-panel__hint {
  margin: 9px 2px 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.screen-audio {
  position: absolute;
  z-index: 15;
  padding: 10px 16px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 150, 0.55);
  background: rgba(20, 13, 8, 0.86);
  color: #ffe6bd;
  font: 600 12px var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: screenAudioPulse 2.4s ease-in-out infinite;
}
.screen-audio:hover { filter: brightness(1.12); }
.screen-audio:active { transform: translate(-50%, -50%) scale(0.96); }

@keyframes screenAudioPulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(255, 205, 140, 0.34); }
  50% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 10px rgba(255, 205, 140, 0); }
}

@media (max-width: 760px) {
  .screen-panel { top: 66px; }
}

/* -------------------------------------------------------------------- RTL */
/* Bố cục phải chừa chỗ cho câu dịch dài (ru/fr/hi) và chữ RTL (ar/ur). */

.join__row .btn--primary { white-space: normal; text-align: center; }
.actions .btn > span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Số, mã phòng và ký hiệu bài luôn đọc trái→phải kể cả trong khung RTL. */
.room__code,
.stack b,
#youCoins,
#winnerAmount,
#winnerNextLine b,
#callAmount,
#raiseAmount,
#raisePreview,
#turnTimerText,
.winner__net,
.pcard,
#blinds {
  direction: ltr;
  unicode-bidi: isolate;
}

[dir="rtl"] .btn small,
[dir="rtl"] .icon-btn__label { letter-spacing: 0; }
[dir="rtl"] .lang__select { padding-left: 6px; }
[dir="rtl"] .log { left: auto; right: 18px; }
[dir="rtl"] .emotes { right: auto; left: 18px; }
[dir="rtl"] .look-hint { left: auto; right: 18px; }
[dir="rtl"] .actions .btn kbd { right: auto; left: 8px; }
[dir="rtl"] .raise input[type="number"] { margin-left: 0; margin-right: auto; text-align: left; direction: ltr; }
[dir="rtl"] input[type="range"] { direction: ltr; }
[dir="rtl"] .winner__rows,
[dir="rtl"] .log ol { padding-inline-start: 0; }
[dir="rtl"] .share__link-row input,
[dir="rtl"] #screenInput { direction: ltr; text-align: right; }

@media (max-width: 760px) {
  [dir="rtl"] .log { left: 8px; right: 8px; }
  [dir="rtl"] .emotes { left: 8px; right: 8px; }
  [dir="rtl"] .look-hint { left: 8px; right: 8px; }
}

/* ------------------------------------------------------------- game picker */

.games { display: grid; gap: 8px; margin: 0 0 16px; }
.games__label { margin: 0; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.games__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon name" "icon desc";
  align-items: center;
  gap: 0 10px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.game-card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.game-card:active { transform: translateY(1px); }
.game-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.game-card__icon { grid-area: icon; font-size: 22px; line-height: 1; }
.game-card b { grid-area: name; color: var(--ink); font-size: 14px; }
.game-card small { grid-area: desc; font-size: 11px; line-height: 1.3; }
.game-card.is-active {
  border-color: rgba(232, 195, 122, 0.55);
  background: linear-gradient(180deg, rgba(232, 195, 122, 0.16), rgba(232, 195, 122, 0.04));
  box-shadow: inset 0 0 0 1px rgba(232, 195, 122, 0.18);
}
.game-card.is-active small { color: #d8c9a6; }
.room-game {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.room-game b { color: var(--gold); letter-spacing: 0.04em; font-size: 13px; }

/* ---------------------------------------------------------------- werewolf */

.ww { position: fixed; inset: 0; z-index: 30; overflow: hidden; background: #05080c; }
.ww__scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.ww__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(90% 70% at 50% 46%, transparent 44%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 26%, transparent 62%, rgba(0, 0, 0, 0.72));
}
.ww__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px max(14px, env(safe-area-inset-left)) 12px max(14px, env(safe-area-inset-right));
  background: linear-gradient(180deg, rgba(4, 7, 10, 0.82), transparent);
}
.ww__badge { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.ww__brand { font-family: var(--serif); font-size: 19px; color: var(--gold); letter-spacing: 0.02em; }
.ww__room {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}
.ww__phasebox { display: grid; justify-items: center; gap: 4px; min-width: 150px; }
.ww__phase { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: #f3ead7; }
.ww__timer { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ww__timer.is-low { color: var(--red); }
.ww__phasebar { width: 132px; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.ww__phasebar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff8a33, var(--gold)); transition: width 0.25s linear; }
.ww__phasebar i.is-low { background: linear-gradient(90deg, #ff4d5e, #ff8a33); }
.ww__tools { display: flex; align-items: center; gap: 6px; }
.ww__tools .icon-btn { background: rgba(10, 15, 20, 0.55); border-color: rgba(255, 255, 255, 0.14); }
.ww__tools .room-menu__btn[aria-expanded="true"] { border-color: rgba(95, 224, 255, 0.6); }

.ww__log-panel {
  position: absolute;
  top: 84px;
  left: max(14px, env(safe-area-inset-left));
  width: min(310px, 34vw);
  max-height: 38vh;
  overflow: hidden auto;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(7, 11, 15, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ww__log-title { margin: 0 0 6px; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.ww__log { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 12px; line-height: 1.35; color: #cfd6df; }
.ww__log li { padding-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.ww__log li:first-child { color: #fff4de; }
.ww__log li:last-child { border-bottom: none; padding-bottom: 0; }

.ww-role {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(292px, 36vw);
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid rgba(232, 195, 122, 0.28);
  background: linear-gradient(180deg, rgba(20, 16, 10, 0.88), rgba(8, 10, 12, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ww-role__label { margin: 0 0 6px; font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }
.ww-role__main { display: flex; align-items: flex-start; gap: 11px; }
.ww-role__icon { font-size: 30px; line-height: 1; filter: drop-shadow(0 0 12px rgba(255, 138, 51, 0.45)); }
.ww-role__text b { display: block; font-family: var(--serif); font-size: 20px; color: #fff3dc; }
.ww-role__text p { margin: 3px 0 0; font-size: 12px; line-height: 1.4; color: #c3c9d2; }
.ww-role__notes { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.08); display: grid; gap: 4px; font-size: 12px; color: var(--gold); }
.ww-role.is-dead { border-color: rgba(255, 97, 114, 0.35); }
.ww-role.is-dead .ww-role__text b { color: #ffb3bb; }

.ww__action {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 13px 15px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 11, 15, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.ww__action-label { margin: 0; font-size: 13px; color: #f2e8d5; text-align: center; }
.ww__targets { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.ww-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: #dfe4ec;
  font-size: 12px;
  cursor: default;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.ww__targets.is-open .ww-chip:not(:disabled) { cursor: pointer; border-color: rgba(232, 160, 74, 0.45); }
.ww__targets.is-open .ww-chip:not(:disabled):hover { background: rgba(232, 160, 74, 0.18); transform: translateY(-1px); }
.ww-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ww-chip.is-you { border-color: rgba(95, 224, 255, 0.45); }
.ww-chip.is-dead { opacity: 0.55; text-decoration: line-through; }
.ww-chip.is-target { background: rgba(232, 195, 122, 0.26); border-color: var(--gold); color: #fff8e8; }
.ww-chip.is-voted { box-shadow: inset 0 0 0 1px rgba(255, 138, 51, 0.4); }
.ww-chip__role { font-style: normal; }
.ww-chip__state { font-style: normal; font-size: 10px; letter-spacing: 0.06em; color: #ff9aa4; }
.ww-chip__votes {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  background: var(--gold);
  color: #23180a;
}
.ww__action-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.ww__notice { margin: 0; font-size: 12px; color: var(--muted); }

.ww-result {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px));
  max-height: min(76vh, 640px);
  overflow: auto;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid rgba(232, 195, 122, 0.35);
  background: linear-gradient(180deg, rgba(24, 18, 11, 0.96), rgba(8, 10, 12, 0.97));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  text-align: center;
}
.ww-result .eyebrow { margin: 0; }
.ww-result h2 { margin: 6px 0 4px; font-family: var(--serif); font-size: clamp(24px, 4vw, 32px); color: #fff4e2; }
.ww-result p { margin: 0; font-size: 13px; line-height: 1.45; color: #c3c9d2; }
.ww-result__rows { list-style: none; margin: 16px 0 12px; padding: 0; display: grid; gap: 6px; text-align: left; }
.ww-result__rows li {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px;
}
.ww-result__rows li.is-dead { opacity: 0.6; }
.ww-result__role { color: var(--gold); font-size: 12px; }
.ww-result__state { color: var(--muted); font-size: 11px; }
.ww-result__next { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .ww__log-panel { top: 74px; width: min(260px, 42vw); max-height: 30vh; }
  .ww-role { width: min(240px, 44vw); padding: 10px 12px; }
  .ww-role__text b { font-size: 17px; }
  .ww__action { width: calc(100vw - 24px); padding: 11px 12px; }
}

@media (max-width: 620px) {
  .ww__log-panel { display: none; }
  .ww__bar { flex-wrap: wrap; row-gap: 6px; }
  .ww__phasebox { order: 3; width: 100%; }
  .ww-role {
    left: 12px;
    right: 12px;
    bottom: auto;
    top: 92px;
    width: auto;
    padding: 9px 11px;
  }
  .ww-role__label { display: none; }
  .ww-role__icon { font-size: 24px; }
  .ww-role__text b { font-size: 16px; }
  .ww-role__text p { font-size: 11px; }
  .ww-role__notes { margin-top: 7px; padding-top: 7px; }
  .ww__action { bottom: 10px; gap: 7px; }
  .ww-chip { font-size: 11px; padding: 6px 9px; }
  .ww__targets { max-height: 26vh; overflow: auto; }
}

@media (max-height: 520px) {
  .ww__log-panel { display: none; }
  .ww-role { display: none; }
  .ww__action { padding: 8px 11px; gap: 6px; }
}

/* Không có WebGL: nền rừng đêm vẽ bằng CSS thay cho canvas. */
.ww.is-flat { background:
  radial-gradient(70% 50% at 50% 62%, rgba(255, 138, 51, 0.32), transparent 70%),
  radial-gradient(90% 70% at 50% 20%, rgba(40, 68, 96, 0.55), transparent 70%),
  linear-gradient(180deg, #060a12, #0c1410 60%, #070b08);
}
.ww.is-flat .ww__scene { display: none; }
/* Nền lobby khi chọn Ma Sói: chỉ giữ cảnh rừng, ẩn HUD, không chặn thao tác. */
.ww.is-backdrop { pointer-events: none; }
.ww.is-backdrop > :not(.ww__scene):not(.ww__vignette) { display: none !important; }

/* Rừng đêm tối hơn bàn poker: bớt tối và bớt mờ để vẫn thấy đống lửa qua lobby. */
.lobby.is-forest {
  background:
    radial-gradient(80% 60% at 50% 18%, rgba(28, 48, 62, 0.35), transparent 70%),
    radial-gradient(70% 60% at 50% 110%, rgba(71, 52, 22, 0.2), transparent 70%),
    rgba(3, 5, 9, 0.26);
  backdrop-filter: blur(2px) saturate(1.05);
  -webkit-backdrop-filter: blur(2px) saturate(1.05);
}

.ww-chip.is-watching { border-style: dashed; opacity: 0.92; }
.ww-chip__state--watch { color: #a9b4c4; }

/* ------------------------------------------------------- vote đổi trò chơi */

.vote-card {
  position: fixed;
  top: 72px;
  right: max(14px, env(safe-area-inset-right));
  z-index: 60;
  width: min(320px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(232, 195, 122, 0.35);
  background: rgba(9, 13, 18, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.vote-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vote-card__kicker { font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }
.vote-card__count { font-size: 11px; color: var(--gold); font-variant-numeric: tabular-nums; }
.vote-card__text { margin: 0; font-size: 12.5px; line-height: 1.4; color: #f2ead9; }
.vote-card__track { height: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.vote-card__track i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), #ff8a33); }
.vote-card__actions { display: flex; gap: 8px; }
.vote-card__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.vote-card__btn small { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.vote-card__btn:hover { background: rgba(255, 255, 255, 0.1); }
.vote-card__btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.vote-card__btn--yes.is-active { background: rgba(57, 217, 138, 0.22); border-color: rgba(57, 217, 138, 0.55); }
.vote-card__btn--no.is-active { background: rgba(255, 97, 114, 0.2); border-color: rgba(255, 97, 114, 0.5); }

[dir="rtl"] .vote-card { right: auto; left: max(14px, env(safe-area-inset-left)); }

@media (max-width: 620px) {
  .vote-card { top: 96px; left: 10px; right: 10px; width: auto; }
  [dir="rtl"] .vote-card { left: 10px; right: 10px; }
}
