/* Result, summary, pause, fleet and unlock screens (src/ui/result.js, summary.js,
   pause.js, fleet.js, unlock.js). Tokens, the column (.jcol), the card (.jcard), the
   float, .sbtn, .tlink and .jtabs come from ui.css. */

/* ---- what the scene shows behind these screens ---- */
body:is([data-screen="result"], [data-screen="summary"]) :is(.inst, .condChip, #ui .panel) { display: none; }
.ghud { transition: opacity .2s; }
body[data-screen="result"] .ghud { opacity: 0; pointer-events: none; }
body[data-screen="result"].playing .topright { display: flex; }      /* the wallet counts with the reward */

/* ---- the sheet of result and summary ---- */
.jcol.result { width: 460px; }
.rw .jcard.sheet { overflow: hidden; gap: 6px; }
.rw-mid { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 2px 6px; }
.rw-mid > * { flex: none; }
.rw h1.rw-head { margin: 0; font: 700 34px/40px var(--font); letter-spacing: -.015em; color: var(--ink); }
.rw h1.rw-head.bad { color: var(--bad); font-size: 24px; line-height: 30px; }
.rw-tip, .rw-line, .rw-cls, .rw-blurb { margin: 0; }
.rw-tip { padding: 10px 14px; border-radius: var(--r-2); background: var(--well); font-size: 14px; line-height: 20px; }
.rw-line, .rw-cls { color: var(--ink-2); font-size: 14px; line-height: 20px; }
.star { fill: none; stroke: var(--ink-3); stroke-width: 1.2; stroke-linejoin: round; }
.star.on { fill: var(--sun); stroke: var(--sun-ink); }
.rw-stars { display: flex; gap: 10px; margin-top: 4px; }
.rw-star { position: relative; display: inline-flex; }
.rw-star .star { width: 52px; height: 52px; }
.rw-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rw-cell { min-width: 0; display: flex; flex-direction: column; padding: 9px 12px; border-radius: var(--r-2); background: var(--well); }
.rw-cell small, .rw-label { font: 600 10.5px/14px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.rw-cell b { font: 600 18px/24px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rw-label { margin: 4px 0 -4px; }
.rw-score { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.rw-score b { font-weight: 700; font-variant-numeric: tabular-nums; }
.rw-score .tlink { padding: 0; }
.rw-details { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.rw-details[hidden] { display: none; }
.rw-details table { width: 100%; border-collapse: collapse; }
.rw-details td { padding: 2px 0; } .rw-details td:last-child { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.rw-details ul { list-style: none; margin: 6px 0 0; padding: 0; } .rw-details li { display: flex; align-items: center; gap: 8px; } .rw-details li.ok { color: var(--ink); }
.rw-details .star { width: 14px; height: 14px; flex: none; }
.rw-reward { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-radius: var(--r-2); background: var(--sun-soft); }
.rw-gain { display: inline-flex; align-items: center; gap: 5px; font: 700 18px/24px var(--font); color: var(--sun-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rw-gain .icoin { width: 18px; height: 18px; margin-right: 2px; }
.rw-note { margin-left: auto; font-size: 13px; line-height: 18px; color: var(--ink); text-align: right; }
.rw-note:first-child { margin-left: 0; text-align: left; color: var(--ink-2); }
.rw-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rw-events li { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; font-size: 13.5px; line-height: 20px; }
.rw-events i { display: grid; place-items: center; color: var(--sea); } .rw-events i .star { width: 16px; height: 16px; stroke: var(--sea); stroke-width: 1.6; }
.rw-events b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-events span { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.rw-goalhead { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.rw-goalhead b { color: var(--ink); font-weight: 600; }
.rw-goalnum { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; } .rw-goalnum.ok { color: var(--good); font-weight: 600; }
.rw-bar { position: relative; height: 6px; margin: 9px 30px 5px 0; border-radius: var(--r-pill); background: var(--well); }
.rw-fill { height: 100%; border-radius: var(--r-pill); background: var(--sea); transition: width .5s var(--e-out); }
.rw-bar.ok .rw-fill { background: var(--good); }
.rw-barend { position: absolute; right: -30px; bottom: -3px; width: 24px; height: 20px; display: flex; align-items: flex-end; justify-content: center; color: var(--ink-2); }
.rw-barend .sil { display: block; max-width: 100%; max-height: 100%; }
.rw-horizon { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; }
.rw-horizon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.rw-horizon b { font-weight: 600; }
.rw-btns { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rw-btns .sbtn { height: 44px; flex: none; }
.rw-btns .float { margin-left: auto; height: 48px; padding: 0 22px; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.rw-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rw-stack .sbtn { height: 44px; font-size: 15px; }
.rw-price { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 15px; }
.rw-price span { display: inline-flex; align-items: center; gap: 6px; } .rw-price b { font-weight: 700; font-variant-numeric: tabular-nums; } .rw-price .icoin { width: 16px; height: 16px; }
.rw .tlink.rw-leave { align-self: center; margin-top: 2px; }
.sbtn[disabled] { opacity: .5; cursor: default; }

/* the staged tally: a block appears at its --t; without .staging everything is simply there */
.rw.staging .st { animation: swell var(--d-3) var(--e-swell) both; animation-delay: var(--t, 0s); }
.rw.staging .rw-star.on .star { animation: rwPop .38s var(--e-swell) both; animation-delay: var(--t, 0s); }
.rw.staging .rw-star.on::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--sun); opacity: 0; animation: rwRing .7s var(--e-out) both; animation-delay: var(--t, 0s); pointer-events: none; }
@keyframes rwPop { from { transform: scale(.6); opacity: 0; } }
@keyframes rwRing { 0% { transform: scale(.5); opacity: 0; } 1% { opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }   /* invisible while it waits for its delay */

/* ---- the finish of a challenge: one banner in the middle, before the card ---- */
.rw .jcol[hidden] { display: none; }
.rw-finish { position: absolute; left: 50%; top: max(80px, 11vh); transform: translateX(-50%); min-width: 340px; box-sizing: border-box; padding: 16px 40px 18px; border-radius: var(--r-3); text-align: center; pointer-events: none; animation: rwBanner 520ms var(--e-swell) both; }
.rw-finish .kicker { justify-content: center; }
.rw .rw-finish h1 { margin: 4px 0 0; font: 700 52px/56px var(--font); letter-spacing: -.02em; color: var(--ink); }
.rw .rw-finish.calm h1 { font-size: 34px; line-height: 40px; }
.rw-ftime { margin: 2px 0 0; font: 600 28px/34px var(--font); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.rw-fstars { display: flex; justify-content: center; gap: 14px; margin-top: 8px; }
.rw-fstars .rw-star .star { width: 54px; height: 54px; }
.rw-finish .rw-star.on .star { animation: rwPop .42s var(--e-swell) both; animation-delay: var(--t, 0s); }
.rw-finish .rw-star.on::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--sun); opacity: 0; animation: rwRing .8s var(--e-out) both; animation-delay: var(--t, 0s); pointer-events: none; }
.rw-finish.out { animation: rwOut 300ms var(--e-in) forwards; }
@keyframes rwBanner { from { opacity: 0; transform: translate(-50%, 18px) scale(.96); } }
@keyframes rwOut { to { opacity: 0; transform: translate(-50%, -12px); } }
.rw-bar.rank { margin-right: 0; }

/* ---- pause: the one centred surface, on a light haze ---- */
#journey #scr-pause { justify-content: center; padding: 0; pointer-events: auto; background: var(--haze); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.rw-small { width: 360px; box-sizing: border-box; padding: 28px; border-radius: var(--r-3); pointer-events: auto; flex: none; animation: swell 180ms var(--e-swell) backwards; }

/* ---- unlock: the boat on the horizon ---- */
.rw-rise { --h: 176px; position: relative; height: var(--h); margin: 2px 0 8px; display: flex; justify-content: center; align-items: flex-end; border-bottom: 1px solid var(--ink-3); overflow: hidden; flex: none; }
.rw-rise .sil { position: relative; height: 80%; width: auto; max-width: 78%; color: var(--ink); animation: rwRise 700ms var(--e-swell) both; }
.rw-sun { position: absolute; left: 50%; bottom: 30px; width: 120px; height: 120px; margin-left: -130px; border-radius: 50%; background: var(--sun); opacity: .3; }
@keyframes rwRise { from { transform: translateY(24px); opacity: 0; } }

/* ---- fleet ---- */
.fl-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.fl-step { display: flex; align-items: center; gap: 8px; font: 600 13px/18px var(--font); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fl-step button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--sea-line); background: var(--sea-soft); color: var(--sea); cursor: pointer; }
.fl-step button:hover { background: var(--foam); box-shadow: var(--shadow-1); }
.fl-step button[disabled] { opacity: .35; cursor: default; background: transparent; box-shadow: none; }
.fl-step button:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.rw-fleet .jtabs { align-self: flex-start; margin: 6px 0 4px; }
.fl-body { display: flex; flex-direction: column; gap: 10px; }
.fl-body > * { flex: none; }
.fl-stars { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.fl-stars .star { width: 16px; height: 16px; } .fl-stars b { color: var(--ink); font-weight: 600; }
.fl-now { display: flex; align-items: center; gap: 8px; height: 52px; margin-top: 10px; font: 600 16px/1 var(--font); color: var(--good); }
.fl-reqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fl-reqs li { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-2); background: var(--well); font-size: 14px; line-height: 20px; }
.fl-reqs i { width: 18px; height: 18px; box-sizing: border-box; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--ink-3); }
.fl-reqs li.ok i { background: var(--good); border-color: var(--good); color: var(--solid); } .fl-reqs i .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.fl-reqs em { font-style: normal; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fl-reqs li.ok em { color: var(--good); }
.fl-short { font-size: 12px; line-height: 16px; color: var(--ink-3); text-align: center; white-space: nowrap; }
.fl-ups { display: flex; flex-direction: column; gap: 6px; }
.fl-up { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; padding: 10px 12px 10px 14px; border-radius: var(--r-2); background: var(--well); }
.fl-up.teased { background: transparent; border: 1px dashed var(--line); padding: 9px 11px 9px 13px; }
.fl-upname { display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 22px; } .fl-upname b { font-weight: 600; }
.fl-pips { display: inline-flex; gap: 4px; }
.fl-pips i { position: relative; width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--sea); overflow: hidden; }
.fl-pips i.on { background: var(--sea); }
.fl-pips i.new { background: linear-gradient(90deg, var(--sea) 50%, transparent 50%) 100% 0 / 200% 100%; animation: flWipe 300ms var(--e-out) forwards; }
@keyframes flWipe { to { background-position: 0 0; } }
.fl-tag { padding: 2px 8px; border-radius: var(--r-pill); background: var(--sun-soft); color: var(--sun-ink); font: 600 10.5px/14px var(--font); letter-spacing: .04em; white-space: nowrap; }
.fl-updetail { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.fl-updetail .ic { margin-top: 1px; }
.fl-updetail.flash { animation: flGood 1.4s var(--e-out); }
@keyframes flGood { 0%, 40% { color: var(--good); } }
.fl-upact { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.sbtn.confirm { background: var(--sea); border-color: transparent; color: var(--solid); }
.fl-fitted { color: var(--good); font-size: 13px; font-weight: 600; }
.fl-upnote { grid-column: 1 / -1; margin-top: 4px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--good); animation: swell var(--d-2) var(--e-out) backwards; }
.fl-later { margin: 2px 0 0; display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.fl-look { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fl-look > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: var(--r-2); background: var(--well); }
.fl-look small { font: 600 10.5px/14px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.fl-look b { font: 600 15px/22px var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-dots { display: flex; gap: 6px; height: 22px; align-items: center; }
.fl-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); box-sizing: border-box; }
.fl-line { display: flex; align-items: flex-end; gap: 2px; margin-top: 8px; border-bottom: 1px solid var(--ink-3); color: var(--ink-3); }
.fl-line .sil { flex: 1; min-width: 0; height: auto; margin-bottom: -4px; }

/* ---- fleet overview: every boat in order ---- */
#journey #scr-fleet .fl-over { width: min(1320px, calc(100vw - 2 * var(--gutter))); }
.fl-overtop { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.fl-overtop h2 { margin: 0; font: 700 24px/30px var(--font); letter-spacing: -.01em; }
.fl-count { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.fl-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }   /* eleven boats in two rows */
.fl-boat { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 10px 12px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--foam); color: var(--ink); font: inherit; text-align: left; box-sizing: border-box; }
:root[data-scene="dark"] .fl-boat { background: var(--well); }
button.fl-boat { cursor: pointer; transition: transform .18s var(--e-swell), box-shadow .18s, border-color .15s; }
button.fl-boat:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
button.fl-boat:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.fl-sea { display: flex; height: 84px; margin-bottom: 6px; border-radius: var(--r-1); background: linear-gradient(180deg, #cfe9f8 0%, #9fd0ee 62%, #4d9bd0 62%, #2f7fbd 100%); flex: none; }
:root[data-scene="dark"] .fl-sea { background: linear-gradient(180deg, #1c3554 0%, #2a4d74 62%, #143352 62%, #0c2440 100%); }
.fl-sea .sil { width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(4, 30, 70, .35)); }
.fl-name { font: 600 15px/20px var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-cls { font-size: 12px; line-height: 16px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--ink-2); white-space: nowrap; }
.fl-meta .star { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.fl-badge, .fl-kick { position: absolute; top: 16px; padding: 4px 7px; border-radius: var(--r-pill); font: 700 9.5px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; box-shadow: var(--shadow-1); }
.fl-badge { right: 16px; background: var(--foam); color: var(--navy); }
.fl-kick { left: 16px; background: var(--sea); color: var(--solid); }
.fl-boat.next { border: 2px solid var(--sea); padding: 9px 9px 11px; }
.fl-boat.next .fl-sea { color: var(--navy); }
.fl-mini { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.fl-mini span { display: block; font-size: 11.5px; line-height: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-mini i { display: block; height: 4px; margin-top: 2px; border-radius: var(--r-pill); background: var(--well); overflow: hidden; }
.fl-mini i b { display: block; height: 100%; border-radius: var(--r-pill); background: var(--sea); }
.fl-mini li.ok i b { background: var(--good); }
.fl-done { margin-top: 8px; font: 600 12px/16px var(--font); color: var(--sea); } .fl-done.ok { color: var(--good); }
.fl-boat.far { background: transparent; border-style: dashed; color: var(--ink-2); }
.fl-boat.far .fl-sea { background: linear-gradient(180deg, rgba(11, 42, 69, .06) 0%, rgba(11, 42, 69, .10) 62%, rgba(11, 42, 69, .18) 62%, rgba(11, 42, 69, .24) 100%); color: #0b1a2b; }
:root[data-scene="dark"] .fl-boat.far .fl-sea { background: linear-gradient(180deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, .07) 62%, rgba(255, 255, 255, .11) 62%); color: #02070d; }
.fl-boat.far .fl-name { color: var(--ink-2); }
.fl-tease { display: flex; gap: 5px; align-items: flex-start; margin-top: 4px; font-size: 11.5px; line-height: 15px; color: var(--ink-3); }
.fl-tease .ic { width: 12px; height: 12px; margin-top: 1px; }

/* ---- a boat became available while sailing: one chip under the wallet, 4 s ---- */
.rw-notice { display: none; height: 32px; padding: 0 14px; align-items: center; font: 500 13px/1 var(--font); color: var(--ink); }
.rw-notice.show { display: inline-flex; animation: swell var(--d-3) var(--e-swell) backwards; }

/* ---- the level HUD: only what the level counts ---- */
.gh-top > .gh-clock:has(+ .gh-stats.hidden) { border-right: 0; padding-right: 24px; }
.gh-top > .gh-title { padding-right: 4px !important; border-right: 0; }
.gh-navtext .wind b { font-weight: 700; }
.gh-navtext > div { white-space: nowrap; } .gh-navtext small { width: 54px; }

@media (prefers-reduced-motion: reduce) {
  .rw.staging .st, .rw.staging .rw-star.on .star, .rw.staging .rw-star.on::after, .rw-finish, .rw-finish .rw-star.on .star, .rw-finish .rw-star.on::after, .rw-small, .rw-rise .sil, .fl-pips i.new, .fl-upnote, .rw-notice.show { animation: none; }
  .fl-pips i.new { background: var(--sea); }
  .rw-fill { transition: none; }
}
/* 1280 x 720 and smaller */
@media (max-width: 1340px), (max-height: 800px) {
  .jcol.result { width: 420px; }
  .rw .rw-finish h1 { font-size: 44px; line-height: 48px; } .rw-fstars .rw-star .star { width: 46px; height: 46px; } .rw-finish { top: 72px; padding: 12px 36px 14px; } .rw-ftime { font-size: 24px; line-height: 30px; }
  .rw h1.rw-head { font-size: 28px; line-height: 34px; }
  .rw-star .star { width: 44px; height: 44px; }
  .rw-cell { padding: 5px 10px; } .rw-cell b { font-size: 16px; line-height: 20px; }
  .rw-mid { gap: 8px; }
  .rw-btns { margin-top: 8px; }
  .rw-rise { --h: 140px; }
  .rw-sun { width: 96px; height: 96px; margin-left: -104px; bottom: 24px; }
  .fl-up { padding: 7px 10px 7px 12px; } .fl-up.teased { padding: 6px 9px 6px 11px; }
  .fl-reqs li { padding: 6px 10px; }
  .fl-body { gap: 8px; }
  .fl-sea { height: 68px; }
  .fl-grid { gap: 8px; } .fl-boat { padding: 8px 8px 10px; } .fl-boat.next { padding: 7px 7px 9px; }
}
