@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg:         #0F1923;
  --bg-card:    #172030;
  --bg-raised:  #1E2D42;
  --navy:       #1B2A4A;
  --blue:       #1A75FF;
  --blue-light: #4D95FF;
  --white:      #FFFFFF;
  --slate:      #7A8FA8;
  --border:     rgba(255,255,255,0.08);
  --accent:     #1A75FF;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--white);
  overscroll-behavior: none;
}

/* ─── Toast notification ──────────────────────────────────── */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  z-index: 100;
  background: var(--bg-raised);
  border: 1px solid rgba(26,117,255,0.35);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.toast-body { flex: 1; }

.toast-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--slate);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.toast-close:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

/* ─── App shell ───────────────────────────────────────────── */
.app {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 32px;
}

/* ─── Header ──────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-logo-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
}
.app-logo-text .accent { color: var(--blue); }

.demo-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-light);
  background: rgba(26,117,255,0.15);
  border: 1px solid rgba(26,117,255,0.3);
  padding: 4px 10px;
  border-radius: 100px;
}

/* ─── Venue bar ───────────────────────────────────────────── */
.venue-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  padding: 0 20px 20px;
}

/* ─── Player card ─────────────────────────────────────────── */
.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  margin: 0 16px;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* TV selector */
.tv-selector { width: 100%; }

.tv-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 8px;
}

.tv-select-wrap {
  position: relative;
  width: 100%;
}

.tv-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 40px 13px 16px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.tv-select:focus { border-color: var(--blue); }
.tv-select option { background: #172030; }

.tv-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate);
  pointer-events: none;
}

/* Visualizer */
.visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 64px;
  width: 100%;
}

.vis-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--blue);
  height: 6px;
  transition: height 0.1s ease;
  opacity: 0.3;
}

.visualizer.playing .vis-bar {
  opacity: 1;
  animation: bar-dance var(--duration, 0.8s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

@keyframes bar-dance {
  from { height: 6px; }
  to   { height: var(--max-h, 48px); }
}

/* Player status */
.player-status {
  font-size: 14px;
  color: var(--slate);
  font-weight: 500;
  text-align: center;
  min-height: 20px;
}

/* Play button */
.play-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--blue);
  border: none;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 0 0 rgba(26,117,255,0.4);
  flex-shrink: 0;
}

.play-btn:hover {
  background: #1460D4;
  transform: scale(1.05);
}

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

.play-btn.playing {
  box-shadow: 0 0 0 12px rgba(26,117,255,0.12);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 8px rgba(26,117,255,0.10); }
  50%       { box-shadow: 0 0 0 18px rgba(26,117,255,0.05); }
}

.icon-play  { display: block; margin-left: 4px; }
.icon-pause { display: none; }

.play-btn.playing .icon-play  { display: none; }
.play-btn.playing .icon-pause { display: block; }

/* No audio notice (shown when no src is set) */
.play-btn.no-audio {
  background: var(--bg-raised);
  border: 2px dashed rgba(255,255,255,0.15);
  cursor: default;
}
.play-btn.no-audio:hover { transform: none; background: var(--bg-raised); }

/* Volume */
.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--slate);
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-raised);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

/* ─── Ad banner ───────────────────────────────────────────── */
.ad-banner {
  margin: 16px 16px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  overflow: hidden;
}

.ad-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 14px;
}

.menu-btn-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 13px 16px;
  background: rgba(26,117,255,0.12);
  border: 1.5px solid rgba(26,117,255,0.35);
  border-radius: 12px;
  color: var(--blue-light);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.menu-btn-full:hover {
  background: rgba(26,117,255,0.22);
  border-color: rgba(26,117,255,0.6);
  color: var(--white);
}

.ad-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ad-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.ad-emoji { font-size: 18px; line-height: 1; }

.ad-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
}

/* ─── Menu modal ──────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 80svh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.modal-backdrop.open .modal {
  transform: translateY(0);
}
/* Taller sheet for PDF content */
.modal:has(.modal-body-pdf) {
  max-height: 92svh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: none;
  color: var(--slate);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.modal-body {
  overflow-y: auto;
  padding: 16px 20px 32px;
  -webkit-overflow-scrolling: touch;
}

/* PDF variant — iframe fills the sheet */
.modal-body-pdf {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.pdf-open-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-light);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}
.pdf-open-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.04);
}

.pdf-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  display: block;
  background: #fff;
}

.menu-section { margin-bottom: 24px; }
.menu-section:last-of-type { margin-bottom: 0; }

.menu-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.menu-item:last-child { border-bottom: none; }

.menu-name {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

.menu-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-light);
  flex-shrink: 0;
}

.menu-note {
  font-size: 12px;
  color: var(--slate);
  margin-top: 20px;
  text-align: center;
  opacity: 0.6;
}

/* ─── BYOLD note ──────────────────────────────────────────── */
.byold-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--slate);
  padding: 20px 20px 0;
  text-align: center;
}

/* ─── Footer ──────────────────────────────────────────────── */
.app-footer {
  margin-top: auto;
  padding: 28px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-light);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--white); }

.app-footer-note {
  font-size: 12px;
  color: var(--slate);
  text-align: center;
  line-height: 1.6;
  opacity: 0.7;
}

/* ─── No audio overlay ────────────────────────────────────── */
.no-audio-note {
  font-size: 12px;
  color: var(--slate);
  text-align: center;
  line-height: 1.5;
  padding: 0 8px;
}

/* ─── Venue selection page ────────────────────────────────── */
.venue-select-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 32px;
  gap: 28px;
}

.venue-select-intro { text-align: center; }

.venue-select-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 10px;
}

.venue-select-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.venue-select-sub {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

.venue-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.venue-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.venue-card:hover {
  border-color: rgba(26,117,255,0.45);
  background: var(--bg-raised);
  transform: translateY(-2px);
}

.venue-card:active { transform: translateY(0); }

.venue-card-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
}

.venue-card-body { flex: 1; }

.venue-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.venue-card-desc {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.5;
}

.venue-card-arrow {
  color: var(--blue-light);
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}

.venue-card:hover .venue-card-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.venue-select-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--slate);
  text-align: center;
  line-height: 1.6;
  opacity: 0.7;
  padding: 0 8px;
}

/* ─── Subscribe button ────────────────────────────────────── */
.subscribe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 12px 16px 0;
  padding: 13px 16px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--slate);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.subscribe-btn:hover {
  border-color: rgba(26,117,255,0.35);
  color: var(--blue-light);
  background: rgba(26,117,255,0.06);
}

/* ─── Subscribe modal form ────────────────────────────────── */
.subscribe-venue {
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
}

.subscribe-sub {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.6;
}

.subscribe-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0 8px;
}

.subscribe-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subscribe-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--slate);
}

.subscribe-field input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--white);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.subscribe-field input:focus { border-color: var(--blue); }

.subscribe-field input::placeholder { color: rgba(255,255,255,0.2); }

.subscribe-optional {
  font-size: 12px;
  color: var(--slate);
  opacity: 0.7;
  margin-bottom: 4px;
}

.subscribe-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--blue);
  border: none;
  border-radius: 12px;
  color: var(--white);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}

.subscribe-submit:hover:not(:disabled) { background: #1460D4; }
.subscribe-submit:active:not(:disabled) { transform: scale(0.98); }
.subscribe-submit:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── Subscribe success state ─────────────────────────────── */
.subscribe-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 8px 16px;
  gap: 14px;
}

.subscribe-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(26,117,255,0.15);
  border: 2px solid rgba(26,117,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-light);
}

.subscribe-success-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
}

.subscribe-success-msg {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.6;
  max-width: 280px;
}

/* ─── Mobile hint (individual demo pages, desktop only) ───── */
.mobile-hint {
  display: none; /* hidden on phones */
}

@media (min-width: 600px) {
  .mobile-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: rgba(26,117,255,0.08);
    border-bottom: 1px solid rgba(26,117,255,0.18);
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate);
    text-align: center;
    border-radius: 0; /* flush with top of .app */
  }
}

/* ─── Desktop phone prompt (demo.html selection page) ──────── */
.desktop-phone-prompt {
  display: none; /* hidden on phones */
}

@media (min-width: 600px) {
  .desktop-phone-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid rgba(26,117,255,0.25);
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 4px;
  }

  .dpp-left {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    color: var(--blue-light);
    flex: 1;
  }

  .dpp-left svg { flex-shrink: 0; margin-top: 2px; }

  .dpp-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
  }

  .dpp-sub {
    font-size: 13px;
    color: var(--slate);
    line-height: 1.5;
  }

  .dpp-qr {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }

  /* qrcodejs renders an img or canvas — make it fill the container */
  .dpp-qr img,
  .dpp-qr canvas {
    display: block;
    width: 72px !important;
    height: 72px !important;
  }
}
