/* ================= FLASHCARDS ================= */
[hidden] {
  display: none !important;
}
/* Revisão do dia no painel escuro, como o destaque do Painel */
.fc-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 28px;
  background: var(--panel-bg);
  color: var(--panel-text);
  border: 1px solid var(--panel-line);
  box-shadow: var(--panel-glow);
}
.fc-hero::after {
  content: '';
  position: absolute;
  top: -160px;
  right: -120px;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, var(--panel-spot), transparent);
}
.fc-hero h2 {
  color: var(--panel-text);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.01em;
}
.fc-hero p {
  color: var(--panel-muted);
  margin-top: 6px;
}
.fc-hero > div {
  min-width: 0;
  flex: 1 1 240px;
}
.fc-hero .btn {
  border-radius: 999px;
}
.fc-hero .btn-primary {
  background: var(--panel-text);
  color: var(--panel-bg);
}
.fc-hero .btn-primary:hover {
  background: var(--panel-muted);
}
.fc-hero .btn-ghost {
  background: transparent;
  color: var(--panel-text);
  border-color: var(--panel-line);
}
.fc-hero.calm {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-subtle);
  box-shadow: none;
}
.fc-hero.calm::after {
  display: none;
}
.fc-hero.calm h2 {
  color: var(--color-text);
}
.fc-hero.calm p {
  color: var(--color-text-muted);
}
.fc-hero.calm .btn-primary {
  background: var(--color-ink);
  color: var(--color-on-ink);
}
.fc-hero.calm .btn-ghost {
  color: var(--color-text);
  border-color: var(--color-border);
}
.fc-modes {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}
@container content (min-width:700px) {
  .fc-modes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.fc-mode {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  min-width: 0;
}
.fc-mode .ic {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
}
.fc-mode h3 {
  font-size: 16px;
}
.fc-mode p {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.45;
}
.fc-mode .btn {
  justify-self: start;
  margin-top: 4px;
}
.deck-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@container content (min-width:620px) {
  .deck-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container content (min-width:1000px) {
  .deck-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.deck {
  display: grid;
  gap: 12px;
  align-content: start;
  position: relative;
  min-width: 0;
  border-top: 4px solid var(--deck, var(--color-accent));
}
.deck h3 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.deck .nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.deck .nums div {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  min-width: 0;
}
.deck .nums b {
  display: block;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.deck .nums span {
  font-size: 12px;
  color: var(--color-text-muted);
}
.deck .foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.deck .foot .grow {
  flex: 1;
}
.exam-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--tone-peach-bg);
  color: var(--tone-peach-fg);
  white-space: normal;
}
.exam-chip svg {
  width: 13px;
  height: 13px;
}
.exam-chip.soon {
  background: var(--tone-brick-bg);
  color: var(--tone-brick-fg);
}
.fc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.fc-row:last-child {
  border-bottom: 0;
}
.fc-row .q {
  font-weight: 600;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fc-row .m {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.fc-row .acts {
  display: flex;
  gap: 4px;
}
@container content (max-width:520px) {
  .fc-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .fc-row .acts {
    justify-content: flex-start;
  }
}
.b-new {
  background: var(--tone-lav-bg);
  color: var(--tone-lav-fg);
}
.b-learning {
  background: var(--tone-blue-bg);
  color: var(--tone-blue-fg);
}
.b-review {
  background: var(--tone-mint-bg);
  color: var(--tone-mint-fg);
}
.b-relearning {
  background: var(--tone-brick-bg);
  color: var(--tone-brick-fg);
}
.b-mastered {
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.fc-text {
  overflow-wrap: anywhere;
}
.fc-text ul {
  margin: 6px 0;
  padding-left: 22px;
  text-align: left;
}
.fc-text sup,
.fc-text sub {
  font-size: 0.7em;
}
.cloze {
  display: inline-block;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 700;
}
.cloze.on {
  background: var(--tone-mint-bg);
  color: var(--tone-mint-fg);
}
.fc-preview {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--color-bg);
  min-height: 96px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 18px;
}
.fc-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.fc-help {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.fc-help code {
  background: var(--color-accent-soft);
  color: var(--tone-lav-fg);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-size: 12px;
}
.dist {
  display: flex;
  height: 14px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--color-accent-soft);
}
.dist span {
  display: block;
  height: 100%;
}
.legend.wrap {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.legend.wrap > span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.forecast {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 120px;
  margin-top: 8px;
}
.forecast div {
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: end;
  height: 100%;
  min-width: 0;
}
.forecast i {
  display: block;
  width: 100%;
  max-width: 34px;
  border-radius: var(--radius-xs) var(--radius-xs) var(--radius-xs) var(--radius-xs);
  background: var(--color-accent);
  min-height: 3px;
}
.forecast b {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.forecast span {
  font-size: 11px;
  color: var(--color-text-muted);
}
.cal-fc {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--tone-lav-fg);
  background: var(--color-accent-soft);
  border-radius: 99px;
  padding: 0 6px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 18px;
}
.cal-fc svg {
  width: 11px;
  height: 11px;
}
.fc-cal-note {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--tone-lav-fg);
  background: var(--color-accent-soft);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.fc-cal-note svg {
  width: 16px;
  height: 16px;
}
/* Sessão de estudo (tela focada) */
.fc-study {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.fc-study .bar-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.fc-study .bar-top .ttl {
  flex: 1;
  min-width: 0;
}
.fc-study .bar-top .ttl b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-study .bar-top .ttl span {
  font-size: 13px;
  color: var(--color-text-muted);
}
.fc-study .prog {
  height: 4px;
  background: var(--color-accent-soft);
}
.fc-study .prog span {
  display: block;
  height: 100%;
  background: var(--color-accent);
  transition: width 0.3s var(--ease-out);
}
.fc-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.fc-card {
  width: 100%;
  perspective: 1400px;
}
.fc-inner {
  position: relative;
  width: 100%;
  min-height: 300px;
  transform-style: preserve-3d;
  transition: transform 0.45s var(--ease-out);
}
.fc-card.flipped .fc-inner {
  transform: rotateY(180deg);
}
.fc-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  overflow: auto;
}
.fc-face.back {
  transform: rotateY(180deg);
}
.fc-face:focus {
  outline: none;
}
.fc-face .q {
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}
.fc-face .a {
  font-size: clamp(18px, 2.8vw, 22px);
  line-height: 1.5;
  color: var(--color-text);
}
.fc-face .small-q {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.45;
}
.fc-face hr {
  width: 60%;
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2px 0;
}
.fc-face .tag {
  position: absolute;
  top: 14px;
  left: 16px;
}
.fc-hint {
  font-size: 14px;
  color: var(--color-text-muted);
  text-align: center;
}
.fc-rate {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.fc-rate button {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 10px 6px;
  min-height: 64px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font: 600 15px var(--font-sans);
  color: var(--color-text);
  cursor: pointer;
  transition:
    transform 0.12s,
    background 0.15s;
}
.fc-rate button:hover {
  transform: translateY(-1px);
}
.fc-rate button small {
  font-weight: 500;
  font-size: 12px;
  color: var(--color-text-muted);
}
.fc-rate button kbd {
  font: 600 11px var(--font-sans);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 0 5px;
}
.fc-rate .r1 {
  border-color: var(--fc-rate-again-border);
  background: var(--tone-brick-bg);
  color: var(--tone-brick-fg);
}
.fc-rate .r2 {
  border-color: var(--fc-rate-hard-border);
  background: var(--tone-yellow-bg);
  color: var(--tone-yellow-fg);
}
.fc-rate .r3 {
  border-color: var(--fc-rate-good-border);
  background: var(--tone-mint-bg);
  color: var(--tone-mint-fg);
}
.fc-rate .r4 {
  border-color: var(--fc-rate-easy-border);
  background: var(--tone-lav-bg);
  color: var(--tone-lav-fg);
}
.fc-rate .r1 small,
.fc-rate .r2 small,
.fc-rate .r3 small,
.fc-rate .r4 small {
  color: inherit;
  opacity: 0.85;
}
.fc-reveal {
  width: 100%;
  max-width: 420px;
}
.fc-flash {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--color-text);
  color: var(--color-surface);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  z-index: 95;
  animation: fcFlash 1.2s var(--ease-out) forwards;
  pointer-events: none;
  white-space: nowrap;
}
@keyframes fcFlash {
  0% {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.fc-done {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  max-width: 460px;
}
.fc-done .big {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: var(--tone-mint-bg);
  color: var(--tone-mint-fg);
  display: grid;
  place-items: center;
}
.fc-done .big svg {
  width: 34px;
  height: 34px;
}
@media (max-width: 520px) {
  .fc-inner {
    min-height: 260px;
  }
  .fc-face {
    padding: 24px 18px;
  }
  .fc-rate {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .fc-inner {
    transition: none;
  }
  .fc-card.flipped .fc-inner {
    transform: none;
  }
  .fc-card .fc-face.back {
    transform: none;
    display: none;
  }
  .fc-card.flipped .fc-face.front {
    display: none;
  }
  .fc-card.flipped .fc-face.back {
    display: flex;
  }
}

/* Modos de estudo: ícone monocromático, sem o quadradinho pastel */
.fc-mode .ic {
  background: var(--color-surface-sunken) !important;
  color: var(--color-text) !important;
}
