/* "Guess where they're going": the button, the picker and the My guesses page (see guess.js). */

/* On a Notable row: a round button under the star */
.hap-guess { position: absolute; top: 48px; right: 6px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
.hap-guess:hover { background: rgba(17,25,21,.06); color: var(--ink); }
.hap-guess.is-on { color: var(--cyan-t); background: var(--cyan-sub); }
.hap-row:has(.hap-guess) .item-happening .tx { padding-right: 34px; }

/* On the plane's page, under the title */
.guess-cta { display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); margin: 4px 16px 12px; padding: 11px 16px; border: 0; border-radius: 16px; background: var(--cyan-sub); color: var(--cyan-t); font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
button.guess-cta:hover { background: rgba(34,188,216,.26); }
.guess-cta.is-made { background: var(--card-tint); color: var(--ink-2); font-weight: 400; cursor: default; }
.guess-cta.is-made > svg { color: var(--cyan-t); flex-shrink: 0; }
.guess-cta span { flex: 1; min-width: 0; }
.guess-cta .link-btn { margin: 0; }

/* The picker: a card over the map */
.guess-sheet { position: fixed; inset: 0; z-index: 2800; display: grid; place-items: center; padding: 16px; background: rgba(17,25,21,.35); animation: guess-fade .15s ease-out; }
@keyframes guess-fade { from { opacity: 0; } }
.guess-card { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px; border-radius: 24px; background: var(--paper); box-shadow: 0 20px 60px rgba(10,24,20,.3); display: grid; gap: 14px; }
.guess-top { display: flex; align-items: flex-start; gap: 12px; }
.guess-top > div { flex: 1; min-width: 0; }
.guess-top h2 { font-size: 20px; line-height: 1.2; margin: 2px 0 2px; }
.guess-x { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--paper-2); cursor: pointer; }
.guess-face { width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: var(--card-tint); display: grid; place-items: center; font-weight: 700; color: var(--ink-2); }
.guess-face img { width: 100%; height: 100%; object-fit: cover; }
.guess-search input { width: 100%; height: 46px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 100px; background: var(--paper-2); font-size: 16px; outline: none; }
.guess-search input:focus { border-color: var(--cyan); background: #fff; }
.guess-results { display: grid; gap: 2px; }
.guess-results:empty { display: none; }
.guess-res, .guess-choice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 14px; background: none; text-align: left; cursor: pointer; }
.guess-res:hover { background: var(--paper-2); }
.guess-res .tx, .guess-choice .tx { flex: 1; min-width: 0; display: grid; }
.guess-res small, .guess-choice small { color: var(--ink-3); font-size: 13px; }
.guess-choice { background: var(--card-tint); cursor: default; padding: 14px; }
.guess-choice b { font-size: 17px; }
.guess-choice .link-btn { margin: 0; }
.guess-res-ic { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--cyan-t); font-size: 14px; }
.guess-note { padding: 4px 12px; }
.guess-save, .guess-map { width: 100%; }
.guess-mapbar { position: fixed; z-index: 2700; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; border-radius: 20px; background: var(--paper); box-shadow: 0 10px 30px rgba(10,24,20,.25); font-weight: 600; line-height: 1.3; max-width: min(560px, calc(100vw - 24px)); width: max-content; } /* the instructions can wrap onto two lines on a phone */
.guess-mapbar span { font-size: 14px; }
#map.is-guess-pick { cursor: crosshair; }
#map.is-guess-pick .leaflet-interactive, #map.is-guess-pick .leaflet-grab { cursor: crosshair; }

/* My guesses */
.guesses-page .guess-score { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.guesses-page .guess-score > div { display: grid; justify-items: center; padding: 10px 4px; border-radius: 14px; background: #fff; }
.guesses-page .guess-score b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.guesses-page .guess-score span { font-size: 12px; color: var(--ink-3); }
.guesses-page .guess-rules { margin-top: 8px; }
.guess-item { margin: 0 16px 12px; padding: 14px 16px; border-radius: 20px; background: var(--card-tint); display: grid; gap: 6px; }
.guess-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.guess-head .guess-face { width: 44px; height: 44px; }
.guess-head .tx { flex: 1; min-width: 0; display: grid; }
.guess-head .tx b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guess-head .tx small { color: var(--ink-3); font-size: 13px; }
.guess-pill { flex-shrink: 0; padding: 3px 10px; border-radius: 100px; font-size: 12.5px; font-weight: 600; }
.guess-pill.is-right { background: var(--green-sub); color: var(--green); }
.guess-pill.is-close { background: var(--amber-sub); color: var(--amber); }
.guess-pill.is-wrong { background: var(--red-sub); color: var(--red); }
.guess-pill.is-flying { background: var(--cyan-sub); color: var(--cyan-t); }
.guess-pill.is-lost { background: var(--paper-3); color: var(--ink-3); }
.guess-line { display: flex; gap: 10px; align-items: baseline; }
.guess-line > span { width: 74px; flex-shrink: 0; font-size: 13px; color: var(--ink-3); }
.guess-line b { font-weight: 600; }
.guess-line small { color: var(--ink-3); font-weight: 600; font-size: 12px; margin-left: 2px; }
.guess-off { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.guess-actions { display: flex; gap: 18px; }
.guess-actions .link-btn { margin: 2px 0 0; font-size: 13.5px; }
.guess-actions .link-btn.is-quiet { color: var(--ink-3); }

/* Phone: the search box turns into the "Mark here" bar, in the same place and width, and back again */
#finder { transition: opacity .18s ease; }
html.guess-picking #finder { opacity: 0; pointer-events: none; }
.guess-mapbar.is-morph { border-radius: 25px; background: #fff; border: 1px solid rgba(255,255,255,.6); box-shadow: 0 2px 8px rgba(28,48,30,.16); padding: 8px 8px 8px 16px; transform-origin: top center; animation: guess-morph .24s cubic-bezier(.2,.8,.2,1); }
.guess-mapbar.is-morph.is-leaving { animation: guess-unmorph .2s ease-in forwards; }
@keyframes guess-morph { from { clip-path: inset(0 0 calc(100% - 50px) 0 round 25px); } to { clip-path: inset(0 0 0 0 round 25px); } }
@keyframes guess-unmorph { from { clip-path: inset(0 0 0 0 round 25px); opacity: 1; } to { clip-path: inset(0 0 calc(100% - 50px) 0 round 25px); opacity: 0; } }
.guess-mapbar.is-morph span, .guess-mapbar.is-morph .guess-mapbar-btns { animation: guess-fade .24s ease; }
@keyframes guess-fade { from { opacity: 0; } to { opacity: 1; } }

/* iPad: the bar spans the map, words on the left and the buttons on the right */
.guess-mapbar.is-wide span { flex: 1; }
.guess-choice-pin { filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); cursor: grab; }
.guess-choice-pin:active { cursor: grabbing; }
/* A spot chosen: the card docks at the bottom (iPad: bottom right of the map), with the map left clear to drag the pin */
.guess-sheet.has-pin { background: none; pointer-events: none; place-items: end center; }
.guess-sheet.has-pin .guess-card { pointer-events: auto; box-shadow: 0 10px 34px rgba(10,24,20,.28); }
@media (min-width: 700px) { .guess-sheet.has-pin { place-items: end end; } }
/* motion.js animates the picker in and out (on the spring); the plain fade is for when it isn't there */
html.motion .guess-sheet { animation: none; }
.guess-sheet.is-leaving { pointer-events: none; }
