:root {
  --gradient-start: #f8f9fa;
  --gradient-end: #e9ecef;
  --color-safe: #198754;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --char-safe-bg: #e8f5e9;
  --char-danger-bg: #fdecea;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  background: linear-gradient(170deg, var(--gradient-start), var(--gradient-end));
  min-height: 100vh;
}

.app-header {
  background-color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid #dee2e6;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.display-4.fw-bold {
    color: #212529;
}

#main-card {
  transition: all 0.3s ease-in-out;
}

.drop-zone {
  border: 2px dashed #ced4da;
  border-radius: .5rem;
  color: #6c757d;
  background-color: #fff;
  transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.drop-zone.dragover {
  background-color: #e9ecef;
  border-color: #0d6efd;
}

.drop-zone:hover {
  cursor: pointer;
  background-color: #f1f3f5;
}

/* --- New Character & Story Styles --- */

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

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

#story-view .character-area {
  animation: popIn 0.5s ease-out forwards;
}

.character-image-container {
  display: inline-block;
  margin-bottom: 1.5rem;
  /* padding, border-radius, and background-color are removed to eliminate the frame */
}

.character-image {
  width: 240px;
  height: 240px;
  object-fit: contain; /* Ensure the whole image is visible */
  /* border-radius is removed to show the original shape */
  display: block;
}

.character-image-container.mood-safe {
  /* No background color */
}

.character-image-container.mood-danger {
  animation: shake 0.5s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.character-image-container.mood-warning {
  animation: pulse 2s infinite ease-in-out;
}

.speech-bubble {
  position: relative;
  background: #ffffff;
  border-radius: .4em;
  padding: 1.5rem;
  border: 1px solid #dee2e6;
  animation: fadeIn 0.5s ease-out 0.2s forwards;
  opacity: 0;
}

.speech-bubble:after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  border: 20px solid transparent;
  border-bottom-color: #ffffff;
  border-top: 0;
  border-left: 0;
  margin-left: -10px;
  margin-top: -20px;
}

/* --- Expert View Styles (for consistency) --- */
#expert-view .anatomy-container {
    border: 1px solid #dee2e6;
    border-radius: .5rem;
}

#expert-view .anatomy-item {
    background-color: #fff;
    transition: background-color 0.2s;
}

#expert-view .anatomy-item:hover {
    background-color: #f8f9fa;
}