:root{
  --bg1:#0b1b55;
  --bg2:#09133c;
  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.09);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.72);
  --line:rgba(255,255,255,.12);
  --shadow:0 18px 60px rgba(0,0,0,.35);
  --primary:#22c55e;
  --primary2:#16a34a;
  --warn:#fbbf24;
  --radius:18px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  overflow:hidden;
  background:
    radial-gradient(1200px 700px at 25% 10%, rgba(73,150,255,.18), transparent 60%),
    radial-gradient(900px 600px at 70% 30%, rgba(34,197,94,.15), transparent 55%),
    linear-gradient(180deg,var(--bg1),var(--bg2));
}

#stars{
  position:fixed; inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,.55) 0 1px, transparent 2px),
    radial-gradient(circle at 25% 75%, rgba(255,255,255,.45) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 35%, rgba(255,255,255,.5) 0 1px, transparent 2px),
    radial-gradient(circle at 65% 55%, rgba(255,255,255,.42) 0 1px, transparent 2px),
    radial-gradient(circle at 85% 18%, rgba(255,255,255,.45) 0 1px, transparent 2px);
  opacity:.55;
}

#snow{
  position:fixed; inset:0;
  width:100%; height:100%;
  pointer-events:none;
}

.topbar{
  position:fixed;
  top:16px; left:16px; right:16px;
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  z-index:30;
}

.brand{
  padding:12px 16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.05);
  border-radius:999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
}
.brand__title{
  font-size:28px;
  font-weight:900;
  letter-spacing:.5px;
  line-height:1.05;
  color:#ffd166;
  text-shadow:0 10px 45px rgba(0,0,0,.35);
}
.brand__sub{font-size:12px;color:var(--muted);margin-top:2px}

.actions{display:flex; gap:10px; align-items:center}
.btn--toggle{min-width:88px}
.btn--toggle.is-off{opacity:.78}
.btn{
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 14px;
  border-radius:999px;
  cursor:pointer;
  backdrop-filter: blur(10px);
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
  user-select:none;
  font-weight:700;
}
.btn:hover{transform:translateY(-1px); background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.2)}
.btn:active{transform:translateY(0px)}
.btn--primary{
  background:linear-gradient(180deg,var(--primary),var(--primary2));
  border-color:rgba(34,197,94,.35);
}
.btn--primary:hover{background:linear-gradient(180deg,#34d399,#16a34a)}
.btn--ghost{background:rgba(255,255,255,.05)}

.stage{
  position:relative;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:86px 16px 24px;
}

.hero{
  width:min(980px, 96vw);
  min-height:calc(100vh - 120px);
  display:grid;
  grid-template-rows:1fr auto;
  align-items:center;
  justify-items:center;
}

.tree-wrap{
  width:min(420px, 86vw);
  margin-top:18px;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.45));
}
.tree{width:100%; height:auto}
.ball{fill:#a7f3d0; opacity:.9}
.ball--r{fill:#fb7185}
.ball--y{fill:#fbbf24}
.ball--b{fill:#60a5fa}
.ball--p{fill:#c4b5fd}
.ball--c{fill:#34d399}

.hint{
  width:min(720px, 96vw);
  text-align:center;
  padding:14px 16px 6px;
}
.hint__title{font-weight:900;font-size:22px}
.hint__sub{color:var(--muted); font-size:13px; margin-top:6px}

.danmaku{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:20;
}

.dm{
  position:absolute;
  left:100%;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
  box-shadow:0 14px 40px rgba(0,0,0,.22);
  white-space:nowrap;
  font-weight:800;
  transform:translateZ(0);
}
.dm__emoji{filter: drop-shadow(0 6px 16px rgba(0,0,0,.25))}
.dm__name{color:rgba(255,255,255,.85)}
.dm__msg{color:rgba(255,255,255,.95)}

.hidden{display:none !important}

.square{
  width:min(980px, 96vw);
  max-height:calc(100vh - 120px);
  overflow:auto;
  padding:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  border-radius:var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.square::-webkit-scrollbar{height:10px;width:10px}
.square::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12); border-radius:999px}
.square__head{display:flex; align-items:flex-end; justify-content:space-between; gap:12px; padding-bottom:12px; border-bottom:1px solid var(--line)}
.square__title{font-size:22px;font-weight:900}
.square__sub{color:var(--muted); font-size:12px; margin-top:4px}
.square__tools{display:flex; gap:10px}
.square__meta{color:var(--muted); font-size:12px; padding:10px 2px}
.square__list{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
@media (max-width:760px){
  .square__list{grid-template-columns:1fr}
  .brand__title{font-size:22px}
}
.card{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  border-radius:16px;
  padding:12px 12px 10px;
}
.card__top{display:flex; align-items:center; justify-content:space-between; gap:12px}
.card__name{font-weight:900}
.card__time{color:var(--muted); font-size:12px}
.card__msg{margin-top:10px; line-height:1.35; font-size:14px; white-space:pre-wrap; word-break:break-word}
.card__emoji{opacity:.9}
.square__more{display:flex; justify-content:center; padding-top:14px}
.empty{
  grid-column: 1 / -1;
  text-align:center;
  padding:26px 10px;
  color:var(--muted);
  border:1px dashed rgba(255,255,255,.18);
  border-radius:16px;
  background:rgba(255,255,255,.03);
}

.gift{
  width:min(980px, 96vw);
  max-height:calc(100vh - 120px);
  overflow:auto;
  padding:18px 16px 16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  border-radius:var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.gift::-webkit-scrollbar{height:10px;width:10px}
.gift::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12); border-radius:999px}
.gift__head{padding-bottom:12px; border-bottom:1px solid var(--line)}
.gift__title{font-size:22px;font-weight:900}
.gift__sub{color:var(--muted); font-size:12px; margin-top:6px}
.gift__body{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap:14px;
  align-items:center;
  padding:16px 0 10px;
}
@media (max-width:820px){
  .gift__body{grid-template-columns:1fr}
}
.gift__actions{display:flex; gap:10px; justify-content:flex-end; padding-top:10px; border-top:1px solid var(--line)}

.giftbox{
  position:relative;
  width:260px;
  height:220px;
  border:none;
  background:transparent;
  cursor:pointer;
  margin: 8px auto;
  filter: drop-shadow(0 18px 38px rgba(0,0,0,.38));
  transform: translateZ(0);
}
.giftbox:focus-visible{outline: 2px solid rgba(255,255,255,.35); outline-offset: 6px; border-radius:18px}
.giftbox__box{
  position:absolute;
  left:22px; right:22px;
  bottom:18px;
  height:150px;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
}
.giftbox__lid{
  position:absolute;
  left:10px; right:10px;
  top:24px;
  height:64px;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
  border:1px solid rgba(255,255,255,.2);
  transform-origin: 22px 64px;
  transition: transform .55s cubic-bezier(.2,.9,.2,1), top .55s cubic-bezier(.2,.9,.2,1);
}
.giftbox__ribbon{
  position:absolute;
  left:50%;
  top:26px;
  bottom:20px;
  width:18px;
  transform:translateX(-50%);
  border-radius:999px;
  background:linear-gradient(180deg,#ffd166,#fbbf24);
  box-shadow: 0 16px 44px rgba(251,191,36,.18);
}
.giftbox__ribbon::before,
.giftbox__ribbon::after{
  content:"";
  position:absolute;
  top:-10px;
  width:60px;
  height:40px;
  border-radius:30px 30px 10px 10px;
  background:linear-gradient(180deg,#ffd166,#fbbf24);
}
.giftbox__ribbon::before{left:-60px; transform: rotate(-12deg)}
.giftbox__ribbon::after{right:-60px; transform: rotate(12deg)}

.giftbox--open .giftbox__lid{
  transform: rotate(-22deg) translateY(-12px);
  top:8px;
}

.giftcards{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
}
@media (max-width:820px){
  .giftcards{grid-template-columns:1fr}
}
.giftcard{
  border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  border-radius:18px;
  padding:12px;
  min-height:132px;
  position:relative;
  overflow:hidden;
  transform: translateY(8px);
  opacity:0;
  animation: gift-in .55s ease forwards;
}
.giftcard:nth-child(2){animation-delay:.08s}
.giftcard:nth-child(3){animation-delay:.16s}
.giftcard::before{
  content:"";
  position:absolute;
  inset:-60px -60px auto auto;
  width:140px; height:140px;
  background: radial-gradient(circle at 30% 30%, rgba(255,209,102,.22), transparent 60%);
  transform: rotate(22deg);
}
.giftcard__top{display:flex; align-items:center; justify-content:space-between; gap:10px}
.giftcard__name{font-weight:1000}
.giftcard__emoji{opacity:.95}
.giftcard__msg{margin-top:10px; line-height:1.35; font-size:14px; white-space:pre-wrap; word-break:break-word}
.giftcard__from{margin-top:10px; color:var(--muted); font-size:12px}
.giftcards--hint{
  color:var(--muted);
  font-size:12px;
  align-content:center;
}
@keyframes gift-in{
  from{transform:translateY(10px) scale(.98); opacity:0}
  to{transform:translateY(0) scale(1); opacity:1}
}

.modal{
  position:fixed; inset:0;
  z-index:50;
}
.modal__mask{
  position:absolute; inset:0;
  background:rgba(0,0,0,.5);
}
.modal__panel{
  position:absolute;
  left:50%; top:50%;
  transform:translate(-50%,-50%);
  width:min(520px, 92vw);
  border:1px solid rgba(255,255,255,.16);
  background:rgba(10,16,48,.82);
  border-radius:22px;
  padding:16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.modal__title{font-weight:1000; font-size:18px; margin-bottom:12px}

.form{display:grid; gap:12px}
.field{display:grid; gap:8px}
.field__label{font-size:12px; color:var(--muted); font-weight:800}
.field--small{max-width:240px}
.input{
  width:100%;
  color:var(--text);
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  border-radius:14px;
  padding:10px 12px;
  outline:none;
}
.input:focus{border-color:rgba(255,255,255,.28)}
.input--textarea{min-height:96px; resize:none}
.form__row{display:flex; align-items:flex-end; justify-content:space-between; gap:12px}
.counter{color:var(--muted); font-size:12px}
.form__actions{display:flex; justify-content:flex-end; gap:10px; padding-top:6px}
.toast{min-height:18px; color:rgba(255,255,255,.88); font-size:12px}

.modal__panel--welcome{
  width:min(560px, 92vw);
  background:
    radial-gradient(800px 260px at 20% 0%, rgba(255, 209, 102, .18), transparent 55%),
    radial-gradient(700px 240px at 100% 0%, rgba(34, 197, 94, .16), transparent 60%),
    rgba(10,16,48,.88);
  border-color: rgba(255, 209, 102, .22);
  box-shadow:
    0 18px 70px rgba(0,0,0,.45),
    0 0 0 1px rgba(255,255,255,.06) inset;
}
.modal__panel--welcome .modal__title{
  color:#ffd166;
  text-shadow:0 14px 40px rgba(0,0,0,.35);
}
.welcome__text{
  color:rgba(255,255,255,.96);
  line-height:1.5;
  font-weight:800;
  font-size:14px;
  padding:8px 2px 2px;
}
