/* ── Per-page Flashcard Widget ── */
.pfc-widget {
    max-width: 520px;
    margin: 0 auto 2rem;
    user-select: none;
    -webkit-user-select: none;
}
.pfc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.pfc-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #777;
}
.pfc-btn-sm {
    background: none;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.pfc-btn-sm:hover { border-color: #999; color: #333; }

/* Card container */
.pfc-card-wrapper {
    -webkit-perspective: 900px;
    perspective: 900px;
    height: 300px;
    margin-bottom: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.pfc-card {
    position: relative;
    width: 100%;
    height: 100%;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-transition: -webkit-transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.pfc-card.flipped {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.pfc-face {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 2.5rem;
    overflow-y: auto;
}

/* Front: definition */
.pfc-front {
    background: #fff;
    border: 1px solid #e2e2e2;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.pfc-front-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #aaa;
    margin-bottom: 1rem;
}
.pfc-front-def {
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    color: #333;
}
.pfc-front-type {
    font-size: 0.8rem;
    color: #bbb;
    margin-top: 0.75rem;
}
.pfc-tap-hint {
    position: absolute;
    bottom: 1.25rem;
    font-size: 0.75rem;
    color: #bbb;
}

/* Back: word + examples */
.pfc-back {
    background: #1a1a1a;
    color: #f0f0f0;
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    align-items: center;
    justify-content: center;
    padding: 1.75rem 2rem;
}
.pfc-back-emoji {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.pfc-back-word {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    text-align: center;
}
.pfc-back-examples {
    list-style: none;
    padding: 0;
    width: 100%;
}
.pfc-back-examples li {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.5;
    padding: 0.35rem 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.pfc-back-examples li b { color: #fff; font-weight: 600; }

.pfc-audio-btn {
    margin-top: 0.75rem;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: #ccc;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.pfc-audio-btn:hover { border-color: rgba(255,255,255,0.5); color: #fff; }

/* Navigation */
.pfc-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}
.pfc-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid #ddd;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-size: 1.2rem;
    color: #555;
    font-family: inherit;
    line-height: 1;
}
.pfc-nav-btn:hover { border-color: #999; background: #f8f8f8; }
.pfc-nav-btn:disabled { opacity: 0.3; cursor: default; }

.pfc-progress {
    font-size: 0.9rem;
    color: #888;
    font-variant-numeric: tabular-nums;
    min-width: 3rem;
    text-align: center;
}

/* Dots */
.pfc-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.pfc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.25s ease;
}
.pfc-dot.current { background: #2a2a2a; transform: scale(1.3); }
.pfc-dot.seen { background: #aaa; }

.pfc-keyboard-hint {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #bbb;
}
.pfc-keyboard-hint kbd {
    display: inline-block;
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    font-family: inherit;
    font-size: 0.7rem;
    color: #888;
}

@media (max-width: 540px) {
    .pfc-card-wrapper { height: 280px; }
    .pfc-front-def { font-size: 1.05rem; }
    .pfc-face { padding: 1.5rem; overflow-y: visible; }
}