@font-face {
  font-family: 'Pirata One';
  src: url('/static/fx/pirata-one.woff2') format('woff2');
  font-display: swap;
}

:root {
  --ink: #030305;
  --lav: #ff1f4b;
  --lav-deep: #8c0f28;
  --gold: #ffc2cf;
  --ice: #ffffff;
  --rose: #ff5c7c;
  --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'DejaVu Sans Mono', Menlo, Consolas, monospace;
}

html { background: var(--ink); scrollbar-color: var(--lav-deep) transparent; }
body, body.anonymous-message { background: transparent; }

#scene {
  position: fixed;
  inset: -4%;
  z-index: -1;
  overflow: hidden;
  will-change: transform;
}
#scene, #scene * { transition: none; }
#sceneImg {
  position: absolute;
  inset: 0;
  background: url('/static/fx/background.webp') no-repeat center center;
  background-size: cover;
}
#scene #sceneRift { transition: opacity .3s ease; }
#sceneRift, #sceneCanvas, #sceneTint { position: absolute; inset: 0; width: 100%; height: 100%; }
#sceneTint { pointer-events: none; }


.introLayer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 100001;
  transition: none;
}
#introStage { z-index: 100002; cursor: crosshair; }

html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
section.home, header, footer { -webkit-user-select: none; user-select: none; }
#term, #term * { -webkit-user-select: text; user-select: text; }

#holeTop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9700;
  pointer-events: none;
  transition: none;
}
#voidScreen {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #000;
  cursor: pointer;
  touch-action: manipulation;
  transition: none;
}
#voidText {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92%;
  color: #fff;
  font: 400 clamp(2.8rem, 12vw, 6.5rem)/1.05 'Pirata One', Georgia, serif;
  text-align: center;
  text-shadow: 3px 0 0 rgba(255, 16, 56, .85), -3px 0 0 rgba(30, 90, 255, .75), 0 0 34px rgba(255, 31, 75, .7);
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: none;
}
#galaxy { position: absolute; inset: 0; width: 100%; height: 100%; transition: none; }
html.fx-eaten .blur {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
html.fx-eaten .blur::after { opacity: 0; }

#fxTop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9000;
  transition: none;
}

body.anonymous-message #loader { display: none; }
html.fx-loading body.anonymous-message main,
html.fx-loading body.anonymous-message header { opacity: 1; transform: none; }
#loader .loader-core { animation: loaderLogoIn .3s .6s both; }
@keyframes loaderLogoIn { from { opacity: 0; } }
#loader .loader-logo { width: 170px; height: 170px; animation: logoPulse 1.8s ease-in-out infinite; transition: none; }
#loader .loader-ring {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--lav);
  border-right-color: var(--gold);
  animation: ringSpin 1.3s linear infinite;
  transition: none;
}
body.anonymous-message #loader { display: none; }
html.fx-loading body.anonymous-message main,
html.fx-loading body.anonymous-message header { opacity: 1; transform: none; }
#loader .loader-core { position: relative; display: flex; align-items: center; justify-content: center; width: 240px; height: 240px; }
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255,31,75,.45)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 26px rgba(255,31,75,.95)); transform: scale(1.04); }
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

html.fx-loading .blur,
html.fx-loading .anonymous-message main,
html.fx-loading header { opacity: 0; transform: translateY(26px) scale(.97); }

.blur {
  position: relative;
  transition: opacity .9s ease, box-shadow .4s ease;
  background: rgba(6, 6, 9, .52);
  border: 1px solid rgba(255, 31, 75, .16);
  box-shadow: 0 0 60px -8px rgba(0, 0, 0, .8), 0 0 40px -18px rgba(255, 31, 75, .55);
}
.tilt { will-change: transform; transition: none; }
.blur::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .11), transparent 65%);
  opacity: var(--sheen, 0);
}

.pfp-wrap { display: block; width: fit-content; margin: 34px auto 44px; }
.pfp-wrap .tooltiptext {
  bottom: -16px;
  z-index: 5;
  width: max-content;
  max-width: min(84vw, 360px);
  padding: 6px 12px;
  border: 1px solid rgba(255, 31, 75, .6);
  background: rgba(6, 6, 9, .92);
  box-shadow: 0 0 18px -6px var(--lav);
  font-size: 14px;
  line-height: 1.3;
}
.pfp-sigil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200px;
  height: auto;
  max-width: none;
  margin: -100px 0 0 -100px;
  opacity: .8;
  filter: drop-shadow(2px 0 0 rgba(255, 16, 56, .8)) drop-shadow(-2px 0 0 rgba(30, 90, 255, .6)) drop-shadow(0 0 12px rgba(255, 31, 75, .6));
  animation: sigilTurn 40s linear infinite;
  transition: none;
  pointer-events: none;
}
@keyframes sigilTurn { to { transform: rotate(360deg); } }
.pfp {
  position: relative;
  margin: 0 auto;
  border: 2px solid #fff;
  box-shadow: 0 0 26px rgba(255, 31, 75, .55);
  animation: pfpBreath 5s ease-in-out infinite;
}
@keyframes pfpBreath {
  0%, 100% { box-shadow: 0 0 18px rgba(255, 31, 75, .35); }
  50% { box-shadow: 0 0 40px rgba(255, 31, 75, .8); }
}

section.home { display: flex; justify-content: center; width: 100%; }

.username {
  position: relative;
  display: block;
  width: fit-content;
  margin: 0 auto 10px;
  font-family: 'Pirata One', 'KingSlayer', Georgia, serif;
  font-size: clamp(2.6rem, 11vw, 4.1rem);
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.1;
  color: transparent;
  background: url('/static/fx/static.png') 0 0 / 96px;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(1.5px 0 0 rgba(255, 16, 56, .85)) drop-shadow(-1.5px 0 0 rgba(30, 90, 255, .7)) drop-shadow(0 0 12px rgba(255, 31, 75, .45));
  animation: nameStatic .5s steps(1) infinite;
  transition: none;
}
@keyframes nameStatic {
  0% { background-position: 0 0; }
  20% { background-position: -37px 23px; }
  40% { background-position: 51px -41px; }
  60% { background-position: -13px 67px; }
  80% { background-position: 29px -11px; }
}
.username::before, .username::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.username::before { color: #ff1038; }
.username::after { color: #10ff60; }
.username.glitch::before { opacity: .85; animation: glitchA .42s steps(2) both; }
.username.glitch::after { opacity: .85; animation: glitchB .42s steps(2) both; }
@keyframes glitchA {
  0% { clip-path: inset(10% 0 70% 0); transform: translate(-4px, 0); }
  35% { clip-path: inset(55% 0 20% 0); transform: translate(5px, 1px); }
  70% { clip-path: inset(30% 0 45% 0); transform: translate(-3px, -1px); }
  100% { clip-path: inset(80% 0 5% 0); transform: translate(2px, 0); }
}
@keyframes glitchB {
  0% { clip-path: inset(65% 0 12% 0); transform: translate(4px, 0); }
  35% { clip-path: inset(15% 0 60% 0); transform: translate(-5px, -1px); }
  70% { clip-path: inset(45% 0 30% 0); transform: translate(3px, 1px); }
  100% { clip-path: inset(5% 0 80% 0); transform: translate(-2px, 0); }
}

.userrole { display: inline-block; color: #d9d6dc; letter-spacing: .12em; cursor: default; user-select: none; }
.bio-text { display: block; min-height: 1.5em; animation: none; color: #f1f1f1d9; }
.bio-text .caret {
  display: inline-block;
  width: .55em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -.12em;
  background: var(--lav);
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.social-icons:hover { filter: brightness(0) invert(1) drop-shadow(0 0 8px var(--lav)); }
#disc { cursor: pointer; }

#playlist {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  width: 90%;
  height: 92px;
  margin: 14px auto 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 12px;
  background: #050507;
  color: #fff;
  cursor: pointer;
}
#playlist::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/static/fx/static.png') 0 0 / 96px;
  opacity: .16;
  animation: nameStatic .5s steps(1) infinite;
}
#playlist:hover { border-color: var(--lav); box-shadow: 0 0 26px -6px var(--lav); }
#playlist:hover::before { opacity: .34; }
.playlist-title { position: relative; font: 400 26px/1 'Pirata One', Georgia, serif; }
.playlist-sub { position: relative; color: #ffc2cf; font: 12px var(--mono); letter-spacing: .28em; text-transform: uppercase; }

.sendmsgbutton {
  position: relative;
  display: inline-block;
  overflow: hidden;
  margin-top: 22px;
  padding: 13px 30px;
  border: 1px solid rgba(255, 31, 75, .55);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(140, 15, 40, .55), rgba(8, 8, 12, .85));
  color: #fff;
  font: 600 15px/1 Arial, sans-serif;
  letter-spacing: .05em;
  cursor: pointer;
  box-shadow: 0 0 22px -6px var(--lav);
}
.sendmsgbutton::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .4), transparent);
  transform: skewX(-20deg);
  animation: btnSweep 4.5s ease-in-out infinite;
}
@keyframes btnSweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.sendmsgbutton:hover { transform: translateY(-2px); box-shadow: 0 0 34px -4px var(--lav); border-color: var(--gold); }

footer { background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); color: #d8d4ea; }

#replayIntro {
  position: fixed;
  right: 16px;
  bottom: 50px;
  z-index: 20;
  width: 46px;
  height: 46px;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 6, 9, .6);
  cursor: pointer;
  box-shadow: 0 0 16px -4px var(--lav);
}
#replayIntro img {
  display: block;
  width: 100%;
  height: 100%;
  animation: sigilTurn 14s linear infinite;
  transition: none;
}
#replayIntro:hover { box-shadow: 0 0 24px 0 var(--lav); transform: scale(1.12); }

#term {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9500;
  display: none;
  flex-direction: column;
  width: min(760px, calc(100vw - 24px));
  height: min(470px, calc(100dvh - 90px));
  overflow: hidden;
  border: 1px solid rgba(255, 31, 75, .4);
  border-radius: 10px;
  background: rgba(6, 6, 18, .93);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .75), 0 0 40px -12px var(--lav);
  color: #f1eff3;
  font: 14px/1.5 var(--mono);
  text-align: left;
  transform: translate(-50%, -50%);
}
#term, #term * { transition: none; }
#term.on { display: flex; animation: termIn .22s ease-out; }
@keyframes termIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
#termBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(255, 31, 75, .1);
  color: var(--lav);
  font-size: 12px;
}
#termClose { padding: 0 6px; border: 0; background: none; color: var(--lav); font: 16px var(--mono); cursor: pointer; }
#termOut { scrollbar-color: var(--lav-deep) transparent; flex: 1; overflow: auto; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
#termOut .banner { display: block; overflow-x: auto; color: var(--lav); font-size: 7px; line-height: 1.15; white-space: pre; overflow-wrap: normal; }
#termOut .cmd { color: var(--gold); }
#termOut .err { color: var(--rose); }
#termRow { display: flex; gap: 8px; align-items: center; padding: 8px 12px 12px; }
#termRow span { color: var(--gold); white-space: nowrap; }
#termIn {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: #fff;
  font: 16px var(--mono);
}

.anonymous-message main {
  position: relative;
  background: rgba(6, 6, 9, .62);
  border: 1px solid rgba(255, 31, 75, .18);
  backdrop-filter: blur(9px);
  box-shadow: 0 0 60px -8px rgba(0, 0, 0, .8), 0 0 40px -18px rgba(255, 31, 75, .55);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .8, .2, 1);
  margin-bottom: 40px;
}
.anonymous-message h1 {
  font-family: 'Pirata One', Georgia, serif;
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 400;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 31, 75, .6);
}
.seal-wrap { position: relative; }
.anonymous-message textarea {
  display: block;
  height: 190px;
  border: 1px solid rgba(255, 31, 75, .3);
  background: rgba(3, 3, 6, .72);
  color: #f7f6f8;
  resize: vertical;
}
.anonymous-message textarea::placeholder { color: #99969f; }
.anonymous-message textarea:focus { padding: 10px; border: 1px solid var(--lav); box-shadow: 0 0 20px -6px var(--lav); }
.anonymous-message button {
  background: linear-gradient(135deg, var(--lav-deep), #3a0612);
  box-shadow: 0 0 20px -8px var(--lav);
}
.anonymous-message button:hover { background: linear-gradient(135deg, var(--lav), var(--lav-deep)); }
.anonymous-message button:disabled { opacity: .55; cursor: wait; }
.anonymous-message a > button { background: rgba(255, 255, 255, .08); box-shadow: none; }
#cipherView {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--lav);
  border-radius: 5px;
  background: rgba(3, 3, 6, .96);
  color: var(--lav);
  font: 14px/1.45 var(--mono);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
  transform-origin: center;
  transition: none;
}
#cipherView.on { display: block; }
#cipherView .done { color: var(--gold); }
#cipherView.fold { animation: foldUp .55s cubic-bezier(.6, 0, .4, 1) forwards; }
@keyframes foldUp {
  to { opacity: 0; transform: scale(.14, .1); border-radius: 12px; }
}
#envelope {
  position: absolute;
  left: 50%;
  top: 50%;
  display: none;
  width: 104px;
  height: 74px;
  margin: -37px 0 0 -52px;
  filter: drop-shadow(0 0 16px var(--lav));
  transition: none;
}
#envelope.on { display: block; animation: envIn .35s ease-out both; }
#envelope.fly { animation: envFly 1s cubic-bezier(.5, 0, .75, .3) forwards; }
#envelope .flap { transform-origin: 50% 0; transform: rotateX(180deg); animation: flapShut .3s .22s ease-in forwards; transition: none; }
@keyframes envIn { from { opacity: 0; transform: scale(.4); } }
@keyframes flapShut { to { transform: rotateX(0deg); } }
@keyframes envFly {
  0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  25% { transform: translate(-14px, 16px) rotate(-7deg) scale(1.05); opacity: 1; }
  100% { transform: translate(var(--fly-x, 0), var(--fly-y, 0)) rotate(24deg) scale(.16); opacity: 0; }
}
#sendStatus { min-height: 1.5em; margin-top: 14px; color: var(--gold); font: 14px var(--mono); }
#sendStatus.err { color: var(--rose); }
.shake { animation: shake .36s linear; }
@keyframes shake {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

@media (max-width: 600px) {
  .blur { background: rgba(6, 6, 9, .6); border: 0; border-radius: 0; }
  .pfp-sigil { width: 178px; margin: -89px 0 0 -89px; }
  #termOut .banner { font-size: 4.5px; }
}

@media (max-height: 860px) {
  html, body { height: auto; min-height: 100%; }
  body:not(.anonymous-message) { justify-content: safe center; padding: 18px 0 58px; }
}

@media (max-width: 600px) {
  html, body { height: auto; min-height: 100%; }
  body { justify-content: safe center; padding: 18px 0 58px; }
  .blur {
    width: calc(100% - 28px);
    min-width: 0;
    min-height: 0;
    max-width: 460px;
    padding: 8px 16px 22px;
    border: 1px solid rgba(255, 31, 75, .22);
    border-radius: 16px;
  }
  .pfp-wrap { margin: 40px auto 42px; }
  .sendmsgbutton { margin-bottom: 4px; }
  #kirbyPeek {
    top: 8vh !important;
    width: auto !important;
    height: 92vh !important;
    max-width: none;
  }
}

@media (pointer: coarse), (max-width: 600px) {
  .blur, footer, .anonymous-message main { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .blur { background: rgba(6, 6, 9, .74); }
  .anonymous-message main { background: rgba(6, 6, 9, .84); }
  footer { background: rgba(0, 0, 0, .72); }
  .pfp { animation: none; box-shadow: 0 0 22px rgba(255, 31, 75, .55); }
  .pfp-sigil { filter: none; }
  .username { filter: drop-shadow(0 0 6px rgba(255, 31, 75, .5)); }
  .bio-text { min-height: 3em; }
  #replayIntro { bottom: 46px; right: 10px; width: 40px; height: 40px; }
}
