/* Shared styles for FruityCloud subpages (news, vote, staff, admin) */
:root {
  --ink: #2a1446;
  --ink-soft: #5b4a75;
  --pink: #ff4f8b;
  --orange: #ff9a1f;
  --yellow: #ffd93b;
  --green: #47d16c;
  --blue: #2fb6ff;
  --purple: #a55cff;
  --card: #ffffff;
  --line: #eadcff;
  --radius: 22px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 15% 0%, #ffe3f3 0, transparent 40%),
    radial-gradient(circle at 85% 10%, #e3f4ff 0, transparent 40%),
    #fbf6ff;
}
a { color: var(--purple); }
h1, h2, h3, .display { font-family: 'Lilita One', 'Nunito', sans-serif; font-weight: 400; letter-spacing: .3px; }

/* ---------- header ---------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, #7fd3ff 0%, #b8e6ff 60%, #ffd6f0 100%);
  padding: 14px 20px 70px;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; left: 50%; top: 60%;
  width: 200vmax; height: 200vmax; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgba(255,255,255,.2) 0 9deg, transparent 9deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 30%);
          mask-image: radial-gradient(circle, #000 0, transparent 30%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 50px;
  background: #fbf6ff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 50' preserveAspectRatio='none'%3E%3Cpath d='M0 30 C240 0 480 0 720 25 S1200 50 1440 20 V50 H0Z'/%3E%3C/svg%3E") center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 50' preserveAspectRatio='none'%3E%3Cpath d='M0 30 C240 0 480 0 720 25 S1200 50 1440 20 V50 H0Z'/%3E%3C/svg%3E") center / 100% 100%;
}
.topbar {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.45);
  border: 2px solid rgba(255,255,255,.8);
  backdrop-filter: blur(6px);
  color: var(--ink); text-decoration: none; font-family: inherit;
  cursor: pointer; text-align: left;
  transition: transform .15s, background .15s;
}
.chip:hover { transform: translateY(-2px); background: rgba(255,255,255,.7); }
.chip .ico {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--ink); flex-shrink: 0;
}
.chip .ico svg { width: 20px; height: 20px; }
.chip b { display: block; font-weight: 900; font-size: 15px; }
.chip small { display: block; font-weight: 700; font-size: 12px; color: var(--ink-soft); }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 5px; vertical-align: 1px; }
.chip .dot.off { background: #aaa; }

.hero-logo { position: relative; z-index: 1; display: block; width: min(420px, 80vw); margin: 4px auto 0; }
.hero-logo img { width: 100%; display: block; filter: drop-shadow(0 6px 0 rgba(42,20,70,.12)); }

nav.mainnav {
  position: relative; z-index: 2;
  max-width: 1100px; margin: -40px auto 0;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
  padding: 8px;
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
  width: calc(100% - 32px);
}
nav.mainnav a {
  text-decoration: none; color: var(--ink);
  font-weight: 900; font-size: 15px;
  padding: 10px 16px; border-radius: 13px;
  transition: background .15s, color .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
nav.mainnav a:hover { background: #f4ebff; }
nav.mainnav a.active { background: var(--c, var(--purple)); color: #fff; }
nav.mainnav a svg { width: 13px; height: 13px; opacity: .6; }

.toast {
  position: fixed; top: 18px; left: 50%; transform: translate(-50%, -12px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-weight: 800; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #d6246a; }

/* ---------- content ---------- */
.wrap { max-width: 1100px; width: 100%; margin: 0 auto; padding: 36px 16px 60px; flex: 1; }
.card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--ink);
}
.page-title { text-align: center; font-size: clamp(32px, 5vw, 46px); margin-bottom: 6px; }
.page-sub { text-align: center; color: var(--ink-soft); font-weight: 700; max-width: 620px; margin: 0 auto 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 900 15px 'Nunito', sans-serif;
  padding: 11px 20px; border-radius: 14px;
  border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  background: var(--yellow); color: var(--ink);
  text-decoration: none; cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.pink { background: var(--pink); color: #fff; }
.btn.green { background: var(--green); }
.btn.blue { background: var(--blue); color: #fff; }
.btn.white { background: #fff; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }

label { display: block; font-weight: 900; font-size: 14px; margin-bottom: 6px; }
input, textarea, select {
  width: 100%; font: 700 15px 'Nunito', sans-serif; color: var(--ink);
  padding: 11px 13px; border-radius: 12px;
  border: 2.5px solid #d9c8f5; background: #fdfbff;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--purple); }
textarea { resize: vertical; min-height: 110px; }
.field { margin-bottom: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.empty { text-align: center; color: var(--ink-soft); font-weight: 800; padding: 40px 10px; }

/* rich text in posts */
.prose { font-size: 17px; line-height: 1.7; font-weight: 600; }
.prose > * + * { margin-top: 14px; }
.prose h1, .prose h2, .prose h3 { line-height: 1.2; margin-top: 26px; }
.prose h1 { font-size: 30px; } .prose h2 { font-size: 25px; } .prose h3 { font-size: 21px; }
.prose ul { padding-left: 24px; }
.prose li + li { margin-top: 4px; }
.prose img { max-width: 100%; border-radius: 14px; }

/* ---------- footer ---------- */
footer.site {
  background: var(--ink); color: #e9dcff;
  padding: 34px 20px 26px;
  font-weight: 700; font-size: 14px;
}
footer.site .cols {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px;
}
footer.site h4 { font-family: 'Lilita One', sans-serif; font-weight: 400; font-size: 19px; color: #fff; margin-bottom: 8px; }
footer.site a { color: #e9dcff; text-decoration: none; display: block; margin: 4px 0; }
footer.site a:hover { color: var(--yellow); }
footer.site .copy { max-width: 1100px; margin: 24px auto 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.15); font-size: 12px; opacity: .75; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
  .chip small { display: none; }
  .chip { padding: 6px 10px 6px 6px; }
  .chip b { font-size: 13px; }
  nav.mainnav a { padding: 8px 11px; font-size: 14px; }
}

/* =====================================================================
   Motion + texture layer
   ===================================================================== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .25s ease both; }
::view-transition-new(root) { animation: vtIn .4s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(14px); } }

:root {
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
html { scroll-behavior: smooth; }

/* paper grain over the whole page */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 999;
  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 0.16 0 0 0 0 0.08 0 0 0 0 0.27 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .09; mix-blend-mode: multiply;
}
/* soft polka dots behind content */
body {
  background-image:
    radial-gradient(circle at 15% 0%, #ffe3f3 0, transparent 40%),
    radial-gradient(circle at 85% 10%, #e3f4ff 0, transparent 40%),
    radial-gradient(rgba(165, 92, 255, .09) 1.6px, transparent 1.8px);
  background-size: auto, auto, 26px 26px;
}

/* hero: drifting clouds + sparkles (added by common.js) */
.hero .hcloud { position: absolute; z-index: 0; width: var(--w); opacity: .9; animation: hdrift var(--d) linear infinite; animation-delay: var(--dl); pointer-events: none; }
.hero .hcloud svg { width: 100%; display: block; filter: drop-shadow(0 5px 0 rgba(140, 100, 220, .14)); }
@keyframes hdrift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
.hero::before { animation: heroSpin 160s linear infinite; }
@keyframes heroSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.hero-logo img { animation: heroBob 5s ease-in-out infinite; }
@keyframes heroBob { 0%,100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-6px) rotate(-.8deg); } 70% { transform: translateY(-2px) rotate(.6deg); } }
.hero-logo { transition: transform .5s var(--ease-spring); }
.hero-logo:hover { transform: scale(1.04) rotate(-1deg); }
.topbar .chip { animation: chipIn .7s var(--ease-spring) both; }
.topbar .chip + .chip { animation-delay: .08s; }
@keyframes chipIn { from { opacity: 0; transform: translateY(-20px); } }
.chip { transition: transform .4s var(--ease-spring), background .2s; }
.chip:hover { transform: translateY(-3px) scale(1.03); }
.chip:active { transform: scale(.96); transition-duration: .1s; }

/* nav with sliding pill */
nav.mainnav { animation: navIn .7s var(--ease-spring) .1s both; }
@keyframes navIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
nav.mainnav .pill {
  position: absolute; z-index: 0; top: 0; left: 0; height: 0; border-radius: 13px;
  background: var(--pc, #f4ebff);
  transition: transform .45s var(--ease-spring), width .45s var(--ease-spring), height .3s, background .3s;
  pointer-events: none;
}
nav.mainnav a { position: relative; z-index: 1; transition: color .25s; }
nav.mainnav.has-pill a.active { background: transparent; }
nav.mainnav.has-pill a:hover { background: transparent; }
nav.mainnav.has-pill a.active:not(.lit) { color: var(--ink); }
nav.mainnav a.lit { color: #fff; }

/* cards: springy lift + scroll reveal */
.card { transition: transform .45s var(--ease-spring), box-shadow .3s var(--ease-out); }
a.card:hover, .card.lift:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 12px 0 var(--ink); }
a.card:active, .card.lift:active { transform: translateY(2px); box-shadow: 0 3px 0 var(--ink); transition-duration: .1s; }
.reveal { opacity: 0; transform: translateY(28px) scale(.98); }
.reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--ease-out), transform .7s var(--ease-spring); transition-delay: var(--rd, 0s); }
.page-title { animation: titleIn .8s var(--ease-spring) .15s both; }
.page-sub { animation: titleIn .8s var(--ease-spring) .22s both; }
@keyframes titleIn { from { opacity: 0; transform: translateY(18px) scale(.95); } }

/* buttons: squishy */
.btn { transition: transform .35s var(--ease-spring), box-shadow .2s var(--ease-out), background .2s, color .2s; }
.btn:hover { transform: translateY(-3px) scale(1.02); }
.btn:active { transform: translateY(3px) scale(.97); transition-duration: .08s; }

/* inputs */
input, textarea, select { transition: border-color .2s, box-shadow .25s var(--ease-out), transform .3s var(--ease-spring); }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 4px rgba(165, 92, 255, .18); }

/* toast spring */
.toast { transition: opacity .25s, transform .45s var(--ease-spring); transform: translate(-50%, -16px) scale(.9); }
.toast.show { transform: translate(-50%, 0) scale(1); }

/* card texture: tiny dotted sheen in the top corner */
.card { background-image: radial-gradient(rgba(165, 92, 255, .07) 1.2px, transparent 1.4px); background-size: 14px 14px; background-color: var(--card); }

/* emoji wiggle */
.wiggle { display: inline-block; transition: transform .5s var(--ease-spring); }
.card:hover .wiggle { transform: rotate(-12deg) scale(1.2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* =====================================================================
   Load polish
   ===================================================================== */
/* Shorter, softer page-to-page crossfade */
::view-transition-old(root) { animation: vtOut .22s ease both; }
::view-transition-new(root) { animation: vtIn .32s ease both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; } }

/* Keep room for the header on a first visit, so nothing jumps when it arrives */
#site-header:empty { min-height: 300px; background: linear-gradient(180deg, #7fd3ff 0%, #b8e6ff 60%, #ffd6f0 100%); }
.hero-logo img { height: auto; }

/* Header entrance, in order: logo -> chips -> nav -> title -> subtitle */
.hero-logo { animation: heroLogoIn .9s var(--ease-spring) backwards; }
@keyframes heroLogoIn { from { opacity: 0; transform: translateY(18px) scale(.82); filter: blur(4px); } }
.topbar .chip { animation: chipIn .7s var(--ease-spring) .12s backwards; }
.topbar .chip + .chip { animation-delay: .2s; }
nav.mainnav { animation: navIn .75s var(--ease-spring) .18s backwards; }
.page-title { animation: titleIn .8s var(--ease-spring) .26s backwards; }
.page-sub { animation: titleIn .8s var(--ease-spring) .34s backwards; }
@keyframes titleIn { from { opacity: 0; transform: translateY(16px) scale(.96); filter: blur(3px); } }
.hero .hcloud { animation: hdrift var(--d) linear infinite, cloudFade 1.2s ease .2s backwards; animation-delay: var(--dl), .2s; }
@keyframes cloudFade { from { opacity: 0; } }

/* Softer scroll reveal: rise + un-blur */
.reveal { opacity: 0; transform: translateY(26px) scale(.98); filter: blur(4px); }
.reveal.in {
  opacity: 1; transform: none; filter: none;
  transition: opacity .55s var(--ease-out), transform .75s var(--ease-spring), filter .55s var(--ease-out);
  transition-delay: var(--rd, 0s);
}

/* Skeleton placeholders (only seen if the network is slow) */
.skel { position: relative; overflow: hidden; background: #efe6fb; border-radius: 12px; }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.skel-line { height: 14px; }
.skel-line.w60 { width: 60%; } .skel-line.w80 { width: 80%; } .skel-line.w40 { width: 40%; }
.skel-cover { aspect-ratio: 16 / 7; border-radius: 0; border-bottom: 3px solid var(--ink); }

/* News covers and avatars ease in */
.cover { position: relative; }
.cover img.fade { transition: opacity .6s ease, transform 1s var(--ease-out); transform: scale(1.06); }
.cover img.fade.loaded { transform: none; }
