/* style.responsive.css */

/* ==========================================================================
   OUTPOST: LAST WATCH — RESPONSIVE VIEWPORT

   This file owns viewport behavior, device orientation and collision safety.
   It intentionally does NOT skin buttons/panels.
   ========================================================================== */

html,
body {
  width: 100%;
  height: 100%;

  margin: 0;
  overflow: hidden;

  background: #05070a;
}

body {
  overscroll-behavior: none;
}

/* --------------------------------------------------------------------------
   FULL VIEWPORT STAGE
   -------------------------------------------------------------------------- */

#app {
  position: fixed;
  inset: 0;

  width: 100vw;
  height: 100vh;
  height: 100dvh;

  padding: 0;

  display: grid;
  place-items: center;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 50% 40%,
      #1b2028 0,
      #090c11 55%,
      #030406 100%
    );
}

#stage {
  position: relative;

  width: 100vw;
  height: 100vh;
  height: 100dvh;

  max-width: none;
  max-height: none;

  overflow: hidden;

  border-radius: 0;
  box-shadow: none;

  background: #080b10;

  isolation: isolate;
}

/* Logical game renderer is 960 × 540.
   The canvas fills the viewport; unusual ratios crop slightly rather than
   stretching the authored world. */

#game {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  display: block;

  touch-action: none;
  /* hide the OS pointer over the field — the in-game reticle is the aim cursor */
  cursor: none;
}

@media (min-aspect-ratio: 2/1) {
  #game {
    width: auto;
    min-width: 100%;
    height: 100%;

    left: 50%;
    right: auto;

    transform: translateX(-50%);
  }
}

@media (max-aspect-ratio: 4/3) and (orientation: landscape) {
  #game {
    width: 100%;
    height: auto;
    min-height: 100%;

    top: 50%;
    bottom: auto;

    transform: translateY(-50%);
  }
}

/* --------------------------------------------------------------------------
   FULLSCREEN BUTTON
   -------------------------------------------------------------------------- */

#fs-btn {
  position: fixed;

  top: 10px;
  right: 10px;

  z-index: 90;

  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border: 1px solid #3b3b44;
  border-radius: 8px;

  background: rgba(10, 13, 18, .72);

  color: #e9dfcb;

  cursor: pointer;

  font-size: 15px;
  line-height: 1;

  pointer-events: auto;
}

#fs-btn:hover {
  border-color: #e8a13a;
  color: #f5c36b;
}

/* --------------------------------------------------------------------------
   PORTRAIT ROTATE PROMPT
   -------------------------------------------------------------------------- */

#rotate-hint {
  display: none;
}

@media (orientation: portrait) and (max-width: 900px) {
  #rotate-hint {
    position: fixed;
    inset: 0;

    z-index: 9998;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 14px;

    padding: 30px;

    text-align: center;

    background:
      radial-gradient(
        circle at 50% 38%,
        #1a1f2b,
        #07090d 72%
      );

    color: #e9dfcb;
  }

  #rotate-hint .rot-ico {
    font-size: 54px;
    animation: rot-wig 1.9s ease-in-out infinite;
  }

  #rotate-hint b {
    font-size: 19px;
    letter-spacing: .5px;
  }

  #rotate-hint small {
    max-width: 26ch;

    color: #9e988b;

    font-size: 13px;
    line-height: 1.55;
  }

  #fs-btn {
    display: none;
  }
}

@keyframes rot-wig {
  0%,
  100% {
    transform: rotate(-12deg);
  }

  50% {
    transform: rotate(12deg);
  }
}

/* --------------------------------------------------------------------------
   GAMEPLAY CONTROL ZONE

   Quick-use lives on the LEFT/RIGHT edge rails (see arsenal injected CSS).
   Utility buttons stay in the corners: volley bottom-left; pause / sound /
   quit bottom-right; wall integrity bottom-centre.
   -------------------------------------------------------------------------- */

.ars-bar,
.ars-items {
  scrollbar-width: none;
}

.ars-bar::-webkit-scrollbar,
.ars-items::-webkit-scrollbar {
  display: none;
}

/* volley sits on the right under the arsenal rail; the wall gauge owns the left */
.volley-wrap {
  right: clamp(6px, 1.4vmin, 14px) !important;
  left: auto !important;
  bottom:
    calc(56px + max(0px, env(safe-area-inset-bottom, 0px))) !important;
}

.hud-bottom {
  left: clamp(10px, 1.8vmin, 16px) !important;
  bottom:
    max(
      12px,
      env(safe-area-inset-bottom, 0px)
    ) !important;
  transform: none !important;
}

#pause-btn {
  right: 12px !important;
  bottom:
    max(
      12px,
      env(safe-area-inset-bottom, 0px)
    ) !important;
}

.mute-btn {
  right: 54px !important;
  bottom:
    max(
      12px,
      env(safe-area-inset-bottom, 0px)
    ) !important;
}

/* bottom-right cluster, right to left: pause · sound · settings · quit.
   Tinted gold and given a larger glyph: at 12px the gear read as a smudge next
   to the emoji speaker and was easy to miss entirely. */
.settings-btn {
  right: 96px !important;
  bottom:
    max(
      12px,
      env(safe-area-inset-bottom, 0px)
    ) !important;
  font-size: 18px !important;
  line-height: 1 !important;
  color: #f5c36b !important;
  border-color: #7a5a2a !important;
}

.settings-btn:hover {
  color: #ffd98a !important;
  border-color: #e8a13a !important;
}

.ars-quit {
  right: 138px !important;
  left: auto !important;
  bottom:
    max(
      12px,
      env(safe-area-inset-bottom, 0px)
    ) !important;
}

/* --------------------------------------------------------------------------
   TABLET / SMALL LAPTOP
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .ars-dock {
    width:
      calc(100vw - 130px) !important;
  }

  .ars-w-body b,
  .ars-item-body b {
    max-width: 72px;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

/* --------------------------------------------------------------------------
   SHORT LANDSCAPE
   -------------------------------------------------------------------------- */

@media (max-height: 650px) and (orientation: landscape) {
  .modern-title-layout {
    justify-content: center;
  }

  .hero-tip {
    display: none;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .ars-dock {
    bottom: 48px !important;

    width:
      calc(100vw - 150px) !important;

    max-height: 82px;

    gap: 3px !important;
  }

  .ars-bar,
  .ars-items {
    justify-content: flex-start !important;
  }

  .ars-w,
  .ars-item {
    min-height: 30px;
  }

  .ars-w-body b,
  .ars-item-body b {
    font-size: 8px !important;
  }

  .ars-w-body small,
  .ars-item-body small {
    font-size: 7px !important;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .volley-wrap {
    right: 9px !important;
    left: auto !important;
    bottom: 50px !important;
  }

  #pause-btn {
    right: 9px !important;
    bottom: 8px !important;
  }

  .mute-btn {
    right: 47px !important;
    bottom: 8px !important;
  }

  /* settings must be re-spaced here too — without it the base 96px lands on
     top of the quit button on short landscape screens and the gear looks like
     it is missing entirely */
  .settings-btn {
    right: 85px !important;
    bottom: 8px !important;
  }

  .ars-quit {
    right: 123px !important;
    left: auto !important;
    bottom: 8px !important;
  }
}

/* --------------------------------------------------------------------------
   MODALS ON MOBILE
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  .screen {
    padding: 0;
  }

  .screen:not(.title-screen) .panel {
    width: 100vw;
    height: 100dvh;

    max-width: none;
    max-height: none;

    border: 0;
    border-radius: 0;

    padding:
      52px 16px
      calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .screen {
    padding: 5px;
  }

  .screen:not(.title-screen) .panel {
    width: min(860px, 98vw);
    max-height: calc(100dvh - 10px);

    padding: 36px 16px 12px;
  }

  .panel-title {
    margin: 3px 0 6px;
    font-size: 24px;
  }

  .panel-copy {
    margin-bottom: 9px;
  }
}

/* --------------------------------------------------------------------------
   SMALL TITLE SCREEN
   -------------------------------------------------------------------------- */

@media (max-width: 650px) {
  .event-brandbar {
    top: 8px;
    left: 10px;
    right: 10px;
  }

  .event-brand {
    height: 22px;
  }

  .event-build-label {
    font-size: 7px;
    letter-spacing: 1.4px;
  }

  /* centre the title column and use the full width — the desktop left-column +
     portrait layout wasted the right half and clipped the left edge on phones */
  /* full-width column (was 72vw left-clipped) + drop the decorative portrait */
  .modern-title-layout {
    width: 92vw;
    max-width: 460px;
    margin: 0 auto;
    justify-self: center;
    padding-left: 0;
  }

  /* the primary "Take the Watch" + "Shared Watch" pair is a 2-column grid on
     desktop; make it a single column on phones so the card can't run off-screen */
  .modern-title-layout .modern-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .modern-title-layout .multiplayer-card,
  .modern-title-layout .hero-play {
    width: 100%;
  }

  .warden-portrait {
    display: none;
  }
}
