/* HG_MOBILE_DIRECTOR_V1 */

.hg-mobile-director-dock,
.hg-mobile-director-cue,
.hg-director-close {
  display: none;
}

@media (min-width: 0px) {
  html.hg-mobile-game-active .game-shell::before,
  html.hg-mobile-game-active .game-shell::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    content: "";
    pointer-events: none;
  }

  html.hg-mobile-game-active .game-shell::before {
    background: repeating-conic-gradient(
      from 2deg at 50% 49%,
      transparent 0deg 12deg,
      rgba(255, 255, 255, 0.2) 12.15deg 12.35deg,
      transparent 12.5deg 24deg
    );
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 360ms ease;
    -webkit-mask-image: radial-gradient(circle at 50% 49%, transparent 0 47%, #000 82%, transparent 100%);
    mask-image: radial-gradient(circle at 50% 49%, transparent 0 47%, #000 82%, transparent 100%);
  }

  html.hg-mobile-game-active[data-hg-camera-gait="run"] .game-shell::before {
    opacity: 0.055;
  }

  html.hg-mobile-game-active[data-hg-camera-gait="sprint"] .game-shell::before {
    opacity: 0.11;
    animation: hg-camera-rush 760ms ease-in-out infinite alternate;
  }

  html.hg-mobile-game-active .game-shell::after {
    background: radial-gradient(circle at 50% 47%, transparent 42%, rgba(8, 0, 0, 0.16) 100%);
    opacity: 0.28;
    transition: opacity 280ms ease, background 280ms ease;
  }

  html.hg-mobile-game-active[data-hg-camera-shot] .game-shell::after {
    background:
      linear-gradient(180deg, rgba(5, 0, 0, 0.68) 0 2.2%, transparent 2.4% 97.6%, rgba(5, 0, 0, 0.68) 97.8% 100%),
      radial-gradient(circle at 50% 47%, transparent 43%, rgba(202, 0, 18, 0.16) 100%);
    opacity: 0.82;
  }

  @keyframes hg-camera-rush {
    from { opacity: 0.07; transform: scale(1.01); }
    to { opacity: 0.12; transform: scale(1.055); }
  }

  html.hg-mobile-directed .game-shell {
    overflow: clip !important;
  }

  html.hg-mobile-directed #worldCanvas {
    cursor: default;
  }

  html.hg-mobile-directed .hud-top {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 6px;
    height: 48px;
    pointer-events: none;
  }

  html.hg-mobile-directed .hud-economy {
    display: none !important;
  }

  html.hg-mobile-directed .brand-lockup,
  html.hg-mobile-directed .identity-chip {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: rgba(3, 10, 8, 0.48);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
  }

  html.hg-mobile-directed .brand-mark,
  html.hg-mobile-directed .identity-chip img {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  html.hg-mobile-directed .hg-v2-locale {
    top: max(9px, env(safe-area-inset-top));
    right: auto;
    left: 50%;
    z-index: 420;
    min-height: 32px;
    padding: 3px;
    background: rgba(3, 10, 8, 0.52);
    transform: translateX(-50%);
    backdrop-filter: blur(12px);
  }

  html.hg-mobile-directed .hg-v2-locale button {
    min-width: 30px;
    min-height: 26px;
    padding-inline: 6px;
  }

  html.hg-mobile-directed #mobileMenu,
  html.hg-mobile-directed #characterCommand,
  html.hg-mobile-directed #commandDock,
  html.hg-mobile-directed .hg-camera-controls {
    display: none !important;
  }

  html.hg-mobile-directed #cityMapDock,
  html.hg-mobile-directed #streetChatDock {
    position: absolute;
    top: auto !important;
    right: 10px !important;
    bottom: max(86px, calc(env(safe-area-inset-bottom) + 78px)) !important;
    left: 10px !important;
    z-index: 46;
    width: auto !important;
    min-height: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(223, 241, 232, 0.2);
    border-radius: 22px;
    background: rgba(3, 11, 8, 0.78);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, calc(100% + 110px), 0) scale(0.98);
    transform-origin: center bottom;
    transition:
      transform 420ms cubic-bezier(0.2, 0.86, 0.2, 1),
      opacity 220ms ease,
      visibility 0s linear 420ms;
    backdrop-filter: blur(20px) saturate(1.1);
  }

  html.hg-mobile-directed #cityMapDock {
    height: min(43dvh, 350px) !important;
    grid-template-rows: 48px minmax(0, 1fr) 28px !important;
  }

  html.hg-mobile-directed #streetChatDock {
    height: min(39dvh, 322px) !important;
    grid-template-rows: 48px 30px minmax(0, 1fr) 48px !important;
  }

  html.hg-mobile-directed[data-hg-mobile-scene="map"] #cityMapDock:not(.hidden),
  html.hg-mobile-directed[data-hg-mobile-scene="chat"] #streetChatDock:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1);
    transition-delay: 0s;
  }

  html.hg-mobile-directed #cityMapDock::before,
  html.hg-mobile-directed #streetChatDock::before,
  html.hg-mobile-directed .game-panel::before {
    position: absolute;
    z-index: 8;
    top: 5px;
    left: 50%;
    width: 38px;
    height: 3px;
    border-radius: 999px;
    background: rgba(236, 246, 241, 0.34);
    content: "";
    transform: translateX(-50%);
  }

  html.hg-mobile-directed #cityMapDock > header,
  html.hg-mobile-directed #streetChatDock > header {
    position: relative;
    padding: 12px 52px 7px 12px;
    background: rgba(3, 10, 8, 0.58);
  }

  html.hg-mobile-directed #cityMapDock .map-actions {
    margin-right: 0;
  }

  html.hg-mobile-directed .hg-director-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 9;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(232, 246, 239, 0.16);
    border-radius: 11px;
    background: rgba(239, 248, 244, 0.06);
    color: #f5faf7;
    font: 500 23px/1 system-ui, sans-serif;
  }

  html.hg-mobile-directed #cityMapDock .hg-director-close {
    right: 84px;
  }

  html.hg-mobile-directed .game-panel {
    inset: auto 0 0 !important;
    width: 100vw !important;
    height: min(64dvh, 570px);
    border: 1px solid rgba(223, 241, 232, 0.2);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: rgba(4, 12, 9, 0.92);
    box-shadow: 0 -28px 90px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translate3d(0, 104%, 0) !important;
    transition: transform 420ms cubic-bezier(0.2, 0.86, 0.2, 1), opacity 200ms ease;
  }

  html.hg-mobile-directed .game-panel.open {
    opacity: 1;
    transform: translate3d(0, 0, 0) !important;
  }

  html.hg-mobile-directed .game-panel .panel-header {
    min-height: 66px;
    padding: 16px 16px 10px;
  }

  html.hg-mobile-directed .game-panel .panel-content {
    padding: 12px 14px max(22px, env(safe-area-inset-bottom));
  }

  .hg-mobile-director-dock {
    position: fixed;
    z-index: 410;
    right: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 54px);
    gap: 4px;
    padding: 5px;
    border: 1px solid rgba(230, 245, 237, 0.18);
    border-radius: 20px;
    background: rgba(3, 10, 8, 0.66);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
    transform: translateX(50%);
    transition: opacity 200ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(18px) saturate(1.16);
  }

  .hg-mobile-director-dock[hidden] {
    display: none !important;
  }

  .hg-mobile-director-dock button {
    display: grid;
    grid-template-rows: 24px 11px;
    place-items: center;
    gap: 2px;
    width: 54px;
    height: 52px;
    padding: 5px 2px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: rgba(239, 247, 243, 0.58);
  }

  .hg-mobile-director-dock button > span {
    font: 650 20px/1 system-ui, sans-serif;
  }

  .hg-mobile-director-dock button > small {
    font: 850 7px/1 system-ui, sans-serif;
    letter-spacing: 0.09em;
  }

  .hg-mobile-director-dock button[aria-pressed="true"] {
    background: #c8ff38;
    color: #07100d;
    box-shadow: 0 0 26px rgba(200, 255, 56, 0.24);
  }

  .hg-mobile-director-cue {
    position: fixed;
    z-index: 405;
    right: 10px;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 72px));
    left: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    padding: 10px 10px 10px 14px;
    overflow: hidden;
    border: 1px solid rgba(73, 215, 255, 0.44);
    border-radius: 18px;
    background: rgba(3, 11, 9, 0.72);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
    transition: opacity 180ms ease, transform 240ms ease;
    backdrop-filter: blur(18px) saturate(1.15);
  }

  .hg-mobile-director-cue[hidden] {
    display: none !important;
  }

  .hg-mobile-director-cue.is-yielding {
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
  }

  .hg-mobile-director-cue > span {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .hg-mobile-director-cue small {
    color: #49d7ff;
    font: 850 7px/1 system-ui, sans-serif;
    letter-spacing: 0.13em;
  }

  .hg-mobile-director-cue strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f6fbf8;
    font: 800 13px/1.15 system-ui, sans-serif;
  }

  .hg-mobile-director-cue em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(232, 243, 237, 0.58);
    font: 600 8px/1.2 system-ui, sans-serif;
    font-style: normal;
  }

  .hg-mobile-director-cue button {
    min-width: 88px;
    min-height: 46px;
    padding: 0 12px;
    border: 0;
    border-radius: 14px;
    background: #c8ff38;
    color: #07100d;
    font: 900 8px/1 system-ui, sans-serif;
    letter-spacing: 0.08em;
  }

  html.hg-mobile-directed .hg-v2-tour.is-coach .hg-v2-tour-card,
  html.hg-mobile-directed .hg-v2-tour.is-coach .hg-v2-tour-scrim {
    display: none !important;
  }

  html.hg-mobile-capture-active .hg-mobile-director-dock,
  html.hg-mobile-capture-active .hg-mobile-director-cue {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(50%, 20px);
  }

  html.hg-mobile-capture-active .hg-mobile-director-cue {
    transform: translateY(20px);
  }

  html.hg-mobile-capture-active .capture-command {
    right: 10px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    max-width: none;
    margin: 0;
    transform: none;
    min-height: 66px;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 42vw);
    border-radius: 18px;
    background: rgba(3, 11, 8, 0.76);
    backdrop-filter: blur(18px);
  }
}

@media (min-width: 721px) {
  html.hg-mobile-directed #cityMapDock,
  html.hg-mobile-directed #streetChatDock {
    right: 18px !important;
    bottom: 92px !important;
    left: auto !important;
    width: min(420px, calc(100vw - 36px)) !important;
  }

  html.hg-mobile-directed #cityMapDock {
    height: min(54vh, 460px) !important;
  }

  html.hg-mobile-directed #streetChatDock {
    height: min(52vh, 440px) !important;
  }

  html.hg-mobile-directed .game-panel {
    inset: 76px 18px 92px auto !important;
    width: min(520px, 44vw) !important;
    height: auto !important;
    border-radius: 24px;
    transform: translate3d(calc(100% + 40px), 0, 0) !important;
  }

  html.hg-mobile-directed .game-panel.open {
    transform: translate3d(0, 0, 0) !important;
  }

  .hg-mobile-director-cue {
    right: auto;
    left: 18px;
    width: min(460px, calc(100vw - 36px));
  }

  html.hg-mobile-capture-active .capture-command {
    right: auto;
    left: 50%;
    width: min(600px, calc(100vw - 36px));
    transform: translateX(-50%);
  }
}

@media (max-width: 380px) {
  .hg-mobile-director-dock {
    grid-template-columns: repeat(4, 50px);
  }

  .hg-mobile-director-dock button {
    width: 50px;
  }

  .hg-mobile-director-cue button {
    min-width: 78px;
    padding-inline: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.hg-mobile-game-active .game-shell::before {
    display: none;
  }

  .hg-mobile-director-dock,
  .hg-mobile-director-cue,
  html.hg-mobile-directed #cityMapDock,
  html.hg-mobile-directed #streetChatDock,
  html.hg-mobile-directed .game-panel {
    transition-duration: 0.01ms !important;
  }
}
