:root {
  --void: #0a0610;
  --bg: #120b1a;
  --panel: #1a1228;
  --panel2: #241a36;
  --bevel-light: #c4a574;
  --bevel-mid: #7a5c3a;
  --bevel-dark: #3d2a1a;
  --gold: #f0c040;
  --gold-glow: rgba(240, 192, 64, 0.35);
  --text: #e8dcc4;
  --muted: #9a8a78;
  --hp-red: #c44c4c;
  --mp-blue: #5c8cbc;
  --ok: #6bc96b;
  --pixel: "Press Start 2P", monospace;
  --mono: "VT323", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1.35;
  background: var(--void);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Starfield-ish grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(92, 60, 140, 0.35), transparent 55%),
    repeating-linear-gradient(90deg, transparent, transparent 31px, rgba(255,255,255,.03) 31px, rgba(255,255,255,.03) 32px),
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(255,255,255,.025) 31px, rgba(255,255,255,.025) 32px),
    linear-gradient(180deg, var(--bg) 0%, var(--void) 100%);
}

/* CRT scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.22;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.45) 2px,
    rgba(0, 0, 0, 0.45) 4px
  );
}

a {
  color: var(--gold);
  text-decoration: none;
  text-shadow: 0 0 8px var(--gold-glow);
}
a:hover { color: #fff5c8; text-decoration: underline; text-underline-offset: 4px; }

/* Asset game: /icon/{icon_id}.png */
.asset-ico {
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 3px solid var(--bevel-dark);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.08);
  flex-shrink: 0;
  background: var(--void);
}
.asset-ico--rail { width: 34px; height: 34px; }
.asset-ico--strip { width: 72px; height: 72px; }
.asset-ico--panel { width: 56px; height: 56px; }
.asset-ico--hero { width: 52px; height: 52px; }
.asset-ico--label { width: 28px; height: 28px; }
.asset-ico--bento { width: 56px; height: 56px; }
.asset-ico--thread { width: 44px; height: 44px; }
.asset-ico--side { width: 40px; height: 40px; }
.asset-ico--nav { width: 32px; height: 32px; }
.asset-ico--ft { width: 36px; height: 36px; }

.asset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.rail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rail-brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.rail-brand-block:hover .rail-brand {
  filter: brightness(1.08);
}

.asset-ico--site-logo {
  width: 44px !important;
  height: 44px !important;
  flex-shrink: 0;
  image-rendering: pixelated;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(240, 192, 64, 0.25);
}

.rail-mascots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.strip-banner {
  max-width: 1100px;
  margin: 0 auto 20px;
  padding: 10px 14px;
  text-align: center;
  background: rgba(0,0,0,.35);
}
.strip-banner figcaption {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 8px;
}

.hero-visual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
}
.hero-visual-label {
  font-family: var(--pixel);
  font-size: 0.38rem;
  line-height: 1.45;
  color: var(--mp-blue);
  max-width: 200px;
  text-shadow: 1px 1px 0 #000;
}

.panel-strip {
  margin: -4px -4px 14px -4px;
  padding: 8px;
  background: var(--void);
  border-bottom: 3px solid var(--bevel-dark);
  text-align: center;
}
.section-label .asset-ico {
  margin-right: 0;
}

.side-mascot-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px dashed rgba(196, 165, 116, 0.2);
}

.thread-pin .thread-ico .asset-ico {
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
}

.bento-card .asset-ico {
  margin-bottom: 12px;
}

/* Pixel frame helper */
.frame {
  background: var(--panel);
  border: 4px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow:
    0 6px 0 rgba(0,0,0,.45),
    inset 0 0 0 2px rgba(0,0,0,.35);
}

/* —— Top bar —— */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--panel2);
  border-bottom: 4px solid var(--bevel-dark);
  box-shadow: 0 4px 0 var(--bevel-light);
}
.rail-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.rail-brand {
  font-family: var(--pixel);
  font-size: 0.55rem;
  line-height: 1.6;
  color: var(--gold);
  text-shadow: 2px 2px 0 #000, 0 0 12px var(--gold-glow);
  letter-spacing: 0.02em;
}
.rail-brand em {
  font-style: normal;
  color: var(--ok);
  text-shadow: 2px 2px 0 #000, 0 0 10px rgba(107, 201, 107, 0.4);
}
.rail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}
.rail-nav a {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--muted);
  text-shadow: none;
  text-decoration: none;
}
.rail-nav a:hover { color: var(--gold); text-decoration: none; }
.rail-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: var(--pixel);
  font-size: 0.45rem;
  line-height: 1.4;
  background: var(--hp-red);
  color: #fff !important;
  border: 3px solid;
  border-color: #ff8a8a #5a2020 #5a2020 #ff8a8a;
  box-shadow: 0 4px 0 rgba(0,0,0,.4);
  text-decoration: none !important;
  text-shadow: 1px 1px 0 #000;
}
.rail-cta:hover {
  filter: brightness(1.12);
  color: #fff !important;
  text-decoration: none !important;
}

/* —— Hero —— */
.hero {
  position: relative;
  z-index: 1;
  margin-top: 64px;
  padding: clamp(24px, 5vw, 48px) 18px clamp(32px, 5vw, 52px);
}
.hero-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: stretch;
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero-tag {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 0.42rem;
  line-height: 1.5;
  color: var(--panel2);
  background: var(--gold);
  padding: 8px 12px;
  border: 3px solid;
  border-color: #fff6c8 #8a7020 #8a7020 #fff6c8;
  box-shadow: 0 4px 0 rgba(0,0,0,.35);
  margin-bottom: 18px;
}
.hero h1.hero-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: none;
  margin: 0;
}

.asset-ico--hero-logo {
  width: clamp(52px, 10vw, 72px) !important;
  height: clamp(52px, 10vw, 72px) !important;
  flex-shrink: 0;
  image-rendering: pixelated;
  border-radius: 6px;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.4),
    0 4px 16px rgba(240, 192, 64, 0.2);
}

.hero h1 .hero-title-text {
  font-family: var(--mono);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 0.95;
  color: var(--text);
  text-shadow: 3px 3px 0 #000, 0 0 24px rgba(240, 192, 64, 0.2);
  max-width: 14ch;
}

.hero h1 .hero-title-text span {
  display: block;
  margin-top: 0.2em;
  font-size: 0.42em;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-lede {
  max-width: 42ch;
  color: var(--muted);
  margin-top: 18px;
  font-size: 1.15rem;
}
.hero-lede a { font-weight: 600; }
.hero-panel {
  padding: clamp(18px, 3vw, 26px);
  position: relative;
}
.hero-panel::before {
  content: "▶";
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 1rem;
  color: var(--gold);
  opacity: 0.5;
  animation: blink 1.2s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}
.hero-panel-title {
  font-family: var(--pixel);
  font-size: 0.42rem;
  line-height: 1.5;
  color: var(--mp-blue);
  margin-bottom: 12px;
  text-shadow: 1px 1px 0 #000;
}
.hero-panel-body {
  color: var(--text);
  margin-bottom: 18px;
  font-size: 1.05rem;
}
.hero-panel-body code {
  display: inline;
  background: var(--void);
  padding: 2px 8px;
  border: 2px solid var(--bevel-dark);
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ok);
}
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-box {
  padding: 14px;
  background: var(--void);
  border: 3px solid;
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
}
.stat-box strong {
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--gold);
  display: block;
  line-height: 1;
  text-shadow: 2px 2px 0 #000;
}
.stat-box span {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 6px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}
.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  background: var(--ok);
  color: #0a160a !important;
  border: 4px solid;
  border-color: #a8f0a8 #1a4a1a #1a4a1a #a8f0a8;
  box-shadow: 0 5px 0 rgba(0,0,0,.4);
  text-decoration: none !important;
  text-shadow: none;
}
.btn-solid:hover {
  filter: brightness(1.08);
  color: #0a160a !important;
  text-decoration: none !important;
}
.btn-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: 1.15rem;
  background: transparent;
  color: var(--text) !important;
  border: 4px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow: 0 5px 0 rgba(0,0,0,.35);
  text-decoration: none !important;
  text-shadow: none;
}
.btn-line:hover {
  background: var(--panel2);
  color: var(--gold) !important;
  text-decoration: none !important;
}

/* —— Bento —— */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px 72px;
}
.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pixel);
  font-size: 0.48rem;
  line-height: 1.5;
  color: var(--gold);
  margin-bottom: 14px;
  text-shadow: 2px 2px 0 #000;
  padding-left: 4px;
}
.section-label .dim {
  color: var(--hp-red);
  margin-right: 4px;
}
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-bottom: 40px;
}
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .bento { grid-template-columns: 1fr; }
}
.bento-card {
  grid-column: span 4;
  background: var(--panel);
  border: 4px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow: 0 6px 0 rgba(0,0,0,.4), inset 0 0 0 2px rgba(0,0,0,.25);
  padding: 18px 16px;
  transition: transform 0.15s ease, filter 0.15s ease;
}
@media (max-width: 900px) {
  .bento-card { grid-column: span 1; }
}
.bento-card:nth-child(1) { grid-column: span 5; }
.bento-card:nth-child(2) { grid-column: span 4; }
.bento-card:nth-child(3) { grid-column: span 3; }
@media (max-width: 900px) {
  .bento-card:nth-child(1),
  .bento-card:nth-child(2),
  .bento-card:nth-child(3) { grid-column: span 1; }
}
@media (max-width: 520px) {
  .bento-card:nth-child(1),
  .bento-card:nth-child(2),
  .bento-card:nth-child(3) { grid-column: span 1; }
}
.bento-card:hover {
  transform: translateY(-4px);
  filter: brightness(1.06);
}
.bento-card h3 {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.bento-card p {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.4;
}

/* —— Trang tải game: ba cột đều —— */
.tai-game-bento .bento-card:nth-child(1),
.tai-game-bento .bento-card:nth-child(2),
.tai-game-bento .bento-card:nth-child(3) {
  grid-column: span 4;
}
@media (max-width: 900px) {
  .tai-game-bento .bento-card:nth-child(n) { grid-column: span 1; }
}
.tai-game-bento .bento-card.is-muted {
  opacity: 0.88;
}
.tai-game-bento .bento-card.is-muted:hover {
  transform: none;
  filter: none;
}
.tai-dl-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
  border: 3px solid;
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  background: var(--void);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  cursor: not-allowed;
  user-select: none;
}
.tai-version-note {
  margin-top: 28px;
  padding: 16px 18px;
  border: 3px dashed var(--bevel-mid);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 1rem;
  max-width: 72ch;
  line-height: 1.45;
}
.tai-version-note strong { color: var(--gold); }

/* —— Threads —— */
.stream-wrap {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 960px) {
  .stream-wrap { grid-template-columns: 1fr; }
}
.stream {
  border: 4px solid;
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  background: rgba(0,0,0,.25);
  padding: 4px 16px 8px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.3);
}
.thread {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px 16px;
  padding: 18px 0;
  border-bottom: 2px dashed rgba(196, 165, 116, 0.25);
  align-items: start;
}
.thread:last-child { border-bottom: none; }
@media (max-width: 560px) {
  .thread { grid-template-columns: 1fr; gap: 8px; }
}
.thread-ico {
  display: flex;
  align-items: flex-start;
  margin-top: 2px;
}
.thread h4 {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.thread-meta {
  font-size: 1.05rem;
  color: var(--muted);
}
.thread-badge {
  font-family: var(--pixel);
  font-size: 0.35rem;
  line-height: 1.4;
  color: var(--void);
  background: var(--gold);
  padding: 8px 10px;
  border: 2px solid #000;
  white-space: nowrap;
  align-self: start;
  box-shadow: 2px 2px 0 #000;
}

.side-stack {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 960px) {
  .side-stack { position: static; flex-direction: row; flex-wrap: wrap; }
  .side-stack > * { flex: 1 1 240px; }
}
.side-card {
  background: var(--panel2);
  border: 4px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow: 0 6px 0 rgba(0,0,0,.4);
  padding: 16px;
}
.side-card h3 {
  font-family: var(--pixel);
  font-size: 0.4rem;
  line-height: 1.5;
  color: var(--gold);
  margin-bottom: 10px;
  text-shadow: 1px 1px 0 #000;
}
.side-card a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 2px dashed rgba(196, 165, 116, 0.2);
  color: var(--text) !important;
  font-size: 1.1rem;
  text-decoration: none !important;
  text-shadow: none;
}
.side-card a:last-child { border-bottom: none; }
.side-card a:hover { color: var(--gold) !important; }

.note {
  background: var(--void);
  border: 3px dashed var(--bevel-mid);
  padding: 14px;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.4;
}
.note code {
  color: var(--ok);
  font-family: var(--mono);
}

.site-ft {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 18px 36px;
  border-top: 4px solid var(--bevel-dark);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  font-size: 1rem;
  color: var(--muted);
}
.site-ft a {
  color: var(--gold);
}
.site-ft-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  width: 100%;
  justify-content: space-between;
}
.site-ft-mascots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.site-ft-mascots .asset-ico--ft {
  border-color: var(--bevel-mid);
}

/* —— Modal đăng ký —— */
.reg-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.78);
}
.reg-modal.is-open {
  display: flex;
}
.reg-modal-box {
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--panel2);
  border: 4px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.55);
  padding: 22px 18px 20px;
  position: relative;
  font-family: var(--mono);
  font-size: 1.1rem;
}
.reg-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 3px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--void);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reg-modal-close:hover {
  color: var(--gold);
}
.reg-modal-title {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gold);
  text-align: center;
  margin-bottom: 18px;
  padding-right: 36px;
  padding-left: 36px;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 0.02em;
}
.reg-modal-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
  color: var(--muted);
}
.reg-modal-form input[type="text"],
.reg-modal-form input[type="password"] {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 12px;
  font-family: var(--mono);
  font-size: 1.1rem;
  background: var(--void);
  color: var(--text);
  border: 3px solid;
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
}
.reg-modal-form input:focus {
  outline: none;
  border-color: var(--gold);
}
.reg-rules {
  margin-bottom: 14px;
  padding: 10px;
  background: var(--void);
  border: 2px dashed var(--bevel-mid);
  font-size: 0.95rem;
  color: var(--muted);
}
.reg-rules label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  color: var(--text);
}
.reg-rules input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
}
.reg-rule-more {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--bevel-mid);
}
.reg-rule-more.is-on {
  display: flex;
}
.reg-submit {
  width: 100%;
  padding: 14px;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--ok);
  color: #0a160a;
  border: 4px solid;
  border-color: #a8f0a8 #1a4a1a #1a4a1a #a8f0a8;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}
.reg-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.reg-submit:not(:disabled):hover {
  filter: brightness(1.06);
}
.reg-notify {
  margin-top: 12px;
  padding: 10px;
  text-align: center;
  font-size: 1rem;
  border: 2px solid;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.reg-notify.show {
  opacity: 1;
  pointer-events: auto;
}
.reg-notify.success {
  border-color: var(--ok);
  color: #b8f5b8;
  background: rgba(107, 201, 107, 0.12);
}
.reg-notify.error {
  border-color: var(--hp-red);
  color: #ffb4b4;
  background: rgba(196, 76, 76, 0.15);
}
body.reg-modal-open {
  overflow: hidden;
}

.rail-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.rail-user-meta {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ok);
  margin-right: 4px;
}
.rail-cta--login {
  background: var(--mp-blue) !important;
  border-color: #7ab8e8 #2a4a6a #2a4a6a #7ab8e8 !important;
  color: #fff !important;
}
.rail-cta--login:hover {
  filter: brightness(1.08);
  color: #fff !important;
}
.rail-cta--logout {
  background: var(--panel) !important;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light) !important;
  color: var(--muted) !important;
  font-family: var(--mono);
  font-size: 0.9rem;
  cursor: pointer;
}
.rail-cta--logout:hover {
  color: var(--gold) !important;
}

/* Trang đang mở trên rail (Diễn đàn, Tải game, BXH, Nạp): kiểu nút pixel + viền vàng — đồng bộ các mục cạnh nhau */
.rail-nav a.rail-nav-pill.rail-nav-pill--active {
  font-family: var(--pixel);
  font-size: 0.38rem;
  line-height: 1.55;
  padding: 6px 11px 8px;
  border-radius: 5px;
  border: 2px solid var(--gold);
  background: rgba(26, 18, 40, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 12px rgba(240, 192, 64, 0.15);
  color: var(--gold) !important;
  text-shadow: 1px 1px 0 #000, 0 0 10px var(--gold-glow);
  text-decoration: none !important;
}
.rail-nav a.rail-nav-pill.rail-nav-pill--active:hover {
  color: #fff5c8 !important;
  border-color: #ffe08a;
}
.rail-nav a.rail-nav-pill.rail-nav-pill--active:active {
  filter: brightness(1.06);
}
/* Nút nội bộ cạnh nhau: phản hồi khi bấm (trước khi điều hướng) */
.rail-nav > a[href^="/"]:active:not(.rail-nav-pill--active) {
  color: var(--gold);
}

/* Đủ chờ rail cố định khi nav xuống nhiều dòng (mobile); tránh nội dung bị che “không thấy” */
.bxh-main {
  position: relative;
  z-index: 5;
  margin-top: 0;
  padding: clamp(5.75rem, 14vw, 7.5rem) 16px 56px;
  min-height: 48vh;
  color: var(--text);
}
.bxh-page-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bxh-err {
  margin: 0;
  padding: 16px 18px;
  background: rgba(196, 76, 76, 0.12);
  color: #f0b0b0;
  font-size: 1.05rem;
}

.bxh-panel {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: var(--panel2);
}
.bxh-panel__bar {
  height: 6px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
  opacity: 0.92;
  box-shadow: 0 0 16px var(--gold-glow);
}
.bxh-table-scroll {
  overflow: auto;
  max-height: min(68vh, 540px);
  -webkit-overflow-scrolling: touch;
}
.bxh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.05rem;
}
.bxh-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #241a38 0%, #1a1228 100%);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 12px;
  border-bottom: 3px solid var(--bevel-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  text-align: left;
}
.bxh-th-rank {
  width: 3.5rem;
  padding-left: 16px !important;
}
.bxh-th-num {
  text-align: right;
  padding-right: 16px !important;
}
.bxh-table tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(122, 92, 58, 0.35);
  vertical-align: middle;
}
.bxh-td-rank {
  width: 3.5rem;
  padding-left: 14px !important;
}
.bxh-td-player {
  min-width: 11rem;
}
.bxh-player {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.bxh-portrait {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 8px;
  border: 2px solid var(--bevel-mid);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background: rgba(10, 6, 16, 0.9);
  flex-shrink: 0;
}
.bxh-name {
  font-weight: 700;
  color: var(--text);
  font-size: 1.08rem;
  text-shadow: 1px 1px 0 #000;
}
.bxh-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #dccfb8;
  padding-right: 16px !important;
}
.bxh-td-strong {
  font-weight: 700;
  color: var(--gold);
  font-size: 1.12rem;
  text-shadow: 0 0 12px rgba(240, 192, 64, 0.25);
}
.bxh-td-empty {
  text-align: center;
  color: #9a8b7a;
  font-size: 0.98rem;
  padding: 1.5rem 12px !important;
}

.bxh-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  font-weight: 700;
  font-size: 1.05rem;
}
.bxh-rank-badge--1,
.bxh-rank-badge--2,
.bxh-rank-badge--3 {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}
.bxh-rank-badge--4 {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--muted);
  border: 2px solid rgba(122, 92, 58, 0.6);
  border-radius: 6px;
  background: rgba(10, 6, 16, 0.55);
}

.bxh-tr--gold td {
  background: linear-gradient(
    90deg,
    rgba(240, 192, 64, 0.16) 0%,
    rgba(240, 192, 64, 0.05) 55%,
    transparent 88%
  );
}
.bxh-tr--silver td {
  background: linear-gradient(
    90deg,
    rgba(210, 210, 225, 0.12) 0%,
    rgba(210, 210, 225, 0.04) 55%,
    transparent 88%
  );
}
.bxh-tr--bronze td {
  background: linear-gradient(
    90deg,
    rgba(200, 120, 64, 0.14) 0%,
    rgba(200, 120, 64, 0.05) 55%,
    transparent 88%
  );
}
.bxh-table tbody tr:hover td {
  background-color: rgba(92, 140, 188, 0.14) !important;
}

@media (max-width: 560px) {
  .bxh-table thead th {
    font-size: 0.8rem;
    padding: 10px 8px;
  }
  .bxh-table tbody td {
    padding: 10px 8px;
  }
  .bxh-portrait {
    width: 38px;
    height: 38px;
  }
  .bxh-name {
    font-size: 1rem;
  }
}
