/* Moonfish Meadow: the field fills the screen; one slim row of controls sits at the bottom and steps back when idle. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; margin: 0; background: #03060f; overflow: hidden; overscroll-behavior: none; }
body { font: 13px/1.2 -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif; color: #dbe7ff; }

button, select, [role='button'], [role='slider'], input[type='range'] {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (pointer: coarse) {
  html { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
         -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
}

/* opened from the home screen, iOS can measure the page short */
@media (display-mode: fullscreen), (display-mode: standalone) { html, body { height: max(100%, 100vh); } }
html.ios-app, html.ios-app body { position: relative; height: var(--app-h, 100%); min-height: var(--app-h, 100%); }

.mm-layer { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
html.ios-app .mm-layer { position: absolute; }
#mm-canvas { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: grab; outline: none; }
#mm-canvas:active { cursor: grabbing; }
.mm-fail { display: grid; place-items: center; padding: 24px; box-sizing: border-box; text-align: center; }
.mm-fail[hidden] { display: none; }

.mm-bar {
  position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 5px; max-width: calc(100% - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)); box-sizing: border-box;
  background: rgba(6, 12, 26, 0.55); border: 1px solid rgba(160, 200, 255, 0.16); border-radius: 999px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: opacity 0.6s;
}
html.ios-app .mm-bar, html.ios-app .mm-toast { position: absolute; }
.mm-bar.mm-away { opacity: 0.16; }
.mm-bar.mm-away:hover { opacity: 1; }
.mm-btn, .mm-sel {
  height: 40px; min-width: 40px; box-sizing: border-box; margin: 0; padding: 0 14px; border: 0; border-radius: 999px;
  background: rgba(150, 190, 255, 0.1); color: inherit; font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
#mm-night[aria-pressed='true'] .mm-sun, #mm-night[aria-pressed='false'] .mm-moon { display: none; }
#mm-night[aria-pressed='false'] { background: rgba(255, 214, 130, 0.2); color: #ffe2a6; }
.mm-btn.mm-icon { padding: 0; width: 40px; }
.mm-btn[aria-pressed='true'] { background: rgba(70, 215, 255, 0.24); color: #9fecff; }
.mm-sel { min-width: 0; flex: 0 1 auto; padding: 0 30px 0 14px; -webkit-appearance: none; appearance: none; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.mm-sel:disabled { opacity: 0.4; cursor: default; }
.mm-sel option { color: #111; }
.mm-btn:focus-visible, .mm-sel:focus-visible { outline: 2px solid #6fdcff; outline-offset: 1px; }
@media (pointer: coarse) { :root .mm-sel { font-size: 16px; } }

.mm-toast {
  position: fixed; left: 50%; bottom: calc(68px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 32px); box-sizing: border-box; padding: 9px 14px; border-radius: 12px; text-align: center;
  background: rgba(6, 12, 26, 0.8); border: 1px solid rgba(160, 200, 255, 0.2);
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.mm-toast.mm-show { opacity: 1; }

/* the steering stick: it appears where the finger lands and goes when it lifts */
.mm-stick { position: fixed; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
html.ios-app .mm-stick { position: absolute; }
.mm-stick.mm-on { opacity: 1; }
.mm-stick::before { content: ''; position: absolute; left: -54px; top: -54px; width: 108px; height: 108px; box-sizing: border-box; border-radius: 50%;
  border: 1.5px solid rgba(190, 225, 255, 0.4); background: rgba(8, 16, 32, 0.22); }
.mm-stick i { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; background: rgba(170, 225, 255, 0.5); border: 1.5px solid rgba(220, 240, 255, 0.8); box-sizing: border-box; }
.mm-btn:disabled { opacity: 0.4; cursor: default; }

/* For now the game is the only thing on screen: the bar, the hints and the steering stick's picture are all hidden.
   (Everything still works: drag to swim, two fingers to look round, N for day or night, T to travel.)
   Delete this rule to bring them back. */
.mm-bar, .mm-toast, .mm-stick { display: none !important; }
