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

:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --success-color: #10b981;
  --error-color: #ef4444;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem;
}

.header {
  text-align: center;
  margin-bottom: 0.75rem;
}

.header h1 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.level-info {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.main-content {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: var(--shadow-lg);
}

.statement-section {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: #f1f5f9;
  border-radius: 6px;
  border-left: 3px solid var(--primary-color);
}

.statement {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.puzzle-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.questions-column,
.options-column {
  min-height: auto;
}

.questions-column h2,
.options-column h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.25rem;
}

.questions-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.options-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

@media (min-width: 768px) {
  .questions-list {
    grid-template-columns: repeat(4, 1fr);
  }
  .options-list {
    grid-template-columns: repeat(6, 1fr);
  }
}

.question-item {
  padding: 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: var(--card-bg);
  min-height: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.question-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pokemon-sprite {
  max-width: 60px;
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.drop-zone {
  min-height: 32px;
  padding: 0.35rem;
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.drop-zone.drag-over {
  border-color: var(--primary-color);
  background: #dbeafe;
}

.drop-zone.filled {
  background: #e0f2fe;
  border-style: solid;
  border-color: var(--primary-color);
}

.drop-zone.selected {
  border-color: #10b981;
  background: #d1fae5;
  border-width: 2px;
  border-style: solid;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.option-item {
  padding: 0.4rem 0.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 4px;
  cursor: grab;
  user-select: none;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  font-size: 0.75rem;
}

.option-item:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.option-item:active {
  cursor: grabbing;
}

.option-item.dragging {
  opacity: 0.5;
}

.option-item.used {
  opacity: 0.3;
  cursor: not-allowed;
}

.option-item.selected {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  transform: scale(1.05);
}

.pokemon-name {
  font-weight: 600;
  text-align: center;
  display: block;
  font-size: 0.7rem;
  line-height: 1.2;
}

.controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #64748b;
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.message {
  padding: 0.5rem;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  margin-top: 0.5rem;
  display: none;
  font-size: 0.875rem;
}

.message.show {
  display: block;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
  border: 2px solid var(--success-color);
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 2px solid var(--error-color);
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* Animation for correct answers */
@keyframes success-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.success-animation {
  animation: success-pulse 0.5s ease;
}

.gem-sprite {
  max-width: 100px;
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
  margin: 0 auto;
}

/* Level 3 - River Crossing Puzzle Styles */
.river-crossing {
  width: 100%;
}

.time-display {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.75rem;
  background: #dbeafe;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 2px solid var(--primary-color);
  transition: all 0.3s;
}

.time-display.hours-over {
  background: #fee2e2;
  border-color: var(--error-color);
  color: var(--error-color);
  animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.crossing-area {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 768px) {
  .crossing-area {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.side {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  min-height: 300px;
}

.side h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  text-align: center;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.boat-indicator {
  font-size: 0.75rem;
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  animation: boat-pulse 2s ease-in-out infinite;
}

@keyframes boat-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.side.boat-here {
  border-color: var(--primary-color);
  border-width: 3px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.left-side {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.right-side {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.characters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.character {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.character:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.character:active {
  transform: translateY(0);
}

.char-sprite {
  width: 60px;
  height: 60px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.char-sprite-small {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.char-info {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.char-info-small {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-color);
  color: white;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  text-align: center;
}

.river-section {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #bfdbfe 0%, #93c5fd 50%, #60a5fa 100%);
  border-radius: 8px;
  padding: 1rem;
  min-height: 300px;
  position: relative;
}

.boat {
  background: #92400e;
  border: 3px solid #78350f;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  transition: all 0.5s ease;
}

.left-boat {
  transform: translateX(-10px);
}

.right-boat {
  transform: translateX(10px);
}

.boat-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  color: white;
  margin-bottom: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  border-radius: 6px;
}

.boat-seats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.boat-passenger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  justify-content: center;
}

.boat-passenger:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.05);
}

.boat-seat-empty {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-style: italic;
}

.btn-cross {
  width: 100%;
  font-size: 0.875rem;
  padding: 0.75rem;
  background: var(--success-color);
  transition: all 0.3s;
}

.btn-cross:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-2px);
}

.btn-cross:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-cross:disabled:hover {
  transform: none;
  box-shadow: var(--shadow);
}

/* Level 4 - Final Screen Styles */
.final-screen {
  text-align: center;
  padding: 2rem 1rem;
}

.congratulations-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 3px solid #f59e0b;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  animation: celebration 1s ease-in-out;
}

@keyframes celebration {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.05) rotate(1deg);
  }
  75% {
    transform: scale(1.05) rotate(-1deg);
  }
}

.congratulations-banner h2 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.congratulations-banner p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.codes-section {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.codes-section h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

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

.code-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f1f5f9;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.code-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.code-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  min-width: 60px;
  text-align: center;
  box-shadow: var(--shadow);
}

.final-code {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border: 3px solid var(--success-color);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
}

.final-code h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.final-code-value {
  font-size: 3rem;
  font-weight: 900;
  color: var(--success-color);
  background: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  display: inline-block;
  box-shadow: var(--shadow-lg);
  letter-spacing: 0.5rem;
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
  }
}

.pokemon-showcase {
  margin: 2rem 0;
}

.pokemon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .pokemon-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 600px;
  }
}

.final-pokemon {
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  animation: float 3s ease-in-out infinite;
}

.final-pokemon:nth-child(1) {
  animation-delay: 0s;
}

.final-pokemon:nth-child(2) {
  animation-delay: 0.5s;
}

.final-pokemon:nth-child(3) {
  animation-delay: 1s;
}

.final-pokemon:nth-child(4) {
  animation-delay: 1.5s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.final-pokemon:hover {
  transform: scale(1.2) translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.thank-you {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-radius: 8px;
}

.thank-you p {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}