/* ═══════════════════════════════════════════
   POKIT — layout.css
   Navigation · Screens · Modals · Panels
   ═══════════════════════════════════════════ */

/* ── Top Nav ── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  padding: 8px 0 0 0;
}
.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 8px;
}
.nav-brand { display: flex; align-items: center; gap: 8px; }
.nav-brand-text { font-size: 15px; font-weight: 700; color: var(--primary); }
.nav-actions { display: flex; gap: 8px; }
.nav-icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--bg); color: var(--text-muted);
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ── Tab Bar ── */
.nav-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 4px;
  padding: 0 12px 8px;
  scroll-snap-type: x proximity;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.25s ease;
  scroll-snap-align: start;
  font-family: var(--font);
}
.nav-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(212,120,142,0.3);
  transform: scale(1.05);
}
.nav-tab:active {
  transform: scale(0.93);
}

/* ── Screen System ── */
.screen {
  display: none;
  padding: 16px;
  padding-bottom: 40px;
  max-width: 500px;
  margin: 0 auto;
}
.screen.active {
  display: block;
}
/* Directional entrance (set --enter-dir via JS) */
.screen.entering {
  animation: roomSlideIn 0.35s ease-out both;
}
.screen.exiting {
  animation: roomSlideOut 0.2s ease-in both;
  pointer-events: none;
}
@keyframes roomSlideIn {
  from {
    opacity: 0;
    transform: translateX(var(--enter-dir, 40px)) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
@keyframes roomSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(var(--exit-dir, -40px)) scale(0.97);
  }
}

/* ── Screen Headers ── */
.screen-header { text-align: center; margin-bottom: 20px; }
.screen-header h1 { font-size: 22px; font-weight: 700; }
.screen-header p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ── Modals ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  justify-content: center;
  align-items: flex-end;
}
.modal-overlay.open { display: flex; }
.modal-content {
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* ── Help Panel ── */
.help-panel {
  position: fixed;
  top: 0; right: -320px;
  width: 300px; height: 100%;
  background: var(--card);
  z-index: 300;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transition: right 0.3s ease;
  padding: 24px;
  overflow-y: auto;
}
.help-panel.open { right: 0; }
.help-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 299;
  display: none;
}
.help-overlay.open { display: block; }
