/* === Placeholder palette — swap for invitation colors later === */
:root {
  --color-bg: #1a1a2e;
  --color-surface: #16213e;
  --color-text: #eee8dc;
  --color-accent: #e2b86b;
  --color-accent-soft: rgba(226, 184, 107, 0.25);
  --color-muted: #a89f91;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

/* === Reset & base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* === Layout === */
.container {
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

/* === Header === */
.header {
  flex-shrink: 0;
}

.names {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.ampersand {
  font-style: italic;
  color: var(--color-accent);
  margin: 0 0.15em;
}

.established {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

/* === Disco ball === */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  width: 100%;
}

.disco-wrapper {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.disco-wrapper.vanish {
  opacity: 0;
  transform: scale(0.3);
  pointer-events: none;
}

.disco-ball {
  width: 180px;
  height: 180px;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 20px rgba(226, 184, 107, 0.15));
}

.disco-wrapper:active .disco-ball {
  transform: scale(0.95);
}

/* Spin animation */
.disco-ball.spinning {
  animation: disco-spin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes disco-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(360deg) scale(1.08); }
  100% { transform: rotate(720deg) scale(1); }
}

/* Tap hint */
.tap-hint {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--color-muted);
  letter-spacing: 0.1em;
  margin-top: 0.75rem;
  text-align: center;
  animation: hint-pulse 2.5s ease-in-out infinite;
}

.tap-hint.hidden {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* === Sparkles === */
.sparkles {
  position: absolute;
  inset: -30px;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0;
}

.sparkle.animate {
  animation: sparkle-pop 0.7s ease-out forwards;
}

@keyframes sparkle-pop {
  0% {
    opacity: 1;
    transform: scale(0) translate(0, 0);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) translate(var(--tx), var(--ty));
  }
  100% {
    opacity: 0;
    transform: scale(0.5) translate(var(--tx), var(--ty));
  }
}

/* === Fortune area === */
.fortune-area {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 0 0.5rem;
}

.fortune-loading {
  display: none;
}

.fortune-loading.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-accent-soft);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fortune-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-text);
  opacity: 0;
  max-width: 320px;
}

.fortune-text.visible {
  animation: fortune-fade-in 0.6s ease forwards;
}

@keyframes fortune-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fortune-author {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--color-muted);
  opacity: 0;
  margin-top: 0.5rem;
}

.fortune-author.visible {
  animation: fortune-fade-in 0.6s ease 0.3s forwards;
}

/* === Footer === */
.footer {
  flex-shrink: 0;
}

.footer-text {
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--color-muted);
  letter-spacing: 0.08em;
  opacity: 0.6;
}
