/* NhaTrang.Wiki: illustrated destinations, photo reel, dish before venue suggestions. */
.eat-dialog {
  --eat-muted: color-mix(in srgb, var(--color-muted) 78%, var(--color-text));
  width: min(1120px, calc(100% - 40px));
  max-width: calc(100% - 40px);
  height: min(880px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  border-radius: 20px;
  background: var(--color-bg);
}
.eat-dialog .eat-header {
  padding: 12px 24px;
  background: var(--color-bg);
}
.eat-dialog .eat-header h2 {
  font-size: clamp(20px, 2.5vw, 30px);
  letter-spacing: -0.03em;
}
.eat-dialog #eat-body {
  flex: 1 1 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.eat-dialog .food-game {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.eat-workspace {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-bg);
}
.eat-controls {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 14px 24px 10px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.eat-controls .button {
  min-height: 48px;
  min-width: 44px;
  justify-content: center;
  gap: 8px;
  margin: 0;
  line-height: 1.3;
  white-space: normal;
  border-radius: 12px;
  font-size: 15px;
}
.eat-dock-secondary,
.eat-dock-primary {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.eat-dock-secondary > .button,
.eat-dock-primary > .button {
  flex: 1 1 0;
  width: auto;
}
.eat-controls .eat-dock-secondary > .button {
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  padding: 8px;
}
.eat-dialog .eat-controls .spin-button {
  display: flex;
  width: 100%;
  min-height: 56px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 14px;
}
.eat-dialog .eat-controls .prefs-toggle {
  display: flex;
  padding: 8px;
}
.eat-filter-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 4px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 11px;
  font-weight: 700;
}
.eat-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.eat-dialog :is(button, summary, input):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}
.eat-dialog button:disabled {
  cursor: default;
  opacity: 0.5;
}
.eat-dialog button:not(:disabled):active {
  transform: scale(0.98);
}

/* The reel uses contributed menu photos, with labelled fallbacks when absent. */
.eat-dialog .food-roulette {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  padding: 16px 0;
  text-align: center;
}
.eat-stage-context {
  padding: 0 20px;
}
.eat-stage-context p {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 600;
}
.eat-stage-context .muted {
  font-size: 13px;
  font-weight: 400;
}
.eat-dialog .slot-scene {
  --slot-width: clamp(220px, 24vw, 300px);
  height: 380px;
  min-height: 200px;
  flex: 0 0 auto;
  margin: 4px 0 0;
  border-radius: 0;
  background: transparent;
  touch-action: pan-y;
}
.eat-dialog .slot-scene::before,
.eat-dialog .slot-scene::after {
  width: 12%;
  z-index: 2;
  pointer-events: none;
}
.eat-dialog .slot-scene::before {
  background: linear-gradient(90deg, var(--color-bg), transparent);
}
.eat-dialog .slot-scene::after {
  background: linear-gradient(270deg, var(--color-bg), transparent);
}
.eat-dialog .slot-track {
  top: 24px;
  gap: 22px;
  animation: none;
}
.eat-dialog .slot-card {
  display: flex;
  flex-direction: column;
  height: 334px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: none;
  opacity: 0.48;
  transform: scale(0.9);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}
.eat-dialog .slot-card.is-near {
  opacity: 0.65;
  transform: scale(0.93);
}
.eat-dialog .slot-card.is-center {
  opacity: 1;
  transform: scale(1);
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}
.eat-dialog .slot-card.is-winner {
  outline-width: 3px;
}
.eat-dialog .slot-art {
  flex: 1 1 0;
  height: 240px;
  min-height: 0;
  border-radius: 0;
  background: var(--color-surface);
}
.eat-dialog .slot-art img {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}
.eat-dialog .slot-words {
  flex: 0 0 auto;
  padding: 14px 16px;
  text-align: left;
}
.eat-dialog .slot-card strong {
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.eat-dialog .slot-card small {
  margin-top: 6px;
  font-size: 12px;
}
.eat-dialog .slot-pointer {
  z-index: 3;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--color-primary);
  transform: translateX(-50%) rotate(45deg);
}
.eat-dialog .slot-empty {
  margin: auto;
  padding: 40px 24px;
  max-width: 46ch;
  min-height: 100%;
  display: grid;
  place-content: center;
  line-height: 1.6;
  font-size: 16px;
}
.eat-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 20px;
}
.eat-preview > div {
  min-width: 0;
  max-width: 480px;
  flex: 1;
}
.eat-preview-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.eat-dialog .slot-card.is-center {
  outline-color: var(--brand-red);
}
.eat-dialog .slot-pointer {
  background: var(--brand-red);
  width: 16px;
  height: 16px;
}
.eat-spin-progress {
  position: absolute;
  inset: auto 22% 3px;
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--color-border);
}
.eat-spin-progress > span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--brand-red);
  transform-origin: left;
  animation: eat-spin-progress 8200ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes eat-spin-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
.eat-result-copy {
  position: relative;
  isolation: isolate;
}
.eat-celebration {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.eat-celebration > span {
  position: absolute;
  top: 22%;
  left: 50%;
  width: 6px;
  height: 12px;
  background: var(--brand-red);
  border-radius: 2px;
  opacity: 0;
  animation: eat-celebrate 900ms ease-out both;
}
.eat-celebration > span:nth-child(1) {
  --burst-x: -120px;
  --burst-y: -50px;
}
.eat-celebration > span:nth-child(2) {
  --burst-x: -80px;
  --burst-y: -80px;
  background: var(--color-text);
}
.eat-celebration > span:nth-child(3) {
  --burst-x: 65px;
  --burst-y: -70px;
}
.eat-celebration > span:nth-child(4) {
  --burst-x: 120px;
  --burst-y: -35px;
  background: var(--color-text);
}
.eat-celebration > span:nth-child(5) {
  --burst-x: -135px;
  --burst-y: 65px;
  background: var(--color-primary);
}
.eat-celebration > span:nth-child(6) {
  --burst-x: -60px;
  --burst-y: 100px;
}
.eat-celebration > span:nth-child(7) {
  --burst-x: 75px;
  --burst-y: 95px;
  background: var(--color-text);
}
.eat-celebration > span:nth-child(8) {
  --burst-x: 135px;
  --burst-y: 55px;
}
@keyframes eat-celebrate {
  0% {
    transform: translate(0, 0) rotate(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--burst-x), var(--burst-y)) rotate(160deg);
    opacity: 0;
  }
}
.eat-reel-nav {
  width: 44px;
  min-height: 44px;
  padding: 10px;
  border-radius: 50%;
}
.eat-reel-nav > span {
  display: none;
}
.eat-dialog
  :is(
    .muted,
    .spin-status,
    .eat-result-swipe,
    .eat-venue-copy small,
    .slot-card small,
    .eat-photo-placeholder
  ) {
  color: var(--eat-muted);
}
.eat-dialog .spin-status {
  margin: 4px 20px 0;
  min-height: 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.4;
}
.eat-photo-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 100px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--color-surface);
  color: var(--color-muted);
}
.eat-photo-placeholder .eat-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}
.eat-photo-placeholder small {
  padding: 0 10px;
  white-space: normal;
  text-align: center;
  font-size: 13px;
}
.eat-notice,
.eat-load-error {
  margin: 12px 20px;
  font-size: 14px;
}

/* Filter choices scroll while their apply action remains docked. */
.eat-dialog .food-preferences {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 24px 32px;
}
.eat-dialog .prefs-title {
  margin: 0 0 16px;
  font-size: 26px;
  letter-spacing: -0.03em;
}
.eat-dialog .food-pref-group {
  padding: 20px 0;
}
.eat-dialog .food-pref-group h3 {
  font-size: 16px;
  margin: 0 0 12px;
}
.eat-dialog .food-pref-group .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.eat-dialog .food-preferences .chip {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 10px;
  line-height: 1.3;
  white-space: normal;
}
.eat-dialog .food-pref-group p {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
}
.eat-dialog .catalog-check {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}
.eat-dialog .catalog-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--color-primary);
}
.eat-dialog .eat-filter-done {
  flex: 2;
}

/* A single large dish image leads; venue suggestions follow it. */
.eat-dialog .eat-congrats {
  padding: 0;
  margin: 0;
  background: transparent;
  animation: none;
  text-align: left;
}
.eat-result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  touch-action: pan-y;
}
.eat-result-photo {
  min-width: 0;
  height: 360px;
  overflow: hidden;
  background: var(--color-surface);
}
.eat-result-photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.eat-result-copy {
  padding: 32px;
  min-width: 0;
}
.eat-congratulation {
  margin: 0 0 12px;
  font-size: 17px;
  color: var(--color-primary);
  font-weight: 600;
}
.eat-dialog .eat-congrats h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.eat-result-price {
  font-size: 22px;
  margin: 0 0 8px;
  font-weight: 600;
}
.eat-result-copy .muted {
  margin: 0 0 10px;
  line-height: 1.5;
  font-size: 14px;
}
.eat-result-copy .button {
  min-height: 44px;
  font-size: 14px;
  gap: 8px;
}
.eat-result-swipe {
  text-align: center;
  color: var(--color-muted);
  font-size: 12px;
  margin: 12px 20px;
}
.eat-result-venues {
  padding: 16px 24px 24px;
  max-width: 880px;
  margin: 0 auto;
}
.eat-result-venues h3 {
  margin: 0 0 16px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.eat-dialog .catalog-nearest-place {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  padding: 14px 0;
  background: transparent;
  color: var(--color-text);
  text-align: left;
}
.eat-venue-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-muted);
}
.eat-venue-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 5px;
}
.eat-venue-copy strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.eat-venue-copy small {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.4;
}
.eat-result-venues > p {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.5;
}
.eat-dialog .eat-library {
  padding: 16px 24px 24px;
  margin: 0;
  border: 0;
}
.eat-dialog .eat-library summary {
  font-size: 20px;
  padding: 8px 0 16px;
}
.eat-dialog .eat-dish-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.eat-dialog .eat-dish-tile {
  border-radius: 12px;
  background: var(--color-surface);
}
.eat-dialog .eat-dish-tile > img,
.eat-dialog .eat-dish-tile > .eat-photo-placeholder {
  width: 100%;
  height: 150px;
  object-fit: cover;
}
.eat-dialog .eat-dish-tile > span:not(.eat-photo-placeholder) {
  padding: 12px;
  font-size: 15px;
  line-height: 1.3;
}
.eat-dialog .eat-catalog-nested {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 20px;
}
.eat-catalog-nested > button {
  flex: 0 0 auto;
  min-height: 48px;
  z-index: 3;
  background: var(--color-surface);
}
.eat-nested-content {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}
@media (min-width: 761px) {
  html.main-menu-ready dialog.with-main-menu.eat-dialog {
    width: min(1120px, calc(var(--main-menu-available-width) - 40px));
    height: min(880px, calc(var(--main-menu-available-height) - 40px));
    max-width: calc(var(--main-menu-available-width) - 40px);
    max-height: calc(var(--main-menu-available-height) - 40px);
  }
  .eat-controls {
    padding-inline: max(24px, calc((100% - 680px) / 2));
  }
}
@media (max-width: 760px) {
  .eat-dialog,
  .eat-dialog[open] {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .eat-dialog .eat-header {
    padding: max(8px, env(safe-area-inset-top)) 16px 8px;
    min-height: 60px;
  }
  .eat-dialog .eat-header h2 {
    font-size: 20px;
  }
  .eat-controls {
    padding: 10px max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    gap: 4px;
  }
  html.main-menu-ready .eat-controls {
    padding-bottom: 6px;
  }
  .eat-controls .eat-dock-secondary > .button {
    font-size: 12px;
    padding: 6px 3px;
    gap: 6px;
  }
  .eat-dialog .food-roulette {
    padding: 12px 0;
  }
  .eat-stage-context p {
    font-size: 15px;
  }
  .eat-dialog .slot-scene {
    --slot-width: min(63vw, 270px);
    height: clamp(230px, 42dvh, 360px);
  }
  .eat-dialog .slot-track {
    top: 22px;
    height: calc(100% - 42px);
    gap: 16px;
  }
  .eat-dialog .slot-card {
    height: 100%;
  }
  .eat-dialog .slot-art {
    height: auto;
  }
  .eat-dialog .slot-words {
    padding: 12px;
  }
  .eat-dialog .slot-card strong {
    font-size: 17px;
  }
  .eat-dialog .slot-card small {
    font-size: 11px;
  }
  .eat-preview {
    padding-inline: 12px;
    gap: 8px;
  }
  .eat-preview-name {
    font-size: 18px;
  }
  .eat-dialog .food-preferences {
    padding: 20px 16px 28px;
  }
  .eat-result-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .eat-result-photo {
    height: clamp(180px, 31dvh, 300px);
  }
  .eat-result-copy {
    padding: 20px;
  }
  .eat-dialog .eat-congrats h2 {
    font-size: 32px;
  }
  .eat-congratulation {
    font-size: 15px;
    margin-bottom: 8px;
  }
  .eat-result-price {
    font-size: 19px;
  }
  .eat-result-venues {
    padding: 16px 20px 24px;
  }
  .eat-result-venues h3 {
    font-size: 20px;
  }
  .eat-dialog .eat-library {
    padding: 16px;
  }
  .eat-dialog .eat-dish-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-height: 650px) {
  .eat-dialog .food-roulette {
    padding: 6px 0;
  }
  .eat-dialog .slot-scene {
    height: 220px;
  }
  .eat-stage-context .muted {
    display: none;
  }
  .eat-dialog .spin-status {
    font-size: 12px;
  }
}
@media (max-height: 450px) and (min-width: 650px) {
  .eat-dialog .food-roulette {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    padding: 0;
  }
  .eat-stage-context {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }
  .eat-dialog .slot-scene {
    grid-column: 1;
    grid-row: 1 / 4;
    height: 210px;
    --slot-width: 180px;
  }
  .eat-preview {
    grid-column: 2;
    grid-row: 2;
  }
  .eat-dialog .spin-status {
    grid-column: 2;
    grid-row: 3;
  }
  .eat-controls {
    padding-block: 4px;
    gap: 0;
  }
  .eat-dialog .eat-controls .spin-button {
    min-height: 46px;
  }
  .eat-controls .button {
    min-height: 44px;
  }
  .eat-dialog .eat-header {
    min-height: 48px;
    padding-block: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .eat-spin-progress > span,
  .eat-celebration > span {
    animation: none;
  }
  .eat-dialog .slot-card {
    transition: none;
  }
}
.eat-dialog
  .eat-workspace
  :is(
    .muted,
    .spin-status,
    .eat-result-swipe,
    .eat-venue-copy small,
    .slot-card small,
    .eat-photo-placeholder
  ) {
  color: var(--eat-muted);
}
