/* ── Herb Flashcards Plugin – scoped to .hfc-app ── */
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@300;400;700;900&family=Noto+Serif+Hebrew:wght@300;400;700&display=swap');

.hfc-app {
  --hfc-bg:           #faf8f4;   /* רקע ראשי — קרם בהיר */
  --hfc-surface:      #ffffff;   /* כרטיסים / משטחים */
  --hfc-surface2:     #f0e8de;   /* משטח משני — קרם כהה יותר */
  --hfc-gold:         #8b5c2a;   /* צבע הדגש הראשי — חום */
  --hfc-gold-light:   #c49a6c;   /* דגש בהיר */
  --hfc-gold-dim:     #5a3c1a;   /* דגש כהה / hover */
  --hfc-green:        #5a7a4a;   /* צבע משני — ירוק עפר */
  --hfc-green-light:  #7a9a6a;   /* ירוק בהיר */
  --hfc-red:          #8b3a2a;   /* שגיאה / אזהרה */
  --hfc-red-light:    #c46050;   /* שגיאה בהירה */
  --hfc-text:         #2c2c2c;   /* טקסט ראשי */
  --hfc-text-dim:     #7a7a7a;   /* טקסט מעומעם */
  --hfc-text-muted:   #a09080;   /* טקסט שקט */



  box-sizing: border-box;
  font-family: 'Frank Ruhl Libre', 'Noto Serif Hebrew', serif;
  color: var(--hfc-text);
  background: var(--hfc-bg);
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 12px;
  overflow: hidden;
  position: relative;
}

.hfc-app *, .hfc-app *::before, .hfc-app *::after {
  box-sizing: border-box;
}

/* background glow */
.hfc-app::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, rgba(201,168,76,.07) 0%, transparent 55%),
    radial-gradient(ellipse 50% 70% at 85% 90%, rgba(61,122,90,.06) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.hfc-app > * { position: relative; z-index: 1; }

/* ── Header ── */
.hfc-header {
  width: 100%; text-align: center;
  padding: 12px 0 6px; flex-shrink: 0;
}
.hfc-title-zh { font-size: 10px; letter-spacing: 6px; color: var(--hfc-gold-dim); margin-bottom: 2px; }
.hfc-title    { font-size: 20px; font-weight: 900; color: var(--hfc-gold-light); margin: 0; }

/* ── Category select ── */
.hfc-cat-select-wrap {
  width: 100%; flex-shrink: 0;
  padding: 4px 0 6px; position: relative;
}
.hfc-cat-select {
  width: 100%;
  background: var(--hfc-surface);
  border: 1px solid var(--hfc-surface2);
  color: var(--hfc-gold);
  font-family: inherit; font-size: 13px;
  padding: 9px 14px 9px 36px;
  border-radius: 10px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  outline: none; direction: rtl;
  transition: border-color .2s;
}
.hfc-cat-select:focus { border-color: var(--hfc-gold-dim); }
.hfc-cat-select option { background: #1e1a14; color: var(--hfc-text); }
.hfc-cat-arrow {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--hfc-gold-dim); font-size: 12px;
}

/* ── Progress ── */
.hfc-progress-wrap { width: 100%; margin: 4px 0; flex-shrink: 0; }
.hfc-progress-track {
  height: 3px; background: var(--hfc-surface2); border-radius: 2px;
  overflow: hidden; margin-bottom: 8px;
}
.hfc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hfc-gold-dim), var(--hfc-gold));
  border-radius: 2px; transition: width .4s ease; width: 0%;
}
.hfc-progress-info {
  display: flex; justify-content: space-between; align-items: center;
}
.hfc-badge {
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.hfc-badge-known   { background: rgba(61,122,90,.25);  color: var(--hfc-green-light); }
.hfc-badge-unknown { background: rgba(122,61,61,.25);  color: var(--hfc-red-light); }
.hfc-badge-left    { background: rgba(201,168,76,.12); color: var(--hfc-gold); }

/* ── Round badge ── */
.hfc-round-badge {
  font-size: 11px; color: var(--hfc-text-muted);
  text-align: center; flex-shrink: 0;
  letter-spacing: 1px; min-height: 16px;
}

/* ── Stack area ── */
.hfc-stack-area {
  position: relative; flex: 1; width: 100%;
  display: flex; align-items: stretch; justify-content: center;
  min-height: 0; padding: 10px 0 6px;
}

.hfc-stack-shadow {
  position: absolute; left: 50%;
  width: calc(100% - 32px); max-width: 420px;
  border-radius: 18px; pointer-events: none;
}
.hfc-stack-shadow-1 {
  top: 16px; bottom: 2px;
  transform: translateX(-50%) scale(.96);
  background: var(--hfc-surface2); opacity: .5;
  border: 1px solid rgba(255,255,255,.03);
}
.hfc-stack-shadow-2 {
  top: 24px; bottom: -4px;
  transform: translateX(-50%) scale(.91);
  background: var(--hfc-surface); opacity: .3;
  border: 1px solid rgba(255,255,255,.02);
}

/* ── Card container ── */
.hfc-card-container {
  position: relative;
  width: calc(100% - 32px); max-width: 420px;
  cursor: grab; touch-action: none; z-index: 10;
  display: flex; flex-direction: column;
}
.hfc-card-container:active { cursor: grabbing; }

/* ── Card ── */
.hfc-card {
  width: 100%; flex: 1; min-height: 0;
  background: var(--hfc-surface);
  border: 1px solid var(--hfc-surface2);
  border-radius: 18px; padding: 24px 24px 36px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.04) inset;
  user-select: none;
}
.hfc-card::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,.3), transparent);
}

/* Swipe overlays */
.hfc-overlay-know, .hfc-overlay-unknown {
  position: absolute; inset: 0; border-radius: 18px;
  opacity: 0; pointer-events: none; transition: opacity .1s;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 900; letter-spacing: 2px;
}
.hfc-overlay-know    { background: rgba(61,122,90,.18);  color: var(--hfc-green-light); border: 2px solid var(--hfc-green); }
.hfc-overlay-unknown { background: rgba(122,61,61,.18);  color: var(--hfc-red-light);   border: 2px solid var(--hfc-red); }

/* Card content */
.hfc-card-category {
  font-size: 10px; letter-spacing: 3px; color: var(--hfc-gold-dim);
  margin-bottom: 10px; flex-shrink: 0;
}
.hfc-card-name {
  font-size: clamp(22px, 5vw, 34px); font-weight: 700;
  color: var(--hfc-gold-light); font-style: italic;
  margin-bottom: 14px; line-height: 1.2; flex-shrink: 0;
}
.hfc-card-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hfc-surface2), transparent);
  margin-bottom: 14px; flex-shrink: 0;
}
.hfc-card-props-label {
  font-size: 10px; letter-spacing: 3px; color: var(--hfc-text-muted);
  margin-bottom: 8px; flex-shrink: 0;
}
.hfc-card-props {
  font-size: 14px; line-height: 1.7; color: var(--hfc-text);
  font-weight: 300; flex: 1; min-height: 0; overflow-y: auto;
}
.hfc-card-props::-webkit-scrollbar { width: 3px; }
.hfc-card-props::-webkit-scrollbar-thumb { background: var(--hfc-surface2); border-radius: 2px; }
.hfc-card-number {
  position: absolute; bottom: 10px; left: 16px;
  font-size: 10px; color: var(--hfc-text-muted);
}

/* Swipe hints */
.hfc-swipe-hints {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 100%; left: 0;
  display: flex; justify-content: space-between;
  pointer-events: none; z-index: 5; padding: 0 4px;
}
.hfc-hint { font-size: 20px; opacity: .18; padding: 8px; }
.hfc-hint-know    { color: var(--hfc-green-light); }
.hfc-hint-unknown { color: var(--hfc-red-light); }

/* ── Buttons ── */
.hfc-btn-row {
  display: flex; gap: 14px; justify-content: center;
  flex-shrink: 0; padding-top: 10px; width: 100%;
}
.hfc-btn {
  flex: 1; max-width: 150px; padding: 11px 10px;
  border-radius: 14px; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; border: none;
  transition: transform .15s;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.hfc-btn:active { transform: scale(.94); }
.hfc-btn-unknown { background: rgba(122,61,61,.35); color: var(--hfc-red-light);   border: 1px solid var(--hfc-red); }
.hfc-btn-know    { background: rgba(61,122,90,.35);  color: var(--hfc-green-light); border: 1px solid var(--hfc-green); }
.hfc-btn-unknown:hover { background: rgba(122,61,61,.5); }
.hfc-btn-know:hover    { background: rgba(61,122,90,.5); }
.hfc-btn-icon  { font-size: 22px; line-height: 1; }
.hfc-btn-label { font-size: 12px; letter-spacing: 1px; opacity: .8; }

/* ── Done screen ── */
.hfc-done-screen {
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px;
  flex: 1; width: 100%;
}
.hfc-done-screen.show { display: flex; animation: hfcFadeUp .6s ease; }
@keyframes hfcFadeUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
.hfc-done-zh    { font-size: 40px; color: var(--hfc-gold-dim); margin-bottom: 8px; }
.hfc-done-title { font-size: 32px; font-weight: 900; color: var(--hfc-gold-light); margin-bottom: 6px; }
.hfc-done-sub   { font-size: 14px; color: var(--hfc-text-dim); margin-bottom: 24px; line-height: 1.7; }
.hfc-done-sub span { color: var(--hfc-gold); }
.hfc-done-btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hfc-done-btn {
  padding: 12px 24px; border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; border: none; transition: transform .15s;
}
.hfc-done-btn:active { transform: scale(.94); }
.hfc-done-btn-repeat  { background: rgba(122,61,61,.4); color: var(--hfc-red-light);  border: 1px solid var(--hfc-red); }
.hfc-done-btn-restart { background: rgba(201,168,76,.15); color: var(--hfc-gold);     border: 1px solid var(--hfc-gold-dim); }
