/* Matter.js Demo Styles */

.matter-demo-wrapper {
  position: relative;
  width: 94%;
  max-width: 800px;
  margin: 12px auto 37px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(to bottom, #208775, #61d0d4);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.12);
}

/* Dark mode wrapper */
@media (prefers-color-scheme: dark) {
  .matter-demo-wrapper {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }
}

/* Mobile responsive */
@media screen and (max-width: 720px) {
  .matter-demo-wrapper {
    width: 100%;
    margin: 12px auto 37px;
  }
}

.matter-demo-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.matter-demo-select {
  padding: 10px 36px 10px 14px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  color: rgba(0, 0, 0, 0.72);
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232e2e2e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}

.matter-demo-select:hover {
  border-color: rgba(0, 0, 0, 0.3);
}

.matter-demo-select:focus {
  box-shadow: 0 0 0 2px #007aff;
  outline: 1px solid #fff;
  outline-offset: 2px;
}

.matter-demo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  color: rgba(0, 0, 0, 0.72);
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  cursor: pointer;
}

.matter-demo-btn:hover {
  border-color: rgba(0, 0, 0, 0.3);
}

.matter-demo-btn:active {
  background: #f0f0f0;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .matter-demo-select {
    color: #dfdfdf;
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23dfdfdf' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
  }

  .matter-demo-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
  }

  .matter-demo-select:focus {
    box-shadow: 0 0 0 2px #007aff;
    outline: 1px solid #fff;
    outline-offset: 2px;
  }

  .matter-demo-btn {
    color: #dfdfdf;
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.15);
  }

  .matter-demo-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
  }

  .matter-demo-btn:active {
    background: #222;
  }
}

.matter-demo-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 600;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.matter-demo-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y pinch-zoom;
}
