/* Kad Ingatan (flashcards). Palette follows the page: emerald-600/700, rose-500/700, amber-100/700, slate. */
.fc-section, .fc-player { --fc-green: #047857; --fc-green-soft: #ecfdf5; --fc-rose: #be123c; --fc-amber: #b45309; --fc-ink: #1e293b; --fc-muted: #475569; }
.fc-section *:focus-visible, .fc-player *:focus-visible { outline: 3px solid #1e293b; outline-offset: 3px; box-shadow: 0 0 0 6px #6ee7b7; }
.fc-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.fc-panel { background: #fff; border: 2px solid #d1fae5; border-radius: 1.5rem; padding: 1.25rem; box-shadow: 6px 6px 0 0 rgba(5, 150, 105, 0.15); }
.fc-panel + .fc-panel { margin-top: 1.5rem; }
.fc-title { font-size: 1.25rem; font-weight: 800; color: var(--fc-ink); }
.fc-sub { color: var(--fc-muted); font-weight: 500; font-size: 0.95rem; }

.fc-btn { min-height: 48px; min-width: 48px; padding: 0.65rem 1.25rem; border-radius: 1rem; border: 2px solid transparent; font: inherit; font-weight: 800; cursor: pointer; transition: transform .15s ease, background-color .15s ease; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.fc-btn:active { transform: scale(.96); }
.fc-btn-primary { background: var(--fc-green); color: #fff; }
.fc-btn-primary:hover { background: #065f46; }
.fc-btn-ghost { background: #fff; color: var(--fc-ink); border-color: #cbd5e1; }
.fc-btn-ghost:hover { border-color: #047857; }
.fc-btn[disabled], .fc-btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }

.fc-form { display: grid; gap: .75rem; max-width: 28rem; }
.fc-input { min-height: 48px; padding: .6rem 1rem; border-radius: 1rem; border: 2px solid #94a3b8; font: inherit; font-size: 1.1rem; color: var(--fc-ink); width: 100%; }
.fc-label { font-weight: 800; font-size: 1.1rem; color: var(--fc-ink); }
.fc-msg { color: var(--fc-amber); font-weight: 700; min-height: 1.25rem; }

.fc-greet { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.fc-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin: 1rem 0; }
@media (min-width: 640px) { .fc-stats { grid-template-columns: repeat(5, 1fr); } }
.fc-stat { background: var(--fc-green-soft); border: 2px solid #a7f3d0; border-radius: 1rem; padding: .6rem .75rem; text-align: center; }
.fc-stat b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--fc-green); }
.fc-stat span { font-size: .8rem; font-weight: 700; color: var(--fc-muted); }

.fc-meter-row { display: grid; gap: .5rem; padding: .75rem 0; border-top: 1px solid #e2e8f0; }
.fc-meter-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-weight: 700; color: var(--fc-ink); }
.fc-meter { height: 14px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.fc-meter > i { display: block; height: 100%; background: linear-gradient(90deg, #059669, #f59e0b); border-radius: 999px; transition: width .4s ease; }
.fc-topic-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }

.fc-trophies { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .75rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.fc-trophy { border: 2px solid #fde68a; background: #fffbeb; border-radius: 1rem; padding: .75rem; text-align: center; }
.fc-trophy .fc-ico { font-size: 2rem; display: block; }
.fc-trophy strong { display: block; color: var(--fc-ink); font-size: .9rem; }
.fc-trophy small { color: var(--fc-muted); font-weight: 600; }
.fc-trophy[data-locked="true"] { border-color: #cbd5e1; background: #f1f5f9; }
.fc-trophy[data-locked="true"] .fc-ico { filter: grayscale(1); opacity: .6; }

/* Player */
.fc-player { width: min(100vw, 44rem); max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0 auto; padding: 0; border: 0; background: #f8fafc; color: var(--fc-ink); }
@media (min-width: 768px) { .fc-player { height: auto; max-height: 94vh; border-radius: 1.5rem; margin: auto; } }
.fc-player::backdrop { background: rgba(15, 23, 42, .8); }
.fc-player-inner { padding: 1rem; display: grid; gap: 1rem; }
.fc-player-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.fc-combo { font-weight: 800; color: var(--fc-rose); min-height: 1.5rem; }
.fc-segments { display: flex; gap: 4px; align-items: center; }
.fc-seg { flex: 1; height: 12px; border-radius: 999px; background: #cbd5e1; transition: background-color .3s ease; }
.fc-seg[data-done="true"] { background: #059669; }
.fc-seg[data-current="true"] { background: #f59e0b; }
.fc-goal { font-size: 1.25rem; }
.fc-count { font-weight: 700; color: var(--fc-muted); font-size: .9rem; }

.fc-scene { perspective: 1200px; }
.fc-card { display: grid; width: 100%; min-height: 16rem; padding: 0; border: 0; border-radius: 1.5rem; background: none; cursor: pointer; text-align: center; transform-style: preserve-3d; transition: transform .55s ease; font: inherit; color: inherit; }
.fc-card[data-flipped="true"] { transform: rotateY(180deg); }
.fc-face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .75rem; padding: 1.5rem; border-radius: 1.5rem; border: 3px solid #34d399; background: #fff; box-shadow: 6px 6px 0 0 rgba(225, 29, 72, .2); }
.fc-face-back { transform: rotateY(180deg); background: #fffbeb; border-color: #f59e0b; }
.fc-tag { font-size: .8rem; font-weight: 800; padding: .2rem .7rem; border-radius: 999px; background: #d1fae5; color: #065f46; }
.fc-face-back .fc-tag { background: #fef3c7; color: #92400e; }
.fc-text { font-size: clamp(1.25rem, 4.5vw, 1.75rem); font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; }
.fc-visual { max-width: 100%; max-height: 16rem; width: auto; height: auto; object-fit: contain; }
.fc-hint { font-size: 1rem; font-weight: 600; color: var(--fc-muted); }
.fc-missing-visual { max-width: 100%; padding: .65rem .8rem; border: 2px solid #fcd34d; border-radius: .75rem; background: #fffbeb; color: #713f12; font-size: .9rem; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.fc-tip { text-align: center; color: var(--fc-muted); font-weight: 600; }

.fc-dock { display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 520px) { .fc-dock { grid-template-columns: repeat(3, 1fr); } }
.fc-dock[hidden] { display: none; }
.fc-rate { min-height: 56px; color: #fff; }
.fc-rate small { font-weight: 700; opacity: .95; }
.fc-rate-1 { background: var(--fc-amber); }
.fc-rate-2 { background: var(--fc-green); }
.fc-rate-3 { background: var(--fc-rose); }
.fc-feedback { text-align: center; font-weight: 800; min-height: 2.5rem; color: var(--fc-green); }

.fc-celebrate { text-align: center; display: grid; gap: 1rem; position: relative; overflow: hidden; }
.fc-celebrate h2 { font-size: 1.75rem; font-weight: 800; }
.fc-celebrate h2:focus { outline: none; box-shadow: none; }
.fc-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.fc-badge-new { background: #fffbeb; border: 2px solid #fcd34d; border-radius: 1rem; padding: .75rem; font-weight: 800; }
.fc-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.fc-confetti { position: absolute; inset: 0; pointer-events: none; }
.fc-confetti span { position: absolute; top: -2rem; font-size: 1.5rem; animation: fc-fall 2.6s ease-in forwards; }
@keyframes fc-fall { to { transform: translateY(26rem) rotate(240deg); opacity: 0; } }
.fc-bounce { animation: fc-pop .4s ease; }
@keyframes fc-pop { 40% { transform: scale(1.12); } }

@media (prefers-reduced-motion: reduce) {
  .fc-card, .fc-meter > i, .fc-seg, .fc-btn { transition: none; }
  .fc-card[data-flipped="true"] { transform: none; }
  .fc-face { backface-visibility: visible; -webkit-backface-visibility: visible; animation: none; }
  .fc-card .fc-face-back { transform: none; display: none; }
  .fc-card[data-flipped="true"] .fc-face-front { display: none; }
  .fc-card[data-flipped="true"] .fc-face-back { display: flex; animation: fc-fade .2s ease; }
  .fc-confetti { display: none; }
  .fc-bounce { animation: none; }
}
@keyframes fc-fade { from { opacity: 0; } to { opacity: 1; } }
