:root {
  color-scheme: dark;
  --bg: #020b12;
  --panel: #071621;
  --panel-2: #0b1b28;
  --line: #18364a;
  --muted: #8699ab;
  --text: #f5f9fc;
  --cyan: #26d3ff;
  --blue: #008ef4;
  --yellow: #ffca32;
  --sidebar: 214px;
  --content-max: 1540px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 10; width: var(--sidebar); padding: 18px 18px 16px;
  display: flex; flex-direction: column; overflow-y: auto;
  border-right: 1px solid rgba(53, 112, 144, .12);
  background: linear-gradient(180deg, rgba(2, 12, 20, .99), rgba(3, 16, 25, .97));
}
.primary-nav { display: grid; gap: 4px; margin-top: 8px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 0 12px; border-radius: 9px; color: #d6e0e8; font-size: .92rem; transition: .2s ease; }
.nav-link span { min-width: 26px; color: #dce9f2; font-size: .74rem; }
.nav-link:hover, .nav-link.active { background: linear-gradient(90deg, #0b1d2a, #091822); color: #fff; }
.main-content { min-height: 100vh; padding: 12px clamp(18px, 2.25vw, 44px) 0; margin-left: var(--sidebar); }
.lobby-rail { width: min(100%, var(--content-max)); min-height: 100vh; margin-inline: auto; }
.topbar { position: sticky; z-index: 20; top: 0; min-height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 9px; padding: 10px 0; border-bottom: 1px solid #173449; background: var(--bg); box-shadow: 0 10px 24px rgba(2, 11, 18, .78); }
.topbar-brand { display: flex; grid-column: 1; align-items: center; gap: 7px; font-size: 1.25rem; font-weight: 850; letter-spacing: -.04em; white-space: nowrap; }
.topbar-brand > span:first-child { color: var(--cyan); font-size: .78rem; letter-spacing: 0; }
.topbar-brand span:last-child { color: var(--cyan); }
.account-actions { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.auth-actions { grid-column: 3; display: flex; justify-self: end; align-items: center; gap: 8px; }
.utility, .auth { min-height: 42px; padding: 0 18px; border: 1px solid #1a3345; border-radius: 9px; background: linear-gradient(180deg, #0d1c27, #08151e); cursor: pointer; font-size: .82rem; font-weight: 650; }
.utility span { margin-right: 7px; color: var(--cyan); font-size: .7rem; }
.utility.balance span { margin: 0 0 0 8px; }
.utility.rewards { color: var(--yellow); }
.auth { min-width: 98px; }
.auth.register { border-color: #14baf1; background: linear-gradient(180deg, #47dcff, #0ab8f4); color: #00101a; box-shadow: 0 0 17px rgba(0, 185, 255, .28); }

.hero-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 12px; }
.hero-card { position: relative; width: 100%; min-height: clamp(258px, 18vw, 318px); padding: 0; overflow: hidden; border: 1px solid #0a9ce5; border-radius: 14px; background-color: #02101a; background-repeat: no-repeat; background-size: cover; color: inherit; cursor: pointer; font: inherit; text-align: left; appearance: none; box-shadow: inset 0 0 34px rgba(0, 143, 240, .08), 0 18px 48px rgba(0, 0, 0, .22); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.hero-card:hover { transform: translateY(-2px); border-color: #62dcff; box-shadow: inset 0 0 34px rgba(0, 143, 240, .1), 0 18px 48px rgba(0, 128, 220, .18); }
.hero-card.active { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(30, 207, 255, .2), 0 18px 48px rgba(0, 128, 220, .18); }
.hero-card::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(1, 9, 15, .93) 0%, rgba(1, 11, 20, .75) 31%, rgba(1, 13, 23, .18) 58%, transparent 76%); }
.hero-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 30%; background: linear-gradient(180deg, transparent, rgba(0, 145, 247, .16)); transform: skewY(-4deg); transform-origin: 100% 100%; }
.hero-house { background-image: url("assets/banners/play-the-house.png"); background-position: center; }
.hero-player { background-image: url("assets/banners/play-the-player.png"); background-position: center; }
.dot-field { position: absolute; z-index: 1; inset: 0 auto 0 0; width: 10%; opacity: .45; background-image: radial-gradient(var(--blue) 1px, transparent 1px); background-size: 6px 6px; mask-image: linear-gradient(90deg, #000, transparent); }
.hero-copy { position: relative; z-index: 3; width: 50%; padding: 36px 0 28px 42px; }
.hero-copy p { margin: 0; font-size: clamp(2rem, 3vw, 3rem); font-style: italic; font-weight: 900; line-height: .86; letter-spacing: -.06em; }
.hero-copy h1 { margin: 0; color: #b9efff; font-size: clamp(3rem, 5vw, 5rem); font-style: italic; line-height: .94; letter-spacing: -.08em; text-shadow: 0 3px 0 #188aca, 0 0 22px #008cf0; }
.hero-copy > span { display: block; margin-top: 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .18em; }
.versus-mark { position: absolute; z-index: 3; left: 66%; top: 49%; transform: translate(-50%, -50%) skew(-7deg); color: #dff8ff; font-size: clamp(2.4rem, 4vw, 4.8rem); font-style: italic; font-weight: 950; letter-spacing: -.12em; text-shadow: 0 0 8px #fff, 0 0 22px #25bfff, 0 0 44px #008cff; }

.category-strip { display: flex; gap: 8px; padding: 18px 0 10px; overflow-x: auto; scrollbar-width: none; }
.category-strip::-webkit-scrollbar { display: none; }
.category { flex: 0 0 auto; min-height: 36px; padding: 0 17px; border: 1px solid #203a4b; border-radius: 999px; background: linear-gradient(180deg, #10222f, #091722); color: #d7e1e9; cursor: pointer; font-size: .76rem; }
.category span { margin-right: 8px; color: #cad9e4; font-size: .65rem; }
.category:hover, .category.active { border-color: #159dce; background: #0d2738; color: #fff; }
.search-box { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 17px; border: 1px solid #21445f; border-radius: 10px; background: linear-gradient(90deg, #0c1a27, #081723); color: #b8d0df; box-shadow: inset 0 1px rgba(255, 255, 255, .02); }
.search-box > span:first-child { font-size: .66rem; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: #eaf6fc; font-size: .89rem; }
.search-box input::placeholder { color: #7790a4; }

.game-section { padding: 20px 0 8px; scroll-margin-top: 12px; }
.section-heading { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.section-icon { color: var(--cyan); font-size: .7rem; }
.section-icon.coral, .section-icon.red { color: #ff4059; }
.section-heading h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.025em; }
.section-heading p { margin: 0; color: var(--muted); font-size: .78rem; }
.section-heading .lobby-mode-label { color: var(--cyan); font-weight: 760; letter-spacing: .02em; }
.section-heading button { flex: 0 0 auto; border: 0; background: transparent; color: var(--cyan); cursor: pointer; font-size: .76rem; }
.section-heading button span { margin-left: 5px; font-size: .65rem; }
.card-row { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 11px; margin-top: 10px; }
.game-card { position: relative; min-width: 0; min-height: 118px; overflow: hidden; text-align: left; background: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.placeholder-art { min-height: 78px; display: grid; place-items: center; padding: 12px; color: #7ddfff; background: transparent; font-weight: 750; font-size: .84rem; text-align: center; text-shadow: 0 1px 9px rgba(0, 174, 255, .5); }
.slot .placeholder-art { min-height: 116px; color: #ffc960; background: transparent; }
.live .placeholder-art { min-height: 116px; color: #ffb4bd; background: transparent; }
.game-card[hidden], .game-section[hidden] { display: none; }
.empty-state { min-height: 120px; display: grid; place-items: center; color: var(--muted); }
.empty-state[hidden] { display: none; }
.lobby-breathing-room { min-height: clamp(96px, 12vw, 190px); margin-top: 24px; background: transparent; }
@media (max-width: 1180px) {
  :root { --sidebar: 190px; }
  .main-content { padding-inline: 18px; }
  .hero-card { min-height: 232px; }
  .hero-copy { padding-left: 28px; }
  .hero-copy > span { font-size: .62rem; }
  .card-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; padding: 7px 10px; overflow-x: auto; overflow-y: hidden; flex-direction: row; border: 0; border-bottom: 1px solid #173449; }
  .primary-nav { display: flex; gap: 5px; margin: 0; }
  .nav-link { flex: 0 0 auto; min-height: 38px; padding: 0 11px; font-size: .78rem; }
  .nav-link:nth-child(n+6) { display: none; }
  .main-content { margin-left: 0; padding: 8px 14px 0; }
  .utility, .auth { min-height: 38px; padding: 0 12px; }
  .auth { min-width: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 218px; }
  .hero-house { background-position: 46% center; }
  .hero-player { background-position: 49% center; }
  .versus-mark { left: 70%; font-size: 2.4rem; }
}

@media (max-width: 560px) {
  .main-content { padding-inline: 10px; }
  .topbar { grid-template-columns: 1fr auto; gap: 7px; min-height: 102px; padding-block: 8px; }
  .topbar-brand { grid-column: 1; grid-row: 1; }
  .auth-actions { grid-column: 2; grid-row: 1; }
  .account-actions { grid-column: 1 / -1; grid-row: 2; justify-self: center; gap: 5px; }
  .utility, .auth { min-height: 34px; padding: 0 9px; font-size: .74rem; }
  .hero-card { min-height: 210px; }
  .hero-copy { width: 72%; padding: 30px 0 22px 22px; }
  .hero-copy p { font-size: 1.85rem; }
  .hero-copy h1 { font-size: 3.15rem; }
  .hero-copy > span { max-width: 210px; line-height: 1.45; }
  .hero-card::before { background: linear-gradient(90deg, rgba(1, 9, 15, .94) 0%, rgba(1, 11, 20, .78) 44%, rgba(1, 13, 23, .2) 74%, transparent 100%); }
  .hero-house { background-position: 48% center; }
  .hero-player { background-position: 54% center; }
  .versus-mark { display: none; }
  .section-heading > div { align-items: center; flex-wrap: wrap; gap: 4px 8px; }
  .section-heading p { flex-basis: calc(100% - 34px); margin-left: 34px; }
  .card-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-card { min-height: 108px; }
  .placeholder-art, .slot .placeholder-art, .live .placeholder-art { min-height: 92px; }
  .lobby-breathing-room { min-height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
