/* ============================================================
   Shared components: nav, buttons, paper, tape, cards, scorecard,
   dialog, segmented scoring, timers, draw cards
   ============================================================ */

/* ---------- Nav ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--black); border-bottom: 1px solid #1d1d1d; }
.site-nav { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); }
.nav-list { display: flex; justify-content: space-between; gap: 8px; }
.nav-list a {
  display: flex; align-items: center; min-height: 64px; padding: 0 6px;
  text-decoration: none; text-transform: uppercase; letter-spacing: .14em; font-size: clamp(.8rem, 1.5vw, 1.12rem); font-weight: 400;
  border-bottom: 2px solid transparent;
}
.nav-list a:hover, .nav-list a[aria-current="page"] { color: var(--pink); border-bottom-color: var(--pink); }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 4px;
    background: none; border: 0; color: var(--white); text-transform: uppercase; letter-spacing: .16em; font-size: .9rem;
  }
  .nav-toggle svg { width: 26px; height: 26px; }
  .nav-list { display: none; position: absolute; left: 0; right: 0; top: 56px; flex-direction: column; gap: 0; background: var(--black); border-bottom: 2px solid var(--pink); padding: 6px var(--gutter) 14px; }
  .nav-open .nav-list { display: flex; }
  .nav-list a { min-height: 52px; font-size: 1rem; border-bottom: 1px solid #222; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: var(--tap); padding: 12px 34px; border-radius: var(--pill);
  font-family: var(--f-btn); font-stretch: 112%; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
  font-size: clamp(1rem, 2.2vw, 1.35rem); line-height: 1.1; text-align: center; text-decoration: none;
  border: 3px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-pink { background: var(--pink); color: var(--black); border-color: var(--black); box-shadow: 0 0 0 2px var(--pink); }
.btn-gold { background: #120D09; color: var(--gold); border-color: var(--gold); }
.btn-black { background: var(--black); color: var(--white); border-color: var(--pink); font-family: var(--f-sans); font-weight: 500; letter-spacing: .06em; }
.btn-next { background: var(--black); color: var(--white); border-color: var(--pink); min-width: min(100%, 340px); }
.btn-ghost { background: transparent; color: var(--white); border-color: var(--white); font-size: 1rem; padding: 10px 24px; }
.btn-ghost.dark { color: var(--ink); border-color: var(--ink); }
.btn-route { width: 100%; justify-content: flex-start; background: var(--black); color: var(--white); border-color: var(--pink); padding: 10px 24px; }
.btn-route .ico { width: 32px; height: 32px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.link-btn { background: none; border: 0; color: #bbb; text-decoration: underline; text-underline-offset: 3px; padding: 12px; min-height: var(--tap); font-size: .9rem; }
.link-btn:hover { color: var(--pink); }
.btn-mini { min-height: 40px; padding: 6px 14px; border-radius: var(--pill); border: 2px solid var(--crimson); background: var(--white); color: var(--crimson); font-weight: 700; font-size: .85rem; }
.btn-mini:hover { background: var(--crimson); color: var(--white); }

.next-bar { background: var(--black); padding: 28px var(--gutter) 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.next-note { color: var(--pink-soft); font-size: .95rem; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; color: #ccc; text-decoration: none; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; }
.back-link .ico { width: 18px; height: 18px; }
.back-link:hover { color: var(--pink); }
.site-footer { background: var(--black); text-align: center; padding: 0 0 20px; }

/* ---------- Icons ---------- */
.ico { width: 1.6em; height: 1.6em; display: inline-block; vertical-align: middle; }
.ico.inline { width: 1em; height: 1em; vertical-align: -.1em; }
.ico.big { width: 46px; height: 46px; flex: none; color: var(--crimson); }
.icon-circle {
  width: clamp(76px, 12vw, 118px); aspect-ratio: 1; border-radius: 50%; background: var(--pink); color: var(--black);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.icon-circle .ico { width: 54%; height: 54%; stroke-width: 1.4; }
.icon-circle.soft { background: radial-gradient(circle, #F8BFCB 0 60%, #FAD5DC 61%); }

/* ---------- Paper, tape, brush ---------- */
.paper-card { background: var(--paper); color: var(--ink); border-radius: 6px; padding: clamp(18px, 3vw, 32px); box-shadow: var(--shadow); position: relative; }
.pink-paper { background: linear-gradient(160deg, #FBDDE2, #F7C9D2); color: var(--ink); padding: clamp(18px, 3vw, 30px); border-radius: 4px; box-shadow: var(--shadow); clip-path: polygon(0 2%, 4% 0, 30% 1.5%, 58% 0, 86% 1.2%, 100% 0, 99% 30%, 100% 62%, 98.5% 100%, 70% 98.5%, 40% 100%, 12% 98.6%, 0 100%, 1% 66%, 0 34%); }
.paper {
  --edge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath fill='%23EFE1D0' d='M0 12V6l6-3 7 4 9-5 8 3 6-4 10 5 7-2 9 3 8-5 7 4 10-3 6 4 9-6 8 5 7-2 9 4 8-4 10 3 6-4 9 5 8-3 7 2 9-4 8 5 6-3 4 1v8z'/%3E%3C/svg%3E");
  background: var(--paper); color: var(--ink); position: relative;
}
.paper.torn::before, .paper.torn::after { content: ''; position: absolute; left: 0; right: 0; height: 22px; background: var(--edge) center / 100% 100% no-repeat; }
.paper.torn::before { top: -21px; }
.paper.torn::after { bottom: -21px; transform: scaleY(-1); }
.tape {
  display: inline-block; background: var(--pink); color: var(--black); font-family: var(--f-marker); font-size: clamp(1.4rem, 3.4vw, 2.3rem);
  padding: 2px 22px; transform: rotate(-2deg); clip-path: polygon(2% 8%, 98% 0, 100% 50%, 97% 100%, 1% 94%, 0 45%);
}
.tape.pink { font-family: var(--f-btn); font-stretch: 112%; font-weight: 800; text-transform: uppercase; font-size: clamp(1.3rem, 3vw, 2rem); background: #F7B7C4; color: var(--crimson); border-radius: 8px; clip-path: none; transform: none; padding: 4px 22px; }
.brush, .brush-crimson, .gold-brush, .brush-pink {
  display: inline-block; padding: 4px 26px; font-family: var(--f-marker); font-weight: 400; line-height: 1.2;
  clip-path: polygon(0 18%, 6% 4%, 50% 0, 96% 6%, 100% 30%, 98% 86%, 60% 100%, 4% 94%);
}
.brush { background: #F7B7C4; color: var(--ink); font-size: clamp(1.5rem, 3.4vw, 2.3rem); }
.brush-pink { background: #F7A7BB; color: var(--ink); font-size: clamp(1.8rem, 5vw, 3rem); }
.brush-crimson { background: linear-gradient(90deg, #8C0E2C, #B0153C); color: var(--card-cream); font-size: clamp(1.25rem, 2.8vw, 1.8rem); text-transform: uppercase; }
.gold-brush { background: linear-gradient(90deg, #EBC88F, #F7DDAE, #E8C186); color: var(--crimson-bright); font-size: clamp(1.4rem, 3.6vw, 2.4rem); text-transform: uppercase; }
.gold-brush small { font-size: .55em; }
.brush-title { display: inline-block; background: linear-gradient(90deg, #F6B6C3, #FBD4DC, #F6B6C3); color: var(--crimson); font-family: var(--f-marker); font-size: clamp(2rem, 6vw, 3.6rem); text-transform: uppercase; padding: 2px 30px; clip-path: polygon(0 16%, 5% 2%, 55% 0, 97% 6%, 100% 40%, 97% 92%, 50% 100%, 3% 96%); }
.pill-banner { background: var(--black); color: var(--white); border: 3px solid var(--pink); border-radius: var(--pill); padding: 12px 26px; text-transform: uppercase; letter-spacing: .04em; text-align: center; font-size: clamp(.85rem, 2vw, 1.3rem); }
.pill-pink { display: inline-block; background: #F7B7C4; color: var(--ink); font-family: var(--f-btn); font-stretch: 112%; font-weight: 800; text-transform: uppercase; padding: 4px 22px; border-radius: 8px; font-size: clamp(1rem, 2.6vw, 1.5rem); }
.paper-strip { background: var(--paper); color: var(--ink); padding: 20px clamp(18px, 4vw, 40px); display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; text-align: center; font-size: clamp(1.15rem, 2.6vw, 1.7rem); clip-path: polygon(0 10%, 3% 0, 60% 6%, 100% 0, 98% 50%, 100% 100%, 40% 94%, 2% 100%, 1% 50%); }
.paper-strip .ico { width: 54px; height: 54px; flex: none; color: var(--crimson); }

/* ---------- Lists ---------- */
.check-list li, .tick-list li { display: flex; align-items: flex-start; gap: 12px; padding: 5px 0; }
.check-list .ico { width: 26px; height: 26px; flex: none; color: #D0254F; border: 2px solid #D0254F; border-radius: 4px; padding: 2px; stroke-width: 2.4; }
.tick-list .ico { width: 30px; height: 30px; flex: none; color: var(--pink); stroke-width: 3.2; }

/* tickable grocery boxes */
.ticks li { padding: 3px 0; }
.tick { display: flex; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; font-size: 1.08rem; }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick .box { width: 26px; height: 26px; flex: none; border: 2px solid #8C1430; border-radius: 4px; background: #fff8; display: inline-flex; align-items: center; justify-content: center; }
.tick .box .ico { width: 20px; height: 20px; color: #D0254F; stroke-width: 3; opacity: 0; transform: scale(.4); transition: .15s; }
.tick input:checked + .box .ico { opacity: 1; transform: scale(1); }
.tick input:checked ~ span:last-child { text-decoration: line-through; text-decoration-color: #D0254F88; }
.tick input:focus-visible + .box { outline: 3px solid var(--crimson); outline-offset: 2px; }

/* ---------- Chalkboard, sticky, notes ---------- */
.chalk { background: var(--bottle); border: 12px solid #F4EBDD; box-shadow: var(--shadow); padding: 22px 20px; transform: rotate(-3deg); max-width: 300px; position: relative; }
.chalk::before { content: ''; position: absolute; top: -22px; left: 38%; width: 70px; height: 26px; background: #F7A7BBcc; transform: rotate(4deg); }
.chalk p { color: #F4EBDD; font-size: clamp(1.5rem, 3.4vw, 2.1rem); text-align: center; }
.chalk.tilt-r { transform: rotate(4deg); }
.sticky { background: linear-gradient(170deg, #F9B2BF, #F59AAE); color: var(--ink); padding: 26px 24px; transform: rotate(-3deg); box-shadow: var(--shadow); max-width: 340px; }
.sticky h3 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); border-bottom: 3px solid var(--ink); display: inline-block; margin-bottom: 10px; }
.sticky p { font-size: clamp(1.3rem, 2.8vw, 1.7rem); text-align: center; }
.signoff { color: var(--card-cream); font-size: clamp(1.4rem, 3vw, 1.9rem); transform: rotate(-6deg); text-align: center; }
.pink-note { background: #F9C3CE; color: var(--ink); padding: 16px 20px; border-radius: 6px; text-align: center; font-size: 1.15rem; transform: rotate(-1deg); }
.pink-note.script { font-size: 1.35rem; }

/* ---------- Scorecard ---------- */
.scorecard { background: linear-gradient(180deg, var(--bottle-2), var(--bottle)); border: 2px solid #B89A55; border-radius: 16px; padding: 22px clamp(16px, 3vw, 28px); box-shadow: var(--shadow); color: var(--white); }
.scorecard.crimson { background: linear-gradient(180deg, #4A0414, #2A020B); }
.gold-caps { color: var(--score-gold); text-align: center; letter-spacing: .24em; text-transform: uppercase; font-size: clamp(1rem, 2.2vw, 1.35rem); font-weight: 700; margin-bottom: 10px; }
.scorecard ul li { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid #ffffff22; }
.scorecard ul li:first-child { border-top: 0; }
.scorecard ul .ico { width: 34px; height: 34px; }
.scorecard ul strong { display: block; font-weight: 600; font-size: 1.05rem; }
.scorecard ul small { display: block; color: #d4d4d4; font-size: .9rem; }
.scorecard ul b { font-size: 1.25rem; font-weight: 500; }
.score-total { margin-top: 10px; border: 2px solid #B89A55; border-radius: 12px; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; color: var(--score-gold); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: clamp(1.1rem, 2.6vw, 1.5rem); }
.score-total b { color: var(--white); font-weight: 600; letter-spacing: 0; }
.score-actions { display: grid; gap: 12px; margin-top: 18px; }
.btn-score { background: var(--pink); color: var(--black); border-color: transparent; font-size: 1rem; width: 100%; padding: 12px 18px; text-transform: none; font-family: var(--f-sans); font-weight: 700; }
.score-status { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 1px dashed #B89A5588; border-radius: 12px; }
.score-status .ico { color: var(--score-gold); flex: none; }
.score-status small { display: block; color: #cfcfcf; font-size: .85rem; }

/* ---------- Dialog / scoring form ---------- */
.dialog { border: 0; padding: 0; border-radius: 18px; width: min(680px, calc(100vw - 20px)); max-height: calc(100dvh - 24px); background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.dialog::backdrop { background: rgba(10, 2, 5, .78); backdrop-filter: blur(3px); }
.score-form { padding: clamp(18px, 4vw, 30px); display: grid; gap: 16px; }
.score-form__pass { text-align: center; display: grid; gap: 8px; }
.score-form__pass .spaced-caps { color: var(--crimson); }
.score-form .serif-title { font-size: clamp(1.6rem, 5vw, 2.4rem); }
.score-form__fields { display: grid; gap: 12px; }
.score-form__total { text-align: center; font-size: 1.2rem; }
.score-form__total b { font-size: 1.6rem; color: var(--crimson); }
.form-error { color: #B00030; font-weight: 600; text-align: center; }
.seg { border: 1px solid #00000022; border-radius: 12px; padding: 12px; margin: 0; background: #fff6; }
.seg.is-missing { border-color: #B00030; box-shadow: 0 0 0 2px #B0003055; }
.seg legend { font-weight: 700; padding: 0 6px; font-size: 1rem; }
.seg legend small { display: block; font-weight: 400; color: #555; }
.seg__opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.seg__opts label { flex: 1 1 0; min-width: 44px; position: relative; }
.seg__opts input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg__opts span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 6px 10px; border-radius: 10px; border: 2px solid #8C1430; background: #fff; font-weight: 600; font-size: .95rem; text-align: center; line-height: 1.15; }
.seg__opts span b { color: var(--crimson); }
.seg__opts input:checked + span { background: var(--crimson); color: var(--white); }
.seg__opts input:checked + span b { color: var(--score-gold); }
.seg__opts input:focus-visible + span { outline: 3px solid var(--score-gold); outline-offset: 2px; }
.twist-toggle { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border-radius: 12px; background: #F9C3CE; font-weight: 600; cursor: pointer; }
.twist-toggle input { width: 24px; height: 24px; accent-color: var(--crimson); flex: none; }
.confirm { text-align: center; }

/* ---------- Neon badge ---------- */
.neon-badge { display: inline-flex; align-items: center; gap: 16px; padding: 14px 34px; border: 3px solid #FFB3C8; border-radius: var(--pill); color: #FFE9EF; text-transform: uppercase; font-family: var(--f-btn); font-stretch: 112%; font-weight: 700; letter-spacing: .08em; line-height: 1.05; font-size: clamp(1rem, 2.4vw, 1.4rem); box-shadow: 0 0 10px var(--neon-glow), inset 0 0 10px var(--neon-glow); text-shadow: 0 0 8px var(--neon-glow); }
.neon-badge strong { font-size: 1.5em; letter-spacing: .06em; }
.neon-badge .ico { width: 54px; height: 54px; flex: none; }
.neon-badge.big { font-size: clamp(1.1rem, 3vw, 1.8rem); }

/* ---------- Timer ---------- */
.timer { margin-top: 14px; padding: 12px; border-radius: 12px; background: #fff; border: 2px solid #E9C9CF; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.timer__display { font-family: var(--f-btn); font-stretch: 112%; font-weight: 800; font-size: 1.8rem; color: var(--crimson); min-width: 5ch; text-align: center; font-variant-numeric: tabular-nums; }
.timer__btns { display: flex; gap: 8px; }
.timer.is-running { border-color: var(--crimson); }
.timer.is-done .timer__display { color: var(--crimson-bright); font-size: 1.4rem; }

/* ---------- Confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; transform: translateX(40px) rotate(720deg); } }
