/* BeVietnamPro Font Face Declarations */
@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-Thin.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-ThinItalic.ttf') format('truetype');
  font-weight: 100;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-ExtraLight.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-ExtraLightItalic.ttf') format('truetype');
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-LightItalic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-MediumItalic.ttf') format('truetype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-SemiBoldItalic.ttf') format('truetype');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-ExtraBoldItalic.ttf') format('truetype');
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BeVietnamPro';
  src: url('/fonts/BeVietnamPro-BlackItalic.ttf') format('truetype');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

:root {
  font-family: 'BeVietnamPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  font-weight: 400;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Bảng màu và layout nằm trong styles/spotify.css */
:root {
  color-scheme: light;
}

:root[data-theme='dark'] {
  color-scheme: dark;
}

/* Tùy chỉnh cho Ant Design */
.ant-layout {
  transition: background-color 0.3s ease;
}

.ant-card {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.ant-list-item {
  transition: all 0.3s;
} /*
 * Design tokens + layout theo phong cách Spotify (light mặc định).
 * Dark theme giữ lại vì nút chuyển theme vẫn còn — dùng bảng màu Spotify dark.
 */

:root {
  /* Nền và bề mặt */
  --sp-bg: #f5f5f5;
  --sp-surface: #ffffff;
  --sp-surface-2: #f8f8f8;
  --sp-surface-hover: #f0f0f0;
  --sp-surface-active: #e8e8e8;
  --sp-border: #e4e4e4;
  --sp-border-strong: #d4d4d4;

  /* Chữ */
  --sp-text: #121212;
  --sp-text-muted: #6a6a6a;
  --sp-text-faint: #9b9b9b;
  --sp-text-on-accent: #000000;

  /* Thương hiệu */
  --sp-green: #1db954;
  --sp-green-hover: #1ed760;
  --sp-green-press: #199f47;
  --sp-green-soft: rgba(29, 185, 84, 0.12);
  --sp-red: #e22134;

  /* Hình khối */
  --sp-radius: 8px;
  --sp-radius-lg: 12px;
  --sp-radius-pill: 500px;
  --sp-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --sp-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

  /* Khung layout */
  --sp-sidebar-w: 340px;
  --sp-rail-w: 340px;
  --sp-rail-news-min: 380px;
  --sp-player-h: 84px;
  --sp-gap: 8px;
}

:root[data-theme='dark'] {
  --sp-bg: #000000;
  --sp-surface: #121212;
  --sp-surface-2: #181818;
  --sp-surface-hover: #1f1f1f;
  --sp-surface-active: #282828;
  --sp-border: #2a2a2a;
  --sp-border-strong: #3e3e3e;

  --sp-text: #ffffff;
  --sp-text-muted: #b3b3b3;
  --sp-text-faint: #7a7a7a;
  --sp-text-on-accent: #000000;

  --sp-green-soft: rgba(29, 185, 84, 0.18);
  --sp-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --sp-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body {
  background: var(--sp-bg);
  color: var(--sp-text);
}

.sp-route-loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--sp-bg);
  color: var(--sp-text-muted);
  font-size: 14px;
}

/* ── Khung ứng dụng ────────────────────────────────────────────────── */

.sp-shell {
  display: grid;
  grid-template-columns: var(--sp-sidebar-w) minmax(0, 1fr) var(--sp-rail-w);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    'sidebar main rail'
    'player player player';
  gap: var(--sp-gap);
  padding: var(--sp-gap);
  height: 100vh;
  background: var(--sp-bg);
  box-sizing: border-box;
}

.sp-shell--no-player {
  grid-template-areas:
    'sidebar main rail'
    'sidebar main rail';
}

.sp-sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: var(--sp-gap);
  min-height: 0;
}

.sp-main-add {
  flex: 0 0 auto;
}

.sp-main-add .sp-panel__head {
  padding: 16px 20px 8px;
}

.sp-main-add .sp-panel__body {
  padding: 0 20px 18px;
}

.add-song-form__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.add-song-form__fields {
  display: flex;
  flex-direction: column;
}

.add-song-form__submit {
  width: 100%;
}

.add-song-form--main .add-song-form__identity {
  margin-bottom: 10px;
}

.add-song-form--main .add-song-form__fields {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 0.9fr) 170px;
  gap: 12px;
  align-items: end;
}

.add-song-form--main .ant-form-item {
  margin-bottom: 0;
}

.add-song-form--main .add-song-form__submit {
  width: 100%;
  min-height: 40px;
  margin-bottom: 0;
}

.add-song-form--main.add-song-form__empty {
  padding: 18px 20px 20px;
}

.add-song-form--main.add-song-form__empty .sp-empty__icon {
  font-size: 24px;
}

.sp-main {
  grid-area: main;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--sp-surface);
  border-radius: var(--sp-radius-lg);
  border: 1px solid var(--sp-border);
}

.sp-rail {
  grid-area: rail;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-gap);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/*
 * Bố cục cột phải Home (dùng class rõ ràng, không phụ thuộc thứ tự con):
 * - Nút Cho-Han: cao tự nhiên, luôn nổi ở trên.
 * - Feed hoạt động: có trần, cuộn bên trong.
 * - Khung tin tức: chiếm phần chiều cao còn lại, nhưng có sàn tối thiểu.
 *
 * Trước đây khung tin chỉ có `flex: 1 1 auto; min-height: 0`, nên trên laptop
 * màn thấp nó bị Cho-Han + Billiards + feed bóp còn vài chục pixel — đúng vào
 * phần mà người ta muốn đọc. Giờ nó giữ sàn `--sp-rail-news-min` và cả cột
 * phải tự cuộn khi không đủ chỗ, thay vì bóp mỗi khung tin.
 */
.sp-rail > .chohan-rail,
.sp-rail > .bil-rail {
  flex: 0 0 auto;
}

.sp-rail > .sp-rail-activity {
  flex: 0 1 auto;
  max-height: 240px;
  min-height: 140px;
}

.sp-rail > .sp-rail-news {
  flex: 1 1 auto;
  min-height: var(--sp-rail-news-min);
}

.chohan-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-player {
  grid-area: player;
}

/* Panel chung — khối bo góc kiểu Spotify */
.sp-panel {
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sp-panel--grow {
  flex: 1;
  min-height: 0;
}

.sp-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
}

.sp-panel__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--sp-text);
}

.sp-panel__body {
  padding: 0 12px 12px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.sp-panel__body--flush {
  padding: 0;
}

/* ── Thanh thương hiệu / điều hướng ───────────────────────────────── */

.sp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

/*
 * Icon app trong sidebar. Bo góc và nền sẫm đã nằm sẵn trong favicon.svg
 * nên ở đây không đặt background hay border-radius — đặt thêm là viền tile
 * bị cắt cụt.
 */
.sp-brand__mark {
  width: 34px;
  height: 34px;
  display: block;
  flex-shrink: 0;
}

.sp-brand__name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sp-text);
  line-height: 1.1;
}

.sp-brand__sub {
  font-size: 11px;
  color: var(--sp-text-muted);
  font-weight: 500;
}

.sp-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 12px;
}

.sp-nav__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--sp-radius);
  color: var(--sp-text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color 0.15s ease, background 0.15s ease;
}

.sp-nav__item:hover {
  color: var(--sp-text);
  background: var(--sp-surface-hover);
}

.sp-nav__item--active {
  color: var(--sp-text);
  background: var(--sp-surface-active);
}

.sp-nav__icon {
  font-size: 18px;
  display: inline-flex;
}

/* Hàng icon easter egg dưới menu điều hướng */
.sp-quicktoys {
  display: flex;
  gap: 6px;
  padding: 8px 14px 14px;
  border-top: 1px solid var(--sp-border);
  margin: 0 8px;
}

.sp-quicktoys__btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--sp-surface-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.sp-quicktoys__btn:hover {
  background: var(--sp-surface-active);
  transform: scale(1.08);
}

.sp-quicktoys__btn.is-active {
  border-color: var(--sp-green);
  background: var(--sp-green-soft);
}

/* ── Nút kiểu Spotify ─────────────────────────────────────────────── */

.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--sp-radius-pill);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.sp-btn:active {
  transform: scale(0.97);
}

.sp-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.sp-btn--primary {
  background: var(--sp-green);
  color: var(--sp-text-on-accent);
}

.sp-btn--primary:hover:not(:disabled) {
  background: var(--sp-green-hover);
  transform: scale(1.03);
}

.sp-btn--ghost {
  background: transparent;
  color: var(--sp-text-muted);
}

.sp-btn--ghost:hover:not(:disabled) {
  color: var(--sp-text);
  background: var(--sp-surface-hover);
}

.sp-btn--outline {
  background: transparent;
  color: var(--sp-text);
  border: 1px solid var(--sp-border-strong);
}

.sp-btn--outline:hover:not(:disabled) {
  border-color: var(--sp-text);
  transform: scale(1.03);
}

.sp-btn--danger {
  background: var(--sp-red);
  color: #fff;
}

.sp-btn--sm {
  padding: 6px 14px;
  font-size: 13px;
}

.sp-btn--icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

/* ── Thanh trên cùng của vùng nội dung ────────────────────────────── */

.sp-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--sp-surface);
  border-bottom: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg) var(--sp-radius-lg) 0 0;
}

.sp-topbar__greeting {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--sp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Chip tài khoản */
.sp-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--sp-radius-pill);
  background: var(--sp-surface-active);
  border: none;
  cursor: pointer;
  color: var(--sp-text);
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s ease;
}

.sp-user-chip:hover {
  background: var(--sp-surface-hover);
}

.sp-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.sp-avatar--image {
  position: relative;
  overflow: hidden;
  background: var(--sp-surface-2);
}

.sp-avatar--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sp-avatar__fallback {
  display: none;
}

.sp-avatar--lg {
  width: 44px;
  height: 44px;
  font-size: 17px;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.avatar-picker__item {
  min-width: 0;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  background: var(--sp-surface);
  color: var(--sp-text);
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 10px 6px 8px;
  font-size: 12px;
  font-weight: 700;
}

.avatar-picker__item:hover {
  background: var(--sp-surface-hover);
}

.avatar-picker__item.is-selected {
  border-color: var(--sp-green);
  background: var(--sp-green-soft);
  box-shadow: inset 0 0 0 1px var(--sp-green);
}

.avatar-picker__item span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Danh sách bài hát ────────────────────────────────────────────── */

.sp-tracklist {
  display: flex;
  flex-direction: column;
}

.sp-track {
  display: grid;
  grid-template-columns: 32px 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: var(--sp-radius);
  transition: background 0.15s ease;
}

.sp-track:hover {
  background: var(--sp-surface-hover);
}

.sp-track__rank {
  font-size: 15px;
  font-weight: 600;
  color: var(--sp-text-faint);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sp-track__rank--top {
  color: var(--sp-green);
  font-weight: 800;
}

.sp-track__art {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--sp-surface-active);
  display: block;
}

.sp-track__meta {
  min-width: 0;
}

.sp-track__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--sp-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-track__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--sp-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.sp-track__note {
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-track__side {
  display: flex;
  align-items: center;
  gap: 12px;
}

/*
 * Biến thể cho cột hẹp (cột phải trang admin): điểm số và nút reaction
 * xuống dòng riêng thay vì ép tiêu đề bài hát co lại còn vài pixel.
 */
.sp-tracklist--compact .sp-track {
  grid-template-columns: 26px 40px minmax(0, 1fr);
  grid-template-areas:
    'rank art meta'
    'side side side';
  gap: 8px 10px;
}

.sp-tracklist--compact .sp-track__rank {
  grid-area: rank;
}

.sp-tracklist--compact .sp-track__art {
  grid-area: art;
  width: 40px;
  height: 40px;
}

.sp-tracklist--compact .sp-track__meta {
  grid-area: meta;
}

.sp-tracklist--compact .sp-track__side {
  grid-area: side;
  justify-content: flex-end;
}

.sp-score {
  min-width: 44px;
  padding: 3px 10px;
  border-radius: var(--sp-radius-pill);
  background: var(--sp-surface-active);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--sp-text);
}

.sp-score--positive {
  background: var(--sp-green-soft);
  color: var(--sp-green-press);
}

:root[data-theme='dark'] .sp-score--positive {
  color: var(--sp-green-hover);
}

.sp-score--negative {
  background: rgba(226, 33, 52, 0.12);
  color: var(--sp-red);
}

/* ── Thanh phát nhạc dưới cùng ────────────────────────────────────── */

.sp-nowplaying {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--sp-player-h);
  padding: 0 20px;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-sizing: border-box;
}

.sp-nowplaying__art {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.sp-nowplaying__meta {
  min-width: 0;
  flex: 1;
}

.sp-skip-next {
  display: grid;
  grid-template-columns: minmax(150px, 210px) auto;
  grid-template-areas:
    'copy button'
    'progress button';
  align-items: center;
  column-gap: 14px;
  row-gap: 6px;
  flex-shrink: 0;
}

.sp-skip-next__progress-copy {
  grid-area: copy;
  color: var(--sp-text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.sp-skip-next__progress-copy strong {
  color: #d99a00;
  font-size: 13px;
}

:root[data-theme='dark'] .sp-skip-next__progress-copy strong {
  color: #ffd35a;
}

.sp-skip-next__progress {
  grid-area: progress;
  width: 100%;
  height: 5px;
  overflow: hidden;
  background: rgba(217, 154, 0, 0.16);
  border-radius: 999px;
}

.sp-skip-next__progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f5b700, #ff7a1a);
  transition: width 260ms ease;
}

.sp-skip-next__button {
  grid-area: button;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 154px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5b700, #ff7a1a);
  color: #211500;
  box-shadow: 0 6px 20px rgba(245, 183, 0, 0.25);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.sp-skip-next__button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 8px 24px rgba(245, 183, 0, 0.34);
}

.sp-skip-next__button:focus-visible {
  outline: 3px solid rgba(245, 183, 0, 0.38);
  outline-offset: 3px;
}

.sp-skip-next__button:disabled {
  cursor: wait;
  filter: saturate(0.55);
  opacity: 0.75;
}

.sp-skip-next__button small {
  position: absolute;
  top: -8px;
  right: 8px;
  padding: 2px 6px;
  border: 2px solid var(--sp-surface);
  border-radius: 999px;
  background: var(--sp-red);
  color: #fff;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.sp-skip-popover {
  width: 260px;
}

.sp-skip-popover__balance {
  margin-bottom: 10px;
  color: var(--sp-text-muted);
  font-size: 12px;
}

.sp-skip-popover__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.sp-skip-popover__chip {
  padding: 5px 9px;
  border: 1px solid var(--sp-border);
  border-radius: 999px;
  background: var(--sp-surface-2);
  color: var(--sp-text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.sp-skip-popover__chip--accent {
  border-color: rgba(245, 183, 0, 0.55);
  background: rgba(245, 183, 0, 0.12);
  color: #b17800;
  font-weight: 700;
}

.sp-skip-popover__custom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.sp-nowplaying__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sp-green);
}

.sp-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.sp-eq span {
  width: 2.5px;
  background: var(--sp-green);
  border-radius: 1px;
  animation: sp-eq-bounce 0.9s ease-in-out infinite;
}

.sp-eq span:nth-child(1) {
  animation-delay: -0.5s;
}
.sp-eq span:nth-child(2) {
  animation-delay: -0.25s;
}
.sp-eq span:nth-child(3) {
  animation-delay: -0.75s;
}

@keyframes sp-eq-bounce {
  0%,
  100% {
    height: 3px;
  }
  50% {
    height: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-eq span {
    animation: none;
    height: 7px;
  }
}

/* ── Trang xác thực ───────────────────────────────────────────────── */

.sp-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--sp-surface-2) 0%, var(--sp-bg) 55%);
  box-sizing: border-box;
}

.sp-auth__card {
  width: 100%;
  max-width: 420px;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-lg);
  padding: 36px 32px 28px;
}

.sp-auth__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.sp-auth__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  margin: 0;
  color: var(--sp-text);
}

.sp-auth__hint {
  text-align: center;
  font-size: 13px;
  color: var(--sp-text-muted);
  margin: 8px 0 0;
}

.sp-auth__divider {
  height: 1px;
  background: var(--sp-border);
  margin: 22px 0 18px;
}

.sp-auth__switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--sp-text-muted);
}

.sp-auth__switch button {
  border: none;
  background: none;
  padding: 0 4px;
  font: inherit;
  font-weight: 700;
  color: var(--sp-text);
  text-decoration: underline;
  cursor: pointer;
}

/* ── Tiện ích ─────────────────────────────────────────────────────── */

.sp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 20px;
  text-align: center;
  color: var(--sp-text-muted);
  font-size: 13.5px;
}

.sp-empty__icon {
  font-size: 30px;
  opacity: 0.6;
}

.sp-section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--sp-text);
}

.sp-muted {
  color: var(--sp-text-muted);
}

.sp-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border-radius: var(--sp-radius-lg);
  background: linear-gradient(135deg, #1db954 0%, #0f7a37 100%);
  color: #fff;
}

.sp-hero__art {
  width: 96px;
  height: 96px;
  border-radius: var(--sp-radius);
  object-fit: cover;
  box-shadow: var(--sp-shadow-lg);
  flex-shrink: 0;
}

.sp-hero__kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

.sp-hero__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 4px 0 6px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sp-hero__sub {
  font-size: 13.5px;
  opacity: 0.9;
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 1240px) {
  .sp-shell {
    grid-template-columns: var(--sp-sidebar-w) minmax(0, 1fr);
    grid-template-areas:
      'sidebar main'
      'player player';
  }

  .sp-rail {
    display: none;
  }
}

@media (max-width: 900px) {
  .sp-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'sidebar'
      'main'
      'player';
    height: auto;
    min-height: 100vh;
  }

  .sp-main {
    overflow: visible;
  }

  /* Sidebar xếp dọc phía trên nội dung — vẫn giữ nguyên form thêm bài */
  .sp-sidebar {
    flex-direction: column;
  }

  .add-song-form--main .add-song-form__fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .avatar-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sp-track {
    grid-template-columns: 28px 44px minmax(0, 1fr);
  }

  .sp-track__side {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  .sp-nowplaying {
    height: auto;
    min-height: var(--sp-player-h);
    flex-wrap: wrap;
    padding-block: 12px;
  }

  .sp-nowplaying__meta {
    flex-basis: calc(100% - 72px);
  }

  .sp-skip-next {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/*
 * ChibiOverlay đặt pointer-events:none trên wrapper, nhưng react-three-fiber
 * tự ghi pointer-events:auto (inline) lên div và canvas bên trong nên wrapper
 * bị vô hiệu — con chibi nuốt mọi click ở góc phải dưới màn hình. Inline style
 * chỉ thắng được bằng !important.
 */
.chibi-overlay,
.chibi-overlay * {
  pointer-events: none !important;
}

/* ── Khung tin tức ở cột phải ─────────────────────────────────────── */

/*
 * Chuỗi cha-con phải liên tục `flex: 1 / min-height: 0` thì chiều cao mới
 * truyền được xuống tận .news-scroll. Thiếu một mắt xích là widget lại phình
 * ra ngoài khung và nuốt mất thao tác cuộn/click.
 * Cấu trúc: .sp-newsdock > .ant-tabs > .ant-tabs-content-holder
 *           > .ant-tabs-tabpane > .news-view > .news-scroll
 */
.sp-newsdock {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.sp-newsdock > .ant-tabs,
.sp-newsdock .ant-tabs-content-holder,
.sp-newsdock .ant-tabs-content,
.sp-newsdock .ant-tabs-tabpane:not(.ant-tabs-tabpane-hidden) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/*
 * antd ẩn tab không active bằng .ant-tabs-tabpane-hidden { display: none }.
 * Rule display:flex ở trên có specificity cao hơn nên phải loại trừ rõ ràng,
 * nếu không cả hai tab cùng hiện và tab sau bị đẩy xuống dưới.
 */
.sp-newsdock .ant-tabs-tabpane-hidden {
  display: none;
}

.sp-newsdock .ant-tabs-nav {
  flex: 0 0 auto;
}


.news-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

/* ── Hoà antd vào bảng màu ────────────────────────────────────────── */

.sp-shell .ant-tabs-nav {
  margin-bottom: 8px;
}

.sp-shell .ant-tabs-tab {
  font-weight: 600;
}

.sp-panel .ant-empty-description {
  color: var(--sp-text-muted);
}
/* Pill số dư Polite Coins trên thanh trên cùng */
.sp-coin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px 5px 5px;
  border-radius: var(--sp-radius-pill);
  background: linear-gradient(135deg, #ffe07a 0%, #f4b823 52%, #e79b0c 100%);
  color: #4d3400;
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
  border: 1.5px solid #ffe9a0;
  box-shadow:
    0 2px 10px rgba(238, 168, 20, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.75);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.sp-coin:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 14px rgba(238, 168, 20, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.75);
}

.sp-coin__img {
  width: 26px;
  height: 26px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(120, 80, 0, 0.35));
}

.sp-coin__unit {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.75;
  margin-left: -2px;
}

:root[data-theme='dark'] .sp-coin {
  background: linear-gradient(135deg, #6b5a1e, #957f24);
  color: #ffe9a8;
}

/* ── Xúc xắc CSS (tạm, Đợt 2 thay bằng ảnh 3D) ────────────────────── */
.sp-die {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 12%;
  box-sizing: border-box;
  background: #fafafa;
  border-radius: 22%;
  box-shadow:
    inset 0 -3px 6px rgba(0, 0, 0, 0.12),
    inset 0 3px 4px rgba(255, 255, 255, 0.9),
    0 4px 10px rgba(0, 0, 0, 0.22);
  border: 1px solid #e6e6e6;
}

.sp-die__cell {
  display: grid;
  place-items: center;
}

.sp-die__pip {
  width: 66%;
  height: 66%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a4a4a, #111);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

.sp-die__pip--red {
  background: radial-gradient(circle at 35% 30%, #ff5a5a, #c81d1d);
}

.sp-die--hidden {
  background: linear-gradient(145deg, #e8e8e8, #cfcfcf);
}

.sp-die__q {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: grid;
  place-items: center;
  font-size: 150%;
  font-weight: 800;
  color: #9a9a9a;
}

@keyframes sp-die-shake {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-6px) rotate(-14deg); }
  50% { transform: translateY(2px) rotate(10deg); }
  75% { transform: translateY(-3px) rotate(-6deg); }
}

.sp-die--rolling {
  animation: sp-die-shake 0.45s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sp-die--rolling {
    animation: none;
  }
}

/* ── Nút nổi bật ở cột phải Home ───────────────────────────────────── */
.chohan-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: var(--sp-radius-lg);
  cursor: pointer;
  color: #fff;
  text-align: left;
  background: linear-gradient(135deg, #e2261d 0%, #7a0f16 100%);
  box-shadow: 0 8px 22px rgba(226, 38, 29, 0.35);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.chohan-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(226, 38, 29, 0.45);
}

.chohan-cta:active {
  transform: translateY(0);
}

.chohan-cta__icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.chohan-cta__title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.chohan-cta__sub {
  font-size: 12px;
  opacity: 0.9;
}

.chohan-cta__badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--sp-radius-pill);
  background: rgba(255, 255, 255, 0.22);
  white-space: nowrap;
}

/* Dải trạng thái nhỏ trong panel Home */
.chohan-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px 2px;
}

.chohan-chip {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.chohan-chip--cho {
  background: #1db954;
}

.chohan-chip--han {
  background: #e2261d;
}

/* ── Overlay chơi ──────────────────────────────────────────────────── */
.chohan-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
}

.chohan-modal {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-lg);
  padding: 20px 22px 24px;
}

.chohan-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.chohan-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sp-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chohan-close {
  border: none;
  background: var(--sp-surface-active);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--sp-text-muted);
}

.chohan-close:hover {
  background: var(--sp-surface-hover);
  color: var(--sp-text);
}

/* Nút "?" xem luật — màu nổi bật + nhịp pulse hút mắt */
.chohan-help {
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55);
  animation: chohan-help-pulse 2s ease-out infinite;
  transition: transform 0.12s ease, background 0.15s ease;
}

.chohan-help:hover {
  background: linear-gradient(135deg, #4f8ff8, #3b82f6);
  transform: scale(1.1) rotate(-6deg);
  animation: none;
}

@keyframes chohan-help-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .chohan-help {
    animation: none;
  }
}

/* Sân khấu bát + xúc xắc */
.chohan-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 0 10px;
}

/*
 * Sân khấu: bát gỗ (úp che xúc xắc) ở trên; khi lắc xong, bát nghiêng và 2
 * xúc xắc ĐỔ ra nền, nảy vài cái rồi nằm yên hé lộ mặt.
 */
.chohan-arena {
  position: relative;
  width: 300px;
  height: 284px;
  margin: 0 auto;
}

.sp-die-img {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.28));
  user-select: none;
}

/* Bát gỗ — nằm trên cùng để che xúc xắc lúc đặt cược/lắc */
.chohan-bowl3d {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 210px;
  transform: translateX(-50%);
  transform-origin: 50% 86%;
  z-index: 3;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.3));
}

.chohan-arena--shaking .chohan-bowl3d {
  animation: chohan-bowl-shake 0.42s ease-in-out infinite;
}

.chohan-arena--revealed .chohan-bowl3d,
.chohan-arena--voided .chohan-bowl3d {
  animation: chohan-bowl-pour 0.9s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
}

@keyframes chohan-bowl-shake {
  0%, 100% { transform: translateX(-50%) rotate(-4deg); }
  25% { transform: translateX(-53%) rotate(4deg); }
  50% { transform: translateX(-47%) rotate(-3deg); }
  75% { transform: translateX(-51%) rotate(3deg); }
}

/* Bát rướn nhẹ rồi nghiêng đổ về phía trước, dạt lên trên nhường chỗ cho xúc xắc */
@keyframes chohan-bowl-pour {
  0% { transform: translateX(-50%) translateY(0) rotate(0); }
  30% { transform: translateX(-50%) translateY(-6px) rotate(-10deg); }
  65% { transform: translateX(-70%) translateY(-20px) rotate(34deg); }
  100% { transform: translateX(-78%) translateY(-28px) rotate(28deg); opacity: 0.96; }
}

/* Hai xúc xắc: ẩn trong bát lúc đặt cược/lắc, đổ ra nền khi mở */
.chohan-die {
  position: absolute;
  z-index: 2;
  opacity: 0;
}

.chohan-die--a {
  left: 78px;
  top: 184px;
}

.chohan-die--b {
  left: 176px;
  top: 198px;
}

.chohan-arena--revealed .chohan-die--a {
  animation: chohan-spill-a 1s cubic-bezier(0.25, 0.6, 0.3, 1) 0.18s forwards;
}

.chohan-arena--revealed .chohan-die--b {
  animation: chohan-spill-b 1s cubic-bezier(0.25, 0.6, 0.3, 1) 0.3s forwards;
}

@keyframes chohan-spill-a {
  0% { transform: translate(44px, -106px) scale(0.35) rotate(0); opacity: 0; }
  20% { opacity: 1; }
  55% { transform: translate(8px, -34px) scale(1.06) rotate(220deg); opacity: 1; }
  78% { transform: translate(0, -13px) scale(1) rotate(348deg); }
  100% { transform: translate(0, 0) scale(1) rotate(360deg); opacity: 1; }
}

@keyframes chohan-spill-b {
  0% { transform: translate(-54px, -120px) scale(0.35) rotate(0); opacity: 0; }
  20% { opacity: 1; }
  55% { transform: translate(-8px, -38px) scale(1.06) rotate(-210deg); opacity: 1; }
  80% { transform: translate(0, -11px) scale(1) rotate(-346deg); }
  100% { transform: translate(0, 0) scale(1) rotate(-360deg); opacity: 1; }
}

/* Bóng đổ dưới xúc xắc khi đã nằm yên */
.chohan-shadow {
  position: absolute;
  z-index: 1;
  width: 50px;
  height: 13px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  filter: blur(2px);
  opacity: 0;
}

.chohan-shadow--a {
  left: 80px;
  top: 234px;
}

.chohan-shadow--b {
  left: 180px;
  top: 248px;
}

.chohan-arena--revealed .chohan-shadow {
  animation: chohan-shadow-in 0.4s ease 0.6s forwards;
}

@keyframes chohan-shadow-in {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .chohan-arena--shaking .chohan-bowl3d {
    animation: none;
  }
  .chohan-arena--revealed .chohan-bowl3d,
  .chohan-arena--voided .chohan-bowl3d {
    animation: none;
    transform: translateX(-78%) translateY(-28px) rotate(28deg);
  }
  .chohan-arena--revealed .chohan-die--a,
  .chohan-arena--revealed .chohan-die--b {
    animation: none;
    opacity: 1;
  }
  .chohan-arena--revealed .chohan-shadow {
    animation: none;
    opacity: 1;
  }
}

.chohan-phase {
  font-size: 13px;
  font-weight: 700;
  color: var(--sp-text-muted);
  text-align: center;
}

.chohan-countdown {
  font-size: 30px;
  font-weight: 800;
  color: var(--sp-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chohan-result-banner {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  padding: 8px 0;
}

.chohan-result-banner--cho {
  color: var(--sp-green-press);
}

.chohan-result-banner--han {
  color: var(--sp-red);
}

/* Điều khiển đặt cược */
.chohan-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0;
}

.chohan-side {
  padding: 14px;
  border-radius: var(--sp-radius);
  border: 2px solid var(--sp-border-strong);
  background: var(--sp-surface-2);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}

.chohan-side:hover:not(:disabled) {
  transform: translateY(-2px);
}

.chohan-side:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chohan-side__name {
  font-size: 17px;
  font-weight: 800;
  color: var(--sp-text);
}

.chohan-side__hint {
  font-size: 12px;
  color: var(--sp-text-muted);
}

.chohan-side__tally {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sp-text-muted);
}

.chohan-side--cho.is-selected {
  border-color: var(--sp-green);
  background: var(--sp-green-soft);
}

.chohan-side--han.is-selected {
  border-color: var(--sp-red);
  background: rgba(226, 33, 52, 0.12);
}

/* Stepper số cược */
.chohan-stake {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0;
}

.chohan-stake__btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--sp-border-strong);
  background: var(--sp-surface-2);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: var(--sp-text);
}

.chohan-stake__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chohan-stake__value {
  font-size: 26px;
  font-weight: 800;
  min-width: 84px;
  text-align: center;
  color: var(--sp-text);
  font-variant-numeric: tabular-nums;
}

.chohan-mybet {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  padding: 10px;
  border-radius: var(--sp-radius);
  background: var(--sp-surface-2);
  color: var(--sp-text);
}

.chohan-balance {
  text-align: center;
  font-size: 13px;
  color: var(--sp-text-muted);
  margin-top: 6px;
}

.chohan-balance strong {
  color: #d9a400;
}

/* Lịch sử ngắn dưới overlay */
.chohan-history {
  margin-top: 14px;
  border-top: 1px solid var(--sp-border);
  padding-top: 12px;
}

.chohan-history__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--sp-text-muted);
  margin-bottom: 8px;
}

.chohan-history__row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Line chart tổng xúc xắc */
.chohan-chart {
  width: 100%;
  height: auto;
  display: block;
}

.chohan-chart__grid {
  stroke: var(--sp-border);
  stroke-width: 1;
}

.chohan-chart__ytext,
.chohan-chart__xtext {
  fill: var(--sp-text-faint);
  font-size: 9px;
  font-weight: 600;
}

.chohan-chart__line {
  fill: none;
  stroke: var(--sp-text-faint);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chohan-chart__dot {
  stroke: var(--sp-surface);
  stroke-width: 1.5;
}

.chohan-chart__dot--cho {
  fill: var(--sp-green);
}

.chohan-chart__dot--han {
  fill: var(--sp-red);
}

/* ── Modal luật chơi ───────────────────────────────────────────────── */
.chohan-overlay--rules {
  z-index: 1300;
}

.chohan-rules__lead {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--sp-text);
  margin: 4px 0 12px;
}

.chohan-rules__desc {
  font-size: 13.5px;
  color: var(--sp-text-muted);
  margin: 0 0 14px;
}

.chohan-rules__block {
  background: var(--sp-surface-2);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.chohan-rules__block p {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--sp-text);
}

.chohan-rules__block ul {
  margin: 0;
  padding-left: 4px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chohan-rules__block li {
  font-size: 13.5px;
  color: var(--sp-text);
}

.chohan-rules__outcome {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

.chohan-rules__outcome p {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--sp-radius);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--sp-green-soft);
  color: var(--sp-text);
}

.chohan-rules__outcome p:last-child {
  background: rgba(226, 33, 52, 0.1);
}
/* Bi-a 9 bóng — NPC dọn bàn. Dùng token --sp-* của design system chung. */

/* ── Nút ở cột phải Home ───────────────────────────────────────────── */
.bil-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bil-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: var(--sp-radius-lg);
  cursor: pointer;
  color: #fff;
  text-align: left;
  background: linear-gradient(135deg, #16955c 0%, #0a4a2c 100%);
  box-shadow: 0 8px 22px rgba(16, 122, 74, 0.32);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.bil-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(16, 122, 74, 0.42);
}

.bil-cta:active {
  transform: translateY(0);
}

.bil-cta__icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.bil-cta__title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.bil-cta__sub {
  font-size: 12px;
  opacity: 0.9;
}

.bil-cta__badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--sp-radius-pill);
  background: rgba(255, 255, 255, 0.22);
  white-space: nowrap;
}

/* ── Overlay xem ván ───────────────────────────────────────────────── */
.bil-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(3px);
}

.bil-modal {
  width: 100%;
  max-width: 1180px;
  max-height: 94vh;
  overflow-y: auto;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-lg);
  padding: 18px 22px 22px;
}

.bil-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bil-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sp-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bil-close {
  border: none;
  background: var(--sp-surface-active);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--sp-text-muted);
}

.bil-close:hover {
  background: var(--sp-surface-hover);
  color: var(--sp-text);
}

/*
 * Chiều cao modal do BÀN BI quyết định, không phải cột thông tin — nếu không,
 * nhật ký dài ra tới bi thứ 6, 7 là modal giãn theo, nhìn nhảy hết cả UI.
 * Cột phải nằm absolute nên không đóng góp chiều cao, tự cuộn bên trong.
 */
.bil-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 18px;
  align-items: stretch;
}

/* ── Bàn bi ────────────────────────────────────────────────────────── */
.bil-stage {
  position: relative;
  min-width: 0;
}

.bil-table {
  width: 100%;
  line-height: 0;
}

.bil-table__canvas {
  display: block;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.bil-stage__banner {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: var(--sp-radius-pill);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Cột thông tin ─────────────────────────────────────────────────── */
.bil-side {
  position: relative;
  min-width: 0;
}

.bil-side__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.bil-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bil-stat {
  background: var(--sp-surface-2);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.bil-stat__label {
  font-size: 11px;
  color: var(--sp-text-faint);
  font-weight: 600;
}

.bil-stat__value {
  font-size: 16px;
  font-weight: 800;
  color: var(--sp-text);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bil-stat__value--sm {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

/* Lý do phải nhấc bi cái đặt lại — hiếm khi hiện, nên cho nổi màu cảnh báo */
.bil-stat__reason {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: #b8860b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

:root[data-theme='dark'] .bil-stat__reason {
  color: #ffd166;
}

.bil-block {
  background: var(--sp-surface-2);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  padding: 10px 12px;
}

.bil-block--grow {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bil-block__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--sp-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.bil-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Chấm tròn mang màu bi thật */
.bil-ball {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: radial-gradient(
    circle at 32% 28%,
    rgba(255, 255, 255, 0.75),
    var(--bil-ball-color) 44%,
    rgba(0, 0, 0, 0.55)
  );
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.bil-ball--striped {
  background:
    linear-gradient(
      to bottom,
      #f2f0ea 0 28%,
      var(--bil-ball-color) 28% 72%,
      #f2f0ea 72% 100%
    );
  color: #1b1b1b;
  text-shadow: none;
}

.bil-ball--muted {
  filter: grayscale(1);
  opacity: 0.3;
}

.bil-log {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bil-log__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--sp-text);
}

.bil-log__pocket {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bil-log__shot {
  color: var(--sp-text-faint);
  font-size: 11px;
  white-space: nowrap;
}

.bil-log__empty {
  font-size: 12px;
  color: var(--sp-text-faint);
}

@media (max-width: 900px) {
  .bil-body {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Một cột thì để nội dung chảy tự nhiên, bỏ khung cuộn cố định */
  .bil-side {
    position: static;
  }

  .bil-side__inner {
    position: static;
    overflow: visible;
  }

  .bil-log {
    max-height: 240px;
  }
}

/* ── Các cửa ăn được của cơ hiện tại (nền cho tính năng cược) ──────── */
.bil-odds {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bil-odds__row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--sp-text);
  border-radius: 6px;
  border-left: 3px solid var(--bil-odds-color);
  background: color-mix(in srgb, var(--bil-odds-color) 10%, transparent);
}

/* Cả hàng là một nút đặt cược */
.bil-odds__pick {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 8px;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}

.bil-odds__pick:hover:not(:disabled) {
  background: color-mix(in srgb, var(--bil-odds-color) 18%, transparent);
}

.bil-odds__pick:disabled {
  cursor: default;
}

/* Kèo mình đã đặt */
.bil-odds__row--mine {
  outline: 2px solid var(--bil-odds-color);
  outline-offset: -1px;
}

.bil-odds__tag {
  margin-left: 6px;
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--bil-odds-color);
}

/* Kết quả sau khi bi đã lăn xong */
.bil-odds__row--won {
  background: color-mix(in srgb, #1db954 22%, transparent);
  border-left-color: #1db954;
}

.bil-odds__row--lost {
  opacity: 0.4;
}

.bil-odds__gain {
  flex: 0 0 auto;
  padding-right: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #1db954;
  white-space: nowrap;
}

.bil-odds__gain--off {
  color: var(--sp-text-faint);
  font-weight: 600;
}

/* ── Khu đặt cược ──────────────────────────────────────────────────── */
.bil-bet__timer {
  margin-left: 6px;
  font-style: normal;
  font-weight: 800;
  color: #e8a317;
  text-transform: none;
}

.bil-bet__stakes {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.bil-bet__stake {
  flex: 1 1 0;
  padding: 5px 0;
  border-radius: 6px;
  border: 1px solid var(--sp-border-strong);
  background: var(--sp-surface);
  color: var(--sp-text);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.bil-bet__stake--on {
  background: var(--sp-green);
  border-color: var(--sp-green);
  color: #fff;
}

.bil-bet__stake:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bil-bet__error {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--sp-red);
}

.bil-bet__mine {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--sp-text-muted);
}

.bil-bet__win {
  color: #1db954;
  font-weight: 800;
}

.bil-bet__lose {
  color: var(--sp-red);
  font-weight: 800;
}

.bil-bet__hint {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--sp-text-faint);
}

.bil-odds__row--easy {
  --bil-odds-color: #1db954;
}

.bil-odds__row--medium {
  --bil-odds-color: #e8a317;
}

.bil-odds__row--hard {
  --bil-odds-color: #e2513d;
}

.bil-odds__pocket {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bil-odds__row--won .bil-odds__pocket {
  font-weight: 800;
}

/* Người cược nhìn con số nhân, không nhìn chữ "Dễ/Khó" hay xác suất nội bộ. */
.bil-odds__mult {
  flex: 0 0 auto;
  min-width: 44px;
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: var(--bil-odds-color);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bil-block__note {
  margin-left: 6px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--sp-text-faint);
  text-transform: none;
}
/*
 * Khung tin tức "Thế giới có gì mới?".
 *
 * Cột phải chỉ rộng 340px và phải chia chỗ cho Cho-Han / Billiards / feed hoạt
 * động, nên bố cục cũ (ảnh full-width 120px + 3 dòng tóm tắt cho MỌI tin) chỉ
 * đủ chỗ hiện đúng một tin — đọc thì ít mà chiếm chỗ thì nhiều. Bố cục mới:
 *   - tin đầu tiên = hero, tiêu đề đè lên ảnh (bắt mắt, gọn chiều cao)
 *   - các tin sau = hàng ngang thumbnail 72px (≈4 tin trong cùng khoảng trống)
 *   - nút "Xem tất cả" mở NewsReaderModal dạng lưới tạp chí để đọc thật sự
 */

/* ── Vỏ widget ────────────────────────────────────────────────────── */

.news-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.news-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 2px 8px;
}

.news-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--sp-text-muted);
}

.news-source__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--news-accent, var(--sp-green));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--news-accent, var(--sp-green)) 22%, transparent);
}

.news-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sp-text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.news-refresh:hover:not(:disabled) {
  background: var(--sp-surface-hover);
  color: var(--sp-text);
}

.news-refresh:disabled {
  cursor: default;
  opacity: 0.6;
}

/* ── Danh sách trong cột phải ─────────────────────────────────────── */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-item {
  color: inherit;
  text-decoration: none;
  border-radius: var(--sp-radius);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.news-item:hover {
  color: inherit;
}

/* Hero — tin mới nhất, tiêu đề nằm trên ảnh */

.news-hero {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--sp-radius-lg);
  background: var(--sp-surface-2);
  aspect-ratio: 16 / 10;
  flex: 0 0 auto;
}

/* Không có ảnh (hoặc ảnh chết) thì hero co lại thành khối chữ, khỏi để một
 * mảng nền trống theo tỉ lệ 16/10 chình ình. */
.news-hero--flat {
  aspect-ratio: auto;
  background: linear-gradient(135deg, var(--sp-surface-active), var(--sp-surface-2));
}

.news-hero--flat .news-hero__veil {
  display: none;
}

.news-hero--flat .news-hero__body {
  position: static;
  padding: 14px;
}

.news-hero--flat .news-hero__title {
  color: var(--sp-text);
  text-shadow: none;
}

.news-hero--flat .news-hero__meta {
  color: var(--sp-text-faint);
}

.news-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.news-hero:hover .news-hero__img {
  transform: scale(1.04);
}

.news-hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.72) 32%,
    rgba(0, 0, 0, 0.15) 62%,
    rgba(0, 0, 0, 0) 100%
  );
}

.news-hero__body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-hero__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-hero__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.78);
}

/* Hàng gọn — thumbnail trái, tiêu đề phải */

.news-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px;
}

.news-row:hover {
  background: var(--sp-surface-hover);
}

.news-row__thumb {
  width: 72px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--sp-radius);
  background: var(--sp-surface-2);
  display: block;
}

.news-row__thumb--empty {
  display: grid;
  place-items: center;
  font-size: 18px;
}

.news-row__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.news-row__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--sp-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-row__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--sp-text-faint);
}

/* Nhãn "Mới" cho tin dưới 2 tiếng */

.news-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: var(--sp-radius-pill);
  background: var(--sp-green);
  color: var(--sp-text-on-accent, #000);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.news-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--sp-radius-pill);
  background: var(--sp-surface-active);
  color: var(--sp-text-muted);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Nút mở trang đọc ─────────────────────────────────────────────── */

.news-expand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--sp-border-strong);
  border-radius: var(--sp-radius-pill);
  background: transparent;
  color: var(--sp-text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.news-expand:hover {
  background: var(--sp-surface-hover);
  border-color: var(--sp-green);
  color: var(--sp-text);
}

/* ── Trang đọc toàn màn hình ──────────────────────────────────────── */

.news-modal .ant-modal-content {
  padding: 0;
  overflow: hidden;
  border-radius: var(--sp-radius-lg);
  background: var(--sp-surface);
}

.news-modal .ant-modal-body {
  padding: 0;
}

.news-reader {
  display: flex;
  flex-direction: column;
  height: min(84vh, 900px);
  min-height: 0;
}

.news-reader__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 0;
  flex: 0 0 auto;
}

.news-reader__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sp-text);
}

.news-reader__sub {
  display: block;
  margin: 4px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sp-text-muted);
}

.news-reader__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 0 24px 20px;
}

.news-reader__body > .ant-tabs,
.news-reader__body .ant-tabs-content-holder,
.news-reader__body .ant-tabs-content,
.news-reader__body .ant-tabs-tabpane:not(.ant-tabs-tabpane-hidden) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.news-reader__body .ant-tabs-tabpane-hidden {
  display: none;
}

.news-reader__body .ant-tabs-nav {
  flex: 0 0 auto;
}

/* Lưới tạp chí */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  align-items: start; /* không kéo dãn thẻ ngắn cho bằng thẻ dẫn */
  gap: 16px;
  padding-bottom: 8px;
}

.news-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--sp-radius-lg);
  background: var(--sp-surface-2);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.news-card:hover {
  background: var(--sp-surface-hover);
  border-color: var(--sp-border-strong);
  color: inherit;
  transform: translateY(-2px);
}

/* Tin đầu tiên chiếm hai cột — mắt có chỗ để bám vào khi mở lưới. */
.news-card--lead {
  grid-column: span 2;
}

/* Trừ khi nó không có ảnh: một thẻ toàn chữ kéo rộng gấp đôi chỉ thấy trống. */
.news-card--lead.news-card--text {
  grid-column: span 1;
}

.news-card__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--sp-radius);
  background: var(--sp-surface-active);
  aspect-ratio: 16 / 9;
  flex: 0 0 auto;
}

.news-card--lead .news-card__media {
  aspect-ratio: 16 / 8;
}

.news-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Thẻ không ảnh: bù lại bằng chữ to hơn và nền đậm hơn để không bị "hụt". */
.news-card--text {
  padding: 14px 14px 12px;
  border-color: var(--sp-border);
}

.news-card--text .news-card__title {
  font-size: 15px;
  -webkit-line-clamp: 4;
}

.news-card--text .news-card__summary {
  -webkit-line-clamp: 4;
}

.news-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px 4px;
}

.news-card__title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--sp-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card--lead .news-card__title {
  font-size: 17px;
}

.news-card__summary {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--sp-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 2px;
  font-size: 11.5px;
  color: var(--sp-text-faint);
}

.news-loadmore {
  display: flex;
  justify-content: center;
  padding: 16px 0 4px;
  grid-column: 1 / -1;
}

/* Bố cục lưới hẹp lại thì tin dẫn không span 2 cột nữa */
@media (max-width: 720px) {
  .news-card--lead {
    grid-column: span 1;
  }

  .news-card--lead .news-card__title {
    font-size: 14.5px;
  }
}

/* ── Trạng thái rỗng / lỗi ────────────────────────────────────────── */

.news-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--sp-text-muted);
  font-size: 13px;
}

.news-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-skeleton__block {
  border-radius: var(--sp-radius);
  background: linear-gradient(
    90deg,
    var(--sp-surface-2) 25%,
    var(--sp-surface-hover) 37%,
    var(--sp-surface-2) 63%
  );
  background-size: 400% 100%;
  animation: news-shimmer 1.4s ease infinite;
}

@keyframes news-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-skeleton__block {
    animation: none;
  }

  .news-hero:hover .news-hero__img,
  .news-card:hover {
    transform: none;
  }
}
/* ── CTA cờ tướng ngoài Home ─────────────────────────────────────── */
.xiangqi-promo {
  position: relative;
  isolation: isolate;
  min-height: 160px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(255, 221, 132, 0.55);
  border-radius: var(--sp-radius-lg);
  color: #fff9e9;
  background:
    linear-gradient(125deg, rgba(45, 13, 8, 0.12), rgba(45, 13, 8, 0.88)),
    url('/xiangqi/gmchess-wood/xiangqi_gmchess_wood.svg') center 42% / 145% auto,
    #7b2016;
  box-shadow: 0 14px 34px rgba(118, 31, 20, 0.34);
}

.xiangqi-promo__glow {
  position: absolute;
  z-index: -1;
  inset: -80px -120px auto auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 197, 75, 0.3);
  filter: blur(30px);
}

.xiangqi-promo__piece {
  position: absolute;
  right: 12px;
  top: 33px;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 7px solid #6d160f;
  border-radius: 50%;
  color: #b01810;
  background: radial-gradient(circle at 35% 28%, #fff3c2, #d9a34d 68%, #955b1e);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.38), inset 0 0 0 2px #f7d985;
  font: 900 33px serif;
  transform: rotate(8deg);
}

.xiangqi-promo__copy { position: relative; z-index: 1; max-width: 230px; }
.xiangqi-promo__eyebrow, .xiangqi-eyebrow { color: #ffd86c; font-size: 10px; font-weight: 900; letter-spacing: 0.16em; }
.xiangqi-promo h2 { margin: 4px 0 2px; font-size: 21px; line-height: 1.1; }
.xiangqi-promo__copy > p { margin: 0 0 15px; font-size: 12px; color: rgba(255,255,255,.84); }
.xiangqi-promo__actions { display: flex; gap: 7px; }
.xiangqi-promo__actions button { border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer; font-size: 11px; font-weight: 850; }
.xiangqi-promo__primary { color: #351600; background: linear-gradient(135deg, #ffe899, #f3b92f); box-shadow: 0 4px 12px rgba(0,0,0,.22); }
.xiangqi-promo__secondary { color: white; background: rgba(255,255,255,.16); backdrop-filter: blur(4px); }
.xiangqi-promo__actions button:hover { transform: translateY(-1px); }
.xiangqi-promo__badge { position: absolute; right: 12px; bottom: 13px; padding: 3px 8px; border-radius: 999px; color: #ffe9a3; background: rgba(31,7,4,.52); font-size: 10px; font-weight: 750; }

.xiangqi-promo--sticky {
  position: fixed;
  z-index: 70;
  width: 238px;
  min-height: 92px;
  box-sizing: border-box;
  padding: 13px 12px 10px;
  cursor: grab;
  touch-action: none;
  transition: left .18s ease, top .18s ease, box-shadow .18s ease;
}

.xiangqi-promo--sticky:not([style]) { visibility: hidden; }
.xiangqi-promo--sticky.is-dragging { cursor: grabbing; transition: none; box-shadow: 0 18px 38px rgba(80,25,12,.46); }
.xiangqi-promo--sticky .xiangqi-promo__copy { max-width: 170px; }
.xiangqi-promo--sticky .xiangqi-promo__piece { top: 27px; right: 10px; width: 42px; height: 42px; border-width: 4px; font-size: 21px; }
.xiangqi-promo--sticky h2 { margin: 2px 0 1px; font-size: 15px; }
.xiangqi-promo--sticky .xiangqi-promo__copy > p { margin-bottom: 8px; font-size: 10px; }
.xiangqi-promo--sticky .xiangqi-promo__actions { gap: 5px; }
.xiangqi-promo--sticky .xiangqi-promo__actions button { padding: 6px 9px; font-size: 10px; }
.xiangqi-promo__drag { position: absolute; top: 3px; left: 7px; color: rgba(255,255,255,.6); font-size: 13px; line-height: 1; cursor: grab; }
.xiangqi-promo__close { position: absolute; z-index: 3; top: 5px; right: 5px; display: grid; width: 20px; height: 20px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: rgba(255,255,255,.78); background: rgba(32,8,4,.48); cursor: pointer; font-size: 9px; }
.xiangqi-promo__close:hover { color: #fff; background: rgba(32,8,4,.75); }

.sp-quicktoys__btn--xiangqi {
  color: #9c271b !important;
  border: 2px solid #8c2519 !important;
  background: radial-gradient(circle at 35% 28%, #fff0ba, #dba554 72%, #a36b2e) !important;
  font-family: serif;
  font-weight: 950;
  box-shadow: 0 3px 7px rgba(74,34,9,.24);
}

/* ── Modal luật ───────────────────────────────────────────────────── */
.xiangqi-modal-backdrop { position: fixed; z-index: 1400; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8,5,3,.68); backdrop-filter: blur(5px); }
.xiangqi-rules { width: min(660px, 100%); max-height: 92vh; overflow-y: auto; padding: 24px; border: 1px solid var(--sp-border); border-radius: 18px; color: var(--sp-text); background: var(--sp-surface); box-shadow: 0 26px 80px rgba(0,0,0,.38); }
.xiangqi-rules__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.xiangqi-rules h2 { margin: 3px 0 0; font-size: 27px; }
.xiangqi-icon-btn { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid var(--sp-border); border-radius: 50%; color: var(--sp-text); background: var(--sp-surface-2); cursor: pointer; font-weight: 800; }
.xiangqi-rules__lead { margin: 18px 0; color: var(--sp-text-muted); line-height: 1.55; }
.xiangqi-rules__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xiangqi-rules__grid article { display: flex; flex-direction: column; gap: 5px; padding: 14px; border-radius: 12px; background: var(--sp-surface-2); }
.xiangqi-rules__grid strong { font-size: 14px; }
.xiangqi-rules__grid span { color: var(--sp-text-muted); font-size: 13px; line-height: 1.45; }
.xiangqi-rules__note { margin: 14px 0; padding: 12px 14px; border-left: 3px solid #c83b27; color: var(--sp-text-muted); background: rgba(200,59,39,.08); font-size: 13px; line-height: 1.5; }
.xiangqi-rules__play { width: 100%; }

/* ── Trang chơi ───────────────────────────────────────────────────── */
.xiangqi-page { min-height: 100vh; color: var(--sp-text); background: radial-gradient(circle at 50% -10%, rgba(162,73,34,.17), transparent 38%), var(--sp-bg); }
.xiangqi-topbar { display: grid; grid-template-columns: minmax(150px, 1fr) auto minmax(260px, 1fr); align-items: center; min-height: 68px; padding: 0 28px; border-bottom: 1px solid var(--sp-border); background: color-mix(in srgb, var(--sp-surface) 88%, transparent); backdrop-filter: blur(14px); }
.xiangqi-topbar__account { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 10px; }
.xiangqi-topbar__account .sp-user-chip { min-width: 0; max-width: 220px; }
.xiangqi-topbar__account .sp-user-chip > span:not(.anticon) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xiangqi-back { color: var(--sp-text-muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.xiangqi-back:hover { color: var(--sp-text); }
.xiangqi-topbar__brand { display: flex; align-items: center; gap: 9px; font-size: 15px; white-space: nowrap; }
.xiangqi-topbar__brand span { display: grid; width: 34px; height: 34px; place-items: center; border: 3px solid #8e2418; border-radius: 50%; color: #a62618; background: #edcb89; font: 900 18px serif; }
.xiangqi-stage { width: min(1180px, calc(100% - 48px)); min-height: calc(100vh - 68px); margin: 0 auto; display: grid; place-items: center; padding: 30px 0 44px; box-sizing: border-box; }
.xiangqi-loading { color: var(--sp-text-muted); }

.xiangqi-lobby { width: min(780px, 100%); padding: 38px; text-align: center; border: 1px solid var(--sp-border); border-radius: 22px; background: var(--sp-surface); box-shadow: var(--sp-shadow-lg); }
.xiangqi-lobby h1 { margin: 7px 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.04em; }
.xiangqi-lobby > p { margin: 0 auto 26px; color: var(--sp-text-muted); }
.xiangqi-difficulties { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.xiangqi-level { display: flex; min-height: 155px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--sp-border); border-radius: 16px; color: var(--sp-text); background: var(--sp-surface-2); cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.xiangqi-level:hover:not(:disabled) { transform: translateY(-4px); border-color: #c18a3c; box-shadow: 0 12px 28px rgba(112,62,20,.15); }
.xiangqi-level:disabled { cursor: not-allowed; opacity: .45; }
.xiangqi-level span { font-size: 17px; font-weight: 800; }
.xiangqi-level strong { color: #c33a24; font-size: 25px; }
.xiangqi-level small { color: var(--sp-text-muted); }
.xiangqi-level--hard { background: linear-gradient(145deg, rgba(184,49,30,.11), var(--sp-surface-2)); }
.xiangqi-warning { margin: 18px 0 0 !important; color: var(--sp-red) !important; font-size: 13px; }
.xiangqi-link-btn { margin-top: 20px; border: 0; color: var(--sp-text-muted); background: transparent; cursor: pointer; text-decoration: underline; }

.xiangqi-game-layout { width: 100%; display: grid; grid-template-columns: minmax(530px, 700px) minmax(280px, 340px); align-items: center; justify-content: center; gap: 34px; }
.xiangqi-board-wrap { position: relative; }
.xiangqi-board { position: relative; width: 100%; aspect-ratio: 902.383 / 1002; user-select: none; filter: drop-shadow(0 18px 25px rgba(62,30,8,.26)); }
.xiangqi-board__wood { display: block; width: 100%; height: 100%; pointer-events: none; }
.xiangqi-square { position: absolute; z-index: 2; left: calc(5.694% + var(--xq-col) * 11.082%); top: calc(5.09% + var(--xq-row) * 9.98%); display: grid; width: 10.8%; aspect-ratio: 1; padding: 0; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; transform: translate(-50%, -50%); transition: filter .12s ease, transform .12s ease; }
.xiangqi-square img { width: 96%; height: 96%; pointer-events: none; filter: drop-shadow(0 4px 3px rgba(46,20,5,.38)); }
.xiangqi-square:hover img { filter: drop-shadow(0 6px 4px rgba(46,20,5,.45)) brightness(1.04); }
.xiangqi-square.is-selected { outline: 4px solid rgba(255,235,89,.92); box-shadow: 0 0 0 7px rgba(82,44,8,.25); }
.xiangqi-square.is-target::after { content: ''; width: 23%; aspect-ratio: 1; border-radius: 50%; background: rgba(25,102,51,.72); box-shadow: 0 0 0 5px rgba(255,255,255,.26); }
.xiangqi-square.is-target:has(img)::after { position: absolute; inset: -1px; width: auto; border: 5px solid rgba(25,102,51,.82); background: transparent; }
.xiangqi-square.is-hint { outline: 4px solid #ffd83d; animation: xiangqi-pulse 1s ease-in-out infinite; }
.xiangqi-square.is-answer { outline: 5px solid #25a75c; }
.xiangqi-board.is-disabled .xiangqi-square { cursor: default; }
.xiangqi-board__check { position: absolute; z-index: 4; left: 50%; top: 50%; padding: 9px 17px; border: 2px solid #ffd693; border-radius: 8px; color: #fff; background: rgba(162,28,18,.91); box-shadow: 0 8px 25px rgba(0,0,0,.28); transform: translate(-50%,-50%) rotate(-4deg); font-size: 22px; font-weight: 950; letter-spacing: .08em; }
@keyframes xiangqi-pulse { 50% { filter: brightness(1.25); } }
.xiangqi-thinking { position: absolute; left: 50%; bottom: 6%; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; color: #fff; background: rgba(39,22,12,.84); transform: translateX(-50%); font-size: 12px; font-weight: 750; backdrop-filter: blur(5px); }
.xiangqi-thinking span { width: 8px; height: 8px; border-radius: 50%; background: #ffd453; animation: xiangqi-blink .8s ease-in-out infinite alternate; }
@keyframes xiangqi-blink { to { opacity: .3; } }

.xiangqi-game-panel { padding: 22px; border: 1px solid var(--sp-border); border-radius: 18px; background: var(--sp-surface); box-shadow: var(--sp-shadow-lg); }
.xiangqi-game-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.xiangqi-level-tag { padding: 5px 11px; border-radius: 999px; background: var(--sp-surface-2); font-size: 12px; font-weight: 850; }
.xiangqi-level-tag--hard { color: #d7452c; background: rgba(215,69,44,.12); }
.xiangqi-pot { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--sp-border); color: var(--sp-text-muted); font-size: 13px; }
.xiangqi-pot strong { color: var(--sp-text); font-size: 16px; }
.xiangqi-pot--reward strong { color: #d8492e; }
.xiangqi-timer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 12px; margin-top: 16px; padding: 12px 13px; border: 1px solid rgba(30,154,80,.24); border-radius: 11px; color: var(--sp-text-muted); background: var(--sp-green-soft); font-size: 12px; }
.xiangqi-timer strong { color: var(--sp-green); font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.xiangqi-timer small { grid-column: 1 / -1; color: var(--sp-text-faint); font-size: 10px; }
.xiangqi-timer.is-urgent { border-color: rgba(216,73,46,.38); background: rgba(216,73,46,.1); }
.xiangqi-timer.is-urgent strong { color: #d8492e; animation: xiangqi-timer-pulse .7s ease-in-out infinite alternate; }
.xiangqi-timer.is-expired { border-color: var(--sp-border); background: var(--sp-surface-2); }
.xiangqi-timer.is-expired strong { color: var(--sp-text-faint); animation: none; }
@keyframes xiangqi-timer-pulse { to { opacity: .55; } }
.xiangqi-turn { display: flex; align-items: center; gap: 9px; margin: 20px 0 14px; padding: 13px; border-radius: 10px; background: var(--sp-green-soft); font-size: 13px; font-weight: 800; }
.xiangqi-turn.is-npc { background: rgba(196,62,38,.1); }
.xiangqi-turn__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sp-green); box-shadow: 0 0 0 4px rgba(29,185,84,.14); }
.xiangqi-turn.is-npc .xiangqi-turn__dot { background: #c83e26; box-shadow: 0 0 0 4px rgba(200,62,38,.14); }
.xiangqi-practice { margin-bottom: 12px; padding: 8px 10px; border-radius: 8px; color: #936d11; background: rgba(242,191,45,.13); font-size: 11px; font-weight: 750; }
.xiangqi-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xiangqi-tools button, .xiangqi-resign { min-height: 38px; border: 1px solid var(--sp-border); border-radius: 9px; color: var(--sp-text); background: var(--sp-surface-2); cursor: pointer; font-size: 12px; font-weight: 700; }
.xiangqi-tools button:disabled, .xiangqi-resign:disabled { opacity: .45; cursor: not-allowed; }
.xiangqi-resign { width: 100%; margin-top: 9px; color: var(--sp-red); background: transparent; }
.xiangqi-result { padding: 24px 0 10px; text-align: center; }
.xiangqi-result__icon { font-size: 42px; }
.xiangqi-result h2 { margin: 7px 0; }
.xiangqi-result p { color: var(--sp-text-muted); font-size: 13px; line-height: 1.45; }
.xiangqi-result__payout { display: block; margin: 12px 0 18px; color: var(--sp-green); font-size: 28px; }
.xiangqi-attribution { margin-top: 20px; color: var(--sp-text-faint); font-size: 9px; line-height: 1.4; }
.xiangqi-attribution a { color: inherit; }

@media (max-width: 960px) {
  .xiangqi-topbar { grid-template-columns: auto 1fr; gap: 14px; padding: 10px 18px; }
  .xiangqi-topbar__brand { justify-self: start; }
  .xiangqi-topbar__account { grid-column: 2; grid-row: 1 / span 2; }
  .xiangqi-back { grid-column: 1; grid-row: 2; }
  .xiangqi-game-layout { grid-template-columns: minmax(470px, 650px); }
  .xiangqi-game-panel { width: min(520px, 100%); margin: 0 auto; box-sizing: border-box; }
}

@media (prefers-reduced-motion: reduce) {
  .xiangqi-square, .xiangqi-level, .xiangqi-thinking span, .xiangqi-square.is-hint, .xiangqi-promo--sticky, .xiangqi-timer strong { animation: none; transition: none; }
}
.wordchain-promo { position: fixed; z-index: 1180; display: flex; width: 250px; min-height: 102px; box-sizing: border-box; align-items: center; gap: 10px; padding: 18px 12px 12px; overflow: hidden; border: 1px solid rgba(190,255,222,.28); border-radius: 16px; color: #fff; background: radial-gradient(circle at 10% 20%, rgba(70,255,179,.28), transparent 38%), linear-gradient(145deg,#173b37,#102521 62%,#091714); box-shadow: 0 15px 34px rgba(2,31,24,.38); cursor: grab; touch-action: none; user-select: none; }
.wordchain-promo:not([style]) { visibility: hidden; }
.wordchain-promo.is-dragging { cursor: grabbing; box-shadow: 0 20px 45px rgba(2,31,24,.52); }
.wordchain-promo__drag { position: absolute; top: 3px; left: 7px; color: rgba(255,255,255,.55); font-size: 13px; }
.wordchain-promo__close { position: absolute; z-index: 2; top: 5px; right: 5px; display: grid; width: 20px; height: 20px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: rgba(255,255,255,.8); background: rgba(0,0,0,.25); cursor: pointer; font-size: 9px; }
.wordchain-promo__icon { display: grid; width: 45px; height: 45px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(177,255,218,.3); border-radius: 14px; background: rgba(44,214,145,.13); font-size: 24px; transform: rotate(-5deg); }
.wordchain-promo__copy { min-width: 0; flex: 1; }
.wordchain-promo__copy h2 { margin: 0 0 3px; font-size: 15px; line-height: 1.2; }
.wordchain-promo__copy p { margin: 0 0 8px; overflow: hidden; color: rgba(255,255,255,.77); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.wordchain-promo__copy p strong { color: #a9f5cf; }
.wordchain-promo__copy > div { display: flex; gap: 5px; }
.wordchain-promo__copy button { padding: 6px 9px; border: 0; border-radius: 999px; color: #08251b; background: #73e7ad; cursor: pointer; font-size: 10px; font-weight: 850; }
.wordchain-promo__copy button + button { color: #fff; background: rgba(255,255,255,.14); }
.wordchain-promo__badge { position: absolute; right: 10px; bottom: 4px; color: #83e8b6; font-size: 8px; font-weight: 800; letter-spacing: .03em; }

.wordchain-backdrop { position: fixed; z-index: 1450; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(2,13,10,.76); backdrop-filter: blur(7px); }
.wordchain-game { width: min(920px,100%); max-height: 92vh; overflow: auto; border: 1px solid var(--sp-border); border-radius: 22px; color: var(--sp-text); background: var(--sp-surface); box-shadow: 0 30px 90px rgba(0,0,0,.46); }
.wordchain-game__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--sp-border); background: linear-gradient(115deg,rgba(31,190,123,.13),transparent); }
.wordchain-game__head span, .wordchain-rules__head span { color: var(--sp-green); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.wordchain-game__head h2, .wordchain-rules__head h2 { margin: 3px 0 0; font-size: 22px; }
.wordchain-game__head-actions { display: flex; gap: 7px; }
.wordchain-game__head-actions button, .wordchain-rules__head button { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 1px solid var(--sp-border); border-radius: 50%; color: var(--sp-text); background: var(--sp-surface-2); cursor: pointer; font-weight: 850; }
.wordchain-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(240px,.75fr); }
.wordchain-arena { padding: 22px; border-right: 1px solid var(--sp-border); }
.wordchain-status { display: flex; align-items: center; justify-content: space-between; color: var(--sp-text-muted); font-size: 12px; font-weight: 750; }
.wordchain-status strong { min-width: 48px; color: var(--sp-green); font-size: 29px; font-variant-numeric: tabular-nums; text-align: right; }
.wordchain-status strong.is-urgent { color: var(--sp-red); animation: wordchain-pulse .55s ease-in-out infinite alternate; }
@keyframes wordchain-pulse { to { opacity: .45; transform: scale(.94); } }
.wordchain-current { display: flex; min-height: 148px; margin: 13px 0 18px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(35,190,124,.22); border-radius: 18px; background: radial-gradient(circle,rgba(41,194,126,.13),transparent 68%),var(--sp-surface-2); }
.wordchain-current small { color: var(--sp-text-faint); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.wordchain-current strong { margin: 6px 0 2px; color: var(--sp-green); font-size: clamp(33px,5vw,52px); letter-spacing: -.04em; }
.wordchain-current span { color: var(--sp-text-muted); font-size: 11px; }
.wordchain-answer > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; }
.wordchain-answer > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.wordchain-answer input { min-width: 0; height: 44px; padding: 0 13px; border: 1px solid var(--sp-border); border-radius: 11px; outline: 0; color: var(--sp-text); background: var(--sp-surface-2); font-size: 15px; }
.wordchain-answer input:focus { border-color: var(--sp-green); box-shadow: 0 0 0 3px var(--sp-green-soft); }
.wordchain-answer button[type='submit'] { padding: 0 17px; border: 0; border-radius: 11px; color: #052016; background: var(--sp-green); cursor: pointer; font-weight: 900; }
.wordchain-answer button:disabled { cursor: not-allowed; opacity: .4; }
.wordchain-answer > p { min-height: 18px; margin: 7px 2px 0; color: var(--sp-text-muted); font-size: 10px; }
.wordchain-login { padding: 0; border: 0; color: var(--sp-green); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.wordchain-meta { display: flex; margin-top: 18px; flex-wrap: wrap; gap: 6px; }
.wordchain-meta span { padding: 5px 8px; border-radius: 999px; color: var(--sp-text-muted); background: var(--sp-surface-2); font-size: 10px; font-weight: 700; }
.wordchain-history { min-height: 430px; padding: 20px; background: color-mix(in srgb,var(--sp-surface-2) 54%,transparent); }
.wordchain-history h3 { margin: 0 0 14px; font-size: 14px; }
.wordchain-history__seed, .wordchain-history li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-bottom: 1px solid var(--sp-border); font-size: 11px; }
.wordchain-history__seed { border-radius: 9px; background: var(--sp-green-soft); }
.wordchain-history span { min-width: 0; overflow: hidden; color: var(--sp-text-muted); text-overflow: ellipsis; white-space: nowrap; }
.wordchain-history strong { flex: 0 0 auto; color: var(--sp-text); }
.wordchain-history ol { max-height: 340px; margin: 8px 0 0; padding: 0; overflow: auto; list-style: none; }
.wordchain-history > p { color: var(--sp-text-faint); font-size: 11px; text-align: center; }
.wordchain-result { padding: 14px 16px; border-radius: 13px; text-align: center; background: var(--sp-green-soft); }
.wordchain-result > span { font-size: 30px; }
.wordchain-result h3 { margin: 5px 0; }
.wordchain-result > strong { color: var(--sp-green); font-size: 25px; }
.wordchain-result p, .wordchain-result small { display: block; margin: 6px 0 0; color: var(--sp-text-muted); font-size: 10px; }
.wordchain-result--voided { background: var(--sp-surface-2); }
.wordchain-empty { padding: 60px 20px; text-align: center; }
.wordchain-empty > span { display: block; font-size: 42px; }
.wordchain-empty strong { display: block; margin-top: 8px; }
.wordchain-empty p { color: var(--sp-text-muted); }

.wordchain-rules { width: min(700px,100%); max-height: 92vh; overflow: auto; padding: 24px; box-sizing: border-box; border: 1px solid var(--sp-border); border-radius: 20px; color: var(--sp-text); background: var(--sp-surface); box-shadow: 0 28px 85px rgba(0,0,0,.44); }
.wordchain-rules__head { display: flex; align-items: flex-start; justify-content: space-between; }
.wordchain-rules__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 14px; }
.wordchain-rules__grid article { padding: 14px; border-radius: 12px; background: var(--sp-surface-2); }
.wordchain-rules__grid strong { font-size: 13px; }
.wordchain-rules__grid p, .wordchain-rules__note { color: var(--sp-text-muted); font-size: 12px; line-height: 1.5; }
.wordchain-rules__note { padding: 12px 14px; border-left: 3px solid var(--sp-green); background: var(--sp-green-soft); }
.wordchain-rules > .sp-btn { width: 100%; }

.sp-quicktoys__btn--wordchain { color: #08794e !important; background: rgba(66,224,156,.16) !important; }
@media (max-width: 760px) { .wordchain-layout { grid-template-columns: 1fr; } .wordchain-arena { border-right: 0; border-bottom: 1px solid var(--sp-border); } .wordchain-history { min-height: 220px; } .wordchain-rules__grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .wordchain-status strong.is-urgent { animation: none; } }
.rl-backdrop {
  position: fixed;
  z-index: 1460;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 18, 28, 0.78);
  backdrop-filter: blur(7px);
}

.rl-backdrop--rules { z-index: 1470; }

.rl-game {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--sp-border);
  border-radius: 22px;
  color: var(--sp-text);
  background: var(--sp-surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
}

.rl-game__head,
.rl-rules__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sp-border);
  background: linear-gradient(115deg, rgba(46, 196, 90, 0.16), rgba(232, 67, 67, 0.12));
}

.rl-game__head span,
.rl-rules__head span {
  color: #1fa85a;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.rl-game__head h2,
.rl-rules__head h2 { margin: 3px 0 0; font-size: 22px; }

.rl-game__head-actions { display: flex; gap: 7px; }

.rl-game__head-actions button,
.rl-rules__head button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--sp-border);
  border-radius: 50%;
  color: var(--sp-text);
  background: var(--sp-surface-2);
  cursor: pointer;
  font-weight: 850;
}

.rl-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(220px, 0.7fr); }
.rl-arena { padding: 16px 18px 18px; border-right: 1px solid var(--sp-border); }
.rl-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--sp-text-muted);
  font-size: 12px;
  font-weight: 750;
}
.rl-status strong {
  min-width: 48px;
  color: var(--sp-green);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.rl-status strong.is-urgent { color: var(--sp-red); }

.rl-field {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 440px;
  border-radius: 18px;
  user-select: none;
  cursor: pointer;
  touch-action: none;
  background: linear-gradient(#7ec8ff 0 42%, #5dcf6b 42% 100%);
}
.rl-field--red,
.rl-field--turning_red { background: linear-gradient(#f08a7a 0 42%, #de6b4f 42% 100%); }
.rl-field--green,
.rl-field--turning_green { background: linear-gradient(#8fd4ff 0 42%, #62d46f 42% 100%); }

.rl-sky { position: absolute; inset: 0 0 48%; pointer-events: none; }
.rl-sun {
  position: absolute;
  top: 18px;
  right: 28px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #ffe56a;
}
.rl-cloud {
  position: absolute;
  height: 22px;
  border-radius: 20px;
  background: #fff;
  opacity: 0.9;
}
.rl-cloud--a { top: 36px; left: 24px; width: 78px; }
.rl-cloud--b { top: 58px; left: 120px; width: 54px; }

.rl-banner {
  position: absolute;
  z-index: 8;
  top: 12px;
  left: 50%;
  padding: 6px 16px;
  border-radius: 999px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
}
.rl-banner--green,
.rl-banner--turning_green { background: #1fa85a; }
.rl-banner--red,
.rl-banner--turning_red { background: #e23d3d; }

.rl-stage {
  position: absolute;
  z-index: 2;
  inset: 56px 10px 36px;
}

.rl-map {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.rl-map__grass {
  fill: #4ec86a;
  stroke: #2f8a44;
  stroke-width: 1.2;
  filter: drop-shadow(0 10px 0 #2f8a44);
}
.rl-map__track-edge {
  fill: none;
  stroke: #c47a22;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.rl-map__finish {
  stroke: #c47a22;
  stroke-width: 0.6;
}

.rl-actors {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}

.rl-gate {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.rl-gate__post {
  position: absolute;
  width: 10px;
  height: 64px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #f3d27a, #8d4f12);
  box-shadow:
    inset -2px 0 0 rgba(0, 0, 0, 0.2),
    2px 2px 0 rgba(40, 20, 0, 0.18);
  transform: translate(-50%, -100%);
}
.rl-gate__post--far {
  width: 8px;
  height: 56px;
  filter: brightness(0.9);
}
.rl-gate__post--near { z-index: 8; }
.rl-gate__beam {
  position: absolute;
  z-index: 6;
  height: 8px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffe56a, #c47a22);
  box-shadow: 0 2px 0 #8d4f12;
  transform-origin: 0 center;
}
.rl-gate__banner {
  position: absolute;
  z-index: 7;
  display: flex;
  min-width: 64px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 2px solid #8d4f12;
  border-radius: 6px;
  color: #5a3208;
  background: linear-gradient(#ffe56a, #f0c84a);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  transform: translate(-50%, calc(-100% - 66px));
  box-shadow: 0 3px 0 #c47a22;
}

.rl-doll {
  position: absolute;
  z-index: 9;
  width: 48px;
  height: 78px;
  transform: translate(-50%, -100%);
  transform-origin: center bottom;
  transition: transform 0.35s ease;
}
.rl-doll--away {
  transform: translate(-50%, -100%) scaleX(-1);
}
.rl-doll__hair {
  position: absolute;
  left: 6px;
  top: 0;
  width: 34px;
  height: 24px;
  border-radius: 16px 16px 8px 8px;
  background: #3b2318;
}
.rl-doll__head {
  position: absolute;
  left: 10px;
  top: 8px;
  width: 26px;
  height: 24px;
  border-radius: 12px;
  background: #f3c7a3;
}
.rl-doll__head i {
  position: absolute;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2b2118;
}
.rl-doll__head i:first-child { left: 5px; }
.rl-doll__head i:last-child { right: 5px; }
.rl-doll__dress {
  position: absolute;
  left: 5px;
  top: 30px;
  width: 36px;
  height: 44px;
  border-radius: 8px 8px 14px 14px;
  background: #e94b7a;
}

.rl-signal {
  position: absolute;
  z-index: 8;
  width: 16px;
  height: 40px;
  border-radius: 10px;
  background: #222;
  transform: translate(-50%, -100%);
}
.rl-signal b {
  display: block;
  width: 9px;
  height: 9px;
  margin: 5px auto 0;
  border-radius: 50%;
  background: #444;
}
.rl-signal--green b:last-child,
.rl-signal--turning_green b:last-child { background: #3dff6a; }
.rl-signal--red b:first-child,
.rl-signal--turning_red b:first-child { background: #ff4d4d; }

.rl-pawn {
  position: absolute;
  width: 0;
  height: 0;
  transition: left 0.12s linear, top 0.12s linear;
}
.rl-pawn__sprite {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, calc(-100% - 1px));
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.28));
}
.rl-pawn__shadow {
  position: absolute;
  left: -16px;
  top: -4px;
  width: 32px;
  height: 10px;
  border-radius: 50%;
  background: rgba(20, 40, 16, 0.38);
}
.rl-pawn__name {
  max-width: 72px;
  overflow: hidden;
  padding: 1px 5px;
  border-radius: 999px;
  color: #123;
  background: rgba(255, 255, 255, 0.92);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rl-pawn--eliminated { filter: grayscale(1); opacity: 0.72; }
.rl-pawn--eliminated .rl-pawn__sprite::after {
  content: '✕';
  position: absolute;
  top: -6px;
  right: -4px;
  color: #e23d3d;
  font-size: 16px;
  font-weight: 900;
}
.rl-pawn--finished .rl-pawn__name { background: #ffe56a; }
.rl-pawn.is-running .sp-avatar { animation: rl-hop 0.28s ease-in-out infinite alternate; }

.rl-hint {
  position: absolute;
  z-index: 8;
  right: 12px;
  bottom: 8px;
  left: 12px;
  margin: 0;
  color: rgba(20, 40, 20, 0.8);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.rl-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  text-align: center;
  background: var(--sp-green-soft);
}
.rl-result span { font-size: 28px; }
.rl-result h3 { margin: 4px 0 8px; }
.rl-result ol { margin: 0; padding: 0; list-style: none; }
.rl-result li { color: var(--sp-text-muted); font-size: 13px; font-weight: 700; }

.rl-side {
  padding: 16px;
  background: color-mix(in srgb, var(--sp-surface-2) 54%, transparent);
}
.rl-side h3 { margin: 0 0 10px; font-size: 14px; }
.rl-side ul { margin: 0 0 14px; padding: 0; list-style: none; }
.rl-side li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--sp-border);
  font-size: 13px;
}
.rl-side em { color: var(--sp-green); font-style: normal; font-size: 11px; font-weight: 800; }
.rl-side .sp-btn { width: 100%; }
.rl-side__note { margin: 10px 0 0; color: var(--sp-text-muted); font-size: 11px; line-height: 1.45; }

.rl-empty { padding: 70px 20px; text-align: center; }
.rl-empty span { display: block; font-size: 42px; }
.rl-empty strong { display: block; margin-top: 8px; }
.rl-empty p { color: var(--sp-text-muted); }

.rl-rules {
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 24px;
  box-sizing: border-box;
  border: 1px solid var(--sp-border);
  border-radius: 20px;
  color: var(--sp-text);
  background: var(--sp-surface);
}
.rl-rules__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 14px; }
.rl-rules__grid article { padding: 14px; border-radius: 12px; background: var(--sp-surface-2); }
.rl-rules__grid p,
.rl-rules__note { color: var(--sp-text-muted); font-size: 12px; line-height: 1.5; }
.rl-rules__note {
  padding: 12px 14px;
  border-left: 3px solid #1fa85a;
  background: var(--sp-green-soft);
}
.rl-rules > .sp-btn { width: 100%; }

.sp-quicktoys__btn--redlight {
  color: #b42318 !important;
  background: rgba(226, 61, 61, 0.16) !important;
}
.sp-quicktoys__btn--redlight.is-active {
  border-color: #1fa85a;
  background: rgba(31, 168, 90, 0.18) !important;
}

@keyframes rl-hop {
  to { transform: translateY(-5px); }
}

@media (max-width: 760px) {
  .rl-layout,
  .rl-rules__grid { grid-template-columns: 1fr; }
  .rl-arena { border-right: 0; border-bottom: 1px solid var(--sp-border); }
}

@media (prefers-reduced-motion: reduce) {
  .rl-pawn.is-running .sp-avatar,
  .rl-doll { animation: none; transition: none; }
}
.chat-room {
  flex: 0 0 auto;
  min-height: 320px;
  max-height: 440px;
}

.chat-room--sidebar {
  flex: 1 1 0;
  min-height: 280px;
  max-height: none;
}

.chat-room__head {
  padding-bottom: 10px;
}

.chat-room__count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--sp-radius-pill);
  background: var(--sp-surface-2);
  color: var(--sp-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.chat-room__body {
  padding: 0 12px;
}

.chat-room__state {
  min-height: 160px;
  display: grid;
  place-items: center;
  gap: 8px;
  align-content: center;
}

.chat-room__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.chat-room__message {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.chat-room__message--mine .chat-room__bubble {
  background: var(--sp-green-soft);
  border-color: rgba(29, 185, 84, 0.24);
}

.chat-room__bubble {
  min-width: 0;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  background: var(--sp-surface-2);
  padding: 8px 10px;
}

.chat-room__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 4px;
}

.chat-room__author {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--sp-text);
  font-size: 12px;
  font-weight: 800;
}

.chat-room__role {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: var(--sp-radius-pill);
  background: var(--sp-green);
  color: var(--sp-text-on-accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-room__time {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--sp-text-faint);
  font-size: 11px;
}

.chat-room__bubble p {
  margin: 0;
  color: var(--sp-text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chat-room__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--sp-border);
}

.chat-room__composer .ant-input {
  resize: none;
}

.chat-room__composer .ant-btn {
  width: 40px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* ── Banner Quốc khánh 2/9 ─────────────────────────────────────────────
 * Dải mảnh nằm trên cùng cột giữa HomePage. Mọi hiệu ứng chỉ chạy bằng
 * transform/opacity nên không gây reflow — trang này còn có vòng
 * requestAnimationFrame 60fps của Billiards, không được giành layout.
 * Cờ đỏ sao vàng: sao vàng LUÔN nằm trên nền đỏ, không có khối vàng nào.
 */

.nd-banner {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 20px;
  min-height: 88px;
  border-radius: var(--sp-radius-lg);
  background: #da251d;
  border: 1px solid rgba(255, 205, 0, 0.28);
  box-shadow: var(--sp-shadow);
}

:root[data-theme='dark'] .nd-banner {
  background: #b31217;
  border-color: rgba(255, 205, 0, 0.22);
}

/* ── Lớp 1: đường chân trời Ba Đình, parallax theo con trỏ ───────────── */
.nd-banner__skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 62px;
  pointer-events: none;
  opacity: 0.16;
  transform: translate3d(var(--nd-parallax, 0px), 0, 0);
  transition: transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nd-banner__skyline svg {
  display: block;
  width: 108%;
  height: 100%;
  margin-left: -4%;
}

:root[data-theme='dark'] .nd-banner__skyline {
  opacity: 0.2;
}

/* ── Lớp 2: sao vàng là nguồn sáng duy nhất ──────────────────────────── */
.nd-banner__glow {
  position: absolute;
  left: 44px;
  top: 50%;
  width: 240px;
  height: 240px;
  transform: translateY(-50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 205, 0, 0.26) 0%, rgba(255, 205, 0, 0) 62%);
  animation: nd-pulse 4.5s ease-in-out infinite;
}

:root[data-theme='dark'] .nd-banner__glow {
  background: radial-gradient(circle, rgba(255, 205, 0, 0.36) 0%, rgba(255, 205, 0, 0) 62%);
}

@keyframes nd-pulse {
  0%, 100% { opacity: 0.55; transform: translateY(-50%) scale(0.92); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.06); }
}

/* ── Lớp 3: vệt sáng quét ngang mặt lụa ──────────────────────────────── */
.nd-banner__sweep {
  position: absolute;
  inset: -40% -12%;
  pointer-events: none;
  background: linear-gradient(76deg, transparent 42%, rgba(255, 255, 255, 0.16) 50%, transparent 58%);
  animation: nd-sweep 7s linear infinite;
}

@keyframes nd-sweep {
  0% { transform: translateX(-70%); }
  55%, 100% { transform: translateX(70%); }
}

/* ── Lớp 4: bụi sao bay lên, gói trong lòng banner ───────────────────── */
.nd-banner__dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.nd-banner__dust span {
  position: absolute;
  bottom: -10px;
  color: #ffcd00;
  font-size: 9px;
  line-height: 1;
  opacity: 0;
  animation: nd-rise linear infinite;
}

@keyframes nd-rise {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  18% { opacity: 0.9; }
  70% { opacity: 0.45; }
  100% { opacity: 0; transform: translateY(-78px) scale(1) rotate(70deg); }
}

/* ── Lá cờ lụa bay ───────────────────────────────────────────────────── */
.nd-banner__flag {
  position: relative;
  flex-shrink: 0;
  width: 66px;
  height: 44px;
  perspective: 220px;
}

.nd-banner__flag svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  transform-origin: left center;
  animation: nd-wave 3.6s ease-in-out infinite;
}

@keyframes nd-wave {
  0%, 100% { transform: rotateY(-11deg) skewY(1.1deg); }
  50% { transform: rotateY(9deg) skewY(-1.1deg); }
}

.nd-banner__silk {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  pointer-events: none;
  mix-blend-mode: overlay;
  background: linear-gradient(
    100deg,
    rgba(0, 0, 0, 0.22) 8%,
    rgba(255, 255, 255, 0.14) 30%,
    rgba(0, 0, 0, 0.2) 55%,
    rgba(255, 255, 255, 0.12) 78%,
    rgba(0, 0, 0, 0.18) 96%
  );
  background-size: 200% 100%;
  animation: nd-silk 3.6s ease-in-out infinite;
}

@keyframes nd-silk {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

/* ── Nội dung ────────────────────────────────────────────────────────── */
.nd-banner__body {
  position: relative;
  flex: 1 1 320px;
  min-width: 0;
}

.nd-banner__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  letter-spacing: 0.1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.nd-banner__subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.74);
}

.nd-banner__countdown {
  position: relative;
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.nd-banner__cell {
  min-width: 46px;
  text-align: center;
  padding: 5px 6px 4px;
  border-radius: var(--sp-radius);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 205, 0, 0.34);
}

.nd-banner__num {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffcd00;
  font-variant-numeric: tabular-nums;
}

.nd-banner__unit {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.62);
}

.nd-banner__num--tick {
  animation: nd-tick 450ms ease;
}

@keyframes nd-tick {
  0% { transform: translateY(-4px); opacity: 0.35; }
  100% { transform: translateY(0); opacity: 1; }
}

.nd-banner__cta {
  position: relative;
  flex-shrink: 0;
  font: inherit;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--sp-radius-pill);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 205, 0, 0.55);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.nd-banner__cta:hover {
  background: rgba(255, 205, 0, 0.2);
}

.nd-banner__cta:active {
  transform: scale(0.97);
}

/* ── Pháo hoa sao vàng: chỉ bung khi bấm, gói trong banner ───────────── */
.nd-banner__spark {
  position: absolute;
  left: var(--nd-spark-x, 50%);
  top: 50%;
  color: #ffcd00;
  font-size: var(--nd-spark-size, 10px);
  line-height: 1;
  pointer-events: none;
  animation: nd-burst var(--nd-spark-dur, 1200ms) cubic-bezier(0.16, 0.84, 0.44, 1) forwards;
}

@keyframes nd-burst {
  0% { opacity: 1; transform: translate(0, 0) scale(0.4); }
  100% {
    opacity: 0;
    transform: translate(var(--nd-spark-dx, 0px), var(--nd-spark-dy, -60px)) scale(1.1) rotate(140deg);
  }
}

/* Tôn trọng thiết lập giảm chuyển động của hệ thống. */
@media (prefers-reduced-motion: reduce) {
  .nd-banner__glow,
  .nd-banner__sweep,
  .nd-banner__flag svg,
  .nd-banner__silk,
  .nd-banner__num--tick {
    animation: none;
  }

  .nd-banner__dust,
  .nd-banner__spark {
    display: none;
  }

  .nd-banner__skyline {
    transition: none;
  }
}
.daily-idiom {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 4px 0 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--di-border);
  background: var(--di-bg);
}

.daily-idiom__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--di-badge);
}

.daily-idiom__badge-dot {
  font-size: 13px;
  line-height: 1;
}

/* Vạch ngăn giữa badge và phần chữ chạy */
.daily-idiom__divider {
  flex: 0 0 auto;
  width: 1px;
  height: 20px;
  background: var(--di-border);
}

.daily-idiom__viewport {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 24px,
    #000 calc(100% - 24px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 24px,
    #000 calc(100% - 24px),
    transparent 100%
  );
}

.daily-idiom__track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  /* Bắt đầu ngoài mép phải để không "chớp" trước khi animation chạy */
  transform: translateX(var(--di-start, 100%));
  animation: daily-idiom-scroll var(--di-duration, 20s) linear infinite;
}

.daily-idiom__viewport:hover .daily-idiom__track {
  animation-play-state: paused;
}

.daily-idiom__item {
  font-size: 15px;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  color: var(--di-text);
}

.daily-idiom__date {
  flex: 0 0 auto;
  padding: 0 10px 0 4px;
  font-size: 11px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  color: var(--di-date);
}

.daily-idiom__vote {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
}

.daily-idiom__vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: var(--di-date);
  transition: background 0.15s, color 0.15s;
}

.daily-idiom__vote-btn:hover:not(:disabled) {
  background: rgba(128, 128, 128, 0.14);
  color: var(--di-text);
}

.daily-idiom__vote-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.daily-idiom__vote-btn.is-active {
  color: #52c41a;
}

.daily-idiom__vote-btn.is-active-down {
  color: #ff4d4f;
}

.daily-idiom__vote-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Câu vào từ mép phải, trôi sang trái tới khi khuất hẳn, rồi lặp lại từ phải.
   Nhờ đó mỗi lượt vào trang user luôn đọc được câu từ chữ đầu tiên. */
@keyframes daily-idiom-scroll {
  from {
    transform: translateX(var(--di-start, 100%));
  }
  to {
    transform: translateX(var(--di-end, -100%));
  }
}

/* Tôn trọng người dùng tắt hiệu ứng chuyển động */
@media (prefers-reduced-motion: reduce) {
  .daily-idiom__track {
    animation: none;
    transform: none;
  }
  .daily-idiom__viewport {
    overflow-x: auto;
  }
}
.wealth-trigger {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #d7a82f;
  border-radius: 6px;
  background: #161616;
  color: #ffd76a;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(215, 168, 47, 0.18);
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.wealth-trigger:hover {
  border-color: #ffe29a;
  color: #fff2c2;
  transform: translateY(-1px);
}

.wealth-trigger:focus-visible,
.wealth-refresh:focus-visible,
.wealth-error button:focus-visible {
  outline: 2px solid #35d9d0;
  outline-offset: 2px;
}

.wealth-modal .ant-modal-content {
  overflow: hidden;
  padding: 0;
  border: 1px solid #53451f;
  border-radius: 8px;
  background: #111315;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.64), 0 0 32px rgba(255, 205, 84, 0.12);
}

.wealth-modal .ant-modal-close {
  top: 14px;
  right: 14px;
  color: #c8ced3;
  background: #25282b;
  border: 1px solid #3d4246;
}

.wealth-modal .ant-modal-close:hover {
  color: #ffffff;
  background: #303438;
}

.wealth-shell {
  min-height: 520px;
  padding: 28px;
  color: #f5f6f7;
  background-color: #111315;
  background-image:
    linear-gradient(rgba(255, 215, 106, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 217, 208, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
}

.wealth-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 40px;
}

.wealth-header__emblem {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  place-items: center;
  border: 1px solid #6e5927;
  border-radius: 50%;
  background: #1b1c1d;
  box-shadow: inset 0 0 0 5px #121415, 0 0 24px rgba(255, 208, 91, 0.16);
}

.wealth-header__emblem img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.wealth-header__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #35d9d0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.wealth-header h2 {
  margin: 2px 0 0;
  color: #ffd76a;
  font-size: 28px;
  line-height: 1.15;
}

.wealth-header p {
  margin: 5px 0 0;
  color: #9da5ab;
  font-size: 13px;
}

.wealth-podiums {
  display: grid;
  min-height: 276px;
  align-items: end;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.wealth-podium {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-end;
}

.wealth-podium--rank-1 {
  grid-column: 2;
}

.wealth-podium--rank-2 {
  grid-column: 1;
  grid-row: 1;
}

.wealth-podium--rank-3 {
  grid-column: 3;
  grid-row: 1;
}

.wealth-podium__identity {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  padding: 8px 6px 10px;
}

.wealth-podium__crown {
  position: absolute;
  top: -17px;
  color: #ffd76a;
  font-size: 24px;
  filter: drop-shadow(0 3px 5px rgba(255, 215, 106, 0.35));
}

.wealth-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid #747b80;
  border-radius: 50%;
  background: var(--wealth-avatar-color);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
}

.wealth-avatar--rank-1 {
  width: 62px;
  height: 62px;
  border-color: #ffd76a;
  font-size: 16px;
  box-shadow: 0 0 0 4px rgba(255, 215, 106, 0.1), 0 7px 20px rgba(0, 0, 0, 0.36);
}

.wealth-avatar--rank-2 {
  border-color: #b9c5cd;
}

.wealth-avatar--rank-3 {
  border-color: #e68961;
}

.wealth-podium__name,
.wealth-podium__username {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wealth-podium__name {
  margin-top: 8px;
  color: #f8f9fa;
  font-size: 14px;
  font-weight: 800;
}

.wealth-podium__username {
  color: #7f8990;
  font-size: 11px;
}

.wealth-podium__base {
  display: flex;
  min-height: 112px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  border: 1px solid #4c4f51;
  border-bottom-width: 4px;
  border-radius: 7px 7px 3px 3px;
  background: #202326;
}

.wealth-podium--rank-1 .wealth-podium__base {
  min-height: 148px;
  border-color: #806626;
  border-bottom-color: #ffd76a;
  background: #262316;
}

.wealth-podium--rank-2 .wealth-podium__base {
  min-height: 124px;
  border-bottom-color: #b9c5cd;
}

.wealth-podium--rank-3 .wealth-podium__base {
  border-bottom-color: #e68961;
}

.wealth-podium__rank {
  color: #777f85;
  font-size: 24px;
  font-weight: 900;
}

.wealth-podium--rank-1 .wealth-podium__rank {
  color: #ffd76a;
  font-size: 34px;
}

.wealth-balance {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #d9dde0;
  white-space: nowrap;
}

.wealth-balance img {
  width: 25px;
  height: 25px;
}

.wealth-balance strong {
  color: #ffffff;
  font-size: 16px;
}

.wealth-balance span {
  color: #ffd76a;
  font-size: 10px;
  font-weight: 800;
}

.wealth-ranking {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.wealth-row {
  display: grid;
  min-height: 58px;
  align-items: center;
  grid-template-columns: 34px 40px minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid #353a3d;
  border-radius: 6px;
  background: #1a1d1f;
}

.wealth-row.is-current-user,
.wealth-podium.is-current-user .wealth-podium__base {
  border-color: #35d9d0;
}

.wealth-row__rank {
  color: #7e878d;
  font-size: 15px;
  font-weight: 900;
}

.wealth-row .wealth-avatar {
  width: 36px;
  height: 36px;
  font-size: 11px;
}

.wealth-row__identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.wealth-row__identity strong,
.wealth-row__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wealth-row__identity strong {
  color: #f0f2f3;
  font-size: 13px;
}

.wealth-row__identity small {
  color: #778087;
  font-size: 11px;
}

.wealth-balance--compact {
  margin-left: auto;
}

.wealth-balance--compact img {
  width: 22px;
  height: 22px;
}

.wealth-balance--compact strong {
  font-size: 14px;
}

.wealth-you-badge {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  padding: 0 6px;
  border: 1px solid #238e89;
  border-radius: 4px;
  background: #153b3a;
  color: #67eee6;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.wealth-loading,
.wealth-error,
.wealth-empty {
  display: flex;
  min-height: 344px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  color: #9ca4aa;
}

.wealth-loading img {
  width: 58px;
  height: 58px;
  animation: wealth-coin-pulse 1.2s ease-in-out infinite;
}

.wealth-error button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid #35d9d0;
  border-radius: 5px;
  background: #17312f;
  color: #6ce9e2;
  cursor: pointer;
}

.wealth-footer {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  border-top: 1px solid #2c3033;
  color: #6f787e;
  font-size: 10px;
}

.wealth-refresh {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8e979d;
  cursor: pointer;
}

.wealth-refresh:hover:not(:disabled) {
  background: #25292c;
  color: #35d9d0;
}

.wealth-refresh:disabled {
  cursor: wait;
  opacity: 0.55;
}

@keyframes wealth-coin-pulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .wealth-shell {
    padding: 22px 14px 18px;
  }

  .wealth-header__emblem {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }

  .wealth-header__emblem img {
    width: 48px;
    height: 48px;
  }

  .wealth-header h2 {
    font-size: 23px;
  }

  .wealth-podiums {
    gap: 5px;
  }

  .wealth-podium__base {
    padding: 8px 2px;
  }

  .wealth-balance {
    gap: 3px;
  }

  .wealth-balance img {
    width: 20px;
    height: 20px;
  }

  .wealth-balance strong {
    font-size: 13px;
  }
}
.quick-reaction-buttons {
  position: relative;
  display: inline-flex;
  gap: 2px;
}

.quick-reaction-buttons__btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.quick-reaction-buttons__btn:hover:not(:disabled) {
  background: var(--sp-surface-active);
  transform: scale(1.12);
}

.quick-reaction-buttons__btn:active:not(:disabled) {
  transform: scale(0.94);
}

.quick-reaction-buttons__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quick-reaction-buttons__btn--active {
  background: var(--sp-green-soft);
  border-color: var(--sp-green);
}

.reaction-burst {
  position: absolute;
  pointer-events: none;
  font-size: 20px;
  animation: reaction-burst-float 0.9s ease-out forwards;
  z-index: 2;
}

@keyframes reaction-burst-float {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -120%) scale(1.4);
  }
}
.coin-economy-modal .ant-modal-content {
  overflow: hidden;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--sp-border) 72%, #d3a73f 28%);
  border-radius: 8px;
  background: var(--sp-surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.coin-economy-modal .ant-modal-close {
  top: 18px;
  right: 18px;
  color: var(--sp-text-secondary);
}

.coin-economy__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 56px 20px 24px;
  border-bottom: 1px solid var(--sp-border);
  background:
    linear-gradient(110deg, rgba(211, 167, 63, 0.12), transparent 42%),
    var(--sp-surface);
}

.coin-economy__title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.coin-economy__title-icon {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(211, 167, 63, 0.45);
  border-radius: 8px;
  color: #d3a73f;
  background: rgba(211, 167, 63, 0.1);
  font-size: 22px;
}

.coin-economy__eyebrow,
.coin-economy__section-title span,
.coin-economy__flow-head span {
  color: var(--sp-text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.coin-economy__title h2 {
  margin: 2px 0 1px;
  color: var(--sp-text);
  font-size: 22px;
  line-height: 1.2;
}

.coin-economy__title p {
  margin: 0;
  color: var(--sp-text-secondary);
  font-size: 13px;
}

.coin-economy__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.coin-economy__controls .ant-segmented {
  background: var(--sp-surface-soft);
}

.coin-economy__content {
  box-sizing: border-box;
  display: flex;
  max-height: min(680px, calc(100vh - 150px));
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding: 22px 24px 26px;
}

.coin-economy__alert {
  margin: 16px 24px 0;
}

.coin-economy__hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.coin-economy__metric {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--sp-border);
  border-radius: 8px;
  background: var(--sp-surface-soft);
}

.coin-economy__metric-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  color: var(--sp-text-secondary);
  background: var(--sp-surface);
  font-size: 16px;
}

.coin-economy__metric > div {
  min-width: 0;
}

.coin-economy__metric-label,
.coin-economy__metric-note {
  display: block;
  overflow: hidden;
  color: var(--sp-text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coin-economy__metric strong {
  display: block;
  margin: 3px 0 1px;
  color: var(--sp-text);
  font-size: 21px;
  line-height: 1.15;
}

.coin-economy__metric strong small {
  font-size: 11px;
  font-weight: 700;
}

.coin-economy__metric--supply .coin-economy__metric-icon,
.coin-economy__metric--positive .coin-economy__metric-icon {
  color: #25b985;
  background: rgba(37, 185, 133, 0.12);
}

.coin-economy__metric--negative .coin-economy__metric-icon,
.coin-economy__metric--spent .coin-economy__metric-icon {
  color: #f05f68;
  background: rgba(240, 95, 104, 0.12);
}

.coin-economy__metric--issued .coin-economy__metric-icon,
.coin-economy__metric--wager .coin-economy__metric-icon {
  color: #d3a73f;
  background: rgba(211, 167, 63, 0.12);
}

.coin-economy__metric--payout .coin-economy__metric-icon,
.coin-economy__metric--refund .coin-economy__metric-icon {
  color: #5b9cf0;
  background: rgba(91, 156, 240, 0.12);
}

.coin-economy__flows,
.coin-economy__users {
  border-top: 1px solid var(--sp-border);
  padding-top: 18px;
}

.coin-economy__flow-head,
.coin-economy__section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.coin-economy__flow-head div,
.coin-economy__section-title div {
  display: flex;
  flex-direction: column;
}

.coin-economy__flow-head strong,
.coin-economy__section-title strong {
  color: var(--sp-text);
  font-size: 15px;
}

.coin-economy__flow-head .coin-economy__tracking,
.coin-economy__section-title > span {
  color: var(--sp-text-secondary);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
}

.coin-economy__flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.coin-economy__flow-grid .coin-economy__metric {
  padding: 11px;
}

.coin-economy__flow-grid .coin-economy__metric strong {
  font-size: 17px;
}

.coin-economy__user-list {
  overflow: hidden;
  border: 1px solid var(--sp-border);
  border-radius: 8px;
}

.coin-economy__user-row {
  display: grid;
  grid-template-columns: 30px minmax(150px, 1fr) 86px 86px 100px;
  min-height: 56px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sp-border);
}

.coin-economy__user-row:last-child {
  border-bottom: 0;
}

.coin-economy__rank {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  color: #d3a73f;
  background: rgba(211, 167, 63, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.coin-economy__identity,
.coin-economy__user-flow {
  min-width: 0;
}

.coin-economy__identity strong,
.coin-economy__identity span,
.coin-economy__user-flow span,
.coin-economy__user-flow strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coin-economy__identity strong {
  color: var(--sp-text);
  font-size: 13px;
}

.coin-economy__identity span,
.coin-economy__user-flow span {
  color: var(--sp-text-secondary);
  font-size: 10px;
}

.coin-economy__user-flow strong {
  margin-top: 2px;
  font-size: 12px;
}

.coin-economy__user-flow--in strong,
.coin-economy__net.is-positive {
  color: #25b985;
}

.coin-economy__user-flow--out strong,
.coin-economy__net.is-negative {
  color: #f05f68;
}

.coin-economy__net {
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.coin-economy__empty {
  padding: 34px 16px;
  border: 1px dashed var(--sp-border);
  border-radius: 8px;
  color: var(--sp-text-secondary);
  text-align: center;
}

@media (max-width: 1180px) {
  .coin-economy-modal {
    max-width: calc(100vw - 32px);
  }

  .coin-economy__header {
    flex-direction: column;
  }

  .coin-economy__controls {
    width: 100%;
    justify-content: space-between;
  }

  .coin-economy__flow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coin-economy__content {
    max-height: calc(100vh - 230px);
  }
}

@media (max-width: 900px) {
  .coin-economy__hero-metrics {
    grid-template-columns: 1fr;
  }

  .coin-economy__user-row {
    grid-template-columns: 30px minmax(120px, 1fr) 74px 74px;
  }

  .coin-economy__net {
    display: none;
  }
}
