/* Christmas Scorecard: pinstripe jersey + lineup card, in team navy/grey/white, with Christmas lights strung across the top */
:root {
  --bg: oklch(95.5% 0.007 262);
  --paper: oklch(99.2% 0.003 262);
  --rule: oklch(86% 0.025 250);
  --rule-warm: oklch(87% 0.01 262);
  --ink: oklch(24% 0.03 262);
  --muted: oklch(44% 0.025 262);
  --navy: oklch(29% 0.07 262);
  --navy-2: oklch(36% 0.08 262);
  --red: oklch(50% 0.19 25);
  --red-2: oklch(56% 0.2 25);
  --red-soft: oklch(94% 0.03 25);
  --grey: oklch(72% 0.012 262);
  --grey-soft: oklch(90% 0.008 262);
  --field: oklch(60% 0.02 262);
  --veg: oklch(42% 0.09 155);
  --veg-soft: oklch(94% 0.035 155);

  /* C9 bulb colors: the only saturated color on the page */
  --bulb-red: oklch(62% 0.21 27);
  --bulb-amber: oklch(82% 0.16 80);
  --bulb-green: oklch(66% 0.17 150);
  --bulb-blue: oklch(62% 0.17 255);
  --bulb-white: oklch(96% 0.05 95);
  --on-dark: oklch(99% 0.003 262);
  --venmo: oklch(52% 0.17 250);

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --script: "Oleo Script", "Brush Script MT", cursive;
  --body: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --photo-overlap: clamp(56px, 14vw, 96px);

  --trim: linear-gradient(var(--navy) 0 4px, var(--paper) 4px 7px, var(--grey) 7px 11px, var(--paper) 11px 14px, var(--navy) 14px 18px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- Masthead: the jersey ---------- */
.masthead {
  background:
    repeating-linear-gradient(90deg, transparent 0 15px, oklch(29% 0.07 262 / .16) 15px 16.5px),
    var(--paper);
  /* bottom padding leaves room for the photo to overlap the trim */
  padding: 74px 0 calc(var(--photo-overlap) + 26px);
  position: relative;
  overflow: hidden;
}

/* ---------- Christmas lights strung across the top, like on the backstop fence ---------- */
.lights {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  display: flex; width: max-content;
  height: 56px;
  /* the wire: one shallow swag per bulb */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='58' height='22'%3E%3Cpath d='M0 3 Q29 21 58 3' fill='none' stroke='%231e2a44' stroke-width='2'/%3E%3C/svg%3E") repeat-x 0 0 / 58px 22px;
  pointer-events: none;
}
.lights i {
  position: relative; flex: none; width: 58px;
  pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
/* Tapped bulb: flickers, then flares bright */
/* doubled class outranks the twinkle rules below */
.lights i.zap.zap::after { animation: zap .7s var(--ease); transform-origin: 50% 0; }
@keyframes zap {
  0% { opacity: 1; }
  15% { opacity: .2; box-shadow: none; }
  30% { opacity: 1; }
  42% { opacity: .35; box-shadow: none; }
  60% { opacity: 1; transform: scale(1.18); filter: brightness(1.35); box-shadow: 0 0 22px 6px var(--c); }
}
/* socket */
.lights i::before {
  content: ""; position: absolute; left: 50%; top: 10px; width: 9px; height: 10px;
  margin-left: -4.5px; border-radius: 2px 2px 1px 1px;
  background: oklch(40% 0.03 150);
}
/* C9 bulb */
.lights i::after {
  content: ""; position: absolute; left: 50%; top: 18px; width: 17px; height: 27px;
  margin-left: -8.5px;
  border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  background: var(--c);
  box-shadow: 0 0 14px 2px color-mix(in oklch, var(--c) 70%, transparent), inset -3px -4px 0 oklch(0% 0 0 / .12);
}
.lights i:nth-child(5n+1) { --c: var(--bulb-red); }
.lights i:nth-child(5n+2) { --c: var(--bulb-amber); }
.lights i:nth-child(5n+3) { --c: var(--bulb-green); }
.lights i:nth-child(5n+4) { --c: var(--bulb-blue); }
.lights i:nth-child(5n+5) { --c: var(--bulb-white); }
.masthead .lights i { animation: light-up .45s var(--ease) both; animation-delay: calc(.3s + var(--d, 0) * 1s); }
.lights i:nth-child(4n+2)::after { animation: twinkle 2.8s ease-in-out infinite alternate; }
.lights i:nth-child(7n+4)::after { animation: twinkle 3.6s ease-in-out .9s infinite alternate; }
@keyframes twinkle {
  0%, 55% { opacity: 1; }
  100% { opacity: .45; box-shadow: none; }
}
.eyebrow {
  margin: 0 0 14px;
  font: 800 15px/1.3 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
h1 {
  font: 900 clamp(64px, 23vw, 132px)/.84 var(--display);
  text-transform: uppercase;
  margin: 0 0 18px;
  color: var(--navy);
  text-shadow: .045em .045em 0 var(--grey);
  letter-spacing: -.01em;
}
/* "Christmas" in red script, tucked onto the cap tops like a jersey wordmark */
h1 .script {
  display: block;
  font: 400 .58em/1 var(--script);
  text-transform: none;
  color: var(--red);
  text-shadow: .025em .025em 0 var(--grey-soft);
  /* pull left past the font's built-in side space so the C's curve lines up with the T stem */
  margin: 0 0 -.1em -.05em;
  position: relative; z-index: 1;
}
.lede { margin: 0; text-wrap: pretty; font-size: 20px; line-height: 1.45; max-width: 30ch; color: var(--ink); font-weight: 600; }

/* Uniform trim stripe, like sleeve or sock piping */
.seam { height: 18px; background: var(--trim); }
.masthead .seam { position: absolute; left: 0; right: 0; bottom: 0; }

/* ---------- Team photo ---------- */
.team { margin: calc(-1 * var(--photo-overlap)) auto 0; position: relative; }
.team img {
  display: block; width: 100%; height: auto;
  border: 5px solid var(--paper);
  border-radius: 6px;
  box-shadow: 0 10px 30px oklch(29% 0.07 262 / .22);
  transform: rotate(-1deg);
}

main { padding-top: 36px; }

/* ---------- Box score ---------- */
.boxscore {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--paper);
  border: 2px solid var(--navy);
  text-align: center;
}
.boxscore th {
  background: var(--navy); color: var(--on-dark);
  font: 800 13px/1 var(--display); letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 4px;
}
.boxscore td {
  font: 900 clamp(28px, 8vw, 38px)/1.05 var(--display); color: var(--navy);
  padding: 12px 4px 10px;
  border-left: 2px solid var(--navy);
  vertical-align: top;
}
.boxscore td:first-child { border-left: 0; }
.boxscore small { display: block; font: 600 15px var(--body); color: var(--muted); margin-top: 2px; }

/* ---------- Maker ---------- */
.maker {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px 12px; margin: 22px 0 30px;
  font-weight: 700; color: var(--muted); font-size: 15px;
}
.maker img { height: 52px; width: auto; }
.maker .amp { font: 900 22px var(--display); color: var(--grey); }

/* ---------- The scorecard ---------- */
.scorecard {
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--navy), 0 14px 34px oklch(29% 0.07 262 / .12);
}
.block { padding: 24px 18px; }
.block + .block { border-top: 4px double var(--navy); }

h2 {
  display: flex; align-items: center; gap: 10px;
  font: 800 27px/1.1 var(--display); color: var(--navy);
  margin: 0 0 8px;
}
.num {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grey-soft); color: var(--navy);
  font: 900 19px/1 var(--display);
}
.hint { color: var(--muted); font-size: 17px; margin: 0 0 14px; }
.block > .hint:last-child { margin: 14px 0 0; }

/* Player */
.player-locked {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding: 12px 14px;
  border: 2px solid var(--navy); border-radius: 4px;
  background: repeating-linear-gradient(90deg, transparent 0 11px, oklch(29% 0.07 262 / .09) 11px 12px), var(--paper);
}
.player-locked strong { flex: 1; font: 900 30px/1 var(--display); color: var(--navy); text-transform: uppercase; }
.player-number {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 6px; border-radius: 50%;
  background: var(--navy); color: var(--on-dark); font: 900 21px/1 var(--display);
}
#player-pick { margin-top: 12px; }

/* Lineup */
.lineup-head {
  display: flex; justify-content: space-between;
  background: var(--navy); color: var(--on-dark);
  font: 800 14px/1 var(--display); letter-spacing: .12em; text-transform: uppercase;
  padding: 9px 12px; margin: 0 -2px;
}
.lineup-head span:last-child { width: 132px; text-align: center; }
.flavors { list-style: none; margin: 0; padding: 0; }
/* Names line up under "FLAVOR", steppers under "DOZEN"; a picked flavor gets a light tint */
.flavor {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  padding: 10px 10px;
  margin: 0 -2px;
  border-bottom: 1.5px solid var(--rule);
  transition: background-color .25s var(--ease);
}
.flavor.has { background: var(--grey-soft); }
.flavor-name { font-weight: 700; font-size: 19px; line-height: 1.2; }
.tag {
  display: inline-block; margin-left: 4px; padding: 1px 8px;
  border-radius: 99px; font-size: 13px; font-weight: 800; vertical-align: 2px;
  letter-spacing: .02em; text-transform: uppercase;
}
.tag.hot { background: var(--red-soft); color: var(--red); }
.tag.veg { background: var(--veg-soft); color: var(--veg); }

.stepper { display: flex; align-items: center; gap: 2px; width: 132px; justify-content: space-between; }
.stepper button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--navy); background: var(--paper); color: var(--navy);
  font: 700 24px/1 var(--body); cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s var(--ease);
}
.stepper button:active:not(:disabled) { transform: scale(.92); }
.stepper button:disabled { opacity: .28; cursor: default; }
.stepper button.add { background: var(--navy); color: var(--on-dark); }
.stepper output { min-width: 32px; text-align: center; font: 900 30px var(--display); color: var(--navy); }

/* Fields */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; margin-top: 14px; }
.fields .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 17px; color: var(--ink); }
.opt { font-weight: 400; color: var(--muted); }
input, textarea, select {
  font: 18px var(--body); color: var(--ink);
  padding: 12px 13px; min-height: 50px;
  border: 2px solid var(--field); border-radius: 4px; background: var(--paper);
}
select {
  appearance: none; padding-right: 40px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231c2a4a' stroke-width='2.4'/%3E%3C/svg%3E") no-repeat right 15px center;
}
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 3px solid oklch(29% 0.07 262 / .3); outline-offset: 1px; border-color: var(--navy);
}
select.invalid, input.invalid { border-color: var(--red); background-color: var(--red-soft); }
.hp { position: absolute; left: -9999px; }

/* Payment */
.pay { display: grid; gap: 10px; margin-top: 14px; }
.pay label {
  flex-direction: row; align-items: center; gap: 12px;
  padding: 14px; border: 2px solid var(--field); border-radius: 4px; cursor: pointer;
  font-size: 17px; font-weight: 600; line-height: 1.3;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.pay label:has(input:checked) { border-color: var(--navy); background: var(--grey-soft); }
.pay input { flex: none; width: 22px; height: 22px; min-height: 0; accent-color: var(--navy); }

/* Checkout bar */
.checkout {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  background:
    repeating-linear-gradient(90deg, transparent 0 15px, oklch(100% 0 0 / .06) 15px 16.5px),
    var(--navy);
  color: var(--on-dark);
  margin: 0 -2px -2px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 4px solid var(--grey);
  transition: transform .45s var(--ease), opacity .3s var(--ease);
}
/* Tucked below the screen until the first dozen is picked */
.checkout.away { transform: translateY(calc(100% + 16px)); opacity: 0; pointer-events: none; transition-duration: .3s; }
#checkout-end { height: 1px; }
.total { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.total span { font-size: 16px; font-weight: 700; color: var(--grey-soft); }
.total strong { font: 900 36px/1 var(--display); }
.checkout button {
  font: 800 18px var(--body); color: var(--on-dark); background: var(--red);
  border: 0; border-radius: 99px; padding: 15px 26px; min-height: 52px; cursor: pointer;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.checkout button:hover:not(:disabled) { background: var(--red-2); }
.checkout button:active:not(:disabled) { transform: scale(.97); }
.checkout button:disabled { opacity: .4; cursor: default; }
.checkout button.is-sending { opacity: 1; display: inline-flex; align-items: center; gap: 10px; }
.checkout button.is-sending::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid oklch(100% 0 0 / .35); border-top-color: var(--on-dark);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--red); font-weight: 700; margin: 0; padding: 0 18px 16px; }
.field-error { color: var(--red); font-weight: 700; font-size: 16px; line-height: 1.35; }

/* Missing field: a short sideways nudge to draw the eye */
.nudge { animation: nudge .4s var(--ease); }
@keyframes nudge {
  20% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-2px); }
}

/* Count and total pop when they change, so a tap clearly registered */
.pop { animation: pop .3s var(--ease); }
@keyframes pop { from { transform: scale(1.3); } }
.stepper output, .total strong { display: inline-block; }

/* Form fades out before the ticket arrives, and back in for another order */
#order { transition: opacity .28s var(--ease), transform .28s var(--ease); }
#order.leaving { opacity: 0; transform: translateY(-10px); }
#order.arriving { animation: fade-up .45s var(--ease) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }
.ticket { scroll-margin-top: 16px; }

/* ---------- Ticket (confirmation) ---------- */
.ticket {
  position: relative;
  display: grid; grid-template-columns: 1fr 74px;
  background: var(--paper);
  border: 2px solid var(--navy); border-radius: 6px;
  box-shadow: 0 14px 34px oklch(29% 0.07 262 / .14);
  overflow: hidden;
  animation: rise .7s var(--ease) both;
}
.ticket:focus { outline: none; }
.ticket-main { padding: 70px 20px 22px; }
.ticket-stub { padding-top: 56px; }

/* The ticket's strand starts at the left edge and lights up bulb by bulb */
.ticket .lights { left: 0; transform: none; z-index: 1; }
.ticket .lights i { animation: light-up .5s var(--ease) both; animation-delay: calc(.5s + var(--i) * 90ms); }
@keyframes light-up {
  from { opacity: .18; filter: saturate(0); }
}
.ticket-kicker { margin: 0 0 6px; font: 800 15px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ticket h2 { font-size: 30px; margin-bottom: 10px; }

/* Sign-off at the bottom of the ticket: a plain thank-you, then the player's autograph */
.signature { margin: 22px 0 0; }
.signoff { display: block; font-size: 17px; color: var(--muted); }
.autograph {
  display: inline-block;
  margin-top: 2px;
  padding: 0 14px 10px 0;
  font: 400 38px/1.1 var(--script);
  color: var(--red);
  transform: rotate(-3deg);
  transform-origin: left bottom;
  /* hand-drawn swoosh under the name */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M2 10 C 50 3, 120 2, 198 7' fill='none' stroke='%23b0202e' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left bottom / 100% 12px;
  animation: sign 1.1s cubic-bezier(.45, 0, .25, 1) .6s both;
}
@keyframes sign { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 -10% 0 0); } }
.ticket-stub {
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 11px, oklch(100% 0 0 / .09) 11px 12px),
    var(--navy);
  color: var(--on-dark);
  border-left: 2px dashed var(--grey);
}
.ticket-stub span {
  writing-mode: vertical-rl;
  font: 800 16px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
}
.ticket-stub b { font-weight: 400; margin: 8px 0; }
.pay-box { background: var(--bg); border: 1.5px solid var(--rule-warm); border-radius: 4px; padding: 14px; margin: 14px 0 0; }
.pay-box p { margin: 0 0 8px; }
.pay-box .hint { margin: 10px 0 0; font-size: 16px; }
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 99px;
  background: var(--venmo); color: var(--on-dark); font-weight: 800; text-decoration: none;
}
.again-row { text-align: center; margin: 18px 0 0; }
.link { background: none; border: 0; padding: 4px; color: var(--navy); font: 700 17px var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
code { white-space: nowrap; font-size: 16px; font-weight: 700; background: var(--paper); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--rule-warm); }

@keyframes rise { from { opacity: 0; transform: translateY(18px) rotate(-1deg); } }

/* ---------- Player links (admin) ---------- */
.links-panel { padding: 22px 18px; margin-bottom: 24px; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; flex-direction: column; padding: 10px 0; border-top: 1.5px solid var(--rule); }
.link-list li:first-child { border-top: 0; }
.link-list a { color: var(--navy); font-size: 15px; word-break: break-all; }

/* ---------- Details ---------- */
.details { padding: 44px 0 12px; }
.details h2 { font-size: 24px; margin-bottom: 4px; }
dl { margin: 0; }
dl > div { padding: 14px 0; border-bottom: 1.5px solid var(--rule-warm); }
dt { font-weight: 800; color: var(--navy); }
dd { margin: 2px 0 0; color: var(--muted); max-width: 60ch; }
dd a { color: var(--navy); font-weight: 700; }

footer { padding: 24px 16px 48px; text-align: center; }
footer .seam { max-width: 640px; margin: 0 auto 14px; }
footer p { margin: 0; font: 800 15px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Responsive + motion ---------- */
@media (min-width: 700px) {
  .checkout { bottom: 12px; border-radius: 0 0 4px 4px; }
  .block { padding: 28px 26px; }
}
/* Phones: tighten everything above the form so step 1 reaches the first screen */
@media (max-width: 520px) {
  .masthead { padding: 60px 0 calc(var(--photo-overlap) + 16px); }
  .eyebrow { margin-bottom: 10px; }
  h1 { margin-bottom: 14px; }
  .team img { aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 30%; }
  main { padding-top: 22px; }
  .boxscore td { padding: 8px 4px 7px; }
  .maker { margin: 14px 0 18px; }
  .maker img { height: 38px; }
}
@media (max-width: 400px) {
  .fields { grid-template-columns: 1fr; }
  .flavor { gap: 8px; }
  .flavor-name { font-size: 17px; }
  .stepper, .lineup-head span:last-child { width: 120px; }
  .checkout button { padding: 14px 20px; }
  .ticket { grid-template-columns: 1fr 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .team img { transform: none; }
}
