:root {
  --bg-main: #009eac;
  --bg-deep: #046873;
  --bg-soft: #53d3dc;
  --ink: #062f35;
  --surface: rgba(255, 255, 255, 0.16);
  --surface-border: rgba(255, 255, 255, 0.34);
  --card-top: #ffffff;
  --card-bottom: #ddf8fb;
  --accent: #0b4f57;
  --accent-hover: #083a40;
  --highlight: #ffce47;
  --muted: #1f5660;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background: var(--bg-main);
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 255, 255, 0.26), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(131, 241, 255, 0.38), transparent 36%),
    radial-gradient(circle at 82% 86%, rgba(2, 82, 91, 0.48), transparent 42%),
    linear-gradient(145deg, rgba(0, 158, 172, 0.98) 0%, rgba(4, 104, 115, 0.98) 100%);
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.hero {
  text-align: center;
  margin-bottom: 18px;
  color: #f4feff;
  animation: reveal 600ms ease-out both;
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  color: #caf8ff;
  font-weight: 700;
  font-size: 0.75rem;
}

h1 {
  margin: 10px 0 12px;
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.04;
  text-shadow: 0 12px 30px rgba(2, 46, 51, 0.35);
}

.subtitle {
  margin: 0 auto;
  max-width: 620px;
  color: #dffcff;
  font-size: 1.05rem;
}

.gift-note {
  max-width: 860px;
  margin: 0 auto 20px;
  padding: 15px 16px;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  color: #effeff;
}

.gift-note p {
  margin: 0;
  line-height: 1.5;
}

.gift-note .formula {
  margin-top: 8px;
  color: #d0fbff;
  font-size: 0.95rem;
}

.buyer-form {
  max-width: 620px;
  margin: 0 auto 22px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow: 0 20px 38px rgba(2, 66, 73, 0.24);
}

.buyer-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #124f57;
}

.buyer-input {
  width: 100%;
  border: 1px solid rgba(7, 77, 84, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
}

.buyer-input:focus {
  outline: none;
  border-color: #0d6973;
  box-shadow: 0 0 0 4px rgba(0, 158, 172, 0.18);
}

.buyer-hint {
  margin: 8px 0 0;
  color: #346a72;
  font-size: 0.85rem;
}

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.gift-card {
  position: relative;
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(165deg, var(--card-top), var(--card-bottom));
  box-shadow: 0 15px 30px rgba(2, 61, 67, 0.26);
  transform: translateY(12px);
  opacity: 0;
  animation: cardRise 620ms ease forwards;
  overflow: hidden;
}

.gift-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #0f8b98, #53d3dc, #0f8b98);
}

.gift-card:nth-child(2) { animation-delay: 50ms; }
.gift-card:nth-child(3) { animation-delay: 100ms; }
.gift-card:nth-child(4) { animation-delay: 150ms; }
.gift-card:nth-child(5) { animation-delay: 200ms; }
.gift-card:nth-child(6) { animation-delay: 250ms; }
.gift-card:nth-child(7) { animation-delay: 300ms; }

.gift-card:hover {
  transform: translateY(-3px);
  transition: transform 200ms ease, box-shadow 220ms ease;
  box-shadow: 0 22px 38px rgba(1, 61, 67, 0.3);
}

.coins {
  margin: 2px 0 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #0a6069;
}

.amount {
  margin: 0 0 8px;
  font-family: 'Fraunces', serif;
  font-size: 2.1rem;
  color: #0a3338;
}

.card-copy {
  min-height: 44px;
  margin: 0 0 14px;
  color: #306c74;
  font-size: 0.92rem;
  line-height: 1.4;
}

.buy-btn {
  width: 100%;
  border: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--accent);
  color: #ebffff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 180ms ease;
}

.buy-btn:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
  box-shadow: 0 8px 18px rgba(5, 62, 69, 0.25);
}

.buy-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status-panel {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 12px 14px;
}

#statusText {
  margin: 0;
  font-size: 0.95rem;
}

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

@keyframes cardRise {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .layout {
    padding-top: 28px;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .gift-note {
    margin-bottom: 16px;
  }
}

@media (max-width: 460px) {
  .cards {
    grid-template-columns: 1fr;
  }
}
