:root {
  --bg: #1f1235;
  --bg-card: #2b1a4a;
  --accent: #e11d48;
  --accent-2: #fb7185;
  --text: #fdf2f8;
  --muted: #d8b4fe;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(0,0,0,0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg) 0%, #3b0d2e 100%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 20px;
}

#app {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
}

.screen { display: none; flex-direction: column; gap: 20px; }
.screen.active { display: flex; animation: fadeIn .3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero { text-align: center; margin-top: 20px; }
.hero h1 {
  font-size: 2.6rem;
  background: linear-gradient(90deg, var(--accent-2), #ffd1dc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); margin-top: 8px; font-size: 1rem; }
.hero .heart { -webkit-text-fill-color: var(--accent); }

.mode-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }

.mode-card {
  background: var(--bg-card);
  border: 1px solid rgba(251,113,133,.3);
  color: var(--text);
  padding: 24px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform .15s, background .15s;
}
.mode-card:hover, .mode-card.selected { background: #3a285d; transform: translateY(-3px); }
.mode-emoji { font-size: 2rem; }
.mode-title { font-weight: 700; font-size: 1.1rem; }
.mode-sub { font-size: .8rem; color: var(--muted); }

.selectors {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.selectors label { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.selectors select {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.15);
  background: #1f1235;
  color: var(--text);
  font-size: 1rem;
  width: 100%;
  margin-top: 6px;
}
.extra-row { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); }
.extra-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.extra-row { text-transform: none !important; letter-spacing: 0 !important; }

.primary-btn, .ghost-btn {
  padding: 18px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform .1s, opacity .1s;
  width: 100%;
}
.primary-btn { background: linear-gradient(90deg, var(--accent), #be123c); color: #fff; box-shadow: var(--shadow); }
.primary-btn:active, .ghost-btn:active { transform: scale(.98); }
.ghost-btn { background: transparent; border: 1.5px solid rgba(251,113,133,.5); color: var(--accent-2); }

/* Carta */
.card-area { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.card {
  background: var(--bg-card);
  border: 1px solid rgba(251,113,133,.4);
  border-radius: var(--radius);
  padding: 30px 26px;
  width: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
  box-shadow: var(--shadow);
}
.card-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tag {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(225,29,72,.25);
  color: var(--accent-2);
  border: 1px solid rgba(251,113,133,.4);
}
.card-emojis { font-size: 2.4rem; }
.card-text { font-size: 1.35rem; line-height: 1.5; }

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

/* Historial */
.history-list { list-style: none; display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.history-list li {
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid var(--accent);
  font-size: .95rem;
}
.history-list .h-tag { color: var(--muted); font-size: .75rem; text-transform: uppercase; }

@media (max-width: 400px) {
  .mode-buttons { grid-template-columns: 1fr; }
}
