/*
 * Fly Pong court shell.
 * Copyright (c) 2026 Martial Systems LLC. All rights reserved.
 */

html, body.fly-pong {
  height: 100%;
  background: #120c08;
  overflow: hidden;
}

body.fly-pong {
  display: flex;
  flex-direction: column;
  touch-action: manipulation;
}

body.fly-pong .fly-wrap {
  flex: 1;
  min-height: 0;
  max-width: 1240px;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: 0.75rem;
}

body.fly-pong nav.site-nav {
  flex-shrink: 0;
}

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0.65rem 0 0.4rem;
  gap: 0.55rem;
}

.court-stack {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
}

.how-scroll {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 12, 8, 0.58);
  z-index: 6;
  padding: 0.4rem;
  overflow: auto;
}

.how-scroll[hidden] {
  display: none !important;
}

.how-scroll-inner {
  width: min(28rem, 100%);
  max-height: 100%;
  overflow: auto;
  background: #e4d09e;
  color: #4e0e0e;
  border: 4px solid #c69c38;
  box-shadow: 6px 6px 0 #050407, inset 0 0 0 3px #76561c;
  padding: 0.95rem 1.05rem 0.85rem;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
}

.how-scroll-inner h2 {
  margin: 0 0 0.45rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.how-scroll-inner p {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 700;
}

.how-scroll-inner .result-score {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.how-mute {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  margin: 0.15rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.how-mute input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #4e0e0e;
}

.how-scroll-inner button,
.how-actions button {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  color: #e6d2a8;
  background: #4e0e0e;
  border: 2px solid #c69c38;
  box-shadow: 2px 2px 0 #050407;
}

.how-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.fly-controls {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
}

.fly-controls button {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  color: #e6d2a8;
  background: #4e0e0e;
  border: 2px solid #c69c38;
  box-shadow: 2px 2px 0 #050407;
}

.fly-controls button:hover,
.fly-controls button:focus-visible {
  background: #c69c38;
  color: #120c08;
}

.court-stack #court {
  width: 100%;
}

#court {
  display: block;
  width: 100%;
  max-width: 1200px;
  height: auto;
  max-height: calc(100dvh - 11rem);
  aspect-ratio: 1200 / 720;
  background: #120c08;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  cursor: crosshair;
  border: 3px solid #333142;
  box-shadow: 4px 4px 0 #050407;
}

.fly-foot {
  flex-shrink: 0;
  margin-top: 0.35rem;
}

@media (max-width: 720px) {
  .fly-controls {
    display: flex;
  }
  #court {
    max-height: calc(100dvh - 16rem);
  }
}

@media (max-width: 520px) {
  body.fly-pong .fly-wrap {
    padding: 0.55rem 0.55rem 0.4rem;
  }
  .stage {
    justify-content: flex-start;
    margin-top: 0.4rem;
  }
  .fly-foot {
    font-size: 0.62rem;
  }
}

/* Phone landscape: court first. Hide the legal block and shrink chrome. */
@media (orientation: landscape) and (max-height: 520px) {
  body.fly-pong .fly-wrap {
    padding: 0.2rem 0.4rem 0.2rem;
    max-width: none;
  }
  body.fly-pong nav.site-nav {
    margin: max(4px, env(safe-area-inset-top)) 0 0;
    padding: 0.28rem 0.45rem;
    width: 100%;
    max-width: none;
    gap: 0.35rem;
  }
  body.fly-pong nav.site-nav a.nav-btn {
    font-size: 0.42rem;
    padding: 0.32rem 0.45rem;
  }
  body.fly-pong nav.site-nav a.nav-brand {
    display: none;
  }
  .fly-foot {
    display: none;
  }
  .fly-controls {
    display: flex;
    gap: 0.3rem;
  }
  .fly-controls button {
    min-height: 32px;
    font-size: 0.8rem;
    padding: 0.2rem 0.55rem;
  }
  .stage {
    margin: 0.2rem 0 0;
    gap: 0.25rem;
    justify-content: center;
  }
  .court-stack {
    width: auto;
    max-width: 100%;
  }
  .court-stack #court,
  #court {
    width: auto;
    height: calc(100dvh - 5.4rem);
    max-height: calc(100dvh - 5.4rem);
    max-width: 100%;
  }
  .how-scroll-inner {
    padding: 0.45rem 0.65rem 0.4rem;
  }
  .how-scroll-inner h2 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }
  .how-scroll-inner p,
  .how-mute {
    font-size: 0.8rem;
    min-height: 32px;
    margin-bottom: 0.2rem;
  }
  .how-scroll-inner button,
  .how-actions button {
    min-height: 32px;
    font-size: 0.8rem;
    padding: 0.2rem 0.55rem;
  }
}
