/* Fly Over Iceland — game styles
 * Step 1: full-screen canvas + boot status overlay.
 * HUD, joysticks, share button come in later steps.
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0e1a;
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  touch-action: none;
}

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* Boot overlay — fades out when scene is ready */
.boot-status {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  transition: opacity 600ms ease-out;
  z-index: 10;
}

.boot-status.hidden {
  opacity: 0;
}

.boot-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #c6ff00; /* MOI lime */
  margin-bottom: 8px;
}

.boot-sub {
  font-size: 14px;
  opacity: 0.7;
  letter-spacing: 0.05em;
}

/* Diagnostic lines — visible on every load so users (and Claude) can see
   which build loaded + which init step reached on mobile without devtools. */
.boot-diag {
  margin-top: 18px;
  font-size: 11px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: rgba(255, 255, 255, 0.75);
  text-align: left;
  max-width: 92vw;
  line-height: 1.55;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(198, 255, 0, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 55vh;
  overflow-y: auto;
}
.boot-diag > div {
  padding: 1px 0;
}
.boot-diag > div.diag-ok  { color: rgba(198, 255, 0, 0.88); }
.boot-diag > div.diag-err { color: #ff7b7b; font-weight: 600; }

@media (max-width: 600px) {
  .boot-title { font-size: 22px; }
  .boot-sub { font-size: 13px; }
  .boot-diag { font-size: 10px; }
}

/* ------- Topbar (back link + share) -------- */
.topbar {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 25;
  pointer-events: none;
}

.topbar-back,
.topbar-share {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 26, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
}
.topbar-back:hover,
.topbar-share:hover {
  background: rgba(10, 14, 26, 0.75);
  border-color: rgba(198, 255, 0, 0.35);
}
.topbar-arrow {
  font-size: 14px;
  color: #c6ff00;
  line-height: 1;
}
.topbar-share {
  font-weight: 600;
  color: #c6ff00;
}

/* ------- Attribution line -------- */
.attrib {
  position: fixed;
  bottom: 6px;
  right: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: auto;
  z-index: 15;
  letter-spacing: 0.01em;
  max-width: 70vw;
  text-align: right;
  line-height: 1.4;
}
.attrib a {
  color: rgba(198, 255, 0, 0.75);
  text-decoration: none;
}
.attrib a:hover { text-decoration: underline; }
@media (pointer: coarse) {
  .attrib { display: none; } /* touch stick labels occupy the bottom */
}

/* ------- HUD -------- */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  font-variant-numeric: tabular-nums;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
}

.hud-main {
  position: absolute;
  left: 24px;
  bottom: 24px;
  background: rgba(10, 14, 26, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 260px;
}

.hud-row {
  display: flex;
  gap: 22px;
}

.hud-item { display: flex; flex-direction: column; }

.hud-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  opacity: 0.55;
  margin-bottom: 2px;
}

.hud-value {
  font-size: 22px;
  font-weight: 600;
  color: #c6ff00;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.hud-throttle { margin-top: 10px; }

.hud-throttle-bar {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 3px;
}

#hud-throttle-fill {
  height: 100%;
  width: 0%;
  background: #c6ff00;
  transition: width 120ms linear;
}

.hud-region {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  background: rgba(10, 14, 26, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hud-help {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  opacity: 0.55;
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 90vw;
}

.hud.hidden { opacity: 0; transition: opacity 300ms; }

@media (max-width: 700px) {
  .hud-main {
    left: 12px;
    right: 12px;
    bottom: 160px;         /* clear the left joystick, including its label */
    padding: 9px 14px;
    min-width: 0;
    max-width: 100%;
  }
  .hud-row { gap: 14px; justify-content: center; }
  .hud-value { font-size: 18px; }
  .hud-help { display: none; }
  .hud-region {
    font-size: 10.5px;
    top: 52px;              /* below the topbar row */
    padding: 4px 11px;
    max-width: calc(100vw - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .attrib { display: none; }       /* too dense for small screens */
  .topbar-label { display: none; } /* show just the arrow for back button */
  .topbar-back { padding: 7px 10px; }
  .topbar-share { padding: 7px 12px; font-size: 11px; }
}

/* ------- Touch joysticks -------- */
.touch-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  display: none;
}
/* Show on coarse-pointer (touch) devices OR narrow viewports */
@media (pointer: coarse), (max-width: 700px) {
  .touch-controls { display: block; }
}

.stick {
  position: absolute;
  bottom: 18px;
  width: 130px;
  height: 130px;
  pointer-events: auto;
  touch-action: none;
  -webkit-touch-callout: none;
}
.stick-left  { left: 18px; }
.stick-right { right: 18px; }

.stick-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(10, 14, 26, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
  border-radius: 50%;
  background: rgba(198, 255, 0, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
  box-shadow: 0 3px 12px rgba(198, 255, 0, 0.35);
  transition: transform 40ms linear;
}

.stick-label {
  display: none; /* stick purpose is spatially obvious; labels crowd the UI */
}
