:root {
  --rc-topbar: 68px;
  --rc-rail: 92px;
  --rc-bottom-nav: 72px;
  --rc-bg: #0d0f12;
  --rc-surface: rgba(24, 25, 28, .94);
  --rc-surface-2: rgba(32, 33, 36, .92);
  --rc-line: rgba(225, 190, 112, .18);
  --rc-gold: #e0b45a;
  --rc-muted: #948e83;
}

html {
  scrollbar-gutter: stable;
  scroll-padding-top: calc(var(--rc-topbar) + 16px);
}

body {
  background-color: var(--rc-bg);
}

body::after {
  background:
    linear-gradient(180deg, rgba(8, 10, 12, .44), rgba(8, 10, 12, .94) 68%),
    radial-gradient(circle at 50% 0, transparent, rgba(0, 0, 0, .45));
}

body[data-scene="home"]::before {
  background-image: url('assets/locations/headquarters-v103.webp');
  opacity: .3;
}

body[data-scene="missions"]::before {
  background-image: url('assets/locations/missions-v103.webp');
  opacity: .32;
}

body[data-scene="arena"]::before {
  background-image: url('assets/scenes/red-hook-arena-v103.webp');
  opacity: .32;
}

body[data-scene="family"]::before {
  background-image: url('assets/locations/family-v103.webp');
  opacity: .3;
}

body:is([data-scene="city"], [data-scene="campaign"], [data-scene="market"], [data-scene="world"], [data-scene="event"], [data-scene="dossier"])::before {
  background-image: url('assets/scenes/rep-city-v103.webp');
  opacity: .3;
}

#gameShell {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  padding:
    calc(var(--rc-topbar) + 16px)
    16px
    0
    calc(var(--rc-rail) + 16px);
}

#gameHeader,
body.location-focus #gameHeader {
  padding-top: 0 !important;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

#v30Objective,
#v30Bell,
body .lc-launch {
  display: none !important;
}

#desktopTitleBar,
body.location-focus #desktopTitleBar {
  position: fixed;
  inset: 0 0 auto var(--rc-rail);
  z-index: 60;
  width: auto;
  max-width: none;
  min-height: var(--rc-topbar);
  transform: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 18px;
  border: 0;
  border-bottom: 1px solid var(--rc-line);
  border-radius: 0;
  background: rgba(13, 15, 18, .94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  backdrop-filter: blur(18px);
}

#desktopTitleBar .rc-brand {
  display: flex !important;
  min-width: 148px;
}

.rc-brand > div:first-child {
  width: 38px;
  height: 38px;
  border-width: 1px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: none;
}

.rc-brand h1 {
  font-size: 20px;
}

.rc-brand h1 i,
.rc-brand p {
  display: none;
}

#desktopTitleBar .rc-hud,
body.location-focus #desktopTitleBar .rc-hud {
  width: auto;
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  overflow: visible;
}

.rc-hud > * {
  flex: 0 0 auto;
  min-height: 42px;
}

.rc-resource,
.rc-profile-button,
.rc-account-button,
#settingsBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(226, 187, 99, .16) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .035) !important;
  box-shadow: none !important;
}

.rc-resource strong {
  font-variant-numeric: tabular-nums;
}

.rc-sync {
  background: rgba(39, 91, 72, .13) !important;
}

.rc-primary-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 70;
  width: var(--rc-rail);
  display: grid;
  align-content: center;
  gap: 7px;
  padding: calc(var(--rc-topbar) + 14px) 9px 18px;
  border-right: 1px solid var(--rc-line);
  background: rgba(11, 13, 15, .97);
  box-shadow: 12px 0 34px rgba(0, 0, 0, .24);
}

.rc-primary-nav .location-tab {
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #8f8b84;
  text-align: center;
  box-shadow: none;
}

.rc-primary-nav .location-tab::before,
.rc-primary-nav .location-tab::after {
  display: none;
}

.rc-primary-nav .location-tab .screen-icon {
  width: 21px;
  height: 21px;
}

.rc-primary-nav .location-tab span {
  position: static;
  transform: none;
  font: 600 10px/1.1 'Roboto Slab', Georgia, serif;
  letter-spacing: 0;
  text-transform: none;
}

.rc-primary-nav .location-tab:hover {
  transform: none;
  color: #eee7da;
  background: rgba(255, 255, 255, .04);
}

.rc-primary-nav .location-tab.active {
  border-color: rgba(238, 195, 96, .3);
  color: #f2ce73;
  background: linear-gradient(145deg, rgba(211, 157, 54, .18), rgba(211, 157, 54, .06));
  box-shadow: none;
}

.rc-city-nav {
  display: none;
  max-width: 1180px;
  margin: 0 auto 14px;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 7px;
  border: 1px solid var(--rc-line);
  border-radius: 14px;
  background: rgba(16, 18, 21, .86);
  scrollbar-width: none;
}

.rc-city-nav::-webkit-scrollbar {
  display: none;
}

body:is([data-scene="city"], [data-scene="campaign"], [data-scene="market"], [data-scene="world"], [data-scene="event"], [data-scene="dossier"]) .rc-city-nav {
  display: flex;
}

.rc-city-nav-title {
  padding: 0 10px;
  color: var(--rc-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.rc-city-nav .tab-button {
  min-width: max-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-color: transparent;
  background: transparent;
  font: 600 11px/1 'Roboto Slab', Georgia, serif;
  color: #aaa59d;
}

.rc-city-nav .tab-button:hover {
  transform: none;
  background: rgba(255, 255, 255, .045);
}

.rc-city-nav .tab-button.active {
  border-color: rgba(226, 183, 84, .28);
  color: #f0cd75;
  background: rgba(205, 148, 43, .13);
  box-shadow: none;
}

#gameShell > main,
#gameShell > #streetLog {
  width: 100%;
  max-width: 1180px;
  margin-right: auto;
  margin-left: auto;
}

#gameShell > main {
  margin-top: 0;
}

.view {
  animation: none;
}

.view > .mb-4:first-child {
  margin-bottom: 18px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid rgba(226, 190, 108, .13);
}

.view > .mb-4:first-child h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.view > .mb-4:first-child > p {
  max-width: 520px;
  color: #8f8a82;
  font-size: 12px;
  line-height: 1.55;
}

#missions > .mb-4:first-child,
#campaign > .mb-4:first-child,
#world > .mb-4:first-child,
#market > .mb-4:first-child,
#event > .mb-4:first-child,
#city > .mb-4:first-child,
#dossier > .mb-4:first-child,
#profile > .mb-4:first-child {
  min-height: 140px;
  align-items: flex-end;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(226, 190, 108, .2);
  border-radius: 16px;
  background-position: center;
  background-size: cover;
}

#missions > .mb-4:first-child {
  background-image: linear-gradient(90deg, rgba(8, 9, 11, .96), rgba(8, 9, 11, .58) 58%, rgba(8, 9, 11, .16)), url('assets/locations/missions-v103.webp');
}

#campaign > .mb-4:first-child,
#world > .mb-4:first-child,
#market > .mb-4:first-child,
#event > .mb-4:first-child,
#city > .mb-4:first-child,
#dossier > .mb-4:first-child {
  background-image: linear-gradient(90deg, rgba(8, 9, 11, .96), rgba(8, 9, 11, .58) 58%, rgba(8, 9, 11, .16)), url('assets/scenes/rep-city-v103.webp');
}

#profile > .mb-4:first-child {
  background-image: linear-gradient(90deg, rgba(8, 9, 11, .96), rgba(8, 9, 11, .58) 58%, rgba(8, 9, 11, .16)), url('assets/locations/headquarters-v103.webp');
}

#arenaClubPanel.scene-card::before {
  opacity: .45;
}

#familyContent > .panel:first-child {
  background-image: linear-gradient(90deg, rgba(8, 9, 11, .95), rgba(8, 9, 11, .64)), url('assets/locations/family-v103.webp');
  background-position: center;
  background-size: cover;
}

#home > .mt-4.grid {
  display: none;
}

.hq-hero {
  min-height: min(46vh, 430px);
  border-color: rgba(226, 188, 101, .22);
  border-radius: 18px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  background-image:
    linear-gradient(90deg, rgba(9, 10, 12, .96) 0%, rgba(9, 10, 12, .7) 44%, rgba(9, 10, 12, .12) 76%),
    linear-gradient(0deg, rgba(8, 9, 10, .9), transparent 62%),
    url('assets/locations/headquarters-v103.webp');
}

.hq-hero > div {
  min-height: min(40vh, 360px);
}

.hq-hero h2 {
  max-width: 600px;
  font-size: clamp(2.15rem, 5vw, 4.4rem);
}

.city-briefing {
  border-color: rgba(226, 190, 108, .15);
  border-radius: 14px !important;
  background: rgba(24, 25, 28, .88);
  box-shadow: none;
}

#arenaClubPanel {
  --scene-image: url('assets/scenes/red-hook-arena-v103.webp') !important;
}

.battle-city {
  background-image: url('assets/scenes/red-hook-arena-v103.webp');
}

.world-map {
  background-image:
    radial-gradient(circle at 32% 34%, rgba(43, 102, 108, .2), transparent 22%),
    radial-gradient(circle at 68% 55%, rgba(142, 66, 40, .22), transparent 26%),
    linear-gradient(rgba(5, 9, 10, .58), rgba(8, 7, 6, .88)),
    url('assets/scenes/rep-city-v103.webp');
}

.panel,
.hq-quiet-card {
  border-color: rgba(226, 190, 108, .16);
  background: linear-gradient(145deg, rgba(31, 32, 35, .94), rgba(18, 19, 21, .96));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.game-button {
  min-height: 44px;
  border-radius: 10px !important;
  box-shadow: 0 3px 0 #53330d;
}

button,
a,
input,
select,
summary {
  touch-action: manipulation;
}

#streetLog {
  margin-top: 18px;
  margin-bottom: 14px;
  opacity: .82;
  box-shadow: none;
}

#chatLauncher {
  right: 18px !important;
  bottom: 18px !important;
  min-width: 48px;
  min-height: 48px;
  padding: 0 16px !important;
  border-radius: 999px !important;
}

@media (max-width: 1360px) {
  .rc-sync,
  .rc-heat {
    display: none;
  }
}

@media (max-width: 960px) {
  :root {
    --rc-topbar: 62px;
    --rc-rail: 0px;
  }

  html {
    scrollbar-gutter: auto;
    scroll-padding-top: calc(var(--rc-topbar) + 10px);
  }

  #gameShell {
    width: 100%;
    padding: calc(var(--rc-topbar) + 10px) 10px calc(var(--rc-bottom-nav) + env(safe-area-inset-bottom) + 16px);
  }

  #desktopTitleBar,
  body.location-focus #desktopTitleBar {
    inset: 0 0 auto;
    min-height: var(--rc-topbar);
    height: var(--rc-topbar);
    gap: 4px;
    padding: 7px max(8px, env(safe-area-inset-right)) 7px max(8px, env(safe-area-inset-left));
  }

  #desktopTitleBar .rc-brand {
    display: none !important;
  }

  #desktopTitleBar .rc-hud,
  body.location-focus #desktopTitleBar > div.rc-hud:last-child {
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(52px, 1fr) minmax(60px, 1fr) minmax(52px, .85fr) 44px 44px !important;
    gap: 4px;
    padding: 0;
    overflow: visible;
  }

  body.location-focus #desktopTitleBar > div.rc-hud:last-child > .rc-profile-button,
  body.location-focus #desktopTitleBar > div.rc-hud:last-child > .rc-gold {
    display: inline-flex !important;
  }

  body.location-focus #desktopTitleBar > div.rc-hud:last-child > #accountBtn,
  body.location-focus #desktopTitleBar > div.rc-hud:last-child > #settingsBtn {
    grid-column: auto !important;
  }

  .rc-hud > * {
    min-width: 0;
    min-height: 44px;
    padding: 6px !important;
  }

  .rc-resource {
    flex-direction: column;
    gap: 1px;
    font-size: 10px;
    line-height: 1.05;
  }

  .rc-resource span {
    display: none;
  }

  .rc-resource strong {
    margin-left: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rc-cash::before,
  .rc-energy::before,
  .rc-gold::before {
    color: #a99b82;
    font-size: 10px;
  }

  .rc-cash::before { content: '$'; }
  .rc-energy::before { content: '⚡'; }
  .rc-gold::before { content: '◆'; }

  .rc-profile-button {
    width: 44px;
    font-size: 0;
    color: transparent !important;
  }

  .rc-profile-button span,
  .rc-profile-button b {
    display: none;
  }

  .rc-profile-button::before {
    content: '♠';
    color: #edc96e;
    font-size: 19px;
  }

  .rc-account-button {
    width: 44px;
    overflow: hidden;
    font-size: 0 !important;
    color: transparent !important;
  }

  .rc-account-button::before {
    content: '♟';
    color: #d4c28e;
    font-size: 18px;
  }

  #settingsBtn {
    width: 44px;
    font-size: 17px;
  }

  .rc-hp,
  .rc-heat,
  .rc-sync {
    display: none;
  }

  .rc-primary-nav {
    inset: auto 0 0;
    width: auto;
    height: calc(var(--rc-bottom-nav) + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-content: start;
    gap: 2px;
    padding: 5px max(5px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(5px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid var(--rc-line);
    background: rgba(10, 12, 14, .97);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, .3);
    backdrop-filter: blur(18px);
  }

  .rc-primary-nav .location-tab {
    min-height: 60px;
    gap: 4px;
    padding: 5px 2px;
    border-radius: 10px;
  }

  .rc-primary-nav .location-tab .screen-icon {
    width: 20px;
    height: 20px;
  }

  .rc-primary-nav .location-tab span {
    font-size: 9px;
  }

  body:is([data-scene="city"], [data-scene="campaign"], [data-scene="market"], [data-scene="world"], [data-scene="event"], [data-scene="dossier"]) .rc-city-nav {
    display: grid;
  }

  .rc-city-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 10px;
    padding: 5px;
    overflow: visible;
    border-radius: 12px;
  }

  .rc-city-nav-title {
    display: none;
  }

  .rc-city-nav .tab-button {
    min-width: 0;
    min-height: 42px;
    justify-content: center;
    gap: 4px;
    padding: 7px 4px;
    font-size: 9px;
  }

  .rc-city-nav .tab-button .screen-icon {
    width: 14px;
    height: 14px;
  }

  #chatLauncher {
    right: 12px !important;
    bottom: calc(var(--rc-bottom-nav) + env(safe-area-inset-bottom) + 10px) !important;
    width: 48px;
    padding: 0 !important;
    font-size: 18px;
  }

  #chatLauncher > span:not(#chatBadge) {
    display: none !important;
  }

  #chatBadge {
    position: absolute;
    top: -4px;
    right: -3px;
    margin: 0;
    font-size: 9px;
  }

  #home > .mt-4.grid {
    display: none;
  }

  .hq-hero {
    min-height: calc(100svh - var(--rc-topbar) - var(--rc-bottom-nav) - 124px);
    padding: 22px !important;
    background-image:
      linear-gradient(180deg, rgba(8, 9, 10, .08), rgba(8, 9, 10, .9) 58%, rgba(8, 9, 10, .98)),
      url('assets/locations/headquarters-v103.webp');
    background-position: 62% center;
  }

  .hq-hero > div {
    min-height: calc(100svh - var(--rc-topbar) - var(--rc-bottom-nav) - 170px);
    justify-content: flex-end !important;
  }

  .hq-hero h2 {
    font-size: clamp(2rem, 11vw, 3.4rem);
  }

  .city-briefing > div:last-child {
    grid-template-columns: 1fr;
  }

  .briefing-card {
    min-height: 82px;
    border-left: 0;
    border-top: 1px solid rgba(226, 190, 108, .12);
  }

  .briefing-card:first-child {
    border-top: 0;
  }

  .view > .mb-4:first-child {
    min-height: 112px;
    margin-bottom: 12px;
    padding: 18px;
  }

  .view > .mb-4:first-child > p {
    display: none;
  }

  #streetLog {
    margin-bottom: 8px;
  }
}

@media (max-width: 359px) {
  #gameShell {
    padding-right: 7px;
    padding-left: 7px;
  }

  #desktopTitleBar .rc-hud,
  body.location-focus #desktopTitleBar > div.rc-hud:last-child {
    grid-template-columns: 42px minmax(46px, 1fr) minmax(52px, 1fr) minmax(46px, .85fr) 42px 42px;
    gap: 2px;
  }

  .rc-hud > * {
    min-height: 42px;
    padding: 4px !important;
  }

  .rc-city-nav .tab-button {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 10px;
  }
}

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