/* ============================= */
/*           BASE                */
/* ============================= */

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ============================= */
/*        RAINBOW BACKGROUND     */
/* ============================= */

.rainbow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(
    270deg,
    #ff9a9e,
    #fad0c4,
    #a18cd1,
    #fbc2eb,
    #a6c1ee,
    #ff9a9e
  );
  background-size: 600% 600%;
  animation: rainbow 12s ease infinite;
  z-index: -1;
}

@keyframes rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================= */
/*      HANDWRITING HELLO        */
/* ============================= */

.hello-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hello-write {
  font-family: 'Great Vibes', cursive;
  font-size: 110px;
  color: white;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: write 3s ease forwards;

  /* Мягкое свечение */
  text-shadow:
    0 0 10px rgba(255,255,255,0.6),
    0 0 20px rgba(255,255,255,0.4),
    0 0 40px rgba(255,255,255,0.2);
}

@keyframes write {
  from { width: 0; }
  to { width: 100%; }
}

/* ============================= */
/*      LIQUID GLASS NAV         */
/* ============================= */

.bottom-nav {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 40px;
  padding: 18px 60px;
  border-radius: 60px;
  backdrop-filter: blur(40px);
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.35),
    rgba(255,255,255,0.15)
  );
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow:
    0 10px 40px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

/* ============================= */
/*           ICONS               */
/* ============================= */

.nav-icon {
  width: 28px;
  height: 28px;
  fill: none;
  stroke-width: 2;
  animation: rainbowStroke 6s linear infinite;
}

@keyframes rainbowStroke {
  0% { stroke: #ff9a9e; }
  25% { stroke: #a18cd1; }
  50% { stroke: #a6c1ee; }
  75% { stroke: #fad0c4; }
  100% { stroke: #ff9a9e; }
}

.nav-item {
  transition: transform 0.3s ease;
}

.nav-item:hover {
  transform: scale(1.2);
}

.nav-item.active {
  transform: scale(1.3);
}


/* ===== PORTAL BACKGROUND ===== */

.portal-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
  z-index: -1;
}

.portal-bg::before,
.portal-bg::after {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(180, 200, 255, 0.4),
    rgba(230, 240, 255, 0.2),
    transparent 70%
  );
  animation: rotatePortal 25s linear infinite;
  filter: blur(80px);
}

.portal-bg::after {
  animation-direction: reverse;
  opacity: 0.7;
}

@keyframes rotatePortal {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== CPSL LAYOUT ===== */

.cpsl-container {
  text-align: center;
}

.cpsl-nav {
  position: fixed;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cpsl-nav a {
  text-decoration: none;
  color: black;
  font-weight: 500;
  transition: 0.3s;
}

.cpsl-nav a.active {
  font-weight: 700;
}

.cpsl-nav a:hover {
  transform: translateX(-5px);
}

/* ===== GREEN LIQUID ===== */

.liquid-green-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(
    135deg,
    #0f3d0f,
    #145214,
    #0b2e0b
  );
  background-size: 400% 400%;
  animation: liquidMove 12s ease infinite;
  z-index: -1;
}

@keyframes liquidMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== RULES BUTTONS ===== */

.rules-buttons {
  margin-top: 30px;
  display: flex;
  gap: 20px;
  justify-content: center;
}

.rules-buttons button {
  padding: 12px 25px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(20px);
  transition: 0.3s;
}

.rules-buttons button:hover {
  transform: scale(1.05);
}

/* ===== POPUP ===== */

.popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  width: 500px;
  max-width: 90%;
  position: relative;
}

.popup-content h2 {
  margin-top: 0;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 22px;
  cursor: pointer;
}


/* ===== RULES DESCRIPTION ===== */

.rules-description {
  margin-top: 15px;
  font-size: 16px;
  opacity: 0.7;
}

/* ===== BUTTONS ===== */

.rules-buttons {
  margin-top: 30px;
  display: flex;
  gap: 20px;
  justify-content: center;
}

.rules-buttons button {
  padding: 12px 25px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  backdrop-filter: blur(20px);
  background: rgba(255,255,255,0.3);
  transition: 0.3s;
}

.rules-buttons button:hover {
  transform: scale(1.05);
}

/* ===== GLASS POPUP ===== */

.popup {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.4s ease;
  z-index: 2000;
}

.popup.active {
  opacity: 1;
  pointer-events: auto;
}

.popup-glass {
  width: 750px;
  max-width: 95%;
  max-height: 80vh;
  padding: 40px;
  border-radius: 30px;
  backdrop-filter: blur(40px);
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.4),
    rgba(255,255,255,0.2)
  );
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.6);
  transform: scale(0.9);
  transition: 0.4s ease;
  overflow: hidden;
  position: relative;
}

.rules-scroll {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 10px;
}

.rules-scroll::-webkit-scrollbar {
  width: 6px;
}

.rules-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
}

.popup.active .popup-glass {
  transform: scale(1);
}

.close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 24px;
  cursor: pointer;
}

.rules-text {
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
}