/* Engeekrillion, pixel-art edition (built from Fortnillion).
   A sunny 16-bit sky made from generated pixel art (public/art): clouds, the Battle Bus, the skydiver, the island.
   Pixelify Sans carries the pixel look for titles, prompts and numbers; Barlow does the small reading text.
   Panels stay dark navy so text always reads over the bright sky. Rarity colours are the loud part. */

:root {
  --display: 'Pixelify Sans', 'Courier New', monospace;
  --text: 'Barlow', 'Segoe UI', sans-serif;

  --sky-top: #3f8fe6;
  --sky-mid: #5fb0f2;
  --sky-low: #9fd6fb;
  --ink: #13223a;          /* panels */
  --paper: #eef2f7;        /* text */
  --muted: #aebbd0;
  --butter: #f1d36f;       /* the Ready up button */
  --butter-dark: #c7a944;
  --storm: #9a7ae6;

  /* rarity colours, one per academic rank (light centre / dark edge, like an item tile) */
  --t-common: #bebebe;      --t-common-d: #5f6166;
  --t-uncommon: #69bb1e;    --t-uncommon-d: #24661a;
  --t-rare: #3ab6f5;        --t-rare-d: #12508a;
  --t-epic: #c659ff;        --t-epic-d: #5a1c99;
  --t-legendary: #f58a35;   --t-legendary-d: #93400f;
  --t-mythic: #ffd23f;      --t-mythic-d: #9a6a0c;
  --t-exotic: #74ecff;      --t-exotic-d: #13798c;
  --t-fortnillion: #ff5fc8; --t-fortnillion-d: #5b2aa8;
  --t-miss: #66708a;        --t-miss-d: #2c3346;

  --suit: #e98a45;
  --pants: #2a3f6a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 400 17px/1.45 var(--text); color: var(--paper); background: var(--sky-mid); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--butter); outline-offset: 3px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- sky world ---------- */
.sky { position: fixed; inset: 0; overflow: hidden; background: linear-gradient(180deg, var(--sky-top), var(--sky-mid) 60%, var(--sky-low)); }
.world { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.world::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent 25%); pointer-events: none; }
.clouds img, .far img { position: absolute; height: auto; image-rendering: pixelated; pointer-events: none; }
.far { position: absolute; left: 0; right: 0; top: 0; will-change: transform; opacity: .55; filter: saturate(.8); }

.lore span { position: absolute; padding: 5px 9px; border-radius: 4px; font: 500 16px/1 var(--display); color: #fff; background: rgba(13, 30, 60, .45); white-space: nowrap; }
/* lore sits in the left margin, clear of the rarity labels on the right */
.lore span.l, .lore span.r { left: 1.5vw; max-width: 12vw; white-space: normal; line-height: 1.2; }

.lines { opacity: 0; transition: opacity var(--fade, 1800ms) ease-in; }
.lines.show { opacity: 1; }
.lines .line { z-index: 2; position: absolute; left: 14vw; right: 14vw; height: 0; border-top: 2px dashed color-mix(in oklab, var(--c), transparent 35%); transition: border-color .4s, box-shadow .4s; }
.lines .line b { position: absolute; right: 0; top: -26px; padding: 4px 10px 3px; border-radius: 4px 4px 0 0; font: 600 17px/1 var(--display); letter-spacing: .02em; color: #10131a; background: var(--c); opacity: .7; transition: opacity .4s; }
.lines .line.lit { border-top: 3px solid var(--c); box-shadow: 0 0 14px color-mix(in oklab, var(--c), transparent 55%); }
.lines .line.lit b { opacity: 1; }

.bus { position: absolute; top: 18px; left: 50%; width: 460px; translate: -64% 0; } /* the branch the apple hangs from */
.bus img { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.bus .bob { animation: bob 4s ease-in-out infinite; }
body.is-lobby .bus, body.is-lobby .far, body.is-lobby .clouds { visibility: hidden; } /* the lobby picture has its own bus and sky */
body.is-lobby .brand { visibility: hidden; }

.diver { position: absolute; z-index: 3; left: 50%; top: 0; width: 76px; height: 76px; translate: -50% 0; opacity: 0; }
.diver.on { opacity: 1; }
/* 4-frame sway from the sprite sheet */
.diver-sprite { width: 100%; height: 100%; background: url(/art/apple.png) 0 0 / 400% 100% no-repeat; image-rendering: pixelated; animation: flap 1.2s steps(1) infinite; }
@keyframes flap { 0% { background-position: 0% 0; } 25% { background-position: 33.333% 0; } 50% { background-position: 66.666% 0; } 75% { background-position: 100% 0; } }
.tag {
  position: absolute; top: 82px; left: 50%; translate: -50% 0; white-space: nowrap;
  padding: 5px 12px; border-radius: 8px; font: 600 19px/1.1 var(--display);
  background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--c, var(--paper)); box-shadow: 0 0 16px color-mix(in oklab, var(--c, transparent), transparent 60%);
  opacity: 0; transition: opacity .25s, border-color .4s;
}
.tag.on { opacity: 1; }

.island { position: absolute; z-index: 1; left: 0; right: 0; overflow: hidden; }
.island img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%); mask-image: linear-gradient(180deg, transparent, #000 22%); }

@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }

/* ---------- HUD ---------- */
.hud { position: fixed; top: var(--vv-top, 0px); left: 0; right: 0; display: flex; justify-content: flex-start; align-items: flex-start; padding: 18px 24px; z-index: 5; pointer-events: none; }
.brand { pointer-events: auto; font: 600 24px/1 var(--display); color: var(--paper); text-decoration: none; }
.alti { line-height: 1; padding: 8px 14px 9px; border-radius: 10px; background: rgba(19, 34, 58, .72); }
.alti-label { display: block; font: 500 13px/1 var(--text); color: var(--muted); margin-bottom: 4px; }
.alti b { font: 600 38px/1 var(--display); font-variant-numeric: tabular-nums; }
.alti-unit { font: 500 20px/1 var(--display); margin-left: 3px; color: var(--muted); }
.alti-score { display: block; font: 500 14px/1 var(--text); margin-top: 6px; color: var(--butter); }
body.is-lobby .alti { visibility: hidden; }

/* ---------- lobby: title, one line, Ready up ---------- */
.lobby {
  position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center;
  padding: max(6vh, 40px) 24px 0; text-align: center;
  background: url(/art/lobby.webp) center 35% / cover no-repeat; image-rendering: pixelated;
}
.lobby::after { /* dark ground strip behind the button, so it reads over the island */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34vh; z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(8, 18, 38, .78) 45%, rgba(8, 18, 38, .92));
}
.logo {
  margin: 0; font: 700 clamp(54px, 9vw, 112px)/1 var(--display); letter-spacing: .02em; color: #fff;
  text-shadow: 4px 0 0 #123a7a, -4px 0 0 #123a7a, 0 4px 0 #123a7a, 0 -4px 0 #123a7a, 6px 8px 0 #0b2550;
}
.pitch { margin: 18px 0 0; padding: 6px 14px; max-width: 30em; font: 500 18px/1.35 var(--display); color: #fff; background: rgba(13, 30, 60, .55); border-radius: 6px; }
.lobby .ready { margin-top: auto; }
.ready {
  min-width: 260px; padding: 16px 40px 15px; border: 0; border-radius: 6px;
  background: var(--butter); color: var(--ink); font: 600 30px/1 var(--display); letter-spacing: .01em;
  box-shadow: 0 6px 0 var(--butter-dark), 0 0 0 3px #0b2550;
  transition: transform .12s, box-shadow .12s, background .2s;
}
.ready:hover { background: #f5dc85; }
.ready:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--butter-dark), 0 0 0 3px #0b2550; }
.ready.small { min-width: 0; padding: 11px 26px 10px; font-size: 22px; }
.lobby-meta { min-height: 1.4em; margin: 16px 0 max(4vh, 22px); font-size: 15px; color: #d7e3f4; }
.ghost { padding: 10px 20px; border: 1px solid rgba(238, 242, 247, .22); border-radius: 6px; background: rgba(19, 34, 58, .4); font: 500 18px/1 var(--display); }
.ghost:hover { border-color: rgba(238, 242, 247, .45); }

/* ---------- question ---------- */
.ask { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100%); z-index: 4; pointer-events: none; }
.banner {
  position: absolute; top: 84px; left: 50%; translate: -50% 0; width: min(720px, 92vw); text-align: center;
  padding: 16px 24px 18px; border-radius: 14px; background: rgba(15, 27, 47, .94);
  box-shadow: 0 10px 30px rgba(5, 12, 25, .35); transition: opacity .35s, translate .35s;
}
.banner-count { margin: 0 0 6px; font: 500 14px/1 var(--text); color: var(--muted); }
.banner-prompt { margin: 0; font: 600 clamp(28px, 3.6vw, 40px)/1.1 var(--display); color: #fff; }
.dock {
  position: absolute; left: 50%; bottom: 24px; translate: -50% 0; width: min(620px, 94vw); pointer-events: auto;
  padding: 12px 12px 10px; border-radius: 16px; background: rgba(9, 16, 30, .92); border: 1px solid rgba(238, 242, 247, .08);
  box-shadow: 0 12px 36px rgba(3, 8, 18, .5); transition: opacity .35s, translate .35s;
}
.ask.falling .banner { opacity: 0; translate: -50% -16px; }
.ask.falling .dock { opacity: 0; translate: -50% 16px; pointer-events: none; }

.storm { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; padding: 2px 4px 0; }
.storm-label { font: 500 14px/1 var(--text); color: var(--muted); }
.storm-time { justify-self: end; font: 600 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.storm-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(238, 242, 247, .12); overflow: hidden; }
.storm-bar i { display: block; height: 100%; width: 100%; border-radius: 3px; background: var(--storm); transform-origin: left; will-change: transform; transition: background .4s; }
.storm.low .storm-bar i { background: #e0647a; }
.storm.low .storm-time { color: #f2a9b6; }

.answer { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
input {
  min-width: 0; padding: 14px 16px; border: 0; border-radius: 10px; background: #f4f6fa; color: var(--ink);
  font: 500 22px/1.1 var(--text);
}
input::placeholder { color: #8b96aa; }
input:focus { outline: 2px solid var(--butter); outline-offset: 0; }
input.suggested { background: #fff7da; }
.answer.shake { animation: shake .3s; }
.go { padding: 0 26px; border: 0; border-radius: 10px; background: var(--butter); color: var(--ink); font: 600 24px/1 var(--display); box-shadow: 0 4px 0 var(--butter-dark); }
.go:active { translate: 0 3px; box-shadow: 0 1px 0 var(--butter-dark); }
.feedback { min-height: 1.4em; margin: 8px 4px 0; font-size: 15px; color: var(--paper); }
.feedback:empty { display: none; }
.feedback b { color: var(--butter); font-weight: 600; }
.feedback kbd { font: 600 13px/1 var(--text); padding: 2px 6px; border-radius: 4px; background: rgba(238, 242, 247, .15); }

@keyframes shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }

/* ---------- reveal ---------- */
.reveal {
  position: fixed; left: 50%; top: 50%; translate: -50% -50%; z-index: 4; width: min(440px, 94vw); text-align: center;
  max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 10px; scrollbar-width: thin;
}
.card {
  --c: var(--t-miss); --cd: var(--t-miss-d);
  position: relative; display: grid; justify-items: center; align-content: end;
  height: 230px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(85% 75% at 50% 32%, color-mix(in oklab, var(--c), #fff 12%), var(--c) 30%, var(--cd) 95%);
  border: 3px solid color-mix(in oklab, var(--c), #fff 30%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 14px 36px color-mix(in oklab, var(--cd), transparent 40%);
  animation: drop-in .6s cubic-bezier(.2, .9, .3, 1);
}
.card::before { /* diagonal shine stripes, as on Fortnite item tiles */
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(120deg, rgba(255, 255, 255, .07) 0 18px, transparent 18px 40px);
}
.card > * { position: relative; }
.card-rarity { margin-bottom: 6px; padding: 3px 10px; border-radius: 4px; font: 600 15px/1.1 var(--display); letter-spacing: .03em; color: #10131a; background: color-mix(in oklab, var(--c), #fff 25%); }
.card-name { width: 100%; margin: 0; padding: 12px 14px 4px; font: 600 clamp(30px, 6vw, 42px)/1 var(--display); color: #fff; overflow-wrap: anywhere; background: linear-gradient(180deg, transparent, rgba(8, 12, 22, .55) 35%); }
.card-pts { width: 100%; padding: 2px 0 14px; font: 600 20px/1 var(--display); color: #fff; background: rgba(8, 12, 22, .55); }
.card.fortnillion { --c: var(--t-fortnillion); background: conic-gradient(from 210deg at 50% 38%, #ff5fc8, #ffd23f, #74ecff, #c659ff, #ff5fc8); border-color: #fff; }
.reveal-meta, .reveal-blurb { position: relative; margin: 0; padding: 0 16px; background: rgba(15, 27, 47, .9); }
.reveal-meta { margin-top: 14px; padding-top: 12px; border-radius: 12px 12px 0 0; font-weight: 500; }
.reveal-blurb { padding-bottom: 12px; margin-bottom: 12px; border-radius: 0 0 12px 12px; font-size: 15px; color: var(--muted); }
.ladder-wrap { margin: 0 auto 16px; text-align: left; border-radius: 12px; background: rgba(15, 27, 47, .9); padding: 8px 16px; }
.ladder-wrap summary { cursor: pointer; font: 500 15px/1.8 var(--text); color: var(--muted); }
.ladder { list-style: none; margin: 4px 0 4px; padding: 0; }
.ladder li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid rgba(238, 242, 247, .08); font-size: 15px; }
.ladder li span:first-child { color: var(--c); font: 500 16px/1.2 var(--display); }
.ladder li.me { color: var(--butter); }

@keyframes drop-in { from { opacity: 0; transform: translateY(-18px); } }

/* ---------- summary: a scrolling results page ---------- */
.summary { position: fixed; inset: 0; z-index: 6; overflow-y: auto; background: linear-gradient(180deg, rgba(27, 47, 78, .97), rgba(15, 27, 47, .98) 50%); }
.sum-col { width: min(540px, 92vw); margin: 88px auto 60px; }
.sum-kicker { margin: 0; font-size: 15px; color: var(--muted); }
.sum-score { display: flex; align-items: baseline; gap: 12px; }
.sum-score b { font: 600 clamp(64px, 14vw, 104px)/1 var(--display); }
.sum-score span { font: 500 26px/1 var(--display); color: var(--t-exotic); }

.share-preview {
  margin: 18px 0 10px; padding: 14px 16px; border-radius: 12px; background: rgba(238, 242, 247, .06);
  border: 1px solid rgba(238, 242, 247, .1); font: 500 16px/1.5 var(--text); white-space: pre-wrap; color: var(--paper);
}
.sum-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.sum-actions .ready { width: 100%; }
.sum-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

.block { margin-top: 30px; }
.block-title { margin: 0 0 12px; font: 600 24px/1 var(--display); }
.block-title span { margin-left: 8px; font: 400 14px/1 var(--text); color: var(--muted); }

.curve { width: 100%; height: 120px; display: block; }
.curve-axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; }
.better { margin: 10px 0 0; font: 600 22px/1.1 var(--display); color: var(--t-exotic); }

.droplog { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; height: 170px; padding-top: 16px; border-top: 1px solid rgba(238, 242, 247, .3); }
.droplog .col { position: relative; display: grid; justify-items: center; align-content: start; }
.droplog .stem { width: 3px; border-radius: 2px; background: linear-gradient(var(--c), color-mix(in oklab, var(--c), transparent 70%)); }
.droplog .dot { width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--c); border: 2px solid var(--paper); }
.droplog .n { position: absolute; bottom: -22px; font-size: 13px; color: var(--muted); }

.bearing { list-style: none; padding: 0; margin: 0; }
.bearing li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 12px; padding: 8px 10px; border-radius: 8px; opacity: .55; }
.bearing li b { font: 600 17px/1.3 var(--display); color: var(--c); }
.bearing li.me { opacity: 1; background: rgba(238, 242, 247, .07); }

.catch { list-style: none; padding: 0; margin: 0; }
.catch > li { border-top: 1px solid rgba(238, 242, 247, .12); }
.catch-row { width: 100%; display: grid; grid-template-columns: 1.6rem 1fr auto; gap: 10px; align-items: center; padding: 12px 4px; border: 0; background: none; text-align: left; }
.catch-row .num { font: 500 20px/1 var(--display); color: var(--muted); }
.catch-row .q { display: block; font-size: 14px; color: var(--muted); }
.catch-row .a { display: block; font: 600 24px/1.15 var(--display); color: var(--c); }
.catch-row .o { display: block; font-size: 14px; color: var(--muted); }
.catch-row .p { font: 600 26px/1 var(--display); color: var(--c); }
.catch-row .tog { margin-left: 6px; color: var(--muted); }
.all { padding: 4px 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips button { padding: 6px 10px; border: 0; border-radius: 6px; background: rgba(238, 242, 247, .07); font: 500 15px/1 var(--display); box-shadow: inset 0 -2px 0 var(--c, var(--paper)); }
.chips button.on { background: var(--paper); color: var(--ink); }
.all-search { width: 100%; padding: 9px 12px; font-size: 16px; margin-bottom: 8px; }
.all-list { list-style: none; padding: 0; margin: 0; max-height: 340px; overflow-y: auto; }
.all-list li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: baseline; padding: 7px 6px; border-top: 1px solid rgba(238, 242, 247, .06); }
.all-list li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.all-list .nm { font-weight: 500; }
.all-list .nt { display: block; font-size: 13px; color: var(--muted); }
.all-list .pt { font: 600 17px/1 var(--display); color: var(--c); }
.all-list li.gem { background: rgba(233, 115, 173, .1); border-radius: 6px; }
.all-list li.yours { box-shadow: inset 0 0 0 1px var(--butter); border-radius: 6px; }
.all-count { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

.logbook { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.logbook span { padding: 10px 12px; border-radius: 10px; background: rgba(238, 242, 247, .06); }
.logbook b { display: block; font: 600 30px/1 var(--display); }
.logbook small { font-size: 13px; color: var(--muted); }
.next-drop { margin: 10px 0 0; font-size: 15px; color: var(--butter); font-variant-numeric: tabular-nums; }
.rate { display: flex; gap: 8px; }
.rate button { width: 46px; height: 42px; border: 0; border-radius: 8px; background: rgba(238, 242, 247, .08); font: 600 20px/1 var(--display); }
.rate button.on { background: var(--butter); color: var(--ink); }
.suggest { margin-top: 16px; }
.suggest label { display: block; margin-bottom: 6px; color: var(--muted); }
.suggest-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.suggest input { font-size: 17px; padding: 10px 14px; }
.suggest-done { min-height: 1.2em; margin: 6px 0 0; color: var(--butter); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .hud { padding: 10px 12px; }
  .ask .banner { top: 62px; padding: 12px 16px 14px; width: 94vw; }
  .banner-prompt { font-size: 26px; }
  .dock { bottom: 10px; width: 96vw; }
  input { font-size: 19px; padding: 12px 14px; }
  .lobby { padding-top: 9vh; background-position: 62% 35%; }
  .bus { width: 300px; }
  .diver { width: 64px; height: 64px; }
  .tag { top: 70px; }
  .lines .line { left: 6vw; right: 6vw; }
  .lore { display: none; }
  .alti b { font-size: 30px; }
  .logbook { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body.is-lobby .lore, body.is-lobby .lines { display: none; }

.all-list .said { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.all-found { margin: 4px 0 10px; font-size: 15px; color: var(--muted); }
.all-found b { color: var(--paper); font-weight: 600; }
.reveal-meta { padding-bottom: 12px; margin-bottom: 14px; border-radius: 12px; font-size: 18px; }
.banner-hint { margin: 8px 0 0; font: 400 15px/1.3 var(--text); color: var(--muted); }
.lang-switch { pointer-events: auto; margin-left: auto; margin-right: 8px; padding: 7px 12px; border-radius: 8px; background: rgba(19, 34, 58, .72); color: var(--paper); font: 500 14px/1 var(--display); text-decoration: none; }
.lang-switch:hover { text-decoration: underline; }
.mute { pointer-events: auto; padding: 7px 12px; border: 0; border-radius: 8px; background: rgba(19, 34, 58, .72); color: var(--paper); font: 500 14px/1 var(--display); }
.mute[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; }

/* Numbers use Silkscreen: Pixelify Sans draws a 5 that reads like an S */
:root { --num: 'Silkscreen', 'Pixelify Sans', monospace; }
.alti b, .storm-time, .card-pts, .sum-score b, .logbook b, .catch-row .p, .catch-row .num, .curve-axis, .droplog .n,
.bearing li b, .rate button, .all-list .pt { font-family: var(--num); font-weight: 700; }
.alti-unit { margin-left: 6px; font-size: 15px; }
.sum-score b { letter-spacing: -.02em; }
.sum-score span { font-size: 22px; }
