html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  background: var(--tg-theme-bg-color, #f3f5f8);
  color: var(--tg-theme-text-color, #1a1a1a);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.card {
  background: var(--tg-theme-secondary-bg-color, #fff);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

form {
  display: grid;
  gap: 8px;
}

input,
select,
button {
  padding: 10px;
  border: 1px solid #d8dbe1;
  border-radius: 8px;
  font-size: 14px;
}

button {
  background: var(--tg-theme-button-color, #2f80ed);
  color: var(--tg-theme-button-text-color, #fff);
  border: 0;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

ul {
  padding-left: 16px;
}

.muted {
  color: #5b6270;
}

.study-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.quiz-card {
  border: 1px solid #e4e6eb;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

/* Quiz Styles */
.hidden {
  display: none !important;
}

.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  margin-top: 20px;
}

.card-front, .card-back {
  background: var(--tg-theme-secondary-bg-color, #fff);
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-front h3 {
  font-size: 24px;
  margin: 0;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.actions button {
  padding: 12px 4px;
  font-size: 12px;
}

.show-answer-btn {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: bold;
}
