@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --bg: #0d0d1a;
  --panel: #16162a;
  --accent: #7c3aed;
  --accent-soft: #7c3aed33;
  --text: #f0f0f5;
  --text-dim: #9a9ab0;
  --border: #2a2a44;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  min-height: 100vh;
}

header {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0 0 6px;
  font-size: clamp(20px, 4vw, 28px);
  background: linear-gradient(90deg, var(--accent), #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}

nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  transition: border-color 0.2s, background 0.2s;
}

nav a:hover, nav a.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
  font-size: 17px;
}

.card p.hint {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone input { display: none; }

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.1s;
}

button:hover { opacity: 0.9; }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.preview-img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
  margin-top: 14px;
}

.status {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dim);
  min-height: 18px;
}

.status.error { color: #f87171; }
.status.ok { color: #34d399; }

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

model-viewer {
  width: 100%;
  height: 420px;
  border-radius: 12px;
  background: #08081280;
  margin-top: 16px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.viewer-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: min(70vh, 620px);
}

.viewer-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.viewer-wrap.chroma { background: #00ff00; }
.viewer-wrap.transparent { background: repeating-conic-gradient(#20203a 0% 25%, #14142a 0% 50%) 50% / 20px 20px; }

.toggle-group {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #c4b5fd;
  margin-left: 6px;
}

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding: 20px;
}
