/* ── Herb Memory Game – WordPress Plugin Styles ─────────── */
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@300;400;700;900&display=swap');

.hmg-wrap {
  --bg:         #faf8f4;   /* רקע ראשי */
  --surface:    #ffffff;   /* כרטיסים */
  --surface2:   #f0e8de;   /* משטח משני */
  --gold:       #8b5c2a;   /* דגש ראשי */
  --gold-light: #c49a6c;   /* דגש בהיר */
  --gold-dim:   #5a3c1a;   /* דגש כהה */
  --jade:       #5a7a4a;   /* ירוק עפר */
  --jade-light: #7a9a6a;   /* ירוק בהיר */
  --red:        #8b3a2a;   /* שגיאה */
  --red-light:  #c46050;   /* שגיאה בהירה */
  --text:       #2c2c2c;   /* טקסט ראשי */
  --text-dim:   #7a7a7a;   /* טקסט שקט */
  --radius:     8px;       /* פינות מעוגלות */

  font-family: 'Frank Ruhl Libre', 'Noto Serif Hebrew', serif;
  background: var(--bg);
  color: var(--text);
  padding: 32px 20px 56px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  direction: rtl;
  max-width: 1100px;
  margin: 0 auto;
}

.hmg-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(201,168,76,.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(74,140,111,.06) 0%, transparent 60%);
  pointer-events: none;
}

/* Header */
.hmg-header { text-align: center; margin-bottom: 28px; }
.hmg-title-zh { font-size: 12px; letter-spacing: 8px; color: var(--gold-dim); margin-bottom: 6px; }
.hmg-title { font-size: clamp(24px,4vw,40px); font-weight: 900; color: var(--gold-light); margin: 0 0 6px; }
.hmg-subtitle { font-size: 13px; color: var(--text-dim); font-weight: 300; margin: 0; }
.hmg-divider { width: 120px; height: 1px; background: linear-gradient(90deg,transparent,var(--gold-dim),transparent); margin: 12px auto 0; }

/* Stats */
.hmg-stats { display: flex; justify-content: center; gap: 28px; margin-bottom: 16px; flex-wrap: wrap; }
.hmg-stat { text-align: center; }
.hmg-stat-value { font-size: 26px; font-weight: 700; color: var(--gold); line-height: 1; }
.hmg-stat-label { font-size: 11px; color: var(--text-dim); letter-spacing: 2px; margin-top: 3px; }

/* Progress */
.hmg-progress-bar { width: 200px; height: 3px; background: var(--surface2); border-radius: 2px; margin: 0 auto 20px; overflow: hidden; }
.hmg-progress-fill { height: 100%; background: linear-gradient(90deg, var(--jade), var(--gold)); width: 0%; transition: width .4s ease; }

/* Difficulty */
.hmg-difficulty { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.hmg-diff-label { font-size: 12px; color: var(--text-dim); }

/* Buttons */
.hmg-btn {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 8px 20px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all .2s;
  letter-spacing: 1px;
}
.hmg-btn:hover { background: var(--gold-dim); color: var(--bg); }
.hmg-btn.active { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 700; }
.hmg-btn-restart { border-color: var(--jade); color: var(--jade-light); }
.hmg-btn-restart:hover { background: var(--jade); color: var(--bg); }

/* Controls */
.hmg-controls { display: flex; justify-content: center; margin-bottom: 16px; }

/* Timer & message */
.hmg-timer { font-size: 13px; color: var(--text-dim); text-align: center; margin-bottom: 12px; }
.hmg-timer span { color: var(--gold); font-weight: 700; }
.hmg-message { text-align: center; padding: 8px 20px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; min-height: 38px; transition: opacity .3s; opacity: 0; }
.hmg-message.show { opacity: 1; }
.hmg-message.correct { background: rgba(74,140,111,.2); color: var(--jade-light); border: 1px solid var(--jade); }
.hmg-message.incorrect { background: rgba(140,58,46,.2); color: var(--red-light); border: 1px solid var(--red); }

/* Game layout */
.hmg-game-area { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 580px) { .hmg-game-area { grid-template-columns: 1fr; } }
.hmg-col-header { text-align: center; font-size: 11px; letter-spacing: 3px; color: var(--text-dim); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--surface2); }
.hmg-cards { display: flex; flex-direction: column; gap: 8px; }

/* Cards */
.hmg-card {
  background: var(--surface);
  border: 1px solid #2a2520;
  border-radius: var(--radius);
  padding: 13px 16px;
  cursor: pointer;
  transition: border-color .2s, transform .2s, background .2s;
  position: relative;
  user-select: none;
}
.hmg-card:hover:not(.matched):not(.disabled) { border-color: var(--gold-dim); transform: translateX(-2px); }
.hmg-card.selected { border-color: var(--gold); background: var(--surface2); box-shadow: 0 0 0 1px var(--gold-dim); }
.hmg-card.matched { border-color: var(--jade); background: rgba(74,140,111,.1); cursor: default; opacity: .7; }
.hmg-card.matched .hmg-card-text { color: var(--jade-light); }
.hmg-card.matched::after { content: '✓'; position: absolute; top: 9px; left: 12px; color: var(--jade-light); font-size: 11px; }
.hmg-card.wrong { border-color: var(--red-light); background: rgba(140,58,46,.15); animation: hmg-shake .4s ease; }
.hmg-card.disabled { opacity: .35; pointer-events: none; }
@keyframes hmg-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.hmg-card-text { font-size: 14px; color: var(--text); line-height: 1.4; }
.hmg-card-text.name-text { font-size: 15px; font-style: italic; color: var(--gold-light); font-weight: 300; letter-spacing: .5px; }

/* Win screen */
.hmg-win-screen { display: none; text-align: center; padding: 50px 20px; animation: hmg-fade .6s ease; }
.hmg-win-screen.show { display: block; }
@keyframes hmg-fade { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.hmg-win-zh { font-size: 36px; color: var(--gold-dim); margin-bottom: 8px; }
.hmg-win-title { font-size: 44px; font-weight: 900; color: var(--gold-light); margin-bottom: 14px; }
.hmg-win-stats { font-size: 15px; color: var(--text-dim); margin-bottom: 26px; line-height: 1.8; }
.hmg-win-stats span { color: var(--gold); }
.hmg-win-restart { font-size: 15px; padding: 12px 32px; }
