/* Layout lock. Loaded last so the header, ticker and lobby share one grid on desktop and phones. */
:root{
  --lha-bar:96px;
  --lha-ticker:72px;
  --lha-top:calc(var(--lha-bar) + var(--lha-ticker));
}
html,body{min-width:0}
.topbar{
  position:fixed !important;
  top:0;left:0;right:0;
  z-index:30 !important;
  height:var(--lha-bar) !important;
  display:flex !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
  gap:12px !important;
  padding:0 16px !important;
  margin:0 !important;
  background:linear-gradient(180deg,#1c1028f8,#161025f2) !important;
  border-bottom:1px solid #f044a333;
  backdrop-filter:blur(16px);
  overflow:hidden;
}
.brand{margin:0 !important;min-width:0;flex:none}
.topbar nav{
  position:static !important;
  left:auto !important;
  bottom:auto !important;
  display:flex !important;
  align-items:center;
  gap:8px !important;
  flex:1 1 auto;
  min-width:0;
  overflow-x:auto;
  scrollbar-width:none;
  padding:0 !important;
}
.topbar nav::-webkit-scrollbar{display:none}
.topbar nav button{flex:none;white-space:nowrap}
.header-right{margin:0 !important;flex:none;display:flex;align-items:center;gap:8px}
.site-winners{
  position:fixed !important;
  top:var(--lha-bar) !important;
  left:0;right:0;
  height:var(--lha-ticker) !important;
  z-index:28 !important;
  display:flex !important;
  align-items:center !important;
  padding:0 16px !important;
  margin:0 !important;
  background:linear-gradient(180deg,#241433fa,#1a1028f5) !important;
  border-bottom:1px solid #f044a444 !important;
  overflow:hidden !important;
}
#winners-content{width:100%;min-width:0}
.win-ticker{display:flex;align-items:center;gap:14px;width:100%;min-width:0;height:100%}
.win-label{
  flex:none;
  color:#ffc47d;
  font:600 12px/1 Tactical,sans-serif;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.win-empty{color:#c9a8d8;font:13px/1.3 Arial,sans-serif}
.win-window{
  flex:1;min-width:0;overflow:hidden;
  mask-image:linear-gradient(90deg,#000,#000 calc(100% - 24px),transparent);
}
.win-track{display:flex;width:max-content;gap:10px;animation:lha-win 42s linear infinite}
.win-ticker:hover .win-track{animation-play-state:paused}
.win-chip{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 14px;border-radius:999px;
  background:#2a1840;border:1px solid #f044a455;
  box-shadow:inset 0 0 0 1px #ffffff08;
}
.win-chip i{font-style:normal;color:#fff0e5;font:600 13px/1 Arial,sans-serif}
.win-chip b{color:#ffc47d;font:700 13px/1 Tactical,sans-serif;font-variant-numeric:tabular-nums}
@keyframes lha-win{from{transform:translate3d(0,0,0)}to{transform:translate3d(-50%,0,0)}}
@media (prefers-reduced-motion:reduce){
  .win-window{overflow-x:auto}
  .win-track{animation:none}
}

body.lobby-open .lobby-view{
  top:var(--lha-top) !important;
  right:0;left:0;bottom:0;
  padding:22px 18px calc(150px + env(safe-area-inset-bottom)) !important;
}
body.lobby-open .launch-notice,
body.lobby-open .room-clock,
body.lobby-open #world,
body.lobby-open .scene-shade,
body.lobby-open .bottom-caption,
body.lobby-open .help-button{display:none !important}
.lobby-shell{padding-bottom:8px !important}
.lobby-hero h1{letter-spacing:0}
.room-list{align-items:stretch}
.room-card{
  border-radius:22px !important;
  border:1px solid #f044a433 !important;
  background:linear-gradient(165deg,#2c1846ee,#160b24f2) !important;
  box-shadow:0 18px 40px #0004;
  min-width:0;
}
.room-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.room-card h3{min-width:0;overflow-wrap:anywhere}
.room-status{flex:none;border-radius:999px !important}
.room-card-note{overflow-wrap:anywhere}
.room-card-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.room-card-actions button{flex:1 1 120px;min-height:44px;border-radius:999px !important}
.lobby-bottom-note a{color:#ffc47d}

dialog{
  width:min(640px,calc(100vw - 24px)) !important;
  max-height:calc(100dvh - 24px);
  border-radius:24px !important;
}
.profile-form-layout{min-width:0}
.room-fields{min-width:0}
.room-fields select,.room-fields input{width:100%;max-width:100%}

@media (max-width:1100px){
  .how-it-works-button{font-size:0 !important;width:36px;height:36px;padding:0 !important;border-radius:12px}
  .how-it-works-button>span{font-size:16px !important}
  .brand small{letter-spacing:.08em}
}

@media (min-width:951px){
  body:not(.lobby-open) .commander-card,
  body:not(.lobby-open) .activity-panel{top:calc(var(--lha-top) + 12px) !important}
  body:not(.lobby-open) .room-clock{top:calc(var(--lha-top) + 16px) !important}
  body:not(.lobby-open) .launch-notice{display:none !important}
  body:not(.lobby-open) .bottom-ui{bottom:24px !important}
}

@media (max-width:950px){
  :root{--lha-bar:118px;--lha-ticker:64px}
  html,body{overflow-x:hidden !important}
  .topbar{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    grid-template-rows:58px 50px !important;
    align-items:center !important;
    column-gap:8px !important;
    row-gap:0 !important;
    padding:0 12px !important;
    height:var(--lha-bar) !important;
  }
  .brand{grid-column:1;grid-row:1}
  .brand-mark{width:36px !important;height:36px !important;font-size:18px !important}
  .brand strong{font-size:15px !important}
  .brand small{display:none !important}
  .header-right{grid-column:2;grid-row:1;gap:6px !important}
  .demo-tag{display:none !important}
  .icon-button{width:36px !important;height:36px !important}
  .balance-pill{min-width:0 !important;padding:4px 10px !important;display:flex;flex-direction:column;align-items:flex-end;line-height:1.05}
  .balance-pill small{display:block !important;font-size:8px !important;letter-spacing:.08em}
  .balance-pill strong{font-size:14px !important}
  .topbar .room-nav-button{display:none !important}
  .topbar nav{
    grid-column:1 / -1;
    grid-row:2;
    width:100% !important;
    padding-bottom:6px !important;
  }
  .topbar nav button{font-size:12px !important;padding:7px 10px !important;min-height:34px}
  .site-winners{padding:0 12px !important}
  .win-label{font-size:11px;letter-spacing:.08em}
  .win-chip{padding:7px 12px}
  body.lobby-open{overflow:hidden !important;height:100dvh !important}
  body.lobby-open .lobby-view{
    padding:16px 12px calc(210px + env(safe-area-inset-bottom)) !important;
  }
  .lobby-hero{flex-direction:column !important;align-items:stretch !important;gap:14px !important}
  .lobby-hero h1{font-size:34px !important;line-height:1.05 !important;margin:6px 0 8px !important}
  .lobby-hero p{font-size:14px !important;line-height:1.5 !important}
  .lobby-hero>.primary-button{width:100% !important;min-height:48px}
  .lobby-demo-notice{align-items:flex-start}
  .lobby-demo-notice p{font-size:13px !important;line-height:1.45 !important}
  .room-list{grid-template-columns:1fr !important;gap:12px !important}
  .room-card{padding:16px !important}
  .room-card h3{font-size:20px !important}
  .guest-bar,.onboard{
    left:8px !important;
    right:8px !important;
    width:auto !important;
    transform:none !important;
    bottom:calc(8px + env(safe-area-inset-bottom)) !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
    padding:14px !important;
  }
  .guest-bar .actions,.onboard .actions{margin-left:0 !important;display:flex;gap:8px}
  .guest-bar .actions button,.onboard .actions button{flex:1;min-height:44px}
  dialog{width:calc(100vw - 16px) !important;padding:20px 14px !important;margin:8px auto}
  .profile-form-layout,.rule-grid,.room-fields{display:grid !important;grid-template-columns:1fr !important;gap:12px !important}
  .close-dialog{width:40px !important;height:40px !important}

  body:not(.lobby-open){overflow:hidden !important;height:100dvh !important}
  body:not(.lobby-open) #world{
    position:fixed !important;
    top:var(--lha-top) !important;
    left:0 !important;
    width:100% !important;
    height:calc(100dvh - var(--lha-top) - 168px) !important;
  }
  body:not(.lobby-open) .scene-shade,
  body:not(.lobby-open) .launch-notice,
  body:not(.lobby-open) .commander-card,
  body:not(.lobby-open) .activity-panel,
  body:not(.lobby-open) .bottom-caption,
  body:not(.lobby-open) .help-button{display:none !important}
  body:not(.lobby-open) .room-clock{
    position:fixed !important;
    top:calc(var(--lha-top) + 8px) !important;
    left:10px !important;
    right:10px !important;
    width:auto !important;
    max-width:none !important;
    min-width:0 !important;
    transform:none !important;
    z-index:16 !important;
  }
  body:not(.lobby-open) .bottom-ui{
    position:fixed !important;
    left:8px !important;
    right:8px !important;
    top:auto !important;
    bottom:calc(8px + env(safe-area-inset-bottom)) !important;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    margin:0 !important;
    transform:none !important;
    z-index:21 !important;
  }
  body:not(.lobby-open) #king-controls:not([hidden]){
    position:fixed !important;
    left:8px !important;
    right:8px !important;
    top:auto !important;
    bottom:calc(168px + env(safe-area-inset-bottom)) !important;
    width:auto !important;
    max-height:42dvh;
    overflow:auto !important;
    z-index:22 !important;
  }
  .play-row{height:auto !important}
  .play-note span:last-child{display:none}
  .toast{left:12px !important;right:12px !important;width:auto !important;bottom:calc(180px + env(safe-area-inset-bottom)) !important}
}

@media (max-width:420px){
  .win-label{display:none}
  .lobby-hero h1{font-size:30px !important}
  .brand strong{font-size:14px !important;max-width:92px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #header-name{display:none}
  .header-profile{padding:4px !important}
}

button,.nav-button,.primary-button,.secondary-button,.icon-button,.play-button,.how-it-works-button,.room-nav-button,.cube-variant-button,.header-profile{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  line-height:1.1 !important;
  letter-spacing:.01em !important;
  font-style:normal !important;
  transform:none !important;
  vertical-align:middle;
}
.primary-button,.secondary-button,.play-button,.nav-button,.how-it-works-button,.room-nav-button,.header-profile{
  box-shadow:none !important;
}
.topbar .nav-button,.topbar .room-nav-button,.how-it-works-button{
  min-height:38px;
  padding:0 14px !important;
  border-radius:999px !important;
  background:#241433 !important;
  border:1px solid #f044a444 !important;
}
.icon-button{
  width:40px !important;
  height:40px !important;
  padding:0 !important;
  overflow:hidden !important;
  border-radius:14px !important;
  background:#241433 !important;
  line-height:0 !important;
}
#sound-button svg{display:block;width:18px;height:18px}
#sound-button .mute-slash{position:static !important;right:auto !important;top:auto !important;font-size:inherit !important}
#sound-button.is-on .mute-slash{display:none}
.brand{display:flex;align-items:center;gap:10px}
img.brand-mark{
  width:44px !important;
  height:44px !important;
  padding:0 !important;
  letter-spacing:0 !important;
  transform:none !important;
  object-fit:cover;
  border-radius:14px !important;
  background:#161025;
  box-shadow:0 0 0 1px #f044a455;
}
.header-profile{
  gap:8px;
  height:40px;
  padding:4px 12px 4px 4px !important;
  border-radius:999px !important;
  background:#241433 !important;
  border:1px solid #f044a455 !important;
  color:#fff0e5 !important;
}
.header-profile img{width:32px;height:32px;border-radius:50%;object-fit:cover}
.balance-pill{
  display:flex !important;
  flex-direction:column;
  align-items:flex-end;
  justify-content:center;
  gap:2px !important;
  min-height:40px;
  padding:6px 12px !important;
  margin:0 !important;
  border:1px solid #f044a444 !important;
  border-radius:16px !important;
  background:#241433 !important;
}
.profile-button{overflow:hidden !important;align-items:center !important}
.profile-button img{width:36px !important;height:36px !important;border-radius:12px !important;object-fit:cover !important}
.topbar{background:#161025f2 !important}
.site-winners{background:#161025eb !important;backdrop-filter:none !important}
body.lobby-open .scene-backdrop{
  background:url('assets/themes/gta6-cover.png') center/cover no-repeat #161025 !important;
  filter:saturate(1.2) contrast(1.05) !important;
}
body.lobby-open .lobby-view{
  background:radial-gradient(ellipse 58% 52% at 50% 36%,rgba(16,8,24,.94) 0%,rgba(16,8,24,.78) 42%,rgba(16,8,24,.34) 70%,rgba(16,8,24,0) 100%) !important;
  backdrop-filter:none !important;
}
#login-button{
  min-height:40px;
  padding:0 16px !important;
  border-radius:999px !important;
  border:0 !important;
  background:linear-gradient(100deg,#ff7854,#f044a4) !important;
  color:#161025 !important;
  font-weight:700;
}
.room-card,.lobby-demo-notice,.guest-bar,.onboard,.panel,.commander-card,.activity-panel,dialog,.gate{
  background:#221432 !important;
  backdrop-filter:none !important;
}
.profile-sheet{
  width:min(420px,calc(100vw - 24px)) !important;
  padding:18px 16px 16px !important;
  background:#1a1028 !important;
  border:1px solid #f044a455 !important;
}
.profile-sheet-head{display:flex;align-items:center;gap:12px;margin:6px 0 14px}
.profile-sheet-head img{width:56px;height:56px;border-radius:16px;object-fit:cover;border:1px solid #f044a466}
.profile-sheet-head strong{display:block;margin-top:2px;font:600 20px/1.15 Tactical,sans-serif;color:#fff0e5}
.profile-sheet-head span{display:block;margin-top:4px;color:#ffc47d;font:600 14px/1.2 Tactical,sans-serif}
.profile-sheet-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.profile-sheet-actions .primary-button,.profile-sheet-actions .secondary-button{width:100%;margin:0 !important;min-height:42px}
.profile-sheet .profile-payments-title{margin:16px 0 8px;font:600 13px/1 Tactical,sans-serif;letter-spacing:.08em;color:#c9a8d8}
.profile-sheet #logout-button{margin-top:12px}
.profile-sheet .deposit-row{background:#160b24}

@media (max-width:950px){
  img.brand-mark{width:36px !important;height:36px !important}
  .header-profile{height:36px}
  .icon-button{width:36px !important;height:36px !important}
}
