/* Wine Enthusiasts — club site styles */
:root {
  --bg: #faf5ee;
  --bg-deep: #f2ebe0;
  --card: #ffffff;
  --ink: #2b2320;
  --ink-soft: #6b5f57;
  --ink-faint: #93857b;
  --wine: #5b1326;
  --wine-deep: #3a0c19;
  --wine-soft: #f6e3e7;
  --gold: #9a7338;
  --gold-soft: #f4ead7;
  --line: #e4d6c6;
  --good: #3f6b3a;
  --good-soft: #e5f0e1;
  --bad: #a3402f;
  --bad-soft: #f7e3de;
  --star: #c08a2c;
  --shadow: 0 1px 2px rgba(43, 35, 32, .05), 0 8px 24px rgba(43, 35, 32, .07);
  --radius: 16px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tabbar-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1412;
    --bg-deep: #150f0d;
    --card: #261d1a;
    --ink: #f0e7e0;
    --ink-soft: #c2b2a7;
    --ink-faint: #8f7f75;
    --wine: #e89aad;
    --wine-deep: #f4c3cf;
    --wine-soft: #3a2328;
    --gold: #d6ad69;
    --gold-soft: #372c1c;
    --line: #3f312c;
    --good: #9fcb8f;
    --good-soft: #243322;
    --bad: #eb9b88;
    --bad-soft: #3d2520;
    --star: #e2b458;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1412; --bg-deep: #150f0d; --card: #261d1a; --ink: #f0e7e0; --ink-soft: #c2b2a7;
  --ink-faint: #8f7f75; --wine: #e89aad; --wine-deep: #f4c3cf; --wine-soft: #3a2328; --gold: #d6ad69;
  --gold-soft: #372c1c; --line: #3f312c; --good: #9fcb8f; --good-soft: #243322; --bad: #eb9b88;
  --bad-soft: #3d2520; --star: #e2b458; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--wine); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; color: var(--wine-deep); text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-soft); }
.boot-glass { width: 44px; height: 44px; border-radius: 12px; background: var(--wine); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.88); opacity: .6; } }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--wine-deep); min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
.brand span { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: none; margin-left: auto; gap: 4px; }
.topnav a { text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 999px; }
.topnav a[aria-current="page"] { background: var(--wine-soft); color: var(--wine-deep); }
.me-chip { margin-left: auto; font-size: .9rem; color: var(--ink-soft); white-space: nowrap; text-decoration: none; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.me-chip b { color: var(--ink); }

.page { max-width: 1040px; margin: 0 auto; padding: 22px 16px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); text-decoration: none; color: var(--ink-faint); font-size: .72rem; font-weight: 600;
}
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--wine); }

@media (min-width: 860px) {
  .topnav { display: flex; }
  .me-chip { margin-left: 8px; }
  .tabbar { display: none; }
  .page { padding-bottom: 60px; padding-top: 32px; }
}

/* ---------- building blocks ---------- */
.stack > * + * { margin-top: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: .88rem; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 12px; }
.section-title h2 { font-size: 1.35rem; }
.section-title a { font-weight: 600; font-size: .95rem; text-decoration: none; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card.tap { display: block; text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.card.tap:active { transform: scale(.99); }
@media (hover: hover) { .card.tap:hover { box-shadow: 0 2px 4px rgba(43,35,32,.06), 0 14px 32px rgba(43,35,32,.1); } }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.btn {
  appearance: none; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; font-weight: 700; font-size: 1.02rem; text-decoration: none; line-height: 1.2; text-align: center;
  background: var(--wine); color: #fff; transition: filter .12s ease, transform .12s ease;
}
:root[data-theme="dark"] .btn.primary, .btn.primary { background: var(--wine); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.secondary):not(.ghost):not(.danger) { color: #1b1412; } }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: var(--card); color: var(--wine-deep); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--wine); padding: 0 12px; }
.btn.danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: .92rem; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 3px 11px; font-size: .78rem; font-weight: 700; background: var(--bg-deep); color: var(--ink-soft);
  border: 1px solid var(--line); white-space: nowrap;
}
.chip.rose { background: var(--wine-soft); color: var(--wine-deep); border-color: transparent; }
.chip.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }

.seg { display: inline-flex; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: .92rem; color: var(--ink-soft); cursor: pointer; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--wine-deep); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 700; font-size: .92rem; }
.field small { color: var(--ink-faint); font-size: .82rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); font-size: 1.02rem;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px var(--wine-soft); }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.error-box { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.note-box { background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; }

/* ---------- login ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); background:
  radial-gradient(1200px 500px at 50% -10%, var(--wine-soft), transparent 70%), var(--bg); }
.gate-card { width: 100%; max-width: 420px; text-align: center; }
.gate-card img { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 18px; box-shadow: var(--shadow); }
.gate-card h1 { margin-bottom: 6px; }
.gate-card form { text-align: left; margin-top: 26px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 76px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--wine); font-weight: 700; padding: 8px 10px; cursor: pointer; }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.name-grid .btn { min-height: 60px; font-size: 1.1rem; }

/* ---------- home ---------- */
.hello { margin-bottom: 20px; }
.hello p { margin: 6px 0 0; color: var(--ink-soft); font-size: 1.05rem; }
.next-card { background: linear-gradient(135deg, var(--wine) 0%, var(--wine-deep) 100%); color: #fff; border: 0; padding: 22px; }
.next-card h2, .next-card .eyebrow { color: #fff; }
.next-card .eyebrow { color: #f1d9a8; }
.next-card .when { font-family: var(--serif); font-size: clamp(1.6rem, 5.5vw, 2.1rem); font-weight: 600; line-height: 1.1; margin: 2px 0 4px; }
.next-card .sub { color: rgba(255,255,255,.82); margin: 0; }
.next-card .countdown { display: inline-block; margin-top: 12px; background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .9rem; }
.bring { margin-top: 18px; background: rgba(255,255,255,.08); border-radius: 12px; padding: 4px 14px; }
.bring-row { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.bring-row:last-child { border-bottom: 0; }
.bring-row .who { font-weight: 700; min-width: 64px; }
.bring-row .what { flex: 1; min-width: 0; }
.bring-row .tbd { color: rgba(255,255,255,.6); font-style: italic; }
.next-card .btn.secondary { background: #fff; color: var(--wine-deep); border: 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .next-card { background: linear-gradient(135deg, #6d1a2f 0%, #3a0c19 100%); }
  :root:not([data-theme="light"]) .next-card .btn.secondary { color: #3a0c19; }
}

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (min-width: 700px) { .actions { grid-template-columns: repeat(4, 1fr); } }
.action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  font-weight: 700; min-height: 108px; cursor: pointer; text-align: left; font-size: 1rem;
}
.action .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--wine-soft); color: var(--wine); }
.action .ico svg { width: 24px; height: 24px; }
.action small { display: block; font-weight: 500; color: var(--ink-soft); font-size: .82rem; margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 1.9rem; color: var(--wine-deep); line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }

.exam { display: flex; align-items: center; gap: 16px; }
.exam .days { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; color: var(--wine); line-height: 1; min-width: 64px; text-align: center; }

/* ---------- tastings ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 6px; }
.toolbar .input { flex: 1 1 220px; }
.year { display: flex; align-items: center; gap: 12px; margin: 30px 0 12px; color: var(--gold); font-weight: 700; letter-spacing: .2em; font-size: .8rem; }
.year::before, .year::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.t-list { display: flex; flex-direction: column; gap: 14px; }
.t-card { border-left: 4px solid var(--wine); }
.t-card.upcoming { border-left-color: var(--gold); }
.t-card.skipped { border-left-color: var(--line); }
.t-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.t-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.t-title .num { font-weight: 700; color: var(--gold); font-size: .85rem; }
.t-title h3 { font-size: 1.3rem; }
.t-date { color: var(--ink-soft); font-size: .92rem; font-weight: 600; }
.t-pours { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.t-pours li { display: grid; grid-template-columns: 78px 1fr; gap: 10px; font-size: .95rem; }
.t-pours .who { font-weight: 700; color: var(--gold); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; padding-top: 3px; }
.t-pours .tbd { color: var(--ink-faint); font-style: italic; }
.t-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.host-badge::before { content: "🏠"; }

.detail-hero { margin-bottom: 8px; }
.detail-hero .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; color: var(--ink-soft); font-weight: 600; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; margin-bottom: 14px; min-height: 40px; }
.pour { display: flex; flex-direction: column; gap: 10px; }
.pour .who .chip { letter-spacing: 0; text-transform: none; }
.pour .who { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--gold); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pour .wine { font-family: var(--serif); font-size: 1.18rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.pour .details { color: var(--ink-soft); font-size: .95rem; margin: 0; white-space: pre-line; }
.ratings { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rating-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: .92rem; }
.rating-line b { min-width: 56px; }
.rating-line .note { color: var(--ink-soft); font-style: italic; }
.rating-line button { border: 0; background: none; color: var(--ink-faint); cursor: pointer; font-size: .8rem; padding: 2px 6px; }
.prose { white-space: pre-line; }

.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--line); }
.star-input { display: flex; gap: 2px; }
.star-input button { border: 0; background: none; font-size: 2rem; line-height: 1; padding: 4px; cursor: pointer; color: var(--line); min-width: 44px; min-height: 44px; }
.star-input button.on { color: var(--star); }

.pour-row { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg); display: grid; gap: 12px; }
.pour-row .spread h3 { font-size: 1rem; font-family: var(--sans); font-weight: 700; color: var(--ink); }

/* ---------- photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 700px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }
.photo-grid button { border: 0; padding: 0; background: var(--bg-deep); border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: pointer; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.strip button { flex: 0 0 116px; height: 116px; border: 0; padding: 0; border-radius: 12px; overflow: hidden; scroll-snap-align: start; cursor: pointer; background: var(--bg-deep); }
.strip img { width: 100%; height: 100%; object-fit: cover; }
.empty { text-align: center; padding: 34px 18px; color: var(--ink-soft); border: 2px dashed var(--line); border-radius: var(--radius); }
.empty .big { font-size: 2.2rem; }

.lightbox { position: fixed; inset: 0; z-index: 60; background: #0e0908; display: flex; flex-direction: column; color: #fff; }
.lightbox .lb-top { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; gap: 8px; }
.lightbox .lb-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 8px; touch-action: pan-y; }
.lightbox .lb-img img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; }
.lightbox .lb-bottom { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.lightbox .lb-caption { font-size: 1.05rem; }
.lightbox .lb-meta { color: rgba(255,255,255,.7); font-size: .88rem; }
.lb-btn { border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 999px; min-height: 44px; min-width: 44px; padding: 0 14px; font-weight: 700; cursor: pointer; font-size: .95rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.6rem; }
.lb-nav.prev { left: 8px; } .lb-nav.next { right: 8px; }

/* ---------- sheet / modal ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20, 10, 8, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--bg);
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
  animation: up .2s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet-head button { border: 0; background: var(--bg-deep); border-radius: 999px; width: 40px; height: 40px; font-size: 1.3rem; cursor: pointer; color: var(--ink-soft); }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-actions .btn { flex: 1; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 80;
  bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100% - 32px); text-align: center; animation: up .2s ease;
}
@media (min-width: 860px) { .toast { bottom: 28px; } }

.progress { height: 10px; background: var(--bg-deep); border-radius: 999px; overflow: hidden; }
.progress div { height: 100%; background: var(--wine); width: 0; transition: width .2s ease; }
.thumbs-preview { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

/* ---------- study ---------- */
.guide-card, .card.tap.guide-card { display: flex; gap: 14px; align-items: center; }
.guide-card .emoji { font-size: 1.9rem; width: 54px; height: 54px; border-radius: 14px; background: var(--wine-soft); display: grid; place-items: center; flex-shrink: 0; }
.guide-card h3 { font-size: 1.12rem; }
.quiz-card { max-width: 680px; margin: 0 auto; }
.quiz-progress { display: flex; justify-content: space-between; font-weight: 700; color: var(--ink-soft); font-size: .9rem; margin-bottom: 8px; }
.q-text { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.35; margin: 12px 0 18px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px 16px;
  cursor: pointer; font-size: 1.02rem; min-height: 56px; display: flex; gap: 12px; align-items: flex-start;
}
.opt .letter { font-weight: 700; color: var(--ink-faint); }
.opt:disabled { cursor: default; }
.opt.correct { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.dim { opacity: .55; }
.explain { margin-top: 16px; background: var(--gold-soft); border-radius: 12px; padding: 14px 16px; }
.score-big { font-family: var(--serif); font-size: 3.4rem; font-weight: 700; color: var(--wine); line-height: 1; }
.flash {
  perspective: 1200px; max-width: 560px; margin: 0 auto; cursor: pointer; border: 0; background: none; padding: 0; width: 100%; display: block;
}
.flash-inner { position: relative; min-height: 280px; transition: transform .45s ease; transform-style: preserve-3d; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  padding: 26px 22px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px;
}
.flash-face.back { transform: rotateY(180deg); background: var(--wine-soft); }
.flash-face .q { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--wine-deep); line-height: 1.3; }
.flash-face .a { font-size: 1.12rem; line-height: 1.5; }
.flash-face .hint { font-size: .8rem; color: var(--ink-faint); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .flash-inner { transition: none; } }

.member-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-row .tools { display: flex; gap: 4px; }
.icon-btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; width: 42px; height: 42px; cursor: pointer; font-size: 1rem; color: var(--ink-soft); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--wine); }

/* ---------- chip pickers & tasting notes ---------- */
.pick {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: 8px 14px; min-height: 44px; font-weight: 600; font-size: .95rem; cursor: pointer;
}
.pick[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pick[aria-pressed="true"] { color: #1b1412; } }
.pick.big { min-height: 52px; padding: 10px 18px; font-size: 1rem; }
.sat-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 18px; margin: 0; background: var(--card); }
.sat-box legend { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--wine-deep); padding: 0 6px; }
.sat-q { margin: 14px 0 8px; }
.sat-label { font-weight: 700; display: block; margin-bottom: 6px; }
.sat-sub { font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; margin: 10px 0 6px; }
.sat-details { border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; }
.sat-details summary { cursor: pointer; font-weight: 700; color: var(--wine); min-height: 32px; }
.sat-details[open] summary { margin-bottom: 12px; }

/* ---------- wine glass animation ---------- */
.glass-art { width: 76px; margin: 0 auto 14px; color: var(--wine-deep); }
.glass-art.big { width: 96px; }
.glass-art svg { width: 100%; height: auto; display: block; overflow: visible; }
.glass-art .wine-level { transform: translateY(70px); animation: fill 1.8s cubic-bezier(.3, .7, .3, 1) .2s forwards; }
.glass-art .wave { animation: slosh 2.6s ease-in-out infinite; }
@keyframes fill { to { transform: translateY(0); } }
@keyframes slosh { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(20px); } }
.boot-glass { background: none; width: auto; height: auto; animation: none; }
@media (prefers-reduced-motion: reduce) {
  .glass-art .wine-level { animation: none; transform: none; }
  .glass-art .wave { animation: none; }
}
.cheers { position: fixed; left: 50%; top: 45%; z-index: 90; font-size: 5rem; transform: translate(-50%, -50%); animation: cheers 1.3s ease forwards; pointer-events: none; }
@keyframes cheers {
  0% { transform: translate(-50%, -30%) scale(.4) rotate(-12deg); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.15) rotate(8deg); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1) rotate(-6deg); }
  100% { transform: translate(-50%, -80%) scale(.9); opacity: 0; }
}
.grape-rain { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.grape-rain span { position: absolute; top: -40px; animation: drop linear forwards; }
@keyframes drop { to { transform: translateY(110vh) rotate(260deg); opacity: .9; } }

/* ---------- tools ---------- */
.big-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 14px; font-size: 1.08rem; }
.serve { display: flex; gap: 16px; align-items: flex-start; }
.serve-temp { flex: 0 0 96px; text-align: center; background: var(--wine-soft); border-radius: 14px; padding: 12px 6px; }
.serve-temp b { display: block; font-family: var(--serif); font-size: 1.25rem; color: var(--wine-deep); line-height: 1.15; }
.serve-temp span { font-size: .74rem; font-weight: 700; color: var(--ink-soft); }
.dish-row { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dish-row:last-child { border-bottom: 0; }
.dish-row .small { grid-column: 2; color: var(--ink-soft); }
@media (max-width: 520px) { .dish-row { grid-template-columns: 1fr; } .dish-row .small { grid-column: 1; } }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stepper-label { font-weight: 700; font-size: 1.05rem; }
.stepper-num { min-width: 56px; text-align: center; font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--wine-deep); }
.icon-btn.big { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 16px; color: var(--wine); font-weight: 700; }

/* ---------- tasting night mode ---------- */
.show {
  position: fixed; inset: 0; z-index: 40; color: #fff; display: flex; flex-direction: column;
  background: radial-gradient(1000px 600px at 50% 0%, #7a1f36, #2a0812 70%);
}
.show-top, .show-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.show-top { padding-top: calc(12px + env(safe-area-inset-top)); }
.show-bottom { padding-bottom: calc(16px + env(safe-area-inset-bottom)); font-weight: 700; color: rgba(255,255,255,.7); }
.show-stage { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px 24px; }
.show-stage.enter > * { animation: up .45s ease both; }
.show-stage h1 { color: #fff; font-size: clamp(2.2rem, 7vw, 4.6rem); max-width: 18ch; }
.show-stage .eyebrow { color: #f1d9a8; font-size: clamp(.8rem, 2vw, 1.1rem); }
.show-sub { font-size: clamp(1.05rem, 2.8vw, 1.6rem); color: rgba(255,255,255,.85); margin: 14px 0 0; max-width: 40ch; }
.show-details { font-size: clamp(.95rem, 2.2vw, 1.25rem); color: rgba(255,255,255,.72); max-width: 60ch; margin-top: 18px; white-space: pre-line; }
.show .mystery { letter-spacing: .2em; }
.show .glass-art { color: #fff; width: 90px; }
.lb-btn.big { min-height: 56px; padding: 0 24px; font-size: 1.1rem; }
.lb-btn[aria-pressed="true"] { background: #f1d9a8; color: #2a0812; }
.lb-btn:disabled { opacity: .35; }

/* ---------- printing ---------- */
.print-sheet h1 { margin: 4px 0; }
.ps-wine { border-top: 2px solid var(--line); padding-top: 12px; margin-top: 18px; }
.ps-wine h2 { font-size: 1.15rem; }
.ps-scale { display: grid; grid-template-columns: 100px 1fr; gap: 12px; font-size: .92rem; margin: 5px 0; align-items: baseline; }
.ps-opts { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.ps-line { margin: 8px 0; }
@media print {
  @page { margin: 1.2cm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, .tabbar, .no-print, .toast, .grape-rain, .cheers, .sheet-backdrop { display: none !important; }
  .page { padding: 0; max-width: none; }
  .ps-wine { break-inside: avoid; border-color: #999; }
  .muted, .faint { color: #333 !important; }
  .eyebrow { color: #555 !important; }
  h1, h2 { color: #000 !important; }
}
