:root {
  --bg-deep: #140a22;
  --bg-mid: #241238;
  --gold: #d4af37;
  --gold-light: #f0d98c;
  --ink: #f5f0e6;
  --ink-soft: #c9bedd;
  --muted: #9d8fb3;
  --danger: #e68a8a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(ellipse at top, var(--bg-mid), var(--bg-deep) 70%);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}

h1.title {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.12em;
  font-size: 2.1rem;
  margin: 0;
  color: var(--gold-light);
  text-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}

.tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.desc,
.disclaimer-small {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

h2 {
  font-family: Georgia, serif;
  color: var(--gold-light);
  margin: 0;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 28px;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #241238;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(201, 190, 221, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  padding: 6px 10px;
}

.actions-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Form ---- */

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

input[type="text"],
input[type="date"],
input[type="number"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 190, 221, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 1rem;
}

input::placeholder {
  color: var(--muted);
}

details {
  border: 1px solid rgba(201, 190, 221, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
}

details summary {
  cursor: pointer;
  color: var(--gold-light);
  font-weight: 600;
}

details > label {
  margin-top: 12px;
}

.consent {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.consent input {
  margin-top: 3px;
  flex-shrink: 0;
}

/* ---- Reveal animation ---- */

.card-stage {
  display: flex;
  justify-content: center;
  padding: 40px 0;
  perspective: 1000px;
}

.card {
  width: 220px;
  height: 320px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border: 2px solid var(--gold);
}

.card-back {
  background: linear-gradient(145deg, var(--bg-mid), var(--bg-deep));
  font-size: 3rem;
  color: var(--gold);
  animation: glow 1.8s ease-in-out infinite;
}

.card-front {
  background: linear-gradient(145deg, #2e1a46, #1a0f2a);
  transform: rotateY(180deg);
  color: var(--gold-light);
  font-family: Georgia, serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

@keyframes glow {
  0%,
  100% {
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  }
  50% {
    text-shadow: 0 0 28px rgba(212, 175, 55, 0.85);
  }
}

/* ---- Result ---- */

.result-card {
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.08), transparent 60%),
    var(--bg-mid);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 18px;
  padding: 26px 22px;
  text-align: left;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.result-header {
  text-align: center;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  margin-bottom: 4px;
}

.result-card h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2px;
}

.result-keyword {
  text-align: center;
  color: var(--gold-light);
  font-style: italic;
  margin: 0 0 16px;
  font-size: 0.95rem;
}

.result-description {
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 18px;
}

.messages p {
  margin: 0 0 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.messages strong {
  color: var(--gold-light);
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

footer.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 24px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

@media (max-width: 380px) {
  h1.title {
    font-size: 1.7rem;
  }
  .card {
    width: 180px;
    height: 260px;
  }
}
