/* Android landscape shell. These rules activate only inside the packaged app. */
html.towcoon-mobile-app,
html.towcoon-mobile-app body,
html.towcoon-mobile-app #root {
  width: 100%;
  height: calc(var(--towcoon-vh, 1vh) * 100);
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html.towcoon-mobile-app input,
html.towcoon-mobile-app textarea,
html.towcoon-mobile-app [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

html.towcoon-mobile-app body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #0b1724;
}

html.towcoon-mobile-app .app,
html.towcoon-mobile-app .viewport,
html.towcoon-mobile-app .overlay-root {
  width: 100%;
  height: 100%;
  min-height: 0;
}

html.towcoon-mobile-app canvas {
  touch-action: none;
}

html.towcoon-mobile-app button,
html.towcoon-mobile-app select,
html.towcoon-mobile-app input {
  touch-action: manipulation;
}

html.towcoon-mobile-app .modal-backdrop,
html.towcoon-mobile-app .confirm-backdrop,
html.towcoon-mobile-app .guide-backdrop,
html.towcoon-mobile-app .achievements-backdrop,
html.towcoon-mobile-app .summary-backdrop,
html.towcoon-mobile-app .intro-backdrop {
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

html.towcoon-mobile-app .modal,
html.towcoon-mobile-app .confirm-box,
html.towcoon-mobile-app .guide,
html.towcoon-mobile-app .achievements-panel,
html.towcoon-mobile-app .summary,
html.towcoon-mobile-app .intro {
  max-height: calc(var(--towcoon-vh, 1vh) * 100 - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

html.towcoon-mobile-app .modal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: inherit;
}

html.towcoon-mobile-app .modal-head > button,
html.towcoon-mobile-app .icon-btn {
  min-width: 44px;
  min-height: 44px;
}

html.towcoon-mobile-app .action-bar {
  max-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 12px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

html.towcoon-mobile-app .action-bar::-webkit-scrollbar {
  display: none;
}

html.towcoon-mobile-app .action-bar > button {
  flex: 0 0 auto;
}

html.towcoon-mobile-app .request-card,
html.towcoon-mobile-app .daily-quest-card,
html.towcoon-mobile-app .operation-chain-card {
  content-visibility: auto;
  contain-intrinsic-size: 90px;
}

html.towcoon-mobile-app .boot-screen {
  padding: 20px max(24px, env(safe-area-inset-left));
}

@media (orientation: landscape) and (max-height: 600px) {
  html.towcoon-mobile-app .hud {
    gap: 3px !important;
    padding: max(4px, env(safe-area-inset-top)) max(84px, calc(env(safe-area-inset-right) + 76px)) 1px max(5px, env(safe-area-inset-left)) !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  html.towcoon-mobile-app .hud::-webkit-scrollbar {
    display: none;
  }

  html.towcoon-mobile-app .hud-card {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    column-gap: 3px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    padding: 4px 5px !important;
    border-radius: 10px !important;
  }

  html.towcoon-mobile-app .hud-card::before {
    width: 24px !important;
    height: 24px !important;
  }

  html.towcoon-mobile-app .hud-card .hud-label,
  html.towcoon-mobile-app .hud-card .hud-sub {
    font-size: 7px !important;
  }

  html.towcoon-mobile-app .hud-card .hud-value {
    font-size: 12px !important;
  }

  html.towcoon-mobile-app .action-bar {
    min-height: 44px !important;
    margin-top: 0 !important;
    padding: 2px !important;
    gap: 2px !important;
  }

  html.towcoon-mobile-app .action-bar > button,
  html.towcoon-mobile-app .action-bar > button[data-towcoon-nav-icon] {
    min-height: 40px !important;
    padding: 4px 8px !important;
    gap: 4px !important;
    font-size: 11px !important;
  }

  html.towcoon-mobile-app .action-bar > button[data-towcoon-nav-icon]::before,
  html.towcoon-mobile-app .action-bar > .tow-finance-nav[data-towcoon-nav-icon]::before {
    width: 25px !important;
    height: 25px !important;
    flex-basis: 25px !important;
  }

  html.towcoon-mobile-app .modal,
  html.towcoon-mobile-app .modal.wide,
  html.towcoon-mobile-app .guide,
  html.towcoon-mobile-app .summary {
    width: min(94vw, 940px) !important;
    padding: 14px 16px !important;
  }

  html.towcoon-mobile-app .modal-head {
    min-height: 46px;
    padding-bottom: 7px;
  }

  html.towcoon-mobile-app .modal-head h2 {
    font-size: 20px;
  }

  html.towcoon-mobile-app .requests-grid,
  html.towcoon-mobile-app .driver-hire-grid,
  html.towcoon-mobile-app .pricing-policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (orientation: portrait) {
  html.towcoon-mobile-app body::before {
    content: "↻";
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: grid;
    place-items: center;
    padding-bottom: 70px;
    color: #f6c344;
    background: #0b1724;
    font-size: 68px;
    font-weight: 900;
    pointer-events: auto;
    touch-action: none;
  }

  html.towcoon-mobile-app body::after {
    content: "TOWCOON yatay ekranda oynanır";
    position: fixed;
    inset: 52% 20px auto;
    z-index: 2147483647;
    color: #fff;
    text-align: center;
    font: var(--font-bold, 700) 18px/1.35 var(--font-body, "Nunito Sans", system-ui, sans-serif);
  }
}
