* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f4f5;
  color: #18181b;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
}

.container {
  width: 100%;
  max-width: 540px;
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

select {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #d4d4d8;
  background: #fff;
  font-size: 0.95rem;
}

.btn-reset {
  padding: 8px 12px;
  font-size: 0.85rem;
  background: transparent;
  color: #71717a;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  cursor: pointer;
}

.btn-reset:hover {
  background: #f4f4f5;
  color: #18181b;
}

.card {
  min-height: 220px;
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 20px;
  font-size: 1.15rem;
  line-height: 1.5;
  cursor: pointer;
  background: #fafafa;
  user-select: none;
  -webkit-user-select: none;
}

.card img {
  max-width: 100%;
  max-height: 280px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  margin: 12px 0;
  pointer-events: none;
}

.cloze {
  color: #2563eb;
  font-weight: 700;
}

.cloze-ans {
  color: #16a34a;
  font-weight: 700;
}

.placeholder {
  color: #a1a1aa;
  font-size: 1rem;
}

.btn-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.btn-rating {
  padding: 10px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-again { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.btn-hard  { background: #fef3c7; color: #d97706; border-color: #fde68a; }
.btn-good  { background: #dbeafe; color: #2563eb; border-color: #bfdbfe; }
.btn-easy  { background: #dcfce7; color: #16a34a; border-color: #bbf7d0; }