@import url('/fonts/fonts.css');

:root {
  --night: #07140f;
  --night-2: #0d241b;
  --pine: #12382a;
  --red: #c8102e;
  --red-deep: #7a0f1f;
  --gold: #f2c86b;
  --gold-2: #ffe7a8;
  --cream: #fff8ec;
  --ink: #f6efe3;
  --muted: #b9c4bc;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --radius: 22px;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% -10%, #1d4a37 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #3a0b16 0%, transparent 55%),
    linear-gradient(180deg, var(--night-2), var(--night));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
body::after { content: ''; position: fixed; inset: -50%; pointer-events: none; z-index: 60; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.hero3d { position: relative; height: 300px; margin: -10px -18px 0; border-radius: 0;
  -webkit-mask-image: radial-gradient(ellipse 54% 47% at 50% 50%, #000 45%, transparent 100%); mask-image: radial-gradient(ellipse 54% 47% at 50% 50%, #000 45%, transparent 100%); }
.hero3d .hero-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 72px; animation: float 3s ease-in-out infinite; }
.hero3d.live .hero-fallback { display: none; }
.hero3d canvas { opacity: 0; animation: heroIn 1.4s ease .2s forwards; }
@keyframes heroIn { to { opacity: 1; } }
@keyframes float { 50% { transform: translateY(-10px) rotate(-4deg); } }
.wrap { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 28px 18px 80px; }
.wrap.wide { max-width: 880px; }

.brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold);
  margin: 6px 0 22px;
}
.brand::before, .brand::after { content: ''; height: 1px; width: 38px; background: linear-gradient(90deg, transparent, var(--gold)); }
.brand::after { transform: scaleX(-1); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(34px, 8vw, 52px); line-height: 1.05; text-align: center; }
h1 em { font-style: italic; font-weight: 500; padding: 0 .06em;
  background: linear-gradient(105deg, #c8913a 0%, #ffe9b0 30%, #fff8e6 40%, #e9b955 55%, #ffe3a0 80%, #c8913a 100%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: foilText 6s linear infinite; }
@keyframes foilText { to { background-position: -200% 0; } }
h2 { font-size: 24px; margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 8px; }
.sub { text-align: center; color: var(--muted); font-size: 16px; line-height: 1.5; margin: 12px auto 26px; max-width: 30em; }

.card {
  background: linear-gradient(160deg, rgba(255,255,255,.085), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 16px 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .8);
}
.card.gold { border-color: rgba(242, 200, 107, .45); background: linear-gradient(160deg, rgba(242,200,107,.12), rgba(255,255,255,.04)); }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; letter-spacing: .02em; }
label small { font-weight: 400; opacity: .8; }
input, textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242, 200, 107, .15); }
input[type=checkbox] { width: auto; }
::placeholder { color: rgba(246, 239, 227, .35); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px var(--body); color: #fff; text-decoration: none; cursor: pointer;
  border: 0; border-radius: 999px; padding: 14px 24px;
  background: linear-gradient(180deg, #e0213f, var(--red));
  box-shadow: 0 10px 24px -10px rgba(200, 16, 46, .8), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn.block { width: 100%; margin-top: 18px; }
.btn.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #3a2205; box-shadow: 0 10px 24px -10px rgba(242, 200, 107, .7), inset 0 1px 0 rgba(255,255,255,.6); }
.btn.ghost { background: transparent; border: 1px solid var(--line); box-shadow: none; color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.danger { background: transparent; border: 1px solid rgba(255, 90, 90, .4); color: #ff9b9b; box-shadow: none; }

.link { background: none; border: 0; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.err { color: #ffadad; min-height: 1.2em; font-size: 14px; margin-top: 10px; }
.ok { color: #a8f0c6; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%);
  background: var(--cream); color: #2b211a; padding: 12px 18px; border-radius: 999px;
  font-weight: 600; box-shadow: 0 14px 40px rgba(0,0,0,.4); z-index: 50; transition: transform .35s cubic-bezier(.2,1.4,.4,1);
  max-width: 92vw; text-align: center;
}
#toast.show { transform: translate(-50%, 0); }

/* Avatars */
.people { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.av {
  --h: 0;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font: 700 16px var(--body); color: #fff;
  background: linear-gradient(145deg, hsl(var(--h) 65% 45%), hsl(calc(var(--h) + 40) 70% 30%));
  border: 2px solid rgba(255,255,255,.25); position: relative;
  animation: pop .5s cubic-bezier(.2,1.6,.4,1) backwards;
}
.av[data-ok]::after { content: '✓'; position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: #1fa463; font-size: 11px; display: grid; place-items: center; border: 2px solid var(--night); }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); max-width: 64px; text-align: center; }
@keyframes pop { from { transform: scale(0); opacity: 0; } }

/* Countdown */
.countdown { display: flex; justify-content: center; gap: 10px; margin: 18px 0 6px; }
.cd { min-width: 66px; padding: 12px 6px 8px; border-radius: 16px; background: rgba(0,0,0,.3); border: 1px solid var(--line); text-align: center; }
.cd b { display: block; font: 600 34px/1 var(--display); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.cd span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cd b.tick { animation: tick .4s ease; }
@keyframes tick { 0% { transform: translateY(-6px); opacity: .2; } 100% { transform: none; opacity: 1; } }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px 2px 8px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; line-height: 1.4; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.mine { align-self: flex-end; background: var(--red); border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; background: rgba(255,255,255,.1); border-bottom-left-radius: 6px; }
.bubble time { display: block; font-size: 11px; opacity: .6; margin-top: 4px; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input { flex: 1; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 10px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(242, 200, 107, .14); color: var(--gold-2); font-size: 13px; font-weight: 600; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 14px 0 4px; }

.wishes { white-space: pre-wrap; line-height: 1.55; font-size: 16px; background: rgba(0,0,0,.22); border-radius: 14px; padding: 14px 16px; }

/* footer */
.foot { text-align: center; color: rgba(185,196,188,.6); font-size: 12px; margin-top: 30px; }

.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
