html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: #000c17;
  perspective: 1000px;
  font-family: Georgia, "Times New Roman", serif;
}

#canvas-container {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.shape {
  position: absolute;
  animation: float 8s linear infinite;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes float {
  0% {
    transform: translateZ(-1000px) translateX(-100%) translateY(-100%) rotate(0deg);
  }
  100% {
    transform: translateZ(500px) translateX(100%) translateY(100%) rotate(360deg);
  }
}

.glow {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(to top, rgba(0, 255, 255, 0.1), transparent);
  pointer-events: none;
}

.card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 12, 23, 0.2);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  width: 240px;
  z-index: 5;
}

.profile-pic {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #00ffff;
}

.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card h1 {
  margin: 0.5rem 0;
  color: #00ffff;
}

.card p {
  margin: 1rem 0;
  opacity: 0.8;
  min-height: 3.8em;
  line-height: 1.35;
}

#typing-text::after {
  content: "|";
  display: inline-block;
  margin-left: 2px;
  color: #00ffff;
  animation: caret-blink 0.8s step-end infinite;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

.social-links {
  margin-top: 1.5rem;
}

.social-links a {
  color: #00ffff;
  text-decoration: none;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #00ffff;
  border-radius: 20px;
  transition: all 0.3s;
}

.social-links a:hover {
  background: #00ffff;
  color: #000c17;
}

.floating-actions {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.float-action {
  --edge-space: clamp(14px, 5vw, 72px);
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(54px, 9vw, 78px);
  height: clamp(54px, 9vw, 78px);
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.5);
  color: #000c17;
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
}

.float-action:hover {
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.8);
  transform: translateY(-50%) scale(1.12);
}

.float-action img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.float-action-round {
  overflow: hidden;
}

.float-action-round img {
  object-fit: cover;
}

.float-action-transparent {
  width: clamp(72px, 13vw, 112px);
  height: clamp(72px, 13vw, 112px);
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.float-action-transparent:hover {
  box-shadow: none;
}

.float-action-transparent img {
  object-fit: cover;
}

.float-action-small {
  width: clamp(50px, 9vw, 78px);
  height: clamp(50px, 9vw, 78px);
}

.float-action-image span {
  display: none;
  font: 700 2rem/1 Arial, sans-serif;
}

.float-action-image img.is-missing {
  display: none;
}

.float-action-image img.is-missing + span {
  display: block;
}

.float-action svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.float-action-icon {
  font: 700 2rem/1 Arial, sans-serif;
}

.float-action-left {
  left: var(--edge-space);
  animation: slide-in-left 2s cubic-bezier(.18, .89, .32, 1.08) forwards, action-float 3s ease-in-out infinite;
}

.float-action-right {
  right: var(--edge-space);
  animation: slide-in-right 2s cubic-bezier(.18, .89, .32, 1.08) forwards, action-float 3s ease-in-out infinite;
}

/* Chap taraf - 4 ta tugma (zigzag: 1 va 3-chisi chiqib turadi) */
.float-pos-l1 {
  top: 10%;
  left: calc(var(--edge-space) + 30px);
  animation-delay: 0s, 2s;
}

.float-pos-l2 {
  top: 32%;
  animation-delay: 1s, 3s;
}

.float-pos-l3 {
  top: 54%;
  left: calc(var(--edge-space) + 10px);
  animation-delay: 2s, 4s;
}

.float-pos-l4 {
  top: 76%;
  animation-delay: 3s, 5s;
}

/* O'ng taraf - 3 ta tugma (zigzag: 1 va 3-chisi chiqib turadi) */
.float-pos-r1 {
  top: 21%;
  right: calc(var(--edge-space) + 30px);
  animation-delay: 0.5s, 2.5s;
}

.float-pos-r2 {
  top: 43%;
  animation-delay: 1.5s, 3.5s;
}

.float-pos-r3 {
  top: 65%;
  right: calc(var(--edge-space) + 30px);
  animation-delay: 2.5s, 4.5s;
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translate(-130%, -50%) scale(0.55);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%) scale(1);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translate(130%, -50%) scale(0.55);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%) scale(1);
  }
}

@keyframes action-float {
  0%, 100% {
    transform: translate(0, -50%);
  }
  50% {
    transform: translate(0, calc(-50% - 10px));
  }
}

.rules-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 8, 15, 0.68);
  backdrop-filter: blur(8px);
}

.rules-modal[hidden] {
  display: none;
}

.rules-box {
  position: relative;
  width: min(360px, calc(100vw - 2rem));
  box-sizing: border-box;
  padding: 1.5rem;
  border: 1px solid rgba(0, 255, 255, 0.65);
  border-radius: 14px;
  background: rgba(0, 12, 23, 0.92);
  box-shadow: 0 0 28px rgba(0, 255, 255, 0.24);
  color: white;
}

.rules-box h2 {
  margin: 0 2rem 1rem 0;
  color: #00ffff;
  font-size: 1.45rem;
}

.rules-box ul {
  margin: 0;
  padding-left: 1.2rem;
}

.rules-box li {
  margin: 0.65rem 0;
  line-height: 1.35;
}

.rules-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: 1px solid #00ffff;
  border-radius: 50%;
  background: transparent;
  color: #00ffff;
  cursor: pointer;
  font: 700 1rem/1 Arial, sans-serif;
}

@media (max-width: 640px) {
  .float-action {
    --edge-space: 12px;
    width: 52px;
    height: 52px;
  }

  .float-action svg {
    width: 24px;
    height: 24px;
  }

  .float-action-icon {
    font-size: 1.55rem;
  }
}