* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --border: rgba(255,255,255,0.07);
  --text: #f0f0f8;
  --muted: #666680;
  --accent: #7c6fff;
  --green: #00e676;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body.light {
  --bg: #f5f5f0;
  --bg2: #ffffff;
  --bg3: #ebebea;
  --border: rgba(0,0,0,0.08);
  --text: #1a1a2e;
  --muted: #888899;
}

.screen {
  display: none;
  padding: 20px 16px 110px;
  max-width: 430px;
  margin: 0 auto;
}

.screen.active {
  display: block;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 22px;
}

.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.theme-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:active {
  transform: scale(0.9);
}

/* PWA Banner */
.pwa-banner {
  display: none;
  background: linear-gradient(135deg, rgba(124,111,255,0.15), rgba(124,111,255,0.05));
  border: 1px solid rgba(124,111,255,0.3);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  align-items: center;
  gap: 12px;
}

.pwa-banner.show {
  display: flex;
}

.pwa-banner img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.pwa-banner-txt {
  flex: 1;
}

.pwa-banner-txt strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.pwa-banner-txt span {
  font-size: 11px;
  color: var(--muted);
}

.pwa-install-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.pwa-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* Frase do Dia */
.frase-do-dia {
  background: linear-gradient(135deg, #1a1030, #0d1a35);
  border: 1px solid rgba(124,111,255,0.3);
  border-radius: 20px;
  padding: 22px 20px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

body.light .frase-do-dia {
  background: linear-gradient(135deg, #e8e0ff, #dce8ff);
  border-color: rgba(124,111,255,0.4);
}

.frase-do-dia::before {
  content: '\201C';
  position: absolute;
  top: -15px;
  left: 12px;
  font-size: 110px;
  color: rgba(124,111,255,0.12);
  font-family: 'Playfair Display', serif;
  line-height: 1;
  pointer-events: none;
}

.frase-do-dia .label {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 12px;
  font-weight: 600;
}

.frase-do-dia .texto {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  font-style: italic;
}

.frase-do-dia .cat-tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 10px;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  padding: 3px 10px;
}

body.light .frase-do-dia .cat-tag {
  background: rgba(0,0,0,0.06);
}

/* Anúncios */
.ad-container {
  margin: 10px 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px dashed var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-container.banner-small {
  height: 52px;
  min-height: 52px;
  max-height: 52px;
}

.ad-container.banner-medium {
  height: 260px;
  min-height: 260px;
}

.ad-label-txt {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  z-index: 0;
}

/* Pesquisa */
.search-wrap {
  position: relative;
  margin-bottom: 14px;
}

.search-wrap input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}

.search-wrap input::placeholder {
  color: var(--muted);
}

.search-wrap input:focus {
  border-color: var(--accent);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

.search-results {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  display: none;
}

.search-results.show {
  display: block;
}

.search-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:active {
  background: var(--bg3);
}

.search-item .s-cat {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.search-item .s-txt {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-style: italic;
  color: var(--text);
}

.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Categorias */
.section-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 18px 0 12px;
  font-weight: 600;
}

.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.cat-card {
  border-radius: 18px;
  padding: 18px 14px 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.18s;
  border: 1px solid rgba(255,255,255,0.06);
}

.cat-card:active {
  transform: scale(0.96);
}

.cat-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.cat-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.cat-count {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 3px;
}

.shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.cat-motivacional { background: linear-gradient(140deg, #0d3320, #1a5e38); }
.cat-romantica { background: linear-gradient(140deg, #4a0020, #a01040); }
.cat-reflexao { background: linear-gradient(140deg, #0d2040, #1a4070); }
.cat-sabedoria { background: linear-gradient(140deg, #2d1800, #7a4500); }
.cat-amizade { background: linear-gradient(140deg, #002030, #005060); }
.cat-humor { background: linear-gradient(140deg, #201000, #604000); }
.cat-fitness { background: linear-gradient(140deg, #150020, #4a0870); }
.cat-espirito { background: linear-gradient(140deg, #001520, #003050); }
.cat-autoestima { background: linear-gradient(140deg, #200020, #600060); }
.cat-negocios { background: linear-gradient(140deg, #001020, #002840); }

/* Botões */
.btn {
  display: block;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  font-family: 'DM Sans', sans-serif;
  transition: transform 0.1s, opacity 0.15s;
  letter-spacing: 0.2px;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-green {
  background: var(--green);
  color: #000;
}

.btn-red {
  background: #d32f2f;
  color: #fff;
}

.btn-ghost {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-pink {
  background: var(--bg3);
  color: #ff6b9d;
  border: 1px solid rgba(255,107,157,0.3);
  font-size: 14px;
  padding: 13px;
}

.btn-copy {
  background: var(--bg3);
  color: #00e676;
  border: 1px solid rgba(0,230,118,0.3);
  font-size: 14px;
  padding: 13px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 14px;
  font-family: 'DM Sans', sans-serif;
}

/* Tela frases */
.frase-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 22px;
  margin: 16px 0;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.frase-box .aspas {
  font-family: 'Playfair Display', serif;
  font-size: 80px;
  color: var(--border);
  position: absolute;
  top: 0;
  left: 14px;
  line-height: 1;
  pointer-events: none;
}

.frase-box p {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  line-height: 1.65;
  color: var(--text);
  font-style: italic;
  z-index: 1;
  transition: opacity 0.25s;
}

.frase-box.fade p {
  opacity: 0;
}

.pills {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--muted);
}

.pill span {
  color: var(--accent);
  font-weight: 600;
}

/* Imagem */
.img-preview-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  text-align: center;
}

.img-preview-wrap canvas {
  border-radius: 12px;
  max-width: 100%;
}

.img-styles {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 12px 0;
  flex-wrap: wrap;
}

.style-btn {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  background: var(--bg3);
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}

.style-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.img-share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.img-share-actions button {
  padding: 13px 8px;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

/* Favoritos */
.fav-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.fav-item .fav-cat {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.fav-item .fav-txt {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-style: italic;
  color: var(--text);
}

.fav-item .fav-txt.normal {
  font-style: normal;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

.fav-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.fav-actions button {
  flex: 1;
  min-width: 80px;
  padding: 9px;
  border: none;
  border-radius: 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
}

.fav-del {
  background: rgba(211,47,47,0.15);
  color: #ff6b6b;
}

.fav-share {
  background: rgba(124,111,255,0.15);
  color: var(--accent);
}

.fav-copy {
  background: rgba(0,230,118,0.15);
  color: #00e676;
}

/* Recentes */
.rec-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.rec-item:active {
  border-color: var(--accent);
}

.rec-item .rec-cat {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.rec-item .rec-txt {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-style: italic;
  color: var(--text);
}

/* Partilhar App */
.share-app-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 12px;
}

.share-app-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.share-native-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  background: var(--accent);
  color: #fff;
  margin-bottom: 10px;
}

.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-opt-btn {
  padding: 13px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg3);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Política Privacidade */
.privacidade-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

.privacidade-card h3 {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
}

/* Ajuda */
.ajuda-step {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
}

.ajuda-step .step-num {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.ajuda-step .step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.ajuda-step .step-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(124,111,255,0.3);
  border-radius: 28px 28px 0 0;
  padding: 30px 20px 44px;
  width: 100%;
  max-width: 430px;
  text-align: center;
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-box .modal-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

.modal-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  margin-bottom: 10px;
}

.stars-display {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.star-item {
  font-size: 36px;
  cursor: pointer;
  transition: transform 0.2s;
}

.star-item:hover {
  transform: scale(1.2);
}

/* Tab nav */
.tab-nav {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  background: none;
  color: var(--muted);
  transition: all 0.15s;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 22px;
  display: none;
  z-index: 400;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(124,111,255,0.4);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 20px;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  padding: 4px 8px;
  transition: color 0.15s;
}

.nav-btn .nav-icon {
  font-size: 20px;
}

.nav-btn.active {
  color: var(--accent);
}

.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 50px;
  margin-bottom: 14px;
}

a.email-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

a.email-link:hover {
  text-decoration: underline;
}