:root {
  --bg: #F5F1EB;
  --card: #ffffff;
  --primary: #B96863;
  --primary-dark: #8B4D48;
  --beige: #DCCCBD;
  --text: #1E1E1E;
  --text-muted: #6B6B6B;
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 70px;
  --header-h: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Nunito", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 12px;
  position: relative;
  overflow-x: hidden;
  /* subtle radial texture to avoid empty look */
  background-image:
    radial-gradient(
      circle at 10% 10%,
      rgba(255, 255, 255, 0.04),
      transparent 8%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(255, 255, 255, 0.03),
      transparent 10%
    );
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--bg);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  height: var(--header-h);
  max-width: 920px;
  margin: 0 auto;
  position: relative;
}
.avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #E8DFD3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.logo {
  font-family: "Fredoka", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}
.logo .ma {
  color: var(--primary);
}
.logo .im {
  color: var(--primary);
}
.logo .baq {
  color: var(--primary);
}
.settings-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0.7;
}

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 200;
  transition: transform 200ms ease;
  transform: translateY(0);
}
.bottom-nav.hide {
  transform: translateY(100%);
}
.bottom-nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 10px;
  width: 100%;
}
.nav-item {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: "Nunito", sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 30px;
  min-width: 72px;
  height: 48px;
  box-sizing: border-box;
  border: 2px solid transparent;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}
.nav-item .icon {
  font-size: 18px;
}
.nav-item:active {
  transform: none;
}
.nav-item.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

/* Generic page container */
.page {
  display: flex;
  flex-direction: column;
  /* give extra bottom padding so fixed bottom-nav doesn't overlap content */
  padding-bottom: calc(var(--nav-h) + 80px);
  min-height: calc(100dvh - var(--header-h));
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal-content {
  background: var(--bg);
  border-radius: 24px;
  max-width: 400px;
  width: 100%;
  overflow: hidden;
}
.modal-img {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #B96863, #8B4D48);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
}
.modal-body {
  padding: 20px;
}
.modal-body h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 22px;
  margin-bottom: 6px;
}
.modal-body p {
  font-size: 13px;
  color: var(--text-muted);
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-close {
  width: 100%;
  background: var(--primary);
  border: none;
  border-radius: 50px;
  padding: 14px;
  font-family: "Fredoka", sans-serif;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
}
.modal-actions .modal-close {
  width: auto;
  flex: 1;
}
.modal-download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* INSTALL BANNER */
.install-banner {
  display: none;
  position: fixed;
  bottom: calc(var(--nav-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 30px);
  max-width: 400px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  z-index: 300;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.install-banner.show {
  display: flex;
  animation: slideUp 0.28s ease-out;
}

.install-banner-row,
.install-banner small,
.install-banner .install-btn-yes,
.install-banner .install-btn-no {
  pointer-events: auto;
}

.install-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.install-banner-row p {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 29px;
  font-weight: 600;
  line-height: 1.2;
}

.install-banner small {
  display: block;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
}

.install-btn-no {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.install-btn-no:hover {
  background: rgba(255, 255, 255, 0.25);
}

.install-btn-yes {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: "Fredoka", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1E1E1E;
  background: #ffffff;
  cursor: pointer;
}

.install-btn-yes:hover {
  background: #f2f2f2;
}

.install-btn-yes:active,
.install-btn-no:active {
  transform: translateY(1px);
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive tweaks */
@media (min-width: 700px) {
  .logo {
    font-size: 32px;
  }
  .nav-item {
    font-size: 12px;
  }
  .modal-img {
    font-size: 160px;
  }
}

@media (max-width: 420px) {
  .header-inner {
    padding: 10px 12px;
  }
  .bottom-nav {
    height: calc(var(--nav-h) - 6px);
  }
  .nav-item {
    padding: 6px 10px;
  }
  .install-banner-row p {
    font-size: 20px;
  }
}
