:root {
  --bg: #ebe4d8;
  --panel: #f5f0e8;
  --text: #2c2824;
  --text-dim: #6b6358;
  --accent: #8f7332;
  --accent-soft: #a6884a;
  --border: rgba(44, 40, 36, 0.12);
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-ui: "Inter", "Segoe UI", sans-serif;
  --fade-half-ms: 1500ms;
  --slide-ms: 8000ms;
  --home-bg-image: url("Layouts/NF OFICIAL LOGO FRONT.jpg");
  --stage-bg: #ebe4d8;
  --stage-surface: #f5f0e8;
  --stage-frame: #ddd4c4;
  --stage-vignette: rgba(44, 36, 28, 0.1);
  --gold: #d4bc82;
  --gold-dim: rgba(212, 188, 130, 0.55);
  --photo-shadow:
    0 32px 64px rgba(16, 12, 8, 0.52),
    0 16px 32px rgba(16, 12, 8, 0.38),
    0 6px 14px rgba(16, 12, 8, 0.24);
  --slideshow-bg-image: url("Layouts/layout_slideshow.jpg");
  --menu-indent: clamp(28px, 7vw, 52px);
  --device-w: 1080px;
  --device-h: 810px;
  --device-scale: 1;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  background: var(--stage-bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

body.is-presenting {
  background: #14110e;
}

.device-viewport {
  width: 100%;
  height: 100%;
  height: 100dvh;
}

#app {
  position: relative;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
}

.screen.is-active {
  display: flex;
}

/* —— Home / Menu —— */

#screen-home {
  background-color: #1a1510;
  background-image: var(--home-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  padding:
    calc(env(safe-area-inset-top) + 20px)
    calc(env(safe-area-inset-right) + 16px)
    calc(env(safe-area-inset-bottom) + 20px)
    calc(env(safe-area-inset-left) + 16px);
  z-index: 1;
}

#screen-home::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(12, 10, 8, 0.92) 0%,
    rgba(12, 10, 8, 0.78) 38%,
    rgba(12, 10, 8, 0.35) 68%,
    rgba(12, 10, 8, 0.2) 100%
  );
  pointer-events: none;
}

.home-header,
.home-menu {
  position: relative;
  z-index: 1;
}

.home-header {
  text-align: center;
  flex-shrink: 0;
  width: 100%;
  padding-bottom: clamp(16px, 3vh, 28px);
}

.home-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(14px, 2.5vh, 22px);
  width: 100%;
  max-width: 380px;
  padding-left: var(--menu-indent);
  padding-right: 12px;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.tagline {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(12px, 2.5vw, 15px);
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: rgba(235, 220, 190, 0.72);
}

.category-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.category-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid rgba(212, 188, 130, 0.28);
  border-radius: 4px;
  background: rgba(245, 240, 232, 0.1);
  color: rgba(235, 220, 190, 0.95);
  font-family: var(--font-display);
  font-size: clamp(16px, 2.8vw, 20px);
  letter-spacing: 0.12em;
  text-indent: 0;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.category-btn:active {
  transform: scale(0.98);
}

.category-btn:not(:disabled):hover,
.category-btn:focus-visible {
  border-color: var(--gold-dim);
  background: rgba(212, 188, 130, 0.16);
  color: var(--gold);
  outline: none;
}

.category-btn:disabled,
.category-btn.is-empty {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}

.category-btn__count {
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--gold-dim);
  text-transform: none;
  text-align: right;
}

.btn-auto {
  flex-shrink: 0;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  background: rgba(212, 188, 130, 0.14);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: clamp(13px, 2vw, 16px);
  letter-spacing: 0.12em;
  text-indent: 0;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-auto:hover,
.btn-auto:focus-visible {
  background: rgba(212, 188, 130, 0.24);
  border-color: var(--gold);
  outline: none;
}

.btn-auto:active {
  transform: scale(0.99);
}

/* —— Presentation overlay (iPad fullscreen) —— */

.presentation-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  background-color: #14110e;
  background-image: var(--slideshow-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.presentation-overlay[hidden] {
  display: none !important;
}

.presentation-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding:
    calc(10px + env(safe-area-inset-top, 0px))
    clamp(72px, 12vw, 96px)
    10px;
  border: none;
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.72) 0%, rgba(12, 10, 8, 0) 100%);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.presentation-label {
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 24px);
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.presentation-counter {
  position: absolute;
  right: clamp(16px, 3vw, 28px);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(235, 220, 190, 0.72);
  white-space: nowrap;
}

.presentation-stage {
  position: absolute;
  inset: 0;
  background: transparent;
  overflow: hidden;
}

.presentation-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 80px rgba(8, 6, 4, 0.28);
}

.show-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  padding: clamp(12px, 2.5vw, 36px);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
}

.show-image.is-visible {
  opacity: 1;
  filter: drop-shadow(0 32px 64px rgba(16, 12, 8, 0.52))
    drop-shadow(0 16px 32px rgba(16, 12, 8, 0.38))
    drop-shadow(0 6px 14px rgba(16, 12, 8, 0.24));
}

.show-curtain {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(12, 10, 8, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fade-half-ms) ease-in-out;
  will-change: opacity;
}

.show-curtain.is-closed {
  opacity: 1;
}

.presentation-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 8vw, 64px);
  min-height: 0;
  padding:
    12px clamp(16px, 4vw, 32px)
    calc(12px + env(safe-area-inset-bottom, 0px));
  border: none;
  background: linear-gradient(0deg, rgba(12, 10, 8, 0.72) 0%, rgba(12, 10, 8, 0) 100%);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.presentation-overlay.is-auto-mode .presentation-controls {
  display: none !important;
}

.presentation-overlay.is-chrome-hidden .presentation-header,
.presentation-overlay.is-chrome-hidden .presentation-controls {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ctrl-btn--float {
  position: absolute;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 14;
  width: clamp(56px, 11vw, 72px);
  height: clamp(56px, 11vw, 72px);
  font-size: clamp(20px, 3.5vw, 24px);
  transform: translateX(-50%);
  border-color: rgba(212, 188, 130, 0.45);
  background: rgba(245, 240, 232, 0.88);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.15s ease;
}

.presentation-overlay.is-chrome-hidden .ctrl-btn--float {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.presentation-overlay.is-chrome-hidden .ctrl-btn--float[hidden] {
  display: none !important;
}

.presentation-overlay:not(.is-chrome-hidden) .ctrl-btn--float:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(52px, 10vw, 64px);
  height: clamp(52px, 10vw, 64px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  color: var(--accent);
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.ctrl-btn--close {
  width: clamp(56px, 11vw, 72px);
  height: clamp(56px, 11vw, 72px);
  font-size: clamp(20px, 3.5vw, 24px);
  border-color: rgba(143, 115, 50, 0.35);
}

.ctrl-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.95);
}

.ctrl-btn:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

@media (min-width: 600px) and (orientation: landscape) {
  .home-menu {
    max-width: 400px;
  }
}

/* —— iPad 9 desktop preview (PC) —— */

body.is-device-preview {
  background: #121110;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 20px 16px 32px;
}

body.is-device-preview .device-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: calc(var(--device-w) + 48px);
  margin-bottom: 14px;
  flex-shrink: 0;
}

body.is-device-preview .device-preview[hidden] {
  display: flex !important;
}

.device-preview__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  width: 100%;
}

.device-preview__title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(212, 188, 130, 0.75);
}

.device-preview__toggles {
  display: flex;
  gap: 6px;
}

.device-preview__toggle {
  padding: 6px 12px;
  border: 1px solid rgba(212, 188, 130, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(235, 220, 190, 0.85);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.device-preview__toggle.is-active {
  background: rgba(212, 188, 130, 0.2);
  border-color: var(--gold-dim);
  color: var(--gold);
}

body.is-device-preview .device-viewport {
  width: var(--device-w);
  height: var(--device-h);
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px;
  transform: scale(var(--device-scale));
  transform-origin: top center;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.08),
    0 0 0 12px #1c1b19,
    0 28px 80px rgba(0, 0, 0, 0.55);
  background: #000;
}

body.is-device-preview .device-viewport,
body.is-device-preview .device-viewport #app {
  height: var(--device-h);
  max-height: var(--device-h);
}

@media (prefers-reduced-motion: reduce) {
  .show-curtain {
    transition: opacity var(--fade-half-ms) ease-in-out;
  }
}
