body {
  background: #fdf6e3;
  color: #222;
  font-family: 'Mukti Narrow', Arial, sans-serif;
  margin: 0;
  padding: 0;
  font-size: 1.2em;
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 24px 20px 12px 20px;
  font-weight: bold;
  user-select: none;
}

header h1 {
  font-size: 2em;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.intro {
  font-weight: 500;
  font-size: 1em;
  max-width: 600px;
  margin: 0 auto;
  color: #444;
}

main {
  max-width: 620px;
  margin: 0 auto;
  padding: 30px 15px 48px 15px;
}

article h2 {
  font-size: 1.5em;
  text-align: center;
  margin-bottom: 15px;
  user-select: none;
}

.shlok-text {
  background: #fffde7;
  border-radius: 9px;
  box-shadow: 0 2px 8px #cfd8dc2f;
  padding: 24px 30px;
  font-size: 1.3em;
  line-height: 1.8;
  white-space: pre-wrap;
  text-align: center;
  font-weight: 500;
  min-height: 180px;
  user-select: text;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 28px;
  gap: 18px;
  font-weight: 600;
}

button {
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 9px 22px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s;
  user-select: none;
}

button:disabled {
  background: #aaa;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  background: #0d3d75;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
  transition: opacity 0.4s ease, max-height 0.4s ease;
  max-height: 500px; /* large enough to show buttons */
  overflow: hidden;
}

#group-selector[style*="opacity: 0"] {
  max-height: 0 !important;
  pointer-events: none;
}

#number-selector {
  opacity: 0;
  pointer-events: none;
  max-height: 0;
}

#number-selector[style*="opacity: 1"] {
  max-height: 500px !important;
  pointer-events: auto;
}

.button-group button {
  background: #4caf50;
  color: white;
  padding: 7px 16px;
  border-radius: 7px;
  font-weight: 600;
  min-width: 48px;
  user-select: none;
  transition: background-color 0.25s;
}

.button-group button:hover {
  background: #357a38;
}

.back-button {
  background: #d32f2f;
  color: white;
  border-radius: 7px;
  margin-bottom: 8px;
  padding: 8px 16px;
  user-select: none;
  transition: background-color 0.25s;
}

.back-button:hover {
  background: #9a2222;
  cursor: pointer;
}

.meaning-box {
  background: #e3f2fd;
  color: #222;
  border-radius: 7px;
  margin: 18px auto 0;
  padding: 15px 12px;
  font-size: 1.05em;
  width: 92%;
  box-shadow: 0 2px 8px #90caf92e;
  text-align: left;
  max-width: 500px;
}

.meaning-toggle {
  display: block;
  margin: 18px auto 0;
  background: #fbc02d;
  color: #222;
  border: none;
  border-radius: 5px;
  padding: 9px 18px;
  font-size: 1em;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.25s;
  user-select: none;
}

.meaning-toggle:hover {
  background: #f9a825;
}

footer p {
  font-size: 0.85em;
  color: #555;
  user-select: none;
}

@media (max-width: 600px) {
  main {
    padding: 18px 10px;
  }
  .shlok-text {
    font-size: 1.1em;
    min-height: 150px;
    padding: 20px 15px;
  }
  nav {
    margin-top: 22px;
    gap: 14px;
  }
  button {
    padding: 7px 16px;
    font-size: 0.9em;
  }
  .button-group button {
    min-width: 40px;
    padding: 7px 9px;
    font-size: 0.9em;
  }
  .meaning-box {
    padding: 12px 7px;
    font-size: 0.95em;
  }
}
