/* Arcade menu: a cozy cabin window at night. */

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% 0%, #22365f 0%, rgba(34, 54, 95, 0) 70%),
    radial-gradient(80% 40% at 50% 110%, rgba(107, 66, 38, 0.35) 0%, rgba(107, 66, 38, 0) 70%),
    var(--night);
  padding: calc(46px + var(--safe-top)) calc(14px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(14px + var(--safe-left));
  overflow-x: hidden;
}

/* ---------- Garland ---------- */
.garland {
  position: fixed; z-index: 2;
  top: var(--safe-top); left: 0; right: 0;
  height: 40px;
  pointer-events: none;
}
.garland-wire { position: absolute; inset: 0; width: 100%; height: 100%; }
.garland-bulbs { position: absolute; inset: 0; }
.bulb {
  position: absolute;
  width: 10px; height: 15px;
  margin-left: -5px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--c);
  box-shadow: 0 0 10px 2px var(--c), 0 0 22px 4px color-mix(in srgb, var(--c) 45%, transparent);
  animation: twinkle var(--d, 3.2s) ease-in-out var(--delay, 0s) infinite alternate;
}
.bulb::before {
  content: ''; position: absolute; left: 2px; top: -4px;
  width: 6px; height: 5px; border-radius: 1px; background: #2e3a2a;
}
@keyframes twinkle {
  0%, 40% { opacity: 1; filter: brightness(1.1); }
  100% { opacity: 0.45; filter: brightness(0.7); box-shadow: 0 0 4px 0 var(--c); }
}

/* ---------- Header ---------- */
.menu-header {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 960px; margin: 6px auto 16px;
}
.menu-title {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 700;
  color: var(--snow);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25), 0 0 24px rgba(242, 193, 78, 0.25);
}
.menu-title span { color: var(--gold); display: block; font-size: 0.55em; letter-spacing: 0.06em; font-weight: 600; }

/* ---------- Cabinets ---------- */
.cabinets {
  position: relative; z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 960px; margin: 0 auto;
}
@media (min-width: 820px) {
  .cabinets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.cabinet {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 44px;
  padding: 10px 10px 12px;
  border-radius: 20px 20px 14px 14px;
  background: linear-gradient(180deg, #7d5131 0%, var(--cocoa) 60%, #573520 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.12), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  color: var(--snow);
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 120ms ease;
  -webkit-user-select: none; user-select: none;
}
.cabinet:active { transform: scale(0.97); }
.cabinet-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--night-2);
  box-shadow: inset 0 0 0 3px #2a1a0f, inset 0 0 18px rgba(0, 0, 0, 0.6);
}
.cabinet-screen svg { display: block; width: 100%; height: 100%; }
.cabinet-screen::after {
  /* glass sheen */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 40%);
}
.cabinet h2 {
  margin: 10px 2px 2px;
  font-size: clamp(1.02rem, 4.4vw, 1.25rem);
  color: var(--snow);
}
.cabinet .tagline {
  margin: 0 2px 8px;
  font-size: 0.82rem;
  line-height: 1.25;
  color: rgba(247, 244, 238, 0.8);
  flex: 1;
}
.cabinet .best {
  display: flex; align-items: center; gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.55);
  font-weight: 800; font-size: 0.85rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.cabinet .best .muted { color: rgba(247, 244, 238, 0.65); font-weight: 600; }
.cabinet .badge {
  position: absolute; z-index: 2;
  top: -8px; right: -4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold); color: var(--night);
  font-family: var(--font-display); font-weight: 600; font-size: 0.78rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  animation: badge-bob 2.4s ease-in-out infinite;
}
.cabinet .soon {
  position: absolute; z-index: 2; left: 50%; bottom: 8px;
  transform: translateX(-50%);
  padding: 3px 10px; border-radius: 999px;
  background: rgba(20, 33, 61, 0.85);
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--frost);
  white-space: nowrap;
}
@keyframes badge-bob { 50% { transform: translateY(-3px); } }

/* ---------- Footer ---------- */
.menu-footer {
  position: relative; z-index: 3;
  margin: 22px auto 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(247, 244, 238, 0.5);
}

/* ---------- Settings sheet ---------- */
.settings-sheet { text-align: left; gap: 6px; }
.settings-sheet h2 { text-align: center; }
.settings-sheet h3 { margin: 12px 0 2px; font-size: 1rem; color: var(--frost); }
.settings-sheet .quality-row { cursor: default; }
.settings-sheet .reset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.settings-sheet .reset-grid .btn { font-size: 0.9rem; padding: 0.5em 0.6em; }
.settings-sheet .version { margin-top: 8px; text-align: center; font-size: 0.75rem; color: rgba(247, 244, 238, 0.4); }

/* ---------- Card art animations (menu/art.js) ---------- */
.a-twinkle { animation: a-twinkle 2.8s ease-in-out infinite; }
@keyframes a-twinkle { 50% { opacity: 0.25; } }
.a-route { animation: a-route 1.2s linear infinite; }
@keyframes a-route { to { stroke-dashoffset: -14; } }
.a-pulse { animation: a-pulse 2.4s ease-in-out infinite; }
@keyframes a-pulse { 50% { opacity: 0.15; } }
.a-bob { animation: a-bob 1.6s ease-in-out infinite; }
@keyframes a-bob { 50% { transform: translate(1px, -1px); } }
.a-fly { animation: a-fly 5s ease-in-out infinite; }
@keyframes a-fly { 50% { transform: translate(-3px, 2px); } }
.a-drop { animation: a-drop 3.2s ease-in infinite; }
@keyframes a-drop { 0% { transform: translate(0, -6px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(-1px, 16px); opacity: 0; } }
.a-glow { animation: a-glow 2.2s ease-in-out infinite; }
@keyframes a-glow { 50% { opacity: 0.55; } }
.a-hop { animation: a-hop 3.6s ease-in-out infinite; }
.a-hop-2 { animation-delay: 0.12s; }
.a-hop-3 { animation-delay: 0.24s; }
@keyframes a-hop { 0%, 70%, 100% { transform: none; } 78% { transform: translate(0, -4px); } 86% { transform: translate(0, 0); } }
.a-roll { animation: a-roll 4s ease-in-out infinite; }
@keyframes a-roll { 50% { transform: translate(-12px, 0); } }
.a-fall { animation: a-fall 6s linear infinite; }
@keyframes a-fall { from { transform: translate(0, -24px); } to { transform: translate(3px, 52px); } }

@media (prefers-reduced-motion: reduce) {
  .bulb, .cabinet .badge { animation: none; }
  .cabinet-screen svg * { animation: none !important; }
}
