/* ===== 設定バー ===== */
.settings-bar {
  margin-bottom: 0.75rem;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.settings-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.settings-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.import-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}

.import-btn:hover {
  background: var(--border);
}

.settings-btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.settings-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
}

.wordbook-name {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-top: 0.4rem;
}

/* ===== 進捗 ===== */
.progress-section {
  margin-bottom: 0.75rem;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.progress-bar {
  height: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: width 0.3s;
}

.progress-stats {
  font-size: 0.8rem;
  color: var(--text-sub);
  display: flex;
  gap: 1rem;
}

.progress-stats span::before {
  margin-right: 0.2rem;
}

/* ===== フラッシュカード ===== */
.card-area {
  perspective: 1200px;
  margin-bottom: 0.75rem;
}

.flashcard {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  cursor: pointer;
  user-select: none;
}

.card-inner {
  position: relative;
  width: 100%;
  min-height: 220px;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card-face {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-back {
  transform: rotateY(180deg);
  border-style: dashed;
}

.card-label {
  font-size: 0.7rem;
  color: var(--text-sub);
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.card-word {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

.card-sub {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 0.5rem;
  text-align: center;
}

.flip-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-top: 0.5rem;
  opacity: 0.5;
}

/* ===== アクションボタン ===== */
.action-btns {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  max-width: 520px;
  margin: 0.8rem auto 0;
}

.btn-known,
.btn-unknown {
  flex: 1;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-known:hover {
  background: var(--bg);
}

.btn-unknown:hover {
  background: var(--bg);
}

.skip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 520px;
  margin: 0.4rem auto 0;
}

.skip-btn {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--text-sub);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
}

.skip-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.btn-quit {
  font-size: 0.78rem;
  color: var(--text-sub);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
}

.btn-quit:hover {
  color: var(--text);
  background: var(--bg);
}

/* ===== 完了画面 ===== */
.complete-card {
  text-align: center;
}

.complete-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.complete-score {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
}

.complete-stats {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

/* ===== 編集モーダル ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-sub);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-hint {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin: 0 0 0.75rem;
}

.modal-btns {
  margin-top: 0.75rem;
  justify-content: flex-start;
}

@media (max-width: 480px) {
  .card-word { font-size: 1.6rem; }
  .card-face { padding: 1.5rem 1.25rem; min-height: 180px; }
  .action-btns { flex-direction: column; }
}
