/* Layout: passaporto dei vini. A plum cover with a gold crest, cream passport pages with a faint guilloche,
   an identity page, ink entry stamps for each week, a visa page for the reading, and a plum tab bar. */
:root {
  --plum: #6a2b4d;
  --plum-deep: #4f1f3a;
  --gold: #f0c07a;
  --gold-soft: #d9b585;
  --paper: #f3ead3;
  --ink: #2b2118;
  --muted: #6b5a45;
  --red: #a8281d;
  --blue: #1f3f7a;
  --green: #2c5a3b;
  --rule: rgba(43, 33, 24, .35);
  --sheet: rgba(255, 255, 255, .38);
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --guilloche: repeating-radial-gradient(circle at 25% 12%, rgba(106, 43, 77, .05) 0 2px, transparent 2px 7px),
    repeating-radial-gradient(circle at 85% 60%, rgba(31, 63, 122, .04) 0 2px, transparent 2px 9px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; min-height: 100vh;
  background: var(--guilloche), var(--paper); background-attachment: fixed;
  color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5;
}
.view {
  max-width: 520px; margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right, 0px)) 32px max(20px, env(safe-area-inset-left, 0px));
}
body.has-tabs .view { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; text-wrap: balance; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--muted); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }
html.on-cover :focus-visible, .ticket :focus-visible, .boarding :focus-visible, .cta :focus-visible, .tabbar :focus-visible { outline-color: var(--gold); }
@media (prefers-reduced-motion: no-preference) { .view { animation: rise .25s ease-out; } }
@keyframes rise { from { opacity: .001; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* labels and data */
.lbl, .eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0; }
.datum { font-family: var(--mono); font-weight: 500; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; overflow-wrap: anywhere; }
.data { display: grid; gap: 9px; }
.data .lbl { font-size: 10px; letter-spacing: .08em; }

/* buttons: every tap target at least 44px */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; margin-top: 16px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; text-align: center;
  background: var(--plum); color: var(--gold); border: 1.5px solid var(--plum); border-radius: 8px; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.wide { display: flex; width: 100%; }
.btn.plain { background: transparent; color: var(--plum); border-color: rgba(106, 43, 77, .6); }
.btn.gold { background: var(--gold); color: #3a1530; border-color: var(--gold); }
.btn.paper { background: var(--paper); color: var(--plum); border-color: var(--paper); }
.btn.ring { background: transparent; color: var(--gold); border-color: var(--gold); border-radius: 999px; }
.btn.alt { background: transparent; color: var(--plum); border-color: var(--plum); }
.linkbtn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px;
  background: none; border: 0; color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.linkbtn:hover { color: var(--ink); }
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  background: var(--sheet); color: var(--ink); border: 1.5px solid var(--rule); border-radius: 8px; cursor: pointer;
}

/* page top: back link or crest, and the week counter */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding-top: env(safe-area-inset-top, 0px); }
.topbar .wk { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.mast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 12px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); border-bottom: 3px double rgba(43, 33, 24, .45); }
.mast .brand { display: flex; align-items: center; gap: 10px; }
.mast img { width: 34px; height: 34px; display: block; }
.mast b { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: .12em; }
.mast .wk { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.pagehead { margin: 4px 0 16px; }
.pagehead h1 { font-size: 48px; margin-top: 4px; }

/* cover */
/* Safari on iPhone paints the status bar and toolbar strips itself, in one flat colour taken from the page's plum
   (theme-color). A page can't draw texture there, so the base is flat plum to match those strips exactly, and the
   texture lies on top and fades out toward the top and bottom edges so there is no seam where it meets them. */
html.on-cover, html.on-cover body { background: var(--plum); }
html.on-cover body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1.3px) 0 0 / 5px 5px, radial-gradient(rgba(0, 0, 0, .10) 1px, transparent 1.3px) 2px 3px / 7px 7px,
    radial-gradient(ellipse 90% 60% at 50% 45%, rgba(255, 255, 255, .035), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
}
html.on-cover .view { position: relative; z-index: 1; }
/* the cover content is one group centred in the safe area, about 48px between its three parts */
.cover {
  min-height: 100vh; min-height: 100dvh; margin: 0 calc(-1 * max(20px, env(safe-area-inset-right, 0px))) -32px;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(20px, 6dvh, 48px); text-align: center;
  background: transparent; color: var(--gold);
}
.cover .emboss { font-family: var(--display); font-weight: 600; letter-spacing: .03em; text-shadow: 0 1px 0 rgba(0, 0, 0, .28), 0 -1px 0 rgba(255, 255, 255, .10); }
.cover .group { font-size: clamp(19px, 6vw, 31px); line-height: 1.1; white-space: nowrap; }
.cover img { width: min(236px, 60vw); height: auto; display: block; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .30)); }
.cover .title { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cover .passaporto { font-size: clamp(38px, 13.6vw, 54px); font-weight: 700; line-height: 1; letter-spacing: .04em; }
.cover .divini { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: .34em; padding-left: .34em; }
.cover .chip { width: 46px; height: 28px; border: 1.5px solid var(--gold); border-radius: 3px; display: flex; align-items: center; justify-content: center; }
.cover .foot-actions { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cover .btn { margin-top: 0; padding: 0 30px; }

/* PIN sign in */
.control { min-height: calc(100vh - 56px); display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 12px; }
.control .crest { width: 84px; height: 84px; display: block; margin-top: 4px; }
.control .eyebrow { margin-top: 14px; letter-spacing: .24em; }
.control h1 { font-size: 42px; margin-top: 6px; letter-spacing: .01em; }
.control .sub { margin: 8px 0 0; font-size: 15px; line-height: 1.4; color: var(--muted); }
.pinrow { margin-top: 24px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pinrow span { width: 50px; height: 56px; border: 1.5px solid var(--ink); border-radius: 6px; background: rgba(255, 255, 255, .4); display: grid; place-items: center; }
.pinrow span.on::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--plum); }
.keypad { margin-top: 22px; width: min(288px, 100%); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.keypad button {
  height: 52px; border: 1.5px solid rgba(43, 33, 24, .55); border-radius: 10px; background: rgba(255, 255, 255, .4); color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.keypad button:active { background: rgba(106, 43, 77, .12); }
.control .err { min-height: 1.4em; }
.control .help { margin-top: auto; padding-top: 18px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.sheet { width: 100%; max-width: 360px; text-align: left; margin-top: 22px; }

/* forms */
.field { display: grid; gap: 6px; text-align: left; margin: 14px 0; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: rgba(255, 255, 255, .55); border: 1.5px solid var(--ink); border-radius: 8px;
  padding: 11px 12px; width: 100%; min-width: 0; min-height: 48px;
}
textarea { min-height: 120px; line-height: 1.35; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 13px; min-height: 220px; }
.err { color: var(--red); font-weight: 600; margin: 10px 0 0; min-height: 1.4em; }
.ok { color: var(--green); font-weight: 600; margin: 10px 0 0; }

/* passport identity page */
.idpage { margin-top: 18px; padding: 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.idpage .top { display: flex; gap: 16px; }
.idpage .photo {
  width: 92px; height: 116px; flex-shrink: 0; border: 1px solid rgba(43, 33, 24, .45); background: rgba(106, 43, 77, .10);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 40px; color: var(--plum);
}
.idpage .data { min-width: 0; }
.idpage .dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(43, 33, 24, .4); }
.idpage .dates .datum { font-size: 14px; }

/* now boarding */
.boarding { margin-top: 16px; padding: 18px; border-radius: 8px; background: var(--plum); color: var(--paper); }
.boarding .lbl { color: var(--gold); }
.boarding h2 { margin-top: 6px; font-size: 44px; color: var(--gold); overflow-wrap: anywhere; }
.boarding p { margin: 6px 0 0; font-size: 15px; }
.boarding .btn { display: flex; width: 100%; }
.boarding .btn + .btn { margin-top: 10px; }

/* entry stamps */
.sechead { margin: 26px 0 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sechead h2 { font-size: 30px; letter-spacing: .02em; }
.sechead .count { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.stamps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 8px; }
.stamps li { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.stamps button { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.stamps button[disabled] { cursor: default; }
.stamp {
  width: 72px; height: 72px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--mono); line-height: 1.15;
}
.stamp .code, .stamp .lab { font-size: 10px; font-weight: 500; letter-spacing: .1em; }
.stamp .lab.tight { font-size: 9px; letter-spacing: 0; }
.stamp .n { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1; }
.stamp .d { font-size: 10px; letter-spacing: .04em; }
.stamp.done { border: 3px double currentColor; mix-blend-mode: multiply; }
.stamp.current { border: 2px dashed var(--plum); background: rgba(106, 43, 77, .07); color: var(--plum); }
.stamp.future { border: 2px dotted rgba(107, 90, 69, .6); color: var(--muted); }
.stamp.missed { border: 2px dotted rgba(107, 90, 69, .45); color: var(--muted); opacity: .75; }
.stamps .cap { min-height: 28px; font-size: 11px; line-height: 1.25; text-align: center; color: var(--ink); overflow-wrap: anywhere; }
.stamps .cap.soon { color: var(--muted); }
.mrz { margin: 26px 0 0; padding-top: 12px; border-top: 3px double rgba(43, 33, 24, .45); font-family: var(--mono); font-size: 11px; line-height: 1.6; letter-spacing: .04em; color: var(--muted); white-space: nowrap; overflow: hidden; }
.signout { display: flex; justify-content: center; margin-top: 18px; }

/* quizzes open now */
.openq { margin-top: 16px; padding: 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.openq h3 { font-size: 24px; }
.openq p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.openq .btn { display: flex; width: 100%; margin-top: 10px; }

/* visa page */
.visa {
  padding: 18px; border: 1.5px solid rgba(31, 63, 122, .55); border-radius: 8px;
  background: repeating-radial-gradient(circle at 70% 30%, rgba(31, 63, 122, .07) 0 2px, transparent 2px 6px), linear-gradient(135deg, rgba(31, 63, 122, .12), rgba(44, 90, 59, .12));
}
.visa .row { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--blue); }
.visa h1 { margin-top: 10px; font-size: clamp(44px, 15vw, 64px); line-height: 1; letter-spacing: .01em; overflow-wrap: anywhere; }
.visa .settimana { margin-top: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.visa .valid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed rgba(31, 63, 122, .5); }
.visa .valid .datum { font-size: 14px; }
.visa .valid .lbl { letter-spacing: .02em; white-space: nowrap; }
.status-open { color: var(--green); }
.status-done { color: var(--blue); }
.status-closed { color: var(--red); }

/* reading content on passport pages */
.page { margin-top: 16px; padding: 18px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.page h2 { font-size: 30px; letter-spacing: .01em; }
.page .sub { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.page p { font-size: 16px; line-height: 1.6; }
.page p:last-child { margin-bottom: 0; }
.page .lead { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 22px; line-height: 1.3; color: var(--plum); margin: 10px 0 14px; }
.sec-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.num {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 3px double var(--blue); color: var(--blue);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 22px; transform: rotate(-6deg);
}
.sign { display: inline-block; margin-top: 4px; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 30px; color: var(--plum); transform: rotate(-3deg); }
.steps { display: grid; gap: 10px; margin: 16px 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 12px 14px 12px 58px; border: 1px solid var(--rule); border-radius: 8px; background: rgba(255, 255, 255, .45); counter-increment: s; }
.steps li::before {
  content: counter(s); position: absolute; left: 12px; top: 12px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--red); color: var(--red);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px;
}
.steps h3 { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 2px; }
.steps p { margin: 0; font-size: 15px; line-height: 1.45; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 16px 0; }
.card { padding: 14px; border: 1px solid var(--rule); border-radius: 8px; background: rgba(255, 255, 255, .45); min-width: 0; }
.card h3 { font-size: 24px; color: var(--plum); margin-bottom: 4px; }
.card .sub, .card .big { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.card p { margin: 0; font-size: 15px; line-height: 1.5; }
.card ul { margin: 8px 0 0; padding-left: 18px; font-size: 15px; line-height: 1.45; }
.card li::marker { color: var(--plum); }
.card .lbl { margin: 12px 0 2px; color: var(--green); }
.note { margin: 16px 0; padding: 14px 16px; border: 1.5px dashed var(--plum); border-radius: 8px; background: rgba(106, 43, 77, .07); font-size: 15px; line-height: 1.5; }
.strong { font-weight: 600; color: var(--plum); }
.bullets { margin: 12px 0 16px; padding-left: 20px; line-height: 1.5; }
.bullets li { margin: 4px 0; }
textarea.code.reading { font-family: var(--body); font-size: 16px; line-height: 1.5; min-height: 420px; }
.cheat { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.cheat summary { cursor: pointer; color: var(--plum); font-weight: 600; }
.cheat dl { margin: 8px 0 0; }
.cheat dt { font-family: var(--mono); font-size: 13px; color: var(--ink); margin-top: 10px; }
.cheat dd { margin: 2px 0 0; }
.wpreview { margin: 16px -4px 20px; padding: 14px 0 4px; border-top: 1.5px dashed var(--plum); border-bottom: 1.5px dashed var(--plum); }
.wpreview > .lbl { margin: 0 4px 12px; color: var(--plum); }
.tablewrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--rule); border-radius: 8px; background: rgba(255, 255, 255, .5); }
table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; line-height: 1.35; }
th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; text-align: left; padding: 10px 12px; background: var(--plum); color: var(--gold); }
td { padding: 10px 12px; border-top: 1px solid var(--rule); vertical-align: middle; }
td.st { font-family: var(--display); font-weight: 700; font-size: 22px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; display: block; box-shadow: 0 0 0 1.5px var(--ink); }
.mono { font-family: var(--mono); letter-spacing: .06em; }

/* plum call to action */
.cta { margin-top: 16px; padding: 20px; border-radius: 8px; background: var(--plum); color: var(--paper); }
.cta h2 { font-size: 32px; line-height: 1.1; color: var(--gold); }
.cta p { margin: 8px 0 0; font-size: 15px; line-height: 1.45; }
.cta .fine { font-size: 13px; color: var(--gold); margin-top: 12px; }
.cta .btn { display: flex; width: 100%; }
.markread { display: flex; justify-content: center; margin-top: 8px; }
.markread .btn { width: 100%; }

/* quiz */
.qhead { padding: 18px; border-radius: 8px; background: var(--plum); color: var(--paper); }
.qhead .lbl { color: var(--gold); }
.qhead h1 { margin-top: 6px; font-size: 40px; color: var(--gold); overflow-wrap: anywhere; }
.qintro { margin: 16px 0 6px; font-size: 15px; }
.progress { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.qcard { margin: 0 0 14px; padding: 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.qcard .qn { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.qcard h3 { font-size: 24px; line-height: 1.15; }
.opts { display: grid; gap: 8px; margin: 12px 0 4px; }
.opt {
  width: 100%; min-height: 48px; padding: 11px 14px; text-align: left; font-family: var(--body); font-size: 16px; line-height: 1.3;
  background: rgba(255, 255, 255, .55); color: var(--ink); border: 1.5px solid rgba(43, 33, 24, .55); border-radius: 8px; cursor: pointer;
}
div.opt { cursor: default; }
.opt.sel { background: var(--plum); color: var(--gold); border-color: var(--plum); }
.opt.right { background: var(--green); color: var(--paper); border-color: var(--green); }
.opt.wrong { background: var(--red); color: var(--paper); border-color: var(--red); }
.opt.right.wrong { background: var(--green); color: var(--paper); border-color: var(--green); } /* your pick and correct: green, not red */
.opt.right::after, .opt.wrong::after { float: right; margin-left: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.opt.right::after { content: "Correct"; }
.opt.wrong::after { content: "Your pick"; }
.opt.right.wrong::after { content: "Your pick, correct"; }
.why { margin: 12px 0 0; font-size: 15px; line-height: 1.45; font-style: italic; color: var(--muted); }
.lockbox { margin: 16px 0; padding: 18px; border: 2px dashed var(--plum); border-radius: 8px; background: rgba(106, 43, 77, .07); text-align: center; }
.lockbox p { margin: 0; }
.lockbox .big { font-family: var(--display); font-weight: 700; font-size: 48px; line-height: 1; color: var(--plum); margin-top: 4px; }
.confirm { margin-top: 16px; padding: 16px; border: 1.5px solid var(--plum); border-radius: 8px; background: rgba(106, 43, 77, .08); }
.confirm p { margin: 0 0 4px; font-weight: 600; }
.confirm .btn { display: flex; width: 100%; margin-top: 10px; }
#submitbox .btn { display: flex; width: 100%; }

/* rankings */
.ticket { display: flex; margin-top: 4px; border-radius: 8px; background: var(--plum); overflow: hidden; color: var(--paper); text-decoration: none; min-height: 88px; }
.ticket .stub { width: 96px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 0; border-right: 2px dashed rgba(240, 192, 122, .6); }
.ticket .stub .lbl { color: var(--gold); font-size: 10px; letter-spacing: .18em; }
.ticket .stub b { font-family: var(--display); font-weight: 700; font-size: 36px; line-height: 1; color: var(--gold); }
.ticket .body { flex: 1; padding: 14px 16px; font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; justify-content: center; }
.ticket .body small { margin-top: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.rules { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.lb { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.lb li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border: 1px solid rgba(43, 33, 24, .3); border-radius: 8px; background: var(--sheet); }
.lb li.me { background: rgba(106, 43, 77, .12); border-color: var(--plum); }
.lb .rk { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 22px; }
.lb li.top .rk { background: var(--plum); color: var(--gold); }
.lb .who { flex: 1; min-width: 0; }
.lb .name { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.lb .you { padding: 2px 7px; border-radius: 4px; background: var(--plum); color: var(--gold); font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .14em; }
.lb .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lb .pts { font-family: var(--mono); font-weight: 500; font-size: 15px; text-align: right; white-space: nowrap; }
.lb .pts small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.empty { margin-top: 16px; padding: 18px; border: 1px dashed var(--rule); border-radius: 8px; text-align: center; color: var(--muted); }
.prize { display: flex; gap: 14px; align-items: flex-start; }
.prize .ico { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; border: 3px double var(--red); color: var(--red); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 22px; transform: rotate(-6deg); }
.foot { margin: 32px 0 0; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

/* bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  background: var(--plum-deep); border-top: 1.5px solid var(--gold); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar[hidden] { display: none; }
.tabbar .in { display: flex; width: 100%; max-width: 520px; }
.tabbar a {
  flex: 1; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--gold-soft); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
}
.tabbar a.on { color: var(--paper); }
.tabbar svg { width: 24px; height: 24px; }

/* manager */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.tabs button {
  min-height: 44px; padding: 0 14px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  border: 1.5px solid var(--rule); border-radius: 8px; background: var(--sheet); color: var(--ink); cursor: pointer;
}
.tabs button.on { background: var(--plum); color: var(--gold); border-color: var(--plum); }
.panel { margin: 14px 0 18px; padding: 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.panel > h3 { font-size: 26px; margin-bottom: 8px; }
.help { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 12px; }
.small { font-size: 14px; }
.tag { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--muted); color: var(--muted); white-space: nowrap; }
td .pill { min-height: 44px; font-size: 11px; padding: 0 10px; }
.skeleton { color: var(--muted); padding: 48px 0; text-align: center; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }

@media (max-width: 370px) {
  .stamps { gap: 14px 4px; }
  .stamp { width: 64px; height: 64px; }
  .stamp .n { font-size: 22px; }
  .idpage .photo { width: 76px; height: 100px; font-size: 32px; }
}

/* wines of the week */
.lbl.plum { color: var(--plum); }
.pour .wine { display: grid; gap: 12px; margin-top: 14px; }
.pour .wine + .wine { padding-top: 14px; border-top: 1px dashed rgba(43, 33, 24, .4); }
.pour .pair2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pour .lbl { font-size: 10px; letter-spacing: .08em; }
.pour > .lbl { font-size: 11px; letter-spacing: .2em; }

/* staff rows: actions wrap, edit and delete open in the row */
.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.danger { color: var(--red); border-color: rgba(168, 40, 29, .55); }
.rowedit { display: grid; gap: 4px; }
.rowedit p { margin: 0 0 6px; font-size: 15px; }
.rowedit .field { margin: 6px 0; }
/* the staff list fits a phone: no sideways scroll, actions drop under the name */
.tablewrap table.stafftable { min-width: 0; }
@media (max-width: 560px) {
  .stafftable thead { display: none; }
  .stafftable tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-top: 1px solid var(--rule); }
  .stafftable tr:first-child { border-top: 0; }
  .stafftable td { padding: 0; border: 0; }
  .stafftable td:nth-child(2) { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
  .stafftable td:nth-child(3), .stafftable td[colspan] { grid-column: 1 / -1; }
}

/* locked screens (cover and PIN pad): the page fills the phone exactly and cannot be dragged or bounce */
html.locked, html.locked body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.locked body { position: fixed; inset: 0; width: 100%; height: 100dvh; touch-action: none; }
html.locked .view { height: 100%; padding-bottom: 0; display: flex; flex-direction: column; }
html.locked .cover { flex: 1; min-height: 0; margin-bottom: 0; }
html.locked .control { flex: 1; min-height: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
html.locked .topbar { flex: none; }
/* shorter phones: tighten the PIN pad so it still fits without scrolling */
@media (max-height: 760px) {
  .control .crest { width: 60px; height: 60px; margin-top: 0; }
  .control .eyebrow { margin-top: 8px; }
  .control h1 { font-size: 34px; margin-top: 2px; }
  .control .sub { font-size: 14px; margin-top: 4px; }
  .pinrow { margin-top: 14px; }
  .pinrow span { height: 48px; }
  .keypad { margin-top: 14px; gap: 8px; }
  .keypad button { height: 46px; font-size: 27px; }
  .control .help { padding-top: 6px; }
}
@media (max-height: 640px) {
  .control .crest, .control .sub { display: none; }
  .control .eyebrow { margin-top: 0; }
  .control .err { min-height: 0; margin-top: 6px; }
}
@media (max-height: 720px) {
  .cover img { width: min(180px, 48vw); }
  .cover .foot-actions { gap: 12px; }
}
/* no Entra button any more: the 4th digit signs in, so the help sits right under the keypad */
.control .help { margin-top: 4px; padding-top: 10px; }
.control .err { margin-top: 12px; }

/* points on the identity page */
.pts-link { display: block; min-height: 44px; text-decoration: none; color: inherit; }
.pts-link .datum { color: var(--plum); font-size: 18px; }
.pts-link .datum span { font-size: 11px; letter-spacing: .1em; color: var(--muted); }

/* prize shop */
.wallet { margin-top: 4px; padding: 18px; border-radius: 8px; background: var(--plum); color: var(--paper); }
.wallet .lbl { color: var(--gold); }
.wallet .bal { margin-top: 2px; font-family: var(--display); font-weight: 700; font-size: 64px; line-height: 1; color: var(--gold); }
.wallet .bal::after { content: " pts"; font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .14em; }
.wallet p { margin: 8px 0 0; font-size: 14px; }
.claimed { margin: 4px 0 14px; padding: 14px 16px; border: 2px dashed var(--green); border-radius: 8px; background: rgba(44, 90, 59, .1); font-size: 15px; }
.shop { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.reward { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.reward .cost {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%; border: 3px double var(--red); color: var(--red); transform: rotate(-6deg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.reward .cost b { font-family: var(--display); font-size: 24px; font-weight: 700; }
.reward .cost span { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; margin-top: 2px; }
.reward .info { flex: 1; min-width: 0; }
.reward h3 { font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.reward p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.reward .left { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.reward .act .btn { margin-top: 10px; min-width: 120px; }
.reward .act .confirm .btn { width: 100%; }
.myclaims, .claimlist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.myclaims li, .claimlist li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.myclaims li > div:first-child, .claimlist li > div:first-child { min-width: 0; flex: 1 1 180px; }
.myclaims .meta, .claimlist .meta { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.st { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; white-space: nowrap; }
.st-pending { background: var(--gold); color: #3a1530; }
.st-given { background: var(--green); color: var(--paper); }
.st-cancelled { border: 1px solid var(--muted); color: var(--muted); }
.claimlist li.cl-cancelled { opacity: .7; }
.claimlist .acts { align-items: center; }

/* five tabs for managers still fit a phone */
.tabbar a { padding: 0 2px; }
@media (max-width: 400px) { .tabbar a { font-size: 10px; letter-spacing: .04em; } }

/* prize photos */
.reward.has-photo { flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.reward .photo { position: relative; width: 100%; aspect-ratio: 4 / 3; background: rgba(43, 33, 24, .08); }
.reward .photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reward .photo .cost { position: absolute; right: 12px; bottom: -22px; background: var(--paper); box-shadow: 0 0 0 4px var(--paper); }
.reward.has-photo .info { padding: 14px 92px 14px 14px; }
.reward.has-photo .info .act .btn { margin-top: 10px; }
.claimlist .thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); flex-shrink: 0; }
.claimlist li[data-rw] > .err { flex-basis: 100%; margin: 0; min-height: 0; }

/* week by week: locked and still-to-do stamps, the locked page, the on-time note */
.stamp.locked { border: 2px dotted rgba(107, 90, 69, .6); color: var(--muted); background: repeating-linear-gradient(135deg, rgba(43, 33, 24, .05) 0 4px, transparent 4px 8px); }
.stamp.todo { border: 2px dashed var(--red); color: var(--red); }
.lockedwk .lbl { margin-bottom: 6px; }
.lockedwk h2 { font-size: 32px; color: var(--ink); }
.lockedwk p { margin: 8px 0 0; }
.cta .ontime { margin-top: 10px; padding: 8px 10px; border: 1px dashed rgba(240, 192, 122, .7); border-radius: 6px; color: var(--gold); font-size: 14px; }

/* the guide */
.tabbar .in.six a { font-size: 9.5px; letter-spacing: .03em; }
.gl { color: var(--plum); border-bottom: 1.5px dotted var(--plum); cursor: pointer; }
.gsearch { margin: 14px 0; }
.gcards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.gcard { display: flex; flex-direction: column; gap: 6px; min-height: 92px; padding: 14px; border: 1px solid var(--rule); border-radius: 8px; background: rgba(255, 255, 255, .55); color: var(--ink); text-decoration: none; }
.gcard .lbl { color: var(--plum); letter-spacing: .1em; font-size: 10px; }
.gcard strong { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.1; }
.ghead { margin: 22px 0 8px; font-size: 26px; color: var(--plum); }
.wrow { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 56px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--rule); border-radius: 8px; background: rgba(255, 255, 255, .55); color: var(--ink); text-decoration: none; }
.wname { font-weight: 600; font-size: 15px; line-height: 1.3; min-width: 0; }
.wname small, .wprice small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.wprice { flex: none; text-align: right; font-family: var(--mono); font-size: 15px; }
.wprice small { font-size: 11px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.pill.on { background: var(--plum); color: var(--gold); border-color: var(--plum); }
.rchips { margin-top: 18px; }
.credit { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }
.italy { display: block; width: 100%; height: auto; }
.mappage { padding: 10px; }
.rg { stroke: var(--paper); stroke-width: 1; cursor: pointer; transition: fill .15s; outline: none; }
.rg.l0 { fill: #dcd0b4; }
.rg.l1, .k.l1 { fill: #c9a3b5; background: #c9a3b5; }
.rg.l2, .k.l2 { fill: #99617f; background: #99617f; }
.rg.l3, .k.l3 { fill: var(--plum); background: var(--plum); }
.rg.on, .rg:focus-visible { fill: var(--gold); }
#maplabels text { font-family: var(--mono); font-size: 16px; font-weight: 500; fill: var(--paper); paint-order: stroke; stroke: rgba(43, 33, 24, .55); stroke-width: 3px; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.mapkey { margin: 6px 0 0; text-align: center; font-size: 13px; }
.k { display: inline-block; width: 12px; height: 12px; margin: 0 4px 0 8px; border-radius: 3px; vertical-align: -1px; }
.prices { margin-bottom: 14px; }
.prices > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 0; }
.prices > div + div { border-top: 1px solid rgba(43, 33, 24, .12); }
.prices .big { font-family: var(--display); font-size: 32px; font-weight: 700; color: var(--plum); line-height: 1.1; }
.prices .unlisted .lbl, .prices .unlisted .big { color: rgba(43, 33, 24, .38); }
.pricenote { font-size: 13px; line-height: 1.4; color: var(--muted); margin: -4px 0 14px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.facts .lbl { letter-spacing: .08em; white-space: nowrap; }
.facts .datum { font-size: 15px; overflow-wrap: anywhere; }
.hearrow { margin: 14px 0 0; }
.pill.hear { min-height: 34px; font-size: 11px; flex: none; }
.ghrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.say { margin: 2px 0 8px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.gword.hit { border-color: var(--plum); box-shadow: 0 0 0 2px var(--plum); }
.gword a.lbl { display: inline-block; margin-top: 4px; }
.ladder { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 12px; }
.ladder li { padding: 12px 14px; border-left: 4px solid var(--plum); background: rgba(255, 255, 255, .45); }
.ladder strong { display: block; font-family: var(--display); font-size: 26px; color: var(--plum); line-height: 1.1; }
.ladder p { margin: 6px 0 0; font-size: 15px; }
.ladder li:nth-child(2) { margin-left: 8px; } .ladder li:nth-child(3) { margin-left: 16px; } .ladder li:nth-child(4) { margin-left: 24px; }
.words { margin: 10px 0 0; }
.words dt { margin-top: 10px; font-weight: 600; }
.words dd { margin: 0; color: var(--muted); font-size: 15px; }
.mwrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }
.mwrow[hidden], .gword[hidden] { display: none; }
.mwrow small { display: block; font-size: 13px; color: var(--muted); }
.mwrow.off { opacity: .6; }
.mwrow .acts { flex: none; }
.gltext { min-height: 460px; }
.sheetwrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(43, 33, 24, .5); }
.sheet { width: 100%; max-width: 520px; padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 14px 14px 0 0; background: var(--paper); }
.sheet h2 { font-size: 32px; color: var(--plum); }
.sheet .btn { margin-top: 12px; }

/* wine cards */
.winecard { display: grid; grid-template-columns: minmax(84px, 30%) 1fr; gap: 16px; align-items: start; }
.bottle { display: block; width: auto; height: auto; max-width: 100%; max-height: 360px; margin: 0 auto; filter: drop-shadow(0 4px 6px rgba(43, 33, 24, .25)); }
.bottle.real { filter: none; mix-blend-mode: multiply; } /* real photos are on white: let it melt into the page */
.tastecol { min-width: 0; }
.tastecol > .lbl { letter-spacing: .08em; white-space: nowrap; }
.flavors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 6px; margin: 8px 0 18px; padding: 0; list-style: none; }
.flavors li { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 12px; line-height: 1.2; color: var(--ink); }
.flavors svg { width: 34px; height: 34px; }
.level { margin-top: 10px; }
.segs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.segs i { height: 7px; background: rgba(43, 33, 24, .14); }
.level span { display: block; margin-top: 3px; font-size: 13px; color: var(--ink); line-height: 1.25; }
@media (min-width: 520px) { .flavors { grid-template-columns: repeat(5, 1fr); } }
