@font-face { font-family: "Gloock"; src: url(fonts/gloock.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Schibsted"; src: url(fonts/schibsted.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Gloock fallback"; src: local("Georgia"); size-adjust: 104%; ascent-override: 88%; descent-override: 24%; }
@font-face { font-family: "Schibsted fallback"; src: local("Arial"); size-adjust: 100%; ascent-override: 96%; descent-override: 26%; }

:root {
  --green: #0f3b2c;
  --green2: #16503c;
  --cream: #f4eedf;
  --cream2: #e3d9bf;
  --paper: #f6efe0;
  --ink: #0f3b2c;
  --ink2: #46665a;
  --coral: #ff7a59;
  --coral-ink: #b83a18;
  --serif: "Gloock", "Gloock fallback", Georgia, serif;
  --sans: "Schibsted", "Schibsted fallback", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--green); color: var(--cream); font: 400 17px/1.55 var(--sans); }
p, li, dd { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 14px 20px; }
.mark { font: 400 22px/1 var(--serif); text-decoration: none; padding: 6px 0; }
.bar nav a { font-size: 16px; padding: 10px 0; }

.hero { max-width: 1180px; margin: 0 auto; padding: 6px 20px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; grid-template-areas: "ask" "card" "share" "vs"; }
.ask { grid-area: ask; display: flex; flex-direction: column; }
.hero-art { margin: 0 -20px 16px; }
.hero-art img { display: block; width: 100%; height: 150px; object-fit: cover; object-position: 60% 45%; }
.rare-art, .crowd-art { margin: 14px 0 0; max-width: 240px; }
.rare-art img, .crowd-art img { display: block; width: 100%; height: auto; border-radius: 14px; }
.c-crowd { display: none; width: min(240px, 45%); height: auto; aspect-ratio: 1; float: right; margin: 0 0 12px 16px; border-radius: 14px; }
.c-crowd:not([hidden]) { display: block; }
h1 { font: 400 clamp(40px, 10.5vw, 96px)/0.98 var(--serif); letter-spacing: -0.015em; margin: 0 0 18px; max-width: 10ch; text-wrap: balance; }
.pick label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; color: var(--cream2); }
.pick-row { display: flex; gap: 8px; }
.pick-row input { flex: 1; min-width: 0; font: 500 20px/1.2 var(--sans); color: var(--ink); background: var(--paper); border: 2px solid var(--paper); border-radius: 12px; padding: 12px 14px; }
.pick-row input[aria-invalid=true] { border-color: var(--coral); box-shadow: 0 0 0 2px var(--coral); }
button { font: 700 17px/1 var(--sans); color: var(--ink); background: var(--coral); border: 0; border-radius: 12px; padding: 14px 18px; cursor: pointer; white-space: nowrap; }
button:hover { background: #ff9274; }
.help { margin: 8px 0 0; font-size: 15px; color: var(--cream2); min-height: 1.55em; }
.help.bad { color: #ffd3c4; font-weight: 600; }

/* ---------- rank card ---------- */
.card { grid-area: card; background: var(--paper); color: var(--ink); border-radius: 22px; padding: 22px 22px 18px; min-width: 0; position: relative; box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .6); }
.card p { margin: 0; }
.c-band { display: block; width: calc(100% + 44px); max-width: none; height: auto; aspect-ratio: 819 / 230; margin: -22px -22px 14px; border-radius: 22px 22px 0 0; border-bottom: 3px solid var(--ink); object-fit: cover; }
.card.flip { animation: flip .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes flip { from { transform: translateY(10px) rotate(-0.6deg); } to { transform: none; } }
.c-date { font: 400 34px/1.1 var(--serif); }
.c-rank { display: flex; align-items: baseline; gap: 10px; margin-top: 4px !important; }
.c-hash { font: 700 18px/1 var(--sans); color: var(--ink2); align-self: flex-start; margin-top: 28px; }
#c-rank { font: 400 clamp(96px, 27vw, 168px)/0.85 var(--serif); color: var(--coral-ink); letter-spacing: -0.03em; font-variant-numeric: lining-nums; }
.c-of { font: 700 20px/1 var(--sans); color: var(--ink); white-space: nowrap; }
.c-say { font-weight: 600; font-size: 19px; margin-top: 8px !important; }
.c-meter { clear: both; position: relative; height: 14px; margin: 34px 0 34px; border-radius: 3px;
  background: linear-gradient(90deg, #1d5c47 0 16.6%, #3f7a4f 0 33.3%, #7a9a55 0 50%, #c9a24a 0 66.6%, #ec8045 0 83.3%, #ff5e3a 0); }
.c-pin { position: absolute; left: calc(9px + var(--at) * (100% - 18px)); top: -14px; width: 0; height: 0; border: 9px solid transparent; border-top: 12px solid var(--ink); transform: translateX(-50%); transition: left .5s cubic-bezier(.2, .8, .2, 1); }
.c-ends { clear: both; display: flex; justify-content: space-between; margin: -26px 0 26px; font-size: 13px; color: var(--ink2); }
.c-facts { margin: 0; display: grid; gap: 6px; }
.c-facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 1px solid #ddd2bd; padding-bottom: 6px; }
.c-facts div[hidden] { display: none; }
.c-facts dt { font-size: 15px; color: var(--ink2); }
.c-facts dd { margin: 0; font: 400 24px/1.2 var(--serif); font-variant-numeric: lining-nums; }
.c-pi { margin-top: 16px; }
.c-pi-head { font-size: 15px; }
.c-pi b { font-weight: 700; }
.c-digits { font: 400 clamp(22px, 6.2vw, 34px)/1.3 var(--serif); letter-spacing: 0.04em; color: var(--ink2); white-space: nowrap; overflow: hidden; margin-top: 4px !important; font-variant-numeric: tabular-nums lining-nums; }
.c-digits mark { background: none; color: var(--coral-ink); text-decoration: underline 3px; text-underline-offset: 6px; }
.c-note { margin-top: 12px !important; font-size: 15px; padding: 10px 12px; background: #ecdfc4; border-radius: 10px; }
.c-src { margin-top: 14px !important; font-size: 13px; color: var(--ink2); }

.share { grid-area: share; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.share button + button { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 2px var(--cream); }
.share button + button:hover { background: var(--green2); }
#share-msg { flex-basis: 100%; margin: 0; font-size: 15px; min-height: 1.5em; overflow-wrap: anywhere; }
html:not(.js) .share, html:not(.js) .billion { display: none; }

/* ---------- map ---------- */
.map, .billion, .data { max-width: 1180px; margin: 0 auto; padding: 28px 20px; }
.map h2, .data h2 { font: 400 34px/1.1 var(--serif); margin: 0 0 8px; }
.map-dek { margin: 0 0 16px; color: var(--cream2); }
.grid { display: grid; gap: 2px; cursor: pointer; max-width: 1000px; }
.g-row { display: grid; grid-template-columns: 34px repeat(31, minmax(0, 1fr)); gap: 2px; align-items: center; }
.g-m { font-size: 12px; color: var(--cream2); }
.g-c { display: block; aspect-ratio: 1; border-radius: 2px; }
.g-c.none { background: transparent; }
.s0 { background: #1d5c47; } .s1 { background: #3f7a4f; } .s2 { background: #7a9a55; } .s3 { background: #c9a24a; } .s4 { background: #ec8045; } .s5 { background: #ff5e3a; }
.g-c.on { outline: 3px solid var(--paper); outline-offset: 1px; position: relative; z-index: 1; }
.key { display: flex; align-items: center; gap: 4px; margin: 14px 0 0; font-size: 14px; color: var(--cream2); }
.key i { width: 18px; height: 12px; aspect-ratio: auto; }
.key span:first-child { margin-right: 6px; } .key span:last-child { margin-left: 6px; }
.lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.lists h3 { font: 700 16px/1.3 var(--sans); margin: 0 0 6px; }
.lists ol { margin: 0; padding: 0; list-style: none; }
.lists li { display: flex; align-items: baseline; gap: 10px; padding: 2px 0; }
.lists .n { font: 400 20px/1 var(--serif); color: var(--coral); min-width: 1ch; }
.lists a { display: inline-block; padding: 3px 0; font-weight: 600; white-space: nowrap; }
.lists .v { color: var(--cream2); font-size: 15px; white-space: nowrap; }

/* ---------- billion + data ---------- */
.billion details { border-top: 1px solid var(--green2); border-bottom: 1px solid var(--green2); padding: 6px 0; }
.billion summary { cursor: pointer; font: 400 24px/1.3 var(--serif); padding: 10px 0; }
.billion p { max-width: 36em; color: var(--cream2); }
.billion .pick-row { max-width: 360px; }
#bout, #tout { color: var(--cream); font-weight: 600; min-height: 1.5em; }
#tout:empty { display: none; }
.data p { max-width: 38em; color: var(--cream2); }
.data a { display: inline-block; padding: 2px 0; color: var(--cream); }
.attr { font-size: 15px; }
.foot { text-align: center; padding: 20px 20px 48px; }
.foot p { margin: 0; }
.foot a { display: inline-block; padding: 8px 0; font-weight: 600; }

@media (min-width: 900px) {
  body { font-size: 18px; }
  .bar { padding: 22px 32px; }
  .hero { padding: 16px 32px 56px; grid-template-columns: minmax(0, 1fr) 460px; column-gap: 64px; row-gap: 18px; grid-template-areas: "ask card" "share card" "vs card"; align-items: start; }
  .ask { padding-top: 24px; }
  .hero-art { order: 3; margin: 28px 0 0; }
  .hero-art img { height: auto; aspect-ratio: 1400 / 547; border-radius: 18px; }
  .card { padding: 30px 32px 22px; }
  .map, .billion, .data { padding-left: 32px; padding-right: 32px; }
  .g-m { font-size: 13px; }
  .lists { grid-template-columns: repeat(2, minmax(0, 280px)); align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 379px) { .c-facts dt { font-size: 13.5px; } .c-facts div { gap: 10px; } }

/* ---------- you vs a friend ---------- */
.vs { grid-area: vs; min-width: 0; margin-top: 8px; padding-top: 18px; border-top: 2px solid var(--green2); }
.vs h2 { font: 400 clamp(28px, 7vw, 36px)/1.05 var(--serif); margin: 0 0 6px; }
.vs-dek { margin: 0 0 12px; font-size: 16px; color: var(--cream2); }
.vs-out { margin-top: 16px; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 18px 18px 14px; }
.vs-out[hidden] { display: none; }
.vs-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.vs-tile p { margin: 0; }
.vs-who { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink2); }
.vs-who .k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--ink); flex: none; }
.vs-who .k.b { background: var(--coral-ink); }
.vs-d { font: 400 clamp(20px, 5.4vw, 26px)/1.1 var(--serif); margin-top: 4px !important; }
.vs-r { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 2px !important; }
.vs-r b { font: 400 clamp(54px, 15vw, 84px)/0.9 var(--serif); color: var(--coral-ink); letter-spacing: -0.03em; font-variant-numeric: lining-nums; }
.vs-r span { font: 700 14px/1 var(--sans); }
.vs-s { font-size: 14px; font-weight: 600; margin-top: 6px !important; }
.vs-meter { margin: 30px 2px 12px; }
.c-pin.b { top: auto; bottom: -14px; border-top-color: transparent; border-bottom: 12px solid var(--coral-ink); }
.vs-gap { margin: 0; font-weight: 700; font-size: 17px; }
.vs-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.vs-btns button + button { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 2px var(--cream); }
.vs-btns button + button:hover { background: var(--green2); }
.vs-btns button[hidden] { display: none; }
.vs-btns #vs-save[hidden] + #vs-copy:not([hidden]) { background: var(--coral); color: var(--ink); box-shadow: none; }
#vs-msg { flex-basis: 100%; margin: 0; font-size: 15px; min-height: 1.5em; overflow-wrap: anywhere; }
html:not(.js) .vs { display: none; }
#when[readonly] { background: var(--cream2); border-color: var(--cream2); }
@media (max-width: 899px) { .hero.locked { grid-template-areas: "ask" "vs" "card" "share"; } .hero.locked .vs { border-top: 0; margin-top: 0; padding-top: 0; } }
.pick-row input::placeholder { color: #5b5b5b; opacity: 1; }
@media (min-width: 900px) { .hero.locked { grid-template-areas: "ask card" "vs card" "share card"; } .hero.locked .hero-art { display: none; } .hero.locked .vs { border-top: 0; margin-top: 0; padding-top: 0; } }
