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

:root {
  --blue-dark:  #0a1528;
  --blue-mid:   #1a3a5c;
  --blue-light: #4a9fd4;
  --gold:       #d4a020;
  --gold-light: #ffe88a;
  --text:       #cce8f8;
  --text-dim:   #6a9ab8;
}

body {
  background: var(--blue-dark);
  color: var(--text);
  font-family: 'Georgia', serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* ── header ────────────────────────────────────────────────────────────────── */
header {
  text-align: center;
  padding: 28px 16px 8px;
  width: 100%;
}

header h1 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), #9a6800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 12px rgba(212,160,32,0.5));
}

header p {
  color: var(--text-dim);
  font-style: italic;
  margin-top: 6px;
  font-size: 1rem;
}

/* ── canvas ─────────────────────────────────────────────────────────────────  */
#canvas-wrap {
  position: relative;
  width: min(780px, 96vw);
  height: min(520px, 58vw, 56vh);
  margin: 16px auto 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(40,140,255,0.18), 0 0 0 1px rgba(100,180,255,0.1);
}

#fountain-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* sound toggle */
#sound-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(10,20,40,0.7);
  border: 1px solid rgba(100,180,255,0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: var(--blue-light);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
#sound-btn:hover { background: rgba(40,80,140,0.8); color: #fff; }

/* wish toast */
#wish-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(10,20,40,0.85);
  border: 1px solid rgba(212,160,32,0.4);
  border-radius: 30px;
  padding: 10px 24px;
  color: var(--gold-light);
  font-style: italic;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
  white-space: nowrap;
  max-width: 90%;
}

/* ── payment panel ──────────────────────────────────────────────────────────  */
#payment-panel {
  width: min(780px, 96vw);
  margin: 24px auto 40px;
  background: rgba(15,30,55,0.7);
  border: 1px solid rgba(100,180,255,0.12);
  border-radius: 18px;
  padding: 28px 32px;
  backdrop-filter: blur(6px);
}

#payment-panel h2 {
  font-size: 1.3rem;
  color: var(--gold-light);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

#payment-panel p.sub {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-bottom: 22px;
}

/* amount presets */
.amount-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.amt-btn {
  flex: 1;
  min-width: 72px;
  background: rgba(20,50,90,0.8);
  border: 1px solid rgba(100,180,255,0.2);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  padding: 12px 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  font-family: inherit;
}

.amt-btn:hover   { background: rgba(40,90,160,0.8); border-color: var(--blue-light); }
.amt-btn.active  { background: rgba(30,80,150,0.9); border-color: var(--gold); color: var(--gold-light); }
.amt-btn:active  { transform: scale(0.96); }

/* custom amount */
.custom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.custom-row label {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.custom-row input[type="number"] {
  flex: 1;
  background: rgba(10,20,40,0.8);
  border: 1px solid rgba(100,180,255,0.2);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  padding: 10px 14px;
  font-family: inherit;
  outline: none;
  -moz-appearance: textfield;
  max-width: 140px;
}
.custom-row input::-webkit-inner-spin-button { display: none; }
.custom-row input:focus { border-color: var(--blue-light); }

/* PayPal button container */
#paypal-button-container {
  min-height: 50px;
}

/* status message */
#status-msg {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  display: none;
}
#status-msg.success {
  background: rgba(20,80,40,0.6);
  border: 1px solid #3aaa60;
  color: #90e8a8;
  display: block;
}
#status-msg.error {
  background: rgba(80,20,20,0.6);
  border: 1px solid #aa3a3a;
  color: #e89090;
  display: block;
}

/* ── footer ─────────────────────────────────────────────────────────────────  */
footer {
  color: var(--text-dim);
  font-size: 0.78rem;
  padding: 16px;
  text-align: center;
  border-top: 1px solid rgba(100,180,255,0.08);
  width: 100%;
  margin-top: auto;
}

footer a { color: var(--blue-light); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── responsive ──────────────────────────────────────────────────────────────  */
@media (max-width: 480px) {
  #payment-panel { padding: 20px 16px; }
  .amt-btn { font-size: 0.9rem; padding: 10px 4px; }
}
