/* A Very Beery Xmas — base styles. Wrapping papers live in papers.css. */

:root {
  --pine: #0f2a20;
  --stout: #2a1810;
  --ink: #22150d;
  --amber: #e8a33d;
  --gold: #f2c14e;
  --foam: #fff6e3;
  --card: #fffaf0;
  --cranberry: #c8102e;
  --muted: #7a6656;
  --line: #22150d;
  --focus: #2f7dff;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(20, 10, 4, 0.35);
  --display: 'Bowlby One', 'Arial Black', Impact, sans-serif;
  --body: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html.gated body { visibility: hidden; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--pine);
  overflow-x: hidden;
}

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

/* ---------- masthead ---------- */
.masthead {
  text-align: center;
  margin: 4px 0 16px;
  padding: 16px 12px 14px;
  background: rgba(24, 14, 8, 0.86);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.masthead h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 8.5vw, 52px);
  line-height: 0.95;
  margin: 0;
  color: var(--foam);
  letter-spacing: 0.5px;
  text-shadow: 0 3px 0 var(--ink), 0 0 0 var(--ink), 3px 3px 0 var(--ink), -2px 3px 0 var(--ink);
  transform: rotate(-2deg);
}
.masthead h1 .accent { color: var(--gold); }
.masthead .sub {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 14px;
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
}
.nav a {
  color: var(--ink);
  background: var(--foam);
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(20, 10, 4, 0.35);
}
.nav a[aria-current='page'] { background: var(--gold); }

/* ---------- cards (gift tags / beer labels) ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin: 0 0 18px;
}
.card h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.1;
  margin: 0 0 12px;
  letter-spacing: 0.3px;
}
.card .hint, .muted { color: var(--muted); font-size: 15px; }
.card.tag::before {
  /* gift-tag hole */
  content: '';
  position: absolute;
  top: 14px;
  right: 16px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--pine);
}

/* ---------- form bits ---------- */
fieldset { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
legend, .label {
  display: block;
  font-weight: 800;
  font-size: 18px;
  margin: 0 0 10px;
  padding: 0;
}
.optional-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #efe3cc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  vertical-align: 2px;
}

input[type='text'] {
  width: 100%;
  min-height: 52px;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
}
input[type='text']::placeholder { color: #b3a090; }

/* visually hidden but available to assistive tech */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* chips: radio inputs styled as big tappable pills */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 16px;
  border: 3px solid var(--line);
  border-radius: 16px;
  background: #fff;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:active { transform: scale(0.97); }
.chip:has(input:checked), .chip[aria-pressed='true'] {
  background: var(--gold);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}
.chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* 1–10 scale: one row on wide screens, 2×5 on phones */
.scale {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
.scale label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 52px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-family: var(--display);
  font-size: 20px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s, background 0.15s;
}
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label:active { transform: scale(0.94); }
.scale label:has(input:checked) {
  background: var(--amber);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 var(--line);
}
.scale label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.25;
}
.scale-ends span:last-child { text-align: right; }
@media (max-width: 420px) {
  .scale { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- buttons ---------- */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 26px;
  border: 3px solid var(--line);
  border-radius: 999px;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--ink);
  background: var(--gold);
  box-shadow: 0 5px 0 var(--line);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary { background: var(--foam); font-size: 17px; min-height: 50px; }
.btn-primary:hover, .btn-secondary:hover { filter: brightness(1.05); }
.btn-primary:active, .btn-secondary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.btn-primary:disabled {
  background: #d9cdb6;
  color: #8c7b6a;
  box-shadow: 0 5px 0 #8c7b6a;
  border-color: #8c7b6a;
  cursor: not-allowed;
}
.btn-block { width: 100%; }

.sticky-submit {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 8px -18px -20px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(255, 250, 240, 0), var(--card) 30%);
  border-radius: 0 0 var(--radius) var(--radius);
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- day picker ---------- */
.days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.days .chip {
  flex: 0 0 auto;
  min-width: 56px;
  justify-content: center;
  scroll-snap-align: center;
  font-family: var(--display);
  font-weight: 400;
  font-size: 18px;
}
.days .chip.done { background: #e4f3e7; color: #2c6b3f; cursor: default; }
.days .chip.done::after { content: '✓'; margin-left: 4px; font-family: var(--body); font-weight: 900; }
.days .chip.today { border-style: dashed; }

/* ---------- the gift ---------- */
.gift-stage { display: grid; place-items: center; padding: 6px 0 4px; }
.gift {
  position: relative;
  width: min(230px, 62vw);
  aspect-ratio: 1 / 0.92;
  margin: 26px auto 14px;
  filter: drop-shadow(0 10px 0 rgba(20, 10, 4, 0.35));
}
.gift .gift-paper, .gift .gift-lid {
  position: absolute;
  border: 3px solid var(--line);
}
.gift .gift-paper { inset: 22% 4% 0 4%; border-radius: 10px; }
.gift .gift-lid {
  left: 0; right: 0; top: 10%;
  height: 18%;
  border-radius: 10px;
  z-index: 2;
  transform-origin: 20% 100%;
}
.gift .gift-lid .gift-paper { position: absolute; inset: 0; border: 0; border-radius: 7px; }
.gift .ribbon-v {
  position: absolute;
  top: 10%; bottom: 0; left: 50%;
  width: 16%;
  transform: translateX(-50%);
  background: var(--gold);
  border-left: 3px solid var(--line);
  border-right: 3px solid var(--line);
  z-index: 1;
}
.gift .gift-lid .ribbon-v { top: 0; bottom: 0; z-index: 3; }
.gift .bow {
  position: absolute;
  left: 50%; top: -6%;
  width: 46%;
  height: 22%;
  transform: translateX(-50%);
  z-index: 4;
}
.gift .bow::before, .gift .bow::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--gold);
  border: 3px solid var(--line);
  border-radius: 50% 50% 10% 50%;
}
.gift .bow::before { left: 0; transform: rotate(-18deg); }
.gift .bow::after { right: 0; transform: scaleX(-1) rotate(-18deg); }
.gift-label {
  font-family: var(--display);
  font-size: 26px;
  text-align: center;
  margin: 0;
}

.beer-name {
  font-family: var(--display);
  font-size: clamp(24px, 6.5vw, 32px);
  line-height: 1.08;
  margin: 4px 0 6px;
}
.brewery { color: var(--muted); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; font-size: 14px; }

/* ---------- leaderboards ---------- */
.medal {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid var(--line);
  font-family: var(--display);
  font-size: 20px;
}
.medal-1 { background: linear-gradient(135deg, #f6d77a, #c8952b); }
.medal-2 { background: linear-gradient(135deg, #f2f2f2, #a9a9a9); }
.medal-3 { background: linear-gradient(135deg, #f0b98a, #a8642e); }

.notice {
  background: #fff1d6;
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 600;
}
.notice.error { background: #ffe0dc; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- survey page ---------- */
.center { text-align: center; }
.field { margin: 0 0 22px; }
.other-wrap input { margin-top: 10px; }
.gift-card { text-align: center; }
.gift-card .btn-primary { margin-top: 6px; }
.gift-status { margin-top: 12px; }
.reveal-head { text-align: center; margin: 0 0 22px; padding-bottom: 18px; border-bottom: 3px dashed #e3d4b8; }
.survey-form .sticky-submit .hint { margin: 8px 0 0; font-size: 13px; }
.form-status .notice { margin: 0 0 10px; }
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0 4px;
}
.countdown span {
  display: grid;
  place-items: center;
  padding: 10px 0;
  border: 3px solid var(--line);
  border-radius: 16px;
  background: var(--gold);
}
.countdown b { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 8vw, 38px); line-height: 1; }
.countdown small { font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }

/* ---------- leaderboard ---------- */
.podium, .raters, .picks, .bars { list-style: none; margin: 0; padding: 0; }
.podium-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 3px dashed #e3d4b8;
}
.podium-row:first-child { border-top: 0; padding-top: 4px; }
.podium-body { flex: 1; min-width: 0; }
.podium-beer { margin: 0; font-family: var(--display); font-size: 19px; line-height: 1.1; overflow-wrap: anywhere; }
.podium-meta { margin: 3px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.podium-score { display: grid; justify-items: end; flex: 0 0 auto; }
.podium-score b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; }
.podium-score small { color: var(--muted); font-size: 12px; font-weight: 700; }
.mystery { color: var(--cranberry); font-weight: 800; }

.rater {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 2px solid #efe3cc;
}
.rater:first-child { border-top: 0; }
.rater-rank {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--display);
  font-size: 15px;
}
.rater:nth-child(-n + 3) .rater-rank { background: var(--gold); color: var(--ink); border: 2px solid var(--line); }
.rater-body { flex: 1; min-width: 0; }
.rater-name { margin: 0; font-weight: 800; font-size: 18px; overflow-wrap: anywhere; }
.rater-fav { margin: 1px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.rater-fav b { color: var(--ink); }
.rater-count { display: grid; justify-items: center; flex: 0 0 auto; }
.rater-count b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; }
.rater-count small { color: var(--muted); font-size: 12px; font-weight: 700; }

.picks li { padding: 10px 0; border-top: 2px solid #efe3cc; }
.picks li:first-child { border-top: 0; }
.pick-beer { margin: 0; font-family: var(--display); font-size: 18px; overflow-wrap: anywhere; }
.pick-who { margin: 2px 0 0; color: var(--muted); overflow-wrap: anywhere; }

.bars li { margin: 0 0 12px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 600; line-height: 1.25; margin-bottom: 5px; }
.bar-label b { font-family: var(--display); font-weight: 400; font-size: 17px; }
.bar-track { height: 14px; border-radius: 4px; background: #f1e6d0; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: #b5651d; min-width: 0; transition: width 0.6s ease; }
