* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Roboto, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #140f1f, #1f1235, #2a1650);
  color: #f5f3ff;
}

.container {
  background: rgba(124, 58, 237, 0.08);
  padding: 32px 42px;
  border-radius: 18px;
  box-shadow: 
    0 0 40px rgba(124, 58, 237, 0.2),
    0 0 80px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header h1 {
  margin-bottom: 0;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 22px;
  color: #c4b5fd;
  letter-spacing: 0.6px;
}

label {
  display: block;
  text-align: left;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

input[type="number"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: none;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.15);
  color: #f5f3ff;
  font-size: 1rem;
  transition: 0.25s;
}

input[type="number"]:focus {
  outline: none;
  background: rgba(139, 92, 246, 0.25);
  box-shadow: 
    0 0 0 2px #8b5cf6,
    0 0 12px rgba(139, 92, 246, 0.8);
}

.result {
  font-size: 1.05rem;
  margin-bottom: 20px;
  min-height: 24px;
  color: #ddd6fe;
}

input[type="submit"] {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

input[type="submit"]:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.7);
}

input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: none;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
  z-index: 999;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: linear-gradient(135deg, #1f1235, #2a1650);
  padding: 25px 30px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
  transform: scale(0.9);
  transition: 0.3s;
}

.modal button {
  margin-top: 18px;
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modal p {
  padding: 10px 20px;
}

.modal button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.7);
}

.modal button:active {
  transform: translateY(0);
  box-shadow: none;
}

.info-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(168, 85, 247, 0.2);
  color: #c4b5fd;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s ease;
}

.info-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
  transform: scale(1.1);
}

.info-btn:active {
  transform: scale(0.95);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

@media (max-width: 400px) {
  .container {
    padding: 25px 20px;
  }

  h1 {
    font-size: 1.3rem;
  }
}
