:root {
  --primary-green: #059669;
  --accent-orange: #f59e0b;
  --bg-light: #f3f4f6;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none;
}

body {
  background-color: var(--bg-light);
  color: var(--text-main);
  padding: 16px;
}

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

/* User Header & Control Bar */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-bottom: 12px;
}

.stats-badge {
  font-size: 12px;
  background-color: #e0f2fe;
  color: #0369a1;
  padding: 4px 8px;
  border-radius: 20px;
  font-weight: 600;
}

/* Flashcard Container persis Gambar */
.flashcard-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: opacity 0.2s ease;
}

.card-main-layout {
  display: flex;
  min-height: 140px;
}

/* Baris/Pita Hijau Sisi Kiri */
.green-stripe {
  width: 22px;
  background-color: var(--primary-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.card-content-wrapper {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.top-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.word-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kanji-title {
  font-size: 28px;
  font-weight: bold;
  color: #111827;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 18px;
  padding: 2px;
  border-radius: 50%;
  transition: color 0.2s;
}

.audio-icon-btn:hover {
  color: var(--primary-green);
}

.furigana-sub {
  font-size: 15px;
  color: #9ca3af;
  margin-top: 2px;
}

.tag-pos {
  background-color: var(--accent-orange);
  color: white;
  font-weight: bold;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  align-self: center;
  margin: 0 10px;
}

.divider-vertical {
  width: 2px;
  background-color: #e5e7eb;
  margin: 0 10px;
  align-self: stretch;
}

.meaning-section {
  flex: 1;
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 500;
  color: #374151;
  padding-left: 6px;
}

/* Checkbox Hafal Kanan Atas */
.checkbox-mastered {
  width: 26px;
  height: 26px;
  border: 2px solid var(--primary-green);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.checkbox-mastered.active {
  background-color: var(--primary-green);
}

.checkbox-mastered.active::after {
  content: "✓";
  color: white;
  font-weight: bold;
  font-size: 16px;
}

/* Bagian Bottom Contoh Kalimat */
.sentence-bottom-section {
  border-top: 1px solid #f3f4f6;
  padding: 12px 16px;
  background-color: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.sentence-text {
  font-size: 17px;
  color: #1f2937;
  line-height: 1.6;
}

ruby rt {
  font-size: 10px;
  color: #6b7280;
}

.sentence-meaning {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  font-style: italic;
}

/* Navigation Bar Bottom */
.nav-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #f9fafb;
}

.btn-primary {
  background-color: var(--primary-green);
  color: white;
}

.btn-primary:hover {
  background-color: #047857;
}

.btn-accent {
  background-color: #8b5cf6;
  color: white;
}

.btn-accent:hover {
  background-color: #7c3aed;
}

/* Modal Form */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 14px;
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
