/* Duck Adrift — neal.fun register: white panel, black 1px borders, Julius display,
   Roboto-Medium body, one accent (the duck's yellow), tiny hover physics. */

@font-face { font-family: Roboto; src: url("vendor/fonts/roboto-medium.woff2") format("woff2"); }
@font-face { font-family: Roboto; font-weight: 700; src: url("vendor/fonts/roboto-bold.woff2") format("woff2"); }
@font-face { font-family: RobotoLight; src: url("vendor/fonts/roboto-light.woff2") format("woff2"); }
@font-face { font-family: Julius; src: url("vendor/fonts/JuliusSansOne-Regular.woff2") format("woff2"); }

:root {
  --black: #000;
  --divider: rgb(189, 189, 189);
  --pill-gray: rgb(238, 238, 238);
  --track: rgb(219, 219, 219);
  --accent: #ffd337;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  color: var(--black);
  font-family: Roboto, sans-serif, system-ui, -apple-system, "Segoe UI", Ubuntu, Cantarell, "Noto Sans";
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- stage (full-bleed map) ---------- */
#stage { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; }
#map canvas { cursor: crosshair; }

/* bottom-center CTA pill (asteroid-launcher's "CLICK IMPACT LOCATION") */
#drop-pill {
  position: absolute; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  background: rgb(255, 255, 255); border-radius: 20px;
  padding: 10px 20px;
  font-family: Julius, sans-serif; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.04em;
  box-shadow: rgba(0, 0, 0, 0.15) 0 2px 8px;
  z-index: 5; pointer-events: none;
  transition: opacity 0.3s ease;
}
#drop-pill.gone { opacity: 0; }

/* ---------- dock (playback bar over the map) ---------- */
#dock {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(80px);
  width: min(480px, calc(100% - 32px));
  display: flex; align-items: center; gap: 14px;
  background: rgb(255, 255, 255); border-radius: 20px;
  box-shadow: rgba(0, 0, 0, 0.15) 0 2px 8px;
  padding: 9px 18px 9px 10px;
  z-index: 5; opacity: 0;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.35s ease;
}
#dock.show { transform: translateX(-50%) translateY(0); opacity: 1; }

#playpause {
  border: none; background: var(--black); color: #fff;
  width: 34px; height: 34px; border-radius: 100%;
  cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center;
}
@media (hover: hover) { #playpause:hover { transform: scale(1.033); } }

#clock {
  font-family: Julius, sans-serif; font-size: 13px;
  text-transform: uppercase; white-space: nowrap;
  min-width: 78px; text-align: right;
}

#scrub {
  flex: 1; cursor: pointer; height: 19px;
  -webkit-appearance: none; appearance: none; background: none;
}
#scrub::-webkit-slider-runnable-track {
  height: 7px; border-radius: 2px;
  background: linear-gradient(to right, var(--black) var(--fill, 0%), var(--track) var(--fill, 0%));
}
#scrub::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 19px; height: 19px; margin-top: -6px;
  border-radius: 100%; background: var(--black);
}
#scrub::-moz-range-track { height: 7px; border-radius: 2px; background: var(--track); }
#scrub::-moz-range-progress { height: 7px; border-radius: 2px; background: var(--black); }
#scrub::-moz-range-thumb { width: 19px; height: 19px; border-radius: 100%; background: var(--black); border: none; }

/* ---------- floating panel over the map ---------- */
#panel {
  position: absolute; top: 16px; left: 16px;
  width: 316px; max-height: calc(100% - 32px);
  overflow-y: auto;
  background: rgb(255, 255, 255); border-radius: 10px;
  box-shadow: rgba(0, 0, 0, 0.18) 0 4px 18px;
  display: flex; flex-direction: column;
  padding: 22px 20px 10px;
  z-index: 6;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}
#panel[data-state="playing"] {
  transform: translateX(-28px); opacity: 0; pointer-events: none;
}

.title {
  font-family: Julius, sans-serif; font-size: 27px; font-weight: 400;
  text-transform: uppercase; text-align: center; line-height: 1.25;
}

.tagline {
  font-family: RobotoLight, sans-serif;
  font-size: 15px; line-height: 1.55; text-align: center;
  color: rgb(51, 51, 51); margin: 12px 4px 0;
}

.hero { display: grid; place-items: center; margin: 14px 0 2px; }
.hero svg { width: 76px; height: 76px; animation: bob 3.2s ease-in-out infinite; }

.instruction {
  display: flex; align-items: center; gap: 12px;
  font-family: Julius, sans-serif; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.09em;
  text-align: center; opacity: 0.7;
  margin: 20px 0 4px;
}
.instruction::before, .instruction::after {
  content: ""; height: 1px; flex: 1;
  background: rgb(189, 189, 189);
}

#presets {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
  margin-top: 18px;
}
body:not(.ready) #presets { visibility: hidden; }
.spot {
  display: flex; align-items: center; gap: 8px;
  background: rgb(255, 255, 255);
  border: 1px solid var(--black); border-radius: 5px;
  padding: 8px 10px;
  font-family: Roboto, sans-serif; font-size: 13.5px; text-align: left;
  cursor: pointer;
  transition: transform 0.07s linear, box-shadow 0.07s linear;
}
@media (hover: hover) {
  .spot:hover { transform: scale(1.023); box-shadow: rgba(0, 0, 0, 0.11) 3px 6px 6px 0px; }
}
.spot:active { transform: scale(1.011); }
.spot .emoji { font-size: 16px; line-height: 1; }

/* results state */
#panel[data-state="done"] #panel-idle { display: none; }
#panel:not([data-state="done"]) #panel-results { display: none; }
#panel-results[hidden] { display: none; }


.results-label {
  font-family: Julius, sans-serif; font-size: 31px; font-weight: 400;
  text-transform: uppercase; text-align: center;
}
#result-headline {
  font-family: Julius, sans-serif; font-size: 21px; font-weight: 400;
  text-transform: uppercase; text-align: center; line-height: 1.4;
  margin: 22px 0 18px;
}
#result-rows { border-bottom: 1px solid var(--divider); }
.row {
  display: grid; grid-template-columns: auto 1fr; gap: 15px; align-items: center;
  border-top: 1px solid var(--divider);
  padding: 15px 0;
  font-size: 14px; line-height: 1.45em;
}
.row .row-icon { font-size: 20px; }
.row b {
  background: var(--pill-gray); border-radius: 2px; padding: 2px 5px;
  white-space: nowrap; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.row.hot b { background: var(--black); color: rgb(255, 255, 255); }

.panel-foot { margin-top: auto; padding-top: 18px; text-align: center; }
.footlink {
  background: none; border: none; cursor: pointer;
  font-family: RobotoLight, sans-serif; font-size: 13px;
  color: var(--black); opacity: 0.55; text-decoration: underline;
}
.footlink:hover { opacity: 1; }

/* ---------- toast ---------- */
#toast {
  position: absolute; left: 50%; top: 20px;
  transform: translateX(-50%);
  background: var(--black); color: rgb(255, 255, 255);
  border-radius: 3px; padding: 9px 14px;
  font-family: Julius, sans-serif; font-size: 13px; text-transform: uppercase;
  z-index: 7; opacity: 0; pointer-events: none;
  transition: opacity 0.2s linear;
}
#toast.show { opacity: 1; }

/* ---------- duck marker ---------- */
.duck { pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3)); }
.duck svg { position: relative; display: block; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob {
  0%   { transform: translateY(0) rotate(-2.5deg); }
  25%  { transform: translateY(-3px) rotate(0deg); }
  50%  { transform: translateY(-4.5px) rotate(2.5deg); }
  75%  { transform: translateY(-1.5px) rotate(0.5deg); }
  100% { transform: translateY(0) rotate(-2.5deg); }
}
.duck.dropping svg { animation: duckdrop 0.7s cubic-bezier(0.3, 0.8, 0.4, 1) 1, bob 3.2s ease-in-out 0.7s infinite; }
@keyframes duckdrop {
  0%   { transform: translateY(-46px) scale(1); opacity: 0; }
  38%  { transform: translateY(0) scale(1); opacity: 1; }
  55%  { transform: translateY(1px) scale(1.14, 0.84); }
  75%  { transform: translateY(-3px) scale(0.96, 1.05); }
  100% { transform: translateY(0) scale(1); }
}

/* ---------- about dialog ---------- */
#about {
  margin: auto; border: none; border-radius: 12px;
  max-width: min(480px, calc(100vw - 32px));
  padding: 26px 28px;
  box-shadow: rgba(0, 0, 0, 0.5) 0 0 15px;
  font-family: Roboto, sans-serif;
}
#about::backdrop { background: rgba(0, 0, 0, 0.55); }
#about h2 {
  font-family: Julius, sans-serif; font-size: 24px; font-weight: 400;
  text-transform: uppercase; text-align: center; margin-bottom: 14px;
}
#about p { font-size: 14px; line-height: 1.55; margin-bottom: 10px; }
#about a { color: var(--black); }
#about .fine { font-size: 12px; opacity: 0.6; }
#about-close {
  display: block; margin: 14px auto 0;
  background: rgb(255, 245, 217); border: 1px solid var(--black); border-radius: 5px;
  padding: 7px 12px; font-family: RobotoLight, sans-serif; font-size: 17px;
  cursor: pointer;
}
@media (hover: hover) { #about-close:hover { transform: scale(1.023); } }

/* ---------- responsive ---------- */
@media (max-width: 700px) {
  #panel {
    top: auto; left: 12px; right: 12px; bottom: 84px;
    width: auto; max-height: 48vh;
    padding: 16px 16px 8px;
  }
  #panel[data-state="playing"] { transform: translateY(28px); }
  .title { font-size: 21px; }
  .tagline { font-size: 14px; }
  .hero svg { width: 54px; height: 54px; }
  #dock { bottom: 14px; }
  #drop-pill { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .duck svg, .duck.dropping svg, .hero svg { animation: none; }
  #dock, #toast, #drop-pill { transition: none; }
}
