/* Blind Pour. One stylesheet for the taster and the host pages.
   Dark by default (a tasting is an evening thing), light when the device is. */

:root {
  --bg: #1a1014;
  --surface-1: #241820;
  --surface-2: #2f2029;
  --surface-3: #3b2a34;
  --ink: #f6ede6;
  --ink-2: #d9c8bf;
  --ink-3: #b3a199;
  --primary: #e2b65c;      /* gold: the one primary action, and the leader */
  --on-primary: #24170b;
  --wine: #b0304e;
  --good: #5fc48a;
  --bad: #f07b7b;
  --border: #4a3640;
  --focus: #f3d08a;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf6f2;
    --surface-1: #ffffff;
    --surface-2: #f3ece6;
    --surface-3: #e8ddd4;
    --ink: #22151b;
    --ink-2: #4b3a41;
    --ink-3: #6b5960;
    --primary: #7a1f36;
    --on-primary: #ffffff;
    --wine: #7a1f36;
    --good: #1d7a47;
    --bad: #b32727;
    --border: #d9cbc1;
    --focus: #7a1f36;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.45 var(--sans);
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
a { color: var(--primary); }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; }
.wrap.wide { max-width: 980px; }

header.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand .glass { width: 22px; height: 22px; }
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
nav.tabs a { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; }
nav.tabs a.on { background: var(--surface-2); color: var(--ink); }

.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin: 0 0 14px;
}
.card.flat { background: transparent; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

label.field { display: block; }
label.field > span { display: block; font-size: .85rem; color: var(--ink-2); margin-bottom: 4px; }
input[type=text], input[type=number], input[type=date], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; min-height: 44px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
button.danger { color: var(--bad); }
button.ghost { background: transparent; }
button.block { width: 100%; }
button.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }

/* Code entry: one big field that reads like the code on the host's screen. */
.code-input {
  font: 700 2.2rem/1 var(--sans) !important; letter-spacing: .35em; text-align: center;
  text-transform: uppercase; padding: 16px 8px !important;
}
.code-big { font: 800 2.6rem/1 var(--sans); letter-spacing: .25em; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; min-height: 40px; font-weight: 500;
}
.chip.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip.on::before { content: "✓ "; }
.chip.warn { border-color: var(--bad); }

/* A glass's label: number, letter, colour swatch or shape. */
.glass-label {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700;
  font-family: var(--serif); font-size: 1.2rem;
}
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-3); flex: none; }
.shape { font-size: 1.4rem; line-height: 1; width: 28px; text-align: center; }
.numeral {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--wine); color: #fff; font-family: var(--sans); font-size: 1rem;
}

.wine-pick { display: grid; gap: 8px; }
.wine-option {
  display: flex; gap: 10px; align-items: center; text-align: left; justify-content: flex-start;
  background: var(--surface-2); font-weight: 500; width: 100%;
}
.wine-option .tag { font-weight: 700; min-width: 1.6em; color: var(--ink-3); }
.wine-option.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.wine-option.on .tag { color: inherit; }
.wine-option .used { margin-left: auto; font-size: .8rem; opacity: .85; }

.scale { display: flex; gap: 6px; }
.scale button { flex: 1; min-width: 0; padding: 8px 0; }
.scale button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.scale-words { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-3); margin-top: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink);
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.badge.ok::before { background: var(--good); }
.badge.live::before { background: var(--primary); }
.badge.stop::before { background: var(--bad); }

.right { color: var(--good); font-weight: 700; }
.wrong { color: var(--bad); font-weight: 700; }

table.plain { width: 100%; border-collapse: collapse; }
table.plain th, table.plain td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.plain th { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
table.plain td.n, table.plain th.n { text-align: right; font-variant-numeric: tabular-nums; }
.leader td:first-child::before { content: "♛ "; color: var(--primary); }

.score-hero { text-align: center; padding: 22px 12px; }
.score-hero .big { font: 800 3.4rem/1 var(--serif); font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 12px; z-index: 50; max-width: 92vw;
}
.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--border); z-index: 20;
}
.footer-bar .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.saved-note { font-size: .82rem; color: var(--ink-3); }

details > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.lineup li { margin-bottom: 6px; }
.superlative h3 { color: var(--primary); font-family: var(--sans); font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); }
.wine-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.empty { text-align: center; padding: 28px 12px; color: var(--ink-3); }

/* Event photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.photo { position: relative; margin: 0; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--border); }
.photo figcaption { font-size: .8rem; margin-top: 4px; overflow-wrap: anywhere; }
.photo .photo-del { position: absolute; top: 6px; right: 6px; padding: 2px 8px; min-height: 0; }
.cover { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }

/* ---------------------------------------------------------------------------
   The taster's page. Made for everybody at the table, reading glasses or not:
   19px text, nothing under 16px, every tap target at least 56px tall, words
   on the buttons, solid colours with a tick for what is chosen (never colour
   alone). The header's Text size button scales all of it (rem). */
body.taster { font-size: 1.1875rem; line-height: 1.5; }
body.taster .small { font-size: 1rem; }
body.taster .muted { color: var(--ink-2); }
body.taster h1 { font-size: 2rem; }
body.taster h2 { font-size: 1.5rem; }
body.taster button { min-height: 56px; font-size: 1.0625rem; }
body.taster button.small { min-height: 44px; font-size: 1rem; }
body.taster button.big { min-height: 64px; font-size: 1.25rem; padding: 12px 22px; }
body.taster input, body.taster textarea { font-size: 1.1875rem; min-height: 56px; }
body.taster input.short { max-width: 12em; }
body.taster label.field > span { font-size: 1rem; }
body.taster .card { padding: 18px; }
body.taster .toast { font-size: 1.125rem; padding: 14px 20px; bottom: 28px; }
body.taster .badge { font-size: .9375rem; }
.head-right { display: flex; align-items: center; gap: 8px; }
.who { font-weight: 600; color: var(--ink-2); }
.welcome { text-align: center; padding: 20px 0 8px; }
.tasting-head { margin: 8px 0 16px; }
.tasting-head h1 { margin: 6px 0 4px; }
.note { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.name-list { display: grid; gap: 10px; }
.name-list button { justify-content: flex-start; font-size: 1.25rem; }

.howto summary { font-size: 1.1rem; }
.q { font-family: var(--sans); font-size: 1.1875rem; font-weight: 700; margin: 0 0 10px; display: inline; }
h3.q { display: block; }
.optional { font-weight: 400; color: var(--ink-2); font-size: 1rem; }
.question { margin-top: 26px; }
.question:first-of-type { margin-top: 18px; }
.glass-card { padding-top: 16px; }
.glass-title { margin: 4px 0 0; }
.glass-title .glass-label { font-size: 1.9rem; gap: 12px; }
.glass-title .swatch { width: 40px; height: 40px; }
.glass-title .shape { font-size: 2.2rem; width: 42px; }
.glass-title .numeral { width: 48px; height: 48px; font-size: 1.5rem; }

body.taster .wine-pick { gap: 10px; }
body.taster .wine-option { min-height: 64px; padding: 12px 14px; align-items: flex-start; border-width: 2px; }
.wine-option .tag { font-size: 1.25rem; padding-top: 1px; }
.wine-text { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.wine-name { font-weight: 700; font-size: 1.1875rem; }
.wine-detail { font-weight: 400; font-size: 1rem; color: var(--ink-2); }
.wine-option.on .wine-detail { color: inherit; }
body.taster .wine-option .used { margin: 2px 0 0; font-size: .9375rem; opacity: 1; font-weight: 500; }

.word-scale { display: grid; gap: 8px; }
.word-scale button { justify-content: flex-start; gap: 12px; font-weight: 600; border-width: 2px; text-align: left; }
.word-scale button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.word-scale .tick { margin-left: auto; font-size: 1.3rem; }
.stars { letter-spacing: 1px; color: var(--primary); min-width: 5.6em; }
.stars .dim { color: var(--border); }
.word-scale button.on .stars, .word-scale button.on .stars .dim { color: inherit; }
.word-scale button.on .stars .dim { opacity: .35; }

body.taster .scale button { min-height: 56px; font-size: 1.25rem; }
body.taster .scale-words { font-size: 1rem; color: var(--ink-2); }
.big-chips { gap: 10px; }
body.taster .chip { min-height: 52px; padding: 10px 18px; font-size: 1.0625rem; border-width: 2px; }
.money { display: flex; align-items: center; gap: 8px; font-size: 1.4rem; font-weight: 700; }

.notes summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 56px;
  border: 2px dashed var(--border); border-radius: 12px; padding: 8px 14px; }
.notes summary::before { content: "+"; font-size: 1.5rem; font-weight: 700; width: 1em; }
.notes[open] summary::before { content: "–"; }
.notes summary::-webkit-details-marker { display: none; }

/* Which glass, and the way on. */
.glass-dots { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
body.taster .glass-dots .dot { min-height: 52px; padding: 6px 12px; border-width: 2px; position: relative; font-weight: 600; }
.glass-dots .dot .glass-label { font-size: 1.05rem; gap: 6px; }
.glass-dots .dot .swatch { width: 22px; height: 22px; }
.glass-dots .dot .numeral { width: 30px; height: 30px; }
.glass-dots .dot.here { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.glass-dots .dot.done .tick { color: var(--good); font-weight: 800; }
.step-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 4px; }
.step-nav button { width: 100%; }
.save-line { text-align: center; color: var(--ink-2); min-height: 1.5em; margin-top: 10px; }

.review { list-style: none; margin: 0; padding: 0; }
.review-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.review-row:last-child { border-bottom: 0; }
.review-row .answer { margin-top: 4px; }
.review-row button { flex: none; }
.done-box { text-align: center; background: var(--surface-1); border: 2px solid var(--good); border-radius: var(--radius); padding: 22px 18px; margin: 0 0 14px; }
.big-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--good); color: #fff; font-size: 2.2rem; font-weight: 800; display: grid; place-items: center; margin: 0 auto 10px; }
.warn-box { border: 2px solid var(--bad); }
body.taster .score-hero .big { font-size: 4rem; }
.hero-place { font-size: 1.4rem; font-weight: 700; margin-top: 6px; }
body.taster table.plain th { font-size: 1rem; color: var(--ink-2); }
body.taster .superlative h3 { font-size: 1rem; }

/* The header stays one line at every text size: it is the one thing that
   must not grow, or it eats the screen. */
body.taster header.bar { font-size: 16px; padding: 8px 12px; }
body.taster header.bar .brand { font-size: 20px; white-space: nowrap; }
body.taster header.bar .who { font-size: 16px; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.taster header.bar #text-size { font-size: 15px; min-height: 44px; padding: 6px 10px; white-space: nowrap; }
.glass-title .of { font-family: var(--sans); font-size: 1.1rem; font-weight: 500; }
