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

.apmg-wrap {
  --bg:         #F1F6F4;;
  --surface:    #BFD9CF;
  --surface2:   #11221C;
  --gold:       #027E7F;
  --gold-light: #4EAAAB;
  --gold-dim:   #014B4C;
  --jade:       #11221C;
  --jade-light: #11221C;
  --red:        #D81757;
  --red-light:  #E45D89;
  --text:       #11221C;
  --text-dim:   #88908D;
  --radius:     10px;

  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;
}

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

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

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

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

/* Buttons */
.apmg-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;
}
.apmg-btn:hover { background: var(--gold-dim); color: var(--bg); }
.apmg-btn.active { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 700; }
.apmg-btn-restart { border-color: var(--jade); color: var(--jade-light); }
.apmg-btn-restart:hover { background: var(--jade); color: var(--bg); }

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

/* Timer & message */
.apmg-timer { font-size: 13px; color: var(--text-dim); text-align: center; margin-bottom: 12px; }
.apmg-timer span { color: var(--gold); font-weight: 700; }
.apmg-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; }
.apmg-message.show { opacity: 1; }
.apmg-message.correct { background: rgba(74,140,111,.2); color: var(--jade-light); border: 1px solid var(--jade); }
.apmg-message.incorrect { background: rgba(140,58,46,.2); color: var(--red-light); border: 1px solid var(--red); }

/* Game layout */
.apmg-game-area { display: grid; grid-template-columns: 2fr 2fr; gap: 20px; }
@media (max-width: 580px) { .apmg-game-area { grid-template-columns: 2fr 2fr; } .apmg-card { min-height: 100px; } }
.apmg-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); }
.apmg-cards { display: flex; flex-direction: column; gap: 8px; }

/* Cards */
.apmg-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;
  min-height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.apmg-card:hover:not(.matched):not(.disabled) { border-color: var(--gold-dim); transform: translateX(-2px); }
.apmg-card.selected { border-color: var(--gold); background: var(--surface2); box-shadow: 0 0 0 1px var(--gold-dim); }
.apmg-card.matched { border-color: var(--jade); background: rgba(74,140,111,.1); cursor: default; opacity: .7; }
.apmg-card.matched .apmg-card-text { color: var(--jade-light); }
.apmg-card.matched::after { content: '✓'; position: absolute; top: 9px; left: 12px; color: var(--jade-light); font-size: 11px; }
.apmg-card.wrong { border-color: var(--red-light); background: rgba(140,58,46,.15); animation: apmg-shake .4s ease; }
.apmg-card.disabled { opacity: .35; pointer-events: none; }
@keyframes apmg-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.apmg-card-text { font-size: 14px; color: var(--text); line-height: 1.4; }
.apmg-card-text.point-text { font-size: 16px; font-weight: 700; color: var(--gold-light); letter-spacing: 1px; }

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