/* ---------- Base Layout ---------- */
body {
  height: 100vh;
  margin: 0;
  background: url("/background.jpg") no-repeat bottom center / cover;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

/* ---------- Title with glow ---------- */
h1 {
  font-size: clamp(28px, 6vw, 60px);
  top: clamp(40px, 10vh, 100px);
  margin: 0 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  font-weight: 900;
  position: absolute;
  color: rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
}

h1::before {
  content: "CMOS.FI";
  display: flex;
  justify-content: center;
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
  z-index: 1;
}

h1::after {
  content: "CMOS.FI";
  display: flex;
  justify-content: center;
  position: absolute;
  inset: 0;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.7);
  color: transparent;
  z-index: 2;
}

h1 span {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

h1 span::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(120deg,
      rgba(255, 255, 255, 0.3) 0%,
      rgba(255, 255, 255, 0.1) 50%,
      rgba(255, 255, 255, 0.3) 100%);
  transform: rotate(25deg) translateX(-100%);
  animation: shine 3s infinite;
}

/* ---------- Minecraft Button (Bottom Left) ---------- */
.minecraft-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 14px 20px;
  min-width: 200px;
  height: 70px;

  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 10px;

  background: url("/lataa.jpg") no-repeat;
  background-size: cover;
  background-position: center 30%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  overflow: hidden;
  z-index: 50;
  transition: transform .25s ease, box-shadow .25s ease;
}

.minecraft-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.minecraft-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.8),
    inset 0 0 8px rgba(255, 255, 255, 0.25);
}

.minecraft-btn:active {
  transform: scale(0.96);
}

.minecraft-btn .btn-text {
  position: relative;
  color: #fff;
  z-index: 2;
  letter-spacing: 0.5px;
}

.minecraft-btn .btn-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1px #fff;
  z-index: -1;
}

.minecraft-btn .arrow {
  font-size: 20px;
  color: #fff;
  animation: arrowBounce 1.2s infinite alternate;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
  z-index: 2;
}

/* ---------- Animations ---------- */
@keyframes arrowBounce {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(6px);
  }
}

@keyframes shine {
  0% {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  }

  50% {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.7);
  }

  100% {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  }
}

@keyframes pop-in {
  from {
    transform: scale(.965);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------- Glassmorphism Popup ---------- */
.popup-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease, background .2s ease;
}

.popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.popup {
  position: relative;
  width: min(92%, 480px);
  padding: clamp(16px, 4vw, 26px);
  text-align: left;
  color: #fff;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 0 28px rgba(255, 255, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  outline: 2px solid rgba(255, 255, 255, 0.55);
  animation: pop-in .18s ease-out both;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 18px;
  color: #fff;
  background: transparent;
  border: none;
  padding: 6px;
  line-height: 1;
  cursor: pointer;
  border-radius: 10px;
  transition: background .15s ease, transform .15s ease;
}

.close-btn:hover,
.close-btn:focus {
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(5deg);
  outline: none;
}

.popup h2 {
  margin: 4px 0 6px;
  font-size: clamp(18px, 4.5vw, 24px);
  letter-spacing: .5px;
  text-shadow: 0 0 18px rgba(255, 255, 255, .35);
}

.hint {
  margin: 0 0 14px;
  font-size: clamp(12px, 3.5vw, 14px);
  opacity: .9;
}

.input-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  padding: clamp(10px, 3vw, 14px);
  font-size: clamp(14px, 3.5vw, 18px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  outline: none;
  box-shadow:
    0 0 20px 4px rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  text-align: center;
}

.input-wrap input:focus {
  box-shadow:
    0 0 26px 6px rgba(255, 255, 255, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: clamp(8px, 2.5vw, 12px) clamp(10px, 3vw, 14px);
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 8px 22px rgba(255, 255, 255, 0.15);
}

.copy-btn:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 10px 26px rgba(255, 255, 255, 0.22);
}

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn.copied {
  background: rgba(180, 255, 200, 0.95);
}

.copy-toast {
  pointer-events: none;
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 255, 255, .3);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  h1 {
    top: 60px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(40px, 8vw, 60px);
    /* increased min size */
  }

  .minecraft-btn {
    bottom: 12px;
    left: 12px;
    min-width: 160px;
    height: 60px;
    border-radius: 8px;
  }

  .minecraft-btn .arrow {
    display: none;
  }

  .popup {
    width: 90%;
    max-height: 90vh;
    padding: clamp(20px, 5vw, 26px);
    overflow-y: auto;
    border-radius: 12px;
  }

  .input-wrap input {
    font-size: clamp(16px, 4vw, 18px);
    padding: clamp(12px, 3.5vw, 14px);
  }

  .copy-btn {
    font-size: clamp(14px, 3.5vw, 16px);
    padding: clamp(10px, 3vw, 14px);
  }
}