*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: #9c2f1a;
  color: #fffaf4;
}

body.void {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #070708;
  color: #f4f1ea;
  font-family: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

body.void.listing-open {
  overflow: hidden;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.5) 100%);
}

.stage {
  position: relative;
  z-index: 1;
  width: min(92vw, 92dvh);
  aspect-ratio: 1;
  overflow: hidden;
  background: #070708;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  touch-action: none;
  user-select: none;
}

.tile {
  position: absolute;
  touch-action: none;
  cursor: grab;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile.light {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 30%),
    linear-gradient(160deg, #f6f3ec, #cfc7ba);
}

.tile.dark {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 26%),
    linear-gradient(160deg, #3a3a3c, #101012);
}

.tile.is-lifted {
  cursor: grabbing;
  transform: scale(1.045);
  box-shadow: 0 22px 36px rgba(0, 0, 0, 0.42);
}

.secret-door {
  position: absolute;
  z-index: 1;
  left: 37.5%;
  top: 75%;
  width: calc(100% / 8);
  height: calc(100% / 8);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  visibility: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.secret-door svg {
  width: 74%;
  height: 92%;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 0 7px rgba(224, 177, 90, 0.55));
}

.gate {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 50%;
  width: min(440px, 76%);
  transform: translate(-50%, -50%);
}

.gate-bar {
  background: rgba(6, 6, 8, 0.92);
  padding: 22px 22px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

.gate input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 0 8px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f7f4ee;
  caret-color: #fff;
  font-family: "Outfit", "Avenir Next", sans-serif;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0.42em;
  text-align: center;
  text-indent: 0.42em;
  text-transform: lowercase;
  outline: none;
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
}

.gate input::selection {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.gate-bar.is-shaking {
  animation: shake 0.38s ease;
}

@keyframes shake {
  0%,
  100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

.listing {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: auto;
  overscroll-behavior: contain;
  background: #f3eee6;
  color: #1c1410;
  font-family: "Outfit", "Avenir Next", sans-serif;
}

.mast {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #161311;
  color: #f6f1e8;
  padding-top: max(18px, env(safe-area-inset-top));
}

.mast-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 16px;
}

.kicker {
  margin: 0 0 8px;
  color: #e7b15a;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.wordmark {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.close {
  flex: none;
  min-height: 44px;
  margin-top: 4px;
  padding: 0 14px;
  border: 1px solid rgba(246, 241, 232, 0.35);
  background: transparent;
  color: #f6f1e8;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.flame-rule {
  height: 3px;
  background: linear-gradient(90deg, #9c2f1a, #e7b15a 48%, #9c2f1a);
}

.tabs {
  display: flex;
  gap: 4px;
  width: min(1080px, calc(100% - 16px));
  margin: 0 auto;
}

.tabs button {
  min-height: 48px;
  padding: 12px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(246, 241, 232, 0.62);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  color: #f6f1e8;
  border-bottom-color: #e7b15a;
}

.close:focus-visible,
.tabs button:focus-visible {
  outline: 2px solid #e7b15a;
  outline-offset: 3px;
}

.marquee {
  overflow: hidden;
  background: #f7f2ea;
  color: #9c2f1a;
  border-bottom: 1px solid rgba(28, 20, 16, 0.08);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: ticker 32s linear infinite;
}

.marquee-track span {
  padding: 10px 0;
  white-space: nowrap;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 28px 6vw 36px;
  background:
    radial-gradient(ellipse at 70% 40%, rgba(226, 140, 70, 0.18), transparent 42%),
    #241c18;
  color: #f6f1e8;
}

.plate {
  width: min(100%, 560px);
  height: auto;
  display: block;
  margin: 0 auto;
}

.hero-caption {
  margin: 0;
  text-align: center;
  color: rgba(246, 241, 232, 0.78);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 0;
  color: #e7b15a;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sheet {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 36px 0 28px;
}

.visit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.card {
  padding: 22px 22px 8px;
  background: rgba(255, 252, 247, 0.72);
  border-top: 3px solid #9c2f1a;
}

.card h2,
.menu-sheet h2,
.story h2 {
  margin: 0 0 16px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.hours,
.address {
  margin: 0;
}

.hours div,
.address p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(28, 20, 16, 0.08);
  font-size: 15px;
}

.hours dt {
  color: #6d5c4e;
}

.hours dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.address a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.note {
  margin: 4px 0 18px;
  color: #6d5c4e;
  font-size: 14px;
  line-height: 1.5;
}

.reviews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.reviews figure {
  margin: 0;
  padding: 18px 18px 8px;
  background: #fffaf4;
}

.reviews blockquote {
  margin: 0 0 12px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.reviews figcaption {
  color: #6d5c4e;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-kicker,
.story-kicker {
  margin: 0 0 6px;
  color: #9c2f1a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 56px;
  margin-top: 8px;
}

.section-label {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(28, 20, 16, 0.16);
  font-family: "Outfit", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.dish {
  margin: 0 0 16px;
}

.dish-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.dish h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.leader {
  flex: 1;
  border-bottom: 1px dotted rgba(28, 20, 16, 0.35);
  transform: translateY(-5px);
}

.price {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.desc {
  margin: 4px 0 0;
  color: #6d5c4e;
  font-size: 0.95rem;
  line-height: 1.45;
}

.story p {
  max-width: 40rem;
  font-size: 18px;
  line-height: 1.6;
}

.site-foot {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 8px 0 max(28px, env(safe-area-inset-bottom));
  color: #6d5c4e;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.site-foot p {
  margin: 0 0 4px;
}

body.table {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(ellipse at center, #2a3830 0%, #101410 68%);
  color: #f4efe6;
  font-family: "Outfit", "Avenir Next", sans-serif;
}

.room {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 16px 36px;
  box-sizing: border-box;
}

.turn {
  margin: 0;
  min-height: 1em;
  color: rgba(244, 239, 230, 0.58);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
}

.board-frame {
  padding: 12px;
  background:
    linear-gradient(145deg, #8a6240, #4e311c 42%, #6b4528);
  box-shadow:
    inset 0 0 0 2px rgba(226, 196, 138, 0.85),
    0 24px 60px rgba(0, 0, 0, 0.45);
}

.board {
  position: relative;
  width: min(88vw, 68dvh, 640px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  touch-action: none;
  user-select: none;
  background: #111;
}

.sq {
  position: relative;
}

.sq.light { background: #ebecd0; }
.sq.dark { background: #739552; }
.sq.last.light { background: #f6f396; }
.sq.last.dark { background: #baca44; }
.sq.selected-sq.light { background: #cdd16a; }
.sq.selected-sq.dark { background: #8aa04a; }

.coord {
  position: absolute;
  font-size: clamp(8px, 1.35vw, 12px);
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.sq.dark .coord { color: #ebecd0; }
.sq.light .coord { color: #739552; }
.coord.rank { top: 3px; left: 3px; }
.coord.file { right: 3px; bottom: 2px; }

.dot {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.dot.capture {
  width: 78%;
  height: 78%;
  background: transparent;
  box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.18);
}

.piece {
  position: absolute;
  z-index: 2;
  width: 12.5%;
  height: 12.5%;
  display: grid;
  place-items: center;
  padding: 1.5%;
  box-sizing: border-box;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
}

.piece.white { cursor: default; }

.piece svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.28));
}

.board.live .piece {
  transition: left 0.28s ease, top 0.28s ease;
}

.piece.selected {
  z-index: 4;
}

.piece.selected svg {
  filter: drop-shadow(0 0 6px rgba(255, 214, 90, 0.95));
}

.piece.dragging {
  z-index: 5;
  transition: none !important;
  cursor: grabbing;
}

.piece.dragging svg {
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.45));
}

.messages {
  width: min(90vw, 640px);
  min-height: 4.6rem;
  text-align: center;
}

.flash,
.hint {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(18px, 2.4vw, 24px);
}

.flash {
  min-height: 1.4em;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.flash.show { opacity: 1; }

.hint {
  margin-top: 4px;
  color: #e6c27a;
}

.board-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

body.is-clear .board-scene {
  display: none;
}

.result {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px 22px;
  text-align: center;
}

.result:not([hidden]) {
  animation: appear 0.35s ease forwards;
}

.result:focus {
  outline: none;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.result h1 {
  margin: 0 0 18px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(32px, 5vw, 58px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.result .code {
  max-width: 36rem;
  margin: 0 auto;
  padding-top: 16px;
  border-top: 1px solid rgba(244, 239, 230, 0.35);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(13px, 1.7vw, 16px);
  font-style: normal;
  line-height: 1.7;
  letter-spacing: 0.03em;
  user-select: text;
  -webkit-user-select: text;
}

.room {
  position: relative;
}

@media (max-width: 800px) {
  .visit-grid,
  .menu-grid,
  .reviews {
    grid-template-columns: 1fr;
  }

  .mast-bar {
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board.live .piece,
  .tile,
  .result:not([hidden]),
  .flash {
    transition: none;
    animation: none;
  }

  .marquee-track {
    animation: none;
  }
}
