:root {
  --color-primary: #3B82F6;
  --color-primary-dark: #1E40AF;
  --color-secondary: #10B981;
  --color-accent: #F59E0B;
  --color-danger: #EF4444;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-dark: #1F2937;
  --color-light: #F9FAFB;
  --screen-transition: 0.4s;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Inter', sans-serif;
  height: 100vh;
  overflow: hidden;
}

.font-geist-mono {
  font-family: monospace;
}

/* Screen Management */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow-y: auto;
  transition: transform var(--screen-transition), opacity var(--screen-transition);
  transform: translateY(20px);
  opacity: 0;
}

.screen.active {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

/* Welcome Screen */
.difficulty-btn {
  background-color: #F3F4F6;
  transition: all 0.2s;
}

.difficulty-btn:hover {
  background-color: #E5E7EB;
}

.difficulty-btn.active {
  background-color: var(--color-primary);
  color: white;
}

/* Game Screen */
.game-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: white;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-progress {
  flex-grow: 1;
  margin: 0 24px;
}

.progress-track {
  height: 8px;
  background-color: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}

.progress-fill {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-stats {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  font-size: 0.875rem;
  color: #6B7280;
}

.game-score {
  font-weight: 600;
}

.level-badge {
  background-color: var(--color-primary-dark);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.rank-badge {
  background-color: var(--color-accent);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.game-scene {
  position: relative;
  height: 40vh;
  background-color: #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.scene-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: background-image 1s ease-in-out;
}

.character {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 80px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: all 0.5s ease;
}

.key-container {
  position: absolute;
  width: 100%;
  height: 100%;
}

.key {
  position: absolute;
  width: 30px;
  height: 30px;
  background-size: contain;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: all 0.3s ease;
}

.key:hover {
  transform: scale(1.1);
}

.question-container {
  background-color: white;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--color-primary-dark);
  color: white;
}

.question-category {
  font-weight: 600;
  font-size: 0.875rem;
}

.timer {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.question-content {
  padding: 20px;
}

.question-content h3 {
  margin-bottom: 16px;
  font-size: 1.125rem;
}

.options-container {
  display: grid;
  gap: 12px;
}

.option {
  padding: 12px 16px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.option:hover {
  border-color: var(--color-primary);
  background-color: rgba(59, 130, 246, 0.05);
}

.option.selected {
  border-color: var(--color-primary);
  background-color: rgba(59, 130, 246, 0.1);
  font-weight: 500;
}

.option.correct {
  border-color: var(--color-success);
  background-color: rgba(16, 185, 129, 0.1);
}

.option.wrong {
  border-color: var(--color-danger);
  background-color: rgba(239, 68, 68, 0.1);
}

.option-marker {
  margin-right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #F3F4F6;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.option.selected .option-marker {
  background-color: var(--color-primary);
  color: white;
}

.question-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid #E5E7EB;
}

.hint-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.hint-btn:disabled {
  color: #9CA3AF;
  cursor: not-allowed;
}

.hint-cost {
  font-size: 0.75rem;
  color: #F59E0B;
}

.submit-btn {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.submit-btn:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
}

.submit-btn:disabled {
  background-color: #9CA3AF;
  cursor: not-allowed;
}

/* Results Screen */
.results-container {
  max-width: 600px;
  margin: 20px auto 80px;
  background-color: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.results-header {
  background-color: var(--color-primary-dark);
  color: white;
  padding: 20px;
  text-align: center;
}

.results-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.results-content {
  padding: 20px;
}

.player-results {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #E5E7EB;
}

.player-avatar {
  margin-right: 16px;
}

.avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
}

.player-stats h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.badge-container {
  display: flex;
  gap: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  background-color: #F9FAFB;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--color-primary-dark);
}

.stat-label {
  font-size: 0.875rem;
  color: #6B7280;
}

.achievements {
  margin-bottom: 24px;
}

.achievements h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.achievements-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.achievement-badge {
  background-color: #F3F4F6;
  color: #4B5563;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.achievement-badge i {
  color: var(--color-accent);
}

.results-footer {
  background-color: #F9FAFB;
  padding: 20px;
  border-top: 1px solid #E5E7EB;
}

.share-container h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.share-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.share-btn {
  background-color: #E5E7EB;
  color: #4B5563;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.share-btn:hover {
  background-color: #D1D5DB;
}

.share-btn.wechat {
  background-color: #07C160;
  color: white;
}

.share-btn.wechat:hover {
  background-color: #06b057;
}

.share-btn.moments {
  background-color: #576B95;
  color: white;
}

.share-btn.moments:hover {
  background-color: #4d5f82;
}

.share-btn.weibo {
  background-color: #E6162D;
  color: white;
}

.share-btn.weibo:hover {
  background-color: #cf142b;
}

.play-again-btn {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  width: 100%;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.play-again-btn:hover {
  background-color: var(--color-primary-dark);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .game-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .game-progress {
    width: 100%;
    margin: 8px 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
