* {
  margin: 0;
  padding: 0;
}

[hidden] { display: none !important; }

body { background: #0b1020; }
body.site-locked { overflow: hidden; }

.site-locked #castle {
  pointer-events: none;
}

:is(.site-locked, .scene-paused) #castle *,
:is(.site-locked, .scene-paused) #castle *::before,
:is(.site-locked, .scene-paused) #castle *::after,
:is(.site-locked, .scene-paused) #castle::before,
:is(.site-locked, .scene-paused) #castle::after {
  animation-play-state: paused !important;
}

.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #080b1826;
  -webkit-backdrop-filter: blur(16px) brightness(0.65);
  backdrop-filter: blur(16px) brightness(0.65);
  transition: opacity 0.55s ease;
}

.site-entering .entry-gate {
  opacity: 0;
  pointer-events: none;
}

.enter-button {
  position: relative;
  padding: 21px 58px;
  border: 1px solid #f4c7f1a6;
  border-radius: 999px;
  background: linear-gradient(120deg, #422c55ed, #172d48ed);
  color: #fff1fb;
  font: 600 clamp(22px, 5vw, 28px)/1.2 "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.08em;
  box-shadow: 0 0 24px #e58bd33b, 0 0 80px #8c99ed26, inset 0 0 18px #e8adff14;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.enter-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 35px #e58bd366, 0 0 100px #8c99ed3b;
}

.enter-button:focus-visible,
.music-toggle:focus-visible {
  outline: 2px solid #a4e8ff;
  outline-offset: 6px;
}

.music-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 5;
  padding: 9px 15px;
  border: 1px solid #c6b4df50;
  border-radius: 999px;
  background: #111629dc;
  color: #e7d8f5;
  font: 500 12px/1.4 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.music-status {
  position: fixed;
  top: 60px;
  right: 16px;
  left: 16px;
  z-index: 5;
  color: #f5d9ea;
  text-align: right;
  font: 13px/1.5 "Segoe UI", Arial, sans-serif;
}

.music-status:empty { display: none; }

.star-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.star-layer {
  position: absolute;
  inset: 0;
  animation: star-twinkle var(--duration) ease-in-out var(--delay) infinite alternate;
  will-change: opacity;
}

.star {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: #e9e4ff;
  box-shadow: 0 0 7px #d3b5ff90;
}

.star:nth-child(3n) { background: #b3eaff; }
.star:nth-child(5n) { background: #ffd0e8; }

.star:nth-child(17n)::before,
.star:nth-child(17n)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 9px;
  background: linear-gradient(transparent, #fff9, transparent);
  transform: translate(-50%, -50%);
}

.star:nth-child(17n)::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

@keyframes star-twinkle {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.hover-animation {
  animation: hover 1.75s ease-in-out infinite;
  will-change: transform;
}

#castle {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vh, 32px);
  min-height: 100vh;
  min-height: 100svh;
  box-sizing: border-box;
  padding: clamp(24px, 4vh, 48px) 20px 24px;
  background:
    radial-gradient(ellipse at 18% 30%, #39214c80, transparent 48%),
    radial-gradient(ellipse at 85% 65%, #0b464e70, transparent 48%),
    radial-gradient(ellipse at 50% 95%, #4e244250, transparent 50%),
    linear-gradient(155deg, #100e20, #070e1c 55%, #0e1021);
  overflow: hidden;
}

#castle::before,
#castle::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

#castle::before {
  inset: -10%;
  background:
    radial-gradient(ellipse at 30% 40%, #b74e9d24, transparent 35%),
    radial-gradient(ellipse at 65% 55%, #58c7d724, transparent 38%);
  animation: aurora-drift 18s ease-in-out infinite alternate;
}

#castle::after {
  background-image:
    radial-gradient(circle, #fff9 0.7px, transparent 1.3px),
    radial-gradient(circle, #b4dfff70 0.8px, transparent 1.5px),
    radial-gradient(circle, #ffb8db60 1px, transparent 1.6px);
  background-size: 113px 137px, 197px 181px, 277px 227px;
  background-position: 23px 47px, 109px 83px, 51px 163px;
  opacity: 0.55;
  mask-image: linear-gradient(#000, #0008 70%, transparent);
}

.led-name {
  position: relative;
  display: flex;
  gap: 0.075em;
  margin: 0;
  padding: 0 0 18px;
  font-family: "Arial Black", "Segoe UI", Arial, sans-serif;
  font-size: clamp(72px, 17vw, 152px);
  font-weight: 900;
  line-height: 1.15;
  user-select: none;
}

.led-name::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ff92cc70, #83ddff70, transparent);
  box-shadow: 0 4px 24px #bf7fff40;
}

.led-name span {
  display: block;
  color: var(--led);
  background-color: color-mix(in srgb, var(--led) 22%, transparent);
  background-image: radial-gradient(circle, #fff 0 0.7px, var(--led) 1px 1.8px, transparent 2.4px);
  background-size: 6px 6px;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 5px var(--led)) drop-shadow(0 0 22px color-mix(in srgb, var(--led) 45%, transparent));
  animation: led-breathe 5s ease-in-out infinite alternate;
  will-change: opacity;
}

.led-name span:nth-child(2) { animation-delay: -1.2s; }
.led-name span:nth-child(3) { animation-delay: -2.4s; }
.led-name span:nth-child(4) { animation-delay: -3.6s; }

.flower-scene {
  position: relative;
  flex: 0 0 440px;
  width: min(100%, 560px);
  height: 440px;
}

.flower-scene::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 355px;
  width: min(100%, 480px);
  height: 100px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, #ce73be30, #6c9ee314 45%, transparent 70%);
  filter: blur(14px);
}

#castle #table {
  position: absolute;
  left: calc(50% - 200px);
  top: 160px;
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse at 45% 40%, #bb8caa, #865d86 58%, #564364);
  border-radius: 100%;
  border-bottom: 80px solid #32283f;
  box-shadow: 0 -4px 0 #e5b2d080, 0 12px 45px #e590d332;
  transform: scaleY(0.225);
}

#castle .shade-wrap {
  position: absolute;
  left: calc(50% - 100px);
  top: 0;
  width: 200px;
  height: 400px;
}

#castle .shade-wrap #shade-main {
  position: absolute;
  left: 20px;
  top: 100px;
  width: 160px;
  height: 300px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-left: 1px solid rgba(255, 255, 255, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  border-top-left-radius: 50% 30%;
  border-top-right-radius: 50% 30%;
  border-bottom: none;
  transform: perspective(200px) rotateX(8deg) scale(1.075, 1);
}

#castle .shade-wrap #shade-main #shade-handle-big {
  position: absolute;
  left: 55px;
  top: -14px;
  width: 50px;
  height: 30px;
  border-radius: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  transform: scaleY(0.9);
}

#castle .shade-wrap #shade-main #shade-handle-small {
  position: absolute;
  left: 70px;
  top: -33px;
  width: 20px;
  height: 20px;
  border-radius: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: none;
}

#castle .shade-wrap #shade-main #bottom-shade {
  position: absolute;
  bottom: -20px;
  width: 100%;
  height: 40px;
  transform: scaleY(0.5);
  border-radius: 100%;
  background: radial-gradient(#d287a5, #da9db6, #985e74);
  animation: floatAnimate 1.75s ease-in-out infinite;
  will-change: opacity;
}

#castle .shade-wrap #shade-main-reflections {
  position: relative;
  left: 20px;
  top: 100px;
  width: 160px;
  height: 300px;
  border-top-left-radius: 50% 30%;
  border-top-right-radius: 50% 30%;
  border-bottom: none;
  background-color: #6d6179;
  transform: perspective(200px) rotateX(8deg) scale(1.075, 1);
  opacity: 0.15;
}

#castle .shade-wrap #shade-main-reflections:after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-top-right-radius: 50% 30%;
  border-right: 20px solid rgba(255, 255, 255, 0.5);
  transform: scale(0.7, 0.85);
  filter: blur(5px);
}

#castle .shade-wrap #shade-main-reflections:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-top-left-radius: 50% 30%;
  border-left: 8px solid rgba(255, 255, 255, 0.6);
  transform: scale(0.85, 0.85);
  filter: blur(5px);
}

#castle .shade-wrap #flower-wrap {
  position: relative;
  top: -50px;
}

#castle .shade-wrap #flower-wrap #stem {
  position: absolute;
  left: 82px;
  top: 187px;
  width: 100px;
  height: 150px;
  background-color: transparent;
  border: solid 4px #a1b965;
  border-color: transparent transparent transparent #a1b965;
  border-radius: 50%/120px 100px 0 0;
  transform: rotate(-3deg) scale(1.1, 0.9);
}

#castle .shade-wrap #flower-wrap #petal1 {
  position: absolute;
  left: 97px;
  top: 188px;
  width: 25px;
  height: 25px;
  border-top-left-radius: 50% 10%;
  border-top-right-radius: 50% 10%;
  border-bottom-left-radius: 50% 40%;
  border-bottom-right-radius: 50% 40%;
  background-color: #c82b60;
  box-shadow: 1px -1px 1px 0 #6f1232;
  transform: rotate(32deg) scale(1.6, 1.6);
}

#castle .shade-wrap #flower-wrap #petal1:before {
  content: "";
  position: absolute;
  height: 100%;
  width: 100%;
  border-top-left-radius: 50% 10%;
  border-top-right-radius: 50% 10%;
  border-bottom-left-radius: 50% 40%;
  border-bottom-right-radius: 50% 40%;
  background-color: transparent;
  box-shadow: 0 0 10px 0 #e8b2ca;
  opacity: 0.9;
}

#castle .shade-wrap #flower-wrap #petal1:after {
  content: "";
  position: absolute;
  height: 100%;
  width: 100%;
  border-top-left-radius: 50% 10%;
  border-top-right-radius: 50% 10%;
  border-bottom-left-radius: 50% 40%;
  border-bottom-right-radius: 50% 40%;
  background-color: transparent;
  box-shadow: 0 0 45px 0 #e8b2ca;
  animation: glow 3s ease-in-out infinite;
  will-change: transform, opacity;
}

#castle .shade-wrap #flower-wrap #petal2 {
  position: absolute;
  left: 85px;
  top: 185px;
  width: 25px;
  height: 30px;
  border-top-left-radius: 50% 10%;
  border-top-right-radius: 50% 50%;
  border-bottom-left-radius: 50% 50%;
  border-bottom-right-radius: 50% 10%;
  background-color: #d05478;
  transform: rotate(35deg) scale(1.2, 1);
  box-shadow: 1px -1px 1px 0 #6f1232;
  opacity: 0.9;
}

#castle .shade-wrap #flower-wrap #petal3 {
  position: absolute;
  left: 105px;
  top: 197px;
  width: 25px;
  height: 28px;
  border-top-left-radius: 50% 50%;
  border-top-right-radius: 10% 10%;
  border-bottom-left-radius: 10% 10%;
  border-bottom-right-radius: 50% 50%;
  background-color: #cb5275;
  transform: rotate(25deg) scale(1, 1.05) skew(-8deg);
  box-shadow: 1px -1px 1px 0 #6f1232;
  opacity: 0.9;
}

#castle .shade-wrap #flower-wrap #petal4 {
  position: absolute;
  left: 80px;
  top: 191px;
  width: 25px;
  height: 25px;
  border-top-left-radius: 50% 10%;
  border-top-right-radius: 50% 50%;
  border-bottom-left-radius: 50% 50%;
  border-bottom-right-radius: 50% 10%;
  background-color: #d26484;
  transform: rotate(30deg) scale(1.1, 0.9) skew(10deg);
  box-shadow: 1px -1px 1px 0 #a53d60;
  opacity: 0.9;
}

#castle .shade-wrap #flower-wrap #petal5 {
  position: absolute;
  left: 105px;
  top: 207px;
  width: 25px;
  height: 20px;
  border-top-left-radius: 50% 50%;
  border-top-right-radius: 10% 10%;
  border-bottom-left-radius: 10% 10%;
  border-bottom-right-radius: 50% 50%;
  background-color: #d26484;
  transform: rotate(28deg) scale(1, 1.05) skew(-18deg);
  box-shadow: 1px -1px 1px 0 #a53d60;
  opacity: 0.9;
}

#castle .shade-wrap #flower-wrap #falling-petal {
  position: absolute;
  left: 105px;
  top: 209px;
  width: 22px;
  height: 18px;
  border-top-left-radius: 50% 50%;
  border-top-right-radius: 10% 10%;
  border-bottom-left-radius: 10% 10%;
  border-bottom-right-radius: 50% 50%;
  background-color: #da7290;
  transform: rotate(32deg) scale(0.9, 0.95) skew(-18deg);
  box-shadow: 1px -1px 1px 0 #a53d60;
  opacity: 0.9;
  animation: 7s fall 4s ease-in-out infinite;
  will-change: transform, opacity;
}

#castle .shade-wrap #flower-wrap #leaf1 {
  position: absolute;
  left: 75px;
  top: 225px;
  width: 13px;
  height: 20px;
  border-top-left-radius: 50% 10%;
  border-top-right-radius: 50% 50%;
  border-bottom-left-radius: 50% 50%;
  border-bottom-right-radius: 50% 10%;
  background-color: #a1b965;
  transform: rotate(5deg);
}

#castle .shade-wrap #flower-wrap #leaf2 {
  position: absolute;
  left: 82px;
  top: 265px;
  width: 12px;
  height: 16px;
  border-top-left-radius: 50% 10%;
  border-top-right-radius: 50% 50%;
  border-bottom-left-radius: 50% 50%;
  border-bottom-right-radius: 50% 10%;
  background-color: #a1b965;
  transform: rotate(-97deg);
}

.dustDef {
  position: absolute;
  background-color: white;
  border-radius: 100%;
  box-shadow: 0 0 3px 1px white;
  opacity: 0;
  will-change: transform, opacity;
}

@keyframes hover {
  0%, 100% { transform: translateY(60px); }
  50% { transform: translateY(50px); }
}

@keyframes glow {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes fall {
  0% { transform: translate(0, 0) rotate(32deg) scale(0.9, 0.95) skew(-18deg); opacity: 0.9; }
  5% { transform: translate(0, 0) rotate(55deg) scale(0.9, 0.95) skew(-18deg); opacity: 0.9; }
  30% { transform: translate(-15px, 78px) rotate(44deg) scale(0.9, 0.95) skew(-24deg); opacity: 0.45; }
  55% { transform: translate(25px, 155px) rotate(32deg) scale(0.9, 0.95) skew(-30deg); opacity: 0.08; }
  60%, 100% { transform: translate(20px, 171px) rotate(30deg) scale(0.9, 0.95) skew(-32deg); opacity: 0; }
}

@keyframes floatAnimate {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.5; }
}

@keyframes aurora-drift {
  from { transform: translate3d(-3%, -2%, 0) rotate(-8deg); }
  to { transform: translate3d(3%, 2%, 0) rotate(8deg); }
}

@keyframes led-breathe {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

@media (max-width: 420px) {
  #castle { padding-inline: 12px; }
  #castle #table {
    left: calc(50% - 170px);
    width: 340px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-gate, .enter-button { transition: none; }
  #castle *, #castle *::before, #castle *::after,
  #castle::before, #castle::after {
    animation: none !important;
  }
}
