/* FLOORSHIFT 3D v8.16.7 — core game shell, mobile navigation and immersive HUD. */
.core-mobile-menu-toggle,
.core-mobile-menu-backdrop { display: none; }
body.calloria-game-launch .core-mobile-menu-toggle,
body.calloria-game-playing .core-mobile-menu-toggle,
body.calloria-immersive .core-mobile-menu-toggle { display: none !important; }
body.calloria-game-launch:not(.calloria-game-playing) .world-title,
body.calloria-game-launch:not(.calloria-game-playing) .world-badge,
body.calloria-game-launch:not(.calloria-game-playing) .world-controls,
body.calloria-game-launch:not(.calloria-game-playing) .world-action-bar { display: none !important; }

@media (max-width: 760px) {
  .topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right));
  }
  .brand-lockup { flex: 1 1 auto; min-width: 0; }
  .core-mobile-menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 64px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid rgba(134, 222, 213, .3);
    border-radius: 10px;
    background: rgba(22, 61, 72, .76);
    color: #e9fffb;
    font: 800 9px Manrope, sans-serif;
    letter-spacing: .75px;
    cursor: pointer;
    touch-action: manipulation;
  }
  .core-mobile-menu-toggle span { font-size: 16px; line-height: 1; }
  .core-mobile-menu-toggle:focus-visible,
  .sidebar .nav-item:focus-visible,
  .immersive-exit:focus-visible,
  .touch-game-button:focus-visible,
  .station-action:focus-visible {
    outline: 3px solid #75e6d3;
    outline-offset: 2px;
  }
  .core-mobile-menu-backdrop {
    display: block;
    position: fixed;
    z-index: 88;
    inset: calc(60px + env(safe-area-inset-top)) 0 0;
    width: 100%;
    border: 0;
    background: rgba(1, 8, 14, .68);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  .core-mobile-menu-backdrop[hidden] { display: none !important; }
  .sidebar {
    position: fixed !important;
    z-index: 90 !important;
    top: calc(68px + env(safe-area-inset-top)) !important;
    right: auto !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    display: flex !important;
    flex: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    width: min(318px, calc(100vw - 24px)) !important;
    height: auto !important;
    max-height: calc(100dvh - 82px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0 !important;
    padding: 12px 10px max(12px, env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    border: 1px solid rgba(134, 222, 213, .22) !important;
    border-radius: 16px !important;
    background: rgba(5, 19, 30, .985) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55) !important;
    transform: translateX(calc(-100% - 18px));
    transition: transform .2s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(117, 230, 211, .38) transparent;
  }
  body.calloria-core-mobile-menu-open .sidebar { transform: translateX(0); }
  .sidebar .side-section-label {
    display: block !important;
    flex: 0 0 auto;
    padding: 12px 10px 6px !important;
    text-align: left !important;
    color: #76c5bd !important;
    font-size: 8px !important;
    letter-spacing: 1.35px !important;
  }
  .sidebar .side-section-label:first-child { padding-top: 4px !important; }
  .sidebar .side-section-label.side-gap { margin-top: 6px !important; }
  .sidebar .nav-item {
    display: flex !important;
    position: relative;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border-radius: 9px !important;
    text-align: left;
    white-space: normal !important;
    font-size: 11px !important;
    line-height: 1.25;
  }
  .sidebar .nav-item > span:not(.nav-icon):not(.nav-count) { flex: 1 1 auto; }
  .sidebar .nav-icon { flex: 0 0 24px; width: 24px !important; text-align: center; font-size: 17px !important; }
  .sidebar .nav-count { position: static !important; flex: 0 0 auto; margin-left: auto; }
  .sidebar .sidebar-bottom {
    display: block !important;
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 14px;
  }
  .sidebar .support-card { min-height: 58px; }
  .sidebar .version-label { padding: 8px 3px 0; }
  .topbar-center { display: none !important; }
  .profile-copy, .profile-chevron { display: none !important; }
  .brand-copy { min-width: 0; overflow: hidden; }
  .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .profile-chip { flex: 0 0 auto; }

  body.calloria-game-launch #gameLaunchScreen {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    gap: 12px;
  }
  body.calloria-game-launch .game-launch-top {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
  body.calloria-game-launch .game-launch-account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    max-width: 100%;
  }
  body.calloria-game-launch .game-account-button {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 8px;
  }
  body.calloria-game-launch .guest-badge { font-size: 7px; }
  body.calloria-game-launch .game-launch-copy { min-width: 0; }
  body.calloria-game-launch .game-launch-copy p { max-width: 44rem; font-size: 12px; line-height: 1.55; }
  body.calloria-game-launch .game-launch-actions { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; }
  body.calloria-game-launch .game-primary-button,
  body.calloria-game-launch .game-secondary-button { width: 100%; min-height: 48px; justify-content: center; }
  body.calloria-game-launch .guest-save-note { display: block; line-height: 1.5; }
  body.calloria-game-launch .game-launch-footer { display: grid; grid-template-columns: 1fr; gap: 10px; }
  body.calloria-game-launch .game-stats-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  body.calloria-game-launch .game-stat { min-width: 0; padding: 8px 5px; }
  body.calloria-game-launch .game-stat strong { font-size: clamp(15px, 5vw, 22px); }
  body.calloria-game-launch .game-stat span { font-size: 6px; line-height: 1.35; }
  body.calloria-game-launch .game-stat-status { grid-column: 1 / -1; font-size: 7px; }
  body.calloria-game-launch .game-sponsor-slot { padding: 10px 12px; }

  body.calloria-immersive .world-panel.is-immersive,
  .world-panel.is-immersive {
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
  }
  /* The keyboard movement reminder competes with touch controls on phones. */
  .immersive-bottomline { display: none !important; }
  .immersive-topline {
    z-index: 24;
    padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    align-items: center;
    gap: 8px;
  }
  .immersive-location { min-width: 0; }
  .immersive-location > div { display: grid; min-width: 0; gap: 3px; }
  .immersive-location strong { display: block; font-size: clamp(7px, 2vw, 9px); letter-spacing: .7px; }
  .immersive-location small { display: block; font-size: 6px; letter-spacing: .55px; }
  .immersive-exit { min-width: 76px; min-height: 44px; padding: 8px 10px; font-size: 8px; white-space: nowrap; }
  .touch-controls {
    display: flex !important;
    position: absolute;
    inset: 0;
    align-items: flex-end;
    justify-content: space-between;
    pointer-events: none;
    z-index: 22;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    align-items: flex-end;
  }
  .touch-joystick { width: clamp(104px, 30vw, 130px); height: clamp(104px, 30vw, 130px); }
  .touch-joystick-knob { width: 46px; height: 46px; left: calc(50% - 23px); top: calc(50% - 23px); }
  .touch-control-caption { font-size: 7px; }
  .touch-actions { gap: 8px; padding-bottom: 2px; }
  .touch-game-button.sprint { width: 56px; height: 56px; min-width: 56px; min-height: 56px; }
  .touch-game-button.interact { width: 68px; min-width: 68px; height: 74px; min-height: 74px; }
  .touch-look-caption { right: 26%; bottom: max(31px, calc(env(safe-area-inset-bottom) + 20px)); font-size: 6px; letter-spacing: .8px; }
  body.calloria-station-panel-open #stationHint,
  body.calloria-station-panel-open #mouseLookNote { display: none !important; }
  .station-panel {
    z-index: 28;
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    bottom: calc(174px + env(safe-area-inset-bottom)) !important;
    transform: none !important;
    width: auto !important;
    max-width: 520px;
    max-height: calc(100dvh - 236px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 13px;
    border-radius: 14px;
  }
  .station-panel-top { align-items: center; }
  .station-close { width: 42px; height: 42px; flex: 0 0 42px; }
  .station-panel h3 { font-size: 14px; line-height: 1.3; }
  .station-panel p { font-size: 10px; line-height: 1.5; }
  .station-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .station-action { min-width: 0; min-height: 64px; padding: 9px; gap: 4px; }
  .station-action b { font-size: 9px; line-height: 1.25; }
  .station-action small { font-size: 7px; line-height: 1.35; }
  .station-panel-actions { gap: 7px; }
  .station-panel-actions .station-action { min-height: 44px; }
  .station-hint {
    z-index: 27;
    bottom: calc(164px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 28px);
    padding: 9px 11px;
    font-size: 8px;
    line-height: 1.4;
  }
  .mouse-look-note { z-index: 29; min-height: 44px; max-width: calc(100vw - 32px); font-size: 8px; }
}

@media (max-width: 380px) {
  .brand-caption { display: none !important; }
  .core-mobile-menu-toggle { min-width: 58px; padding-inline: 8px; }
  body.calloria-game-launch .game-launch-copy h1 { font-size: clamp(32px, 9vw, 40px); }
  body.calloria-game-launch .game-launch-account { gap: 5px; }
  body.calloria-game-launch .game-account-button { padding-inline: 8px; }
  .station-panel { left: 8px !important; right: 8px !important; padding: 11px; }
  .station-grid { gap: 6px; }
}

@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .immersive-location > div { display: grid; min-width: 0; gap: 3px; }
  .immersive-location strong, .immersive-location small { display: block; }
  .touch-controls { display: flex !important; position: absolute; inset: 0; align-items: flex-end; justify-content: space-between; pointer-events: none; }
  .immersive-topline { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 5px; }
  .immersive-exit { min-height: 40px; }
  .touch-controls { padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .touch-joystick { width: 88px; height: 88px; }
  .touch-joystick-knob { width: 38px; height: 38px; left: calc(50% - 19px); top: calc(50% - 19px); }
  .touch-game-button.sprint { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
  .touch-game-button.interact { width: 58px; min-width: 58px; height: 60px; min-height: 60px; }
  .station-panel {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(116px + env(safe-area-inset-bottom)) !important;
    width: min(440px, calc(100vw - 20px)) !important;
    max-height: calc(100dvh - 225px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    transform: translateX(-50%) !important;
    padding: 10px;
  }
  .station-action { min-height: 48px; }
  .station-hint { bottom: calc(94px + env(safe-area-inset-bottom)); }
  .touch-look-caption { display: none; }
}


@media (pointer: coarse) and (min-width: 761px) and (min-height: 521px) {
  .touch-controls { display: flex !important; position: absolute; inset: 0; align-items: flex-end; justify-content: space-between; padding: 0 max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); pointer-events: none; z-index: 22; }
  .touch-joystick { width: 126px; height: 126px; }
  .touch-joystick-knob { width: 48px; height: 48px; left: calc(50% - 24px); top: calc(50% - 24px); }
  .touch-game-button.sprint { width: 62px; height: 62px; min-width: 62px; min-height: 62px; }
  .touch-game-button.interact { width: 74px; min-width: 74px; height: 80px; min-height: 80px; }
  .station-panel { top: auto !important; bottom: calc(190px + env(safe-area-inset-bottom)) !important; left: 50% !important; right: auto !important; width: min(520px, calc(100vw - 40px)) !important; max-height: calc(100dvh - 250px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); transform: translateX(-50%) !important; }
  .station-hint { bottom: calc(178px + env(safe-area-inset-bottom)); }
}

@media (pointer: coarse) {
  /* Keyboard-only instructions must not overlap touch HUD controls. */
  .immersive-bottomline { display: none !important; }
  body.calloria-station-panel-open #stationHint,
  body.calloria-station-panel-open #mouseLookNote { display: none !important; }
}

@media (min-width: 761px) {
  .core-mobile-menu-toggle, .core-mobile-menu-backdrop { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none !important; }
}

/* Keep the proximity hint and pointer-lock prompt out of the active station sheet. */
body.calloria-station-panel-open #stationHint,
body.calloria-station-panel-open #mouseLookNote { display: none !important; }
