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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  text-align: center;
  font-size: 1.4rem;
  color: #1d4ed8;
  margin-bottom: 16px;
}

/* タブ */
.tabs {
  display: flex;
  border-bottom: 2px solid #3b82f6;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #64748b;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab.active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  font-weight: bold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* スコアバー */
.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.score-bar strong {
  color: #1d4ed8;
}

/* フラッシュカード */
.flashcard {
  perspective: 800px;
  height: 200px;
  margin-bottom: 16px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}

.card-inner.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 20px;
}

.card-back {
  transform: rotateY(180deg);
  background: #eff6ff;
}

.card-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.card-word {
  font-size: 1.8rem;
  font-weight: bold;
  color: #1e293b;
  text-align: center;
  word-break: break-word;
}

.card-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 12px;
}

/* クイズボタン */
.quiz-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-next {
  background: #3b82f6;
  color: #fff;
  width: 100%;
}

.btn-correct {
  background: #22c55e;
  color: #fff;
  flex: 1;
}

.btn-wrong {
  background: #ef4444;
  color: #fff;
  flex: 1;
}

.btn-small {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: #e2e8f0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-left: auto;
}

.btn-add {
  background: #3b82f6;
  color: #fff;
  white-space: nowrap;
}

/* 単語管理 */
.form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.form-row input {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
}

.form-row input:focus {
  outline: none;
  border-color: #3b82f6;
}

#word-list {
  list-style: none;
}

#word-list li {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  gap: 10px;
}

.word-text {
  font-weight: bold;
  color: #1d4ed8;
  min-width: 80px;
}

.meaning-text {
  flex: 1;
  color: #475569;
  font-size: 0.9rem;
}

.btn-delete {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-delete:hover {
  background: #fee2e2;
  color: #ef4444;
}

.empty-msg {
  text-align: center;
  color: #94a3b8;
  padding: 40px 20px;
  font-size: 0.95rem;
}

@media (max-width: 375px) {
  h1 { font-size: 1.2rem; }
  .card-word { font-size: 1.5rem; }
  .form-row { flex-direction: column; }
  .form-row input { min-width: unset; }
}
