/* ManiRush skin & embedded stage styling for Island Voxels Builder */

.voxel-shell {
  max-width: 980px;
}

/* Clear guided mission checklist banner above canvas */
.mission-bar {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(28, 39, 82, 0.96), rgba(16, 24, 56, 0.96));
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mission-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.mission-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--yellow);
}

.mission-desc {
  font-size: 0.84rem;
  color: var(--muted);
}

.mission-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 216, 77, 0.55);
  background: rgba(255, 216, 77, 0.14);
  color: #fff8dc;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.task-pill:hover {
  transform: translateY(-1px);
  border-color: var(--yellow);
  background: rgba(255, 216, 77, 0.24);
}

.task-pill.done {
  border-color: var(--green);
  background: rgba(57, 255, 110, 0.2);
  color: var(--green);
}

/* Floating 360 compass pill inside stage */
.stage-compass {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 16;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(27, 91, 168, 0.35);
  background: rgba(251, 246, 236, 0.94);
  color: #1b5ba8;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
  touch-action: manipulation;
}

.stage-compass:hover {
  background: #ffffff;
  border-color: #1b5ba8;
}

/* Level complete auto-advance celebration modal inside stage */
.level-modal {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(7, 11, 26, 0.72);
  backdrop-filter: blur(5px);
}

.level-modal[hidden] {
  display: none;
}

.level-modal-card {
  width: min(390px, 100%);
  padding: 24px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #162147 0%, #0d1430 100%);
  border: 2px solid var(--green);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.level-modal-card h2 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  color: var(--green);
}

.level-modal-card p {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.92rem;
}

.level-modal-count {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--yellow);
  font-size: 0.95rem;
}

.level-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.pan-group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.pan-btn {
  min-width: 34px;
  min-height: 36px;
  padding: 4px 8px;
  font-size: 0.85rem;
}

.voxel-stage {
  position: relative;
  width: 100%;
  height: clamp(360px, 56vh, 540px);
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(56, 189, 248, 0.35);
  background: radial-gradient(ellipse at 50% 30%, #fbf6ec 0%, #f0e7d2 60%, #e3d6ba 100%);
  box-shadow: inset 0 2px 12px rgba(15, 23, 42, 0.14);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* Loading overlay scoped inside stage */
#loading-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: linear-gradient(180deg, #f6efe1 0%, #e8dcc1 100%);
}
#loading-screen.hidden {
  display: none;
}

.loading-card {
  background: #fbf6ec;
  color: #2b2a26;
  border-radius: 20px;
  padding: 26px 30px;
  box-shadow: 0 18px 42px rgba(43, 42, 38, 0.18);
  text-align: center;
  width: min(340px, 100%);
}

.loading-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1b5ba8;
}

.loading-sub {
  color: #6b675b;
  margin-top: 4px;
  font-size: 0.85rem;
}

.loading-bar {
  margin-top: 16px;
  height: 7px;
  width: 100%;
  background: #e7decb;
  border-radius: 999px;
  overflow: hidden;
}

.loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1b5ba8, #38bdf8);
  transition: width 0.15s ease;
}

.loading-status {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #6b675b;
  font-weight: 600;
}

/* Floating left tool rail inside stage */
#toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 6px;
  background: rgba(251, 246, 236, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  border: 1px solid rgba(27, 91, 168, 0.14);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.tool {
  width: 54px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #3f3d36;
  font: inherit;
  touch-action: manipulation;
  transition: background 0.14s ease, color 0.14s ease, transform 0.08s ease;
}

.tool:hover {
  background: #ede4d2;
}

.tool:active {
  transform: scale(0.96);
}

.tool.active {
  background: #d6e6f6;
  color: #1b5ba8;
}

.tool .ti {
  width: 28px;
  height: 28px;
  display: block;
}

.tool span.label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

/* Floating top-right visual toggles inside stage */
.stage-toggles {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(251, 246, 236, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  border: 1px solid rgba(27, 91, 168, 0.14);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  color: #2b2a26;
  font-size: 0.78rem;
  font-weight: 700;
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(27, 91, 168, 0.12);
}

.hud-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1b5ba8;
  font-weight: 800;
}

.sun-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}

.hud-toggles {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.toggle input {
  accent-color: #1b5ba8;
  cursor: pointer;
}

/* Toast inside stage */
#toast {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translate(-50%, -14px);
  padding: 7px 14px;
  background: rgba(11, 16, 36, 0.92);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Quick camera & flip bar below stage */
.voxel-quickbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.active-piece-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.active-piece-badge strong {
  color: var(--yellow);
  font-family: 'Outfit', sans-serif;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-compact {
  padding: 7px 12px;
  font-size: 0.84rem;
  border-radius: 10px;
}

/* Asset palette cleanly integrated below stage */
.voxel-palette {
  margin-top: 12px;
  background: #0d1430;
  border: 1.5px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 10px;
}

#palette-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tab {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  touch-action: manipulation;
}

.tab.active {
  background: linear-gradient(135deg, var(--yellow), #f59e0b);
  color: #0b1024;
  border-color: var(--yellow);
}

#palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}

.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 4px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, border-color 0.14s ease, background 0.14s ease;
}

.swatch:hover {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
}

.swatch.selected {
  border-color: var(--green);
  background: rgba(57, 255, 110, 0.16);
  box-shadow: 0 0 0 2px rgba(57, 255, 110, 0.28);
}

.swatch canvas {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.swatch .name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

/* Controls & CraftNG cross-promo */
.controls-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.craftng-promo {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 92, 168, 0.14), rgba(56, 189, 248, 0.14));
  border: 1px solid rgba(255, 92, 168, 0.35);
}

.craftng-promo-copy {
  font-size: 0.88rem;
  color: #e2e8f0;
}

.craftng-promo-copy strong {
  color: var(--yellow);
}

@media (max-width: 640px) {
  .voxel-stage {
    height: 360px;
  }

  #toolbar {
    top: 8px;
    left: 8px;
    padding: 5px 4px;
    gap: 3px;
  }

  .tool {
    width: 42px;
    padding: 5px 3px;
  }

  .tool .ti {
    width: 24px;
    height: 24px;
  }

  .tool span.label {
    display: none;
  }

  .stage-toggles {
    top: 8px;
    right: 8px;
    padding: 7px 9px;
    font-size: 0.72rem;
  }

  #palette-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    max-height: 185px;
  }
}
