/* Mobile: landscape-only notice + small-screen sizing. Loaded last. */

/* ===== Rotate notice (same look as the YOU LOSE / wrong-way screen) ===== */
#orientation-guard {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #080e13ee;
  backdrop-filter: blur(6px);
  text-align: center;
  color: #f2f3e6;
  pointer-events: auto;
  touch-action: none;
  overflow: hidden;
  --accent-fg: #d7ff3e;
}
#orientation-guard[hidden] {
  display: none !important;
}
#orientation-guard > div {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(900px, 100%);
  text-shadow: 0 2px 12px #000b;
}
#orientation-guard .eyebrow {
  display: flex;
  justify-content: center;
  margin: 0;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.25em;
  line-height: 1.5;
  color: #d6e2cb;
}
#orientation-guard .operation-outcome-title {
  margin: 0;
  font:
    700 clamp(34px, 11vw, 64px) / 1 ReferenceHeading,
    sans-serif;
  letter-spacing: 0.055em;
  text-wrap: balance;
  text-shadow: 0 2px 20px #000;
}
#orientation-guard p {
  margin: 0;
  font:
    600 13px ReferenceUI,
    sans-serif;
  letter-spacing: 0.16em;
  color: #b3c6af;
}
#orientation-guard p.death-reason {
  color: #e8efdc;
  font-size: 14px;
}
.orientation-phone {
  position: relative;
  width: 44px;
  height: 78px;
  border: 3px solid #d7ff3e;
  border-radius: 9px;
  animation: orientation-turn 2.4s ease-in-out infinite;
}
.orientation-phone i {
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 14px;
  height: 3px;
  margin-left: -7px;
  border-radius: 2px;
  background: #d7ff3e;
}
@keyframes orientation-turn {
  0%,
  15% {
    transform: rotate(0);
  }
  55%,
  100% {
    transform: rotate(-90deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .orientation-phone {
    animation: none;
    transform: rotate(-90deg);
  }
}

/* ===== Rotate message under the boot loader ===== */
.atra-load-rotate {
  display: none;
  margin: 12px 0 0;
  font:
    700 11px / 1.4 Barlow,
    sans-serif;
  letter-spacing: 0.12em;
  color: #d7ff3e;
  align-items: center;
  gap: 8px;
}
html[data-portrait] #match-loading.atra-loader .atra-load-rotate {
  display: flex;
}
.atra-load-rotate .rotate-icon {
  flex: none;
  width: 12px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 3px;
  animation: orientation-turn 2.4s ease-in-out infinite;
}

/* ===== Small landscape screens: scale the whole UI layer ===== */
html[data-ui-scaled] {
  /* 1 virtual unit = 1 real unit / zoom (see js/game/ui-scale.js) */
  --ui-vw: calc(1vw / var(--ui-zoom));
  --ui-vh: calc(1vh / var(--ui-zoom));
  --ui-vmin: calc(1vmin / var(--ui-zoom));
  --ui-vmax: calc(1vmax / var(--ui-zoom));
}
html[data-ui-scaled] :is(#app, #match-loading, #toast) {
  zoom: var(--ui-zoom);
}

/* ===== Unsupported browser message (under the loader bar) ===== */
.atra-load-unsupported {
  display: none;
  margin: 12px 0 0;
  font:
    600 11px / 1.5 Barlow,
    sans-serif;
  letter-spacing: 0.06em;
  color: #f4f1e7;
}
.atra-load-unsupported b {
  display: block;
  margin-bottom: 2px;
  letter-spacing: 0.12em;
  color: #ff6b5a;
}
html[data-unsupported] #match-loading.atra-loader .atra-load-unsupported {
  display: block;
}
html[data-unsupported] .atra-load-rotate {
  display: none !important;
}
html[data-unsupported] #match-loading .load-percent {
  visibility: hidden;
}
html[data-unsupported] #match-loading .atra-load-tip {
  display: none;
}

/* ===== Small spinner beside the loading percentage ===== */
#match-loading .load-percent {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
#match-loading .load-percent::before {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid #f4f1e740;
  border-top-color: var(--accent-fg, #d7ff3e);
  border-radius: 50%;
  /* transform-only animation keeps spinning while the page is busy building */
  animation: load-spin 0.8s linear infinite;
}
@keyframes load-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  #match-loading .load-percent::before {
    animation-duration: 2.4s;
  }
}
