:root {
  --bg: #05070d;
  --text: rgba(205, 231, 253, 0.82);
  --accent: #7ddcff;
  --glass: rgba(255, 255, 255, 0.08);
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at top, #152238 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 400;
  margin: 0 0 clamp(2rem, 5vw, 4rem);
  letter-spacing: .08em;
  text-shadow: 0 0 30px rgba(125, 220, 255, .35);
}

main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 5vw, 4rem);
}

.container {
  text-align: center;
  width: min(90vw, 1100px);
}

.menu {
  display: grid;
  gap: clamp(1rem, 3vw, 2rem);
}

.menu-item {
  position: relative;
  display: block;
  overflow: hidden;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 24px;
  color: var(--text);
  text-decoration: none;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: .05em;
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
  backdrop-filter: blur(12px);
  transition:
      transform .25s ease,
      border-color .25s ease,
      box-shadow .25s ease,
      background .25s ease;
}

.menu-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(125, 220, 255, .25), transparent);
  transform: translateX(-100%);
  transition: transform .45s ease;
}

.menu-item:hover,
.menu-item.active {
  transform: scale(1.05) translateY(-8px);
  border-color: var(--accent);
  box-shadow:
      0 20px 60px rgba(0, 0, 0, .5),
      0 0 35px rgba(125, 220, 255, .25);
}

.menu-item:hover::before,
.menu-item.active::before {
  transform: translateX(100%);
}

.menu-item:active {
  transform: scale(.97);
}

#snow {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.snowflake {
  position: absolute;
  top: -15vh;
  color: white;
  opacity: 0.40;
  animation:
      fall linear infinite,
      drift ease-in-out infinite alternate;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, .5));
}

@keyframes fall {
  to {
      transform: translateY(120vh);
  }
}

@keyframes drift {
  from {
      margin-left: -30px;
  }
  to {
      margin-left: 30px;
  }
}

body.glow::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(125, 220, 255, .08), transparent 35%);
  pointer-events: none;
}

body.tool {
  display: flex;
  flex-direction: column;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.8rem 1.2rem;
  position: relative;
  z-index: 2;
  background: rgba(5, 7, 13, 0.5);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.2rem 0.4rem 0.2rem 0.6rem;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(4px);
}

.ctrl-group:focus-within {
  border-color: rgba(125, 220, 255, 0.2);
  box-shadow: 0 0 10px rgba(125, 220, 255, 0.04);
}

.ctrl-group label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(205, 231, 253, 0.6);
  margin-right: 0.1rem;
  user-select: none;
}

.controls input,
.controls button {
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(12px);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.controls input {
  width: 56px;
  text-align: center;
  padding: 0 2px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.controls input::-webkit-outer-spin-button,
.controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.controls button {
  width: 34px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.07);
  font-size: 1rem;
  padding: 0;
}

.controls button:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(125, 220, 255, 0.18);
  background: rgba(125, 220, 255, 0.06);
}

.controls input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(125, 220, 255, 0.15);
}

.svg-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  position: relative;
  z-index: 1;
}

.svg-container svg {
  width: min(95vw, 900px);
  height: min(80vh, 900px);
  display: block;
  filter: drop-shadow(0 0 30px rgba(125, 220, 255, 0.05));
}

@media (min-width: 900px) {
  .menu {
      grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 780px) {
  .controls {
      gap: 0.4rem 0.6rem;
      padding: 0.5rem 0.3rem;
  }
  .ctrl-group {
      padding: 0.1rem 0.2rem 0.1rem 0.4rem;
  }
  .controls input {
      width: 48px;
      font-size: 0.8rem;
      height: 30px;
  }
  .controls button {
      width: 30px;
      height: 30px;
      font-size: 0.9rem;
  }
  .ctrl-group label {
      font-size: 0.55rem;
  }
}

@media (max-width: 480px) {
  h1 {
      letter-spacing: .03em;
  }
  .menu-item {
      border-radius: 18px;
  }
}
