/* css/game-craft.css */

.craft-game-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  font-family: 'Prompt', sans-serif;
  color: white;
}

.craft-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  border-bottom: 2px solid #0f766e;
}

.craft-score-board {
  display: flex;
  gap: 20px;
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.craft-canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background-color: #4ade80; /* Grass color base */
  display: flex;
  justify-content: center;
  align-items: center;
}

#craft-canvas {
  width: 100%;
  height: 100%;
  display: block;
  /* Pixel art rendering */
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.craft-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 10;
}

.craft-overlay h2 {
  color: #5eead4;
  margin-bottom: 20px;
  font-size: 2rem;
}

.craft-instruction {
  background: rgba(255,255,255,0.1);
  padding: 15px 30px;
  border-radius: 8px;
  margin-bottom: 25px;
  text-align: left;
}

.craft-instruction ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.craft-instruction li {
  margin: 10px 0;
  font-size: 1.1rem;
}

.craft-quiz-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  background: white;
  color: #1e293b;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 20;
  display: none;
}

.craft-quiz-question {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: #0f172a;
}

.craft-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.craft-btn-option {
  padding: 12px;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #334155;
}

.craft-btn-option:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.craft-btn-option.correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}

.craft-btn-option.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

/* Mobile Controls */
.craft-mobile-controls {
  display: none;
  background: #0f172a;
  padding: 15px;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {
  .craft-mobile-controls {
    display: flex;
  }
}

.d-pad {
  display: grid;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 5px;
}

.d-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: white;
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.d-btn:active { background: rgba(255,255,255,0.3); }

.d-up { grid-column: 2; grid-row: 1; }
.d-left { grid-column: 1; grid-row: 2; }
.d-right { grid-column: 3; grid-row: 2; }
.d-down { grid-column: 2; grid-row: 3; }

.action-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #14b8a6;
  border: 2px solid #0d9488;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 4px 0 #0f766e;
  cursor: pointer;
  user-select: none;
}
.action-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #0f766e;
}
