/* ========================================
   Flashcard CSS – 2025-11-06 (clean version)
   ======================================== */

/* 全体 */
#flashcard-app {
  font-family: "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
  user-select: none;
}

/* カードコンテナ */
.card {
  position: relative;
  width: 100%;
  height: 200px;
  perspective: 1000px;
  margin: 20px auto;
  cursor: pointer;
  transition: transform 0.6s;
}

/* カード内面 */
.card .front,
.card .back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  padding: 20px;
  box-sizing: border-box;
}

/* 裏面 */
.card .back {
  transform: rotateY(180deg);
  background: #f7f7ff;
}

/* 裏面を表示中の状態 */
.card.show-back {
  transform: rotateY(180deg);
}

/* 操作ボタン */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 10px 0;
}

.controls button {
  background: #4b8df8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.controls button:hover {
  background: #357ae8;
}

/* カウンター表示 */
#counter {
  font-weight: bold;
  font-size: 1.1rem;
}

/* トグルスイッチ部分 */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #4b8df8;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* チェックボックスの余白 */
#question-limit-container {
  margin-top: 10px;
  font-size: 0.95rem;
}

#question-limit-container label {
  cursor: pointer;
}

/* レスポンシブ微調整 */
@media (max-width: 480px) {
  .card {
    height: 160px;
  }
  .card .front,
  .card .back {
    font-size: 1.2rem;
  }
}