/* HUD and screens, in the trailer's graphic language: navy news cards, BREAKING red, ink-outlined
   condensed type. Barlow Condensed stands in for DIN Condensed; Futura lettering is pre-rendered. */
@font-face { font-family: 'Barlow C'; src: url(../assets/fonts/barlow-condensed-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow C'; src: url(../assets/fonts/barlow-condensed-800.woff2) format('woff2'); font-weight: 800; font-display: swap; }

:root { --ink: #110c0a; --navy: rgba(14, 22, 44, .82); --red: #ce1126; --yellow: #ffd23f; --green: #46e678; --gold: #ffe296;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); }
#ui { position: fixed; inset: 0; pointer-events: none; font-family: 'Barlow C', 'DIN Condensed', 'Arial Narrow', sans-serif; color: #fff;
  font-weight: 600; letter-spacing: .02em; -webkit-font-smoothing: antialiased; }
#ui button { pointer-events: auto; font: inherit; cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; }
.ink { text-shadow: 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 6px 10px rgba(0,0,0,.45); }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; }
.screen.on { display: flex; }

/* ---------- HUD ---------- */
#hud { justify-content: flex-start; }
.hud-top { width: 100%; box-sizing: border-box; padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l)); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card { background: var(--navy); border: 1.5px solid rgba(255,255,255,.22); border-radius: 12px; padding: 6px 12px 7px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.card .lbl { font-size: 12px; color: #aab6cd; letter-spacing: .06em; }
.card .big { font-size: 34px; font-weight: 800; line-height: 1; margin-top: 1px; font-variant-numeric: tabular-nums; }
.card .chg { font-size: 16px; color: var(--green); font-weight: 800; }
.card.cargo { text-align: right; }
.card .big small { font-size: 18px; font-weight: 600; color: #cfd8e8; margin-left: 2px; }
.pips { display: flex; gap: 4px; justify-content: flex-end; margin-top: 4px; }
.pip { width: 15px; height: 9px; border-radius: 3px; background: #ff4b3a; border: 1.5px solid var(--ink); }
.pip.gone { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); }
.pip.free { background: var(--yellow); }
.bump { animation: bump .35s ease-out; }
@keyframes bump { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
.prog { width: calc(100% - 24px); max-width: 520px; margin-top: 8px; position: relative; height: 22px; }
.prog .bar { position: absolute; left: 0; right: 0; top: 9px; height: 5px; border-radius: 3px; background: rgba(14,22,44,.55); border: 1px solid rgba(255,255,255,.25); }
.prog .fill { position: absolute; left: 0; top: 9px; height: 7px; border-radius: 3px; background: linear-gradient(90deg, #ffe08a, #ff9d2e); }
.prog .ship { position: absolute; top: 2px; width: 22px; height: 18px; margin-left: -11px; font-size: 16px; line-height: 18px; text-align: center; filter: drop-shadow(0 1px 1px #000); }
.prog .end { position: absolute; top: -12px; font-size: 11px; color: #e6eef5; letter-spacing: .08em; }
#callout { position: absolute; left: 50%; top: 30%; width: min(78vw, 440px); transform: translate(-50%, -50%) scale(.2); opacity: 0; pointer-events: none; }
#callout.pop { animation: pop 1.5s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes pop { 0% { transform: translate(-50%,-50%) scale(.2); opacity: 0; } 14% { transform: translate(-50%,-50%) scale(1.06); opacity: 1; }
  24% { transform: translate(-50%,-50%) scale(1); } 78% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-58%) scale(.96); } }
#sub { position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); max-width: 86vw; text-align: center;
  font-size: 19px; background: rgba(10,12,18,.62); padding: 6px 14px 7px; border-radius: 10px; opacity: 0; transition: opacity .25s; }
#sub.on { opacity: 1; }
#sub .who { font-weight: 800; letter-spacing: .06em; margin-right: .2em; }
#sub .who.skipper { color: #ffb13d; } #sub .who.radio { color: #7fe0ff; }
#sub .who.admiral { color: #d2c4ff; } #sub .who.markets { color: #ff6b5e; }
#hint { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); font-size: 22px; font-weight: 800; opacity: 0; transition: opacity .4s; text-align: center; }
#hint.on { opacity: 1; }
#hint .hand { display: inline-block; animation: swipe 1.4s ease-in-out infinite; font-size: 30px; }
@keyframes swipe { 0%,100% { transform: translateX(-34px); } 50% { transform: translateX(34px); } }
/* with a mouse there is a keyboard: show the keys instead of the finger (W, S and Space are kept
   free for the Navy side) */
#hint .keys { display: none; white-space: nowrap; }
#hint kbd { display: inline-block; min-width: 1.6em; margin: 0 .12em 6px; padding: 0 .3em; font: inherit; font-size: 26px; line-height: 1.35;
  border: 2px solid #fff; border-bottom-width: 5px; border-radius: 7px; background: var(--navy); text-shadow: none; }
/* the condensed face has no arrows, so they are drawn at its weight */
#hint kbd svg { width: .8em; height: .8em; vertical-align: -.1em; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { #hint .touch { display: none; } #hint .keys { display: inline; } }
#flash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(255,40,20,0) 35%, rgba(255,30,10,.55) 100%); opacity: 0; transition: opacity .5s; }
#flash.on { opacity: 1; transition: none; }
#mute { position: absolute; right: calc(10px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); width: 40px; height: 40px; border-radius: 20px; background: rgba(14,22,44,.6); color: #fff; font-size: 19px; z-index: 5; }

/* ---------- title ---------- */
#title { background: linear-gradient(180deg, rgba(8,18,30,.72) 0%, rgba(8,18,30,.25) 38%, rgba(8,18,30,0) 55%, rgba(8,18,30,.55) 100%);
  padding-top: calc(4vh + var(--safe-t)); box-sizing: border-box; }
#title .logo { width: min(88vw, 560px); filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
#title .tag { font-size: clamp(18px, 5vw, 26px); font-weight: 800; margin-top: 2px; letter-spacing: .04em; }
.sides { margin-top: auto; margin-bottom: calc(66px + var(--safe-b)); display: flex; gap: 12px; width: min(92vw, 560px); }
.side { flex: 1; border-radius: 16px; padding: 12px 10px 14px; text-align: center; color: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.35); border: 3px solid var(--ink); }
.side .who { font-size: 30px; font-weight: 800; line-height: 1; }
.side .what { font-size: 15px; margin-top: 4px; opacity: .92; }
.side .go { display: inline-block; margin-top: 10px; padding: 6px 18px; border-radius: 20px; font-weight: 800; font-size: 20px; border: 2.5px solid var(--ink); background: var(--yellow); color: var(--ink); }
.side.smug { background: linear-gradient(180deg, #e8562f, #a5281c); }
.side.navy { background: linear-gradient(180deg, #5b6c7d, #2c3946); }
.best { position: absolute; bottom: calc(46px + var(--safe-b)); font-size: 15px; color: #eaf2f6; }
.ticker { position: absolute; left: 0; right: 0; bottom: var(--safe-b); height: 34px; display: flex; background: rgba(245,245,240,.94); overflow: hidden; }
.ticker .lab { background: var(--red); color: #fff; font-weight: 800; font-size: 20px; padding: 0 12px; line-height: 34px; flex: none; z-index: 1; }
.ticker .run { white-space: nowrap; color: #141418; font-size: 19px; line-height: 34px; padding-left: 16px; animation: tick 38s linear infinite; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- upgrade pick ---------- */
#upgrade { background: rgba(8,16,28,.62); justify-content: center; padding: 16px; box-sizing: border-box; }
#upgrade h2 { margin: 0; font-size: 40px; font-weight: 800; }
#upgrade .sub { font-size: 18px; color: var(--gold); margin-bottom: 14px; }
.picks { display: flex; flex-direction: column; gap: 10px; width: min(92vw, 420px); }
@media (min-aspect-ratio: 1/1) { .picks { flex-direction: row; width: min(92vw, 760px); } .pick { flex: 1; flex-direction: column; text-align: center; } }
.pick { display: flex; align-items: center; gap: 12px; text-align: left; background: #f6f1e4; color: var(--ink); border: 3px solid var(--ink); border-radius: 14px;
  padding: 10px 12px; box-shadow: 0 6px 0 var(--ink); transition: transform .08s; }
.pick:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.pick .ico { font-size: 38px; width: 50px; text-align: center; flex: none; }
.pick .nm { font-size: 23px; font-weight: 800; line-height: 1.05; }
.pick .ds { font-size: 16px; color: #3a3530; margin-top: 2px; }
.pick .lvl { font-size: 13px; color: #a5281c; font-weight: 800; }

/* ---------- result ---------- */
#result { background: rgba(8,16,28,.72); justify-content: center; padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(14px + var(--safe-b)) calc(12px + var(--safe-l)); box-sizing: border-box; gap: 12px; }
#result img.cardimg { max-width: min(92vw, 460px); max-height: calc(100% - 130px); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.5); border: 3px solid var(--ink); }
.btns { display: flex; gap: 10px; }
.btn { padding: 10px 20px; border-radius: 26px; font-size: 22px !important; font-weight: 800 !important; border: 3px solid var(--ink) !important; box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn.pri { background: var(--yellow); color: var(--ink); }
.btn.sec { background: #f6f1e4; color: var(--ink); }
#toast { position: absolute; left: 50%; top: calc(18px + var(--safe-t)); transform: translateX(-50%); background: rgba(14,22,44,.92); padding: 8px 16px; border-radius: 10px;
  font-size: 18px; opacity: 0; transition: opacity .3s; z-index: 9; text-align: center; max-width: 86vw; }
#toast.on { opacity: 1; }
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; background: #0a8c9a; z-index: 10; transition: opacity .5s; }
