:root {
  --bg: #fafafa;
  --bg-deep: #f0f0f0;
  --ink: #0a0a0a;
  --ink-soft: #5c5c5c;
  --ink-muted: #8a8a8a;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: rgba(10, 10, 10, 0.12);
  --line-strong: rgba(10, 10, 10, 0.22);
  --accent: #0a0a0a;
  --accent-bright: #1a1a1a;
  --accent-2: #0a0a0a;
  --gold: #0a0a0a;
  --danger: #8b2e2e;
  --shadow: 0 24px 64px rgba(10, 10, 10, 0.08);
  --shadow-soft: 0 8px 24px rgba(10, 10, 10, 0.04);
  --sheet: #f5f5f5;
  --card: #ffffff;
  --dock-bg: rgba(255, 255, 255, 0.97);
  --dock-border: rgba(10, 10, 10, 0.08);
  --cat-btn-bg: #ffffff;
  --cat-btn-border: rgba(10, 10, 10, 0.08);
  --cat-btn-color: #555555;
  --now-card-bg: rgba(255, 255, 255, 0.94);
  --now-card-border: rgba(255, 255, 255, 0.7);
  --promo-bg: #0a0a0a;
  --promo-fg: #fafafa;
  --promo-muted: rgba(250, 250, 250, 0.72);
  --promo-badge: rgba(250, 250, 250, 0.55);
  --overlay-fade: linear-gradient(
    180deg,
    rgba(6, 6, 6, 0.42) 0%,
    rgba(6, 6, 6, 0.5) 40%,
    rgba(245, 245, 245, 0.55) 78%,
    #f5f5f5 100%
  );
  --radius: 0;
  --font: "Inter", system-ui, sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0b0b;
  --bg-deep: #121212;
  --ink: #f3f3f3;
  --ink-soft: #b5b5b5;
  --ink-muted: #8a8a8a;
  --panel: #161616;
  --panel-strong: #1a1a1a;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #f3f3f3;
  --accent-bright: #ffffff;
  --accent-2: #f3f3f3;
  --gold: #e8e8e8;
  --danger: #d06b6b;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.3);
  --sheet: #121212;
  --card: #1a1a1a;
  --dock-bg: rgba(14, 14, 14, 0.96);
  --dock-border: rgba(255, 255, 255, 0.1);
  --cat-btn-bg: #1c1c1c;
  --cat-btn-border: rgba(255, 255, 255, 0.1);
  --cat-btn-color: #bdbdbd;
  --now-card-bg: rgba(22, 22, 22, 0.92);
  --now-card-border: rgba(255, 255, 255, 0.12);
  --promo-bg: #1f1f1f;
  --promo-fg: #fafafa;
  --promo-muted: rgba(250, 250, 250, 0.75);
  --promo-badge: rgba(250, 250, 250, 0.58);
  --overlay-fade: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.58) 42%,
    rgba(12, 12, 12, 0.82) 78%,
    #0b0b0b 100%
  );
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg);
}

.atmosphere.admin-atmo {
  background: linear-gradient(180deg, #f5f5f5, #ebebeb);
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 10vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.brand-sm {
  font-size: 2.2rem;
  margin-bottom: 1.4rem;
}

.tagline {
  margin: 1rem 0 0;
  max-width: 24rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

/* Public menu */
.page-menu {
  padding: 0 0 3.5rem;
  position: relative;
  transform: none;
  filter: none;
  perspective: none;
  contain: none;
  min-height: 100dvh;
}

.menu-page {
  position: relative;
  z-index: 1;
  padding: 0 1.25rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

.venue-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: saturate(0.75) contrast(1.08) brightness(0.72);
  z-index: 0;
}

.venue-slide {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1) translate3d(0, 0, 0);
  filter: saturate(0.9) contrast(1.05) brightness(0.78);
  transition: opacity 1s ease;
  z-index: 1;
  will-change: opacity, transform;
  pointer-events: none;
  animation: none;
}

.venue-slide.is-active {
  opacity: 1;
  z-index: 2;
}

/* Ken Burns — separate classes so every slide can restart cleanly */
.venue-slide.is-kenburns-a {
  animation: venue-kenburns-a 7s ease-out forwards;
}

.venue-slide.is-kenburns-b {
  animation: venue-kenburns-b 7s ease-out forwards;
}

@keyframes venue-kenburns-a {
  from {
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.16) translate3d(-2.2%, -1.4%, 0);
  }
}

@keyframes venue-kenburns-b {
  from {
    transform: scale(1.14) translate3d(2%, 1%, 0);
  }
  to {
    transform: scale(1) translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .venue-slide.is-active {
    animation: none !important;
    transform: scale(1.05);
  }

  .venue-slide.is-kenburns-a,
  .venue-slide.is-kenburns-b {
    animation: none !important;
  }
}

.venue-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--overlay-fade);
}

.top-controls {
  position: absolute;
  top: max(0.85rem, env(safe-area-inset-top));
  left: 1rem;
  right: 1rem;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  pointer-events: none;
}

.top-controls > * {
  pointer-events: auto;
}

.top-controls-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(12px);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.game-launch {
  height: 2.5rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(12px);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.game-launch:active,
.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.lang-switch {
  position: static;
  top: auto;
  right: auto;
  z-index: 5;
  display: flex;
  gap: 0.2rem;
  padding: 0.22rem;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.lang-btn {
  min-width: 2.2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
}

.lang-btn.is-active {
  background: #fff;
  color: #0a0a0a;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.35rem;
  flex-wrap: wrap;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: #fff;
  color: #0a0a0a;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.2s var(--ease-smooth), opacity 0.2s ease;
}

.pill-btn:active {
  transform: scale(0.97);
}

.pill-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.now-strip {
  max-width: 40rem;
  margin: 0 auto 1.1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.now-card {
  padding: 0.85rem 0.7rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  display: grid;
  gap: 0.25rem;
}

.now-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}

.now-card strong {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

.featured {
  margin: 0 0 1.6rem;
}

.featured-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.featured-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.featured-line {
  flex: 1;
  height: 1px;
  margin-top: 0.08em;
  background: var(--line-strong);
  opacity: 0.7;
}

.featured-rail {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
}

.featured-rail::-webkit-scrollbar {
  display: none;
}

.featured-card {
  flex: 0 0 11.5rem;
  scroll-snap-align: start;
  border-radius: 18px;
  overflow: hidden;
  background: #111;
  border: 1px solid var(--line);
}

.featured-photo {
  height: 8.5rem;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s var(--ease-smooth);
}

.featured-card:hover .featured-photo {
  transform: scale(1.06);
}

.featured-meta {
  display: grid;
  gap: 0.3rem;
  padding: 0.75rem 0.8rem 0.9rem;
  background: #111;
  color: #fafafa;
}

.featured-meta h3 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
  color: rgba(250, 250, 250, 0.92);
}

.featured-meta span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

.item.has-photo {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 0;
}

.item-photo,
.featured-photo {
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
}

.item-photo {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.item-photo.is-loaded,
.featured-photo.is-loaded,
.venue-slide.is-loaded {
  animation: photo-in 0.35s ease both;
}

@keyframes photo-in {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.item-body {
  min-width: 0;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.1rem;
  margin-bottom: 0.85rem;
}

/* Wine / bar dark mode */
.page-menu.wine-mode .menu-sheet {
  background: rgba(12, 12, 12, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f4f1ea;
}

.page-menu.wine-mode .category-head h2,
.page-menu.wine-mode .item h3,
.page-menu.wine-mode .price,
.page-menu.wine-mode .slide-meta,
.page-menu.wine-mode .featured-head h2 {
  color: #f4f1ea;
}

.page-menu.wine-mode .item p,
.page-menu.wine-mode .price-leader {
  color: rgba(244, 241, 234, 0.55);
  border-bottom-color: rgba(244, 241, 234, 0.22);
}

.page-menu.wine-mode .item {
  border-bottom-color: rgba(244, 241, 234, 0.12);
}

.page-menu.wine-mode .item:first-child {
  border-top-color: rgba(244, 241, 234, 0.12);
}

.page-menu.wine-mode .cats {
  border-bottom-color: rgba(244, 241, 234, 0.12);
}

.page-menu.wine-mode .cat-btn {
  color: rgba(244, 241, 234, 0.62);
}

.page-menu.wine-mode .cats-indicator {
  background: linear-gradient(135deg, #c9a227, #8a6b1f);
}

.page-menu.wine-mode .cat-btn.is-active {
  color: #0a0a0a;
}

.page-menu.wine-mode .category-line,
.page-menu.wine-mode .featured-line {
  background: rgba(201, 162, 39, 0.35);
}

.page-menu.wine-mode .promo {
  background: linear-gradient(135deg, #1a1510, #0c0c0c);
  border-color: rgba(201, 162, 39, 0.35);
}

.page-menu.wine-mode .promo-badge {
  color: #c9a227;
}

.has-venue-photos .hero {
  min-height: 62vh;
  display: grid;
  align-content: end;
  padding: 3.2rem 0 2.2rem;
  margin-bottom: 0;
}

.has-venue-photos .logo-ring {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.has-venue-photos .logo-ring span,
.has-venue-photos .brand,
.has-venue-photos .eyebrow,
.has-venue-photos .tagline {
  color: #fafafa;
}

.has-venue-photos .eyebrow {
  color: rgba(250, 250, 250, 0.72);
}

.has-venue-photos .tagline {
  color: rgba(250, 250, 250, 0.82);
}

.menu-sheet {
  max-width: 40rem;
  margin: -1.2rem auto 0;
  padding: 1.35rem 1.15rem 1.6rem;
  border-radius: 28px 28px 0 0;
  background: var(--sheet);
  backdrop-filter: blur(22px) saturate(1.1);
  border: 1px solid var(--line);
  box-shadow: 0 -28px 80px rgba(10, 10, 10, 0.14);
}

.page-menu:not(.has-venue-photos) .menu-page {
  padding-top: 2rem;
}

.page-menu:not(.has-venue-photos) .menu-sheet {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.hero {
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  padding: 0.5rem 0 0;
  text-align: center;
}

.logo-ring {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.4rem;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  animation: ring-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.logo-ring span {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  color: var(--ink);
}

.reveal {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.hero.reveal,
.menu-sheet.reveal,
.menu-shell.reveal {
  opacity: 1;
}

.reveal.is-visible {
  opacity: 1;
}

.promos {
  max-width: 100%;
  margin: 0 auto 1.5rem;
}

.promos-track {
  position: relative;
  display: grid;
}

.promo {
  grid-area: 1 / 1;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--promo-bg);
  border-radius: 18px;
  background: var(--promo-bg);
  color: var(--promo-fg);
  overflow: visible;
  opacity: 0;
  transform: translateX(18px);
  transition:
    opacity 0.55s var(--ease-smooth),
    transform 0.55s var(--ease-smooth);
  pointer-events: none;
  visibility: hidden;
}

.promo.is-front {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
  z-index: 1;
}

.promo h2 {
  margin: 0.4rem 0 0.45rem;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--promo-fg);
}

.promo p {
  margin: 0;
  color: var(--promo-muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.promo-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--promo-badge);
}

.menu-search {
  padding: 0 0 0.7rem;
}

.menu-search-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0 0.55rem 0 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.menu-search-ico {
  flex: 0 0 auto;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
}

.menu-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  /* 16px+ — иначе iOS зумит поле и страница прыгает */
  font-size: 16px;
  line-height: 1.3;
  padding: 0.7rem 0;
  -webkit-appearance: none;
  appearance: none;
}

.menu-search-input::placeholder {
  color: var(--ink-soft);
  opacity: 0.9;
}

.menu-search-input::-webkit-search-cancel-button {
  display: none;
}

.menu-search-clear {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.08);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

html[data-theme="dark"] .menu-search-clear {
  background: rgba(255, 255, 255, 0.1);
}

.menu-search-clear[hidden] {
  display: none !important;
}

.search-panel {
  margin-top: 0.15rem;
}

.search-panel[hidden] {
  display: none !important;
}

.search-meta {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.search-empty {
  margin: 1.2rem 0 0.4rem;
  padding: 1rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.02);
}

.search-empty[hidden] {
  display: none !important;
}

.search-list .item-cat {
  display: block;
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.menu-shell.is-searching .cats,
.menu-shell.is-searching .cats-spacer,
.menu-shell.is-searching .menu-viewport,
.menu-shell.is-searching .slide-meta {
  display: none !important;
}

.menu-shell.is-searching,
.menu-shell.is-search-focus {
  overflow-anchor: none;
}

@media (max-width: 768px) {
  .menu-search {
    padding: 0 1rem 0.55rem;
  }

  .menu-shell.is-search-focus .menu-search,
  .menu-shell.is-searching .menu-search {
    position: sticky;
    top: 0;
    z-index: 36;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    background: var(--sheet);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
  }

  .menu-search-field {
    min-height: 2.55rem;
    border-radius: 13px;
  }

  .menu-search-input {
    font-size: 16px;
  }

  .search-panel {
    padding: 0 1rem;
    overflow-anchor: none;
  }
}

.cats {
  position: relative;
  z-index: 5;
  max-width: 40rem;
  margin: 0 auto 1rem;
  padding: 0.25rem 0 0.85rem;
  border-bottom: 1px solid var(--line);
}

.cats-track {
  position: relative;
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
}

.cats-track::-webkit-scrollbar {
  display: none;
}

.cats-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  transition:
    transform 0.55s var(--ease-smooth),
    width 0.45s var(--ease-smooth);
  z-index: 0;
  pointer-events: none;
}

.cat-btn {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.35s var(--ease-smooth);
}

.cat-btn.is-active {
  color: #fafafa;
}

.menu-shell {
  max-width: 100%;
  margin: 0 auto;
}

.menu-viewport {
  overflow: hidden;
  /* pan-y: вертикаль — скролл страницы, горизонталь — наш JS-свайп */
  touch-action: pan-y;
  cursor: grab;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  /* height synced to active category so the page scrolls, not an inner box */
  transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-viewport .menu-track,
.menu-viewport .category-panel,
.menu-viewport .item,
.menu-viewport .item-photo,
.menu-viewport .item-body {
  touch-action: pan-y;
}

.menu-viewport:active {
  cursor: grabbing;
}

.menu-track {
  display: flex;
  align-items: flex-start;
  will-change: transform;
}

.menu-track.is-dragging {
  transition: none !important;
}

.category-panel {
  flex: 0 0 100%;
  min-width: 0;
  width: 100%;
  padding: 0.25rem 0 0.5rem;
  max-height: none;
  height: auto;
  overflow: visible;
}

.slide-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0 0.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.slide-nav {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 0.55rem 0.7rem;
  margin: 0;
  border-radius: 999px;
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.25s var(--ease-smooth), background 0.25s var(--ease-smooth);
  -webkit-tap-highlight-color: transparent;
}

.slide-nav:hover,
.slide-nav:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  outline: none;
}

.slide-nav:active {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.slide-counter {
  font-variant-numeric: tabular-nums;
}

.slide-hint::after {
  content: " →";
  letter-spacing: 0.05em;
}

.menu {
  max-width: 40rem;
  margin: 0 auto;
}

.category {
  margin-bottom: 2.8rem;
}

.category-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.category h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.category-line {
  flex: 1;
  height: 1px;
  margin-top: 0.08em;
  background: var(--line-strong);
}

.category ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.55s var(--ease-smooth),
    transform 0.55s var(--ease-smooth);
  transition-delay: var(--item-delay, 0ms);
}

.item.is-shown,
.category-panel.is-active .item {
  opacity: 1;
  transform: translateY(0);
}

.item:first-child {
  border-top: 1px solid var(--line);
}

.category-panel.is-active .item:hover {
  opacity: 0.65;
}

.item-top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.item h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.price-leader {
  flex: 1 1 auto;
  min-width: 0.75rem;
  border-bottom: 1px dotted var(--line-strong);
  transform: translateY(-0.15rem);
}

.price {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.95rem;
}

.item p {
  margin: 0.3rem 0 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.category-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.08);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
}

.desktop-only {
  display: revert;
}

.mobile-dock {
  display: none;
}

/* ——— Mobile app layout ——— */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  html {
    scroll-padding-top: 4.2rem;
    scroll-behavior: smooth;
  }

  body {
    -webkit-tap-highlight-color: transparent;
  }

  .page-menu {
    padding-bottom: calc(5.2rem + env(safe-area-inset-bottom));
  }

  .menu-page {
    padding-left: 0;
    padding-right: 0;
  }

  .lang-switch {
    position: static;
    top: auto;
    right: auto;
    z-index: 5;
  }

  .top-controls {
    top: max(0.5rem, env(safe-area-inset-top));
    left: max(0.5rem, env(safe-area-inset-left));
    right: max(0.5rem, env(safe-area-inset-right));
  }

  .theme-toggle,
  .game-launch {
    height: 2.35rem;
  }

  .theme-toggle {
    width: 2.35rem;
    font-size: 0.88rem;
  }

  .game-launch {
    padding: 0 0.7rem;
    font-size: 0.72rem;
  }

  .lang-btn {
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.32rem 0.45rem;
    font-size: 0.64rem;
  }

  /* Compact hero — menu is the product */
  .hero-video {
    display: none !important;
  }

  .has-venue-photos .hero {
    min-height: auto;
    padding: max(3.2rem, calc(env(safe-area-inset-top) + 2.1rem)) 1rem 0.55rem;
    margin: 0;
  }

  .logo-ring {
    width: 3.1rem;
    height: 3.1rem;
    margin-bottom: 0.45rem;
  }

  .logo-ring span {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
  }

  .brand {
    font-size: clamp(1.65rem, 8.5vw, 2.05rem);
    line-height: 1;
  }

  .eyebrow {
    font-size: 0.52rem;
    letter-spacing: 0.18em;
    margin-bottom: 0.25rem;
  }

  .tagline {
    margin: 0.35rem auto 0;
    font-size: 0.78rem;
    max-width: 18rem;
    opacity: 0.88;
    line-height: 1.4;
  }

  .now-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    max-width: none;
    margin: 0.55rem 0 0;
    padding: 0 1rem 0.85rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .now-strip::-webkit-scrollbar {
    display: none;
  }

  .now-card {
    flex: 0 0 auto;
    width: max-content;
    max-width: 10.5rem;
    scroll-snap-align: start;
    padding: 0.65rem 0.8rem;
    border-radius: 14px;
    background: var(--now-card-bg);
    border: 1px solid var(--now-card-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }

  .now-kicker {
    font-size: 0.52rem;
  }

  .now-card strong {
    font-size: 0.74rem;
  }

  .menu-sheet {
    margin: 0;
    padding: 1rem 0 1.25rem;
    border-radius: 24px 24px 0 0;
    border-left: 0;
    border-right: 0;
    background: var(--sheet);
    box-shadow: 0 -14px 40px rgba(10, 10, 10, 0.18);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .promos,
  .featured,
  .empty {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .promos {
    margin-bottom: 1.05rem;
  }

  .promos-track {
    min-height: 0;
  }

  .promo {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 0;
  }

  .promo h2 {
    font-size: 1.1rem;
    margin: 0.25rem 0 0.3rem;
    line-height: 1.15;
  }

  .promo p {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  .featured {
    margin-bottom: 1rem;
  }

  .featured-head {
    margin-bottom: 0.7rem;
    gap: 0.7rem;
  }

  .featured-head h2 {
    font-size: 0.95rem;
    letter-spacing: 0.1em;
  }

  .featured-rail {
    margin: 0 -1rem;
    padding: 0 1rem 0.15rem;
    gap: 0.55rem;
    -webkit-overflow-scrolling: touch;
  }

  .featured-card {
    flex: 0 0 8.6rem;
    border-radius: 16px;
    border: 0;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
    background: #111;
  }

  .featured-photo {
    height: 6rem;
  }

  .featured-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 3.7rem;
    padding: 0.6rem 0.65rem 0.7rem;
    background: #111;
  }

  .featured-meta h3 {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.92);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
  }

  .featured-meta span {
    margin-top: auto;
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
  }

  /* Swipe only the menu panels — vertical scroll is the whole page */
  .menu-viewport {
    overflow: hidden !important;
    cursor: grab;
    touch-action: pan-y;
  }

  .menu-viewport .menu-track,
  .menu-viewport .category-panel,
  .menu-viewport .item,
  .menu-viewport .item-photo,
  .menu-viewport .item-body {
    touch-action: pan-y;
  }

  .menu-track {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    will-change: transform;
  }

  .category-panel {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    margin-bottom: 0 !important;
    padding: 0 1rem 0.35rem;
    scroll-margin-top: 0;
  }

  .category-panel:last-child {
    margin-bottom: 0;
  }

  .item,
  .item.is-shown,
  .category-panel.is-active .item,
  .category-panel .item {
    opacity: 1 !important;
    transform: none !important;
  }

  .category-panel.is-active .item:hover {
    opacity: 1;
  }

  .slide-meta {
    display: flex !important;
    margin: 0.55rem 1rem 0.15rem;
    font-size: 0.68rem;
  }

  .category-panel.is-wine .item-list {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.06);
  }

  .category-panel.is-wine .category-head h2 {
    color: #f4f1ea;
  }

  .category-panel.is-wine .category-count {
    background: rgba(201, 162, 39, 0.18);
    color: #c9a227;
  }

  .category-panel.is-wine .item {
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  .category-panel.is-wine .item h3 {
    color: #f4f1ea;
  }

  .category-panel.is-wine .price {
    color: #c9a227;
  }

  .category-panel.is-wine .item p {
    color: rgba(244, 241, 234, 0.55);
  }

  .cats {
    position: sticky;
    top: 0;
    z-index: 30;
    max-width: none;
    margin: 0 0 0.85rem;
    padding: 0.55rem 0 0.6rem;
    background: var(--sheet);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
  }

  .cats.is-fixed {
    position: sticky;
    left: auto;
    right: auto;
    top: 0;
    z-index: 30;
    margin: 0 0 0.85rem;
    padding: 0.55rem 0 0.6rem;
  }

  .cats-spacer {
    display: none !important;
    height: 0 !important;
  }

  .cats-spacer.is-on {
    display: none !important;
  }

  .cats-track {
    padding: 0 1rem;
    gap: 0.45rem;
    -webkit-overflow-scrolling: touch;
  }

  .cats-indicator {
    display: none;
  }

  .cat-btn {
    padding: 0.58rem 0.9rem;
    font-size: 0.7rem;
    min-height: 2.55rem;
    background: var(--cat-btn-bg);
    border: 1px solid var(--cat-btn-border);
    color: var(--cat-btn-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    letter-spacing: 0.05em;
  }

  .cat-btn.is-active {
    color: var(--bg);
    background: var(--ink);
    border-color: var(--ink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  }

  .cat-btn.is-vitrine {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  }

  .cat-btn.is-vitrine.is-active {
    background: var(--ink);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  }

  .category-panel.is-vitrine .category-head h2 {
    letter-spacing: 0.08em;
  }

  .category-panel.is-vitrine .item-list {
    border-color: rgba(10, 10, 10, 0.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  }

  .vitrine-hint {
    margin: 0 0 0.55rem;
    font-size: 0.72rem;
    color: var(--ink-muted);
    letter-spacing: 0.02em;
  }

  .category-head {
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .category-head h2,
  .category h2 {
    font-size: 1.05rem;
    letter-spacing: 0.04em;
  }

  .category-count {
    min-width: 1.4rem;
    height: 1.4rem;
    font-size: 0.66rem;
  }

  .item-list {
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.04);
  }

  .item,
  .item.has-photo {
    display: grid;
    margin: 0;
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid var(--line);
    border-top: 0 !important;
    min-height: 3.6rem;
  }

  .item:last-child {
    border-bottom: 0;
  }

  .item.has-photo {
    grid-template-columns: 4.1rem 1fr;
    gap: 0.7rem;
    align-items: center;
  }

  .item:not(.has-photo) {
    grid-template-columns: 1fr;
  }

  .item-photo {
    width: 4.1rem;
    height: 4.1rem;
    border-radius: 12px;
    border: 0;
    background-size: cover;
    background-position: center;
  }

  .item-top {
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .item h3 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.28;
  }

  .price {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
    padding-top: 0.05rem;
  }

  .price-leader {
    display: none;
  }

  .item p {
    font-size: 0.74rem;
    margin-top: 0.18rem;
    color: var(--ink-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mobile-dock {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    gap: 0.15rem;
    padding: 0.5rem 0.55rem calc(0.5rem + env(safe-area-inset-bottom));
    background: var(--dock-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--dock-border);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
  }

  .dock-btn {
    display: grid;
    justify-items: center;
    gap: 0.2rem;
    padding: 0.45rem 0.2rem;
    min-height: 3.2rem;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 14px;
  }

  .dock-btn:active {
    background: rgba(127, 127, 127, 0.12);
  }

  .dock-ico {
    width: 2.15rem;
    height: 2.15rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    overflow: hidden;
  }

  .dock-ico svg {
    width: 1.05rem;
    height: 1.05rem;
    display: block;
  }

  .dock-ico--twogis,
  .dock-ico--instagram {
    background: transparent;
    border-radius: 10px;
  }

  .dock-ico--twogis svg,
  .dock-ico--instagram svg {
    width: 100%;
    height: 100%;
  }

  /* ——— PWA / app chrome ——— */
  .app-splash {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: #0a0a0a;
    color: #fff;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.45s ease, visibility 0.45s;
  }

  .app-splash.is-done,
  html.is-ready .app-splash {
    opacity: 0;
    visibility: hidden;
  }

  .app-splash-logo {
    font-family: var(--display);
    font-size: 1.6rem;
    letter-spacing: 0.28em;
    animation: splash-pulse 1.1s ease-in-out infinite alternate;
  }

  @keyframes splash-pulse {
    from { opacity: 0.55; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
  }

  .pwa-install {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(4.6rem + env(safe-area-inset-bottom));
    z-index: 55;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s var(--ease-smooth);
    pointer-events: none;
  }

  .pwa-install.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .pwa-install-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.75rem 0.8rem;
    border-radius: 18px;
    background: rgba(12, 12, 12, 0.94);
    color: #fafafa;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .pwa-install-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #0a0a0a;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1rem;
  }

  .pwa-install-copy strong {
    display: block;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
  }

  .pwa-install-copy p {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    color: rgba(250, 250, 250, 0.7);
    line-height: 1.35;
  }

  .pwa-install-copy.is-pulse p {
    color: #fff;
    animation: pwa-hint-pulse 1.2s ease;
  }

  @keyframes pwa-hint-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    40% { opacity: 1; transform: scale(1.02); }
  }

  .pwa-install-actions {
    display: grid;
    gap: 0.25rem;
    justify-items: end;
  }

  .pwa-install-btn {
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    background: #fff;
    color: #0a0a0a;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
  }

  .pwa-install-close {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
  }

  /* Native app feel when installed / standalone */
  html.is-pwa,
  body.is-pwa {
    overscroll-behavior-y: none;
    user-select: none;
    -webkit-user-select: none;
  }

  body.is-pwa .menu-page {
    padding-bottom: calc(5.6rem + env(safe-area-inset-bottom));
  }

  body.is-pwa .has-venue-photos .hero {
    padding-top: max(4.2rem, calc(env(safe-area-inset-top) + 2.8rem));
  }

  body.is-pwa .venue-backdrop .hero-video {
    opacity: 0.85;
  }

  body.is-pwa .menu-sheet {
    border-radius: 24px 24px 0 0;
    min-height: 70vh;
  }

  body.is-pwa .cats.is-fixed {
    padding-top: max(0.65rem, env(safe-area-inset-top));
    background: rgba(244, 244, 244, 0.98);
  }

  body.is-pwa .mobile-dock {
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
  }

  body.is-pwa .item:active {
    background: rgba(0, 0, 0, 0.03);
  }

  body.is-pwa .cat-btn:active {
    transform: scale(0.97);
  }
}

@media (max-width: 380px) {
  .featured-card {
    flex-basis: 8.1rem;
  }

  .item.has-photo {
    grid-template-columns: 3.5rem 1fr;
  }

  .item-photo {
    width: 3.5rem;
    height: 3.5rem;
  }
}

@media (min-width: 769px) {
  .mobile-dock,
  .pwa-install,
  .app-splash {
    display: none !important;
  }
}

.footer {
  max-width: 40rem;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-strong);
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.photo-card {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.footer-note {
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.footer-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 0.6;
}

.tiny {
  font-size: 0.8rem;
  opacity: 0.75;
}

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 2rem 0;
}

/* Login */
.page-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.login-card {
  width: min(100%, 24rem);
  padding: 1.6rem;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.85rem;
  animation: rise 0.55s ease both;
}

.login-card label,
.stack-form label,
.inline-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

input,
textarea,
select,
button,
.button-link {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

button,
.button-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #f7faf8;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover,
.button-link:hover {
  opacity: 0.92;
}

button:active,
.button-link:active {
  transform: scale(0.98);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(139, 46, 46, 0.35);
  margin-top: 0.4rem;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.ghost-link {
  text-align: center;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
}

/* Admin */
.page-admin {
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
}

.page-admin .atmosphere.admin-atmo {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(10, 10, 10, 0.06), transparent 55%),
    linear-gradient(180deg, #f7f7f5 0%, #efefed 100%);
}

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1rem 0.7rem;
  background: rgba(12, 12, 12, 0.96);
  color: #f5f5f5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.admin-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-brand {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
}

.admin-bar-menu-link {
  color: rgba(238, 243, 240, 0.8);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.admin-bar nav,
.admin-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.1rem;
}

.admin-bar nav::-webkit-scrollbar,
.admin-nav::-webkit-scrollbar {
  display: none;
}

.admin-bar nav a,
.admin-nav a {
  flex: 0 0 auto;
  color: rgba(238, 243, 240, 0.72);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-bar nav a:hover,
.admin-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.admin-bar nav a.is-active,
.admin-nav a.is-active {
  color: #0a0a0a;
  background: #fff;
}

.admin-bar nav a.admin-link-out,
.admin-nav a.admin-link-out {
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.admin-bar nav a.admin-link-muted,
.admin-nav a.admin-link-muted {
  opacity: 0.65;
}

.admin-main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.6rem 1.15rem 3.5rem;
}

.admin-main h1 {
  margin: 0 0 0.35rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.25rem);
  letter-spacing: -0.02em;
  color: #111;
}

.admin-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.admin-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
  font-weight: 600;
}

.admin-hero-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-btn-ghost {
  background: transparent !important;
  color: #111 !important;
  border: 1px solid rgba(10, 10, 10, 0.18) !important;
}

.lead {
  margin: 0;
  color: #666;
  max-width: 34rem;
  line-height: 1.45;
}

.admin-status {
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.admin-status a {
  color: inherit;
  font-weight: 600;
}

.admin-status.is-ok {
  background: rgba(45, 90, 71, 0.12);
  color: #2d5a47;
}

.admin-status.is-bad {
  background: rgba(139, 46, 46, 0.12);
  color: #8b2e2e;
}

.admin-status.is-warn {
  background: rgba(140, 110, 40, 0.12);
  color: #7a5b12;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 720px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat-grid-secondary {
  margin-bottom: 1.35rem;
}

.stat {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(10, 10, 10, 0.07);
  box-shadow: 0 8px 24px rgba(10, 10, 10, 0.04);
  display: grid;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.stat:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(10, 10, 10, 0.08);
}

.stat strong {
  font-family: "Syne", sans-serif;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  color: #111;
  line-height: 1.1;
}

.stat span {
  color: #777;
  font-size: 0.84rem;
}

.stat-soft {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.admin-quick {
  margin-bottom: 1.35rem;
}

.admin-quick h2,
.panel-head h2,
.panel h2 {
  margin: 0 0 0.85rem;
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: #111;
}

.admin-quick-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .admin-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-quick-card {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: #111;
  color: #f5f5f5;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.admin-quick-card:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}

.admin-quick-card strong {
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
}

.admin-quick-card span {
  color: rgba(245, 245, 245, 0.65);
  font-size: 0.86rem;
  line-height: 1.35;
}

.panel {
  margin-bottom: 1.1rem;
  padding: 1.2rem 1.15rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(10, 10, 10, 0.07);
  box-shadow: 0 8px 24px rgba(10, 10, 10, 0.04);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.panel-head h2 {
  margin: 0;
}

.admin-upload {
  margin: 0.85rem 0 1rem;
}

.admin-file {
  border: 1px dashed rgba(10, 10, 10, 0.18);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: #fafafa;
}

.admin-file span {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: #333;
}

.page-admin .button-link,
.page-admin button:not(.btn-danger):not(.btn-off):not(.pwa-install-btn):not(.pwa-install-close):not(.theme-toggle) {
  border-radius: 12px;
  font-weight: 600;
}

.page-admin .photo-grid {
  margin-top: 0.75rem;
}

.page-admin .photo-card {
  background: #fafafa;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(10, 10, 10, 0.06);
}

.page-admin .flash {
  border-radius: 14px;
}

.page-admin .edit-card {
  padding: 1.1rem 0;
}

.page-admin .vitrine-card {
  border-radius: 18px;
}

.promo-admin-list {
  display: grid;
  gap: 1rem;
}

.promo-admin-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(10, 10, 10, 0.08);
}

.promo-admin-card.is-off {
  opacity: 0.72;
}

.promo-admin-preview {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: #0a0a0a;
  color: #fafafa;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.promo-admin-preview .promo-badge {
  color: rgba(250, 250, 250, 0.55);
}

.promo-admin-preview strong {
  font-family: "Syne", sans-serif;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.promo-admin-preview > span:not(.promo-badge) {
  color: rgba(250, 250, 250, 0.72);
  font-size: 0.88rem;
  line-height: 1.35;
}

.promo-admin-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.promo-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.promo-pill.is-on {
  background: rgba(45, 90, 71, 0.14);
  color: #2d5a47;
}

.promo-pill.is-off {
  background: rgba(139, 46, 46, 0.12);
  color: #8b2e2e;
}

.promo-admin-actions {
  display: grid;
}

@media (min-width: 720px) {
  .promo-admin-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .admin-bar {
    padding: 0.75rem 0.85rem;
  }

  .admin-bar nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }

  .admin-bar nav::-webkit-scrollbar {
    display: none;
  }

  .admin-bar nav a {
    white-space: nowrap;
    font-size: 0.8rem;
  }

  .admin-main {
    padding: 1.15rem 0.9rem 3rem;
  }
}

.stack-form {
  display: grid;
  gap: 0.75rem;
}

.inline-form,
.row-form {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 720px) {
  .inline-form,
  .row-form {
    grid-template-columns: 1.5fr 0.5fr auto auto;
    align-items: end;
  }
}

.two-col {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.check {
  display: flex !important;
  align-items: center;
  gap: 0.45rem;
  grid-template-columns: none !important;
}

.check input {
  width: auto;
}

.align-end {
  align-self: end;
  padding-bottom: 0.35rem;
}

.items-filter {
  position: sticky;
  top: 0.35rem;
  z-index: 3;
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding: 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(10, 10, 10, 0.08);
  backdrop-filter: blur(10px);
}

@media (min-width: 720px) {
  .items-filter {
    grid-template-columns: 1fr 1.2fr;
    align-items: end;
  }
}

.items-filter label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: #666;
  margin: 0;
}

.item-card-cat {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
}

.items-filter-empty {
  margin: 0.5rem 0 0;
}

.edit-card {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.edit-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.edit-card[hidden] {
  display: none !important;
}

.danger-form {
  margin: -0.35rem 0 1rem;
}

.flashes {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.flash {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: rgba(47, 93, 74, 0.12);
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.muted {
  color: var(--ink-soft);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  font-size: 0.92rem;
}

.qr-panel {
  display: grid;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 720px) {
  .qr-panel {
    grid-template-columns: 280px 1fr;
  }
}

.qr-panel img {
  width: min(100%, 280px);
  height: auto;
  border-radius: 16px;
  background: #fff;
  padding: 0.75rem;
}

/* Admin vitrine quick toggles */
.vitrine-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .vitrine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.vitrine-card {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  align-items: center;
}

.vitrine-card.is-off {
  opacity: 0.72;
  background: #f7f7f7;
}

.vitrine-photo {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 12px;
  background: #1a1a1a center/cover no-repeat;
}

.vitrine-photo-empty {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
}

.vitrine-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.vitrine-body strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.vitrine-meta {
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.vitrine-status {
  font-size: 0.78rem;
  font-weight: 600;
}

.vitrine-card.is-on .vitrine-status {
  color: #1f6b3a;
}

.vitrine-card.is-off .vitrine-status {
  color: #8b2e2e;
}

.vitrine-body button {
  margin-top: 0.35rem;
  width: fit-content;
  min-width: 7rem;
}

.vitrine-body .btn-on {
  background: #0a0a0a;
}

.vitrine-body .btn-off {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(139, 46, 46, 0.35);
}

@keyframes ring-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal,
  .item {
    opacity: 1;
    transform: none;
  }

  .menu-track {
    flex-direction: column;
    transform: none !important;
  }

  .category-panel {
    flex: none;
    max-height: none;
    overflow: visible;
    margin-bottom: 2rem;
  }

  .menu-viewport {
    overflow: visible;
    cursor: default;
  }

  .slide-meta {
    display: none;
  }

  .promo {
    position: relative;
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    margin-bottom: 0.75rem;
  }

  .promos-track {
    display: grid;
    gap: 0.75rem;
    min-height: 0;
  }
}

/* Admin + login on phones (public Cloudflare URL) */
@media (max-width: 720px) {
  .page-login,
  .page-admin {
    -webkit-text-size-adjust: 100%;
  }

  .login-card {
    width: 100%;
    padding: 1.35rem 1.15rem;
    border-radius: 18px;
  }

  .login-card input,
  .page-admin input,
  .page-admin textarea,
  .page-admin select {
    font-size: 16px; /* stop iOS zoom that breaks forms */
    min-height: 2.75rem;
  }

  .login-card button,
  .page-admin button,
  .page-admin .button-link {
    min-height: 2.85rem;
    width: 100%;
  }

  .admin-hero-actions {
    width: 100%;
  }

  .admin-hero-actions .button-link {
    flex: 1 1 auto;
  }

  .admin-main {
    padding: 1.1rem 0.85rem 4.5rem;
  }

  .admin-quick-grid,
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .photo-grid {
    grid-template-columns: 1fr 1fr;
  }

  .edit-card,
  .vitrine-card,
  .panel {
    border-radius: 16px;
  }

  .inline-form {
    display: grid;
    gap: 0.65rem;
  }
}

.photo-picker {
  display: grid;
  gap: 0.65rem;
}

.photo-preview {
  width: 100%;
  min-height: 9.5rem;
  border-radius: 16px;
  border: 1px dashed rgba(10, 10, 10, 0.18);
  background: rgba(255, 255, 255, 0.7) center/cover no-repeat;
  display: grid;
  place-items: center;
  color: #888;
  font-size: 0.88rem;
}

.photo-preview.is-empty {
  background-color: rgba(255, 255, 255, 0.7);
}

.page-admin .photo-picker .admin-file {
  margin: 0;
}

/* Mini-game hub */
body.game-open {
  overflow: hidden;
}

/* —— Item detail sheet (mobile-first) —— */
.item.is-tappable,
.featured-card.is-tappable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.item.is-tappable:active {
  opacity: 0.82;
}

.featured-card.is-tappable:active {
  transform: scale(0.985);
}

body.item-detail-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.item-detail {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: end center;
  padding: 0;
}

.item-detail[hidden] {
  display: none !important;
}

.item-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(8, 8, 8, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.item-detail-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 32rem;
  max-height: min(94dvh, 52rem);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 22px 22px 0 0;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28);
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translate3d(0, 0, 0);
  transition: transform 0.28s var(--ease-smooth);
  animation: item-detail-up 0.32s var(--ease-smooth) both;
  touch-action: pan-y;
}

.item-detail-sheet.is-dragging {
  transition: none;
  animation: none;
}

@keyframes item-detail-up {
  from {
    transform: translate3d(0, 22%, 0);
    opacity: 0.75;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

.item-detail-grab {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.65rem;
  padding: 0.55rem 0 0.2rem;
  touch-action: none;
}

.item-detail-handle {
  width: 2.4rem;
  height: 0.28rem;
  border-radius: 999px;
  background: var(--line-strong);
}

.item-detail-photo {
  position: relative;
  width: calc(100% - 1.5rem);
  margin: 0.15rem 0.75rem 0;
  max-height: min(42dvh, 18rem);
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
}

.item-detail-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.item-detail-close span {
  display: block;
  margin-top: -0.04rem;
  font-weight: 500;
}

.item-detail-photo img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.item-detail-photo.has-image img {
  display: block;
}

.item-detail-photo:not(.has-image) {
  display: grid;
  place-items: center;
  min-height: 8rem;
  max-height: 10rem;
  aspect-ratio: auto;
  background: linear-gradient(160deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.1));
}

.item-detail-no-photo {
  color: var(--ink-muted);
  font-size: 0.92rem;
  padding: 1rem;
  text-align: center;
}

.item-detail-body {
  padding: 0.95rem 1.15rem 0.35rem;
  display: grid;
  gap: 0.45rem;
}

.item-detail-body h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.4rem, 5.6vw, 1.75rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.item-detail-price {
  margin: 0.1rem 0 0.15rem;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 2rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.08);
  color: var(--ink);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  white-space: nowrap;
}

html[data-theme="dark"] .item-detail-price {
  background: rgba(255, 255, 255, 0.1);
}

.item-detail-desc-label {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 650;
}

.item-detail-desc-label[hidden],
.item-detail-desc[hidden] {
  display: none !important;
}

.item-detail-desc {
  margin: 0;
  color: var(--ink);
  opacity: 0.82;
  font-size: 1rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (min-width: 720px) {
  .item-detail {
    place-items: center;
    padding: 1.25rem;
  }

  .item-detail-sheet {
    width: min(100%, 32rem);
    border-radius: 22px;
    max-height: min(88dvh, 46rem);
    animation-name: item-detail-pop;
  }

  @keyframes item-detail-pop {
    from {
      transform: translateY(12px) scale(0.98);
      opacity: 0;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }

  .item-detail-grab {
    display: none;
  }

  .item-detail-photo {
    width: 100%;
    margin: 0;
    max-height: min(46dvh, 22rem);
    border-radius: 22px 22px 0 0;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .item-detail-close {
    top: 0.7rem;
    right: 0.7rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  }

  .item-detail-body {
    padding: 1.1rem 1.25rem 0.5rem;
  }
}

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  background: rgba(8, 8, 8, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.game-overlay[hidden] {
  display: none !important;
}

.game-shell {
  width: min(100%, 28rem);
  max-height: min(92dvh, 44rem);
  overflow: auto;
  border-radius: 22px 22px 18px 18px;
  background: #111;
  color: #f7f4ef;
  padding: 1rem 1rem 1.15rem;
  display: grid;
  gap: 0.75rem;
}

.game-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.game-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 244, 239, 0.5);
  font-weight: 600;
}

.game-title {
  margin: 0.15rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.game-close {
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.game-hint {
  margin: 0;
  color: rgba(247, 244, 239, 0.65);
  font-size: 0.9rem;
}

.game-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.game-pick-card {
  display: grid;
  gap: 0.28rem;
  justify-items: start;
  text-align: left;
  padding: 0.85rem 0.8rem;
  border: 1px solid rgba(244, 239, 230, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.game-pick-card:active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(244, 239, 230, 0.28);
}

.game-pick-ico {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-bottom: 0.15rem;
  border-radius: 8px;
  background: rgba(232, 197, 140, 0.14);
  color: #e8c58c;
  font-size: 0.95rem;
}

.game-pick-card strong {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.2;
}

.game-pick-card span:last-child {
  color: rgba(247, 244, 239, 0.55);
  font-size: 0.78rem;
  line-height: 1.35;
}

.game-back {
  justify-self: start;
  border: 0;
  background: transparent;
  color: rgba(247, 244, 239, 0.7);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.15rem 0;
  cursor: pointer;
}

.game-play {
  display: grid;
  gap: 0.7rem;
}

.game-play[hidden],
.game-hub[hidden] {
  display: none !important;
}

.game-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.game-stats > div {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.game-stats span {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 244, 239, 0.5);
}

.game-stats strong {
  font-size: 1.15rem;
  font-weight: 700;
}

.game-stage {
  position: relative;
  min-height: 12rem;
}

.game-board {
  --game-size: 3;
  display: grid;
  grid-template-columns: repeat(var(--game-size), 1fr);
  gap: 0.35rem;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #0a0a0a;
  padding: 0.35rem;
}

.game-board.is-preview {
  display: block;
  padding: 0;
}

.game-board-preview {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: game-preview-in 0.35s ease;
}

@keyframes game-preview-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.game-board.is-won .game-tile:not(.is-empty) {
  transform: scale(0.985);
}

.game-tile {
  border: 0;
  border-radius: 10px;
  padding: 0;
  aspect-ratio: 1;
  background-color: #1a1a1a;
  background-repeat: no-repeat;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.game-tile:active:not(.is-empty) {
  transform: scale(0.97);
}

.game-tile.is-empty {
  background: transparent;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.game-beans-arena {
  position: relative;
  height: min(68vw, 22rem);
  min-height: 16.5rem;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(90, 60, 35, 0.35), transparent 55%),
    linear-gradient(180deg, #1a1612 0%, #0b0a09 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

.game-bean {
  --bean-w: 1.9rem;
  --bean-h: 2.6rem;
  position: absolute;
  top: 0;
  left: 0;
  width: max(2.85rem, calc(var(--bean-w) + 1rem));
  height: max(3.35rem, calc(var(--bean-h) + 1rem));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  will-change: transform, top, left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-bean::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--bean-w);
  height: var(--bean-h);
  transform: translate(-50%, -50%);
  border-radius: 50% 50% 48% 48% / 42% 42% 58% 58%;
  background:
    radial-gradient(ellipse 55% 40% at 32% 28%, rgba(160, 110, 70, 0.95), transparent 55%),
    radial-gradient(ellipse 70% 80% at 50% 55%, #5a3722 0%, #2a160e 62%, #140a06 100%);
  box-shadow:
    inset 2px 3px 5px rgba(255, 220, 170, 0.16),
    inset -3px -5px 8px rgba(0, 0, 0, 0.55),
    0 6px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.game-bean::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--bean-w) * 0.18);
  height: calc(var(--bean-h) * 0.62);
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(20, 10, 5, 0.15),
    rgba(15, 8, 4, 0.85) 45%,
    rgba(20, 10, 5, 0.2)
  );
  box-shadow: 0 0 0 1px rgba(255, 210, 150, 0.08);
  pointer-events: none;
}

.game-bean.is-bad::before {
  background:
    radial-gradient(ellipse 55% 40% at 32% 28%, rgba(255, 250, 240, 0.95), transparent 55%),
    radial-gradient(ellipse 70% 80% at 50% 55%, #f0e4cf 0%, #cbb892 62%, #a89068 100%);
  box-shadow:
    inset 2px 3px 5px rgba(255, 255, 255, 0.35),
    inset -3px -5px 8px rgba(90, 70, 40, 0.35),
    0 6px 12px rgba(0, 0, 0, 0.28);
}

.game-bean.is-bad::after {
  background: linear-gradient(
    180deg,
    rgba(140, 110, 70, 0.15),
    rgba(110, 85, 50, 0.65) 45%,
    rgba(140, 110, 70, 0.2)
  );
  box-shadow: 0 0 0 1px rgba(90, 70, 40, 0.12);
}

.game-bean.is-pop {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.2) !important;
  transition: opacity 0.12s ease, transform 0.12s ease;
  pointer-events: none;
}

.game-bean.is-miss {
  opacity: 0;
  filter: grayscale(0.4);
  transform: translate(-50%, -50%) scale(0.75) !important;
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
}

@media (max-width: 720px) {
  .game-beans-arena {
    height: min(72vw, 24rem);
    min-height: 18rem;
  }

  .game-bean {
    width: max(3.1rem, calc(var(--bean-w) + 1.2rem));
    height: max(3.6rem, calc(var(--bean-h) + 1.2rem));
  }
}

.game-quiz {
  display: grid;
  gap: 0.75rem;
}

.game-quiz-q {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
}

.game-quiz-answers {
  display: grid;
  gap: 0.45rem;
}

.game-quiz-answer {
  min-height: 2.7rem;
  padding: 0.7rem 0.85rem;
  text-align: left;
  border: 1px solid rgba(244, 239, 230, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.game-quiz-answer.is-ok {
  border-color: rgba(140, 200, 140, 0.55);
  background: rgba(90, 150, 90, 0.2);
}

.game-quiz-answer.is-no {
  border-color: rgba(200, 110, 110, 0.5);
  background: rgba(150, 70, 70, 0.18);
}

.game-merge {
  display: grid;
  gap: 0.65rem;
  width: 100%;
  justify-items: stretch;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.game-play.is-merge .game-hint {
  font-size: 0.82rem;
}

.game-play.is-merge .game-stage {
  min-height: 0;
}

.game-merge-board {
  --size: 4;
  display: grid;
  grid-template-columns: repeat(var(--size), 1fr);
  grid-template-rows: repeat(var(--size), 1fr);
  width: 100%;
  aspect-ratio: 1;
  gap: 8px;
  padding: 0.55rem;
  border-radius: 18px;
  background: #161311;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  touch-action: none;
}

.game-merge-board.is-celebrate {
  animation: merge-pop 0.85s ease;
}

@keyframes merge-pop {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.02); }
  60% { transform: scale(0.99); }
}

.game-merge-cell {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
  font-size: clamp(1.15rem, 7vw, 1.85rem);
  letter-spacing: -0.02em;
  transition: transform 0.12s ease, background 0.12s ease;
}

.game-merge-cell.is-on {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 4px 10px rgba(0, 0, 0, 0.22);
}

.game-merge-cell.is-big {
  font-size: clamp(0.95rem, 5.5vw, 1.35rem);
}

.game-merge-pad {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
}

.game-merge-pad > button,
.game-merge-pad-mid button {
  width: 3.4rem;
  height: 3.1rem;
  border: 1px solid rgba(244, 239, 230, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #f7f4ef;
  font-size: 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-merge-pad-mid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0.4rem;
}

.game-merge-pad > button:active,
.game-merge-pad-mid button:active {
  background: rgba(232, 197, 140, 0.22);
}

@media (max-width: 720px) {
  .game-merge-board {
    gap: 9px;
    padding: 0.6rem;
    border-radius: 20px;
  }

  .game-merge-cell {
    border-radius: 14px;
  }

  .game-merge-pad > button,
  .game-merge-pad-mid button {
    width: 3.7rem;
    height: 3.3rem;
  }
}

.game-win {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.55rem;
  padding: 1.2rem;
  text-align: center;
  border-radius: 14px;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.game-win[hidden] {
  display: none !important;
}

.game-win strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
}

.game-win p {
  margin: 0;
  color: rgba(247, 244, 239, 0.72);
  font-size: 0.92rem;
  max-width: 16rem;
  line-height: 1.4;
}

.game-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.game-actions:empty {
  display: none;
}

.game-btn {
  min-height: 2.75rem;
  border: 0;
  border-radius: 12px;
  background: #f4efe6;
  color: #111;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.game-btn-ghost {
  background: transparent;
  color: #f4efe6;
  border: 1px solid rgba(244, 239, 230, 0.28);
}

@media (min-width: 720px) {
  .game-overlay {
    place-items: center;
  }

  .game-shell {
    border-radius: 22px;
  }
}

