/* ==========================================================================
   Uncorked: styles
   Warm wine-bar palette, simple shapes, emoji characters. No images needed.
   ========================================================================== */

:root {
  --cream: #fbf5ec;
  --paper: #ffffff;
  --ink: #2b1d22;
  --muted: #6e5b61;
  --wine: #7a1f3d;
  --wine-dark: #5a1229;
  --wine-soft: #f4e3e8;
  --gold: #d9a441;
  --gold-soft: #fbefd6;
  --white-grape: #e7c55a;
  --sage: #5f8a6a;
  --sage-soft: #e3efe5;
  --oops: #b8483e;
  --oops-soft: #f9e2df;
  --line: #eadfd3;
  --radius: 18px;
  --shadow: 0 2px 0 rgba(90, 18, 41, .08), 0 8px 24px rgba(90, 18, 41, .08);
  --font-head: 'Fraunces', Georgia, serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  background-image: radial-gradient(circle at 10% 0%, #f7e6dc 0, transparent 40%),
                    radial-gradient(circle at 100% 30%, #f3ecd9 0, transparent 35%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .4em; color: var(--wine-dark); }
h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--wine); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

#app { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; outline: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: rgba(251, 245, 236, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; color: var(--wine-dark); text-decoration: none; white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: .95rem; }
.topnav a { text-decoration: none; white-space: nowrap; }
.topnav a:hover { text-decoration: underline; }
.corks { background: var(--gold-soft); border-radius: 99px; padding: 2px 10px; white-space: nowrap; }
@media (max-width: 480px) {
  .topbar { padding: 10px 12px; }
  .topnav { gap: 10px; font-size: .85rem; }
  .brand { font-size: 1.1rem; }
  .wide-only { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 1rem var(--font-body);
  padding: 13px 22px; min-height: 48px;
  border-radius: 99px; border: 2px solid var(--wine);
  background: var(--wine); color: #fff;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 3px 0 var(--wine-dark);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { background: var(--wine-dark); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wine-dark); }
.btn.secondary { background: var(--paper); color: var(--wine); box-shadow: 0 3px 0 var(--line); }
.btn.secondary:hover { background: var(--wine-soft); }
.btn.gold { background: var(--gold); border-color: #b9872d; color: var(--ink); box-shadow: 0 3px 0 #b9872d; }
.btn.gold:hover { background: #e6b354; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 18px;
}
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.big-emoji { font-size: 3.4rem; line-height: 1; display: block; margin-bottom: 10px; }

/* ---------- Age gate ---------- */
.gate { min-height: 80vh; display: grid; place-items: center; text-align: center; }
.gate .card { max-width: 460px; padding: 36px 26px; }
.gate .bottle { font-size: 4.5rem; display: block; animation: wobble 2.8s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* ---------- Home ---------- */
.hero { text-align: center; padding: 18px 0 8px; }
.hero .tag { font-size: 1.15rem; color: var(--muted); max-width: 520px; margin: 0 auto 8px; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 30px; }
.quick-link {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.quick-link b { display: block; font-family: var(--font-head); color: var(--wine-dark); font-size: 1.1rem; }
.quick-link span { font-size: .9rem; color: var(--muted); }
.quick-link:hover { border-color: var(--wine); }

/* The vineyard path */
.path { position: relative; margin: 10px 0; padding-left: 0; list-style: none; }
.path::before {
  content: ''; position: absolute; left: 33px; top: 30px; bottom: 30px;
  border-left: 4px dotted #d8c3b0;
}
.stop { position: relative; display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.stop .dot {
  flex: 0 0 70px; height: 70px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2rem;
  background: var(--paper); border: 3px solid var(--line); z-index: 1;
}
.stop.done .dot { border-color: var(--sage); background: var(--sage-soft); }
.stop.open .dot { border-color: var(--wine); background: var(--wine-soft); animation: pulse 2s ease-in-out infinite; }
.stop.final .dot { border-color: var(--gold); background: var(--gold-soft); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(122, 31, 61, .25); } 50% { box-shadow: 0 0 0 10px rgba(122, 31, 61, 0); } }
.stop .info {
  flex: 1; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); display: block;
}
a.info:hover { border-color: var(--wine); }
.stop .info .num { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stop .info h3 { margin: 2px 0 2px; }
.stop .info p { margin: 0; font-size: .92rem; color: var(--muted); }
.stop.locked .info { opacity: .6; }
.pill { display: inline-block; font-size: .75rem; font-weight: 800; padding: 2px 9px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.pill.done { background: var(--sage-soft); color: var(--sage); }
.pill.soon { background: var(--line); color: var(--muted); }
.pill.go { background: var(--wine-soft); color: var(--wine); }

.badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold-soft); border: 1px solid #f0d9a6; border-radius: 99px;
  padding: 4px 12px; font-weight: 800; font-size: .9rem;
}

/* ---------- Progress ---------- */
.stepper { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.stepper .label { font-weight: 800; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--wine), #b23a62); border-radius: 99px; transition: width .4s ease; }

/* ---------- Learn cards ---------- */
.learn-card { text-align: center; min-height: 300px; display: flex; flex-direction: column; justify-content: center; }
.learn-card p { font-size: 1.08rem; max-width: 520px; margin-left: auto; margin-right: auto; }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--wine); }

/* Grape character card */
.grape-card { text-align: left; }
.grape-card .head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.grape-card .face {
  flex: 0 0 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.4rem;
}
.face.white { background: #fbf1cf; border: 3px solid var(--white-grape); }
.face.red { background: var(--wine-soft); border: 3px solid var(--wine); }
.grape-card .nick { font-weight: 800; color: var(--muted); font-size: .9rem; }
.grape-card .persona { font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip { background: var(--cream); border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px; font-size: .9rem; font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.fact { background: var(--cream); border-radius: 12px; padding: 8px 12px; }
.fact b { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.meter { display: flex; gap: 3px; margin-top: 4px; }
.meter i { flex: 1; height: 7px; border-radius: 4px; background: var(--line); }
.meter i.on { background: var(--wine); }
.where { font-size: .95rem; }

/* ---------- Questions ---------- */
.q-text { font-family: var(--font-head); font-size: clamp(1.25rem, 4vw, 1.55rem); color: var(--ink); margin-bottom: 18px; font-weight: 600; }
.options { display: grid; gap: 10px; }
.option {
  text-align: left; width: 100%;
  font: 700 1.02rem var(--font-body); color: var(--ink);
  background: var(--paper); border: 2px solid var(--line); border-radius: 14px;
  padding: 14px 16px; min-height: 52px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .08s;
}
.option:hover:not([disabled]) { border-color: var(--wine); background: var(--wine-soft); }
.option:active:not([disabled]) { transform: scale(.99); }
.option[disabled] { cursor: default; }
.option.right { border-color: var(--sage); background: var(--sage-soft); }
.option.right::after { content: '  ✓'; color: var(--sage); }
.option.wrong { border-color: var(--oops); background: var(--oops-soft); }
.option.wrong::after { content: '  ✗'; color: var(--oops); }
.option.faded { opacity: .55; }
.options.row { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.options.row .option { text-align: center; }

.feedback { margin-top: 16px; border-radius: 14px; padding: 14px 16px; animation: pop .25s ease; }
.feedback.good { background: var(--sage-soft); border-left: 5px solid var(--sage); }
.feedback.bad { background: var(--oops-soft); border-left: 5px solid var(--oops); }
.feedback b { display: block; font-size: 1.05rem; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.comeback { display: inline-block; background: var(--gold-soft); border-radius: 99px; padding: 2px 10px; font-size: .8rem; font-weight: 800; margin-bottom: 10px; }

/* Sort game */
.sort-item {
  text-align: center; font-family: var(--font-head); font-size: 1.5rem; font-weight: 600;
  background: var(--cream); border: 2px dashed #d8c3b0; border-radius: 16px;
  padding: 22px 16px; margin-bottom: 16px;
}
.shelves { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 18px; }
.shelf { background: var(--cream); border-radius: 12px; padding: 8px 10px; min-height: 58px; border-bottom: 5px solid #c9a888; }
.shelf b { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.shelf .mini { display: block; font-size: .82rem; font-weight: 600; }

/* Who am I */
.clues { list-style: none; padding: 0; margin: 0 0 18px; }
.clues li {
  background: var(--cream); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px;
  animation: pop .3s ease; font-weight: 600;
}
.clues li::before { content: '🔍 '; }
.cork-pot { font-weight: 800; color: var(--wine); }

/* Perfect Match: Taste-o-Meter */
.sort-item .big-emoji { margin-bottom: 6px; }
.tasteo { margin-top: 18px; }
.tasteo-label { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.tasteo-track {
  position: relative; height: 16px; border-radius: 99px; margin: 0 14px;
  background: linear-gradient(90deg, #e6a097 0%, #f1d58a 50%, #9cc7a5 100%);
}
.tasteo-track i {
  position: absolute; top: 50%; left: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  display: grid; place-items: center; font-style: normal; font-size: 1.1rem;
  background: #fff; border: 3px solid var(--wine); border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  transition: left 1.1s cubic-bezier(.2, 1.3, .4, 1);
}

/* Order game */
.order-slots { display: grid; gap: 8px; margin-bottom: 16px; }
.slot {
  display: flex; align-items: center; gap: 10px;
  border: 2px dashed #d8c3b0; border-radius: 12px; padding: 10px 14px; min-height: 50px;
  font-weight: 700; color: var(--muted);
}
.slot.filled { border-style: solid; border-color: var(--wine); color: var(--ink); background: var(--wine-soft); }
.slot.right-slot { border-color: var(--sage); background: var(--sage-soft); }
.slot.wrong-slot { border-color: var(--oops); background: var(--oops-soft); }
.slot .n { width: 26px; height: 26px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: .85rem; color: var(--ink); }
.scale-label { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Completion ---------- */
.confetti { font-size: 2.6rem; letter-spacing: 6px; animation: pop .5s ease; }
.score-big { font-family: var(--font-head); font-size: 3.4rem; font-weight: 800; color: var(--wine); line-height: 1; }

/* ---------- Flavour Map ---------- */
.flavour-map { width: 100%; height: auto; display: block; }
.flavour-map .axis { fill: var(--muted); font: 800 11px var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.flavour-map .lbl { font: 700 12.5px var(--font-body); fill: var(--ink); }
.map-legend { display: flex; gap: 16px; justify-content: center; font-size: .85rem; font-weight: 700; color: var(--muted); }
.map-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* ---------- Cheat sheet ---------- */
.cheat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.mini-grape { display: flex; gap: 12px; align-items: flex-start; background: var(--cream); border-radius: 12px; padding: 10px 12px; }
.mini-grape .face { flex: 0 0 44px; height: 44px; font-size: 1.4rem; border-radius: 50%; display: grid; place-items: center; }
.mini-grape b { display: block; }
.mini-grape span { font-size: .92rem; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rules li { background: var(--cream); border-radius: 12px; padding: 10px 12px; }
.rules li b { display: block; }
.rules li span { font-size: .9rem; color: var(--muted); }
table.temps { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.temps td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
table.temps td:last-child { text-align: right; font-weight: 800; white-space: nowrap; }
select {
  font: 700 1rem var(--font-body); padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--paper); color: var(--ink); width: 100%; min-height: 48px;
}
.try-box { margin-top: 12px; }
.try { background: var(--wine-soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.phrases { padding-left: 1.1em; margin: 0; }
.phrases li { margin-bottom: 6px; font-style: italic; }
.section-title { display: flex; align-items: center; gap: 8px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.toc a { background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; text-decoration: none; font-weight: 700; font-size: .88rem; }

/* ---------- Results / certificate ---------- */
.breakdown { list-style: none; padding: 0; margin: 0; }
.breakdown li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.breakdown .score { font-weight: 800; }
input[type="text"] {
  font: 700 1.1rem var(--font-body); padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  width: 100%; min-height: 50px; background: var(--paper); color: var(--ink);
}
input[type="text"]:focus { border-color: var(--wine); outline: none; }
.cert-preview { width: 100%; height: auto; border-radius: 10px; box-shadow: var(--shadow); margin-top: 16px; display: block; }

/* ---------- Footer ---------- */
.footer { max-width: 760px; margin: 0 auto; padding: 10px 16px 40px; text-align: center; font-size: .8rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Move my progress */
.move-link { width: 100%; margin: 6px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: .8rem; color: var(--muted); background: var(--cream); text-overflow: ellipsis; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
