:root {
  --bg-primary: #e8f4fc;
  --bg-secondary: #d4ecfa;
  --sky-50: #f8fcff;
  --sky-100: #f5f8fb;
  --sky-200: #eaf0f6;
  --sky-300: #d8e0e8;
  --sky-400: #b8c4d0;
  --sky-500: #7ec8e3;
  --sky-600: #4aade0;
  --sky-700: #094665;
  --sky-800: #1a78b5;
  --ink-900: #0e3a5c;
  --ink-800: #0b3556;
  --ink-600: #0b3556;
  --mint: #064e48;
  --gold: #4f3204;
  --danger: #7f1d36;
  --button-bg: #0e3a5c;
  --button-bg-2: #0a547c;
  --radius: 8px;
  --r: 8px;

  --text: var(--ink-900);
  --muted: var(--ink-600);
  --accent: var(--button-bg-2);
  --accent-2: var(--sky-700);
  --success: var(--mint);
  --warn: var(--gold);
  --line: rgba(43, 143, 202, 0.18);
  --panel: rgba(255, 255, 255, 0.74);
  --panel-2: rgba(255, 255, 255, 0.56);
  --soft: rgba(255, 255, 255, 0.58);
  --shadow: 0 22px 60px rgba(43, 143, 202, 0.14);
}

html {
  color-scheme: light;
}

body {
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(ellipse at 40% 18%, rgba(126, 200, 227, 0.26) 0%, transparent 48%),
    radial-gradient(ellipse at 72% 72%, rgba(74, 173, 224, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #f8fcff 0%, #e8f4fc 42%, #d4ecfa 100%);
}

body::before {
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(43, 143, 202, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 143, 202, 0.12) 1px, transparent 1px);
  mask-image: radial-gradient(circle at center, black 42%, transparent 84%);
}

section[id],
.danger-zone[id] {
  scroll-margin-top: 24px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 1 292px;
  min-width: 244px;
  color: var(--ink-900);
  text-decoration: none;
}

.site-identity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.site-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.site-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(43, 143, 202, 0.2);
  border-radius: 8px;
  background: linear-gradient(145deg, #f8fcff, #d4ecfa);
  box-shadow: 0 10px 28px rgba(43, 143, 202, 0.18);
}

.site-name {
  color: var(--ink-900);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
}

.site-slogan {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

.site-header .nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.site-header .nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.site-header .nav-links a,
.site-header .auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px !important;
  border: 1px solid rgba(14, 58, 92, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-900) !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.site-header .nav-links a:hover,
.site-header .nav-links a.active {
  border-color: rgba(14, 58, 92, 0.24);
  background: linear-gradient(135deg, rgba(232, 244, 252, 0.95), rgba(212, 236, 250, 0.86));
}

.site-header .nav-links a.active {
  box-shadow: inset 0 -2px 0 var(--button-bg-2);
}

.site-header .auth-link {
  flex: 0 0 auto;
  border-color: transparent;
  background: linear-gradient(135deg, var(--button-bg), var(--button-bg-2)) !important;
  color: #ffffff !important;
}

.site-header .auth-link:hover,
.site-header .auth-link.player,
.site-header .auth-link.active {
  border-color: transparent;
  background: linear-gradient(135deg, #0e3a5c, var(--button-bg-2)) !important;
  color: #ffffff !important;
}

a {
  color: var(--accent);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.nav,
.top,
.hero-copy,
.hero-select,
.block,
.spotlight,
.live-item,
.world,
.shared,
.testimonial-shell,
.testimonial-thumb,
.rail,
.panel,
.dock,
.challenge-panel,
.metric,
.board-row,
.detail-panel,
.challenge-row,
.shell,
.card,
.player,
.board-wrap,
.actions,
.stake,
.hero-card,
.stat-card,
.match-row,
.badge-card,
.section-shell,
.rank-card,
.tournament-card,
.leader-card,
.settings-shell,
.setting-card,
.room-card,
.visual-banner,
.watch-card {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.nav,
.top {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px !important;
  backdrop-filter: blur(18px);
}

:is(
  .nav, .top, .site-header, .ui-topbar, .ui-panel, .ui-card,
  .hero, .hero-copy, .hero-select, .block, .spotlight, .live-item,
  .world, .shared, .testimonial-shell, .testimonial-thumb,
  .panel, .dock, .challenge-panel, .metric, .board-row,
  .detail-panel, .challenge-row, .shell, .card, .player,
  .board-wrap, .actions, .stake, .hero-card, .stat-card,
  .match-row, .badge-card, .section-shell, .rank-card,
  .tournament-card, .leader-card, .settings-shell, .setting-card,
  .room-card, .visual-banner, .watch-card, .list-panel, .sidebar,
  .section, .table-section, .topbar, .map-card, .room-row,
  .other-card, .main-board-card, .side-card, .chat-box,
  .filter-group, .save-bar, .rail, .game, .game-card, .box,
  .testimonial-card, .testimonial-card-inner, .testimonial-content,
  .tourney-card, .podium-card, .hero-stat, .input-box, .row,
  .board-opt, .visual-panel, .live-panel, .watch-panel, .room-panel,
  .combo-panel, .field, .preset-chip, .filter-chip, .line-btn,
  .section-box, .aside-box, .input-shell, .danger-zone,
  .tabs-bar, .game-filter-group, .category-hero, .board-surface
) {
  border-radius: 8px !important;
}

:is(
  .nav-links a, .nav-links span, .site-menu a, .site-account,
  .pill, .wallet, .chip, .tag, .cfg, .btn, .btn-sm, .tab-btn,
  .vbtn, .tbtn, .auth-link, .account-pill, .eyebrow, .live-link,
  .row-btn, .mode-pill, .live-badge, .play, .play-btn,
  .primary-btn, .secondary-btn, .ghost-btn, .abtn, .cta,
  .save-btn, .seg-btn, .filter-btn, .game-btn, .board-link,
  .jump-link, .mini-chip, .carousel-arrow, .input, .select,
  input, select, textarea
) {
  border-radius: 8px !important;
}

:is(.brand-mark, .mark, .site-logo, .ui-logo, .avatar, .ava, .mini-avatar, .mini-ava, .podium-avatar, .brand-avatar, .game-icon) {
  border-radius: 8px !important;
}

.hero,
.list-panel,
.sidebar,
.section,
.table-section,
.topbar,
.map-card,
.room-row,
.other-card,
.main-board-card,
.side-card,
.chat-box,
.filter-group,
.save-bar,
.rail,
.game,
.game-card,
.box,
.testimonial-card,
.testimonial-card-inner,
.testimonial-content,
.tourney-card,
.podium-card,
.hero-stat,
.input-box,
.row,
.board-opt,
.visual-panel,
.live-panel,
.watch-panel,
.room-panel {
  border-color: var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(232, 244, 252, 0.72)),
    radial-gradient(circle at top right, rgba(126, 200, 227, 0.16), transparent 38%);
  color: var(--ink-900);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-select,
.block,
.panel,
.dock,
.challenge-panel,
.detail-panel,
.shell,
.hero-card,
.section-shell {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(232, 244, 252, 0.78)),
    radial-gradient(circle at top right, rgba(126, 200, 227, 0.2), transparent 36%);
}

.card,
.stat-card,
.metric,
.board-row,
.challenge-row,
.rank-card,
.match-row,
.badge-card,
.settings-shell,
.setting-card,
.live-item,
.world,
.shared,
.testimonial-shell,
.testimonial-thumb,
.room-card,
.watch-card,
.live-list,
.board-list,
.match-list,
.tourney-grid,
.ranking-grid,
.podium,
.lb-table tbody tr {
  background: rgba(255, 255, 255, 0.58);
}

.brand-mark,
.mark {
  width: 44px !important;
  height: 44px !important;
  flex: 0 0 44px;
  border-radius: 8px !important;
  background:
    url("../../logos/chessvn-net-logo.svg") center / 76% 76% no-repeat,
    linear-gradient(145deg, #f8fcff, #d4ecfa);
  border: 1px solid rgba(43, 143, 202, 0.2);
  box-shadow: 0 10px 28px rgba(43, 143, 202, 0.18);
}

.brand,
.ui-brand {
  align-items: center;
}

.brand-name,
.brand h1,
.ui-brand h1 {
  color: var(--ink-900) !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

.brand-name span,
.brand h1 span,
.ui-brand h1 span {
  color: var(--ink-900) !important;
}

.brand-name span,
.brand h1 span,
.value.accent,
.elo,
.section-title,
.palette-group-title {
  color: var(--accent);
}

.brand-copy,
.nav-copy,
.sub,
.hint,
.muted,
.world p,
.shared p,
.rail p,
.section-copy,
.board-meta,
.dock-meta,
.challenge-meta,
.copy p,
.small,
.chat-meta,
.row span,
.note,
.label,
.section-label,
.rank-meta,
.brand p,
.subtitle,
.desc,
.lead,
.hero-meta,
.game-meta,
.mini-label,
.board-lbl,
.podium-meta,
.filter-label,
.tourney-card .meta,
.tourney-card .chip,
.table-section th,
.lb-table th,
.nav-item,
.row-info .hint {
  color: var(--muted);
}

:is(.hero, .list-panel, .sidebar, .section, .table-section, .tourney-card, .podium-card, .game-card, .game, .box, .testimonial-card, .testimonial-card-inner) :is(h1, h2, h3, h4, strong, .board-title, .podium-name, .podium-elo, .val, .value, .count, .game-name, .live-mode, .rank-name, .player-name, .elo-col, .rank-col) {
  color: var(--ink-900);
}

:is(.hero, .list-panel, .sidebar, .section, .table-section, .tourney-card, .podium-card, .game-card, .game, .box, .testimonial-card, .testimonial-card-inner) :is(p, small, .meta, .desc, .lbl, .label, .hint, .game-meta, .board-meta, .podium-meta, .filter-label, .mini-label, .section-copy, .muted, .testimonial-role-line, .testimonial-meta, .testimonial-quote-large, .chat-bubble) {
  color: var(--muted);
}

.nav-links a,
.nav-links span,
.pill,
.wallet,
.chip,
.tag,
.cfg,
.btn,
.tab-btn,
.vbtn,
.tbtn,
.auth-link,
.account-pill,
.eyebrow,
.live-link {
  border-color: rgba(43, 143, 202, 0.16);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-800);
}

.nav-links a,
.nav-links span {
  min-height: 38px;
  align-items: center;
  padding: 9px 13px !important;
  color: var(--ink-900) !important;
  font-size: 14px !important;
  font-weight: 850 !important;
  line-height: 1.2;
}

.nav-links a.active,
.nav-links .active,
.pill,
.tag.accent,
.eyebrow,
.cfg.time {
  border-color: rgba(43, 143, 202, 0.28);
  background: rgba(43, 143, 202, 0.1);
  color: var(--ink-900);
}

.auth-link,
.account-pill,
.btn.primary,
.btn-sm.primary,
.abtn.primary,
.cta.primary,
.save-btn.primary,
.row-btn,
.mode-pill,
.live-badge,
.play,
.play-btn,
.primary-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--button-bg), var(--button-bg-2)) !important;
  color: #ffffff !important;
}

.wallet,
.tag.gold,
.cfg.econ,
.value.gold {
  border-color: rgba(183, 121, 31, 0.24);
  background: rgba(183, 121, 31, 0.1);
  color: #8a560e;
}

.tag.mint,
.value.mint,
.clock.live,
.trend.positive,
.trend.up,
.wr-col.high {
  border-color: rgba(13, 148, 136, 0.2);
  background: rgba(13, 148, 136, 0.08);
  color: #0f766e;
}

.trend.down,
.trend.negative,
.rank-card .trend.negative,
.danger-btn,
.abtn.warn {
  border-color: rgba(164, 59, 78, 0.22);
  background: rgba(164, 59, 78, 0.08);
  color: var(--danger) !important;
}

.trend.up,
.trend.positive,
.rank-card .trend.positive,
.wr-col.high,
.lb-table .wr-col.high {
  border-color: rgba(13, 148, 136, 0.2);
  background: rgba(13, 148, 136, 0.08);
  color: var(--mint) !important;
}

.cta.gold-cta,
.tourney-card .chip.gold,
.podium-card.first .podium-badge {
  border-color: rgba(138, 86, 14, 0.22);
  background: rgba(138, 86, 14, 0.09);
  color: var(--gold);
}

.tourney-card .chip.accent,
.podium-card.second .podium-badge,
.podium-card.third .podium-badge {
  border-color: rgba(18, 109, 160, 0.2);
  background: rgba(18, 109, 160, 0.08);
  color: var(--accent);
}

.tourney-card .cta:not(.primary):not(.gold-cta),
.abtn,
.mini-chip,
.btn-sm.ghost,
.save-btn.ghost {
  border-color: rgba(18, 109, 160, 0.18);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-800);
}

.tourney-card .cta.primary,
.settings-shell .btn-sm.primary,
.btn-sm.primary,
.save-btn.primary,
.abtn.primary {
  background: linear-gradient(135deg, var(--button-bg), var(--button-bg-2)) !important;
  color: #ffffff !important;
}

.cta.gold-cta {
  background: linear-gradient(135deg, #8a560e, #a76a12);
  color: #ffffff !important;
}

.tab-btn.active,
.vbtn.active,
.tbtn.active,
.filter-btn.active,
.nav-item.active,
.game.active,
.live-item.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--button-bg), var(--button-bg-2));
  color: #ffffff;
}

.game.active :is(.game-name, .count, .muted),
.live-item.active :is(.live-mode, .muted, span, div, p),
.filter-btn.active,
.nav-item.active {
  color: #ffffff;
}

.live-item:not(.active) :is(.live-mode, h3, span),
.box :is(strong, b, span, h4),
.testimonial-content :is(.testimonial-title, h3, strong),
.visual-banner :is(.vb-title, h2, strong),
.other-card :is(h4, strong),
.chat-item :is(strong, span) {
  color: var(--ink-900) !important;
}

.live-item:not(.active) :is(p, .muted),
.testimonial-content :is(.testimonial-meta, .testimonial-role-line, .testimonial-quote-large),
.visual-banner :is(.vb-meta, .sub, .board-note),
.other-card :is(.other-copy, .sub, .board-note),
.chat-item :is(.chat-text) {
  color: var(--muted) !important;
}

.game:not(.active),
.game-card:not(.active),
.live-item:not(.active),
.filter-btn:not(.active),
.nav-item:not(.active) {
  color: var(--ink-800);
}

.filter-btn:hover:not(.active),
.nav-item:hover:not(.active) {
  background: rgba(18, 109, 160, 0.08);
  color: var(--ink-900);
}

.board-wrap {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(212, 236, 250, 0.45)),
    radial-gradient(circle at center, rgba(126, 200, 227, 0.2), transparent 52%);
}

.clock {
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-900);
}

.stake strong,
.card h3,
.player-main h3,
.section-shell h3,
.copy h2,
.hero-info h2,
.brand h1,
.brand-name,
.tourney-card h3,
.table-section h3,
.section h2,
.sidebar h3,
.podium-name,
.board-title,
.hero h2 {
  color: var(--ink-900);
}

.podium-card.first,
.podium-card.second,
.podium-card.third {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(232, 244, 252, 0.72)),
    radial-gradient(circle at 50% 0%, rgba(18, 109, 160, 0.12), transparent 58%);
}

.podium-card.first {
  border-color: rgba(138, 86, 14, 0.24);
}

.podium-card.second,
.podium-card.third {
  border-color: rgba(18, 109, 160, 0.18);
}

.podium-card.first .podium-elo,
.podium-card.first .podium-rank {
  color: var(--gold);
  text-shadow: none;
}

.podium-card.second .podium-elo,
.podium-card.third .podium-elo {
  color: var(--ink-900);
}

.podium-avatar {
  background: linear-gradient(135deg, rgba(18, 109, 160, 0.16), rgba(126, 200, 227, 0.2));
  border-color: rgba(18, 109, 160, 0.22);
  color: var(--ink-900);
}

.progress {
  background: rgba(14, 58, 92, 0.1);
}

.progress-fill {
  background: linear-gradient(90deg, var(--button-bg), var(--button-bg-2));
}

.chat-bubble,
.input,
.select,
input,
select,
textarea {
  border-color: rgba(18, 109, 160, 0.16);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink-900);
}

.seg-btn.active,
.board-link,
.jump-link {
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--button-bg), var(--button-bg-2)) !important;
  color: #ffffff !important;
}

.visual-banner,
.visual-banner.chess,
.visual-banner.xiangqi,
.visual-banner.up,
.visual-banner.caro {
  border-color: rgba(18, 109, 160, 0.18) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(212, 236, 250, 0.72)),
    radial-gradient(circle at 18% 16%, rgba(126, 200, 227, 0.24), transparent 42%) !important;
  color: var(--ink-900) !important;
}

.visual-banner::before {
  opacity: 0.18;
}

.vb-meta,
.chip-row .chip,
.rank,
.piece-hidden {
  border-color: rgba(18, 109, 160, 0.16) !important;
  background: rgba(255, 255, 255, 0.68) !important;
  color: var(--ink-900) !important;
}

.rank {
  box-shadow: 0 10px 24px rgba(18, 109, 160, 0.12);
}

.ava.alt,
.take,
.item strong,
.row strong,
.mini-chip,
.mini-chip.active {
  color: var(--ink-900) !important;
}

.mini-chip.active {
  border-color: rgba(18, 109, 160, 0.28);
  background: rgba(18, 109, 160, 0.1);
}

.segmented-control,
.filter-group,
.game-filter-group,
.tabs-bar {
  border-color: rgba(18, 109, 160, 0.16) !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

.seg-btn:not(.active),
.filter-btn:not(.active),
.game-btn:not(.active),
.tab-btn:not(.active),
.btn-sm.ghost,
.save-btn.ghost {
  color: var(--ink-900) !important;
}

.hero-label,
.hero-meta,
.game-meta,
.section-copy,
.mini-label,
.dock-meta,
.section-label,
.subtitle,
.desc,
.lead,
.label,
.hint,
.board-lbl,
.filter-label,
.game-filter-label,
.podium-meta,
.board-note,
.input-note,
.chat-text,
.testimonial-meta,
.testimonial-role-line,
.testimonial-quote-large,
.brand-copy,
.brand p {
  color: var(--ink-800) !important;
}

.value.accent,
.val.accent,
.elo.up,
.elo-col,
.me-indicator,
.podium-badge,
.rank-col,
.filter-btn[style*="var(--accent)"] {
  color: var(--ink-900) !important;
}

.tag.mint,
.trend.up,
.trend.positive,
.wr-col.high {
  color: var(--mint) !important;
}

.tag.gold,
.value.gold,
.val.gold,
.podium-card.first .podium-elo,
.podium-card.first .podium-rank {
  color: var(--gold) !important;
}

.carousel-arrow,
body[data-screen="gameplay"] .clock.live {
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--button-bg), var(--button-bg-2)) !important;
  color: #ffffff !important;
}

.cfg.econ {
  color: var(--gold) !important;
}

body[data-screen="watch"] [style*="color:var(--accent)"],
body[data-screen="watch-chess"] [style*="color:var(--accent)"],
body[data-screen="watch"] [style*="color: var(--accent)"],
body[data-screen="watch-chess"] [style*="color: var(--accent)"] {
  color: var(--ink-900) !important;
}

body[data-screen="home"] .stage,
body[data-screen="watch"] .section-box,
body[data-screen="watch"] .aside-box,
body[data-screen="watch"] .input-shell,
body[data-screen="watch-chess"] .section-box,
body[data-screen="watch-chess"] .aside-box,
body[data-screen="watch-chess"] .input-shell,
body[data-screen="watch-chess"] .chat-col {
  border-color: rgba(18, 109, 160, 0.16) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(232, 244, 252, 0.76)),
    radial-gradient(circle at top right, rgba(126, 200, 227, 0.18), transparent 42%) !important;
  color: var(--ink-900) !important;
  box-shadow: var(--shadow);
}

body[data-screen="home"] .stage .caption,
body[data-screen="home"] .stage .caption *,
body[data-screen="gameplay"] .meta-line strong,
body[data-screen="watch"] .side-card :is(strong, h3, h4, .main-title),
body[data-screen="watch"] .main-board-card :is(strong, h3, h4, .main-title),
body[data-screen="watch"] .section-box :is(strong, h3, h4),
body[data-screen="watch-chess"] .side-card :is(strong, h3, h4, .main-title),
body[data-screen="watch-chess"] .main-board-card :is(strong, h3, h4, .main-title),
body[data-screen="watch-chess"] .section-box :is(strong, h3, h4),
body[data-screen="watch-chess"] .chat-col :is(span, strong, div) {
  color: var(--ink-900) !important;
}

body[data-screen="tournaments"] .hero .eyebrow {
  border-color: rgba(18, 109, 160, 0.24) !important;
  background: rgba(18, 109, 160, 0.1) !important;
  color: var(--ink-900) !important;
}

body[data-screen="tournaments"] .tourney-card .badge.live {
  background: #9f1239 !important;
  color: #ffffff !important;
}

body[data-screen="tournaments"] .tourney-card .badge.upcoming,
body[data-screen="profile"] .match-row .result.win,
body[data-screen="profile"] .match-row .result.loss,
body[data-screen="profile"] .match-row .result.draw {
  border-color: transparent !important;
  color: #ffffff !important;
}

body[data-screen="tournaments"] .tourney-card .badge.upcoming,
body[data-screen="profile"] .match-row .result.draw {
  background: linear-gradient(135deg, var(--button-bg), var(--button-bg-2)) !important;
}

body[data-screen="profile"] .match-row .result.win {
  background: #064e48 !important;
}

body[data-screen="profile"] .match-row .result.loss {
  background: #7f1d36 !important;
}

body[data-screen="tournaments"] .tourney-card .badge.live::before {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

body[data-screen="watch-chess"] .chat-col > div,
body[data-screen="watch-chess"] .chat-col input {
  border-color: rgba(18, 109, 160, 0.16) !important;
  background: rgba(255, 255, 255, 0.66) !important;
  color: var(--ink-900) !important;
}

body[data-screen="watch-chess"] .chat-col input::placeholder {
  color: var(--muted);
}

body[data-screen="watch"] [style*="#f59e0b"],
body[data-screen="watch-chess"] [style*="#f59e0b"],
body[data-screen="watch"] [style*="#d97706"],
body[data-screen="watch-chess"] [style*="#d97706"] {
  background: linear-gradient(135deg, #6b4608, #8a560e) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(138, 86, 14, 0.18) !important;
}

body[data-screen="watch"] [style*="#9ca3af"],
body[data-screen="watch-chess"] [style*="#9ca3af"],
body[data-screen="watch"] [style*="#6b7280"],
body[data-screen="watch-chess"] [style*="#6b7280"],
body[data-screen="watch"] [style*="#b45309"],
body[data-screen="watch-chess"] [style*="#b45309"],
body[data-screen="watch"] [style*="#78350f"],
body[data-screen="watch-chess"] [style*="#78350f"],
body[data-screen="watch"] [style*="color: #ccc"],
body[data-screen="watch-chess"] [style*="color: #ccc"],
body[data-screen="watch"] [style*="rgba(0,0,0,0.6)"],
body[data-screen="watch-chess"] [style*="rgba(0,0,0,0.6)"],
body[data-screen="watch"] [style*="rgba(0,0,0,0.45)"],
body[data-screen="watch-chess"] [style*="rgba(0,0,0,0.45)"] {
  background: linear-gradient(135deg, #164f73, #0e3a5c) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

body[data-screen="watch"] [style*="rgba(243,191,105,0.2)"],
body[data-screen="watch-chess"] [style*="rgba(243,191,105,0.2)"],
body[data-screen="watch"] [style*="#ffe8c2"],
body[data-screen="watch-chess"] [style*="#ffe8c2"] {
  background: rgba(138, 86, 14, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

:is(
  .ui-count, .ui-status, .complete-source-ribbon,
  .visual, .visual img, .action, .stage, .frame, .chat-bubble, .live-mode,
  .combo-action, .segmented, .segmented span, .segmented button,
  .segmented-control, .segmented-control span, .segmented-control button,
  .vb-meta, .signal, .category-hero, .board, .board-surface, .board-mini,
  .chat-col, .clock, .item, .tabs-bar, .result, .game-filter-group,
  .podium-badge, .me-indicator, .nav-item, .avatar-big, .rank,
  .hero-media, .hero-image, .media-frame, .preview-frame, .search-box,
  .input-wrap, .field-wrap, .toggle, .toggle-track, .dropdown, .menu-panel,
  .state-panel, .state-list, .token-card, .token, .swatch, .sample-card,
  .testimonial-pagination button, .world-visual img,
  .visual-banner > div, .vb-hover-cta, .guess-module, .toggles,
  [class*="card"], [class*="panel"], [class*="shell"], [class*="box"],
  [class*="badge"], [class*="pill"], [class*="chip"], [class*="button"],
  [class*="btn"], [class*="tab"], [class*="bar"], [class*="hero"],
  [class*="stage"], [class*="frame"], [class*="visual"], [class*="surface"],
  [class*="row"], [class*="item"], [class*="avatar"], [class*="clock"],
  [class*="input"], [class*="filter"], [class*="leader"], [class*="rank"],
  [class*="ribbon"], [class*="menu"], [class*="account"]
):not(.piece):not(.disc):not(.dot):not(.sparkle):not(.x-mark):not(.o-mark) {
  border-radius: 8px !important;
}

body[data-screen="watch"] :is(.main-board-card, .side-card) > div:first-child,
body[data-screen="watch-chess"] main article,
body[data-screen="watch-chess"] main article > div:first-child {
  border-radius: 8px !important;
}

.has-demo-ribbon {
  position: relative;
  overflow: hidden;
}

.demo-ribbon {
  position: absolute;
  top: 18px;
  right: -48px;
  z-index: 4;
  width: 190px;
  padding: 7px 12px;
  transform: rotate(35deg);
  background: linear-gradient(135deg, #0e3a5c, #0a547c);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 12px 28px rgba(14, 58, 92, 0.22);
}

@keyframes liveBadgePulse {
  0%,
  100% {
    opacity: 0.68;
    transform: scale(0.86);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.28);
  }

  50% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
  }
}

body[data-screen="play"] .game-card.active {
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--button-bg), var(--button-bg-2)) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px rgba(14, 58, 92, 0.22);
}

body[data-screen="play"] .game-card.active :is(strong, .game-meta, .dot) {
  color: #ffffff !important;
}

body[data-screen="play"] .game-card.active strong {
  font-size: 16px !important;
  font-weight: 900 !important;
}

body[data-screen="play"] .game-card.active .game-meta {
  font-weight: 750 !important;
}

body[data-screen="play"] .game-card.active .game-icon {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

body[data-screen="tournaments"] .game-type-filter .game-filter-label {
  color: var(--ink-900) !important;
  font-size: 14px !important;
  font-weight: 850 !important;
}

body[data-screen="tournaments"] .game-type-filter .game-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 11px 15px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

body[data-screen="tournaments"] .tourney-card .badge.live {
  border-color: rgba(34, 197, 94, 0.3) !important;
  background: linear-gradient(135deg, #047857, #16a34a) !important;
  color: #ffffff !important;
}

body[data-screen="tournaments"] .tourney-card .badge.live::before {
  background: #86efac !important;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.28) !important;
  animation: liveBadgePulse 2.6s ease-in-out infinite;
}

@media (max-width: 1180px) {
  .site-header {
    align-items: flex-start;
  }

  .site-header .nav-actions {
    justify-content: flex-end;
  }

  body[data-screen="watch"] .live-map,
  body[data-screen="watch-chess"] main#rooms {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-screen="watch"] .room-row {
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.4fr) !important;
  }

  body[data-screen="watch"] .right-col {
    grid-column: 1 / -1;
  }

  body[data-screen="watch-chess"] .main-layout {
    flex-direction: column;
  }

  body[data-screen="watch-chess"] .chat-col {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .page {
    width: min(100% - 24px, 1180px);
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .site-brand {
    width: 100%;
  }

  .site-header .nav-actions,
  .site-header .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  .site-header .auth-link {
    width: 100%;
  }

  body[data-screen="watch"] .live-map,
  body[data-screen="watch"] .room-row,
  body[data-screen="watch-chess"] main#rooms,
  body[data-screen="tournaments"] .tourney-grid,
  body[data-screen="leaderboard"] .podium {
    grid-template-columns: 1fr !important;
  }

  body[data-screen="watch"] .room-tools,
  body[data-screen="leaderboard"] .filter-bar,
  body[data-screen="tournaments"] .game-filter {
    align-items: stretch !important;
  }

  body[data-screen="leaderboard"] .filter-group,
  body[data-screen="tournaments"] .game-filter-group {
    width: 100%;
    overflow-x: auto;
  }

  body[data-screen="leaderboard"] .table-section {
    overflow-x: auto;
  }

  body[data-screen="leaderboard"] .lb-table {
    min-width: 720px;
  }

  body[data-screen="watch-chess"] .category-hero {
    flex-direction: column;
    align-items: flex-start !important;
    padding: 28px 20px !important;
  }
}

@media (max-width: 560px) {
  .site-header .nav-links a {
    flex: 1 1 calc(50% - 8px);
  }

  .site-name {
    font-size: 18px;
  }

  .site-slogan {
    font-size: 11px;
  }

  .demo-ribbon {
    right: -56px;
    width: 184px;
    font-size: 10px;
  }

  body[data-screen="play"] .game-card,
  body[data-screen="watch"] .visual-banner {
    min-width: 0;
  }
}

.complete-source-ribbon {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(43, 143, 202, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(43, 143, 202, 0.14);
  backdrop-filter: blur(14px);
}

.complete-source-ribbon a {
  color: var(--ink-900);
  text-decoration: none;
}

@media (max-width: 720px) {
  .complete-source-ribbon {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}
