:root {
  --slate: #161c19;      /* the board */
  --slate-2: #1e2622;    /* raised surfaces */
  --slate-3: #28322d;    /* inputs, pressed */
  --rule: #2f3a34;
  --chalk: #ece8df;
  --chalk-2: #b9c1bb;    /* secondary text */
  --chalk-3: #98a29c;    /* tertiary */
  --yellow: #f2c94c;     /* the one action colour */
  --yellow-ink: #1d1a0e;
  /* coloured chalk, used only for wine colour */
  --w-red: #e0574e; --w-white: #e7d98b; --w-rose: #f08aa8; --w-orange: #e8913a;
  --w-sparkling: #a9d3e6; --w-dessert: #d2a54a; --w-fortified: #b0695a;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html { background: var(--slate); scrollbar-color: var(--rule) var(--slate); }
body { margin: 0; font: 16px/1.45 var(--ui); background: var(--slate); color: var(--chalk); -webkit-font-smoothing: antialiased; }
::selection { background: var(--yellow); color: var(--yellow-ink); }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg:has(> use) { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--slate) 92%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.mark { margin: 0; font: 800 30px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.top-actions { display: flex; gap: 4px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; color: var(--chalk-2); }
.icon-btn:hover { background: var(--slate-2); color: var(--chalk); }

main { max-width: 640px; margin: 0 auto; padding: 0 16px 170px; }

/* ---- bar above the board ---- */
.bar { display: flex; align-items: center; gap: 10px; padding: 18px 0 14px; }
.count { margin: 0 auto 0 0; font: 600 20px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--chalk-2); font-variant-numeric: tabular-nums; }
.count b { color: var(--chalk); font-weight: 800; }
.chip-todo { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--yellow); color: var(--yellow-ink); font-weight: 700; font-size: 14px; }
.seg { display: flex; background: var(--slate-2); border-radius: 12px; padding: 3px; }
.seg button { display: grid; place-items: center; width: 40px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--chalk-3); }
.seg button[aria-pressed="true"] { background: var(--slate-3); color: var(--chalk); }
.seg svg { width: 20px; height: 20px; }

/* ---- the board ---- */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.row { position: relative; }
.row .ph { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); background: var(--slate-2); }
.row .txt { padding: 12px 2px 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; align-items: start; }
.row h2 { grid-column: 1; margin: 0; font: 800 clamp(28px, 7.5vw, 36px)/.98 var(--display); text-transform: uppercase; letter-spacing: .005em; overflow-wrap: anywhere; text-wrap: balance; }
.row h2.unknown { color: var(--chalk-3); }
.row .dots { grid-column: 2; grid-row: 1; padding-top: 6px; }
.row .sub { grid-column: 1 / -1; margin: 6px 0 0; color: var(--chalk-2); font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row .hue { width: 10px; height: 10px; border-radius: 50%; background: var(--hue, var(--chalk-3)); flex: none; }
.row .where { grid-column: 1 / -1; margin: 2px 0 0; color: var(--chalk-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.row .notes { grid-column: 1 / -1; margin: 10px 0 0; color: var(--chalk); font-size: 15px; max-width: 62ch; }
.row .tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.row .tags span { border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--chalk-2); }
.row .unrated { grid-column: 2; grid-row: 1; padding-top: 4px; font-size: 13px; font-weight: 600; color: var(--yellow); white-space: nowrap; }
.row .del { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px;
  background: color-mix(in srgb, var(--slate) 70%, transparent); color: var(--chalk); opacity: 0; transition: opacity .2s; }
.row:hover .del, .row .del:focus-visible { opacity: 1; }
@media (hover: none) { .row .del { opacity: .85; } }

/* dense list view */
.board.list { gap: 0; }
.board.list .row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.board.list .ph { width: 56px; height: 56px; aspect-ratio: auto; border-radius: 10px; }
.board.list .txt { padding: 0; }
.board.list h2 { font-size: 22px; }
.board.list .sub { margin-top: 2px; font-size: 13px; }
.board.list .where, .board.list .notes, .board.list .tags, .board.list .del { display: none; }

.empty { padding: 72px 8px; text-align: center; color: var(--chalk-2); }
.empty strong { display: block; margin-bottom: 8px; font: 800 40px/1 var(--display); text-transform: uppercase; color: var(--chalk); }

/* ---- rating: a ramp of growing dots ---- */
.dots { display: flex; align-items: center; gap: 5px; }

/* ---- primary action ---- */
.chalk { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  background: var(--yellow); color: var(--yellow-ink); font: 800 22px/1 var(--display); text-transform: uppercase; letter-spacing: .03em;
  transition: transform .2s var(--ease); }
.chalk:active { transform: scale(.96); }
.chalk svg { stroke-width: 2.6; }
.chalk.fab { position: fixed; right: max(16px, calc(50% - 304px)); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 7;
  padding: 15px 24px 15px 18px; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
body[data-tab="map"] .chalk.fab { bottom: calc(96px + env(safe-area-inset-bottom)); }
.chalk.wide { width: 100%; padding: 17px; }
.chalk:disabled { background: var(--slate-3); color: var(--chalk-3); }

/* ---- tab bar ---- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 4px max(8px, calc(50% - 320px)) max(6px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--slate-2) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--rule); }
.tabbar button { display: grid; justify-items: center; gap: 3px; min-height: 56px; padding-top: 6px; border: 0; background: none; color: var(--chalk-3); font-size: 12px; font-weight: 600; }
.tabbar button[aria-current] { color: var(--chalk); }
.tabbar button[aria-current] svg { color: var(--yellow); }

/* ---- log sheet ---- */
.sheet { width: 100%; max-width: 640px; max-height: 94dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0;
  background: var(--slate-2); color: var(--chalk); overflow: auto; }
.sheet::backdrop { background: rgba(6, 9, 8, .7); }
.sheet[open] { animation: rise .4s var(--ease); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet form { display: grid; gap: 12px; padding: 8px 16px max(18px, env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { margin: 0; font: 800 26px/1 var(--display); text-transform: uppercase; }
.shot { display: grid; place-items: center; min-height: 168px; border-radius: var(--r); background: var(--slate-3); overflow: hidden; color: var(--chalk-2); }
.shot-hint { display: grid; grid-template-columns: 1fr 1fr; width: 100%; height: 100%; min-height: 168px; }
.shot-btn { display: grid; place-content: center; justify-items: center; gap: 8px; font-weight: 600; cursor: pointer; color: var(--chalk); }
.shot-btn + .shot-btn { border-left: 1px solid var(--rule); color: var(--chalk-2); }
.shot-btn:hover { background: color-mix(in srgb, var(--chalk) 5%, transparent); }
.shot-btn svg { width: 34px; height: 34px; }
.photo-change { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: -4px; }
.photo-change > label:not(.back-btn) { min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; color: var(--chalk-2); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.taken { display: flex; align-items: center; gap: 8px; color: var(--chalk-2); font-size: 15px; }
.taken svg { width: 20px; height: 20px; color: var(--yellow); }
.taken input { padding: 8px 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--slate-3); color: var(--chalk); color-scheme: dark; }
.shot img { width: 100%; max-height: 300px; object-fit: cover; }
.field { width: 100%; padding: 13px 14px; border: 1px solid transparent; border-radius: 12px; background: var(--slate-3); }
.field::placeholder { color: var(--chalk-3); }
.field:focus { outline: none; border-color: var(--yellow); }
.field.big { font: 800 24px/1.1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.field.big::placeholder { text-transform: none; font: 500 17px var(--ui); }
.field-icon { position: relative; }
.field-icon svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--chalk-3); width: 20px; height: 20px; }
.field-icon .field { padding-left: 42px; }
textarea.field { resize: vertical; }
.rate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label { font-weight: 600; color: var(--chalk-2); }
details { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 4px 0 12px; }
summary { padding: 10px 0 4px; color: var(--chalk-2); font-weight: 600; cursor: pointer; list-style: none; }
summary::after { content: " +"; color: var(--yellow); }
details[open] summary::after { content: " −"; }
details h3 { margin: 16px 0 6px; font-size: 13px; font-weight: 700; color: var(--chalk-3); text-transform: uppercase; letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 38px; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; background: none; color: var(--chalk-2); font-size: 14px; }
.chips button.on { background: var(--chalk); border-color: var(--chalk); color: var(--slate); font-weight: 600; }
.attr { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 10px; font-size: 14px; }
.attr input { width: 100%; accent-color: var(--yellow); }
.attr .ends { grid-column: 2; display: flex; justify-content: space-between; margin-top: -8px; font-size: 11px; color: var(--chalk-3); }

/* ---- review ---- */
#review { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; background: #0d110f; }
#review[hidden] { display: none; }
.r-top { display: flex; justify-content: space-between; align-items: center; padding: max(10px, env(safe-area-inset-top)) 16px 10px; color: var(--chalk-2); font-size: 14px; font-variant-numeric: tabular-nums; }
#r-photo { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.r-panel { display: grid; gap: 8px; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); background: var(--slate-2); border-radius: 22px 22px 0 0; }
.r-panel .meta { margin: 0; color: var(--chalk-2); font-size: 14px; }
.flag { margin: 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--yellow) 14%, transparent); color: var(--yellow); font-size: 14px; }
.r-actions { display: flex; justify-content: space-between; }
.ghost { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 0; background: none; color: var(--chalk-2); padding: 0 6px; }
.ghost svg { width: 18px; height: 18px; }
.ghost.strong { color: var(--chalk); font-weight: 700; }

/* signature: a new bottle is written onto the board letter by letter */
.flip { display: inline-block; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* label reading under the photo */
.label-status { margin: -2px 2px 0; font-size: 14px; color: var(--chalk-2); display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.label-status .sub-status { color: var(--chalk-3); }
.label-status .seen { flex-basis: 100%; display: flex; align-items: center; gap: 8px; color: var(--yellow); font-weight: 600; }
.back-btn { justify-self: start; margin-top: -4px; min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border: 1.5px dashed var(--chalk-3); border-radius: 999px; color: var(--chalk-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.label-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.label-pick button { min-height: 36px; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; background: none; color: var(--chalk-2); font-size: 13px; text-align: left; }
.label-pick button.on { background: var(--chalk); border-color: var(--chalk); color: var(--slate); font-weight: 600; }
.label-status.busy::before { align-self: center; content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--yellow); border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
.label-status.unsure { color: var(--yellow); }
@keyframes spin { to { transform: rotate(360deg); } }
.row .unrated.forgot { color: var(--chalk-3); font-weight: 500; }
.r-actions { gap: 4px; }

/* ---- scores out of 10 ---- */
.score { display: inline-flex; align-items: baseline; gap: 1px; padding: 2px 9px 3px; border-radius: 999px; background: var(--slate-3); color: var(--chalk); font-variant-numeric: tabular-nums; white-space: nowrap; }
.score b { font: 800 20px/1 var(--display); }
.score i { font-style: normal; font-size: 12px; color: var(--chalk-3); }
.score.top { background: var(--yellow); color: var(--yellow-ink); }
.score.top i { color: color-mix(in srgb, var(--yellow-ink) 65%, transparent); }
.dots.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; align-items: end; width: 100%; max-width: 360px; }
.dots.scale button { display: grid; justify-items: center; align-content: end; gap: 3px; width: auto; height: 50px; padding: 0; border: 0; background: none; }
.dots.scale button i { width: 100%; height: var(--h); border: 1.5px solid var(--chalk-3); border-radius: 5px; scale: none; }
.dots.scale button i.on { background: var(--yellow); border-color: var(--yellow); }
.dots.scale button span { font-size: 11px; color: var(--chalk-3); font-variant-numeric: tabular-nums; }
.dots.scale.small button { height: 40px; width: auto; }
.dots.scale.small button span { display: none; }
.dots.scale.big { max-width: 420px; margin: 0 auto; }
.dots.scale.big button { height: 64px; }
.rate-row { flex-direction: column; align-items: stretch; }
