/* ==========================================================================
   Apple Human Interface Guidelines (HIG) Stylesheet - TOEIC Voca Master
   ========================================================================== */

:root {
  /* Apple System Colors (Light Mode) */
  --apple-bg: #f5f5f7;
  --apple-card: #ffffff;
  --apple-card-hover: #fafafa;
  --apple-subtle: #ebecee;
  --apple-border: rgba(0, 0, 0, 0.08);
  --apple-border-focus: #0071e3;

  --apple-text: #1d1d1f;
  --apple-text-secondary: #6e6e73;
  --apple-text-tertiary: #86868b;

  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blue-light: rgba(0, 113, 227, 0.08);

  --apple-green: #34c759;
  --apple-green-light: rgba(52, 199, 89, 0.1);
  --apple-red: #ff3b30;
  --apple-red-light: rgba(255, 59, 48, 0.1);
  --apple-amber: #ff9500;
  --apple-amber-light: rgba(255, 149, 0, 0.1);

  --apple-glass-bg: rgba(245, 245, 247, 0.82);
  --apple-glass-border: rgba(255, 255, 255, 0.6);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-elevated: 0 16px 36px rgba(0, 0, 0, 0.08);

  --spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.25s var(--spring);
}

[data-theme="dark"] {
  /* Apple System Colors (Dark Mode) */
  --apple-bg: #000000;
  --apple-card: #1c1c1e;
  --apple-card-hover: #2c2c2e;
  --apple-subtle: #2c2c2e;
  --apple-border: rgba(255, 255, 255, 0.12);
  --apple-border-focus: #2997ff;

  --apple-text: #f5f5f7;
  --apple-text-secondary: #a1a1a6;
  --apple-text-tertiary: #6e6e73;

  --apple-blue: #2997ff;
  --apple-blue-hover: #0077ed;
  --apple-blue-light: rgba(41, 151, 255, 0.15);

  --apple-glass-bg: rgba(28, 28, 30, 0.8);
  --apple-glass-border: rgba(255, 255, 255, 0.1);

  --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 20px 48px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Pretendard", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--apple-bg);
  color: var(--apple-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.47;
  letter-spacing: -0.015em;
  transition: background-color 0.3s var(--spring), color 0.3s var(--spring);
}

/* ==========================================================================
   Header & Segmented Navigation (Apple Translucent Bar)
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--apple-glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--apple-border);
  transition: var(--transition);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
}

.brand-logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--apple-text);
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--apple-subtle);
  color: var(--apple-text-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apple-auth-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--apple-text);
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.apple-auth-btn:hover {
  background: var(--apple-subtle);
  border-color: var(--apple-blue);
}

.apple-auth-btn.logged-in {
  background: var(--apple-blue-light);
  border-color: var(--apple-blue);
  color: var(--apple-blue);
}

.auth-avatar-img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.apple-pill-select {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--apple-text-secondary);
  box-shadow: var(--shadow-subtle);
}

.apple-pill-select select {
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--apple-text);
  outline: none;
  cursor: pointer;
}

.theme-toggle-btn {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  color: var(--apple-text);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--apple-subtle);
}

/* ==========================================================================
   Apple Auth & Cloud Sync Modal
   ========================================================================== */

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  padding: 20px;
  transition: opacity 0.25s var(--spring);
}

.auth-modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.auth-modal-card {
  background: var(--apple-card);
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  box-shadow: var(--shadow-elevated);
  text-align: center;
  position: relative;
  transform: scale(0.94);
  transition: transform 0.3s var(--spring);
}

.auth-modal-backdrop.active .auth-modal-card {
  transform: scale(1);
}

.auth-modal-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: var(--apple-blue-light);
  color: var(--apple-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}

.auth-modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-modal-desc {
  font-size: 0.88rem;
  color: var(--apple-text-secondary);
  line-height: 1.55;
  margin-bottom: 24px;
}

.btn-google-login {
  width: 100%;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  padding: 13px 18px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.08);
  transition: var(--transition);
  margin-bottom: 12px;
}

.btn-google-login:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.15);
}

.auth-modal-close-btn {
  background: transparent;
  border: none;
  color: var(--apple-text-tertiary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.auth-modal-close-btn:hover {
  color: var(--apple-text);
  background: var(--apple-subtle);
}

.auth-profile-info-box {
  background: var(--apple-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  text-align: left;
}

.auth-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-profile-img-lg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-profile-name {
  font-weight: 700;
  font-size: 1rem;
}

.auth-profile-email {
  font-size: 0.8rem;
  color: var(--apple-text-secondary);
}

.auth-sync-badge-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--apple-green);
  font-weight: 600;
}

.btn-logout {
  width: 100%;
  background: var(--apple-subtle);
  color: var(--apple-red);
  border: none;
  padding: 12px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 10px;
}

.btn-logout:hover {
  background: var(--apple-red-light);
}

/* Apple Segmented Control Navigation */
.nav-segmented-bar {
  background: var(--apple-glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--apple-border);
  padding: 8px 16px;
}

.nav-segmented-inner {
  max-width: 640px;
  margin: 0 auto;
  background: var(--apple-subtle);
  padding: 3px;
  border-radius: var(--radius-full);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-segmented-inner::-webkit-scrollbar {
  display: none;
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--apple-text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition);
}

.segment-btn:hover {
  color: var(--apple-text);
}

.segment-btn.active {
  background: var(--apple-card);
  color: var(--apple-text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.segment-counter {
  font-size: 0.72rem;
  background: var(--apple-blue-light);
  color: var(--apple-blue);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.main-content {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 80px;
  flex: 1;
}

.view-section {
  display: none;
  animation: appleFadeIn 0.35s var(--spring);
}

.view-section.active {
  display: block;
}

@keyframes appleFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Subtle Status Summary Pill (Apple HIG - Quiet & Unobtrusive) */
.subtle-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--apple-text-secondary);
  margin-bottom: 24px;
  box-shadow: var(--shadow-subtle);
  flex-wrap: wrap;
}

.status-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--apple-amber-light);
  color: var(--apple-amber);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8rem;
}

.status-sync-indicator {
  font-size: 0.75rem;
  color: var(--apple-text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* Daily Goal Bar in Hero Card */
.hero-daily-goal-box {
  margin-bottom: 20px;
  max-width: 320px;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--apple-text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.goal-header strong {
  color: var(--apple-text);
  font-weight: 600;
}

.goal-bar-track {
  height: 6px;
  background: var(--apple-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.goal-bar-fill {
  height: 100%;
  background: var(--apple-green);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--spring);
}

/* ==========================================================================
   Apple HIG Hero Focus Card (Today's Next Action)
   ========================================================================== */

.hero-focus-card {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.hero-content {
  flex: 1;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--apple-blue);
  margin-bottom: 8px;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--apple-text);
  margin-bottom: 6px;
}

.hero-desc {
  font-size: 1rem;
  color: var(--apple-text-secondary);
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-apple-primary {
  background: var(--apple-blue);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
  transition: var(--transition);
}

.btn-apple-primary:hover {
  background: var(--apple-blue-hover);
  transform: scale(1.02);
}

.btn-apple-secondary {
  background: var(--apple-subtle);
  color: var(--apple-text);
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

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

.hero-visual {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: var(--apple-blue-light);
  color: var(--apple-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Course Browsing (Week Filter & Minimal Day Tiles)
   ========================================================================== */

.course-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.course-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Week Filter Pills */
.week-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.week-pill {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  color: var(--apple-text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.week-pill:hover {
  background: var(--apple-subtle);
  color: var(--apple-text);
}

.week-pill.active {
  background: var(--apple-text);
  color: var(--apple-card);
  border-color: var(--apple-text);
}

/* Minimal Day Tiles (No button clutter!) */
.minimal-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.day-tile {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  position: relative;
}

.day-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--apple-blue);
}

.day-tile.active-selected {
  border-color: var(--apple-blue);
  background: var(--apple-blue-light);
}

.day-tile.completed {
  border-color: rgba(52, 199, 89, 0.4);
}

.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tile-day-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--apple-text-tertiary);
}

.tile-completed-mark {
  font-size: 0.8rem;
  color: var(--apple-green);
}

.tile-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--apple-text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--apple-text-tertiary);
}

.tile-micro-bar {
  width: 60px;
  height: 4px;
  background: var(--apple-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.tile-micro-fill {
  height: 100%;
  background: var(--apple-blue);
  border-radius: var(--radius-full);
}

.day-tile.completed .tile-micro-fill {
  background: var(--apple-green);
}

/* ==========================================================================
   Apple Action Sheet / Bottom Modal
   ========================================================================== */

.action-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s var(--spring);
}

.action-sheet-backdrop.active {
  display: flex;
  opacity: 1;
}

.action-sheet-modal {
  background: var(--apple-card);
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 36px;
  box-shadow: var(--shadow-elevated);
  transform: translateY(100%);
  transition: transform 0.35s var(--spring);
}

@media (min-width: 640px) {
  .action-sheet-backdrop {
    align-items: center;
  }
  .action-sheet-modal {
    border-radius: var(--radius-lg);
    padding: 28px 24px;
  }
}

.action-sheet-backdrop.active .action-sheet-modal {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--apple-subtle);
  border-radius: var(--radius-full);
  margin: 0 auto 18px;
}

.sheet-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.sheet-sub {
  font-size: 0.88rem;
  color: var(--apple-text-secondary);
  text-align: center;
  margin-bottom: 24px;
}

.sheet-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-action-item {
  background: var(--apple-subtle);
  border: none;
  padding: 15px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--apple-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.sheet-action-item:hover {
  background: var(--apple-blue);
  color: #ffffff;
}

.sheet-cancel-btn {
  background: transparent;
  border: 1px solid var(--apple-border);
  color: var(--apple-text-secondary);
  margin-top: 10px;
}

.sheet-cancel-btn:hover {
  background: var(--apple-subtle);
  color: var(--apple-text);
}

/* ==========================================================================
   Flashcard View (Clean Apple Minimalist)
   ========================================================================== */

.flashcard-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.fc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.fc-day-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.fc-progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--apple-text-tertiary);
}

.fc-bar-track {
  height: 4px;
  background: var(--apple-subtle);
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  overflow: hidden;
}

.fc-bar-fill {
  height: 100%;
  background: var(--apple-blue);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.card-scene {
  perspective: 1000px;
  width: 100%;
  height: 360px;
  margin-bottom: 24px;
  cursor: pointer;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s var(--spring);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

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

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
}

.card-face.card-back {
  transform: rotateY(180deg);
  background: var(--apple-card);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-number-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--apple-text-tertiary);
}

.card-bookmark-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--apple-text-tertiary);
  cursor: pointer;
  transition: var(--transition);
}

.card-bookmark-btn.active {
  color: var(--apple-amber);
}

.card-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.card-english-word {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.card-audio-btn {
  background: var(--apple-blue-light);
  color: var(--apple-blue);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.card-audio-btn:hover {
  background: var(--apple-blue);
  color: #fff;
}

.card-korean-meaning {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--apple-text);
  line-height: 1.35;
  margin-bottom: 12px;
}

.card-collocation-tag {
  display: inline-block;
  font-size: 0.78rem;
  background: var(--apple-subtle);
  color: var(--apple-text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.card-bottom-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--apple-text-tertiary);
}

/* Flashcard Controls */
.fc-controls {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;
}

.btn-review {
  background: var(--apple-subtle);
  color: var(--apple-red);
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-review:hover {
  background: var(--apple-red-light);
}

.btn-flip {
  background: var(--apple-card);
  color: var(--apple-text);
  border: 1px solid var(--apple-border);
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.btn-flip:hover {
  background: var(--apple-subtle);
}

.btn-master {
  background: var(--apple-subtle);
  color: var(--apple-green);
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-master:hover {
  background: var(--apple-green-light);
}

.fc-shortcut-legend {
  text-align: center;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--apple-text-tertiary);
}

kbd {
  background: var(--apple-subtle);
  border: 1px solid var(--apple-border);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ==========================================================================
   Autoplay View (Apple Audio Player Feel)
   ========================================================================== */

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

.ap-player-card {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
  text-align: center;
  margin-bottom: 24px;
}

.ap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.ap-day-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--apple-blue);
  background: var(--apple-blue-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.ap-audio-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wave-bar {
  width: 3px;
  height: 12px;
  background: var(--apple-blue);
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.2s; height: 18px; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; height: 14px; }

@keyframes wave {
  from { transform: scaleY(0.4); }
  to { transform: scaleY(1.2); }
}

.ap-audio-indicator.paused .wave-bar {
  animation: none;
  transform: scaleY(0.3);
  background: var(--apple-text-tertiary);
}

.ap-word-display {
  margin: 28px 0;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.ap-english {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.ap-meaning {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--apple-blue);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ap-meaning.visible {
  opacity: 1;
  transform: translateY(0);
}

.ap-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--apple-text-tertiary);
  margin-bottom: 6px;
}

.ap-progress-track {
  height: 4px;
  background: var(--apple-subtle);
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  overflow: hidden;
}

.ap-progress-fill {
  height: 100%;
  background: var(--apple-blue);
  width: 0%;
  transition: width 0.3s linear;
}

.ap-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.ap-ctrl-btn {
  background: var(--apple-subtle);
  border: none;
  color: var(--apple-text);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.ap-ctrl-btn:hover {
  background: var(--apple-border);
}

.ap-play-btn {
  background: var(--apple-blue);
  color: #fff;
  width: 56px;
  height: 56px;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.ap-play-btn:hover {
  background: var(--apple-blue-hover);
  transform: scale(1.04);
}

.ap-settings-panel {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
}

.ap-setting-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--apple-text-secondary);
}

.ap-setting-item select {
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--apple-border);
  background: var(--apple-subtle);
  color: var(--apple-text);
  font-size: 0.82rem;
  outline: none;
}

/* ==========================================================================
   Quiz View
   ========================================================================== */

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

.quiz-setup-card {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
}

.setup-group {
  margin-bottom: 22px;
}

.setup-label {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
  color: var(--apple-text-secondary);
}

.setup-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-btn {
  background: var(--apple-subtle);
  border: 1px solid transparent;
  color: var(--apple-text);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

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

.option-btn.selected {
  background: var(--apple-blue);
  color: #fff;
}

.btn-start-quiz {
  width: 100%;
  background: var(--apple-blue);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
  transition: var(--transition);
  margin-top: 10px;
}

.btn-start-quiz:hover {
  background: var(--apple-blue-hover);
  transform: scale(1.02);
}

.quiz-play-screen {
  display: none;
}

.quiz-play-screen.active {
  display: block;
}

.quiz-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.quiz-score-badge {
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.quiz-combo-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--apple-amber);
}

.time-attack-track {
  height: 4px;
  background: var(--apple-subtle);
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  overflow: hidden;
}

.time-attack-fill {
  height: 100%;
  background: var(--apple-blue);
  border-radius: var(--radius-full);
  width: 100%;
}

.quiz-question-box {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow-subtle);
}

.quiz-prompt-type {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--apple-text-tertiary);
  margin-bottom: 8px;
}

.quiz-prompt-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 10px;
}

.quiz-prompt-audio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--apple-blue-light);
  color: var(--apple-blue);
  border: none;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.quiz-choices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.choice-item {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.choice-item:hover:not(.disabled) {
  border-color: var(--apple-blue);
}

.choice-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.choice-num {
  width: 24px;
  height: 24px;
  background: var(--apple-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--apple-text-secondary);
}

.choice-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--apple-text);
}

.choice-eliminate-btn {
  background: none;
  border: none;
  color: var(--apple-text-tertiary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
}

.choice-eliminate-btn:hover {
  color: var(--apple-red);
}

.choice-item.eliminated {
  opacity: 0.35;
  text-decoration: line-through;
  background: var(--apple-subtle);
}

.choice-item.correct {
  background: var(--apple-green-light) !important;
  border-color: var(--apple-green) !important;
  color: var(--apple-green) !important;
}

.choice-item.wrong {
  background: var(--apple-red-light) !important;
  border-color: var(--apple-red) !important;
  color: var(--apple-red) !important;
}

/* Result Screen */
.quiz-result-screen {
  display: none;
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.quiz-result-screen.active {
  display: block;
}

.result-emoji {
  font-size: 3rem;
  margin-bottom: 8px;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.result-score-box {
  background: var(--apple-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0;
  display: flex;
  justify-content: space-around;
}

.res-stat-val {
  font-size: 1.4rem;
  font-weight: 700;
}

.res-stat-lbl {
  font-size: 0.78rem;
  color: var(--apple-text-secondary);
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* ==========================================================================
   Review & Search Views (Clean Apple Table)
   ========================================================================== */

.filter-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.pill-btn {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  color: var(--apple-text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.pill-btn:hover {
  background: var(--apple-subtle);
}

.pill-btn.active {
  background: var(--apple-blue);
  color: #fff;
  border-color: var(--apple-blue);
}

.words-table-wrap {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.word-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--apple-border);
  transition: var(--transition);
}

.word-list-item:last-child {
  border-bottom: none;
}

.word-list-item:hover {
  background: var(--apple-card-hover);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.item-day-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--apple-subtle);
  color: var(--apple-text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

.item-word {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--apple-text);
  min-width: 140px;
}

.item-meaning {
  font-size: 0.92rem;
  color: var(--apple-text-secondary);
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--apple-text-tertiary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--apple-subtle);
  color: var(--apple-text);
}

.icon-btn.active-star {
  color: var(--apple-amber);
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--apple-text-tertiary);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.search-input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  color: var(--apple-text);
  outline: none;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--apple-blue);
}

.search-icon-fixed {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--apple-text-tertiary);
  font-size: 0.95rem;
  pointer-events: none;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(30, 30, 30, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-focus-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 22px;
  }
  .hero-visual {
    display: none;
  }
  .minimal-days-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .card-scene {
    height: 300px;
  }
  .card-english-word {
    font-size: 1.8rem;
  }
  .card-korean-meaning {
    font-size: 1.3rem;
  }
}
