:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101216;
  color: #f4f5f7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, #252a36 0, #101216 45%);
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  background: rgba(16, 18, 22, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #30343d;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

p {
  margin: 4px 0 0;
  color: #9da3af;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.volume {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: #1b1e25;
  border: 1px solid #343943;
  border-radius: 12px;
}

input[type="range"] {
  width: 120px;
}

button {
  border: 0;
  color: white;
  cursor: pointer;
  font: inherit;
}

.secondary {
  padding: 10px 14px;
  border-radius: 10px;
  background: #292e38;
}

.secondary:hover {
  background: #353b48;
}

main {
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.category {
  margin-bottom: 30px;
}

.category h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: #aeb5c2;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.sound {
  min-height: 120px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, #292e38, #1c1f26);
  border: 1px solid #3b414d;
  box-shadow: 0 5px 16px rgba(0,0,0,.25);
  font-weight: 700;
  font-size: 1.05rem;
  transition: transform .08s ease, background .08s ease;
  user-select: none;
  touch-action: manipulation;
}

.sound:hover {
  background: linear-gradient(145deg, #343b48, #232730);
}

.sound:active,
.sound.playing {
  transform: scale(.96);
  background: #4a5362;
}

.error {
  margin: 24px;
  padding: 16px;
  border-radius: 12px;
  background: #512b30;
  color: #ffdce0;
}

.hidden { display: none; }

@media (max-width: 700px) {
  header {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    width: 100%;
    justify-content: flex-start;
  }

  .volume {
    flex: 1;
  }

  input[type="range"] {
    width: 100%;
  }

  main {
    padding: 14px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .sound {
    min-height: 105px;
    padding: 12px;
  }
}
