/* css/style.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0a0f1f 0%, #0c1222 50%, #050a15 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  color: #eef5ff;
  position: relative;
}

/* animated gradient background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(30, 100, 200, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.game-container {
  max-width: 950px;
  width: 100%;
  background: rgba(12, 20, 35, 0.65);
  backdrop-filter: blur(16px);
  border-radius: 2.5rem;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(72, 187, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  border: 1px solid rgba(80, 180, 255, 0.25);
}

/* header section */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
  gap: 1rem;
}

.brand h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #7bc5ff, #4a9eff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand p {
  font-size: 0.7rem;
  font-weight: 400;
  color: #8aa9d6;
  letter-spacing: 0.5px;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-icon {
  color: #9bb5e6;
  font-size: 1.3rem;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  background: rgba(255,255,255,0.05);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.social-icon:hover {
  color: #fff;
  background: #2f6eb3;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,160,255,0.3);
}

/* X (Twitter) specific hover effect */
.social-icon .fa-x-twitter:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255,255,255,0.5);
}

/* stats cards */
.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  border-radius: 1.2rem;
  padding: 0.6rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
  border: 1px solid rgba(72, 187, 255, 0.2);
  font-weight: 600;
}

.stat-card i {
  font-size: 1.2rem;
  color: #4cbbff;
}

/* flashcard 3D flip */
.flashcard-wrapper {
  perspective: 1600px;
  margin-bottom: 1.8rem;
  cursor: pointer;
}

.flashcard {
  background: linear-gradient(145deg, rgba(25, 40, 75, 0.95), rgba(15, 28, 55, 0.98));
  border-radius: 2rem;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 25px 40px -15px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(90, 180, 255, 0.5);
  transition: transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  position: relative;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  backface-visibility: hidden;
  width: 100%;
  padding: 2rem 1.8rem;
  border-radius: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 420px;
}

.card-front {
  transform: rotateY(0deg);
}

.card-back {
  transform: rotateY(180deg);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(145deg, rgba(30, 55, 95, 0.98), rgba(20, 38, 70, 0.98));
}

.question-text {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  background: linear-gradient(120deg, #ffffff, #b8dcff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.3;
}

.answer-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: #b8ffb0;
  margin-bottom: 1rem;
  text-shadow: 0 0 8px rgba(100,255,100,0.2);
}

.explanation-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 1rem;
  padding: 1rem;
  margin: 0.8rem 0;
  text-align: left;
  border-left: 3px solid #4cbbff;
}

.explanation-box p, .usage-box p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #c9e0ff;
  margin-top: 5px;
}

.usage-box {
  background: rgba(0, 20, 40, 0.6);
  border-radius: 1rem;
  padding: 0.9rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  text-align: left;
  border: 1px solid rgba(100, 180, 255, 0.3);
}

.category-badge {
  display: inline-block;
  background: linear-gradient(135deg, #1e3a5f, #0f2a48);
  padding: 0.35rem 1rem;
  border-radius: 40px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 1rem;
  width: fit-content;
  align-self: center;
  color: #9fc9ff;
}

.flip-hint {
  margin-top: 1rem;
  font-size: 0.7rem;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

/* navigation */
.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin: 1.5rem 0 1rem;
  flex-wrap: wrap;
}

.btn-nav {
  background: linear-gradient(135deg, rgba(35, 65, 105, 0.9), rgba(20, 45, 80, 0.9));
  border: none;
  backdrop-filter: blur(8px);
  padding: 0.7rem 1.8rem;
  border-radius: 60px;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid rgba(80, 180, 255, 0.5);
}

.btn-nav:hover {
  background: #2f6eb3;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 160, 255, 0.3);
}

.action-group {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.btn-action {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #2c5a8c;
  padding: 0.5rem 1.2rem;
  border-radius: 40px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #cce4ff;
}

.btn-action:hover {
  background: #2b4b78;
  transform: translateY(-1px);
  border-color: #88ccff;
}

.progress-message {
  text-align: center;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  width: fit-content;
  margin: 0.8rem auto 0;
  padding: 0.3rem 1.2rem;
  border-radius: 60px;
}

footer {
  text-align: center;
  font-size: 0.65rem;
  margin-top: 1.5rem;
  opacity: 0.6;
}

@media (max-width: 650px) {
  .game-container { padding: 1rem; }
  .question-text { font-size: 1.3rem; }
  .answer-text { font-size: 1.1rem; }
  .card-front, .card-back { padding: 1.3rem; min-height: 380px; }
  .flashcard { min-height: 380px; }
  .stat-card { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
  .brand h1 { font-size: 1.3rem; }
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.flashcard-wrapper {
  animation: fadeSlide 0.4s ease-out;
}

button:active {
  transform: scale(0.97);
}