* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6a5acd;
  --secondary: #9370db;
  --accent: #ff69b4;
  --dark: #2c2c54;
  --light: #f7f7ff;
  --success: #4caf50;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
}

body {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
}

.container {
  max-width: 1300px;
  width: 100%;
  margin: 20px auto;
  padding: 20px;
  color: var(--light);
  min-height: 100vh;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(44, 44, 84, 0.7);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
  font-size: 2rem;
  margin-bottom: 15px;
  background: linear-gradient(45deg, var(--accent), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.1rem;
  color: #d3d3e7;
  margin: 20px auto;
  line-height: 1.6;
  text-align: center;
}

.game-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}

.stats-panel {
  background: rgba(44, 44, 84, 0.7);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.character-info {
  text-align: center;
  margin-bottom: 30px;
}

.avatar {
  width: 120px;
  height: 120px;
  background: linear-gradient(45deg, var(--secondary), var(--accent));
  border-radius: 50%;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.age-display {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 5px;
  color: var(--accent);
}

.name-display {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.stat {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  align-items: center;
}

.stat-icon {
  font-size: 1.8rem;
  margin-right: 15px;
  width: 40px;
  text-align: center;
}

.stat-info {
  flex: 1;
}

.stat-name {
  font-size: 1rem;
  margin-bottom: 5px;
  color: #b8b8d9;
}

.stat-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.stat-value {
  height: 100%;
  border-radius: 5px;
}

.health .stat-value {
  background: var(--success);
}

.intelligence .stat-value {
  background: var(--info);
}

.charm .stat-value {
  background: var(--accent);
}

.wealth .stat-value {
  background: var(--warning);
}

.happiness .stat-value {
  background: var(--primary);
}

.stat-number {
  font-size: 1.2rem;
  font-weight: bold;
  margin-left: 10px;
  min-width: 40px;
  text-align: right;
}

.event-panel {
  background: rgba(44, 44, 84, 0.7);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.year-display {
  font-size: 1.5rem;
  font-weight: bold;
}

.life-stage {
  background: var(--secondary);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.event-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 0;
}

.event-text {
  font-size: 1.4rem;
  line-height: 1.6;
  margin-bottom: 40px;
  text-align: center;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.choice {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 15px;
  padding: 20px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.choice:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.choice:active {
  transform: translateY(0);
}

.actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.btn {
  padding: 12px 30px;
  border-radius: 50px;
  border: none;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.achievements {
  margin-top: 30px;
  background: rgba(44, 44, 84, 0.7);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.achievements-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  text-align: center;
  color: var(--accent);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.achievement {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  padding: 15px;
  text-align: center;
  opacity: 0.5;
}

.achievement.unlocked {
  opacity: 1;
  background: rgba(106, 90, 205, 0.3);
  border: 1px solid var(--primary);
}

.achievement-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.achievement-name {
  font-size: 1rem;
  margin-bottom: 5px;
}

.achievement-desc {
  font-size: 0.8rem;
  color: #b8b8d9;
}

.life-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin-top: 20px;
  overflow: hidden;
}

.life-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  width: 0%;
  transition: width 0.01s ease;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: linear-gradient(135deg, #2c2c54, #1a1a2e);
  border-radius: 20px;
  padding: 40px;
  width: 80%;
  max-width: 700px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--accent);
}

.modal-text {
  font-size: 1.4rem;
  line-height: 1.6;
  margin-bottom: 30px;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.modal-stat {
  background: rgba(255, 255, 255, 0.08);
  padding: 15px;
  border-radius: 12px;
  font-size: 1.2rem;
}

.modal-stat span {
  color: var(--accent);
  font-weight: bold;
}

.end-life-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  color: var(--accent);
}

.new-life-btn {
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: white;
  padding: 15px 40px;
  font-size: 1.3rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.new-life-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(106, 90, 205, 0.5);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes fadeUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-30px);
  }
}

.achievement-progress {
  font-size: 0.7rem;
  color: #9370db;
  margin-top: 5px;
}

 @keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
