:root {
  --study-bg: #0f172a;
  --study-card: #1e1e2f;
  --study-border: rgba(255, 255, 255, 0.15);
  --study-accent: #fbbf24;
  --study-secondary: #c4b5fd;
}

#study-page {
  padding: 2rem 1rem 4rem;
  background: radial-gradient(circle at top, rgba(251, 191, 36, 0.18), transparent 55%), var(--study-bg);
  color: #f8fafc;
}

.study-intro {
  max-width: 960px;
  margin: 0 auto 2rem;
  text-align: center;
}

.study-intro h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.5rem;
}

.study-highlights {
  list-style: disc;
  text-align: left;
  max-width: 720px;
  margin: 1rem auto 0;
  padding-left: 1.25rem;
  color: rgba(248, 250, 252, 0.9);
}

.study-module {
  max-width: 960px;
  margin: 0 auto;
}

.flashcard-app {
  border: 1px solid var(--study-border);
  border-radius: 1rem;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.study-howto {
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  line-height: 1.4;
}

.study-howto ol {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
  color: rgba(248, 250, 252, 0.85);
}

.study-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--study-border);
}

.study-filter label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(248, 250, 252, 0.75);
}

.study-filter select {
  flex: 1;
  min-width: 220px;
  border-radius: 999px;
  border: 1px solid var(--study-border);
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  outline: none;
}

.flashcard-shell {
  margin-bottom: 1rem;
}

.flashcard {
  position: relative;
  width: 100%;
  min-height: clamp(320px, 55vw, 520px);
  border-radius: 1rem;
  border: 1px solid var(--study-border);
  background: var(--study-card);
  overflow: hidden;
}

.flashcard-panel {
  position: absolute;
  inset: 0;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.flashcard-panel--prompt {
  opacity: 1;
  visibility: visible;
}

.flashcard--show-answer .flashcard-panel--prompt {
  opacity: 0;
  visibility: hidden;
}

.flashcard-panel--answer {
  opacity: 0;
  visibility: hidden;
}

.flashcard--show-answer .flashcard-panel--answer {
  opacity: 1;
  visibility: visible;
}

.flashcard-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(248, 250, 252, 0.65);
  margin: 0;
}

.flashcard-title {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  margin: 0;
}

[data-prompt-image],
[data-answer-image] {
  width: min(260px, 70%);
  max-height: 360px;
  object-fit: contain;
  align-self: center;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
}

.flashcard img.is-hidden {
  display: none;
}

.flashcard-keywords {
  min-height: 2rem;
  color: rgba(248, 250, 252, 0.85);
  font-style: italic;
}

.answer-meanings {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flashcard-note {
  border: 1px dashed var(--study-border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.4);
  margin-bottom: 1.25rem;
}

.note-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: rgba(248, 250, 252, 0.65);
  margin: 0 0 0.4rem;
}

.note-text {
  margin: 0;
  color: rgba(248, 250, 252, 0.9);
  line-height: 1.4;
}

.flashcard-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.flashcard-actions button {
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--study-border);
  background: transparent;
  color: #f8fafc;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.flashcard-actions button.primary {
  background: var(--study-accent);
  border-color: var(--study-accent);
  color: #111;
  font-weight: 600;
}

.flashcard-actions button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.flashcard-actions button.primary:hover {
  background: #fed766;
}

.study-reminder {
  margin-top: 0.5rem;
  text-align: center;
  color: rgba(248, 250, 252, 0.8);
  font-size: 0.95rem;
}

.study-disclaimer {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.65);
  text-align: center;
}

.noscript-alert {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

@media (max-width: 720px) {
  .flashcard-app__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .study-stats {
    width: 100%;
    justify-content: space-around;
  }

  .flashcard-face {
    padding: 1.25rem;
  }

  .flashcard-panel {
    padding: 1.25rem 1rem;
  }

  .study-filter {
    flex-direction: column;
    align-items: flex-start;
  }

  .study-filter select {
    width: 100%;
  }

  [data-prompt-image],
  [data-answer-image] {
    width: 80%;
  }

  .flashcard-title {
    font-size: 1.5rem;
  }
}
