/* Done Deal. One narrow column: round tracker, transfer card, offer desk.
   Deliberately single-theme: black and gold. */
:root {
  --bg: #0a0a09;
  --surface: #1b1a17;
  --raised: #272520;
  --ink: #f4efe3;
  --muted: #b3ab9c;
  --line: #3a362f;
  --edge: rgba(255, 255, 255, .05);
  --lift: 0 1px 0 var(--edge) inset, 0 12px 32px rgba(0, 0, 0, .45);
  --gold: #d4af37;
  --gold-soft: #8a7225;
  --gold-ink: #0a0a09;
  --mid: #c98a2e;
  --miss: #b8533f;
  --track: #3a362f;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.wrap { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.num { font-variant-numeric: tabular-nums; }

header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mark { font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: 22px; letter-spacing: .02em; line-height: 1; margin: 0; }
.mark span { color: var(--gold); }
.meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.iconbtn { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 600 13px var(--body); cursor: pointer; }
.iconbtn:hover { border-color: var(--gold-soft); }

/* Round tracker */
.rounds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.round { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.round b { font-family: var(--display); font-size: 16px; font-weight: 800; color: var(--ink); }
.round.now { border-color: var(--gold-soft); color: var(--ink); }
.round.done b { color: var(--ink); }

/* Transfer card */
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--lift); display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.deal::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); }
.eyebrow { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mode { color: var(--ink); }
.player { font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: clamp(28px, 8vw, 38px); line-height: 1.02; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
.route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; }
.club { min-width: 0; }
.club small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.club b { display: block; font-weight: 700; font-size: 16px; line-height: 1.25; }
.club.to { text-align: right; }
.mid { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.arrow { color: var(--muted); font-size: 20px; font-weight: 700; line-height: 1; }
.year { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }

/* Offer desk */
.desk { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--lift); display: flex; flex-direction: column; gap: 14px; }
.readout { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font: 700 22px var(--body); cursor: pointer; flex: none; touch-action: manipulation; }
.step:hover { border-color: var(--gold-soft); }
.step:disabled { opacity: .3; cursor: default; }
.value { text-align: center; flex: 1; }
.value .big { font-family: var(--display); font-weight: 800; font-size: 46px; line-height: 1; letter-spacing: -.02em; }
.value small { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

.trackwrap { position: relative; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 40px; background: transparent; cursor: pointer; margin: 0; display: block; touch-action: pan-y; }
input[type=range]:disabled { cursor: default; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: var(--track); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 999px; background: var(--track); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--gold); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--gold); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--gold); }
.revealing input[type=range]::-webkit-slider-thumb { opacity: 0; }
.revealing input[type=range]::-moz-range-thumb { opacity: 0; }

/* Reveal markers sit over the track */
.marker { position: absolute; top: 0; height: 40px; width: 0; pointer-events: none; transition: left .9s cubic-bezier(.2,.8,.2,1); }
.marker::before { content: ""; position: absolute; left: -2px; top: 6px; width: 4px; height: 28px; border-radius: 2px; }
.marker span { position: absolute; bottom: 42px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; }
.marker.you::before { background: var(--ink); }
.marker.you span { background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.marker.real::before { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.marker.real span { background: var(--gold); color: var(--gold-ink); bottom: auto; top: 42px; }
.marker.edge-l span { transform: translateX(-8px); }
.marker.edge-r span { transform: translateX(calc(-100% + 8px)); }
.scale { position: relative; height: 16px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.scale span:first-child { transform: none; }
.scale span:last-child { transform: translateX(-100%); }
.revealing .scale { visibility: hidden; }

.verdict { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; background: var(--raised); border-radius: 14px; padding: 14px 16px; }
.verdict .fee small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.verdict .fee b { font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--gold); }
.verdict .pts { text-align: right; }
.verdict .pts b { font-family: var(--display); font-size: 26px; font-weight: 900; }
.verdict .pts small { display: block; font-size: 13px; color: var(--muted); }
.verdict p { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--muted); }
.t-great { color: var(--gold); } .t-mid { color: var(--mid); } .t-miss { color: var(--miss); }

.primary { height: 52px; border: 0; border-radius: 14px; background: var(--gold); color: var(--gold-ink); font: 800 16px var(--display); font-stretch: 112%; letter-spacing: .03em; cursor: pointer; touch-action: manipulation; }
.primary:hover { filter: brightness(1.08); }
.secondary { height: 48px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 700 15px var(--body); cursor: pointer; touch-action: manipulation; }
.secondary:hover { border-color: var(--gold-soft); }
.textbtn { background: none; border: 0; color: var(--muted); font: 600 13px var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; justify-self: center; }
.textbtn:hover { color: var(--ink); }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Summary */
.summary { text-align: center; }
.summary .eyebrow { justify-content: center; }
.total { font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: 64px; line-height: 1; color: var(--gold); letter-spacing: -.02em; }
.total small { font-size: 22px; color: var(--muted); font-weight: 700; }
.summary h2 { margin: 0; font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: 26px; color: var(--ink); letter-spacing: .02em; text-transform: uppercase; }
.league { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.league div { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.league div i { font-style: normal; font-weight: 800; }
.league div span:last-child { font-size: 12px; }
.league div.on { background: var(--gold); color: var(--gold-ink); font-weight: 800; }
.league div.on.down { background: var(--miss); color: #fff; }
.recap { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.recap div { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: baseline; padding: 10px 12px; border-radius: 12px; background: var(--raised); font-size: 14px; }
.recap div span:nth-child(2) { color: var(--muted); font-size: 13px; }
.recap div b { font-family: var(--display); font-weight: 800; min-width: 3ch; text-align: right; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toast { font-size: 13px; color: var(--gold); min-height: 18px; }
.next { font-size: 13px; color: var(--muted); }

/* Stats */
.stats { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--lift); display: flex; flex-direction: column; gap: 12px; }
.stats h3 { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.statrow b { display: block; font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--ink); }
.statrow span { font-size: 12px; color: var(--muted); }

.rules, footer { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }
.fade { animation: fade .35s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Start screen: a bright gold card, shown before today's first offer. The rest of the column hides behind it. */
body.intro-on .wrap > :not(.intro):not(.intro-bar):not(#stats):not(footer) { display: none !important; }
body.intro-on .intro-bar { order: 0; }
body.intro-on #stats { order: 1; }
body.intro-on .intro { order: 2; }
body.intro-on footer { order: 3; }
.intro-bar { display: flex; justify-content: space-between; align-items: center; }
.roundbtn { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--gold); color: var(--gold-ink); font: 900 22px var(--display); cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.5); touch-action: manipulation; }
.roundbtn.ghost { background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.roundbtn:hover { filter: brightness(1.08); }

.intro { display: flex; flex-direction: column; gap: 22px; }
.hero { --hero-ink: #14110a; background: radial-gradient(120% 90% at 50% 0%, #e6c457 0%, var(--gold) 55%, #b8932a 100%); color: var(--hero-ink); border-radius: 30px; padding: 22px 22px 30px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; box-shadow: 0 24px 60px rgba(212,175,55,.18), 0 18px 40px rgba(0,0,0,.55); animation: herorise .55s cubic-bezier(.2,.9,.3,1.1) both; }
.hero-top { width: 100%; display: flex; justify-content: space-between; font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .04em; }
.hero-top span:first-child { font-weight: 900; font-stretch: 125%; }
.hero-top i { font-style: normal; color: var(--ink); }
.hero-title { margin: 6px 0 2px; font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: clamp(42px, 12.5vw, 72px); line-height: .92; letter-spacing: -.02em; }
.hero-title em { display: block; font-family: "Caveat Brush", "Marker Felt", cursive; font-style: normal; font-weight: 400; font-stretch: normal; font-size: 1.3em; line-height: .95; letter-spacing: 0; color: var(--ink); -webkit-text-stroke: 7px var(--hero-ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--hero-ink); transform: rotate(-4deg); animation: scribble .5s cubic-bezier(.3,1.6,.5,1) .35s both; }
.hero-date { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; }
.hero-go { margin-top: 6px; min-width: min(100%, 290px); height: 60px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--ink); color: var(--hero-ink); font: 900 15px var(--display); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; box-shadow: 0 10px 24px rgba(0,0,0,.28); transition: transform .15s ease; touch-action: manipulation; }
.hero-go span { margin-left: 8px; display: inline-block; transition: transform .15s ease; }
.hero-go:hover span { transform: translateX(4px); }
.hero-go:active { transform: scale(.97); }
.hero-go:focus-visible { outline-color: var(--ink); outline-offset: 4px; }
.hero-streak { font-size: 13px; font-weight: 800; }

.howto-title { margin: 14px 0 0; text-align: center; font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: 30px; animation: rise .5s ease-out .5s both; }
.howto-title span { background: linear-gradient(transparent 58%, var(--gold-soft) 58%, var(--gold-soft) 92%, transparent 92%); padding: 0 6px; }
.howto { list-style: none; margin: 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--lift); animation: rise .5s ease-out .6s both; }
.howto li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; font-size: 15px; }
.howto b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--gold-ink); font-family: var(--display); font-size: 14px; font-weight: 900; }
@keyframes herorise { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes scribble { from { opacity: 0; transform: rotate(-14deg) scale(1.4); } to { opacity: 1; transform: rotate(-4deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Share panel: centred on desktop, a bottom sheet on phones */
.sheet { width: min(440px, calc(100% - 24px)); max-height: calc(100svh - 24px); overflow: auto; margin: auto; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.7); display: flex; flex-direction: column; gap: 14px; }
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(0,0,0,.7); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheetin .28s cubic-bezier(.2,.9,.3,1) both; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: 20px; }
.sheet-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font: 400 22px/1 var(--body); cursor: pointer; }
.share-preview { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--raised); font: 600 14px/1.5 var(--body); white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-btn { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--c); color: var(--k); font: 800 15px var(--body); text-decoration: none; border: 1px solid rgba(255,255,255,.08); touch-action: manipulation; }
.share-btn:hover { filter: brightness(1.08); }
.share-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.share-btn i { font-style: normal; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(0,0,0,.18); font-size: 14px; font-weight: 900; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-hint { margin: -4px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
@keyframes sheetin { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .sheet { margin: auto auto max(12px, env(safe-area-inset-bottom)); }
}

/* Score celebrations */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.badge { position: fixed; inset: 0; z-index: 51; display: grid; place-items: center; pointer-events: none; }
.stamp { font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: clamp(26px, 9vw, 84px); white-space: nowrap; letter-spacing: .06em; color: var(--gold); border: 6px double var(--gold); border-radius: 14px; padding: .12em .35em; background: rgba(10,10,9,.75); text-align: center; line-height: 1; animation: stamp .45s cubic-bezier(.3,1.6,.5,1) both, stampout .4s ease-in 1.9s forwards; }
.stamp small { display: block; font-size: 13px; font-weight: 700; letter-spacing: .2em; margin-top: 6px; color: var(--ink); }
.card { width: 130px; height: 182px; border-radius: 12px; display: grid; place-items: end center; padding-bottom: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.6); animation: drop .9s cubic-bezier(.25,1.3,.5,1) both, fadeout .4s ease-in 2.1s forwards; }
.card span { font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: 18px; letter-spacing: .1em; color: #0a0a09; }
.card.yellow { background: #f2c21b; }
.card.red { background: #d62f24; }
.card.red span { color: #fff; }
@keyframes stamp { from { transform: scale(3) rotate(-4deg); opacity: 0; } to { transform: scale(1) rotate(-12deg); opacity: 1; } }
@keyframes stampout { to { opacity: 0; transform: scale(.9) rotate(-12deg); } }
@keyframes drop { from { transform: translateY(-110vh) rotate(-35deg); } 70% { transform: translateY(0) rotate(8deg); } to { transform: translateY(0) rotate(4deg); } }
@keyframes fadeout { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .fade { animation: none; }
  .marker { transition: none; }
  .stamp, .card { animation: fadeout .4s ease-in 1.8s forwards; }
  .hero, .hero-title em, .howto-title, .howto { animation: none; }
  .sheet[open] { animation: none; }
}
