/* Flying Human: calm, quiet, dusk. Nothing on screen but the sky and the score. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #07060c;
  color: #f6ecdf;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#stage, #stage canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

[hidden] { display: none !important; }

/* The score */
#score {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(30px, 6vh, 52px);
  letter-spacing: 0.08em;
  color: rgba(255, 246, 232, 0.82);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* Panels: no box, just quiet type over the sky */
.panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 420px);
  max-height: 92vh;
  overflow: auto;
  text-align: center;
  padding: 24px;
  pointer-events: none; /* clicks fall through to the game (= flap)... */
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}
.panel button { pointer-events: auto; } /* ...except on the buttons */

#ready { top: 30%; }

h1 {
  margin: 0 0 10px;
  font-weight: 400;
  font-size: clamp(30px, 7vw, 54px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  /* letter-spacing adds space after the last letter too; nudge it back to centre */
  padding-left: 0.32em;
}

p { margin: 6px 0; }
.greeting { font-size: 20px; }
.account { font-size: 13px; opacity: 0.7; }
.hint { margin-top: 18px; font-size: 14px; opacity: 0.75; letter-spacing: 0.04em; }
.note { font-size: 12px; opacity: 0.65; }

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

button {
  font: inherit;
  font-size: 15px;
  color: #f6ecdf;
  background: rgba(12, 10, 18, 0.45);
  border: 1px solid rgba(246, 236, 223, 0.35);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
button:hover { border-color: rgba(246, 236, 223, 0.7); }
button:focus-visible { outline: 2px solid #ffc274; outline-offset: 2px; }
button.primary {
  background: rgba(255, 194, 116, 0.9);
  border-color: transparent;
  color: #1b1220;
}

/* After a run */
.final {
  font-size: clamp(54px, 12vh, 88px);
  line-height: 1;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.result { font-size: 15px; opacity: 0.85; min-height: 1.3em; }

.board {
  list-style: none;
  margin: 16px auto 4px;
  padding: 10px 14px;
  max-width: 320px;
  background: rgba(8, 6, 14, 0.42);
  border-radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  text-shadow: none;
}
.board:empty { display: none; }
.board li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 8px;
}
.board li.me { background: rgba(255, 194, 116, 0.22); }
.board .rank { width: 1.6em; text-align: right; opacity: 0.6; font-variant-numeric: tabular-nums; }
.board .name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board .name::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--dot, rgba(246, 236, 223, 0.4));
}
.board .pts { font-variant-numeric: tabular-nums; }

.file-note {
  position: fixed;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  width: min(92vw, 520px);
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.6);
  padding: 14px 18px;
  border-radius: 12px;
}
