:root {
  --fc-primary: #7c3aed;
  --fc-primary-hover: #6d28d9;
  --fc-bg-card: #ffffff;
  --fc-border: #e2e8f0;
  --fc-text-main: #0f172a;
  --fc-text-muted: #64748b;
  --fc-pill-bg: #f1f5f9;
  --fc-pill-hover: #e2e8f0;
  --fc-result-bg: #f8fafc;
  --fc-hl-bg: #f5f3ff;
  --fc-hl-border: #ddd6fe;
  --fc-hl-text: #6d28d9;
}

.fc-tool-container {
  max-width: 880px;
  margin: 0 auto 3rem auto;
  font-family: inherit;
  color: var(--fc-text-main);
}

.fc-editor-card {
  background: var(--fc-bg-card);
  border: 1px solid var(--fc-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.fc-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--fc-border);
}

.fc-deck-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fc-deck-select-wrap label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fc-text-main);
}

.fc-deck-select-wrap select {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  background: var(--fc-bg-card);
  color: var(--fc-text-main);
  font-size: 0.9rem;
}

.fc-stats-bar {
  display: flex;
  gap: 0.4rem;
}

.fc-stat-chip {
  background: var(--fc-pill-bg);
  border: 1px solid var(--fc-border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fc-text-muted);
}

/* 3D Flip Card Container */
.fc-scene {
  perspective: 1000px;
  margin-bottom: 1.25rem;
}

.fc-card {
  width: 100%;
  height: 240px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1);
  cursor: pointer;
  border-radius: 12px;
  outline: none;
}

.fc-card:focus {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.fc-card.is-flipped {
  transform: rotateY(180deg);
}

.fc-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  border: 2px solid var(--fc-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  box-sizing: border-box;
  background: var(--fc-result-bg);
}

.fc-face-front {
  background: var(--fc-result-bg);
}

.fc-face-back {
  background: var(--fc-hl-bg);
  border-color: var(--fc-hl-border);
  transform: rotateY(180deg);
}

.fc-badge-front {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--fc-text-muted);
}

.fc-badge-back {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--fc-hl-text);
}

.fc-card-text {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  color: var(--fc-text-main);
  max-width: 90%;
}

.fc-card-hint {
  font-size: 0.8rem;
  color: var(--fc-text-muted);
}

.fc-rate-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 500px) {
  .fc-rate-row {
    grid-template-columns: 1fr;
  }
}

.fc-btn-wrong {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 8px;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.fc-btn-wrong:hover {
  background: #fee2e2;
}

.fc-btn-right {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  border-radius: 8px;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.fc-btn-right:hover {
  background: #dcfce7;
}

.fc-custom-drawer {
  background: var(--fc-pill-bg);
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.fc-custom-heading {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--fc-text-main);
}

.fc-custom-inputs {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .fc-custom-inputs {
    flex-direction: column;
  }
}

.fc-custom-inputs input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--fc-border);
  border-radius: 6px;
  background: var(--fc-bg-card);
  color: var(--fc-text-main);
  font-size: 0.9rem;
}

.fc-btn-add {
  background: var(--fc-primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.fc-action-row {
  display: flex;
  gap: 0.75rem;
}

.fc-secondary-btn {
  background: var(--fc-pill-bg);
  color: var(--fc-text-main);
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.fc-results-card {
  background: var(--fc-result-bg);
  border: 1px solid var(--fc-border);
  border-radius: 12px;
  padding: 1.75rem;
}

.fc-highlight-box {
  background: var(--fc-hl-bg);
  border: 1px solid var(--fc-hl-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.fc-hl-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--fc-hl-text);
  margin-bottom: 0.25rem;
  display: block;
}

.fc-hl-val {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--fc-hl-text);
  margin-bottom: 0.25rem;
}

.fc-hl-sub {
  font-size: 0.9rem;
  color: var(--fc-hl-text);
}

.fc-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .fc-specs-grid {
    grid-template-columns: 1fr;
  }
}

.fc-spec-item {
  background: var(--fc-bg-card);
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fc-spec-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fc-text-muted);
}

.fc-spec-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--fc-text-main);
}

.fc-spec-sub {
  font-size: 0.75rem;
  color: var(--fc-text-muted);
}

.fc-table-card {
  background: var(--fc-bg-card);
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.fc-sub-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--fc-text-main);
}

.fc-table-wrap {
  overflow-x: auto;
}

.fc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.fc-table th,
.fc-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--fc-border);
}

.fc-table th {
  background: var(--fc-pill-bg);
  font-weight: 700;
  color: var(--fc-text-muted);
}

.fc-tip-box {
  background: var(--fc-bg-card);
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  padding: 1.25rem;
}

.fc-tip-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--fc-primary);
}

.fc-tip-box p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fc-text-muted);
  line-height: 1.5;
}

.fc-ad {
  overflow: hidden;
  min-height: 280px;
}
/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --fc-primary: #a281da;
  --fc-primary-hover: #a481da;
  --fc-bg-card: var(--tf-surface);
  --fc-border: var(--tf-surface);
  --fc-text-main: var(--tf-ink);
  --fc-text-muted: var(--tf-ink-faint);
  --fc-pill-bg: var(--tf-surface);
  --fc-pill-hover: var(--tf-surface);
  --fc-result-bg: var(--tf-surface);
  --fc-hl-bg: var(--tf-surface);
  --fc-hl-border: var(--tf-surface);
  --fc-hl-text: #a481da;
}
