:root{
  --bg: #0A0A14;
  --bg2: #05050A;
  --panel: rgba(255,255,255,.03);
  --panel-border: rgba(255,255,255,.08);
  --neon-pink: #FF3EA5;
  --neon-cyan: #2BE7FF;
  --neon-purple: #A45CFF;
  --neon-gold: #FFD166;
  --paper: #14141F;
  --paper-2: #1B1B2A;
  --text: #ECEBFF;
  --muted: #8890B0;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  min-height:100vh;
  background:
    radial-gradient(ellipse at 15% -10%, rgba(255,62,165,.12) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 110%, rgba(43,231,255,.10) 0%, transparent 50%),
    var(--bg);
  font-family:'Inter',sans-serif;
  color:var(--text);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  position:relative;
  overflow-x:hidden;
}
body::before{
  content:'';
  position:fixed; inset:0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.2), transparent),
    radial-gradient(1px 1px at 80% 15%, rgba(255,255,255,.18), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,.13), transparent),
    radial-gradient(1px 1px at 30% 85%, rgba(255,255,255,.16), transparent);
  pointer-events:none; z-index:0;
}
.stage{ position:relative; z-index:1; width:100%; max-width:520px; }
.eyebrow{ font-size:12px; letter-spacing:.22em; text-transform:uppercase; color:var(--neon-cyan); text-align:center; margin-bottom:10px; font-weight:500; text-shadow:0 0 12px rgba(43,231,255,.5); }
h1{ font-family:'Fraunces',serif; font-weight:600; font-size:clamp(26px,6vw,38px); text-align:center; margin:0 0 8px; text-shadow:0 0 24px rgba(255,62,165,.25); }
.sub{ text-align:center; color:var(--muted); font-size:14.5px; margin:0 0 30px; line-height:1.5; }
.card{
  background:var(--panel);
  border:1px solid var(--panel-border);
  border-radius:18px;
  padding:26px 22px;
  backdrop-filter:blur(8px);
  position:relative;
  box-shadow:0 0 0 1px rgba(255,255,255,.02), 0 20px 60px rgba(0,0,0,.5);
}
label{ display:block; font-size:12.5px; color:var(--neon-pink); letter-spacing:.04em; margin-bottom:6px; margin-top:18px; font-weight:500; }
label:first-child{ margin-top:0; }
input[type=text], input[type=email], textarea{
  width:100%; background:rgba(0,0,0,.3); border:1px solid rgba(255,255,255,.1);
  border-radius:10px; padding:12px 14px; color:var(--text); font-family:'Inter',sans-serif;
  font-size:15px; resize:vertical; outline:none; transition:border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus{ border-color:var(--neon-cyan); box-shadow:0 0 0 3px rgba(43,231,255,.12); }
textarea{ min-height:130px; line-height:1.5; }
.row2{ display:flex; gap:14px; }
.row2 > div{ flex:1; }
button{ font-family:'Inter',sans-serif; font-weight:600; font-size:15px; border:none; border-radius:10px; padding:14px 20px; cursor:pointer; transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease; }
button:focus-visible{ outline:2px solid var(--neon-cyan); outline-offset:2px; }
button:disabled{ opacity:.5; cursor:default; }
.btn-primary{
  width:100%; margin-top:24px; color:#0A0A14; font-weight:700;
  background:linear-gradient(135deg,var(--neon-pink),var(--neon-purple));
  box-shadow:0 0 24px rgba(255,62,165,.35), 0 8px 20px rgba(0,0,0,.3);
}
.btn-primary:hover:not(:disabled){ transform:translateY(-1px); box-shadow:0 0 32px rgba(255,62,165,.5), 0 10px 24px rgba(0,0,0,.35); }
.btn-ghost{ background:transparent; border:1px solid rgba(43,231,255,.35); color:var(--neon-cyan); width:100%; margin-top:10px; }
.btn-ghost:hover:not(:disabled){ box-shadow:0 0 16px rgba(43,231,255,.25); }
.btn-small{ padding:10px 14px; font-size:13px; }
.hint{ font-size:12px; color:var(--muted); margin-top:6px; line-height:1.4; }
.error-msg{ font-size:13px; color:#FF6E9C; margin-top:8px; min-height:16px; }
.success-msg{ font-size:13px; color:#5CFFC0; margin-top:8px; }

.verify-row{ display:flex; gap:8px; margin-top:8px; }
.verify-row input{ flex:1; }
.code-row{ display:flex; gap:8px; margin-top:10px; align-items:center; }
.code-row input{ letter-spacing:4px; font-size:18px; text-align:center; }
.badge-verified{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:#5CFFC0; margin-top:8px; }

.link-box{ display:flex; gap:8px; margin-top:22px; align-items:center; }
.link-box input{ flex:1; font-size:13px; color:var(--neon-cyan); background:rgba(0,0,0,.35); }
.copy-btn{ background:rgba(43,231,255,.1); border:1px solid rgba(43,231,255,.35); color:var(--neon-cyan); padding:12px 16px; white-space:nowrap; font-size:13px; }
.copy-btn.copied{ background:var(--neon-cyan); color:#0A0A14; }

/* --- Envelope (used for both closing/sealing and opening/reveal) --- */
.envelope-stage{ display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:46vh; }
.envelope-wrap{ perspective:1200px; cursor:pointer; user-select:none; }
.envelope{
  width:min(260px, 68vw); height:calc(min(260px, 68vw) * 0.69);
  position:relative;
  background:linear-gradient(155deg,var(--paper-2),var(--paper) 60%);
  border-radius:6px;
  box-shadow:0 0 0 1px rgba(255,255,255,.05), 0 0 40px rgba(164,92,255,.18), 0 25px 50px rgba(0,0,0,.55);
  transition:transform .4s ease, box-shadow .4s ease;
  animation: envelopeArrive .6s cubic-bezier(.2,.9,.3,1.2) both, envelopeGlow 3.2s ease-in-out .6s infinite;
}
@keyframes envelopeArrive{
  0%{ opacity:0; transform:scale(.7) translateY(14px); }
  100%{ opacity:1; transform:scale(1) translateY(0); }
}
@keyframes envelopeGlow{
  0%,100%{ box-shadow:0 0 0 1px rgba(255,255,255,.05), 0 0 40px rgba(164,92,255,.18), 0 25px 50px rgba(0,0,0,.55); }
  50%{ box-shadow:0 0 0 1px rgba(255,255,255,.08), 0 0 60px rgba(255,62,165,.28), 0 25px 50px rgba(0,0,0,.55); }
}
.envelope-wrap:hover .envelope{ transform:translateY(-4px); }
.flap{
  position:absolute; top:0;left:0; width:0;height:0;
  border-left:130px solid transparent; border-right:130px solid transparent;
  border-top:95px solid var(--paper-2);
  transform-origin:top;
  transition:transform .7s cubic-bezier(.6,-0.1,.2,1.4);
  z-index:3;
  filter:drop-shadow(0 0 10px rgba(164,92,255,.25));
}
.envelope.open .flap{ transform:rotateX(180deg); }
.body-flap-l{ position:absolute; bottom:0;left:0; width:0;height:0; border-bottom:70px solid rgba(0,0,0,.25); border-right:130px solid transparent; }
.body-flap-r{ position:absolute; bottom:0;right:0; width:0;height:0; border-bottom:70px solid rgba(0,0,0,.25); border-left:130px solid transparent; }
.wax{
  position:absolute; top:35%; left:50%; transform:translate(-50%,0);
  width:48px;height:48px; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, var(--neon-pink), var(--neon-purple));
  box-shadow:0 0 18px rgba(255,62,165,.7), 0 0 4px rgba(255,62,165,.9), inset 0 -3px 6px rgba(0,0,0,.3);
  display:flex;align-items:center;justify-content:center;
  font-family:'Fraunces',serif; font-size:18px; color:#fff;
  z-index:4;
  transition:opacity .3s ease, transform .3s ease;
}
.envelope.open .wax{ opacity:0; transform:translate(-50%,0) scale(.4); }
.letter-inside{
  position:absolute; top:14px;left:20px;right:20px; height:calc(100% - 44px);
  background:linear-gradient(160deg, var(--paper) 0%, #0F0F18 100%);
  border-radius:3px;
  box-shadow:0 4px 14px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.05);
  transition:transform .6s ease .2s;
  z-index:2;
}
.envelope.open .letter-inside{ transform:translateY(-92px); }
.tap-hint{ margin-top:26px; color:var(--muted); font-size:13px; text-align:center; }
.tap-hint .glow-word{ color:var(--neon-cyan); text-shadow:0 0 10px rgba(43,231,255,.6); }

.letter-full{
  max-width:480px; width:100%;
  background:linear-gradient(165deg, var(--paper-2), var(--paper) 70%);
  color:var(--text);
  border-radius:12px;
  padding:38px 32px 32px;
  box-shadow:0 0 0 1px rgba(255,255,255,.06), 0 0 60px rgba(164,92,255,.15), 0 30px 60px rgba(0,0,0,.6);
  opacity:0; transform:translateY(16px);
  animation:riseIn .6s ease forwards;
  animation-delay:.25s;
}
@keyframes riseIn{ to{ opacity:1; transform:translateY(0); } }
.letter-full .to-line{ font-family:'Fraunces',serif; font-style:italic; font-size:15px; color:var(--neon-cyan); margin-bottom:18px; text-shadow:0 0 10px rgba(43,231,255,.35); }
.letter-full .msg{ font-family:'Fraunces',serif; font-size:19px; line-height:1.75; white-space:pre-wrap; color:var(--text); }
.letter-full .from-line{ font-family:'Caveat',cursive; font-size:32px; color:var(--neon-pink); margin-top:26px; text-align:right; text-shadow:0 0 14px rgba(255,62,165,.4); }
.letter-full .date-line{ font-size:11px; color:var(--muted); text-align:right; margin-top:4px; }
.action-row{ display:flex; gap:10px; margin-top:22px; }
.action-row button{ flex:1; }
.link-small{ display:block; text-align:center; margin-top:16px; color:var(--muted); font-size:13px; text-decoration:none; background:none; border:none; cursor:pointer; }
.link-small:hover{ color:var(--neon-cyan); }

.status{ text-align:center; color:var(--muted); font-size:14px; padding:40px 0; }
.error-box{ text-align:center; padding:30px 10px; }
.seal-icon{
  width:60px;height:60px;margin:0 auto 18px; display:flex;align-items:center;justify-content:center;
  border-radius:50%; background:radial-gradient(circle at 35% 30%, var(--neon-pink), var(--neon-purple));
  box-shadow:0 0 20px rgba(255,62,165,.6); font-family:'Fraunces',serif; font-size:20px; color:#fff;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
@media (max-width:480px){
  .row2{ flex-direction:column; gap:0; }
  .action-row{ flex-direction:column; }
  .letter-full{ padding:30px 22px 26px; }
  .card{ padding:22px 18px; }
}
@media (max-width:360px){
  h1{ font-size:24px; }
  .letter-full .msg{ font-size:17px; }
}

/* --- Layout: form + side panel on desktop, stacked on mobile --- */
.layout{
  display:flex; flex-direction:row; align-items:flex-start; justify-content:center;
  gap:52px; width:100%; max-width:900px; position:relative; z-index:1;
}
.inspire-panel{
  width:230px; flex-shrink:0; position:sticky; top:200px;
  display:flex; flex-direction:column; gap:14px;
}
.inspire-panel:empty{ display:none; }
.stat-counter{
  padding:16px 14px;
  border-radius:12px;
  background:rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.06);
  text-align:center;
}
.stat-counter .stat-number{
  font-family:'Fraunces',serif; font-weight:600; font-size:26px;
  color:var(--neon-cyan); text-shadow:0 0 14px rgba(43,231,255,.5);
  line-height:1.2;
}
.stat-counter .stat-label{ font-size:11.5px; color:var(--muted); margin-top:2px; letter-spacing:.03em; }

.inspire-title{
  font-size:11.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted);
  margin-bottom:2px;
}
.inspire-list{ display:flex; flex-direction:column; gap:10px; }
.inspire-item{
  display:flex; align-items:center; gap:10px;
  font-size:13.5px; color:var(--text); opacity:0;
  padding:10px 12px; border-radius:10px;
  background:rgba(255,255,255,.02); border:1px solid rgba(255,255,255,.06);
  animation:itemFadeIn .5s ease forwards;
}
.inspire-item .dot{
  width:7px; height:7px; border-radius:50%; flex-shrink:0;
  background:var(--neon-cyan); box-shadow:0 0 8px rgba(43,231,255,.8);
}
.inspire-item:nth-child(even) .dot{ background:var(--neon-pink); box-shadow:0 0 8px rgba(255,62,165,.8); }
@keyframes itemFadeIn{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:translateY(0); } }

@media (max-width:900px){
  .layout{ flex-direction:column; align-items:center; gap:0; }
  .inspire-panel{ width:100%; max-width:520px; position:static; margin-top:36px; }
}

/* --- Admin --- */
.admin-wrap{ max-width:900px; width:100%; }
table{ width:100%; border-collapse:collapse; margin-top:20px; font-size:13.5px; }
th,td{ text-align:left; padding:10px 12px; border-bottom:1px solid rgba(255,255,255,.08); vertical-align:top; }
th{ color:var(--neon-cyan); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
tr.reply-row td:first-child{ padding-left:28px; color:var(--muted); }
.pill{ display:inline-block; padding:2px 8px; border-radius:20px; font-size:11px; background:rgba(255,62,165,.12); color:var(--neon-pink); }
