/* 見本1の3D表示（.v3d の中だけに効く）。色の変数は呼び出し側のページで定義する */
.v3d {
  --stage-top: #fbfcfe;
  --stage-bottom: #e3e8f0;
}
.v3d .grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.v3d .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.v3d .stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: linear-gradient(var(--stage-top), var(--stage-bottom));
}
.v3d .stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.v3d .badge {
  position: absolute;
  left: 12px;
  top: 12px;
  font-size: 12px;
  background: color-mix(in srgb, var(--card) 85%, transparent);
  border: 1px solid var(--line);
  padding: 2px 10px;
  border-radius: 999px;
  pointer-events: none;
}
.v3d .caption {
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 14px;
  min-height: 3.6em;
}
.v3d .caption b {
  color: var(--accent-ink);
}
.v3d .loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}
.v3d .bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  align-items: center;
}
.v3d button {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  min-height: 40px;
}
.v3d button:hover {
  border-color: var(--accent);
}
.v3d button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
.v3d button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.v3d button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.v3d .hint {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
.v3d .steps {
  padding: 14px;
}
.v3d .steps h3 {
  font-size: 15px;
  margin: 0 0 4px;
}
.v3d .steps p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
}
.v3d ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.v3d ol button {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: center;
}
.v3d .num {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.v3d ol button[aria-pressed="true"] .num {
  background: var(--accent);
  color: #fff;
}
.v3d .note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
@media (max-width: 820px) {
  .v3d .grid {
    grid-template-columns: 1fr;
  }
  .v3d .stage {
    aspect-ratio: 4/3.4;
  }
  .v3d .hint {
    margin-left: 0;
    width: 100%;
  }
}
