* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
}

.container {
  width: 100%;
  max-width: 500px;
  padding: 20px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Menu Screen */
#menu {
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #e94560;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  font-size: 1.1rem;
  color: #a0a0a0;
  margin-bottom: 2rem;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.menu-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.menu-btn:hover {
  background: rgba(233, 69, 96, 0.2);
  border-color: #e94560;
  transform: translateY(-2px);
}

.btn-label {
  font-size: 1.8rem;
  font-weight: bold;
}

.btn-desc {
  font-size: 0.9rem;
  color: #a0a0a0;
}

.card-count {
  color: #666;
  font-size: 0.9rem;
}

/* Flashcard Screen */
#flashcard {
  text-align: center;
}

.card {
  perspective: 1000px;
  margin-bottom: 2rem;
}

.card-inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

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

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  min-height: 280px;
  backface-visibility: hidden;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

.card-label {
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.card-text {
  color: #1a1a2e;
  font-size: 2.5rem;
  font-weight: bold;
  word-break: break-word;
}

.pinyin {
  font-size: 1.8rem;
  color: #e94560;
  margin-bottom: 0.5rem;
}

.english {
  font-size: 1.3rem;
  color: #333;
  font-weight: normal;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.control-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn.primary {
  background: #e94560;
  color: white;
}

.control-btn.primary:hover {
  background: #d63651;
  transform: scale(1.02);
}

.control-btn.secondary {
  background: transparent;
  color: #a0a0a0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.control-btn.secondary:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.hidden {
  display: none;
}

.progress {
  font-size: 1rem;
  color: #a0a0a0;
}

/* Responsive */
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .card-front,
  .card-back {
    min-height: 240px;
    padding: 1.5rem;
  }

  .card-text {
    font-size: 2rem;
  }

  .pinyin {
    font-size: 1.5rem;
  }

  .english {
    font-size: 1.1rem;
  }
}
