:root {
  --ivory: #faf6ef;
  --paper: #ffffff;
  --ink: #0f1b3d;
  --navy: #011a51;
  --navy-2: #0a2a6b;
  --brass: #b8862f;
  --brass-light: #f0d28c;
  --muted: #6f6a60;
  --line: #e9e1d3;
  --soft: #f3ecdf;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow: 0 1px 2px rgba(15, 27, 61, .04), 0 8px 24px rgba(15, 27, 61, .06);
}

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

html { background: var(--ivory); }
body {
  margin: 0;
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

button, textarea, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
h1:focus, h2:focus { outline: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Desktop: the page sits like a phone over a soft photo backdrop */
.backdrop { display: none; }
.app {
  position: relative;
  max-width: 460px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--ivory);
}
@media (min-width: 620px) {
  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(1, 26, 81, .55), rgba(1, 26, 81, .7)), url("img/facade.jpg") center / cover;
    filter: blur(18px) saturate(.9);
    transform: scale(1.1);
  }
  .app {
    min-height: auto;
    margin: 32px auto;
    border-radius: 28px;
    overflow: hidden;
    overflow: clip; /* "hidden" would stop the bottom button from sticking */
    box-shadow: 0 30px 80px rgba(0, 10, 40, .45);
  }
  .screen { min-height: 760px; }
}

/* Screens */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.screen.enter { animation: enter .45s var(--ease) both; }
@keyframes enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.content { padding: 22px 24px 24px; }
.content.center { text-align: center; padding-top: 18vh; }

/* Type */
.eyebrow {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass);
}
h1, h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
h1 { font-size: 42px; line-height: 1.02; }
h2 { font-size: 34px; line-height: 1.08; }
.lede { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 60px;
  padding: 0 12px;
  background: rgba(250, 246, 239, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
}
.icon-btn:active { background: var(--soft); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wordmark {
  text-align: center;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .02em;
}
.step { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); padding-right: 6px; }
.progress {
  position: absolute; left: 24px; right: 24px; bottom: 0;
  height: 2px; background: var(--line); border-radius: 2px; overflow: hidden;
}
.progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brass-light), var(--brass));
  transition: width .5s var(--ease);
}

/* 1. Rate */
.hero { position: relative; height: 50vh; height: 50dvh; min-height: 320px; max-height: 470px; overflow: hidden; }
.hero > img { width: 100%; height: 100%; object-fit: cover; object-position: 92% 50%; display: block; animation: settle 1.6s var(--ease) both; }
@keyframes settle { from { transform: scale(1.06); } to { transform: none; } }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(1, 18, 58, .62) 0%, rgba(1, 18, 58, .18) 38%, rgba(1, 18, 58, 0) 60%);
}
.hero-brand {
  position: absolute; z-index: 1; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 22px 0;
  color: #fff;
}
.hero-logo { border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.hero-name { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.1; }
.hero-place { margin: 2px 0 0; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .85; }

.sheet {
  position: relative;
  flex: 1;
  margin-top: -30px;
  padding: 34px 24px 28px;
  background: var(--ivory);
  border-radius: 28px 28px 0 0;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.stars { display: flex; justify-content: center; gap: 4px; margin: 26px 0 0; }
.star {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border: 0; background: none; padding: 0;
  border-radius: 50%;
}
.star svg {
  width: 44px; height: 44px;
  fill: transparent;
  stroke: #cdbf9f;
  stroke-width: 1.2;
  stroke-linejoin: round;
  transition: fill .2s, stroke .2s, transform .25s var(--ease);
}
.star.on svg { fill: url(#brass); stroke: #b8862f; }
.star.pop svg { animation: pop .42s var(--ease); }
@keyframes pop { 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.star-label {
  min-height: 30px;
  margin: 10px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--brass);
}
.credit { margin: auto 0 0; padding-top: 26px; font-size: 12px; color: #a39c8e; letter-spacing: .02em; }

/* Mini stars */
.mini-stars { display: inline-flex; gap: 2px; }
.mini-stars svg { width: 14px; height: 14px; fill: url(#brass); }
.mini-stars svg.off { fill: #ddd3bf; }
.eyebrow.rated { display: flex; align-items: center; gap: 8px; }

/* 2. Tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.tile {
  display: flex; align-items: center; gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  font-size: 14.5px;
  font-weight: 600;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.tile:active { transform: scale(.97); }
.tile svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--brass); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.tile[aria-pressed="true"] svg { stroke: var(--brass-light); }

/* 3. Ideas */
.ideas { display: grid; gap: 12px; margin-top: 22px; }
.idea {
  position: relative;
  padding: 20px 20px 18px 50px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  font-size: 15.5px;
  line-height: 1.55;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s, transform .15s;
  animation: enter .4s var(--ease) both;
}
.idea:nth-child(2) { animation-delay: .04s; }
.idea:nth-child(3) { animation-delay: .08s; }
.idea:nth-child(4) { animation-delay: .12s; }
.idea:nth-child(5) { animation-delay: .16s; }
.idea:active { transform: scale(.985); }
.idea::before {
  content: "\201C";
  position: absolute; left: 16px; top: 6px;
  font-family: var(--serif);
  font-size: 48px;
  line-height: 1;
  color: var(--brass-light);
}
.idea .tick {
  position: absolute; right: 12px; top: 12px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brass);
  opacity: 0; transform: scale(.6);
  transition: opacity .2s, transform .25s var(--ease);
}
.idea .tick svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.idea[aria-checked="true"] { border-color: var(--brass); box-shadow: 0 0 0 4px rgba(184, 134, 47, .14), var(--shadow); padding-right: 42px; }
.idea[aria-checked="true"] .tick { opacity: 1; transform: none; }
.idea[aria-checked="true"]::before { color: var(--brass); }

.text-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 18px auto 0;
  padding: 10px 6px;
  border: 0; background: none;
  font-size: 14px; font-weight: 600; color: var(--navy);
}
.text-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--brass); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.text-btn.spin svg { animation: spin .6s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
.screen[data-screen="pick"] .content { display: flex; flex-direction: column; }

/* 4. Ready */
.review-card {
  margin-top: 22px;
  padding: 18px 18px 12px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(15, 27, 61, .05), 0 14px 34px rgba(15, 27, 61, .09);
}
.review-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); }
.avatar svg { width: 22px; height: 22px; fill: none; stroke: var(--brass); stroke-width: 1.6; stroke-linecap: round; }
.review-who { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.2; }
#editor {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  resize: none;
  overflow: hidden;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink);
}
#editor:focus { outline: none; }
.review-card:focus-within { box-shadow: 0 0 0 2px var(--brass), 0 14px 34px rgba(15, 27, 61, .09); }
.review-hint {
  display: flex; align-items: center; gap: 6px;
  margin: 10px 0 0; padding-top: 10px;
  border-top: 1px solid var(--soft);
  font-size: 12.5px; color: var(--muted);
}
.review-hint svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linejoin: round; }

.howto { margin-top: 26px; }
.howto-title { margin: 0 0 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
.howto ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.howto li { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.howto strong { font-weight: 700; }
.num {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--brass);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--brass);
}

/* Buttons */
.cta-bar {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(250, 246, 239, 0), var(--ivory) 32%);
  display: grid;
  gap: 4px;
}
.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  transition: transform .15s, opacity .2s, background .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 24px rgba(1, 26, 81, .25);
}
.btn-primary:disabled { opacity: .32; box-shadow: none; cursor: default; transform: none; }
.btn-ghost { background: var(--paper); border: 1px solid var(--line); color: var(--navy); min-height: 52px; }
.g-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #fff; }
.g-mark svg { width: 18px; height: 18px; }
.btn.done { background: linear-gradient(180deg, #2a8f5c, #1c7a4b); }
.btn .wa { width: 22px; height: 22px; fill: #fff; }
.text-link {
  display: block;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

/* 5. Thanks */
.seal { width: 92px; height: 92px; margin: 0 auto 26px; }
.seal svg { width: 100%; height: 100%; fill: none; stroke: url(#brass); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.seal circle { stroke-dasharray: 183; stroke-dashoffset: 183; animation: draw .9s var(--ease) .1s forwards; }
.seal path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s var(--ease) .75s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.screen-thanks h2 { font-size: 40px; }
.screen-thanks .lede { max-width: 300px; margin-left: auto; margin-right: auto; }
.thanks-actions { margin: 56px auto 0; max-width: 320px; }
.small-note { margin: 0 0 10px; font-size: 13px; color: var(--muted); }

/* Low rating */
.issue-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 16px; }
.issue-chips button {
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
}
.issue-chips button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.field {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  font-size: 16px;
  resize: vertical;
}
.field:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px rgba(184, 134, 47, .12); }

/* Toast */
.toast {
  position: fixed; z-index: 20;
  left: 50%; top: calc(14px + env(safe-area-inset-top));
  transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 420px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  font-size: 14.5px;
  box-shadow: 0 12px 30px rgba(1, 26, 81, .3);
  animation: enter .3s var(--ease) both;
}

@media (max-width: 360px) {
  h1 { font-size: 36px; }
  h2 { font-size: 30px; }
  .star { width: 52px; height: 52px; }
  .star svg { width: 38px; height: 38px; }
  .tiles { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .seal circle, .seal path { stroke-dashoffset: 0; }
}

.start-over { margin: 28px auto 0; border: 0; background: none; font-size: 13px; font-weight: 500; color: #a39c8e; }

/* Pure veg is the hotel's highlight, so its tile spans the full row */
.tile.wide { grid-column: 1 / -1; }
.tile small { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--muted); }
.tile[aria-pressed="true"] small { color: rgba(255, 255, 255, .7); }

/* Stayed or came to eat */
.visit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.visit button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 92px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  font-size: 15px;
  font-weight: 700;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.visit button:active { transform: scale(.97); }
.visit svg { width: 26px; height: 26px; fill: none; stroke: var(--brass); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.visit button[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 10px 24px rgba(1, 26, 81, .2); }
.visit button[aria-checked="true"] svg { stroke: var(--brass-light); }
.section-label {
  margin: 30px 0 0;
  font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brass);
}
.section-label span { margin-left: 6px; letter-spacing: .02em; text-transform: none; font-weight: 500; color: var(--muted); }
.section-label + .tiles { margin-top: 12px; }
.tile.fill { grid-column: 1 / -1; }
