/* StreamDrop v1.8 global UX and responsive fixes */
:root { --sd-sidebar-width: clamp(300px, 20vw, 370px); }
html { scroll-behavior: smooth; }
body:not(.overlay-body) { overflow-x: hidden; }
.topbar, .layout, .games-shell, .v13-shell, .saas-admin-shell { max-width: calc(100vw - 24px); }

/* Critical clickability fix: sidebar always stays above catalog layers. */
.games-page-body .games-shell { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) !important; }
.games-page-body .games-sidebar,
.games-page-body .v13-side,
.games-page-body .sidebar { position: sticky; top: 94px; z-index: 60; pointer-events: auto !important; overflow: visible; }
.games-page-body .games-main { position: relative; z-index: 1; min-width: 0; }
.games-page-body .side-nav,
.games-page-body .side-nav *,
.games-page-body .nav-link { position: relative; z-index: 70; pointer-events: auto !important; }
.games-page-body .nav-link { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.games-page-body .game-card,
.games-page-body .games-catalog-grid,
.games-page-body .games-welcome { position: relative; z-index: 1; }
.games-page-body .pixel-scene,
.games-page-body .pixel-scene::before,
.games-page-body .game-orb,
.games-page-body .live-preview-mini::before,
body:not(.overlay-body)::before { pointer-events: none !important; }

/* Sidebar and shell polish for every page */
.side-nav { align-content: start; width: 100%; }
.nav-link { user-select: none; isolation: isolate; }
.nav-link span:first-child { flex: 0 0 auto; }
.sidebar, .v13-side, .saas-sidebar, .games-sidebar { min-width: 0; }
.main-panel, .v13-main, .saas-main, .games-main { min-width: 0; }

/* Better cards, tables and empty states */
.empty-table { border: 1px dashed rgba(38, 57, 93, .14); background: rgba(255,255,255,.68) !important; color: #61718f; }
.table-row { overflow: hidden; }
.table-row > * { min-width: 0; overflow-wrap: anywhere; }
.admin-table { overflow-x: auto; padding-bottom: 4px; }

/* Uniform language switcher */
.language-switcher { flex-shrink: 0; }
.lang-pill { cursor: pointer; }
.lang-pill:focus-visible, .nav-link:focus-visible, .btn:focus-visible { outline: 3px solid rgba(91, 124, 250, .35); outline-offset: 3px; }

/* Game catalog UX */
.games-welcome { overflow: hidden; }
.game-card { isolation: isolate; }
.game-card-body h2 { min-height: 1.35em; }
.game-actions .btn[disabled] { opacity: .7; cursor: not-allowed; transform: none; }
.game-actions .btn { cursor: pointer; }
.game-badges { pointer-events: none; }

/* Mobile navigation becomes usable horizontal chips instead of squeezed links */
@media (max-width: 1280px) {
  .games-page-body .games-shell { grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) !important; }
}
@media (max-width: 1024px) {
  .games-page-body .games-shell { grid-template-columns: 1fr !important; }
  .games-page-body .games-sidebar { position: relative; top: auto; z-index: 10; }
  .side-nav { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .nav-link { white-space: normal; overflow: visible; text-overflow: clip; }
}
@media (max-width: 760px) {
  .topbar { max-width: calc(100vw - 14px); }
  .brand { min-width: 0; }
  .brand > span:not(.brand-mark) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .side-nav { grid-template-columns: 1fr 1fr; gap: 8px; }
  .nav-link { min-height: 48px; padding: 10px 11px; font-size: .9rem; }
  .games-page-body .games-shell, .layout, .v13-shell, .saas-admin-shell { width: calc(100% - 14px) !important; }
}
@media (max-width: 480px) {
  .side-nav { grid-template-columns: 1fr; }
  .top-actions { grid-template-columns: 1fr !important; }
  .language-switcher { overflow-x: auto; justify-content: flex-start !important; }
  .lang-pill { min-width: 76px; }
}
