body {
  animation: none;
  background: #0b0b0f;
}

:root {
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --fc-bg-1: rgba(255, 255, 255, 0.06);
  --fc-bg-2: rgba(255, 255, 255, 0.09);
  --fc-border: rgba(255, 255, 255, 0.14);
  --fc-text: #f7f3ff;
  --fc-muted: #c9c1d9;
  --fc-accent: #ff7a18;
  --fc-accent-2: #ff3cac;
  --fc-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  outline: none !important;
  -webkit-focus-ring-color: transparent;
}

input,
textarea {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
}

.flashcards-page {
  position: relative;
  z-index: 1;
  width: min(1300px, calc(100% - 32px));
  margin: 0 auto;
  padding: 120px 0 70px;
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
}

.hero {
  text-align: center;
  margin-bottom: 36px;
  animation: heroFade 0.9s ease both;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 122, 24, 0.35);
  border-radius: var(--radius-full);
  background: rgba(255, 122, 24, 0.08);
  color: #ffd2b1;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: "Orbitron", "Trebuchet MS", sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
  color: #fff;
}

.flashcards-controls {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-bottom: 30px;
  padding: 18px;
  border: 1px solid var(--fc-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(20, 20, 30, 0.88), rgba(28, 18, 42, 0.84));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--fc-shadow);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.search-wrap {
  width: 100%;
}

.search-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--fc-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--fc-text);
  font-size: 1rem;
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  outline: none !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
}

.search-wrap input:focus {
  border-color: rgba(255, 122, 24, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 122, 24, 0.12);
}

.search-wrap input::placeholder {
  color: var(--fc-muted);
}

.filter-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.action-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.filter-wrap button,
.action-wrap button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fc-text);
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  outline: none !important;
  transition: transform 0.25s ease, border-color 0.25s ease,
              box-shadow 0.25s ease, background 0.25s ease;
}

.filter-wrap button:focus-visible,
.action-wrap button:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.45);
}

.filter-wrap button:hover,
.action-wrap button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 122, 24, 0.55);
  box-shadow: 0 10px 20px rgba(255, 122, 24, 0.14);
}

.filter-wrap button.active {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.22), rgba(255, 60, 172, 0.18));
  border-color: rgba(255, 122, 24, 0.65);
  box-shadow: 0 0 18px rgba(255, 122, 24, 0.18);
}

.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 22px;
}

.flashcard {
  position: relative;
  height: 270px;
  cursor: pointer;
  transition: transform 0.35s ease;
  animation: cardRise 0.7s ease both;
  -webkit-tap-highlight-color: transparent;
}

.flashcard.hidden {
  display: none;
}

.flashcard:hover {
  transform: translateY(-6px) scale(1.012);
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1000px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.6s ease;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--fc-border);
  box-shadow: var(--fc-shadow);
  transform: rotateY(0deg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flashcard-face::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left,     rgba(255, 122, 24, 0.16),  transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 60, 172, 0.18),  transparent 36%),
    linear-gradient(145deg, var(--fc-bg-1), var(--fc-bg-2));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.flashcard-face > * {
  position: relative;
  z-index: 1;
}

.flashcard-back {
  transform: rotateY(180deg);
}

.flashcard-front h3,
.flashcard-back h3,
.flashcard-front p,
.flashcard-back p,
.domain-tag {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flashcard-front h3,
.flashcard-back h3 {
  font-family: "Orbitron", "Trebuchet MS", sans-serif;
  font-size: 1.15rem;
  color: #fff;
  margin: 0;
}

.flashcard-front p,
.flashcard-back p {
  font-size: 1.03rem;
  color: var(--fc-muted);
  font-weight: 600;
  margin: 0;
  line-height: 1.45;
}

.domain-tag {
  display: inline-block;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 122, 24, 0.14);
  border: 1px solid rgba(255, 122, 24, 0.25);
  color: #ffd8bb;
  font-size: 0.9rem;
  font-weight: 700;
}

.cards-count {
  margin-top: 24px;
  text-align: center;
  color: #d8d1e4;
  font-size: 1rem;
  font-weight: 700;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.pop-in {
  animation: popIn 0.32s ease both;
}

@keyframes heroFade {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

@media (max-width: 768px) {
  .flashcards-page {
    width: 100%;
    padding-top: 104px;
  }

  .filter-wrap {
    grid-template-columns: 1fr 1fr;
  }

  .action-wrap {
    flex-direction: column;
    width: 100%;
  }

  .filter-wrap button,
  .action-wrap button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .filter-wrap {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flashcard,
  .flashcard-inner,
  .hero,
  .pop-in {
    animation: none !important;
    transition: none !important;
  }
}
