:root {
  --ink: #edf2ff;
  --bg-deep: #0a0120;
  --bg-mid: #20004d;
  --bg-soft: #4a0c78;
  --lime: #89ff6b;
  --gold: #ffd84a;
  --gate-bg-image: url("./assets/5532919.jpg");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  font-family: Tahoma, Verdana, "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgba(108, 64, 220, 0.35), transparent 42%),
    radial-gradient(circle at 79% 11%, rgba(185, 52, 255, 0.3), transparent 44%),
    linear-gradient(175deg, #03020a, #16032f 55%, #100224);
}

.no-js #gate {
  display: none;
}

.site {
  position: relative;
  min-height: 100dvh;
  opacity: 0;
  transform: scale(1.015);
  filter: blur(16px);
  transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
  background: #000;
  overflow: hidden;
  isolation: isolate;
}

.site::before,
.site::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.site::before {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 1.1px, transparent 1.8px),
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 0.9px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.74) 0 0.8px, transparent 1.4px);
  background-size: 120px 120px, 170px 170px, 240px 240px;
  background-position: 0 0, 34px 72px, 80px 20px;
  opacity: 0.82;
  animation: siteStarDrift 65s linear infinite;
}

.site::after {
  background:
    radial-gradient(circle at 18% 26%, rgba(255, 255, 255, 0.18), transparent 20%),
    radial-gradient(circle at 79% 17%, rgba(255, 255, 255, 0.14), transparent 22%),
    radial-gradient(circle at 54% 72%, rgba(255, 255, 255, 0.12), transparent 24%);
  opacity: 0.56;
  animation: siteStarPulse 6.8s ease-in-out infinite;
}

body.site-open .site {
  opacity: 1;
  transform: none;
  filter: none;
}

.space-hub {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.1rem;
  padding: clamp(1.1rem, 3.8vw, 2.8rem);
  padding-bottom: calc(clamp(1.1rem, 3.8vw, 2.8rem) + env(safe-area-inset-bottom));
}

.site-notice {
  margin: 0;
  text-align: center;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1.05rem, 2.8vw, 1.65rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff3a8;
  text-shadow:
    0 0 8px rgba(255, 224, 107, 0.28),
    0 0 18px rgba(255, 120, 220, 0.22);
}

.chat-panel {
  width: min(820px, 94vw);
  display: grid;
  gap: 0.48rem;
}

.chat-panel__title {
  margin: 0;
  text-align: center;
  font-size: clamp(0.96rem, 2vw, 1.12rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: "Courier New", Courier, monospace;
  color: #f8d7ff;
  text-shadow:
    0 0 8px rgba(255, 104, 232, 0.55),
    0 0 18px rgba(113, 123, 255, 0.4);
}

.chat-window {
  position: relative;
  border: 2px solid #2f2753;
  border-radius: 0.34rem;
  overflow: hidden;
  background: #cdc6d8;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #7d7591,
    0 16px 28px rgba(0, 0, 0, 0.5);
}

.chat-window__bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.44rem 0.56rem;
  border-bottom: 1px solid #564b76;
  background: linear-gradient(90deg, #ff46cb 0%, #9262ff 56%, #35cfff 100%);
  color: #fef8ff;
}

.chat-window__dots {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.chat-window__dots span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #fff3ff;
  box-shadow: 0 0 0 1px rgba(48, 30, 75, 0.46);
}

.chat-window__bar-title {
  margin: 0;
  user-select: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "Courier New", Courier, monospace;
}

.chat-window__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.chat-window__actions span {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 0.12rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(30, 14, 68, 0.25);
}

.chat-window__toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.56);
  border-bottom: 1px solid #8f87a3;
  background: linear-gradient(180deg, #ece6f4 0%, #d5cfde 100%);
}

.chat-window__toolbar span {
  padding: 0.16rem 0.42rem;
  border-radius: 0.2rem;
  border: 1px solid #9890ac;
  background: #f7f5fb;
  color: #453a5f;
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  font-family: "Courier New", Courier, monospace;
}


.chat-messages {
  margin: 0.5rem;
  height: clamp(260px, 44vh, 390px);
  overflow-y: auto;
  padding: 0.6rem;
  border: 2px solid #7f7498;
  border-radius: 0.22rem;
  background:
    linear-gradient(180deg, #ffffff 0%, #f5f0fc 100%),
    repeating-linear-gradient(180deg, rgba(123, 92, 163, 0.07) 0 1px, rgba(123, 92, 163, 0) 1px 3px);
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #b3a8c8;
}

.chat-message {
  margin-bottom: 0.5rem;
  padding: 0.42rem 0.46rem;
  border: 1px solid #b4a8ca;
  border-radius: 0.24rem;
  background: linear-gradient(180deg, #fffaff 0%, #f0e8fb 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.85);
}

.chat-message:last-child {
  margin-bottom: 0;
}

.chat-message__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.chat-message__identity {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.chat-message__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #65597f;
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, #d9d0ea 65%, #b7a8d2 100%);
  object-fit: cover;
  flex: 0 0 auto;
}

.chat-message__text {
  margin: 0;
  word-break: break-word;
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 0.98rem;
  color: #1a1228;
  background: #ffffff;
  border: 1px solid #cbc0df;
  border-radius: 0.2rem;
  padding: 0.42rem 0.5rem;
  box-shadow: inset 1px 1px 0 #ffffff;
}

.chat-message__author {
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  color: #6d2f95;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-message__time {
  color: #4c3f66;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.71rem;
  flex: 0 0 auto;
}

.chat-message__controls {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.chat-message__delete {
  border: 1px solid #8f386d;
  border-radius: 0.18rem;
  background: linear-gradient(180deg, #fff0f8 0%, #f2bfd8 100%);
  color: #5e1b44;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.42rem;
  cursor: pointer;
}

.chat-message__delete:hover,
.chat-message__delete:focus-visible {
  border-color: #6f214f;
  outline: none;
}

.chat-message__delete:disabled {
  opacity: 0.62;
  cursor: wait;
}

.chat-empty {
  margin: 0;
  color: #221734;
  text-align: center;
}

.chat-empty--error {
  color: #b41f60;
}

.chat-form {
  padding: 0 0.5rem 0.4rem;
  display: grid;
  gap: 0.48rem;
}

.admin-panel {
  width: min(240px, calc(100% - 1rem));
  margin: 0 0.5rem 0.35rem auto;
  padding: 0.38rem;
  border: 1px solid #9a90ae;
  border-radius: 0.24rem;
  background: linear-gradient(180deg, rgba(245, 241, 250, 0.94) 0%, rgba(226, 217, 239, 0.94) 100%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.85),
    0 6px 16px rgba(23, 10, 44, 0.16);
  display: grid;
  gap: 0.3rem;
}

.admin-panel label {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #50426e;
}

.admin-panel__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.38rem;
}

.admin-panel__row input {
  min-width: 0;
  border: 2px solid #8f87a6;
  border-radius: 0.2rem;
  padding: 0.5rem 0.62rem;
  background: #ffffff;
  color: #2a1e41;
  outline: none;
}

.admin-panel__row input:focus {
  border-color: #cd47c0;
  box-shadow: 0 0 0 2px rgba(233, 122, 255, 0.22);
}

.admin-panel__row button {
  white-space: nowrap;
  padding-inline: 0.72rem;
  border: 2px solid #726688;
  border-radius: 0.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #e8e3f0 45%, #c5b7dd 100%);
  color: #272034;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #9f91ba,
    0 2px 0 rgba(56, 43, 77, 0.35);
}

.admin-panel__row button:hover,
.admin-panel__row button:focus-visible {
  border-color: #5f4e86;
  background: linear-gradient(180deg, #fff8ff 0%, #ead8ff 45%, #bfa8ea 100%);
  outline: none;
}

.admin-panel__status {
  margin: 0;
  font-size: 0.62rem;
  color: #4e4266;
}

.admin-panel__status.is-error {
  color: #a31f59;
}

.chat-form__nickname {
  display: grid;
  gap: 0.26rem;
}

.chat-form__nickname label {
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #50426f;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
}

.chat-form__profile {
  display: flex;
  align-items: center;
  gap: 0.52rem;
}

.chat-avatar-preview {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #7b6f95;
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, #d6cee5 65%, #b5a7cf 100%);
  object-fit: cover;
  opacity: 0.58;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.88);
}

.chat-avatar-preview.is-visible {
  opacity: 1;
}

.chat-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.32rem 0.72rem;
  border: 2px solid #7c7194;
  border-radius: 0.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #ece5f9 45%, #cdbfe6 100%);
  color: #2c2141;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #9f92ba;
  transition: border-color 0.16s ease, filter 0.16s ease;
}

.chat-avatar-btn:hover,
.chat-avatar-btn:focus-visible {
  border-color: #5f4f83;
  filter: saturate(112%);
  outline: none;
}

.chat-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.chat-form__message-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.42rem;
}

.chat-form input {
  min-width: 0;
  border: 2px solid #8f87a6;
  border-radius: 0.2rem;
  padding: 0.52rem 0.68rem;
  color: #2a1e41;
  background: #ffffff;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #d4cfdf;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.chat-form input:focus {
  border-color: #cd47c0;
  box-shadow: 0 0 0 2px rgba(233, 122, 255, 0.22);
}

.chat-form input::placeholder {
  color: #7c7394;
}

.chat-form button {
  border: 2px solid #726688;
  border-radius: 0.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #e8e3f0 45%, #c5b7dd 100%);
  color: #272034;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.94rem;
  cursor: pointer;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #9f91ba,
    0 2px 0 rgba(56, 43, 77, 0.35);
}

.chat-form button:hover,
.chat-form button:focus-visible {
  border-color: #5f4e86;
  background: linear-gradient(180deg, #fff8ff 0%, #ead8ff 45%, #bfa8ea 100%);
  outline: none;
}

.chat-form button:active {
  transform: translateY(1px);
}

.chat-form button:disabled {
  opacity: 0.66;
  cursor: wait;
}

.chat-window__status {
  margin: 0;
  padding: 0.24rem 0.5rem 0.42rem;
  border-top: 1px solid #aba3bc;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b4f77;
  font-family: "Courier New", Courier, monospace;
  text-align: right;
  animation: y2kStatusBlink 2.4s ease-in-out infinite;
}

.social-links {
  width: min(820px, 94vw);
  display: grid;
  gap: 0.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  padding: 0.62rem 1rem;
  border: 2px solid #6f6486;
  border-radius: 0.22rem;
  color: #2d2340;
  text-decoration: none;
  background: linear-gradient(180deg, #faf9fc 0%, #dfd8eb 48%, #bfb2d8 100%);
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #8c80a7,
    0 2px 0 rgba(39, 26, 58, 0.35);
  transition: border-color 0.16s ease, filter 0.16s ease;
}

.social-link:hover,
.social-link:focus-visible {
  border-color: #4f3f76;
  filter: saturate(112%);
  outline: none;
}

.social-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icon svg {
  width: 100%;
  height: 100%;
  fill: currentcolor;
}

.social-link--x {
  color: #352b4c;
}

.social-link--tiktok {
  color: #352b4c;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  isolation: isolate;
  background-color: #040115;
  background-image:
    var(--gate-bg-image),
    radial-gradient(circle at 18% 20%, rgba(182, 80, 255, 0.34), transparent 42%),
    radial-gradient(circle at 83% 11%, rgba(74, 137, 255, 0.3), transparent 38%),
    linear-gradient(170deg, var(--bg-deep), var(--bg-mid) 54%, var(--bg-soft));
  background-size: cover, 100% 100%, 100% 100%, 100% 100%;
  background-position: center;
}

.gate::before,
.gate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gate::before {
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0 1px,
    rgba(0, 0, 0, 0.08) 1px 3px
  );
  mix-blend-mode: screen;
  opacity: 0.2;
}

.gate::after {
  background:
    radial-gradient(circle at 15% 78%, rgba(255, 255, 255, 0.24), transparent 20%),
    radial-gradient(circle at 84% 22%, rgba(255, 255, 255, 0.2), transparent 19%),
    radial-gradient(circle at 62% 12%, rgba(255, 255, 255, 0.22), transparent 17%);
  animation: starPulse 7s ease-in-out infinite;
  opacity: 0.5;
}

.gate__stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.bg-motion {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.bg-motion::before,
.bg-motion::after {
  content: "";
  position: absolute;
  inset: -14%;
  pointer-events: none;
}

.bg-motion::before {
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1.2px, transparent 1.7px),
    radial-gradient(circle, rgba(189, 227, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 167, 244, 0.88) 0 1.3px, transparent 1.8px);
  background-size: 150px 150px, 210px 210px, 260px 260px;
  background-position: 0 0, 36px 58px, 120px 80px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
  animation: starFieldDrift 36s linear infinite;
}

.bg-motion::after {
  z-index: 1;
  opacity: 0.42;
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse at 22% 66%, rgba(74, 137, 255, 0.32), transparent 55%),
    radial-gradient(ellipse at 72% 18%, rgba(255, 82, 233, 0.3), transparent 52%),
    radial-gradient(ellipse at 50% 38%, rgba(181, 102, 255, 0.28), transparent 50%);
  filter: blur(18px) saturate(125%);
  animation: nebulaShift 14s ease-in-out infinite;
}

.blob {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  filter: blur(28px);
  mix-blend-mode: screen;
  opacity: 0.26;
  animation: blobDrift 14s ease-in-out infinite;
}

.b1 {
  width: min(42vw, 520px);
  height: min(42vw, 520px);
  left: -10%;
  top: 14%;
  background: radial-gradient(circle, rgba(56, 172, 255, 0.85), rgba(56, 172, 255, 0));
}

.b2 {
  width: min(36vw, 440px);
  height: min(36vw, 440px);
  right: -8%;
  top: 8%;
  background: radial-gradient(circle, rgba(255, 74, 214, 0.75), rgba(255, 74, 214, 0));
  animation-delay: -4s;
}

.b3 {
  width: min(44vw, 560px);
  height: min(44vw, 560px);
  left: 26%;
  bottom: -18%;
  background: radial-gradient(circle, rgba(123, 85, 255, 0.72), rgba(123, 85, 255, 0));
  animation-delay: -7s;
}

.gate-title {
  position: absolute;
  z-index: 4;
  top: clamp(1.1rem, 2.8vw, 2rem);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  font-family: "Cooper Black", "Bookman Old Style", Georgia, serif;
  font-size: clamp(2rem, 8.4vw, 5.6rem);
  line-height: 1;
  text-shadow:
    0 6px 14px rgba(0, 0, 0, 0.5),
    -1px 0 rgba(0, 0, 0, 0.22),
    1px 0 rgba(255, 255, 255, 0.18);
}

.gate-title span {
  display: inline-block;
}

.gate-title span:nth-child(1) { color: #f6ef00; }
.gate-title span:nth-child(2) { color: #ff1f1f; }
.gate-title span:nth-child(3) { color: #efefef; }
.gate-title span:nth-child(4) { color: #16b5ff; }
.gate-title span:nth-child(5) { color: #c52bb0; }
.gate-title span:nth-child(7) { color: #ffb81f; }
.gate-title span:nth-child(8) {
  color: #32de8a;
  text-shadow:
    0 6px 14px rgba(0, 0, 0, 0.5),
    0 0 0.06em #32de8a,
    0 0 0.24em rgba(50, 222, 138, 0.45);
}
.gate-title span:nth-child(9) { color: #e03aac; }
.gate-title span:nth-child(10) { color: #d4d0d9; }

.gate-title .space {
  width: 0.55em;
}

.gate-moon {
  position: absolute;
  z-index: 3;
  top: clamp(0.7rem, 1.8vw, 1.3rem);
  right: clamp(0.6rem, 2.2vw, 2rem);
  width: clamp(130px, 20vw, 280px);
  max-width: 30vw;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.45));
  transition: transform 0.26s ease;
}

.gate-moon:hover {
  transform: translate(-9px, 9px) rotate(-6deg) scale(1.03);
}

.galaxy-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.galaxy {
  position: absolute;
  z-index: 2;
  opacity: 0.75;
  filter: drop-shadow(0 0 14px rgba(173, 255, 78, 0.32));
  animation: galaxyFloat 9s ease-in-out infinite;
}

.g1 { width: clamp(90px, 12vw, 190px); top: 16%; left: 7%; transform: rotate(-12deg); }
.g2 { width: clamp(72px, 10vw, 140px); top: 30%; right: 10%; transform: rotate(18deg); animation-delay: -1.2s; }
.g3 { width: clamp(84px, 11vw, 160px); top: 54%; left: 18%; transform: rotate(-26deg); animation-delay: -2.2s; }
.g4 { width: clamp(68px, 9vw, 132px); top: 61%; right: 20%; transform: rotate(22deg); animation-delay: -3.1s; }
.g5 { width: clamp(62px, 8vw, 120px); top: 43%; left: 64%; transform: rotate(34deg); animation-delay: -4s; }
.g6 { width: clamp(78px, 10vw, 150px); top: 72%; right: 7%; transform: rotate(-17deg); animation-delay: -4.9s; }

.pixel-stars {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.pixel-star {
  position: absolute;
  width: clamp(34px, 5vw, 82px);
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
  opacity: 0.86;
  filter: drop-shadow(0 0 10px rgba(255, 220, 90, 0.45));
  animation: pixelStarTwinkle 2.8s steps(2, end) infinite, pixelStarFloat 7.8s ease-in-out infinite;
}

.s1 { top: 18%; left: 14%; animation-delay: -0.6s; }
.s2 { top: 24%; left: 31%; animation-delay: -1.8s; }
.s3 { top: 16%; left: 52%; animation-delay: -0.3s; }
.s4 { top: 28%; left: 73%; animation-delay: -2.2s; }
.s5 { top: 42%; left: 11%; animation-delay: -1s; }
.s6 { top: 55%; left: 80%; animation-delay: -2.8s; }
.s7 { top: 68%; left: 24%; animation-delay: -1.4s; }
.s8 { top: 74%; left: 62%; animation-delay: -2.5s; }

.earth-wrap {
  position: absolute;
  z-index: 5;
  left: clamp(0.8rem, 3.6vw, 3.2rem);
  bottom: clamp(0.8rem, 5.2vh, 3.4rem);
  width: clamp(140px, 21vw, 270px);
  pointer-events: none;
}

.earth {
  width: 100%;
  display: block;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.38));
  animation: earthFloat 6s ease-in-out infinite;
}

.kirby {
  position: absolute;
  width: clamp(36px, 6vw, 82px);
  left: 38%;
  top: 12%;
  transform: translate(-50%, -55%) rotate(-7deg);
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.4));
  animation: kirbyWalk 3.2s ease-in-out infinite;
}

.tv-wrap {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 54.5%;
  width: clamp(300px, 48vw, 680px);
  transform: translate(-50%, -50%);
}

.gate-controller {
  position: absolute;
  z-index: 6;
  left: calc(50% + clamp(190px, 26vw, 410px));
  top: 63%;
  width: clamp(120px, 16vw, 230px);
  transform: translate(-50%, -50%) rotate(-9deg);
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.tv-shell {
  width: 100%;
  display: block;
  image-rendering: auto;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.45));
}

.press-start-btn {
  position: absolute;
  left: 20.5%;
  top: 44.2%;
  width: 43%;
  height: 14.5%;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 7;
}

.press-start-btn::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  border-radius: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.press-start-btn:hover::before,
.press-start-btn:focus-visible::before {
  opacity: 1;
}

.paper {
  --void-x: 50%;
  --void-y: 55%;
  --galaxy-tilt: -18deg;
  position: absolute;
  inset: 0;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  clip-path: circle(0% at var(--void-x) var(--void-y));
}

.paper::before,
.paper::after,
.paper__creases {
  content: "";
  position: absolute;
  inset: -34%;
  transform-origin: var(--void-x) var(--void-y);
}

.paper::before {
  background:
    radial-gradient(ellipse 10% 9% at var(--void-x) var(--void-y), rgba(255, 255, 255, 1) 0 38%, rgba(246, 228, 255, 0.95) 42%, rgba(219, 180, 255, 0.72) 58%, rgba(118, 66, 200, 0.3) 76%, rgba(0, 0, 0, 0) 100%),
    repeating-conic-gradient(from 18deg at var(--void-x) var(--void-y), rgba(255, 247, 255, 0.82) 0deg 14deg, rgba(214, 169, 255, 0.45) 14deg 30deg, rgba(96, 53, 170, 0.16) 30deg 52deg, rgba(0, 0, 0, 0) 52deg 74deg),
    radial-gradient(ellipse 28% 18% at calc(var(--void-x) + 2%) calc(var(--void-y) - 1%), rgba(177, 133, 255, 0.54) 0 44%, rgba(38, 14, 86, 0) 100%);
  mix-blend-mode: screen;
  opacity: 0;
  filter: blur(1.25px) saturate(168%);
}

.paper::after {
  background:
    radial-gradient(circle at calc(var(--void-x) - 18%) calc(var(--void-y) - 13%), rgba(255, 255, 255, 0.34) 0 0.55%, rgba(255, 255, 255, 0) 0.7%),
    radial-gradient(circle at calc(var(--void-x) + 20%) calc(var(--void-y) + 6%), rgba(255, 255, 255, 0.31) 0 0.48%, rgba(255, 255, 255, 0) 0.64%),
    radial-gradient(circle at calc(var(--void-x) - 7%) calc(var(--void-y) + 19%), rgba(198, 175, 255, 0.3) 0 0.6%, rgba(255, 255, 255, 0) 0.76%),
    repeating-radial-gradient(circle at var(--void-x) var(--void-y), rgba(255, 255, 255, 0.2) 0 1.8px, rgba(255, 255, 255, 0) 1.8px 9px);
  mix-blend-mode: screen;
  opacity: 0;
  filter: blur(0.4px);
}

.paper__creases {
  inset: 0;
  background:
    radial-gradient(circle at var(--void-x) var(--void-y), rgba(30, 8, 62, 0) 0 16%, rgba(25, 7, 60, 0.48) 28%, rgba(5, 1, 18, 0.92) 58%, rgba(0, 0, 0, 1) 100%),
    repeating-conic-gradient(from 0deg at var(--void-x) var(--void-y), rgba(255, 255, 255, 0.11) 0deg 8deg, rgba(255, 255, 255, 0) 8deg 24deg);
  mix-blend-mode: screen;
  opacity: 0;
  filter: blur(0.65px);
}

body.site-entering .gate__stage {
  animation: stageAnnihilate 1.35s cubic-bezier(0.22, 0.72, 0.15, 1) forwards;
}

body.site-entering .paper {
  opacity: 1;
  animation: galaxyConsume 1.65s cubic-bezier(0.18, 0.78, 0.12, 1) forwards;
}

body.site-entering .paper::before {
  animation: galaxySpiral 1.65s cubic-bezier(0.14, 0.8, 0.2, 1) forwards;
}

body.site-entering .paper::after {
  animation: galaxyDust 1.45s linear forwards;
}

body.site-entering .paper__creases {
  animation: galaxyVoid 1.65s ease-out forwards;
}

body.site-open .gate {
  visibility: hidden;
}

@keyframes stageAnnihilate {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: none;
  }
  38% {
    opacity: 1;
    transform: scale(1.012);
    filter: saturate(140%) contrast(116%) hue-rotate(8deg);
  }
  72% {
    opacity: 0.82;
    transform: scale(0.975);
    filter: saturate(72%) brightness(0.48) blur(1.8px);
  }
  100% {
    opacity: 0;
    transform: scale(0.92);
    filter: brightness(0.03) blur(5px);
  }
}

@keyframes galaxyConsume {
  0% {
    opacity: 0;
    clip-path: circle(0% at var(--void-x) var(--void-y));
  }
  22% {
    opacity: 0.95;
    clip-path: circle(18% at var(--void-x) var(--void-y));
  }
  56% {
    opacity: 1;
    clip-path: circle(72% at var(--void-x) var(--void-y));
  }
  85% {
    opacity: 1;
    clip-path: circle(136% at var(--void-x) var(--void-y));
  }
  100% {
    opacity: 1;
    clip-path: circle(160% at var(--void-x) var(--void-y));
  }
}

@keyframes galaxySpiral {
  0% {
    opacity: 0;
    transform: perspective(900px) rotateX(11deg) rotateZ(var(--galaxy-tilt)) scale(0.08);
  }
  24% {
    opacity: 0.9;
    transform: perspective(900px) rotateX(11deg) rotateZ(calc(var(--galaxy-tilt) + 96deg)) scale(0.36);
  }
  62% {
    opacity: 1;
    transform: perspective(900px) rotateX(11deg) rotateZ(calc(var(--galaxy-tilt) + 270deg)) scale(1.18);
  }
  100% {
    opacity: 1;
    transform: perspective(900px) rotateX(11deg) rotateZ(calc(var(--galaxy-tilt) + 520deg)) scale(2.34);
  }
}

@keyframes galaxyDust {
  0% {
    opacity: 0;
    transform: perspective(900px) rotateX(11deg) rotateZ(var(--galaxy-tilt)) scale(0.5);
  }
  40% {
    opacity: 0.8;
    transform: perspective(900px) rotateX(11deg) rotateZ(calc(var(--galaxy-tilt) + 120deg)) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: perspective(900px) rotateX(11deg) rotateZ(calc(var(--galaxy-tilt) + 280deg)) scale(1.65);
  }
}

@keyframes galaxyVoid {
  0% {
    opacity: 0;
    transform: scale(0.22);
  }
  50% {
    opacity: 0.58;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.2);
  }
}
@keyframes y2kStatusBlink {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes siteStarDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-140px, -90px, 0); }
}

@keyframes siteStarPulse {
  0%,
  100% { opacity: 0.42; }
  50% { opacity: 0.72; }
}

@keyframes stopFloat {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(-5px) rotate(-2deg) scale(1.025);
  }
  100% {
    transform: translateY(-3px) rotate(2deg) scale(1.04);
  }
}

@keyframes starPulse {
  0%,
  100% { opacity: 0.38; }
  50% { opacity: 0.62; }
}

@keyframes pixelStarTwinkle {
  0%,
  100% { opacity: 0.72; filter: drop-shadow(0 0 6px rgba(255, 221, 96, 0.35)); }
  50% { opacity: 1; filter: drop-shadow(0 0 14px rgba(255, 233, 120, 0.65)); }
}

@keyframes pixelStarFloat {
  0%,
  100% { transform: translate(-50%, -50%) translateY(0) scale(1); }
  50% { transform: translate(-50%, -50%) translateY(-6px) scale(1.06); }
}

@keyframes starFieldDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.45;
  }
  50% {
    transform: translate3d(-2.8%, -2.2%, 0) scale(1.05);
    opacity: 0.58;
  }
  100% {
    transform: translate3d(-5.6%, -4.4%, 0) scale(1.09);
    opacity: 0.44;
  }
}

@keyframes nebulaShift {
  0%,
  100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(1.8%, -2.2%, 0) rotate(2.5deg) scale(1.06); }
}

@keyframes blobDrift {
  0%,
  100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2.4%, -2.4%, 0) scale(1.08); }
}

@keyframes galaxyFloat {
  0%,
  100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.04); }
}

@keyframes earthFloat {
  0%,
  100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes kirbyWalk {
  0% { left: 38%; top: 12%; transform: translate(-50%, -55%) rotate(-7deg); }
  25% { left: 47%; top: 9%; transform: translate(-50%, -61%) rotate(2deg); }
  50% { left: 56%; top: 8%; transform: translate(-50%, -58%) rotate(-5deg); }
  75% { left: 47%; top: 9%; transform: translate(-50%, -62%) rotate(2deg); }
  100% { left: 38%; top: 12%; transform: translate(-50%, -55%) rotate(-7deg); }
}

@keyframes staticShift {
  0% { background-position: 0 0, 0 0, center; }
  25% { background-position: 2px -1px, -1px 1px, center; }
  50% { background-position: -1px 1px, 2px -1px, center; }
  75% { background-position: 1px 2px, -2px 1px, center; }
  100% { background-position: 0 0, 0 0, center; }
}

@keyframes scanLine {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@media (max-width: 900px) {
  .space-hub {
    align-content: flex-start;
    gap: 0.9rem;
    padding-top: max(0.9rem, env(safe-area-inset-top));
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom));
  }

  .gate-title {
    top: 0.95rem;
    font-size: clamp(1.8rem, 9vw, 4.6rem);
  }

  .tv-wrap {
    width: clamp(300px, 78vw, 660px);
    top: 55.5%;
  }

  .gate-controller {
    left: calc(50% + clamp(170px, 30vw, 360px));
    top: 64%;
    width: clamp(106px, 19vw, 188px);
  }

  .chat-panel,
  .social-links {
    width: min(94vw, 700px);
  }

  .chat-messages {
    height: clamp(240px, 40dvh, 350px);
  }
}

@media (max-width: 620px) {
  .space-hub {
    gap: 0.72rem;
    padding-inline: 0.68rem;
  }

  .earth-wrap {
    left: clamp(0.3rem, 2vw, 1rem);
    bottom: clamp(0.3rem, 3vh, 1.2rem);
    width: clamp(98px, 28vw, 152px);
  }

  .kirby {
    width: clamp(26px, 7vw, 48px);
  }

  .gate-title {
    top: 0.72rem;
    font-size: clamp(1.45rem, 8.8vw, 2.8rem);
  }

  .gate-moon {
    top: 2.7rem;
    width: clamp(92px, 25vw, 150px);
  }

  .pixel-star.s7,
  .pixel-star.s8 {
    display: none;
  }

  .tv-wrap {
    width: clamp(250px, 92vw, 500px);
    top: 57.8%;
  }

  .gate-controller {
    left: auto;
    right: clamp(0.4rem, 1.3vw, 0.9rem);
    top: 69.5%;
    width: clamp(82px, 29vw, 124px);
    transform: translate(0, -50%) rotate(-6deg);
  }

  .press-start-btn {
    left: 20.5%;
    top: 43.4%;
    width: 43%;
    height: 16.2%;
  }

  .chat-window__toolbar {
    flex-wrap: wrap;
  }


  .chat-messages {
    height: clamp(220px, 40dvh, 320px);
    margin: 0.4rem;
    padding: 0.45rem;
  }

  .chat-message__header {
    align-items: flex-start;
  }

  .chat-message__controls {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.18rem;
  }

  .admin-panel {
    width: calc(100% - 0.8rem);
    margin-inline: 0.4rem;
  }

  .admin-panel__row {
    grid-template-columns: 1fr;
  }

  .chat-form__profile {
    flex-wrap: wrap;
  }

  .chat-form__message-row {
    grid-template-columns: 1fr;
  }

  .chat-form button,
  .admin-panel__row button {
    width: 100%;
  }

  .social-link {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .site {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .gate {
    display: none;
  }
}





















