@font-face { font-family: "Bebas Neue"; src: url(/fonts/bebas-neue.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto"; src: url(/fonts/roboto.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --navy: #1d4486;
  --blue: #2d5aa8;
  --mid: #4a7bc8;
  --light: #7ba3d9;
  --pale: #b3cce9;
  --wash: #e6eff8;
  --cream: #f6f1e7;
  --ink: #333;
  --muted: #5b6577;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(16 33 66 / .08), 0 12px 32px -8px rgb(16 33 66 / .22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  font: 300 17px/1.55 Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--wash);
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; color: var(--navy); letter-spacing: .02em; line-height: 1; margin: 0; }
h1 { font-size: clamp(48px, 9vw, 84px); }
h2 { font-size: clamp(36px, 6vw, 52px); }
h3 { font-size: 30px; }
strong { font-weight: 500; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Header */
.bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.brand { font-family: "Bebas Neue", sans-serif; font-size: 22px; letter-spacing: .06em; color: var(--navy); text-decoration: none; }
.link { background: none; border: 0; padding: 6px 2px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 400; }
.link:disabled { color: var(--light); cursor: default; text-decoration: none; }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 500; font-size: 17px; letter-spacing: .01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, .link:focus-visible, .tile:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--mid); outline-offset: 3px; }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 6px 16px -6px rgb(29 68 134 / .6); }
.btn.primary:hover { background: var(--blue); }
.btn.primary:disabled { background: var(--pale); color: #fff; box-shadow: none; cursor: default; }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--pale); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--light); }

main { flex: 1; display: flex; flex-direction: column; }
.screen { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 8px 20px 40px; }
.screen-head { text-align: center; max-width: 620px; margin: 8px auto 28px; }
.screen-head p { color: var(--muted); margin: 12px 0 0; }

/* Intro */
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding-top: 24px; }
.intro-art { position: relative; height: min(70svh, 600px); }
.intro-art img {
  position: absolute; width: 58%; height: auto; aspect-ratio: 2/3; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow); background: var(--pale);
}
.intro-art img:nth-child(1) { left: 21%; top: 0; z-index: 3; }
.intro-art img:nth-child(2) { left: 0; top: 10%; transform: rotate(-7deg); z-index: 2; }
.intro-art img:nth-child(3) { right: 0; top: 10%; transform: rotate(7deg); z-index: 1; }
.lede { font-size: 21px; margin: 18px 0 22px; color: var(--ink); }
.steps { padding: 0; margin: 0 0 18px; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 46px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff;
  font: 400 20px/32px "Bebas Neue", sans-serif; text-align: center;
}
.hint { color: var(--muted); font-size: 15px; margin: 0 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Sort */
.sort { display: flex; flex-direction: column; align-items: center; max-width: 520px; padding-top: 0; }
.progress { width: 100%; max-width: 400px; height: 6px; border-radius: 3px; background: var(--pale); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--navy); transition: width .3s ease; }
.count { margin: 8px 0 14px; color: var(--muted); font-size: 15px; }
.deck { position: relative; width: min(380px, 100%); height: calc(clamp(220px, 50svh, 480px) + 150px); }
.card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s ease;
}
.card.dragging { transition: none; cursor: grabbing; }
.card.behind { transform: translateY(10px) scale(.96); pointer-events: none; }
.card.behind2 { transform: translateY(20px) scale(.92); opacity: .7; pointer-events: none; }
.card .art { position: relative; flex: 1; min-height: 0; background: var(--pale); }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.card .body { padding: 16px 20px 20px; }
.card h3 { font-size: 38px; }
.card p { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.stamp {
  position: absolute; top: 18px; padding: 6px 14px; border-radius: 10px;
  font: 400 26px/1 "Bebas Neue", sans-serif; letter-spacing: .05em; color: #fff; opacity: 0; transition: opacity .1s;
}
.stamp.yes { left: 18px; background: var(--navy); }
.stamp.no { right: 18px; background: #5b6577; }
.sort-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(380px, 100%); margin-top: 18px; }
.choice { padding: 0 12px; }
.choice.no { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--pale); }
.choice.no:hover { box-shadow: inset 0 0 0 2px var(--light); }
.choice.yes { background: var(--navy); color: #fff; }
.choice.yes:hover { background: var(--blue); }
.sort-foot { display: flex; justify-content: space-between; align-items: center; width: min(380px, 100%); margin-top: 10px; font-size: 15px; color: var(--muted); }

/* Choose */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding-bottom: 120px; }
.tile {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; text-align: left;
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgb(16 33 66 / .08), 0 6px 16px -6px rgb(16 33 66 / .2);
  transition: transform .12s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile img { width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; display: block; background: var(--pale); }
.tile .name { display: block; padding: 8px 12px 10px; font: 400 22px/1.1 "Bebas Neue", sans-serif; color: var(--navy); letter-spacing: .03em; }
.tile .desc { display: none; }
.tile .rank {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: rgb(255 255 255 / .85); box-shadow: inset 0 0 0 2px var(--pale);
  font: 400 22px/34px "Bebas Neue", sans-serif; text-align: center; color: var(--navy);
}
.tile[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--navy), 0 8px 20px -6px rgb(29 68 134 / .5); }
.tile[aria-pressed="true"] .rank { background: var(--navy); color: #fff; box-shadow: none; }
.tile.full:not([aria-pressed="true"]) { opacity: .55; }
.sticky-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: rgb(255 255 255 / .92); backdrop-filter: blur(8px); box-shadow: 0 -8px 24px -12px rgb(16 33 66 / .25);
}
.picked { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; font-size: 15px; color: var(--muted); }
.picked .chip { background: var(--wash); color: var(--navy); padding: 4px 10px; border-radius: 999px; font-weight: 400; }

/* Results */
.results { max-width: 760px; }
.top5 { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.top5 li {
  display: grid; grid-template-columns: 132px 1fr auto; gap: 20px; align-items: center;
  background: #fff; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
}
.top5 img { width: 132px; height: 165px; object-fit: cover; border-radius: 12px; display: block; background: var(--pale); }
.top5 .num { font: 400 22px/1 "Bebas Neue", sans-serif; color: var(--mid); letter-spacing: .05em; }
.top5 h3 { font-size: 36px; margin: 2px 0 6px; }
.top5 p { margin: 0; font-size: 15px; color: var(--ink); }
.move { display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.move button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--wash); color: var(--navy); font-size: 18px; line-height: 1;
}
.move button:hover:not(:disabled) { background: var(--pale); }
.move button:disabled { opacity: .3; cursor: default; }
.also { margin: 24px 0 0; background: #fff; border-radius: var(--radius); padding: 16px 20px; }
.also summary { cursor: pointer; font-weight: 400; color: var(--navy); }
.also-list { margin: 10px 0 0; color: var(--ink); }

.send { margin: 32px 0 0; background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.send p { margin: -6px 0 4px; color: var(--muted); }
.send label { display: grid; gap: 6px; font-weight: 400; color: var(--ink); }
.send .opt { color: var(--muted); font-weight: 300; }
.send input, .send textarea {
  font: inherit; font-weight: 300; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--pale); background: #fbfcfe; color: var(--ink);
}
.send input:focus, .send textarea:focus { border-color: var(--mid); outline: none; }
.send .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin: 0; min-height: 1.5em; }
.form-msg.ok { color: var(--navy); font-weight: 400; }
.form-msg.err { color: #9b2c2c; }
.send.sent { background: var(--navy); }
.send.sent h3, .send.sent p, .send.sent .form-msg { color: #fff; }
.after { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }

@media (max-width: 820px) {
  .intro { grid-template-columns: 1fr; gap: 24px; padding-top: 0; }
  .intro-art { height: 260px; max-width: 300px; width: 100%; margin: 0 auto; }
  .intro-art img { width: 50%; }
  .intro-art img:nth-child(1) { left: 25%; }
  .intro-copy { text-align: left; }
  .lede { font-size: 19px; }
}
@media (max-width: 560px) {
  .top5 li { grid-template-columns: 84px 1fr auto; gap: 12px; padding: 10px; }
  .top5 img { width: 84px; height: 112px; }
  .top5 h3 { font-size: 30px; }
  .top5 p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .send { padding: 20px; }
  .card h3 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .bar, .after, .send, .move, .also summary { display: none !important; }
  body { background: #fff; }
  .top5 li { box-shadow: none; border: 1px solid var(--pale); break-inside: avoid; }
  .also { display: block; }
  .also[open] .also-list, .also .also-list { display: block; }
}
