@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;600&display=swap');

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Josefin Sans', sans-serif;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 20% 20%, #14222e, #1b2a3d 70%, #0e1623);
  color: #eaeaea;
  overflow: hidden;
  user-select: none;
}

.hide {
  display: none !important;
}

/* Container */
.container {
  position: relative;
  padding: 32px;
  background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border-radius: 24px;
  text-align: center;
  box-shadow: -16px 16px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  transition: transform 0.3s ease;
}
.container:hover {
  transform: scale(1.02);
}

/* Loader Widget */
.loader-widget {
  width: 360px;
  height: 420px;
}

.loader-widget h1 {
  line-height: 1.3;
  margin-bottom: 32px;
  color: #aaffff;
  text-shadow: 0 0 12px #81ecec;
  letter-spacing: 1px;
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 5px #81ecec; }
  to { text-shadow: 0 0 20px #01b6be; }
}

/* Loader Animation */
.loader {
  position: relative;
  display: inline-block;
  height: 240px;
  width: 240px;
  border-radius: 50%;
  background: conic-gradient(rgba(1, 182, 190, 0.3) 0%, transparent 65%);
  animation: radarRotate 1.8s linear infinite;
  filter: drop-shadow(0 0 10px #01b6be);
}

@keyframes radarRotate {
  100% {
    transform: rotate(-360deg);
  }
}

.loader::before {
  content: '';
  position: absolute;
  height: 0;
  width: 0;
  top: 0;
  left: calc(50% - 8px);
  border: 8px solid transparent;
  border-top: 120px solid #81ecec;
  filter: drop-shadow(0 0 12px #01b6be);
}

/* Loader Content */
.loader-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  transition: all 0.4s ease;
}

.loader-content button {
  position: relative;
  cursor: pointer;
  height: 240px;
  width: 240px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 50%;
  background-color: #223140;
  color: #eaeaea;
  border: none;
  box-shadow: 0 0 12px #81ecec;
  transition: background 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.loader-content button:hover {
  background-color: #1f3c4e;
  transform: scale(1.05);
}

.loader-content button:before {
  content: '';
  position: absolute;
  height: 100%;
  width: 100%;
  top: -2px;
  left: -2px;
  border: 2px solid #7ed6d4;
  border-radius: 50%;
  animation: btnRing 2s linear infinite;
}

@keyframes btnRing {
  60%, 100% {
    height: calc(100% + 60px);
    width: calc(100% + 60px);
    top: -32px;
    left: -32px;
    opacity: 0;
  }
}

.loader-content button:after {
  content: '';
  position: absolute;
  height: calc(100% + 4px);
  width: calc(100% + 4px);
  top: -2px;
  left: -2px;
  background: linear-gradient(45deg, #25476e, #c7ecee);
  z-index: -1;
  border-radius: 50%;
}

.loader-content.result button {
  height: 120px;
  width: 120px;
  margin-top: 16px;
}

/* Speed Display */
.content {
  display: flex;
  width: 100%;
  font-size: 64px;
  margin: 12px 0 32px 0;
  flex-direction: column;
  color: #aaffff;
  text-shadow: 0 0 12px #81ecec;
  transition: color 0.3s ease, transform 0.3s ease;
}

.content small {
  font-size: 40%;
  color: #d1ffff;
}

/* Responsive */
@media (max-width: 480px) {
  .loader-widget {
    width: 280px;
    height: 360px;
  }
  .loader-content button {
    height: 180px;
    width: 180px;
    font-size: 16px;
  }
  .content {
    font-size: 48px;
  }
}
