/* ╔═══════════════════════════════════════════════════════════════╗
   ║  PATHOPHYSIOLOGY 문제 연습 — flashcard with flip animation    ║
   ║  Matches the orange/peach medical-flashcard photo style       ║
   ╚═══════════════════════════════════════════════════════════════╝ */
.pathophys-tab {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; margin: 4px 0 10px;
  padding: 16px 18px 16px 16px;
  text-align: left; border-radius: 18px;
  background:
    radial-gradient(120% 220% at 0% 0%, rgba(244,114,182,0.18) 0%, transparent 55%),
    radial-gradient(120% 220% at 100% 100%, rgba(168,85,247,0.18) 0%, transparent 55%),
    linear-gradient(135deg, #1a0b2e 0%, #2e1755 50%, #1f0d3d 100%);
  border: 1.5px solid rgba(244,114,182,0.55);
  box-shadow: 0 10px 28px rgba(0,0,0,0.55), 0 24px 60px -28px rgba(168,85,247,0.45);
  color: #fef9e6; cursor: pointer; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.pathophys-tab:hover { box-shadow: 0 14px 36px rgba(0,0,0,0.6), 0 30px 70px -28px rgba(168,85,247,0.6); }
.pathophys-tab:active { transform: scale(0.99); }
.pathophys-tab .ppt-glow {
  position: absolute; inset: -2px; border-radius: 20px;
  background: conic-gradient(from 90deg, rgba(244,114,182,0) 0deg, rgba(244,114,182,0.45) 60deg, rgba(168,85,247,0.45) 200deg, rgba(244,114,182,0) 360deg);
  filter: blur(14px); opacity: 0.55; z-index: -1;
  animation: pptGlowSpin 16s linear infinite;
}
@keyframes pptGlowSpin { to { transform: rotate(360deg); } }
.pathophys-tab .ppt-shimmer {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,0.16) 50%, transparent 62%);
  transform: translateX(-100%); animation: pptShimmerSweep 5.4s ease-in-out infinite;
}
@keyframes pptShimmerSweep { 0%,100%{transform:translateX(-110%)} 50%{transform:translateX(110%)} }
.pathophys-tab .ppt-icon {
  position: relative; flex: 0 0 auto; width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #fbcfe8 0%, #ec4899 60%, #a21caf 100%);
  border-radius: 14px; border: 1.5px solid rgba(255,243,200,0.65);
  box-shadow: 0 6px 14px rgba(168,85,247,0.45), 0 0 0 4px rgba(244,114,182,0.18);
}
.pathophys-tab .ppt-icon-emoji { font-size: 1.7rem; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25)); z-index: 1; }
.pathophys-tab .ppt-icon-ring {
  position: absolute; inset: -8px; border-radius: 18px;
  background: radial-gradient(circle, rgba(244,114,182,0.45) 0%, transparent 70%);
  animation: pptIconPulse 2.4s ease-in-out infinite;
}
@keyframes pptIconPulse { 0%,100%{transform:scale(0.85);opacity:0.55} 50%{transform:scale(1.15);opacity:0} }
.pathophys-tab .ppt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.pathophys-tab .ppt-row1 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pathophys-tab .ppt-title { font-size: 1.05rem; font-weight: 800; color: #fff7d8; text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.pathophys-tab .ppt-count {
  font-size: 1.5rem; font-weight: 900;
  background: linear-gradient(135deg, #fbcfe8 0%, #ec4899 50%, #a21caf 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(244,114,182,0.5));
}
.pathophys-tab .ppt-sub { font-size: 0.78rem; color: #e9d5ff; font-weight: 500; }
.pathophys-tab .ppt-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pathophys-tab .ppt-chip { font-size: 0.7rem; font-weight: 600; padding: 3px 9px; background: rgba(244,114,182,0.13); color: #fbcfe8; border: 1px solid rgba(244,114,182,0.35); border-radius: 999px; white-space: nowrap; }
.pathophys-tab .ppt-chip-special { background: rgba(251,191,36,0.18); color: #fde68a; border-color: rgba(251,191,36,0.45); }
.pathophys-tab .ppt-arrow {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(244,114,182,0.18); color: #fbcfe8;
  border: 1.5px solid rgba(244,114,182,0.4);
  transition: transform 0.2s, background 0.2s;
}
.pathophys-tab:hover .ppt-arrow { background: rgba(244,114,182,0.32); transform: translateX(3px); }
@media (max-width: 380px) {
  .pathophys-tab { padding: 13px 14px 13px 12px; gap: 11px; }
  .pathophys-tab .ppt-icon { width: 48px; height: 48px; }
  .pathophys-tab .ppt-icon-emoji { font-size: 1.45rem; }
  .pathophys-tab .ppt-title { font-size: 0.95rem; }
  .pathophys-tab .ppt-count { font-size: 1.25rem; }
  .pathophys-tab .ppt-sub { font-size: 0.72rem; }
  .pathophys-tab .ppt-chip { font-size: 0.62rem; padding: 2px 7px; }
}

/* ── Pathophys flashcard screen ── */
#screen-pathophys { flex-direction: column; background: #2c1810; }
.ppc-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: rgba(0,0,0,0.18); flex-shrink: 0; }
.ppc-counter { font-size: 0.85rem; font-weight: 700; color: #fde68a; min-width: 64px; }
.ppc-system { flex: 1; padding: 6px 10px; background: rgba(255,255,255,0.08); color: #fff7d8; border: 1px solid rgba(255,243,200,0.25); border-radius: 8px; font-size: 0.82rem; }
.ppc-shuffle { padding: 6px 10px; background: rgba(244,114,182,0.18); color: #fbcfe8; border: 1px solid rgba(244,114,182,0.4); border-radius: 8px; font-size: 1rem; cursor: pointer; }

.ppc-stage { flex: 1; display: flex; align-items: center; justify-content: center; perspective: 1400px; padding: 14px; overflow-y: auto; }
.ppc-card { position: relative; width: 100%; max-width: 420px; min-height: 520px; transform-style: preserve-3d; transition: transform 0.7s cubic-bezier(.25,.8,.25,1); }
.ppc-card.flipped { transform: rotateY(180deg); }
.ppc-side { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 18px; background: #fff8f0; box-shadow: 0 14px 40px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3); overflow: hidden; display: flex; flex-direction: column; }
.ppc-side-back { transform: rotateY(180deg); }
.ppc-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: linear-gradient(135deg, #c87f4e 0%, #b16538 100%); color: #fff; }
.ppc-header-title { font-size: 0.88rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; flex: 1; border-bottom: 2px solid #fff; padding-bottom: 4px; }
.ppc-header-case { display: flex; align-items: center; gap: 8px; }
.ppc-case-circle { background: #fff8f0; color: #b16538; font-weight: 800; padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; }
.ppc-case-num { background: #ef4444; color: #fff; font-weight: 800; padding: 3px 9px; border-radius: 50%; font-size: 0.74rem; min-width: 24px; text-align: center; }

.ppc-body { flex: 1; padding: 16px; color: #2c1810; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.ppc-patient-row { display: flex; gap: 12px; align-items: flex-start; }
.ppc-avatar { flex: 0 0 auto; width: 78px; height: 78px; border-radius: 12px; overflow: hidden; border: 2px solid #2c1810; background: #f1d8c4; }
.ppc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ppc-hxpe-label { background: #c87f4e; color: #fff; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 10px; align-self: flex-start; margin-bottom: 4px; }
.ppc-vignette { font-size: 0.92rem; line-height: 1.5; color: #2c1810; }
.ppc-options { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ppc-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 999px; border: 1.5px solid #c87f4e; background: #fff; cursor: pointer; text-align: left; font-size: 0.86rem; color: #2c1810; transition: background 0.2s, transform 0.1s; }
.ppc-option:hover { background: #ffeedd; }
.ppc-option:active { transform: scale(0.99); }
.ppc-option-letter { flex: 0 0 auto; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: #fff; color: #c87f4e; font-weight: 800; border: 1.5px solid #c87f4e; border-radius: 50%; font-size: 0.85rem; }
.ppc-option.selected { background: #ffd9b8; border-color: #b16538; }
.ppc-option.correct { background: #d1fae5; border-color: #059669; }
.ppc-option.correct .ppc-option-letter { background: #059669; color: #fff; border-color: #059669; }
.ppc-option.incorrect { background: #fee2e2; border-color: #dc2626; }
.ppc-option.incorrect .ppc-option-letter { background: #dc2626; color: #fff; border-color: #dc2626; }

.ppc-cond-title { background: #fee2d6; color: #c2185b; border: 2px solid #c2185b; border-radius: 14px; padding: 8px 14px; font-weight: 800; font-size: 0.95rem; text-align: center; margin: 8px 14px; line-height: 1.3; }
.ppc-section { padding: 0 16px 4px; font-size: 0.84rem; line-height: 1.5; color: #2c1810; }
.ppc-section-label { font-weight: 800; color: #c2185b; }
.ppc-section .key-red { color: #c2185b; font-weight: 700; }
.ppc-section .key-green { color: #047857; font-weight: 700; }
.ppc-section .key-orange { color: #ea580c; font-weight: 700; }
.ppc-answer-box { margin: 10px 16px 14px; padding: 12px; background: #6b3a1f; color: #fff8f0; border-radius: 10px; font-size: 0.82rem; line-height: 1.5; }
.ppc-answer-line { font-weight: 800; margin-bottom: 4px; color: #fde68a; }
.ppc-img-thumb { display: flex; gap: 8px; padding: 8px 16px 12px; flex-wrap: wrap; align-items: stretch; }
.ppc-img-thumb img { flex: 1 1 30%; min-width: 96px; max-width: 140px; height: 110px; object-fit: cover; border-radius: 8px; border: 2px solid #c87f4e; cursor: zoom-in; box-shadow: 0 2px 6px rgba(0,0,0,0.18); transition: transform 0.15s; }
.ppc-img-thumb img:hover { transform: scale(1.04); border-color: #b16538; }
.ppc-img-label { width: 100%; flex-basis: 100%; font-size: 0.78rem; font-weight: 800; color: #c2185b; padding: 2px 0 4px; }

.ppc-nav { display: flex; gap: 8px; padding: 12px 16px; background: rgba(0,0,0,0.2); flex-shrink: 0; }
.ppc-nav button { flex: 1; padding: 12px; border-radius: 10px; font-weight: 700; font-size: 0.92rem; background: rgba(255,255,255,0.08); color: #fff7d8; border: 1px solid rgba(255,243,200,0.25); cursor: pointer; }
.ppc-flip-btn { background: linear-gradient(135deg, #ec4899, #a21caf) !important; color: #fff !important; border: none !important; }
.ppc-prev:active, .ppc-next:active { transform: scale(0.98); }
