:root {
  --bg: #0c0c12;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.6);
  --accent: #c8ff3d;
  --danger: #ff4d6d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: radial-gradient(120% 70% at 50% 0%, #2a1f5c 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
header { text-align: center; margin: 8px 0 20px; }
.pill {
  display: inline-block; background: var(--accent); color: var(--bg);
  font-weight: 900; letter-spacing: 4px; font-size: 12px; padding: 4px 12px; border-radius: 99px;
}
h1 { margin: 8px 0 2px; font-size: 32px; font-weight: 900; letter-spacing: -0.5px; }
h2 { margin: 0; font-size: 18px; font-weight: 900; }
.sub { margin: 0; color: var(--muted); }
.code { color: var(--accent); font-weight: 900; letter-spacing: 3px; }
main { max-width: 520px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 28px 20px; }
.center { text-align: center; }
.center p { color: var(--muted); }
.big { font-size: 64px; line-height: 1.1; margin-bottom: 8px; }
.dice { display: inline-block; animation: tumble 1.1s ease-in-out infinite; }
@keyframes tumble { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(200deg) translateY(-14px); } 100% { transform: rotate(360deg) translateY(0); } }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 12px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: block; margin-bottom: 20px; }
.field span { display: block; color: var(--muted); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
input {
  width: 100%; font: inherit; font-size: 18px; font-weight: 700; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; outline: none;
}
input:focus { border-color: var(--accent); }
.row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.count { color: var(--accent); font-weight: 900; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.place {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 64px;
  padding: 10px 12px; border-radius: 18px; border: 2px solid transparent; cursor: pointer;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; text-align: left;
  font: inherit; font-weight: 800; transition: transform 0.12s, opacity 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.place::before { content: ""; position: absolute; inset: 0; border-radius: 16px; background: rgba(0, 0, 0, 0.28); }
.place > * { position: relative; }
.place .emoji { font-size: 26px; }
.place .label { overflow-wrap: anywhere; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.place .tick {
  position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--bg); font-size: 14px; font-weight: 900;
  display: grid; place-items: center; opacity: 0; transform: scale(0.5); transition: 0.15s;
}
.place[aria-pressed="true"] { border-color: var(--accent); transform: scale(1.02); }
.place[aria-pressed="true"]::before { background: rgba(0, 0, 0, 0.1); }
.place[aria-pressed="true"] .tick { opacity: 1; transform: scale(1); }
.place:disabled { opacity: 0.35; cursor: not-allowed; }
.cta {
  width: 100%; margin-top: 20px; height: 58px; border: 0; border-radius: 99px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent), #7cffb2); color: var(--bg);
  font: inherit; font-size: 18px; font-weight: 900; letter-spacing: 1px;
}
.cta:disabled { opacity: 0.45; cursor: not-allowed; }
.saved { color: var(--accent); text-align: center; font-weight: 700; }
.error { color: var(--danger); text-align: center; font-weight: 700; }
.kicker { letter-spacing: 4px; font-weight: 800; font-size: 12px; }
.winner { font-size: 40px; line-height: 1.1; margin: 4px 0 8px; }
footer { text-align: center; color: rgba(255, 255, 255, 0.35); font-size: 12px; margin-top: 28px; }

/* v1.2.2 – search, cuisine chips, addresses, maps links */
.search {
  width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: inherit; font: inherit; font-size: 16px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  min-height: 44px;
}
.chip[aria-pressed="true"] { background: var(--accent); color: #0C0C12; border-color: var(--accent); }
.cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cell[hidden] { display: none; }
.cell .place { flex: 1; }
.place:has(.addr) { flex-wrap: wrap; row-gap: 4px; }
.place .addr { flex-basis: 100%; font-size: 11px; font-weight: 600; opacity: 0.85; overflow-wrap: anywhere; }
.maplink { color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; padding: 2px 6px; align-self: flex-start; }
.maplink:hover, .maplink:focus-visible { color: var(--accent); }
.big-link { display: inline-block; font-size: 15px; margin: 6px 0 10px; color: var(--accent); }
.address { margin: 0; }
.empty { color: var(--muted); text-align: center; }

/* v1.2.3 – Favourites / More places, progressive list, sticky picks bar */
.pick-title { margin: 4px 0 10px; font-size: 18px; }
.sec { margin: 14px 0 8px; font-size: 15px; font-weight: 900; }
.sec-hint { color: var(--muted); font-size: 12px; font-weight: 700; margin-left: 6px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.linkbtn {
  border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 800;
  cursor: pointer; padding: 6px 0;
}
.linkbtn:disabled { opacity: 0.5; }
.more-btn {
  display: block; width: 100%; margin: 12px 0 4px; padding: 12px; border-radius: 14px;
  border: 1px dashed var(--line); background: transparent; color: var(--muted);
  font: inherit; font-weight: 800; cursor: pointer;
}
.cell .meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 18px; }
.cell .dist { color: var(--accent); font-size: 12px; font-weight: 800; padding-right: 6px; }
.pickbar {
  position: sticky; bottom: 0; z-index: 5; margin: 16px -12px 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(12, 12, 18, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
}
.pickbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 30px; }
.pickbar-title { flex: none; font-weight: 900; font-size: 14px; }
.pick-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pick-chips::-webkit-scrollbar { display: none; }
.pick-chip {
  flex: none; border: 1px solid var(--accent); background: rgba(215, 255, 58, 0.12); color: #fff;
  border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer;
}
.pick-hint { color: var(--muted); font-size: 12px; }
.pickbar .cta { margin: 0; }
.pickbar .saved, .pickbar .error { margin: 8px 0 0; font-size: 13px; }

/* Remember my name */
.remember { display: flex; align-items: center; gap: 8px; margin: -10px 0 18px; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.remember input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

.dist-line { margin: 2px 0 0; color: var(--accent); font-weight: 800; }

.vbadge { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.vbadge.open { color: #4ade80; }
.vbadge.closingSoon, .vbadge.opensLater { color: #ffc857; }
.vbadge.closedToday, .vbadge.closedNow { color: #ff6b81; }

/* v1.4.1 – reviews (drill ratings) */
.drills { display: inline-flex; gap: 1px; vertical-align: middle; color: #fff; }
.drill { display: block; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; }
.rating-text { color: var(--muted); font-weight: 700; }
.rate-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(12,12,18,.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rate-box { width: min(440px, 100%); max-height: 92vh; overflow-y: auto; background: #17151f; border: 1px solid var(--line);
  border-radius: 24px; padding: 20px; }
.rate-title { margin: 0 0 4px; font-size: 22px; }
.rate-sub { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.drill-picker { display: flex; justify-content: center; gap: 6px; margin: 4px 0 14px; color: #fff; }
.drill-btn { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 14px; padding: 6px; cursor: pointer; }
.drill-btn[aria-checked="true"] { border-color: var(--accent); }
.rate-box textarea { width: 100%; box-sizing: border-box; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  color: inherit; font: inherit; padding: 10px 12px; resize: vertical; }
.count-small { color: var(--muted); font-weight: 600; font-size: 11px; }
.review-list { display: grid; gap: 10px; margin-top: 8px; }
.review { border-top: 1px solid var(--line); padding-top: 8px; }
.review-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.review-text { margin: 4px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rate-btn { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.rate-btn[hidden] { display: none; }
.linkbtn { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 800; cursor: pointer; padding: 6px 0; }
.center-block { display: block; margin: 10px auto 0; }
.acct-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.small.ok { color: var(--accent); font-weight: 700; }
.small.error { text-align: left; }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 900; line-height: 1; vertical-align: middle; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.signin-gate { text-align: center; }
.signin-gate p { color: var(--muted); }

/* Responsive (v1.6.0): tablet / desktop use the width instead of a stretched phone column. */
@media (min-width: 760px) {
  main#app:not(.me):not(.host-main) { max-width: 1000px; }
}
.signin-gate a.cta { display: flex !important; align-items: center; justify-content: center; min-height: 52px; }
/* ≥44 px touch targets for link-style buttons (responsive requirement) */
.linkbtn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.center-block.linkbtn { display: flex; margin-left: auto; margin-right: auto; }
/* Vote cards on phones: the hours badge wraps instead of widening the page. */
.cell .meta { flex-wrap: wrap; row-gap: 2px; }
.vbadge { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.maplink { min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px 0 2px; }
.acct-link { display: inline-flex; align-items: center; min-height: 44px; }

/* v1.6.0 /v: account in the header + sign-in hint */
header { position: relative; }
.hdr-account { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; padding: 0 16px;
  border-radius: 999px; border: 2px solid var(--accent); color: var(--accent); font-weight: 900; text-decoration: none; }
.hdr-account.signed-in { border-color: var(--line); color: #fff; padding: 0 14px 0 6px; font-weight: 800; }
.hdr-account[hidden], .signin-hint[hidden] { display: none; }
.signin-hint { margin: -6px 0 14px; font-size: 13px; color: var(--muted); }
.signin-hint a { color: var(--accent); font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
/* Vote cards: everything stays inside the card at any width. */
.cell, .cell .place { min-width: 0; }
.cell .meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 2px 6px; min-height: 0; }
.cell .meta > * { min-width: 0; max-width: 100%; }
.cell .meta .rv { overflow: hidden; }
.cell .dist { margin-left: auto; padding-right: 4px; white-space: nowrap; }
.signin-hint { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; line-height: 1.3; }
.menulink { color: var(--accent); }
.result-menu { margin: 0; }

/* ---- Vote cards (v1.6.4, Haitham's layout) --------------------------------
   One card = main row (select button) + action row + inline hours.
   1 column on phones, 2 columns from 600 px (tablet + desktop). */
.grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vcard { position: relative; display: flex; flex-direction: column; gap: 0; min-width: 0; overflow: hidden;
  border-radius: 18px; border: 2px solid transparent;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 55%, #14121c), color-mix(in srgb, var(--c2) 45%, #14121c)); }
.vcard:has(.place[aria-pressed="true"]) { border-color: var(--accent); }
.vcard .place { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 12px 12px 8px; cursor: pointer; color: #fff; }
.vcard .place::before { content: none; }
.vcard .place:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 16px; }
.vcard .place:disabled { opacity: .45; cursor: not-allowed; }
.vcard .emoji { font-size: 28px; line-height: 1; }
.vcard .vmain { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vcard .label { font-weight: 900; font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.vcard .vsub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 12px; }
.vcard .vsub:empty { display: none; }
.vcard .vbadge { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; border: 1px solid;
  white-space: nowrap; background: rgba(0,0,0,.35); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.vcard .dist { color: var(--accent); font-weight: 800; margin: 0; padding: 0; white-space: nowrap; }
.vcard .dist:empty, .vcard .rv:empty { display: none; }
.vcard .rv { min-width: 0; overflow: hidden; }
.vcard .tick { position: static; opacity: 1; transform: none; flex: none; width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid rgba(255,255,255,.7); display: grid; place-items: center; color: transparent; font-weight: 900; font-size: 15px;
  background: rgba(0,0,0,.25); }
.vcard .place[aria-pressed="true"] .tick { background: var(--accent); border-color: var(--accent); color: #0c0c12; }
.vacts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }
.vact { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 44px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff; cursor: pointer;
  background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.18); white-space: nowrap; }
.vact.icon { min-width: 44px; padding: 0; font-size: 17px; }
.vact.menulink { color: var(--accent); }
.vact:focus-visible { outline: 2px solid var(--accent); }
.vact[aria-expanded="true"] { background: rgba(255,255,255,.16); }
.vhours { margin: 0 10px 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.38); font-size: 13px; }
.vhours[hidden] { display: none; }
.vaddr, .vnote { margin: 0 0 6px; overflow-wrap: anywhere; }
.vnote { color: var(--muted); margin: 6px 0 0; }
.vweek { width: 100%; border-collapse: collapse; }
.vweek th { text-align: left; font-weight: 700; color: var(--muted); width: 44px; padding: 2px 0; }
.vweek td { padding: 2px 0; }
.vweek tr.today th, .vweek tr.today td { color: #fff; font-weight: 900; }
.grid { align-items: start; }
.more-sentinel { height: 1px; }
.more-sentinel[hidden] { display: none; }
.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; }

/* ---- Sign-in modal (v1.6.4) ------------------------------------------------ */
.auth-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px 20px 22px;
  border: 1px solid var(--line); border-radius: 24px; background: #17151f; color: var(--text); }
.auth-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.auth-dialog h2 { margin: 0 0 4px; font-size: 22px; }
.auth-why { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.auth-close-row { display: flex; justify-content: flex-end; margin: -6px -8px 0; }
.auth-x { all: unset; box-sizing: border-box; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  color: var(--muted); font-size: 20px; cursor: pointer; }
.auth-x:hover, .auth-x:focus-visible { background: rgba(255,255,255,.08); color: #fff; outline: 2px solid var(--accent); }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.auth-tabs button { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font: inherit; font-weight: 800; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.auth-form .field { margin-bottom: 14px; }
.auth-form [hidden] { display: none !important; }
.auth-form .hint { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.auth-msg { color: var(--danger); font-weight: 700; font-size: 13px; margin: 0 0 10px; }
.auth-msg.ok { color: var(--accent); }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* Google's official button image, unaltered; a 44 px tall transparent hit area around the 40 px button. */
.gsi-btn { all: unset; box-sizing: border-box; display: flex; justify-content: center; align-items: center; width: 100%;
  min-height: 44px; cursor: pointer; border-radius: 22px; }
.gsi-btn img { display: block; width: 180px; height: 40px; }
.gsi-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gsi-btn:disabled { opacity: .5; cursor: progress; }
@media (max-width: 600px) {
  /* Phones: a full-height sheet. */
  .auth-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0;
    padding: max(12px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); }
}
.approval-note { margin: 10px auto 0; max-width: 520px; padding: 10px 14px; border-radius: 14px; border: 1px solid #ffc857;
  color: #ffc857; background: rgba(255,200,87,.1); font-size: 14px; font-weight: 700; text-align: center; }
.approval-note[hidden] { display: none; }

/* v1.7.0 vote cards: favourites + who's there now */
.vact.vstar { color: var(--muted); }
.vact.vstar.on { color: #ffd166; }
.vact[hidden] { display: none !important; }
.vnowhere { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 10px 10px; padding: 6px 10px; border-radius: 12px;
  background: rgba(0,0,0,.35); font-size: 12px; font-weight: 800; }
.vnowhere[hidden] { display: none; }
.fav-hint { margin: -2px 0 8px; color: var(--muted); font-size: 13px; }
.fav-hint[hidden] { display: none; }
