/* /flight-path/. Loads after /style.css and /play/play.css and reuses
   their tokens, header, buttons, difficulty rows and globe. */

/* Result colors from the Okabe-Ito palette, which stays distinct for the
   common kinds of color blindness. Each state also has its own pattern on
   the map, its own marker shape, and a word in the results list, so none of
   it depends on color alone. */
:root{
  --found:#0072B2;
  --missed:#E69F00;
  --wrong:#CC79A7;
  --endpoint:#8D98AA;
  --bad-text:#8E2356;
}

/* ---------- start screen ---------- */

/* Weak-spot memory: what is weighted, and the button that clears it */
.weak{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem 1.2rem;max-width:var(--measure);margin:1.4rem 0 0}
.weak-text{flex:1 1 20rem;margin:0;font-size:.93rem;color:var(--ink-soft)}
.weak-text:focus{outline:none}
.btn-small{padding:.4rem .9rem;font-size:.88rem}
.btn-small[hidden]{display:none}

/* ---------- globe layers ---------- */

.borders{fill:none;stroke:var(--ink);stroke-opacity:.35;stroke-width:.5;stroke-linejoin:round}
.shape{stroke:var(--ink);stroke-width:.7;stroke-linejoin:round}
.shape.endpoint{fill:var(--endpoint)}
.shape.plain{fill:var(--land)}
.shape.found{fill:var(--found)}
.shape.missed{fill:url(#hatch)}
.shape.wrong{fill:url(#dots)}
.hatch-bg{fill:var(--missed)}
.hatch-line{stroke:var(--ink);stroke-width:1.6}
.dots-bg{fill:var(--wrong)}
.dots-dot{fill:var(--ink)}

/* The route: a light line on a dark casing, so it reads over sea and land */
.arc-casing{fill:none;stroke:var(--ink);stroke-width:5;stroke-linecap:round;stroke-linejoin:round}
.arc.route-arc{stroke:var(--paper);stroke-width:2.2;stroke-dasharray:none}

.marker path{stroke-width:2;stroke-linejoin:round}
.marker.found path{fill:var(--found);stroke:var(--paper)}
.marker.missed path{fill:var(--missed);stroke:var(--ink)}
.marker.wrong path{fill:var(--wrong);stroke:var(--ink);stroke-width:1.5}

/* ---------- guessing ---------- */

.guess{max-width:600px;margin:1.4rem auto 0}
.guess-label{display:block;font-weight:500;margin:0 0 .4rem}
.guess-row{display:flex;gap:.6rem;align-items:flex-start}
.combo{position:relative;flex:1 1 auto;min-width:0}
.combo input{
  width:100%;
  min-height:44px;
  padding:.55rem .75rem;
  border:1px solid var(--ink);
  border-radius:2px;
  background:#fff;
  color:var(--ink);
  font:inherit;
}
.combo input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.suggestions{
  position:absolute;
  z-index:5;
  left:0;
  right:0;
  top:calc(100% + 2px);
  max-height:17.6rem;
  overflow-y:auto;
  margin:0;
  padding:.25rem 0;
  list-style:none;
  background:#fff;
  border:1px solid var(--ink);
  border-radius:2px;
  box-shadow:0 6px 18px rgba(19,35,60,.18);
}
.suggestions[hidden]{display:none}
.suggestions li{padding:.6rem .75rem;min-height:44px;cursor:pointer;line-height:1.4}
.suggestions li:hover{background:var(--paper)}
.suggestions li[aria-selected="true"]{background:var(--ink);color:var(--paper)}
.hint{margin:.5rem 0 0;font-size:.88rem;color:var(--ink-soft)}
.feedback{min-height:1.62em;margin:.6rem 0 0;font-weight:500}
.feedback.good{color:var(--accent)}
.feedback.bad{color:var(--bad-text)}

.tally{display:grid;grid-template-columns:1fr 1fr;gap:1rem 1.5rem;margin:1rem 0 0}
.tally-title{
  font-family:"IBM Plex Sans",system-ui,sans-serif;
  font-size:.88rem;
  font-weight:500;
  letter-spacing:normal;
  color:var(--ink-soft);
  margin:0 0 .4rem;
  padding:0;
  border:0;
}
.tally-none{margin:0;font-size:.93rem;color:var(--ink-soft)}
.chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:0;padding:0;list-style:none}
.chip{display:inline-flex;align-items:center;gap:.4rem;padding:.2rem .6rem;border:1px solid var(--rule);border-radius:2px;font-size:.93rem;background:#fff}

/* The small symbol in chips, the legend and the results list: the same
   shape and fill as the marker on the globe. */
.mark{display:inline-block;flex:none;width:.95rem;height:.95rem;border:1.5px solid var(--ink)}
.found .mark{background:var(--found);border-radius:50%;border-color:var(--found)}
.missed .mark{background:repeating-linear-gradient(45deg,var(--missed) 0 3px,var(--ink) 3px 4.5px);clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);border:0;width:1.05rem;height:1.05rem}
.wrong .mark{background:radial-gradient(circle,var(--ink) 0 1px,transparent 1.4px) 0 0/4px 4px,var(--wrong);border:0;clip-path:polygon(20% 0,50% 30%,80% 0,100% 20%,70% 50%,100% 80%,80% 100%,50% 70%,20% 100%,0 80%,30% 50%,0 20%)}

.controls .btn-quiet[hidden]{display:none}

/* ---------- results ---------- */

.results{max-width:600px;margin:1.6rem auto 0;padding:0}
.results-title{
  font-family:Spectral,Georgia,serif;
  font-weight:600;
  font-size:1.45rem;
  line-height:1.25;
  margin:0 0 .3rem;
  padding:0;
  border:0;
}
.results-title:focus{outline:none}
.results-title:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.results-km{margin:0 0 1rem;color:var(--ink-soft);font-variant-numeric:tabular-nums}
.legend{display:flex;flex-wrap:wrap;gap:.4rem 1.2rem;margin:0 0 1.2rem;padding:0;list-style:none;font-size:.88rem;color:var(--ink-soft)}
.legend li{display:inline-flex;align-items:center;gap:.4rem}
.results-sub{
  font-family:"IBM Plex Sans",system-ui,sans-serif;
  font-size:.93rem;
  font-weight:500;
  color:var(--ink-soft);
  margin:1.2rem 0 .3rem;
}
.result-list{margin:0;padding:0;list-style:none;border-top:1px solid var(--rule)}
.result-row{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:.75rem;
  padding:.55rem 0;
  border-bottom:1px solid var(--rule);
}
.result-name{font-family:Spectral,Georgia,serif;font-weight:600}
.result-status{font-size:.9rem;color:var(--ink-soft)}
.results-notes{margin:1rem 0 0;padding:.7rem .9rem;border-left:3px solid var(--rule);color:var(--ink-soft);font-size:.95rem}
.results-notes p{margin:0}
.results-notes p + p{margin-top:.4rem}
.results .end-actions{margin-top:1.6rem}

@media (max-width:640px){
  .tally{grid-template-columns:1fr}
  .guess-row .btn{flex:none}
}
